CN103226689B - Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device - Google Patents

Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device Download PDF

Info

Publication number
CN103226689B
CN103226689B CN201210021206.3A CN201210021206A CN103226689B CN 103226689 B CN103226689 B CN 103226689B CN 201210021206 A CN201210021206 A CN 201210021206A CN 103226689 B CN103226689 B CN 103226689B
Authority
CN
China
Prior art keywords
pixel
blood
eye illness
shot eye
red
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
Application number
CN201210021206.3A
Other languages
Chinese (zh)
Other versions
CN103226689A (en
Inventor
黄玉春
林福辉
彭晓峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201210021206.3A priority Critical patent/CN103226689B/en
Publication of CN103226689A publication Critical patent/CN103226689A/en
Application granted granted Critical
Publication of CN103226689B publication Critical patent/CN103226689B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

A kind of detect blood-shot eye illness method and device, the method for removal blood-shot eye illness and device.The described method detecting blood-shot eye illness comprises: obtain the blood-shot eye illness sample point in eyes image; Search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point; Based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region, described preset range is relevant to the resolution of described eyes image.Technical scheme of the present invention, improves the efficiency that detection is seen red and removed blood-shot eye illness, reduces loss when detection is seen red and false drop rate, also reduces leakage correction rate when removing blood-shot eye illness and misses correction rate, and better to the error-correcting effect of red eye region.

Description

Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device
Technical field
The present invention relates to image technique field, particularly relate to a kind of detect blood-shot eye illness method and device, the method for removal blood-shot eye illness and device.
Background technology
When " red-eye effect " refers to taking photos by using flashlights portrait photographs, the red some phenomenon that the human eye pupil central authorities caused due to the reflective of the person's of being taken optical fundus blood vessel are formed.Its Crack cause is mainly because the pupil of people can amplify when surround lighting is darker, the closely pupil of high light through amplifying of flashlamp, impinge upon on postretinal microvascular tissue, be reflected back red light, the photo of actual imaging is caused to present " blood-shot eye illness " shape, blood-shot eye illness and people general cognitive eye color difference very greatly, greatly reduce the quality of photo.Along with the application of the digital camera, mobile phone, video camera etc. with flash function is more and more extensive, the removal for " red-eye effect " has very strong practical application, and it is important also to become all the more.
In prior art, when removing red eye region, usually adopt removal automatically and manually remove two kinds of modes and red eye region is removed.
So-called automatically to remove, normally first extract ocular by certain algorithm, based on the ocular extracted and then detect red eye region in conjunction with corresponding algorithm, then the red eye region detected is corrected.
Particularly, first by means of human-face detector, human face region can be detected by human-face detector, and then extract ocular roughly by Hough transform method or deforming template method etc.As: extract the first half of face as ocular.
Or obtained the eye hole being different from skin by skin arbiter, and then extract ocular.
Or by the extraction of the face features such as face, nose or eyebrow, and extract ocular roughly based on eyes and the position relationship between face, nose or eyebrow.As: the preset range extracting face place is interior as ocular.
Or extract ocular roughly by the last frame previewing photos (without blood-shot eye illness photo) before shooting.As: extract with as described in there is the part of red difference as ocular without seeing red photo.
After extracting ocular by the way, based on the ocular extracted, excavate the blood-shot eye illness color characteristic in blood-shot eye illness, and then extract red eye region based on described blood-shot eye illness color characteristic.Then the shape facility of shape to the red eye region extracted based on blood-shot eye illness is verified accordingly, in general, the shape of red eye region is generally circular, similar round, oval, class is oval, therefore, if the shape of the red eye region extracted is for circular, similar round, oval, class is oval, just can judge that the red eye region extracted is really as the red eye region formed in shooting process, and then can correct the blood-shot eye illness look of the red eye region extracted, and various smooth treatment is carried out to the edge of red eye region, revised eyes image is made to seem more natural in reach the object removing blood-shot eye illness.
So-called manually removing, is then the aid removed by means of various blood-shot eye illness, completely by repairing one by one each pixel manually.
For above-mentioned two kinds of modes removing blood-shot eye illness, the mode of automatic removal blood-shot eye illness mainly utilizes the CF feature of red eye region position red eye region and verify and then correct blood-shot eye illness, detect the efficiency of seeing red, removing blood-shot eye illness higher, but, very strong to the dependence of the CF of red eye region.
In actual photographed process, the difference of lighting condition during owing to taking pictures, background light, reference object, equipment and angle, can cause the color of red eye region and shape to have greatly changed.As: due to the change of illumination condition, the red degree in blood-shot eye illness can change a lot, and for different ethnic groups, its blood-shot eye illness degree is also not quite similar.In shooting process, the difference of the degree that eyes open also can cause seeing red shape from circular ideal to the change of class ellipse in various degree.Once the color of blood-shot eye illness has a greater change, the failure of extracting red eye region can be caused, and blood-shot eye illness has a greater change in shape, also the failure that the red eye region extracted is verified can be caused, therefore make loss when detecting red eye region and false drop rate higher, and then the leakage correction rate that result in when blood-shot eye illness is corrected and by mistake correction rate is higher.
For manually removing the mode of blood-shot eye illness, owing to by means of various aid, therefore, manual removal blood-shot eye illness is more flexible comparatively speaking, and accuracy is higher, but owing to needing manually first to detect each pixel in red eye region, then carry out pointwise reparation, so it is lower to detect the efficiency of seeing red, removing blood-shot eye illness.When particularly carrying out seeing red the operation of removing on mini-plant, more waste time and energy, the efficiency detecting and remove blood-shot eye illness is extremely low.
Therefore, a kind of method of loss and the false drop rate lower and detection that detection efficiency is high blood-shot eye illness how can be provided to become one of current problem demanding prompt solution.
Other correlation techniques about redeye detection can also be WO2007116947A1 see publication number, and denomination of invention is the international patent application of REDEYEDETECTINGAPPARATUS, REDEYEDETECTINGMETHODANDREDEYEDETECTINGPROGRAM.
Summary of the invention
The problem that the present invention solves is to provide a kind of loss, false drop rate lower and the method for the detection that detection efficiency is higher blood-shot eye illness and device, removes method and the device of blood-shot eye illness.
In order to solve the problem, the invention provides a kind of method detecting blood-shot eye illness, comprising:
Obtain the blood-shot eye illness sample point in eyes image;
Search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point;
Based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region, described preset range is relevant to the resolution of described eyes image.
For solving the problem, present invention also offers a kind of device detecting blood-shot eye illness, comprising:
Acquiring unit, for obtaining the blood-shot eye illness sample point in eyes image;
Search computing unit, for searching for the pixel in the preset range comprising described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point, described preset range is relevant to the resolution of described eyes image;
Red pixel point determining unit, for based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region.
For solving the problem, present invention also offers a kind of method removing blood-shot eye illness, comprising:
The method of above-mentioned detection blood-shot eye illness is adopted to detect red eye region;
Described red eye region is corrected.
For solving the problem, present invention also offers a kind of device removing blood-shot eye illness, comprising:
The device of above-mentioned detection blood-shot eye illness;
Correct unit, for correcting described red eye region.
Compared with prior art, technical scheme of the present invention has the following advantages:
For automatically removing the mode of blood-shot eye illness, owing to first determining blood-shot eye illness sample point and the pixel searched in preset range, and the red pixel point determined according to color distance in preset range, therefore, reduce loss when detecting blood-shot eye illness and false detection rate, and then the leakage correction rate also reduced when removing blood-shot eye illness and by mistake correction rate.For manually removing the mode of blood-shot eye illness, owing to only needing to determine blood-shot eye illness sample point and then search in the preset range comprising described blood-shot eye illness sample point, and detect and remove blood-shot eye illness without the need to manually pointwise, therefore, decrease manual detection and remove the number of times of seeing red, improve the efficiency detecting blood-shot eye illness and remove blood-shot eye illness to a great extent.
Further, by centered by described blood-shot eye illness sample point, search for the pixel in predetermined neighborhood, with based on color distance determination red pixel point, implement comparatively simple, calculated amount is little, and the search speed accelerated red pixel point, this improves the efficiency detecting blood-shot eye illness, and then also correspondingly improve the efficiency removing blood-shot eye illness.
Further, after obtaining the blood-shot eye illness sample point in eyes image, color space conversion is carried out to described eyes image, calculate color distance between the pixel in described blood-shot eye illness sample point and preset range based on different color spaces to determine red pixel point.Because color space is different, therefore the threshold value of color distance when determining red pixel point is also different, and then accurately can detect red eye region in different color space, reduce loss when detection is seen red and false drop rate, also reduce leakage correction rate when removing blood-shot eye illness and miss correction rate.Further, due to different color space can be suitable for, thus there is very large dirigibility.
Further, to the pixel in the preset range searched, based on described color distance determination black pixel point, and described black pixel point is utilized to correct the red eye region detected adaptively, thus better to the error-correcting effect of red eye region.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the method for the detection blood-shot eye illness of the embodiment of the present invention one;
Fig. 2 is the schematic diagram that the search of the embodiment of the present invention one comprises a kind of way of search of the pixel in the preset range of blood-shot eye illness sample point;
Fig. 3 is the schematic diagram that the search of the embodiment of the present invention one comprises the another kind of way of search of the pixel in the preset range of blood-shot eye illness sample point;
Fig. 4 is the schematic flow sheet of the method for the removal blood-shot eye illness of the embodiment of the present invention one;
Fig. 5 is the structural representation of the device of the detection blood-shot eye illness of the embodiment of the present invention one;
Fig. 6 is the structural representation of the device of the removal blood-shot eye illness of the embodiment of the present invention one;
Fig. 7 is the schematic flow sheet of the method for the removal blood-shot eye illness of the embodiment of the present invention two;
Fig. 8 is the structural representation of the device of the removal blood-shot eye illness of the embodiment of the present invention two.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage more become apparent, and are described in detail the specific embodiment of the present invention below in conjunction with accompanying drawing.
Set forth detail in the following description so that fully understand the present invention.But the present invention can be different from alternate manner described here to implement with multiple, those skilled in the art can when without prejudice to doing similar popularization when intension of the present invention.Therefore the present invention is not by the restriction of following public embodiment.
Just as described in the background art, when detecting red eye region in prior art, loss, false drop rate are higher and detection efficiency is lower.
Inventor proposes, and first obtains the blood-shot eye illness sample point in eyes image, searches for the pixel comprised in the preset range of described blood-shot eye illness sample point, determine red pixel point by the color distance calculated between described pixel and described blood-shot eye illness sample point.Owing to first obtaining blood-shot eye illness sample point, therefore the loss that can reduce to a certain extent when detecting blood-shot eye illness and false drop rate, on the other hand owing to being undertaken by automatic mode completely the search of the pixel in preset range, therefore, improve detection efficiency when detecting blood-shot eye illness.
Embodiment one
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of the method for the detection blood-shot eye illness of the embodiment of the present invention one, and as shown in Figure 1, the described method detecting blood-shot eye illness comprises:
Step S11: obtain the blood-shot eye illness sample point in eyes image.
Step S12: search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point.
Step S13: based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region, described preset range is relevant to the resolution of described eyes image.
Particularly, perform step S11, in this step, the acquisition of seeing red sample point in eyes image can be obtained by the aid in existing image processing software, and the red pixel point as clicked in red eye region by the aid single carried in the image processing softwares such as photoshop or acdsee by user sees red sample point to obtain.
In addition, if obtain the blood-shot eye illness sample point in eyes image on mini-plant, as: mobile terminal, then the image processing tool that can carry by means of mobile terminal is to obtain blood-shot eye illness sample point.
Perform step S12, search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point.Described preset range is relevant to the resolution of described eyes image.In general, described preset range is 0.25 ~ 0.5 times of face region area, and in order to red eye region can be searched quickly, usual described preset range is by the circle of seeing red 0.25 ~ 0.5 times that the area centered by sample point is face region area, also can be rectangle or other polygons.
In the present embodiment, the pixel in preset range can be searched for by the following two kinds mode, and calculate the color distance between described pixel and described blood-shot eye illness sample point.
Refer to Fig. 2, Fig. 2 is the schematic diagram that the search of the embodiment of the present invention one comprises a kind of way of search of the pixel in the preset range of blood-shot eye illness sample point.As shown in Figure 2, the first pixel of the predetermined neighborhood of search center pixel, described central pixel point is positioned at described preset range.The present embodiment, the central pixel point that first time searches for is the blood-shot eye illness sample point R obtained in step S11, and described predetermined neighborhood is four neighborhoods or eight neighborhood.For Fig. 2, the pixel of four neighborhoods of blood-shot eye illness sample point R is pixel 2,4,5,7; The pixel of the eight neighborhood of blood-shot eye illness sample point R is pixel 1,2,3,4,5,6,7,8.
In the present embodiment with predetermined neighborhood for eight neighborhood is described whole search procedure.First the pixel 1,2,3,4,5,6,7,8 of the eight neighborhood of search blood-shot eye illness sample point R.Calculate the color distance between pixel 1,2,3,4,5,6,7,8 and blood-shot eye illness sample point R respectively.Next, centered by the pixel once searched in the past, pixel proceeds eight neighborhood search.In the present embodiment, before the pixel that once searches be pixel 1, 2, 3, 4, 5, 6, 7, 8, then can with pixel 1, 2, 3, 4, 5, 6, 7, centered by a pixel in 8, pixel carries out eight neighborhood search, for pixel 8, then the pixel of its eight neighborhood should be pixel R, 5, 13, 7, 9, 12, 11, 10, in the present embodiment, preferably, the front pixel once searched for no longer is searched for, therefore the pixel 9 only searched for for pixel 8 in its eight neighborhood, 10, 11, 12, 13, then pixel 9 is calculated, 10, 11, 12, color distance between 13 and blood-shot eye illness sample point R.Next, centered by a pixel then in pixel 9,10,11,12,13, pixel carries out eight neighborhood search, the color distance between the pixel that calculating searches and blood-shot eye illness sample point R.Repeat the process of above-mentioned search and calculating, until final search to the region at pixel place exceed described preset range, then stop search.
Refer to Fig. 3, Fig. 3 is the schematic diagram that the search of the embodiment of the present invention one comprises the another kind of way of search of the pixel in the preset range of blood-shot eye illness sample point.As shown in Figure 3, centered by described blood-shot eye illness sample point R, search for the pixel of predetermined neighborhood.In the present embodiment, described predetermined neighborhood can be that predetermined length is the square of the length of side centered by described blood-shot eye illness sample point R; Or centered by described blood-shot eye illness sample point R, predetermined length and width are respectively long and wide rectangle.In the present embodiment, for predetermined neighborhood for square illustrates accordingly, if the coordinate of blood-shot eye illness sample point R be (x, y), then centered by described blood-shot eye illness sample point R, search for the length of side be 2 times pixel interval from the pixel of square neighborhood.Also namely searching coordinates is respectively (x-1, y), (x+1, y), (x-1, y+1), (x, y+1), (x+1, y+1), (x-1, y-1), the pixel of (x, y-1), (x+1, y-1).Corresponding in Fig. 3, be then pixel 1,2,3,4,5,6,7,8, calculate pixel 1,2,3,4, color distance between 5,6,7,8 and described blood-shot eye illness sample point R.Increase described predetermined neighborhood, then described predetermined neighborhood can be increased by increasing the default length of side in the present embodiment, as preset as described in increasing the length of side be 4 times pixel interval from, then search for the length of side be 4 times pixel interval from the pixel of square neighborhood, be then search pixel point 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 corresponding to Fig. 3.Then, calculate pixel 9,10,11,12,13,14,15,16,17,18,19,20, color distance between 21,22,23,24 and described blood-shot eye illness sample point R, increase described predetermined neighborhood, continue search, and calculate the color distance between pixel and described blood-shot eye illness sample point R searched.Repeat above-mentioned search pixel point, calculate the process of color distance and increase neighborhood, until the pixel region searched exceeds described preset range, then stop search.
By above-mentioned two kinds of modes, then can search the pixel in the preset range comprising described blood-shot eye illness sample point.Then the color distance between pixel and described blood-shot eye illness sample point searched is calculated.For different color spaces, then obtain the color distance between the pixel searched and described blood-shot eye illness sample point in different ways.In the present embodiment, for rgb color space, then the color distance between the pixel searched and described blood-shot eye illness sample point is obtained by following formula:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively.
Perform step S13, based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region.By performing step S12, searching the pixel in preset range, also having calculated the color distance between pixel and described blood-shot eye illness sample point searched simultaneously, therefore red pixel point can be determined based on described color distance.Particularly, if described color distance is greater than first threshold and is less than Second Threshold, then described pixel is red pixel point.For rgb space, described first threshold is 1, and described Second Threshold is 20.Also namely for rgb space, when the color distance between described blood-shot eye illness sample point and the pixel searched is greater than 1 and is less than 20, then the pixel searched is red pixel point.And for the color distance with described blood-shot eye illness sample point equal 1 pixel can also can not for red pixel point for red pixel point, similarly, for the pixel that the color distance with described blood-shot eye illness sample point equals 20, can be that red pixel point also can not for red pixel point, when color distance between pixel and described blood-shot eye illness sample point equals first threshold or Second Threshold, whether determine that this pixel is the accuracy requirement of red pixel point when then depending on that red eye region detects.
In the present embodiment, with the color space at eyes image place for rgb space, the color distance between blood-shot eye illness sample point and the pixel searched is illustrated, and determines that red pixel point is to obtain red eye region with the threshold value of rgb space.In order to more accurate red eye region can be obtained, after obtaining the blood-shot eye illness sample point in eyes image, color space conversion can also be carried out to described eyes image in the present embodiment, by in different color spaces, the measurement of the color distance between described blood-shot eye illness sample point and the pixel searched more accurately is determined red pixel point.
Particularly, carrying out color space conversion to described eyes image can be carried out color space conversion before searching for the pixel comprised in the preset range of described blood-shot eye illness sample point, then search for the pixel in preset range in color space after conversion, and calculate the color distance between described pixel and described blood-shot eye illness sample point.
Also can be carry out color space conversion after searching for the pixel comprised in the preset range of described blood-shot eye illness sample point, in color space after conversion, calculate the color distance between described pixel and described blood-shot eye illness sample point.
In the present embodiment, if the color space at the eyes image place of extracting is rgb space, then can be converted to any one color space in CIELab space, HSV space, yuv space.The image of rgb space being converted to CIELab space or HSV space or yuv space is prior art, so place repeats no more.
In the present embodiment, if the color space of the eyes image after changing is CIELab space, then the color distance calculated between described pixel and described blood-shot eye illness sample point is undertaken by following formula:
d = ( l - l s ) 2 + ( a - a s ) 2 + ( b - b s ) 2
Wherein, d represent pixel and blood-shot eye illness sample point between color distance, l, a, b represent respectively pixel luminance channel, from redness to the scope of green, from blueness to the scope of yellow, l s, a s, b srepresent the luminance channel of blood-shot eye illness sample point respectively, from redness to the scope of green, from blueness to the scope of yellow.
If the color space of the eyes image after changing is HSV space, then the color distance calculated between described pixel and described blood-shot eye illness sample point is undertaken by following formula:
d = α 1 ( v - v s ) 2 + β 1 ( s - s s ) 2 + ( h - h s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and h, s, v represent the tone of pixel, saturation degree and brightness respectively, h s, s s, v srepresent the tone of blood-shot eye illness sample point, saturation degree and brightness respectively, α 1, β 1represent weight coefficient.
If the color space of the eyes image after changing is yuv space, then the color distance calculated between described pixel and described blood-shot eye illness sample point is undertaken by following formula:
d = α 2 ( y - y s ) 2 + β 2 ( u - u s ) 2 + ( v - v s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and y represents that brightness u, v of pixel represent the colourity of pixel, y srepresent the brightness of blood-shot eye illness sample point, u s, v srepresent the colourity of blood-shot eye illness sample point, α 2, β 2represent weight coefficient.
And correspond to above-mentioned CIELab space or HSV space or yuv space, when it determines red pixel point, also be that the color distance between the blood-shot eye illness sample point calculated at each color space and the pixel searched is judged, when described color distance is greater than first threshold and is less than Second Threshold, described pixel is then red pixel point.Unlike, for different color spaces, the value of described first threshold, Second Threshold is had nothing in common with each other, and specifically in different color spaces, described first threshold, Second Threshold get how many, tested determine by reality.
In addition, it should be noted that, in the present embodiment, obtain blood-shot eye illness sample point by means of the aid in image processing software by the mode that single is clicked by user, and in other embodiments, also multiple blood-shot eye illness sample point can be obtained by user by repeatedly clicking, the pre-stator range comprising described blood-shot eye illness sample point is all existed for each the blood-shot eye illness sample point obtained, to the scope that the pre-stator range corresponding to each blood-shot eye illness sample point asks union to obtain, for finally comprising the preset range of multiple blood-shot eye illness sample point.Then based on this preset range search pixel point, and the color distance calculated between the pixel that searches and multiple blood-shot eye illness sample point is to determine red pixel point.
Determine red pixel point by above-mentioned mode, the region at described red pixel point place is the red eye region detected.After red eye region being detected, next described red eye region is corrected, namely remove described red eye region.
Refer to Fig. 4, Fig. 4 is the schematic flow sheet of the method for the removal blood-shot eye illness of the embodiment of the present invention one, and as shown in Figure 4, the described method removing blood-shot eye illness comprises:
Step S11: obtain the blood-shot eye illness sample point in eyes image.
Step S12: search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point.
Step S13: based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region, described preset range is relevant to the resolution of described eyes image.
Step S14: based on described color distance determination black pixel point, utilize described black pixel point to correct described red eye region.
In the present embodiment, the process that execution step S11 ~ S13 detection red eye region and above-mentioned detection are seen red is similar, repeats no more herein.
Perform step S14: based on described color distance determination black pixel point, utilize described black pixel point to correct described red eye region.Searched for the pixel in the preset range comprising described blood-shot eye illness sample point by above-mentioned step S11 and S12, concrete search procedure can see the description in the above-mentioned method detecting blood-shot eye illness.In the present embodiment, still with the color space at eyes image place for rgb space illustrates accordingly, then the obtain manner of described color distance is identical with above-mentioned steps S12, unlike, for the pixel searched, when color distance between itself and described blood-shot eye illness sample point is greater than the 3rd threshold value and is less than the 4th threshold value, then this pixel searched is black pixel point.Be 20 for the 3rd threshold value described in rgb space, described 4th threshold value is 40.Also the color distance namely between the pixel searched and described blood-shot eye illness sample point is greater than 20 when being less than 40, and this pixel is black pixel point.And for the color distance with described blood-shot eye illness sample point equal 20 pixel can also can not for black pixel point for black pixel point, similarly, for the pixel that the color distance with described blood-shot eye illness sample point equals 40, can be that black pixel point also can not for black pixel point, when color distance between pixel and described blood-shot eye illness sample point equals the 3rd threshold value or the 4th threshold value, whether determine that this pixel is the accuracy requirement of black pixel point when then depending on that red eye region detects.
In addition, owing to being utilize the black pixel point that searches to correct red eye region in the present embodiment, therefore the black pixel point searched is more accurate then correct after the effect of red eye region better, therefore when determining black pixel point in the present embodiment, also can carry out at different color spaces, specific formula for calculation can see the computing formula of seeing red the color distance between sample point and the pixel searched in above-mentioned CIELab space or HSV space or yuv space.Only correspond to no color space, the value of the 3rd threshold value and the 4th threshold value is different, specifically gets what value and is tested by reality and determine.
In the present embodiment, utilize described black pixel point to correct described red eye region and carry out especially by following formula:
R new = α * G old + B old 2 + ( 1 -α ) * R ‾ black
G new = α * G old + ( 1 - α ) * G black * R new R ‾ black
B new = α * B old + ( 1 - α ) * B ‾ black * R new R ‾ black
Wherein, R new, G new, B newbe respectively the red channel value of pixel after correction in described red eye region, green channel value, blue channel value, G old, B oldbe respectively the green channel value of pixel before correction, the blue channel value in described red eye region, the green channel value of red pixel point and blue channel value in the red eye region also namely detected.
be respectively the red channel value mean value of black pixel point, green channel value mean value, blue channel value mean value, particularly, exactly the red channel value phase adduction of all black pixel points searched is obtained to red channel value mean value divided by the sum of black pixel point, the green channel value phase adduction of all black pixel points searched is obtained to green channel value mean value divided by the sum of black pixel point, obtains blue channel value mean value to the blue channel value phase adduction of all black pixel points searched divided by the sum of black pixel point.α is weight factor, α ∈ [0,1].
By above-mentioned correcting method, the red eye region detected is corrected, and the green channel value of employing black pixel point and the red pixel point before correcting, blue channel value are corrected red eye region, because it has taken into account the pixel value of red pixel point self and black pixel point around thereof, corresponding adjustment has been carried out to the RGB triple channel value of the pixel after correction, therefore, achieve the desaturation effect of the red eye region after to correction, and red eye region after correcting is relatively natural, effect is better.
Corresponding to the method for above-mentioned detection blood-shot eye illness, the embodiment of the present invention also provides a kind of device detecting blood-shot eye illness, refers to Fig. 5, and Fig. 5 is the structural representation of the device of the detection blood-shot eye illness of the embodiment of the present invention one, and as shown in Figure 5, the described device 1 detecting blood-shot eye illness comprises:
Acquiring unit 10, for obtaining the blood-shot eye illness sample point in eyes image.
Search computing unit 11, be connected with described acquiring unit 10, for searching for the pixel in the preset range comprising described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point, described preset range is relevant to the resolution of described eyes image.
Red pixel point determining unit 12, is connected with described search computing unit 11, for based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region.
In the present embodiment, described search computing unit 11 comprises:
First search subelement 110, be connected with described acquiring unit 10, for the pixel of the predetermined neighborhood of search center pixel, described central pixel point is positioned at described preset range.
First computing unit 111, searches for subelement 110 with described first, red pixel point determining unit 12 is connected, for calculating the color distance between pixel and described blood-shot eye illness sample point searched.
First control module 112, search for subelement 110, first computing unit 111 be connected with described first, when region for the pixel place searched at described first search subelement 110 does not exceed described preset range, control described first search subelement 110, first computing unit 111 and work; Wherein, the central pixel point that first time searches for is described blood-shot eye illness sample point, the pixel that later central pixel point of searching for for each time once searches before being.
In the present embodiment, the predetermined neighborhood of described first search subelement 110 search center pixel can be neighbours territory, also can be eight neighborhood.In the present embodiment, preferably, the pixel of the not searched mistake of the predetermined neighborhood of described first search subelement 110 search center pixel.
In other embodiments, described search computing unit comprises:
Second search subelement (not shown), for searching for the pixel of predetermined neighborhood centered by described blood-shot eye illness sample point.
Second computing unit (not shown), searches for subelement be connected, for calculating the color distance between described pixel and described blood-shot eye illness sample point with described second.
Second control module (not shown), search for subelement with described second, the second computing unit is connected, when pixel region for searching at described second search subelement not exceeding described preset range, increasing described predetermined neighborhood union and controlling described second search subelement, the second computing unit work.
In the present embodiment, the described device 1 detecting blood-shot eye illness also comprises: color space converting unit (not shown), for obtain the blood-shot eye illness sample point in eyes image at described acquiring unit 10 after, carry out color space conversion to described eyes image.Described search computing unit 11 is for calculating pixel described in the color space after conversion and the color distance between described blood-shot eye illness sample point.
In the present embodiment, if the color space of described eyes image is rgb space, described color space converting unit is used for any one color space be converted to by described eyes image in CIELab space, HSV space, yuv space.
Particularly, if described eyes image is converted to CIELab space by described color space converting unit, then described search computing unit 11 is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = ( l - l s ) 2 + ( a - a s ) 2 + ( b - b s ) 2
Wherein, d represent pixel and blood-shot eye illness sample point between color distance, l, a, b represent respectively pixel luminance channel, from redness to the scope of green, from blueness to the scope of yellow, l s, a s, b srepresent the luminance channel of blood-shot eye illness sample point respectively, from redness to the scope of green, from blueness to the scope of yellow.
If described eyes image is converted to HSV space by described color space converting unit, then described search computing unit 11 is by pixel described in following formulae discovery and the color distance between described blood-shot eye illness sample point
d = α 1 ( v - v s ) 2 + β 1 ( s - s s ) 2 + ( h - h s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and h, s, v represent the tone of pixel, saturation degree and brightness respectively, h s, s s, v srepresent the tone of blood-shot eye illness sample point, saturation degree and brightness respectively, α 1, β 1represent weight coefficient.
If described eyes image is converted to yuv space by described color space converting unit, then described search computing unit 11 is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = α 2 ( y - y s ) 2 + β 2 ( u - u s ) 2 + ( v - v s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and y represents that brightness u, v of pixel represent the colourity of pixel, y srepresent the brightness of blood-shot eye illness sample point, u s, v srepresent the colourity of blood-shot eye illness sample point, α 2, β 2represent weight coefficient.
In the present embodiment, described red pixel point determining unit 12 comprises: the first judging unit (not shown), for when described color distance is greater than first threshold and is less than Second Threshold, judges that described pixel is red pixel point.
In the present embodiment, when the color space of described eyes image is rgb space, described search computing unit 11 is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively.Now, described first judging unit is used for when described color distance is greater than 1 and is less than 20, judges that described pixel is red pixel point.
It should be noted that, for above-mentioned different color space, the color distance formula of its correspondence between the described blood-shot eye illness sample point of corresponding calculating and the pixel searched, when now based on first threshold and Second Threshold, the first judging unit judges that the pixel searched is red pixel point, the value of described first threshold, Second Threshold is determined by the actual test carried out at this color space.
In the present embodiment, the described course of work detecting the device of blood-shot eye illness can be carried out see the method for above-mentioned detection blood-shot eye illness, repeats no more herein.
Corresponding to the method for above-mentioned removal blood-shot eye illness, the embodiment of the present invention also provides a kind of device removing blood-shot eye illness, refers to Fig. 6, and Fig. 6 is the structural representation of the device of the removal blood-shot eye illness of the embodiment of the present invention one, and as shown in Figure 6, the described device removing blood-shot eye illness comprises:
The device 1 of above-mentioned detection blood-shot eye illness.
Correcting unit 13, being connected, for correcting described red eye region with the described device 1 of seeing red that detects.
In the present embodiment, in order to make the effect of the red eye region after correcting better, the described device removing blood-shot eye illness also comprises:
Black pixel point determining unit 14, is connected with the described device 1 of seeing red that detects, for based on described color distance determination black pixel point.
Described correction unit 13, is connected with described black pixel point determining unit 14, corrects described red eye region for utilizing described black pixel point.
In the present embodiment, described black pixel point determining unit 14 comprises: the second judging unit (not shown), during for being greater than the 3rd threshold value at described color distance and being less than the 4th threshold value, judges that described pixel is black pixel point.
In the present embodiment, be rgb space at the color space of described eyes image, described search computing unit 11 is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively.Now, described second judging unit is used for when described color distance is greater than 20 and is less than 40, judges that described pixel is black pixel point.
Described correction unit 13 is corrected described red eye region by following formula:
R new = α * G old + B old 2 + ( 1 -α ) * R ‾ black
G new = α * G old + ( 1 - α ) * G black * R new R ‾ black
B new = α * B old + ( 1 - α ) * B ‾ black * R new R ‾ black
Wherein, R new, G new, B newbe respectively the red channel value of pixel after correction in described red eye region, green channel value, blue channel value, G old, B oldbe respectively the green channel value of pixel before correction, the blue channel value in described red eye region, the green channel value of red pixel point and blue channel value in the red eye region also namely detected.
be respectively the red channel value mean value of black pixel point, green channel value mean value, blue channel value mean value.α is weight factor, α ∈ [0,1].
It should be noted that, the formula calculating the color distance between described blood-shot eye illness sample point and the pixel searched at different color spaces is given in the present embodiment, the value of first threshold, Second Threshold, the 3rd threshold value and the 4th threshold value when judging red pixel point or black pixel point based on described color distance is then fixed according to reality test, therefore, the value of described first threshold, Second Threshold, the 3rd threshold value and the 4th threshold value should as the restriction to technical solution of the present invention.
In the present embodiment, the course of work removing the device of blood-shot eye illness can be carried out see the method for above-mentioned removal blood-shot eye illness, no longer launches concrete detailed description in detail herein.
Embodiment two
In the present embodiment, detect in the method and embodiment one of seeing red similar, unlike, the method removing blood-shot eye illness in the present embodiment is not identical with embodiment one, the red eye region that its method removing blood-shot eye illness further comprises correcting judges accordingly, to judge whether the red eye region after correcting is correct region by mistake, during in the region of correcting for correcting region by mistake, it is suppressed.
Refer to Fig. 7, Fig. 7 is the schematic flow sheet of the method for the removal blood-shot eye illness of the embodiment of the present invention two, and as shown in Figure 7, the described method removing blood-shot eye illness comprises:
Step S11: obtain the blood-shot eye illness sample point in eyes image.
Step S12: search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point.
Step S13: based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region, described preset range is relevant to the resolution of described eyes image.
Step S14 ': described red eye region is corrected.
Step S15: the mistake obtained in the red eye region after correcting based on texture analysis corrects region.
Step S16: utilize medium filtering to suppress described region of correcting by mistake.
In the present embodiment, similar in step S11 ~ S13 and embodiment one, so place no longer launches concrete detailed description in detail.Perform step S14 ' to correct described red eye region, prior art can be utilized to correct red eye region, and in the present embodiment, the average of the pixel value of the pixel in the black eyeball region near the red eye region that detects can be utilized to replace the pixel value of the pixel in red eye region.Described black eyeball region refers to the region with described red eye region with nest relation, described black eyeball region can utilize the color characteristic in black eyeball region and shape facility and obtain with the position relationship of described red eye region, as obtained black region by different color segmentation methods, then the shape of black region obtained and position relationship are judged, if the shape of the black region obtained is circular, similar round, oval, a kind of in class ellipse and there is nest relation with the red eye region detected, then this black region is black eyeball region.After obtaining black eyeball region, 6 ~ 12 pixels in the black eyeball region of fetch bit near described red eye region, calculate the average of the pixel value of 6 ~ 12 pixels, for 6 pixels, then divided by 6 by the pixel value phase adduction of 6 pixels, to obtain the average of the pixel value of 6 pixels, and the pixel value using this average as the pixel of described red eye region.
Further, in the present embodiment, in order to reduce the mistake correction rate to the red eye region detected, perform step S15, the mistake obtained in the red eye region after correcting based on texture analysis corrects region.
Particularly, obtain the degree of uniformity of the red degree of the pixel in the red eye region detected in preset range, described preset range is associated with the size of described red eye region.
If described degree of uniformity reaches preset value, then the red eye region after described correction is for correct region by mistake.
The described red eye region detected be with correct after the red eye region detected corresponding to red eye region.Preset range in the described red eye region detected, it can be 1/1 to four/2nd of described red eye region, preferably, get 1/2nd of described red eye region, and described preset range can be the arbitrary region in described red eye region, if guarantee preset range still belong to described red eye region and for red eye region 1/1 to four/2nd.In the present embodiment, described in the degree of uniformity of red degree of pixel in the red eye region that detects in preset range obtain in the following way:
I a = Σ i = 1 N I i N , E = Σ i = 1 N ( I i - I a ) 2 N
Wherein, I ibe the red degree of i-th pixel, I afor the mean value of the red degree of the pixel in preset range in the red eye region that detects, N is the number of the pixel in preset range, and E is the degree of uniformity of the red degree of pixel in the red eye region detected in preset range.
In general, if the red eye region after correcting is wrong, to be likely eye lip portion flase drop be red eye region and then correct it, therefore, the degree of uniformity of the red degree of the pixel in preset range in (before the correction) red eye region detected is detected accordingly, if the degree of uniformity of the red degree of the pixel in this preset range is poor, then prove that this region should be a lip, in the present embodiment with the standard variance of the red degree of the pixel in preset range in the red eye region detected to weigh the degree of uniformity of red degree, therefore the standard variance of described red degree is less, the degree of uniformity representing the red degree in this region is better, therefore, weigh for the degree of uniformity of red degree for adopting the standard variance of red degree of pixel, the degree of uniformity of redness degree reaches preset value, when then referring to that the standard variance of the red degree of the pixel in the red eye region detected in preset range is greater than the first predetermined threshold value, judge that the red eye region after correcting is wrong.Described in the present embodiment, the first predetermined threshold value is more than or equal to 0.1 and is less than or equal to 0.3.
Mode according to other weighs the degree of uniformity of the red degree of the pixel in the red eye region detected in preset range, as adopted the degree of scatter of red texture to weigh the words of the degree of uniformity of the red degree of the pixel in preset range, then the degree of scatter of the red texture in this region is larger, degree of uniformity is better, now for adopting the degree of scatter of red texture to weigh for the degree of uniformity of the red degree of the pixel in preset range, the degree of uniformity of redness degree reaches preset value, when then referring to that the degree of scatter of the red texture of the pixel in the red eye region detected in preset range is less than the second predetermined threshold value, judge that the red eye region detected is wrong.Described second predetermined threshold value is tested by reality and is determined.
After determining the red eye region of by mistake correcting, perform step S16, utilize medium filtering to suppress described region of correcting by mistake.The chromatic value arranging the described pixel by mistake corrected in region is particularly described intermediate value of by mistake correcting the chromatic value of pixel before correction in region.
In the present embodiment, the space at the eyes image place of acquisition is rgb space, and determines red pixel point based on the color distance that rgb space calculates between blood-shot eye illness sample point and the pixel searched and then detect red eye region.But, due to the characteristic of human visual system, when the red eye region detected is corrected, normally carry out at yuv space, after red eye region being corrected, be converted to rgb space again.Therefore, to when correction region suppresses by mistake in the present embodiment, first the value of pixel R, G, B of this pixel before correction of by mistake correcting in region is converted to Y, U, V value in yuv space.In addition, to when correction region suppresses by mistake, the impact of brightness is not very large, therefore to when correction region suppresses by mistake, only can consider colourity (brightness is constant), all can consider brightness and colourity yet.
Therefore, when the described region of correction is by mistake suppressed, the chromatic value of all pixels in the region before correction can be calculated particularly, and using the intermediate value of all chromatic values as the chromatic value (brightness value is constant) correcting the pixel in region by mistake.After the chromatic value of the pixel by mistake corrected in region is determined, then the chromatic value and brightness value of correcting the pixel in region are converted to by mistake the value of corresponding R, G, B, to complete the described suppression correcting region by mistake.
Or, calculate chromatic value and the brightness value of all pixels in the region before correcting, and using the intermediate value of the intermediate value of all chromatic values, brightness value as chromatic value and the brightness value of correcting the pixel in region by mistake.After the chromatic value of the pixel by mistake in correction region and brightness value are determined, then the chromatic value and brightness value of correcting the pixel in region are converted to by mistake the value of corresponding R, G, B, to complete the described suppression correcting region by mistake.
In the present embodiment, be converted to yuv space from rgb space and undertaken by following formula:
Y U V = 0.299 0.587 0.114 - 0.147 - 0.289 0.436 0.615 - 0.515 - 0.100 R G B
Be converted to rgb space from yuv space to be undertaken by following formula:
R G B = 1 0 . 000 1 . 140 1 - 0.396 - 0 . 581 1 2.029 0.000 R G B
In addition, in the present embodiment, when utilizing medium filtering to suppress the described region of correction by mistake.The chromatic value that also can arrange the described pixel by mistake corrected in region is described intermediate value of by mistake correcting the chromatic value of pixel before correction of setting range in region.Namely the intermediate value by mistake need not correcting the chromatic value of all pixels before correction in region suppresses described region of correcting by mistake, but only utilizing described intermediate value of by mistake correcting the chromatic value of pixel before correction of setting range in region to suppress described region of correcting by mistake, the size of the preset range during degree of uniformity of the red degree of the pixel in the red eye region that described setting range can detect with above-mentioned acquisition in preset range is identical.Only utilize described intermediate value of by mistake correcting the chromatic value of pixel before correction of setting range in region to suppress correcting region by mistake, can operand be reduced to a certain extent.
Corresponding to the method for above-mentioned removal blood-shot eye illness, the present embodiment also provides a kind of device removing blood-shot eye illness, refers to Fig. 8, and Fig. 8 is the structural representation of the device of the removal blood-shot eye illness of the embodiment of the present invention two, and as shown in Figure 8, the described device removing blood-shot eye illness comprises:
First acquiring unit 20, for obtaining the blood-shot eye illness sample point in eyes image.
Search computing unit 21, be connected with described first acquiring unit 20, for searching for the pixel in the preset range comprising described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point, described preset range is relevant to the resolution of described eyes image.
Red pixel point determining unit 22, is connected with described search computing unit 21, for based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region.
Correcting unit 23, being connected, for correcting described red eye region with described red pixel point determining unit 22.
Second acquisition unit 24, is connected with described correction unit 23, for obtaining the mistake correction region in the red eye region after correcting based on texture analysis.
Suppressing unit 25, be connected with described second acquisition unit 24, for utilizing medium filtering, described region of by mistake correcting being suppressed.
The course of work removing the device of blood-shot eye illness described in the present embodiment can be carried out see the method for above-mentioned removal blood-shot eye illness, repeats no more herein.
In sum, technical scheme of the present invention at least has following beneficial effect:
For automatically removing the mode of blood-shot eye illness, owing to first determining blood-shot eye illness sample point and the pixel searched in preset range, and the red pixel point determined according to color distance in preset range, therefore, reduce loss when detecting blood-shot eye illness and false detection rate, and then the leakage correction rate also reduced when removing blood-shot eye illness and by mistake correction rate.For manually removing the mode of blood-shot eye illness, owing to only needing to determine blood-shot eye illness sample point and then search in the preset range comprising described blood-shot eye illness sample point, and detect and remove blood-shot eye illness without the need to manually pointwise, therefore, decrease manual detection and remove the number of times of seeing red, improve the efficiency detecting blood-shot eye illness and remove blood-shot eye illness to a great extent.
Further, by centered by described blood-shot eye illness sample point, search for the pixel in predetermined neighborhood, with based on color distance determination red pixel point, implement comparatively simple, calculated amount is little, and the search speed accelerated red pixel point, this improves the efficiency detecting blood-shot eye illness, and then also correspondingly improve the efficiency removing blood-shot eye illness.
Further, after obtaining the blood-shot eye illness sample point in eyes image, color space conversion is carried out to described eyes image, calculate color distance between the pixel in described blood-shot eye illness sample point and preset range based on different color spaces to determine red pixel point.Because color space is different, therefore the threshold value of color distance when determining red pixel point is also different, and then accurately can detect red eye region in different color space, reduce loss when detection is seen red and false drop rate, also reduce leakage correction rate when removing blood-shot eye illness and miss correction rate.Further, due to different color space can be suitable for, thus there is very large dirigibility.
Further, to the pixel in the preset range searched, based on described color distance determination black pixel point, and described black pixel point is utilized to correct the red eye region detected adaptively, thus better to the error-correcting effect of red eye region.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; the Method and Technology content of above-mentioned announcement can be utilized to make possible variation and amendment to technical solution of the present invention; therefore; every content not departing from technical solution of the present invention; the any simple modification done above embodiment according to technical spirit of the present invention, equivalent variations and modification, all belong to the protection domain of technical solution of the present invention.

Claims (28)

1. remove a method for blood-shot eye illness, it is characterized in that, comprising:
Detect red eye region, comprising: obtain the blood-shot eye illness sample point in eyes image; Search for the pixel comprised in the preset range of described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point; Based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region, described preset range is relevant to the resolution of described eyes image;
Based on described color distance determination black pixel point;
Utilize described black pixel point to correct described red eye region, undertaken by following formula:
R n e w = α * G o l d + B o l d 2 + ( 1 - α ) * R ‾ b l a c k
G n e w = α * G o l d + ( 1 - α ) * G ‾ b l a c k * R n e w R ‾ b l a c k
B n e w = α * B o l d + ( 1 - α ) * B ‾ b l a c k * R n e w R ‾ b l a c k
Wherein, R new, G new, B newbe respectively the red channel value of pixel after correction in described red eye region, green channel value, blue channel value, G old, B oldbe respectively the green channel value of pixel before correction in described red eye region, blue channel value, be respectively the red channel value mean value of black pixel point, green channel value mean value, blue channel value mean value, α is weight factor, α ∈ [0,1].
2. the as claimed in claim 1 method removing blood-shot eye illness, is characterized in that, describedly comprises based on described color distance determination black pixel point:
If described color distance is greater than the 3rd threshold value and be less than the 4th threshold value, then described pixel is black pixel point.
3. the method removing blood-shot eye illness as claimed in claim 2, it is characterized in that, the color space of described eyes image is rgb space, and the color distance between the described pixel of described calculating and described blood-shot eye illness sample point is undertaken by following formula:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively;
Described 3rd threshold value is 20, and described 4th threshold value is 40.
4. the method removing blood-shot eye illness as claimed in claim 1, it is characterized in that, described search comprises the pixel in the preset range of described blood-shot eye illness sample point, and the color distance calculated between described pixel and described blood-shot eye illness sample point comprises:
The pixel of the predetermined neighborhood of search center pixel, described central pixel point is positioned at described preset range;
Calculate the color distance between pixel and described blood-shot eye illness sample point searched;
Repeat said process, until the region at the pixel place searched exceeds described preset range, wherein, the central pixel point that first time searches for is described blood-shot eye illness sample point, the pixel that later central pixel point of searching for for each time once searches before being.
5. the method removing blood-shot eye illness as claimed in claim 4, it is characterized in that, described predetermined neighborhood is four neighborhoods or eight neighborhood.
6. the method removing blood-shot eye illness as claimed in claim 4, it is characterized in that, the pixel of the predetermined neighborhood of described search center pixel refers to the pixel of the not searched mistake of the predetermined neighborhood of search center pixel.
7. the method removing blood-shot eye illness as claimed in claim 1, it is characterized in that, described search comprises the pixel in the preset range of described blood-shot eye illness sample point, and the color distance calculated between described pixel and described blood-shot eye illness sample point comprises:
The pixel of predetermined neighborhood is searched for centered by described blood-shot eye illness sample point;
Calculate the color distance between described pixel and described blood-shot eye illness sample point;
Increase described predetermined neighborhood, repeat said process, until the pixel region searched exceeds described preset range.
8. the method removing blood-shot eye illness as claimed in claim 1, it is characterized in that, also comprise: after obtaining the blood-shot eye illness sample point in eyes image, carry out color space conversion to described eyes image, the color distance between described pixel and described blood-shot eye illness sample point refers to the color distance described in color space after conversion between pixel and described blood-shot eye illness sample point.
9. the method removing blood-shot eye illness as claimed in claim 8, it is characterized in that, the color space of described eyes image is rgb space, described to eyes image carry out color space conversion comprise: described eyes image is converted to any one color space in CIELab space, HSV space, yuv space.
10. the method removing blood-shot eye illness as claimed in claim 9, it is characterized in that, the color space of the eyes image after changing is CIELab space, and the color distance between the described pixel of described calculating and described blood-shot eye illness sample point is undertaken by following formula:
d = ( l - l s ) 2 + ( a - a s ) 2 + ( b - b s ) 2
Wherein, d represent pixel and blood-shot eye illness sample point between color distance, l, a, b represent respectively pixel luminance channel, from redness to the scope of green, from blueness to the scope of yellow, l s, a s, b srepresent the luminance channel of blood-shot eye illness sample point respectively, from redness to the scope of green, from blueness to the scope of yellow.
11. remove the method for seeing red as claimed in claim 9, and it is characterized in that, the color space of the eyes image after changing is HSV space, and the color distance between the described pixel of described calculating and described blood-shot eye illness sample point is undertaken by following formula:
d = α 1 ( v - v s ) 2 + β 1 ( s - s s ) 2 + ( h - h s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and h, s, v represent the tone of pixel, saturation degree and brightness respectively, h s, s s, v srepresent the tone of blood-shot eye illness sample point, saturation degree and brightness respectively, α 1, β 1represent weight coefficient.
12. remove the method for seeing red as claimed in claim 9, and it is characterized in that, the color space of the eyes image after changing is yuv space, and the color distance between the described pixel of described calculating and described blood-shot eye illness sample point is undertaken by following formula:
d = α 2 ( y - y s ) 2 + β 2 ( u - u s ) 2 + ( v - v s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and y represents that brightness u, v of pixel represent the colourity of pixel, y srepresent the brightness of blood-shot eye illness sample point, u s, v srepresent the colourity of blood-shot eye illness sample point, α 2, β 2represent weight coefficient.
13. methods removing as claimed in claim 1 blood-shot eye illness, is characterized in that, describedly comprise based on described color distance determination red pixel point:
If described color distance is greater than first threshold and is less than Second Threshold, then described pixel is red pixel point.
14. remove the method for seeing red as claimed in claim 13, and it is characterized in that, the color space of described eyes image is rgb space, and the color distance between the described pixel of described calculating and described blood-shot eye illness sample point is undertaken by following formula:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively;
Described first threshold is 1, and described Second Threshold is 20.
15. 1 kinds of devices removing blood-shot eye illness, is characterized in that, comprising:
Detect the device of blood-shot eye illness, the device of described detection blood-shot eye illness comprises: acquiring unit, for obtaining the blood-shot eye illness sample point in eyes image; Search computing unit, for searching for the pixel in the preset range comprising described blood-shot eye illness sample point, calculate the color distance between described pixel and described blood-shot eye illness sample point, described preset range is relevant to the resolution of described eyes image;
Red pixel point determining unit, for based on described color distance determination red pixel point, with the region at described red pixel point place for red eye region;
Black pixel point determining unit, for based on described color distance determination black pixel point;
Correcting unit, for utilizing described black pixel point to correct described red eye region, by following formula, described red eye region being corrected:
R n e w = α * G o l d + B o l d 2 + ( 1 - α ) * R ‾ b l a c k
G n e w = α * G o l d + ( 1 - α ) * G ‾ b l a c k * R n e w R ‾ b l a c k
B n e w = α * B o l d + ( 1 - α ) * B ‾ b l a c k * R n e w R ‾ b l a c k
Wherein, R new, G new, B newbe respectively the red channel value of pixel after correction in described red eye region, green channel value, blue channel value, G old, B oldbe respectively the green channel value of pixel before correction in described red eye region, blue channel value, be respectively the red channel value mean value of black pixel point, green channel value mean value, blue channel value mean value, α is weight factor, α ∈ [0,1].
16. remove the device of seeing red as claimed in claim 15, it is characterized in that, described black pixel point determining unit comprises: the second judging unit, during for being greater than the 3rd threshold value at described color distance and being less than the 4th threshold value, judges that described pixel is black pixel point.
17. remove the device of seeing red as claimed in claim 16, and it is characterized in that, the color space of described eyes image is rgb space, and described search computing unit is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively;
Described second judging unit is used for when described color distance is greater than 20 and is less than 40, judges that described pixel is black pixel point.
18. remove the device of seeing red as claimed in claim 15, and it is characterized in that, described search computing unit comprises:
First search subelement, for the pixel of the predetermined neighborhood of search center pixel, described central pixel point is positioned at described preset range;
First computing unit, for calculating the color distance between pixel and described blood-shot eye illness sample point searched;
First control module, when the region for the pixel place searched at described first search subelement does not exceed described preset range, controls said units work; Wherein, the central pixel point that first time searches for is described blood-shot eye illness sample point, the pixel that later central pixel point of searching for for each time once searches before being.
19. remove the device of seeing red as claimed in claim 18, and it is characterized in that, described predetermined neighborhood is four neighborhoods or eight neighborhood.
20. remove the device of seeing red as claimed in claim 18, it is characterized in that, the pixel of the not searched mistake of the predetermined neighborhood of described first search subelement search center pixel.
21. remove the device of seeing red as claimed in claim 15, and it is characterized in that, described search computing unit comprises:
Second search subelement, for searching for the pixel of predetermined neighborhood centered by described blood-shot eye illness sample point;
Second computing unit, for calculating the color distance between described pixel and described blood-shot eye illness sample point;
Second control module, when the pixel region for searching at described second search subelement not exceeding described preset range, increasing described predetermined neighborhood union and controlling said units work.
22. remove the device of seeing red as claimed in claim 15, it is characterized in that, also comprise: color space converting unit, for carrying out color space conversion to described eyes image after the blood-shot eye illness sample point in described acquiring unit acquisition eyes image;
Described search computing unit is for calculating pixel described in the color space after conversion and the color distance between described blood-shot eye illness sample point.
23. remove the device of seeing red as claimed in claim 22, it is characterized in that, the color space of described eyes image is rgb space, and described color space converting unit is used for any one color space be converted to by described eyes image in CIELab space, HSV space, yuv space.
24. remove the device of seeing red as claimed in claim 23, it is characterized in that, described eyes image is converted to CIELab space by described color space converting unit, and described search computing unit is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = ( l - l s ) 2 + ( a - a s ) 2 + ( b - b s ) 2
Wherein, d represent pixel and blood-shot eye illness sample point between color distance, l, a, b represent respectively pixel luminance channel, from redness to the scope of green, from blueness to the scope of yellow, l s, a s, b srepresent the luminance channel of blood-shot eye illness sample point respectively, from redness to the scope of green, from blueness to the scope of yellow.
25. remove the device of seeing red as claimed in claim 23, it is characterized in that, described eyes image is converted to HSV space by described color space converting unit, and described search computing unit is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = α 1 ( v - v s ) 2 + β 1 ( s - s s ) 2 + ( h - h s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and h, s, v represent the tone of pixel, saturation degree and brightness respectively, h s, s s, v srepresent the tone of blood-shot eye illness sample point, saturation degree and brightness respectively, α 1, β 1represent weight coefficient.
26. remove the device of seeing red as claimed in claim 23, it is characterized in that, described eyes image is converted to yuv space by described color space converting unit, and described search computing unit is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = α 2 ( y - y s ) 2 + β 2 ( u - u s ) 2 + ( v - v s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and y represents that brightness u, v of pixel represent the colourity of pixel, y srepresent the brightness of blood-shot eye illness sample point, u s, v srepresent the colourity of blood-shot eye illness sample point, α 2, β 2represent weight coefficient.
27. remove the device of seeing red as claimed in claim 15, it is characterized in that, described red pixel point determining unit comprises: the first judging unit, for when described color distance is greater than first threshold and is less than Second Threshold, judges that described pixel is red pixel point.
28. remove the device of seeing red as claimed in claim 27, and it is characterized in that, the color space of described eyes image is rgb space, and described search computing unit is by the color distance described in following formulae discovery between pixel and described blood-shot eye illness sample point:
d = ( R - R s ) 2 + ( G - G s ) 2 + ( B - B s ) 2
Wherein, d represents the color distance between pixel and blood-shot eye illness sample point, and R, G, B represent the red channel value of pixel, green channel value, blue channel value respectively, R s, G s, B srepresent red channel value, green channel value, the blue channel value of blood-shot eye illness sample point respectively;
Described first judging unit is used for when described color distance is greater than 1 and is less than 20, judges that described pixel is red pixel point.
CN201210021206.3A 2012-01-30 2012-01-30 Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device Active CN103226689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210021206.3A CN103226689B (en) 2012-01-30 2012-01-30 Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210021206.3A CN103226689B (en) 2012-01-30 2012-01-30 Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device

Publications (2)

Publication Number Publication Date
CN103226689A CN103226689A (en) 2013-07-31
CN103226689B true CN103226689B (en) 2016-04-13

Family

ID=48837130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210021206.3A Active CN103226689B (en) 2012-01-30 2012-01-30 Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device

Country Status (1)

Country Link
CN (1) CN103226689B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801249A (en) * 2018-12-27 2019-05-24 深圳豪客互联网有限公司 Image interfusion method, device, computer equipment and storage medium
CN113034509A (en) * 2021-02-26 2021-06-25 北京达佳互联信息技术有限公司 Image processing method and device
CN115564971B (en) * 2022-07-18 2023-06-16 广东柏奴斯股份有限公司 Woven belt flame retardant performance test method based on gray level co-occurrence matrix

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102171723A (en) * 2008-08-01 2011-08-31 惠普开发有限公司 Method for red-eye detection

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7403654B2 (en) * 2004-10-04 2008-07-22 Arcsoft, Inc. Enhanced automatic red eye removal

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102171723A (en) * 2008-08-01 2011-08-31 惠普开发有限公司 Method for red-eye detection

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RGB颜色空间的矢量_角度距离色差公式;杨振亚等;《计算机工程与应用》;20100221;第46卷(第6期);154,155 *
图像的色彩空间研究;文山等;《六盘水师范高等专科学校学报》;20051230;第17卷(第6期);15-18 *

Also Published As

Publication number Publication date
CN103226689A (en) 2013-07-31

Similar Documents

Publication Publication Date Title
US8184900B2 (en) Automatic detection and correction of non-red eye flash defects
TWI532385B (en) White balance method and apparatus thereof
WO2017088365A1 (en) Skin-colour detection method and apparatus
CN103974053B (en) A kind of Automatic white balance antidote extracted based on ash point
CN103327345B (en) White balance processing method and processing device thereof
US20160063305A1 (en) Image processing device and image processing method
US8285039B2 (en) Image processor
CN104168478B (en) Based on the video image color cast detection method of Lab space and relevance function
JP2007097178A (en) Method for removing "red-eyes" by face detection
EP1528509A3 (en) Image processing method and apparatus for red eye correction
US8559668B2 (en) Red-eye reduction using facial detection
KR20040047834A (en) Image processing to remove red-eye features
CN103455790A (en) Skin identification method based on skin color model
CN103218615B (en) Face judgment method
KR20150107598A (en) Image processing apparatus and image processing method
CN103226689B (en) Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device
CN109242792B (en) White balance correction method based on white object
CN110412257B (en) Test paper block positioning method combining manual calibration and star ray algorithm
CN102088539A (en) Method and system for evaluating pre-shot picture quality
CN103226690B (en) Detect blood-shot eye illness method and device, removal blood-shot eye illness method and device
CN109583330B (en) Pore detection method for face photo
CN114286014A (en) Image database acquisition method
CN104050676B (en) A kind of backlight image detecting method and device based on Logistic regression models
US8767088B2 (en) White balancing method and image capturing device
CN106409193A (en) Display screen blur detection system and method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170207

Address after: 200127 room 3205F, building 707, Zhang Yang Road, Pudong New Area Free Trade Zone, Shanghai, China

Patentee after: Xin Xin Finance Leasing Co.,Ltd.

Address before: Zuchongzhi road in Pudong Zhangjiang hi tech park Shanghai 201203 Lane 2288 Pudong New Area Spreadtrum Center Building 1

Patentee before: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170707

Address after: 100033 room 2062, Wenstin Executive Apartment, 9 Financial Street, Beijing, Xicheng District

Patentee after: Xin Xin finance leasing (Beijing) Co.,Ltd.

Address before: 200127 room 3205F, building 707, Zhang Yang Road, Pudong New Area Free Trade Zone, Shanghai, China

Patentee before: Xin Xin Finance Leasing Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20130731

Assignee: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

Assignor: Xin Xin finance leasing (Beijing) Co.,Ltd.

Contract record no.: 2018990000163

Denomination of invention: Red eye detection method and device and red eye removing method and device

Granted publication date: 20160413

License type: Exclusive License

Record date: 20180626

EE01 Entry into force of recordation of patent licensing contract
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200306

Address after: 201203 Zuchongzhi Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai 2288

Patentee after: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

Address before: 100033 room 2062, Wenstin administrative apartments, 9 Financial Street B, Xicheng District, Beijing.

Patentee before: Xin Xin finance leasing (Beijing) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200602

Address after: 361012 unit 05, 8 / F, building D, Xiamen international shipping center, No.97 Xiangyu Road, Xiamen area, China (Fujian) free trade zone, Xiamen City, Fujian Province

Patentee after: Xinxin Finance Leasing (Xiamen) Co.,Ltd.

Address before: 201203 Zuchongzhi Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai 2288

Patentee before: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

EC01 Cancellation of recordation of patent licensing contract
EC01 Cancellation of recordation of patent licensing contract

Assignee: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

Assignor: Xin Xin finance leasing (Beijing) Co.,Ltd.

Contract record no.: 2018990000163

Date of cancellation: 20210301

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20130731

Assignee: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

Assignor: Xinxin Finance Leasing (Xiamen) Co.,Ltd.

Contract record no.: X2021110000010

Denomination of invention: Method and device for detecting red eye, method and device for removing red eye

Granted publication date: 20160413

License type: Exclusive License

Record date: 20210317

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230710

Address after: 201203 Shanghai city Zuchongzhi road Pudong New Area Zhangjiang hi tech park, Spreadtrum Center Building 1, Lane 2288

Patentee after: SPREADTRUM COMMUNICATIONS (SHANGHAI) Co.,Ltd.

Address before: 361012 unit 05, 8 / F, building D, Xiamen international shipping center, 97 Xiangyu Road, Xiamen area, China (Fujian) pilot Free Trade Zone, Xiamen City, Fujian Province

Patentee before: Xinxin Finance Leasing (Xiamen) Co.,Ltd.