A kind of electronic document display method
Technical field
The present invention relates to the display technique field, relate in particular to a kind of electronic document display method.
Background technology
E-book reader (e-book device, e-book reader) is a kind of instrument of browsing e-book, and the size of its screen has determined singly to shield and shown what of number of words.The technology that is applied to the E-book reader screen has display techniques such as electronic paper technology (electronic ink technologies) and LCD.
Will get well though adopt the E-book reader of electronic paper technology to compare traditional lcd screen for the reading experience of electronic document, such equipment also has some very serious weakness: do not have back lighting, can not round-the-clockly use; The screen refresh rate of electric ink screen is very low, is not suitable as video player.Though this causes E-book reader price height, volume is big, and component is not light yet, can not replace mobile phone, MID (mobile internet device), panel computer etc. to become Full Featured personal data recreation center equipment.On the other hand, equipment such as panel computer, giant-screen mobile phone and MID, as the document reading tool, because screen relies on backlight, make the visual effect of text reading and paper reading that clearly gap be arranged, have much room for improvement in experience, and traditional mobile communication equipments such as panel computer and mobile phone LCD screen that have back lighting of using more, the perhaps self luminous OLED technology of liquid crystal screen, required power consumption all the time in the document reading process causes stand-by time to be significantly less than e-book.
But battery technology is also in continuous progress.The physical size of battery and capacity are all improving.And, if other equipment of the same size of E-book reader of contrast and use electric ink screen do not have the microminiature mobile communication equipment harsh like that to the restriction of battery capacity and size like that on the profile specification in fact.So, realize the repertoire of E-book reader at the mobile device of using LCDs, the obstacle that can not break through not, even certain cost and the advantage of scale are arranged.On the other hand, in the market can be with E-book reader competition, use the small type mobile devices of LCDs, their Core Feature still comprises the amusement function of video and recreation etc.This class function is emphasized the brightness of screen, color fidelity etc. again very much.And too bright screen though the expressive force that video file is play has lifting, can make beholder's eyes feel tired rapidly.
Therefore, be necessary existing light-emitting display apparatus is carried out function optimization, improve it to the display capabilities of electronic document, so that the user to be provided better reading experience.
Summary of the invention
The object of the present invention is to provide a kind of electronic document display method, improve existing light-emitting display apparatus to the display capabilities of electronic document.
Technical scheme of the present invention is as follows:
A kind of electronic document display method may further comprise the steps:
A, image of electronic document is converted to gray-scale map, buffer memory is also sampled;
The intensity profile of B, statistic sampling gained pixel generates the statistics array;
Average gray in C, the counting statistics array;
D, statistical average gray scale pixel distribution at two sides are also judged the gray scale of both sides and the corresponding relation of foreground and background colour; With
E, in original image, use pre-set replaced color, replace foreground and background colour in the original image respectively with different replaced color.
Described electronic document display method, wherein, in described steps A, the original image with electronic document converts gray-scale map and buffer memory to earlier, chooses sample area with certain proportion again in the viewing area of image and samples.
Described electronic document display method wherein, in described steps A, is chosen sample area with certain proportion earlier the original image of electronic document is sampled in the viewing area of image, the original image with electronic document converts gray-scale map and buffer memory to again.
Described electronic document display method, wherein, the ratio that the area of described sample area accounts for described viewing area is at least 20%.
Described electronic document display method, wherein, described sample area be a plurality of and its area summation account for described equipment the viewing area 20%.
Described electronic document display method wherein, is characterized in that: described step D further may further comprise the steps:
D1, in the statistics array, be the boundary with the average gray, gray scale corresponding in the statistics array is calculated summation respectively greater than average gray with less than the numerical value of the array part of average gray, obtain than first sum of the saturate pixel of average gray with than second sum of the light-colored pixel of average gray; With
The numerical values recited of D2, comparison first sum and second sum, wherein the correspondence that numerical value is bigger is background colour, a less correspondence be foreground.
Described electronic document display method, wherein, described step D is further comprising the steps of:
D3, respectively corresponding gray scale in the statistics array is partly calculated average gray greater than average gray with less than the array of average gray, obtain first average gray value and second average gray value of corresponding first sum and second sum respectively;
A less corresponding mean pixel number of numerical value in D4, calculating first sum and second sum;
D5, all pixel counts in the original image counted the N corresponding pixel of gray scale doubly greater than mean pixel be labeled as valid pixel, less than be labeled as noise, wherein N is statistics tolerance parameter; With
D6, be benchmark with bigger corresponding first or second average gray value of numerical value in first sum and second sum, in original image, select pixel and be labeled as background pixel with certain gray scale tolerance
Described electronic document display method, wherein, in described step e, described pre-set replaced color comprises the replaced color of at least one group of corresponding foreground of difference and background colour, each group replaced color comprises the replaced color of at least one foreground.
Described electronic document display method, wherein, described step e further may further comprise the steps:
E1, with the replaced color of corresponding foreground the primary colors of all valid pixels in the original image is replaced; With
E2, with the replaced color of corresponding background colour the primary colors of all background pixels in the original image is replaced.
Described electronic document display method, wherein, described step e is further comprising the steps of: E3, with the replaced color of corresponding background colour the primary colors of all noises in the original image is replaced.
But word segment and non-legible part in the above-mentioned electronic document display method recognition image, increase the contrast of reading content and background colour, automatically adjust the overall brightness of two-part color attribute, reduction screen simultaneously, when showing electronic document, provide better reading experience for the user.
Description of drawings
Fig. 1 is the synoptic diagram of viewing area sampling in the electronic document display method of the present invention;
Fig. 2 is the intensity profile statistics synoptic diagram of a kind of electronic document in the electronic document display method of the present invention;
Fig. 3 is the intensity profile statistics synoptic diagram of another kind of electronic document in the electronic document display method of the present invention;
Fig. 4 is the process flow diagram of electronic document display method preferred embodiments of the present invention;
Fig. 5 is the intensity profile statistics synoptic diagram of sampled result in the electronic document display method preferred embodiments of the present invention;
Fig. 6 is the intensity profile statistics synoptic diagram after original image is handled in the electronic document display method preferred embodiments of the present invention;
Fig. 7 adds up synoptic diagram through the intensity profile of noise reduction after original image is handled in the electronic document display method preferred embodiments of the present invention again.
Embodiment
Below with reference to accompanying drawing, the specific embodiment of the present invention is described in detail.
The invention provides a kind of electronic document display method, word segment and non-legible part by the identification electronic document increase the contrast of font and background colour then, adjust two-part color attribute automatically, reach the purpose that improves reading experience, said method may further comprise the steps:
Step 1, equipment become gray level image and buffer memory with the data-switching of original image;
Step 2, according to the gray scale exponent number, build the array (be designated hereinafter simply as statistics array) that an array length equals the gray scale exponent number, each array member's value correspondence the counting total value of pixel on each gray scale of statistical regions;
Step 3, at random site or the predefined position sampling of device display area, as shown in Figure 1, select the sample area 1 to 5 of at least five rectangles, the area ratio of all sample area is not done particular provisions, but summation needs greater than 20% of viewing area area, this ratio is more big, and the workload that data are handled is more big, but effect may not be better;
Step 4, gray-scale value to all pixels of institute's favored area is added up, the result of statistics is stored in the above-mentioned statistics array, owing to The present invention be directed to the processing of display effect of the document of electronic document (be with the literal main also can contain image), so the statistics for the gray-scale value of the sampling of this sort of electronic document has two big class situations: for the electronic document from similar scanning shelves, the intensity profile of its pixel must meet the class normal distribution, it is the intermediate value of a statistical significance of distribution existence of numerical value, it is discrete to have certain deviation again, and depart from intermediate value point more far away, the probability that occurs is more low, as shown in Figure 2; Another kind of situation is the electronic document that comes from the text of word processor, because digitized result, the form of several " pulses " only can appear in its statistics, also namely for the font of different colors, the gray scale of the pixel of same color font correspondence must be identical, cause last statistics to concentrate on several limited gray-scale values, as shown in Figure 3, Fig. 2 and Fig. 3 have only described has only two kinds of main color gray scales 1 and gray scale 2, be the situation of character look (foreground) and background colour, this method also is applicable to the situation (color document and colorful display screen) of the document that contains the multiple font color;
The gray scale of step 5, screening background colour pixel correspondence and the gray scale of foreground pixel correspondence specifically may further comprise the steps: step a, selected gray scale intermediate value also are 1/2nd of gray scale mxm.; The statistics of step b, utilization statistics array is calculated the average gray value X of all pixels; Step c, in the statistics array, be the boundary with average gray X, respectively gray scale corresponding in the statistics array is calculated summation respectively greater than X with less than the numerical value of the array part of X, also namely calculate than the saturate pixel of average gray X total S1 (first sum) and than the total S2 (second sum) of the light-colored pixel of X; Steps d, be the boundary with average gray X, respectively corresponding gray scale in the statistics array is partly calculated average gray greater than X with less than the array of X, obtain respectively the average gray value X1 (first average gray value) corresponding with S1 and S2 and X2 (second average gray value), because in most electronic documents, the pixel count of background parts correspondence is necessarily many than occupation space such as strokes of characters even figures, so the average gray value X1 of the greater correspondence or X2 are the gray scale of background colour correspondence among S1 and the S2, gray scale B (Background hereinafter referred to as, background colour), and another is called gray scale F (foreground among X1 and the X2, foreground), the sum of all pixels that it is corresponding, namely less that quoted from hereinafter and is SF among S1 and the S2; Step e, in a side of gray scale F place statistics array, calculate mean pixel number on all gray scales, i.e. the value of SF/F; Step f, in SF with the gray scale corresponding pixel of all pixel counts greater than [N* (SF/F)], all being used as is the pixel (valid pixel) of " effectively " word segment correspondence, and obtain its corresponding gray, the last processing that in next step, these gray-scale values corresponding pixel in original image is promoted the reading experience effect, all are lower than the corresponding pixel of gray scale of this value and are used as " noise " or common pixel, it is not done any special processing, perhaps do denoising, wherein N is the statistics tolerance, is the parameter that is used for control character process color screening fine degree of a systemic presupposition;
Step 6, improve reading experience by adjusting pixel color, specifically may further comprise the steps: step a, in one or more groups background colour of system intialization and character look (foreground) group, contain a background colour and at least one character look look as an alternative in each background colour and the character colour cell; Step b, each pixel of original image is calculated gray-scale value, being substituted into all gray-scale values in the original image with default background colour is on the pixel between B+W and the B-W (background pixel), wherein W is gray scale tolerance parameter, is the parameter that a systemic presupposition control background colour is suitable for tolerant degree; Same, to the effective literal corresponding gray that filters out, can give these gray-scale values certain gray scale tolerance W equally, and can be according to the quantity of the pixel appearance that meets this gray scale and the intensity of GTG, select the character look (foreground) of system definition for use, also namely replace the primary colors of these respective pixel with the character look of system definition, in addition, to neither in the tonal range of background colour place, again not in the pixel of foreground range of application, disposal route has two kinds: if be used as noise, just all replace the primary colors of this pixel with background colour, also namely driven away noise; If be used as general pixel, can not do any processing, show by previous status.
In said method, the selection of statistics tolerance N and these two parameters of gray scale tolerance W can be adjusted according to the needs of system, and the gray scale B of background colour correspondence allows to regulate in the display device use.
Wherein, for inclined to one side background colour one side with average gray X boundary, also may exist more than one, just be the situation of the intensity profile of character correspondence, but from the angle of statistics, why these colors are overshadowed under the data of background colour, be since the ratio that they occur seldom, and its color and the own contrast of background colour too little (comparing with the color of X opposite side, more approaching apart from background colour).By the adjusting to gray scale tolerance W, can reduce the data of these pixels to the interference of background colour identifying, but there is not help to identifying these pixels, if electronic document needs very meticulous processing, algorithm to valid pixel in step 5 and the step 6 can be applied in the data of former statistics array with inclined to one side background colour one side of X boundary equally, further identify these small probability pixels.
With reference to figure 4, be the process flow diagram of electronic document display method preferred embodiments of the present invention, described electronic document display method comprises: step S1, convert original image to gray-scale map and buffer memory; Step S2, in gray-scale map, sample; The intensity profile of step S3, statistic sampling generates the statistics array; Step S4, calculating average gray X; The pixel count of step S5, statistical average gray scale X both sides is also judged background colour, determines background colour is positioned at which side of average gray X; The pixel count of step S6, statistical average gray scale X both sides is also judged character gray scale (foreground), determines foreground is positioned at which side of average gray X; Step S7, the color that application is preset in original image are replaced the primary colors of the pixel of foreground and background colour correspondence respectively with corresponding replaced color.
Wherein, the order of step S1 and step S2 can be changed in actual applications, does not influence whole structure.
Intensity profile statistical-reference Fig. 5 of sampled result among the above-mentioned steps S4, the peak value that has five intensity profile among the figure, and illustrate the position of average gray X, after having carried out the processing of above-mentioned statistics and image (step S5~S7), the intensity profile statistics of pixel on the original image can be become as shown in Figure 6, wherein, pixel in the character look 1~3 that judges and background colour gray scale and the both sides certain width thereof, owing to all replaced by corresponding color, gray-scale statistical result after this part processes pixel becomes one " pulse ", continuation is with reference to figure 7, if further carry out noise reduction process, for the pixel of the considerably less color correspondence of those frequencies of occurrences, directly from image, ignore, this is few and the electronic edition of the process plate books of some printing vestiges is arranged for color, and treatment effect is the most obvious.
The principle that the background colour of presetting in said method and character colour cell are chosen is that the target device contrast that is presented at of writings and image is strengthened, literal shows clearer outstanding, reduce the overall brightness of screen simultaneously, this has reduced the stimulation of light to eyes on the one hand, improve and read comfort, for the LCD Panel that needs back lighting, reduce output brightness and can also save power consumption on the other hand, extend working time.These numerical value can be obtained and set by test and experiment, also namely at the varying environment light condition, for example under the dark condition, under the different light-illuminatings, the inferior different situations of different solar radiation, the paper quality how to simulate and characteristics, the a series of empirical value groups that obtain are by experiment set, and are perhaps set voluntarily with each one hobby by the user, and background colour is black etc. such as all literal are all replaced with white.
In sum, the invention provides a kind of electronic document display method, but prospect part and background parts in the above-mentioned electronic document display method recognition image, increase the contrast of reading content and background colour, automatically adjust the overall brightness of two-part color attribute, reduction screen simultaneously, when showing electronic document, provide better reading experience for the user.
Should be understood that, for those of ordinary skills, can be improved according to the above description or conversion, and all these improvement and conversion all should belong to the protection domain of claims of the present invention.