CN105338214B - Image processing method and image processing apparatus - Google Patents
Image processing method and image processing apparatus Download PDFInfo
- Publication number
- CN105338214B CN105338214B CN201410397088.5A CN201410397088A CN105338214B CN 105338214 B CN105338214 B CN 105338214B CN 201410397088 A CN201410397088 A CN 201410397088A CN 105338214 B CN105338214 B CN 105338214B
- Authority
- CN
- China
- Prior art keywords
- pixel point
- weakly acidic
- color component
- spodogram
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The invention discloses a kind of image processing method and image processing apparatus.The image processing method includes:Obtain the weakly acidic pH spodogram vegetarian refreshments in coloured image, wherein weakly acidic pH spodogram vegetarian refreshments is the pixel that the difference of maximum color component value and Minimal color weight value is less than or equal to predetermined threshold value in coloured image;Weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point;Coloured image is adjusted, wherein darkening processing is carried out to foreground pixel point, brightening processing is carried out to background pixel point.Through the invention, it solves the problems, such as that the foreground content of the master copy file caused when the picture quality of the coloured image of the master copy file obtained using image acquiring device is bad is not easy identified and extracts, and then improves the image recognition effect of coloured image.
Description
Technical field
The present invention relates to image processing fields, in particular to a kind of image processing method and image processing apparatus.
Background technology
The image acquiring devices such as scanner are widely used in office realm, for obtaining master copy file (such as bill, office text
Part, contract, archives etc.) image.Use image (the hereinafter referred to as manuscript map for the master copy file that image acquiring device is got
Picture) include foreground part and background parts, foreground part includes the main word and picture printed in master copy file, background parts
Including other parts in master copy file in addition to foreground part, such as shading, watermark etc..In general, it is intended that obtaining original copy text
The well reproduced image of part, i.e., it is desirable to use word in the original image that image acquiring device gets and picture clear
It is clear, background is single, foreground part and background parts have higher contrast, in order to which the content of master copy file is easy to be known
Not and extract.But when the condition of scanning is bad, for example, when the scanning resolution of image acquiring device is relatively low or original copy
When file itself is relatively fuzzy, or when image acquiring device execute the brightness of the light source that the when scanned is irradiated on master copy file compared with
When low, acquired original image may be caused second-rate so that the foreground part in original image is not easy with background parts
It distinguishes, this results in being difficult to and extracting by the original image acquired in image acquiring device in the foreground of master copy file
Hold.
The relevant technologies disclose a kind of image processing method, which includes:Pre-set first threshold and
Second threshold, and first threshold is more than second threshold;The pixel that gray value in gray level image is more than to first threshold is all white
Change, gray value in gray level image is less than to the pixel whole melanism of second threshold, gray value in gray level image is in first
Pixel between threshold value and second threshold is converted according to setting formula.By the relevant technologies, can improve using ash
The contrast for spending the gray level image of the master copy file acquired in scan mode, makes the foreground part in original image and background parts
It is easy to distinguish, to make the foreground content of master copy file be easily identified and extract.But the relevant technologies are only applicable to obtain
The case where black white image, the case where being not particularly suited for obtaining coloured image.According to different use requirements, many times user needs
Image acquiring device is used to obtain the coloured image of master copy file.
For caused when the picture quality of the coloured image of the master copy file obtained using image acquiring device is bad
The foreground content of master copy file be not easy identified and the problem of extract, not yet propose effective workaround at present.
Invention content
The main purpose of the present invention is to provide a kind of image processing method and image processing apparatus, to solve when using figure
As the foreground content of caused master copy file when the picture quality of the coloured image of the master copy file of acquisition device acquisition is bad
The problem of being not easy identified and extraction.
To achieve the goals above, according to an aspect of the invention, there is provided a kind of image processing method.At the image
Reason method includes:Obtain the weakly acidic pH spodogram vegetarian refreshments in coloured image, wherein weakly acidic pH spodogram vegetarian refreshments is maximum in coloured image
The difference of color component value and Minimal color weight value is less than or equal to the pixel of predetermined threshold value;Weakly acidic pH gray pixel point is divided
For foreground pixel point and background pixel point;Coloured image is adjusted, wherein darkening processing is carried out to foreground pixel point, it is right
Background pixel point carries out brightening processing.
Further, the weakly acidic pH spodogram vegetarian refreshments in acquisition coloured image includes:Pixel in coloured image is divided
For weakly acidic pH spodogram vegetarian refreshments and non-weakly acidic pH gray pixel point, wherein non-weakly acidic pH gray pixel point is to remove weakly acidic pH in coloured image
Pixel except spodogram vegetarian refreshments;Obtain weakly acidic pH spodogram vegetarian refreshments.
Further, weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point includes:Calculate weakly acidic pH
The gray value of spodogram vegetarian refreshments;Prospect background segmentation threshold is calculated according to the gray value of weakly acidic pH spodogram vegetarian refreshments;According to prospect background
Weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point by segmentation threshold.
Further, weakly acidic pH gray pixel point is divided by foreground pixel point and background picture according to prospect background segmentation threshold
Vegetarian refreshments includes:Using Minimal color weight value in weakly acidic pH gray pixel point be less than or equal to prospect background segmentation threshold pixel as
Foreground pixel point;Minimal color weight value in weakly acidic pH gray pixel point is more than the pixel of prospect background segmentation threshold as the back of the body
Scene vegetarian refreshments.
Further, coloured image is adjusted in the following manner:The conversion coefficient k1 of foreground pixel point is obtained,
In, k1 is less than or equal to 1;Obtain the conversion coefficient k2 of background pixel point, wherein k2 is more than or equal to 1;Pass through turning for foreground pixel point
Coefficient k 1 is changed to be adjusted the color component value of foreground pixel point:R'=k1*R, G'=k1*G, B'=k1*B, R' are adjustment
The first color component value afterwards, R are the first color component value before adjustment, and G' is the second color component value after adjustment, and G is to adjust
The second color component value before whole, B' are the third color component value after adjustment, and B is the third color component value before adjustment.It is logical
The conversion coefficient k2 for crossing background pixel point is adjusted the color component value of background pixel point:R'=k2*R, G'=k2*G, B'
=k2*B, R' are the first color component value after adjustment, and R is the first color component value before adjustment, and G' is second after adjustment
Color component value, G are the second color component value before adjustment, and B' be the third color component value after adjustment, and B is the before adjusting
Three color component values.
To achieve the goals above, according to another aspect of the present invention, a kind of image processing apparatus is provided.At the image
Managing device includes:Acquiring unit, for obtaining the weakly acidic pH spodogram vegetarian refreshments in coloured image, wherein weakly acidic pH spodogram vegetarian refreshments is
The difference of maximum color component value and Minimal color weight value is less than or equal to the pixel of predetermined threshold value in coloured image;It divides single
Member, for weakly acidic pH gray pixel point to be divided into foreground pixel point and background pixel point;Image control unit, for cromogram
As being adjusted, wherein carry out darkening processing to foreground pixel point, brightening processing is carried out to background pixel point.
Further, acquiring unit includes:Division module, for the pixel in coloured image to be divided into weakly acidic pH ash
Pixel and non-weakly acidic pH gray pixel point, wherein non-weakly acidic pH gray pixel select be in coloured image except weakly acidic pH spodogram vegetarian refreshments it
Outer pixel;Acquisition module, for obtaining weakly acidic pH spodogram vegetarian refreshments.
Further, division unit includes:First computing module, the gray value for calculating weakly acidic pH spodogram vegetarian refreshments;The
Two computing modules, for calculating prospect background segmentation threshold according to the gray value of weakly acidic pH spodogram vegetarian refreshments;Division module is used for root
Weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point according to prospect background segmentation threshold.
Further, division module by weakly acidic pH gray pixel point for being divided into foreground pixel point and the back of the body in the following manner
Scene vegetarian refreshments:Using Minimal color weight value in weakly acidic pH gray pixel point be less than or equal to prospect background segmentation threshold pixel as
Foreground pixel point;Minimal color weight value in weakly acidic pH gray pixel point is more than the pixel of prospect background segmentation threshold as the back of the body
Scene vegetarian refreshments.
Further, image control unit includes:First acquisition module, the conversion coefficient for obtaining foreground pixel point
K1, wherein k1 is less than or equal to 1;Second acquisition module, the conversion coefficient k2 for obtaining background pixel point, wherein k2 be more than etc.
In 1;The first adjustment module adjusts the color component value of foreground pixel point for the conversion coefficient k1 by foreground pixel point
It is whole:R'=k1*R, G'=k1*G, B'=k1*B, R' are the first color component value after adjustment, and R is the first color before adjustment
Component value, G' are the second color component value after adjustment, and G is the second color component value before adjustment, and B' is the third after adjustment
Color component value, B are the third color component value before adjustment, second adjustment module, for the conversion system by background pixel point
Number k2 is adjusted the color component value of background pixel point:R'=k2*R, G'=k2*G, B'=k2*B, R' are after adjusting
First color component value, R are the first color component value before adjustment, and G' is the second color component value after adjustment, and G is before adjusting
The second color component value, B' be adjustment after third color component value, B be adjust before third color component value.
Through the invention, due to first obtaining the weakly acidic pH spodogram vegetarian refreshments in coloured image, weakly acidic pH gray pixel point is divided
For foreground pixel point and background pixel point, then based on darkening processing is executed to foreground pixel point, brightening is carried out to background pixel point
Processing is adjusted coloured image, solves the image when the coloured image for the master copy file for using image acquiring device to obtain
The foreground content of caused master copy file is not easy the problem of identified and extraction when quality is bad, and then improves coloured image
Image recognition effect.
Description of the drawings
The attached drawing constituted part of this application is used to provide further understanding of the present invention, schematic reality of the invention
Example and its explanation are applied for explaining the present invention, is not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the module composition schematic diagram of image processing apparatus according to a first embodiment of the present invention;
Fig. 2 is the flow chart of image processing method according to a first embodiment of the present invention;
Fig. 3 is the curve synoptic diagram of image adjustment functions according to a first embodiment of the present invention;
Fig. 4 is the module composition schematic diagram of image processing apparatus according to a second embodiment of the present invention;
Fig. 5 is the module composition schematic diagram of image processing apparatus according to a third embodiment of the present invention;
Fig. 6 is the module composition schematic diagram of image processing apparatus according to a fourth embodiment of the present invention;And
Fig. 7 is the module composition schematic diagram of image processing apparatus according to a fifth embodiment of the present invention.
Specific implementation mode
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
Fig. 1 is the module composition schematic diagram of image processing apparatus according to a first embodiment of the present invention, as shown, image
Processing unit 100 includes control unit (hereinafter referred to as CPU) 11, read-only memory (hereinafter referred to as ROM) 12, random access memory
Device (hereinafter referred to as RAM) 13, input/output interface 14 and bus 15.CPU 11 executes work for controlling other each modules;
ROM 12 is used to store the control program of image processing apparatus 100;RAM13 is used to store to control and be generated in program operation process
Data and variable;Input/output interface 14 is for obtaining raw image data and output by image processing apparatus 100 to original
The final image data generated after image real time transfer, wherein raw image data be image acquiring device to master copy file into
The color digital image data that the acquired analog image of row scanning is obtained by processing such as AD conversion, image rectifications, for original
Each pixel in the image (hereinafter referred to as original image) of original text file, raw image data include corresponding with the pixel
Red (R), green (G), blue (B) three color component values;Bus 15 for connect CPU 11, ROM 12, RAM 13 and input/
Output interface 14.
Fig. 2 is the flow chart of image processing method according to a first embodiment of the present invention.As shown, this method include with
Lower step:
Step S101 obtains the weakly acidic pH spodogram vegetarian refreshments in coloured image.
Weakly acidic pH spodogram vegetarian refreshments be in coloured image the difference of maximum color component value and Minimal color weight value be less than etc.
In the pixel of predetermined threshold value.
Image processing apparatus obtains the raw image data of image acquiring device output, and according to raw image data from original
Weakly acidic pH spodogram vegetarian refreshments is obtained in pixel in manuscript base picture.
In embodiments of the present invention, it in order to more easily obtain weakly acidic pH spodogram vegetarian refreshments, can take original image first
In pixel be divided into weakly acidic pH spodogram vegetarian refreshments and non-weakly acidic pH gray pixel point, then from divide obtained in obtained pixel it is close
The mode of neutral spodogram vegetarian refreshments.
Image processing apparatus obtains the raw image data of image acquiring device output, and will be former according to raw image data
Pixel in manuscript base picture is divided into weakly acidic pH spodogram vegetarian refreshments and non-weakly acidic pH gray pixel point, wherein raw image data is original
The color digital image data of original text file, weakly acidic pH spodogram vegetarian refreshments refer to the pixel of the close neutral ash of color in original image,
It refers to other pixels in original image in addition to weakly acidic pH spodogram vegetarian refreshments that non-weakly acidic pH gray pixel, which is selected,.
For each pixel of original image, raw image data includes R, G, B corresponding with the pixel tri-
Color component value, since neutral ash refers to the color that tri- color component values of R, G, B are formed when equal under rgb color pattern, because
This, for a certain pixel, when tri- color component values of its R, G, B are close, image processing apparatus judges that the pixel shows
Color out is weakly acidic pH ash, that is, judges the pixel for weakly acidic pH spodogram vegetarian refreshments.
Image processing apparatus analyzes R, G, B color component value of each pixel in raw image data successively, for
Each pixel in original image determines that the maximum value RGBmax in tri- color component values of R, G, B is (hereinafter referred to as maximum
Both color component value) and minimum value RGBmin (hereinafter referred to as Minimal color weight value), calculate the difference of the two, and judge
Whether difference is less than or equal to predetermined threshold value T1, as the maximum color component value RGBmax and Minimal color weight value of a certain pixel
When the difference of RGBmin is less than or equal to predetermined threshold value T1, image processing apparatus judges the pixel for weakly acidic pH spodogram vegetarian refreshments, no
Then, it is weakly acidic pH spodogram vegetarian refreshments to judge the pixel not.It should be noted that predetermined threshold value T1 is a smaller numerical value, when certain
The difference of the maximum color component value RGBmax and Minimal color weight value RGBmin of one pixel are less than or equal to predetermined threshold value T1
When, show that tri- color component values of R, G, B of the pixel are close, it is preferable that predetermined threshold value T1 is equal to 30.
Weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point by step S102.
Image processing apparatus calculates the gray value of each weakly acidic pH spodogram vegetarian refreshments successively, and according to all weakly acidic pH spodogram vegetarian refreshments
Gray value determine prospect background segmentation threshold T2, and weakly acidic pH gray pixel point is divided according to prospect background segmentation threshold T2
For foreground pixel point and background pixel point.
Wherein, the gray value of weakly acidic pH spodogram vegetarian refreshments refers to the gray scale of the pixel when carrying out gray processing to the pixel
Value utilizes tri- color component values of R, G, B of the pixel to calculate the pixel of gained according to certain calculating principle
Coloured image gray processing method known in the art may be used in the method for weakly acidic pH gray pixel point gray processing by gray value, than
Such as, using mean value method to weakly acidic pH spodogram vegetarian refreshments gray processing, i.e., to a certain pixel gray level when its gray value be Gray=
(R+G+B)/3, alternatively, using weighted mean method to weakly acidic pH spodogram vegetarian refreshments gray processing, i.e., to a certain pixel gray level when its
Gray value is Gray=0.299*R+0.587G+0.114*B.Image processing apparatus calculates the ash of each weakly acidic pH spodogram vegetarian refreshments successively
Angle value, and the gray value for each weakly acidic pH spodogram vegetarian refreshments for calculating gained is stored in pre-assigned buffering area GrayBuffer
In.
Image processing apparatus is carried out according to the gray value of each weakly acidic pH spodogram vegetarian refreshments stored in buffering area GrayBuffer
The calculating of prospect background segmentation threshold T2, wherein the computational methods of prospect background segmentation threshold T2 use ash known in the art
Spend display foreground background segment threshold value calculation method.Preferably, before the present embodiment is calculated using maximum variance between clusters (OTSU)
Scape background segment threshold value T2, it is w0 that note foreground pixel, which is selected and accounts for the ratio of all weakly acidic pH spodogram vegetarian refreshments, and foreground pixel point is averaged
Gray value is u0, and the ratio that background pixel point accounts for all weakly acidic pH spodogram vegetarian refreshments is w1, and the average gray value of background pixel point is
U1, then the average gray value of all weakly acidic pH spodogram vegetarian refreshments be:
U=w0*u0+w1*u1
The variance of foreground pixel point and background pixel point is:
G=w0* (u0-u) * (u0-u)+w1* (u1-u) * (u1-u)=w0*w1* (u0-u1) * (u0-u1) (formula one)
If the number of greyscale levels of the image formed after each weakly acidic pH spodogram vegetarian refreshments gray processing is m, i.e., each weakly acidic pH spodogram vegetarian refreshments
Gray value value range be 0~m-1, calculate the foreground pixel when foreground background segment threshold value is set as gray value i successively
The variance gi of point and background pixel point, wherein i=0,1,2 ..., m-1, and the m foreground pixel point and background pixel that will be obtained
The corresponding gray value of maximum value of the variance of point is set as prospect background segmentation threshold T2, and specific method is:
A) when prospect background segmentation threshold is set as gray value i according to Gray pairs of the gray value of each weakly acidic pH spodogram vegetarian refreshments
All weakly acidic pH gray pixel points carry out the division of foreground pixel point and background pixel point, wherein when a certain weakly acidic pH spodogram vegetarian refreshments
Gray value Gray when being less than or equal to gray value i, determine that the weakly acidic pH spodogram vegetarian refreshments is foreground pixel point, otherwise, it determines this is close
Neutral spodogram vegetarian refreshments is background pixel point.
The number of the quantity, background pixel point of foreground pixel point when b) being set as gray value i according to prospect background segmentation threshold
It measures and the gray value of the gray value of each foreground pixel point, each background pixel point calculates separately the value of w0, u0, w1, u1.
C) it is calculated according to the value of w0, u0, w1, u1 when foreground background segment threshold value is set as gray value i and works as prospect background
Segmentation threshold is set as the variance gi of foreground pixel point and background pixel point when gray value i.
D) the corresponding gray value of maximum value of the variance of obtained m foreground pixel point and background pixel point is set as foreground
Background segment threshold value T2.When due to the variance maximum of current scene vegetarian refreshments and background pixel point, it is believed that the foreground portion of image
Divide and the difference of background parts is maximum, therefore, which is best prospect background segmentation threshold, i.e. prospect background divides threshold
Value T2 is equal to the corresponding gray value of maximum value of the variance of m foreground pixel point and background pixel point.
Image processing apparatus divides threshold according to tri- color component values of R, G, B and prospect background of each weakly acidic pH spodogram vegetarian refreshments
Value T2 determines that each weakly acidic pH spodogram vegetarian refreshments is that foreground pixel point or background pixel point, specific method are successively, for it is a certain it is close in
Property spodogram vegetarian refreshments, its Minimal color weight value RGBmin is determined, according to its Minimal color weight value RGBmin and prospect background point
The relationship for cutting threshold value T2 determines that the weakly acidic pH spodogram vegetarian refreshments is foreground pixel point or background pixel point, wherein when weakly acidic pH ash
When the Minimal color weight value RGBmin of pixel is less than or equal to prospect background segmentation threshold T2, the weakly acidic pH spodogram vegetarian refreshments is judged
For foreground pixel point, otherwise, it is determined that the weakly acidic pH spodogram vegetarian refreshments is background pixel point.
Step S103, is adjusted coloured image, wherein darkening processing is carried out to foreground pixel point, to background pixel
Point carries out brightening processing.
In this step, according to the original for foreground pixel point darken processing and carry out background pixel point brightening processing
Then original image is adjusted.
Image processing apparatus according to darkening processing is carried out to foreground pixel point and carries out brightening processing to background pixel point
Principle is adjusted the weakly acidic pH gray pixel point in original image, and specific method is to be sequentially adjusted in by conversion coefficient original
R, G, B color component value of each weakly acidic pH spodogram vegetarian refreshments in image data, wherein the conversion coefficient of foreground pixel point is k1, and
K1 is less than or equal to 1, and the conversion coefficient of background pixel point is k2, and k2 is more than or equal to 1, after Image Adjusting, for each foreground pixel
Point, three of them color component value are respectively:R'=k1*R, G'=k1*G, B'=k1*B, for each background pixel point, three of them
Color component value is respectively:R'=k2*R, G'=k2*G, B'=k2*B, wherein R', G', B' are adjusted to original image
Three color component values of each weakly acidic pH spodogram vegetarian refreshments afterwards, i.e. each weakly acidic pH spodogram vegetarian refreshments included in final image data
Three color component values, R, G, B are three color component values of each weakly acidic pH spodogram vegetarian refreshments before being adjusted to original image, i.e.,
Three color component values of each weakly acidic pH spodogram vegetarian refreshments included in raw image data.
In the present embodiment, image processing apparatus determines image adjustment functions first, is then determined according to image adjustment functions
The conversion coefficient k1 of the foreground pixel point and conversion coefficient k2 of background pixel point.Fig. 3 is the figure according to first embodiment of the invention
As the curve synoptic diagram of Tuning function, as shown, x is indicated to each weakly acidic pH spodogram after weakly acidic pH gray pixel point progress gray processing
The gray value of vegetarian refreshments, y expression the gray value of each weakly acidic pH spodogram vegetarian refreshments is converted using image adjustment functions after it is each closely in
Property spodogram vegetarian refreshments gray value, wherein y is the function of x, i.e. y=f (x), before conversion and the number of greyscale levels of converted images are
The value range of 256, i.e. x and y are 0~255.
The determination process of image adjustment functions is as follows:
First, five fixed coordinates points [x0, y0] in x-y coordinate system are determined, [x1, y1], [x2, y2], [x3, y3],
[x4, y4], wherein x0=0, x2=T2, x4=255, x1 be x0 and x2 midpoint, i.e. x1=x0+ (x2-x0)/2=T2/2,
X3 be x2 and x4 midpoint, i.e. x3=x2+ (x4-x2)/2=(T2+255)/2, y0, y1, y2, y3, y4 be respectively to x0, x1,
X2, x3, x4 carry out transformed gray value using image adjustment functions, wherein y0=x0=0, y1=x1/2=T2/4, y2=
X2=T2, y3=235, y4=x4=255.
Then, [x0, x1], [x1, x2], [x2, x3], [x3, x4] four gray values are determined according to five fixed coordinates points
The gradation conversion coefficient in section, is easy to get:
A0=(y1-y0) * 1.0/ (x1-x0)
A1=(y2-y1) * 1.0/ (x2-x1)
A2=(y3-y2) * 1.0/ (x3-x2)
A3=(y4-y3) * 1.0/ (x4-x3)
Wherein, a0 is the gradation conversion coefficient of gray value interval [x0, x1], and a1 is the gray scale of gray value interval [x1, x2]
Conversion coefficient, a2 are the gradation conversion coefficient of gray value interval [x2, x3], and a3 is the gradation conversion of gray value interval [x3, x4]
Coefficient.
Finally, the image adjustment functions of each gray value interval are determined, wherein in each gray value interval, y is the linear letter of x
Number, the image adjustment functions of gray value interval [x0, x1] are:Y=y0+a0 (x-x0);The image tune of gray value interval [x1, x2]
Integral function is:Y=y1+a1 (x-x1);The image adjustment functions of gray value interval [x2, x3] are:Y=y2+a2 (x-x2);Gray scale
Value section [x3, x4] image adjustment functions be:Y=y3+a3 (x-x3).
That is, converted to the gray value of each weakly acidic pH spodogram vegetarian refreshments using image adjustment functions, former ash angle value with turn
The mapping relations of gray value after changing can be denoted as y=f (x), wherein
As shown in figure 3, curve a is the schematic diagram of (formula two), straight line b is the schematic diagram of function f (x)=x, as seen from the figure,
In gray value interval [x0, x1] and gray value interval [x1, x2] range, curve a is located at below straight line b, that is, uses (formula two)
When being converted to being located at the gray value in gray value interval [x0, x2], the gray value of pixel reduces after conversion, i.e. pixel
It is darkened, in gray value interval [x2, x3] and gray value interval [x3, x4] range, curve a is located above straight line b, that is, uses
When (formula two) is converted to being located at the gray value in gray value interval [x2, x4], the gray value of pixel improves after conversion, i.e.,
Pixel is by brightening.Since x2 is equal to prospect background segmentation threshold T2, pixel of the gray value less than or equal to T2 is foreground pixel
Point, pixel of the gray value more than T2 is background pixel point, therefore, using (formula two) to the gray value of each weakly acidic pH spodogram vegetarian refreshments
After being converted, foreground pixel point is darkened, and background pixel point is by brightening.
It is determined when being adjusted to three color component values of weakly acidic pH spodogram vegetarian refreshments in original image according to (formula two)
The conversion coefficient k1 of the foreground pixel point and conversion coefficient k2 of background pixel point, wherein for each foreground pixel point, conversion system
Number is k1=f (RGBmin)/RGBmin, and for each background pixel point, conversion coefficient is k2=f (RGBmax)/RGBmax, figure
As processing unit is according to (formula two) and the maximum color component value RGBmax and Minimal color weight value of each weakly acidic pH spodogram vegetarian refreshments
RGBmin calculates the value of f (RGBmin) and f (RGBmax), so that it is determined that the conversion coefficient of each weakly acidic pH spodogram vegetarian refreshments.Due to
There is RGBmin≤T2 for foreground pixel point, so f (RGBmin)≤RGBmin, i.e. k1≤1 can be obtained according to (formula two), and only
The k1=1 in RGBmin=0 or RGBmin=T2;Similarly, due to having RGBmin > T2, i.e. RGBmax > for background pixel point
T2, so f (RGBmax) >=RGBmax, i.e. k2 >=1, and the only k2=1 in RGBmax=255 can be obtained according to (formula two).
It should be noted that for non-weakly acidic pH gray pixel point, i.e., for a certain pixel, as RGBmax-RGBmin>T1
When, image processing apparatus equally can according to the maximum color component value RGBmax of (formula two) and each non-weakly acidic pH gray pixel point and
Minimal color weight value RGBmin determines the conversion coefficient of each non-weakly acidic pH gray pixel point, for example, k3=f (RGBmax)/
RGBmax, and three color component values of each non-weakly acidic pH gray pixel point are adjusted according to conversion coefficient, after Image Adjusting,
For each non-weakly acidic pH gray pixel point, three of them color component value is respectively:R'=k3*R, G'=k3*G, B'=k3*B,
In, R', G', B' are three color component values that rear each non-weakly acidic pH gray pixel point is adjusted to original image, i.e., final figure
Three color component values of each weakly acidic pH spodogram vegetarian refreshments as included in data, R, G, B are before being adjusted to original image
Three color component values of pixel, i.e. three colors minute of each non-weakly acidic pH gray pixel point included in raw image data
Magnitude.
After conversion coefficient k1, conversion coefficient k2 and conversion coefficient k3 are determined, image processing apparatus is successively in original image
Each pixel be adjusted, according to each pixel be weakly acidic pH spodogram vegetarian refreshments foreground pixel point, alternatively, be weakly acidic pH spodogram
Background pixel point in vegetarian refreshments selects corresponding conversion coefficient, and use conversion coefficient alternatively, being non-weakly acidic pH gray pixel point
Tri- color component values of R, G, B of each pixel in raw image data are converted, and by each pixel after conversion
In three color component value R', G', B' storages to ROM memory.
In the present embodiment, the above method is not limited to for the processing of non-weakly acidic pH gray pixel point, for example, may be used certainly
The method of dynamic setting contrast handles each non-weakly acidic pH gray pixel point.
In the embodiment of the present invention, image processing apparatus obtains the weakly acidic pH spodogram in the coloured image of master copy file automatically
Vegetarian refreshments, and weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point, it is darkened according to foreground pixel point
Processing and the principle that brightening processing is carried out to background pixel point adjust the coloured image of master copy file.At image using the present invention
Reason method can improve the contrast of foreground part and background parts in coloured image, make the foreground part in coloured image and the back of the body
Scape part is easy to distinguish, and solves the figure of the coloured image when the master copy file obtained using image acquiring device in the prior art
The foreground content of image quality amount master copy file caused when bad is not easy the problem of identified and extraction.
Image processing apparatus provided in an embodiment of the present invention is introduced below, the image processing method of the embodiment of the present invention
Image processing apparatus that method can provide through the embodiment of the present invention is realized.
The module composition schematic diagram of the image processing apparatus of Fig. 4 according to a second embodiment of the present invention, as shown, the image
Processing unit includes acquiring unit 10, division unit 20 and image control unit 30.
Acquiring unit 10 is used to obtain the weakly acidic pH spodogram vegetarian refreshments in coloured image, wherein weakly acidic pH spodogram vegetarian refreshments is color
The difference of maximum color component value and Minimal color weight value is less than or equal to the pixel of predetermined threshold value in color image.Division unit
20 by weakly acidic pH gray pixel point for being divided into foreground pixel point and background pixel point.Image control unit 30 is used for cromogram
As being adjusted, wherein carry out darkening processing to foreground pixel point, brightening processing is carried out to background pixel point.
Fig. 5 is the module composition schematic diagram of image processing apparatus according to a third embodiment of the present invention.
Preferably, as shown in figure 5, acquiring unit 10 includes:Division module 11 is used for the pixel click and sweep in coloured image
It is divided into weakly acidic pH spodogram vegetarian refreshments and non-weakly acidic pH gray pixel point, wherein non-weakly acidic pH gray pixel point is in being removed closely in coloured image
Pixel except property spodogram vegetarian refreshments.Acquisition module 12, for obtaining weakly acidic pH spodogram vegetarian refreshments.Division module 11 can also be into one
Step includes the first computational submodule 111 and the first decision sub-module 112, wherein the first computational submodule 111 is for calculating original copy
The maximum color component value RGBmax of each pixel and Minimal color weight value RGBmin in image, and the difference of the two is calculated,
First decision sub-module 112 is according to the difference of the maximum color component value RGBmax and Minimal color weight value RGBmin of each pixel
Value and each pixel of magnitude relationship judgement of predetermined threshold value T1 for weakly acidic pH spodogram vegetarian refreshments or are non-weakly acidic pH gray pixel point,
In, when the difference of the maximum color component value RGBmax and Minimal color weight value RGBmin of a certain pixel are less than or equal to preset
When threshold value T1, the pixel is judged for weakly acidic pH spodogram vegetarian refreshments, otherwise, it is determined that the pixel is non-weakly acidic pH gray pixel point.
Fig. 6 is the module composition schematic diagram of image processing apparatus according to a fourth embodiment of the present invention.As shown in fig. 6, drawing
Subdivision 20 may include the first computing module 201, the second computing module 202 and division module 203.First computing module 201
Gray value for calculating weakly acidic pH spodogram vegetarian refreshments.Second computing module 202 is used for the gray value according to weakly acidic pH spodogram vegetarian refreshments
Calculate prospect background segmentation threshold.Division module 203 is used to be divided weakly acidic pH gray pixel point according to prospect background segmentation threshold
For foreground pixel point and background pixel point.Weakly acidic pH gray pixel point for before being divided by division module 203 in the following manner
Scene vegetarian refreshments and background pixel point:Minimal color weight value in weakly acidic pH gray pixel point is less than or equal to prospect background segmentation threshold
Pixel as foreground pixel point, Minimal color weight value in weakly acidic pH gray pixel point is more than prospect background segmentation threshold
Pixel is as background pixel point.Division unit 20 calculates the gray value after each weakly acidic pH spodogram vegetarian refreshments gray processing, and root first
Prospect background segmentation threshold T2 is calculated according to the gray value of all weakly acidic pH spodogram vegetarian refreshments, then according to each weakly acidic pH spodogram vegetarian refreshments
The magnitude relationship of Minimal color weight value RGBmin and prospect background segmentation threshold T2 judge that each weakly acidic pH spodogram vegetarian refreshments is foreground
Pixel or background pixel point, wherein before the Minimal color weight value RGBmin of a certain weakly acidic pH spodogram vegetarian refreshments is less than or equal to
When scape background segment threshold value T2, the weakly acidic pH spodogram vegetarian refreshments is judged for foreground pixel point, otherwise, it is determined that the weakly acidic pH spodogram vegetarian refreshments
For background pixel point.
Fig. 7 is the module composition schematic diagram of image processing apparatus according to a fifth embodiment of the present invention.As shown in fig. 7, figure
As adjustment unit 30 includes:First acquisition module 301, the conversion coefficient k1 for obtaining foreground pixel point, wherein k1 be less than etc.
In 1.Second acquisition module 302, the conversion coefficient k2 for obtaining background pixel point, wherein k2 is more than or equal to 1.The first adjustment
Module 303 is adjusted the color component value of foreground pixel point for the conversion coefficient k1 by foreground pixel point:R'=
K1*R, G'=k1*G, B'=k1*B, R' are the first color component value after adjustment, and R is the first color component value before adjustment,
G' is the second color component value after adjustment, and G is the second color component value before adjustment, and B' is the third color component after adjustment
Value, B are the third color component value before adjustment, second adjustment module 304, for k2 pairs of the conversion coefficient by background pixel point
The color component value of background pixel point is adjusted:R'=k2*R, G'=k2*G, B'=k2*B, R' are the first face after adjustment
Colouring component value, R are the first color component value before adjustment, and G' is the second color component value after adjustment, and G is second before adjustment
Color component value, B' are the third color component value after adjustment, and B is the third color component value before adjustment.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general
Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed
Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored
Be performed by computing device in the storage device, either they are fabricated to each integrated circuit modules or by they
In multiple modules or step be fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific
Hardware and software combines.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of image processing method, which is characterized in that including:
Obtain coloured image in weakly acidic pH spodogram vegetarian refreshments, wherein the weakly acidic pH spodogram vegetarian refreshments be in the coloured image most
The difference of big color component value and Minimal color weight value is less than or equal to the pixel of predetermined threshold value;
The weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point;And
The coloured image is adjusted, wherein darkening processing is carried out to the foreground pixel point, to the background pixel point
Carry out brightening processing.
2. image processing method according to claim 1, which is characterized in that obtain the weakly acidic pH gray pixel in coloured image
It puts and includes:
Pixel in coloured image is divided into the weakly acidic pH spodogram vegetarian refreshments and non-weakly acidic pH gray pixel point, wherein described
It is pixel in the coloured image in addition to the weakly acidic pH spodogram vegetarian refreshments that non-weakly acidic pH gray pixel, which is selected,;And
Obtain the weakly acidic pH spodogram vegetarian refreshments.
3. image processing method according to claim 1, which is characterized in that before being divided into the weakly acidic pH gray pixel point
Scene vegetarian refreshments and background pixel point include:
Calculate the gray value of the weakly acidic pH spodogram vegetarian refreshments;
Prospect background segmentation threshold is calculated according to the gray value of the weakly acidic pH spodogram vegetarian refreshments;And
The weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point according to the prospect background segmentation threshold.
4. image processing method according to claim 3, which is characterized in that according to the prospect background segmentation threshold by institute
State that weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point includes:
Minimal color weight value in the weakly acidic pH spodogram vegetarian refreshments is less than or equal to the pixel of the prospect background segmentation threshold
As the foreground pixel point;And
Using Minimal color weight value in the weakly acidic pH spodogram vegetarian refreshments be more than the prospect background segmentation threshold pixel as
The background pixel point.
5. image processing method according to claim 1, which is characterized in that in the following manner to the coloured image into
Row adjustment:
Obtain the conversion coefficient k1 of the foreground pixel point, wherein k1 is less than or equal to 1;
Obtain the conversion coefficient k2 of the background pixel point, wherein k2 is more than or equal to 1;
The color component value of the foreground pixel point is adjusted by the conversion coefficient k1 of the foreground pixel point:R'=
K1*R, G'=k1*G, B'=k1*B, R' are the first color component value after adjustment, and R is the first color component value before adjustment,
G' is the second color component value after adjustment, and G is the second color component value before adjustment, and B' is the third color component after adjustment
Value, B are the third color component value before adjustment,
The color component value of the background pixel point is adjusted by the conversion coefficient k2 of the background pixel point:R'=
K2*R, G'=k2*G, B'=k2*B, R' are the first color component value after adjustment, and R is the first color component value before adjustment,
G' is the second color component value after adjustment, and G is the second color component value before adjustment, and B' is the third color component after adjustment
Value, B are the third color component value before adjustment.
6. a kind of image processing apparatus, which is characterized in that including:
Acquiring unit, for obtaining the weakly acidic pH spodogram vegetarian refreshments in coloured image, wherein the weakly acidic pH spodogram vegetarian refreshments is described
The difference of maximum color component value and Minimal color weight value is less than or equal to the pixel of predetermined threshold value in coloured image;
Division unit, for the weakly acidic pH gray pixel point to be divided into foreground pixel point and background pixel point;And
Image control unit, for being adjusted to the coloured image, wherein the foreground pixel point is carried out at darkening
Reason carries out brightening processing to the background pixel point.
7. image processing apparatus according to claim 6, which is characterized in that the acquiring unit includes:
Division module, for the pixel in coloured image to be divided into the weakly acidic pH spodogram vegetarian refreshments and non-weakly acidic pH gray pixel
Point, wherein it is pixel in the coloured image in addition to the weakly acidic pH spodogram vegetarian refreshments that the non-weakly acidic pH gray pixel, which is selected,;
And
Acquisition module, for obtaining the weakly acidic pH spodogram vegetarian refreshments.
8. image processing apparatus according to claim 6, which is characterized in that the division unit includes:
First computing module, the gray value for calculating the weakly acidic pH spodogram vegetarian refreshments;
Second computing module, for calculating prospect background segmentation threshold according to the gray value of the weakly acidic pH spodogram vegetarian refreshments;And
Division module, for the weakly acidic pH gray pixel point to be divided into foreground pixel point according to the prospect background segmentation threshold
And background pixel point.
9. image processing apparatus according to claim 8, which is characterized in that the division module is in the following manner
The weakly acidic pH gray pixel point is divided into foreground pixel point and background pixel point:
Minimal color weight value in the weakly acidic pH spodogram vegetarian refreshments is less than or equal to the pixel of the prospect background segmentation threshold
As the foreground pixel point;And
Using Minimal color weight value in the weakly acidic pH spodogram vegetarian refreshments be more than the prospect background segmentation threshold pixel as
The background pixel point.
10. image processing apparatus according to claim 6, which is characterized in that described image adjustment unit includes:
First acquisition module, the conversion coefficient k1 for obtaining the foreground pixel point, wherein k1 is less than or equal to 1;
Second acquisition module, the conversion coefficient k2 for obtaining the background pixel point, wherein k2 is more than or equal to 1;
The first adjustment module, for the conversion coefficient k1 by the foreground pixel point to the color component of the foreground pixel point
Value is adjusted:R'=k1*R, G'=k1*G, B'=k1*B, R' are the first color component value after adjustment, and R is before adjusting
First color component value, G' are the second color component value after adjustment, and G is the second color component value before adjustment, and B' is adjustment
Third color component value afterwards, B are the third color component value before adjustment,
Second adjustment module, for the conversion coefficient k2 by the background pixel point to the color component of the background pixel point
Value is adjusted:R'=k2*R, G'=k2*G, B'=k2*B, R' are the first color component value after adjustment, and R is before adjusting
First color component value, G' are the second color component value after adjustment, and G is the second color component value before adjustment, and B' is adjustment
Third color component value afterwards, B are the third color component value before adjustment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410397088.5A CN105338214B (en) | 2014-08-13 | 2014-08-13 | Image processing method and image processing apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410397088.5A CN105338214B (en) | 2014-08-13 | 2014-08-13 | Image processing method and image processing apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105338214A CN105338214A (en) | 2016-02-17 |
CN105338214B true CN105338214B (en) | 2018-07-20 |
Family
ID=55288471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410397088.5A Active CN105338214B (en) | 2014-08-13 | 2014-08-13 | Image processing method and image processing apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105338214B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106993107A (en) * | 2016-01-20 | 2017-07-28 | 杭州健培科技有限公司 | A kind of medical image output intent of color/monochrome mixing |
JP6779688B2 (en) * | 2016-07-25 | 2020-11-04 | キヤノン株式会社 | Image processing equipment, image processing method, computer program |
JP2018142759A (en) * | 2017-02-24 | 2018-09-13 | 株式会社東芝 | Image processing system and image processing method |
CN107093395B (en) * | 2017-07-05 | 2020-07-21 | 京东方科技集团股份有限公司 | Transparent display device and image display method thereof |
CN108009997B (en) * | 2017-11-08 | 2022-05-13 | 海信视像科技股份有限公司 | Method and device for adjusting image contrast |
CN110826569B (en) * | 2019-11-05 | 2022-07-19 | 泰康保险集团股份有限公司 | Bill image preprocessing method, device, medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010043996A3 (en) * | 2008-10-13 | 2010-09-30 | Koninklijke Philips Electronics N.V. | Contrast enhancement of images |
CN101951523A (en) * | 2010-09-21 | 2011-01-19 | 北京工业大学 | Adaptive colour image processing method and system |
CN102339461A (en) * | 2010-07-27 | 2012-02-01 | 夏普株式会社 | Method and equipment for enhancing image |
CN102760288A (en) * | 2011-04-26 | 2012-10-31 | 北京大学 | Color matching method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040120599A1 (en) * | 2002-12-19 | 2004-06-24 | Canon Kabushiki Kaisha | Detection and enhancement of backlit images |
-
2014
- 2014-08-13 CN CN201410397088.5A patent/CN105338214B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010043996A3 (en) * | 2008-10-13 | 2010-09-30 | Koninklijke Philips Electronics N.V. | Contrast enhancement of images |
CN102339461A (en) * | 2010-07-27 | 2012-02-01 | 夏普株式会社 | Method and equipment for enhancing image |
CN101951523A (en) * | 2010-09-21 | 2011-01-19 | 北京工业大学 | Adaptive colour image processing method and system |
CN102760288A (en) * | 2011-04-26 | 2012-10-31 | 北京大学 | Color matching method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105338214A (en) | 2016-02-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105338214B (en) | Image processing method and image processing apparatus | |
CN109191395B (en) | Image contrast enhancement method, device, equipment and storage medium | |
CN101454806B (en) | Method and apparatus for volume rendering using depth weighted colorization | |
CN106778995A (en) | A kind of art up two-dimensional code generation method and device with image co-registration | |
CN104978186B (en) | A kind of rendering intent and device of interface skin | |
CN104700371B (en) | The generation method and system of a kind of masking-out | |
CN102663741B (en) | Method for carrying out visual stereo perception enhancement on color digit image and system thereof | |
CN104899629B (en) | A kind of image in 2 D code generation method based on RBF | |
JP4934454B2 (en) | Image reading device | |
CN108761777A (en) | A kind of method and apparatus of determining Optical devices amount of distortion, distortion correction | |
CN104252700A (en) | Histogram equalization method for infrared image | |
CN104935900A (en) | Image sensing device, color correction matrix correction method and lookup table establishment method | |
CN109803172A (en) | A kind of processing method of live video, device and electronic equipment | |
CN110400278A (en) | A kind of full-automatic bearing calibration, device and the equipment of color of image and geometric distortion | |
CN111489322A (en) | Method and device for adding sky filter to static picture | |
CN113436284A (en) | Image processing method and device, computer equipment and storage medium | |
CN109949248A (en) | Modify method, apparatus, equipment and the medium of the color of vehicle in the picture | |
CN109255763A (en) | Image processing method, device, equipment and storage medium | |
US7664322B1 (en) | Feature-based color adjustment | |
CN108921869B (en) | Image binarization method and device | |
CN107094219A (en) | Image processing apparatus and image processing method | |
CN110782400A (en) | Self-adaptive uniform illumination realization method and device | |
CN115994875A (en) | Method and system for improving digital image quality | |
CN109064431A (en) | A kind of picture luminance adjusting method, equipment and its storage medium | |
CN110610461B (en) | Method, device and equipment for enhancing printed image and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |