CN101968849B - Picture red eye removal method based on 3G smart phone - Google Patents

Picture red eye removal method based on 3G smart phone Download PDF

Info

Publication number
CN101968849B
CN101968849B CN 201010295460 CN201010295460A CN101968849B CN 101968849 B CN101968849 B CN 101968849B CN 201010295460 CN201010295460 CN 201010295460 CN 201010295460 A CN201010295460 A CN 201010295460A CN 101968849 B CN101968849 B CN 101968849B
Authority
CN
China
Prior art keywords
pixel
value
red
picture element
red eye
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.)
Expired - Fee Related
Application number
CN 201010295460
Other languages
Chinese (zh)
Other versions
CN101968849A (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.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
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 Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN 201010295460 priority Critical patent/CN101968849B/en
Publication of CN101968849A publication Critical patent/CN101968849A/en
Application granted granted Critical
Publication of CN101968849B publication Critical patent/CN101968849B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a picture red eye removal method based on a 3G smart phone. The existing red eye removal algorithm is applied on a special DSP processing chip or high-performance household personal computer (PC), is complex to realize and requires higher hardware conditions. The method of the invention comprises: firstly, selecting a human face area; then, taking the RGB value of each pixel point within a selected range, and converting the RGB value of each pixel point to the value of an HSV color space; removing noise points from the red eye area, wherein the step of removing the noise points comprises the processes of processing non-red noise points and isolated red noise points; and finally, repairing the red eye area. The red eye removal technology realized by the invention requires small time and space cost, is very suitable to remove red eyes in pictures on an embedded platform with limited hardware resource, such as smart phones and the like, solves the problem that the existing red eye removal technology requires high-performance hardware environment, and improves the processing efficiency.

Description

A kind of picture red eye removal method based on the 3G smart mobile phone
Technical field
The invention belongs to the mobile intelligent terminal technical field, relate to a kind of picture red eye removal method based on the 3G smart mobile phone.
Background technology
Blood-shot eye illness is common phenomenon in the photography.Closely the high light of flashlamp impinges upon postretinal blood capillary tissue through pupil, and it is red block that the red light that reflects can make the human eye place in the photo of actual imaging present, the reason of blood-shot eye illness generation that Here it is.Picture red eye removal method mainly divides three steps at present: (1) people's face detects; (2) redeye detection; (3) red-eye correction.
The method that people's face detects mainly contains: Knowledge-Based Method: it is encoded typical people's face formation rule storehouse to people's face.Usually, carry out people's face location by the relation between the facial characteristics.The method of feature invariant: the method can in the situation that attitude, visual angle or illumination condition change the architectural feature that finds existence, then use these features to determine people's face.Template matching method: store people's face pattern of several standards, be used for describing respectively whole people's face and facial characteristics; Calculate between the pattern of input picture and storage mutual relationship and for detection of.Method based on outward appearance: thus model obtained from concentrated study of training picture, and detect with these models.
Detected human face region location blood-shot eye illness, most important information is color.The red round dot at blood-shot eye illness picture pupil place and the difference of normal eye's color are very large, so redeye location all adopts red degree is fixed Threshold segmentation to picture the method for extracting usually.
After having determined final red eye region, the work of eliminating blood-shot eye illness is the color-values of adjusting the blood-shot eye illness pixel.In rgb space, red value with the R passage represents, but only the R passage adjusted not often, can cause revised blood-shot eye illness to seem partially green or indigo plant partially.Therefore, in processing that the R passage is lost lustre, also need G passage and B passage are made suitable adjustment.
Present to go to see red algorithm be to be applied on special DSP process chip or the high performance home PC, and algorithm is realized complicated, and needs higher hardware condition.Therefore, be not suitable for the limited portable terminals of hardware performance such as smart mobile phone.
Summary of the invention
The present invention is directed to the deficiencies in the prior art, a kind of picture red eye removal optimized algorithm that is applicable to intelligent mobile phone platform is provided, complicated to solve existing algorithm, inefficient problem.
The concrete steps of the inventive method are:
Step (1) is selected human face region.Scope at the selected people's face of pending picture.
Step (2) is determined red eye region.May further comprise the steps:
2-1, take out the rgb value of each pixel in the selected scope successively;
2-2, the rgb value of each pixel is converted to the value in hsv color space, then by the threshold value of setting the pixel in the selected scope cut apart;
Described dividing method is: judge whether each pixel is in the red color range, if pixel is to be in the red color range, then will covers the plate picture element matrix and be arranged to 255 corresponding to the value of this pixel; If pixel outside red color range, then will cover the plate picture element matrix and be arranged to 0 corresponding to the value of this pixel;
Described red color range refers to the zone that H>290.0 in the hsv color space and S>0.29 and V>0.29 surround, perhaps the zone that surrounds of the H in the hsv color space<21.0 and S>0.45 and V>0.39.
Step (3) is carried out the denoising point to red eye region, comprises isolated non-red noise is processed and isolated red noise is processed.
Isolated non-red noise is processed: at first utilize the matrix of N * M that pixel and the pixel around it in the illiteracy plate picture element matrix are sued for peace; Then judge and be worth, and if value greater than (N-1) * (M-1) * 255, then will cover the value of this pixel in the plate picture element matrix and be arranged to 255; And if value then will be covered the value of this pixel in the plate matrix and be arranged to 0 less than or equal to (N-1) * (M-1) * 255; The height of 1<N<selected scope wherein, the width of 1<M<selected scope.
Isolated red noise is processed: at first utilize the matrix of N * M that pixel and the pixel around it in the illiteracy plate picture element matrix are sued for peace.Then judge and be worth, if and value is less than (M+N)/min{M, N}, the value that then will cover pixel in the plate picture element matrix is arranged to 0, and if the value more than or equal to (M+N)/min{M, N}, the value that then will cover pixel in the plate picture element matrix is arranged to 255, min{M wherein, N} represents to get value less among M and the N, "/" expression division rounding operation;
Step (4) is repaired red eye region.
Rgb value is revised respectively, is obtained revised R ', G ' and B ':
R ′ = G + B 2 , G ′ = G + R ′ 2 , B ′ = B + R ′ 2
Wherein G represents the green channel component value of former pixel, and B represents the blue channel component value of former pixel.
The present invention solves the key point that its technical matters adopts: in the hsv color space, filter out red eye region by the threshold value that sets, and red eye region is carried out denoising point process, filter out isolated noise, thereby determined final red eye region.
The beneficial effect of the inventive method is: the present invention realizes goes needed time of blood-shot eye illness technology and space expense very little, be highly suitable for as what carry out picture on the limited embedded platform of the hardware resources such as smart mobile phone and go the blood-shot eye illness operation, solve the problem of removing at present to see red Technology Need high-performance hardware environment, improved treatment effeciency.
Description of drawings
Fig. 1 is the process flow diagram of the inventive method.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
As shown in Figure 1, a kind of picture red eye removal method based on the 3G smart mobile phone comprises the steps:
Step (1) is selected human face region.Scope at the selected people's face of pending picture.
Step (2) is determined red eye region.May further comprise the steps:
Judge that red eye region mainly is by the threshold value of setting the red degree of pixel to be judged, in the color space that the RGB three primary colours are described, because colourity is difficult to separate with brightness, and has certain correlativity between each color component, therefore can not well distinguish red degree.In the shades of colour space, the characteristics that human eye distinguishes between colors have been embodied in the hsv color space, relatively are fit to distinguish red degree.Determine that red eye region may further comprise the steps:
A. take out successively the rgb value of each pixel in the selected scope;
B. the rgb value of each pixel is converted to the value in hsv color space, then the threshold by setting
Value is cut apart the pixel in the selected scope;
Dividing method is: judge whether each pixel is in the red color range, if pixel is to be in the red color range, then will covers the plate picture element matrix and be arranged to 255 corresponding to the pixel value of this pixel; If pixel outside red color range, then will cover the plate picture element matrix and be arranged to 0 corresponding to the value of this pixel;
Red color range refers to the zone that H>290.0 in the hsv color space and S>0.29 and V>0.29 surround, perhaps the zone that surrounds of the H in the hsv color space<21.0 and S>0.45 and V>0.39.
Step (3) is carried out the denoising point to red eye region.Utilize the illiteracy plate picture element matrix of threshold method mark can produce some isolated noises, and red eye region is generally the border circular areas of relatively concentrating, therefore can remove isolated noise according to the value of surrounding pixel point, this step comprises to be processed and isolated red noise is processed isolated non-red noise.
Isolated non-red noise is processed.At first utilize 3 * 3 matrix to sue for peace with its pixel on every side to covering in the plate picture element matrix pixel.Then judge and be worth, and if value greater than 1020 (2 * 2 * 255), then will cover the value of pixel in the plate picture element matrix and be arranged to 255; And if value then will be covered the value of pixel in the plate picture element matrix and be arranged to 0 less than or equal to 1020 (2 * 2 * 255).
Isolated red noise is processed.At first utilize 3 * 3 matrix to sue for peace with its pixel on every side to covering in the plate picture element matrix pixel.Then judge and be worth, and if value less than 510 (2 * 255), then will cover the value of pixel in the plate picture element matrix and be arranged to 0, and if be worth more than or equal to 510, then will cover the value of pixel in the plate picture element matrix and be arranged to 255;
Step (4) is repaired red eye region.
After red eye region is determined, mainly be the color-values of adjusting the blood-shot eye illness pixel, make it recover normal color.In the RGB color space, the value representation of R passage is red, and therefore the most direct mode is to adjust the value of R passage.But only adjust the value of R passage, can cause in some cases revised blood-shot eye illness to seem partially green or partially blue.Therefore, when the R passage is processed, also need G and B passage are carried out suitable adjustment.
R passage, G passage and B passage are revised respectively, are obtained revised R ', G ' and B ':
R ′ = G + B 2 - - - ( 1 )
G ′ = G + R ′ 2 - - - ( 2 )
B ′ = B + R ′ 2 - - - ( 3 )
Below by an example this method is described further.As hardware platform, oms 1.5 is as software platform based on Motorola's MT710Ophone smart mobile phone for this example.This method is seen red and is removed operation, and concrete treatment step is as follows:
1. move the picture red eye removal process software, and open a blood-shot eye illness picture.
2. near people's face of picture, select a rectangular area, comprising the blood-shot eye illness part.
3. the redeye detection algorithm flow is as follows:
3.1 create the illiteracy plate picture element matrix of a former picture size and be initialized as full 0;
3.2 take out successively the value of selecting each pixel in zone in the step 2.
If 3.3 the rgb value of pixel meets R>G+B and R>50 and G<60 and B<60, then the value of the illiteracy plate picture element matrix of corresponding pixel points position is set to 255.Jumping into 3.2 continues to carry out.
3.4 rgb value is converted to the HSV value, if judge H>290.0 and S>0.29 and V>0.29 or H<21.0 and S>0.45 and V>0.39, then the value of the illiteracy plate picture element matrix of corresponding pixel points position is set to 255.Jumping into 3.2 continues to carry out.
After this step is finished, cover the two values matrix of having preserved expression pixel redness degree in the plate picture element matrix, wherein 255 expression pixels are red, and 0 expression pixel is non-redness.
4. remove the isolated noise of covering in the plate picture element matrix, algorithm flow is as follows:
4.1 temporary variable i=0 is set, j=0, wherein i represents to remove the number of times that isolated non-red noise will circulate, and j represents to remove the number of times that isolated red noise will circulate;
If 4.2 i>3 then jump to step 4.4, otherwise enter step 4.3;
4.3 remove isolated non-red noise.At first utilize 3 * 3 matrix to carry out sum operation to covering in the plate picture element matrix current pixel point and pixel on every side thereof.Then judge and be worth, and if value greater than 1020 (2 * 2 * 255), then will cover the value of pixel in the plate picture element matrix and be arranged to 255; And if value then will be covered the value of pixel in the plate picture element matrix and be arranged to 0 less than or equal to 1020 (2 * 2 * 255).I adds 1, jumps to step 4.2;
If 4.4 j>2 processing end, otherwise enter step 4.5;
4.5 remove isolated red noise.Pixel carries out sum operation with its pixel on every side in the plate picture element matrix to covering at first to utilize 3 * 3 matrix.Then judge and be worth, and if value less than 510 (2 * 255), then will cover the value of pixel in the plate picture element matrix and be arranged to 0, and if be worth more than or equal to 510, then will cover the value of pixel in the plate picture element matrix and be arranged to 255.J adds 1, jumps to step 4.4;
After step 4 is finished, cover value in the plate picture element matrix and be 255 some representative through removing the red eye region after the isolated noise.
5. to the reparation of red eye region.Adjust red degree by the value of adjusting the R passage, and according to the R ' after adjusting, the value of G, B passage is adjusted.Formula specifically is set shown in formula (1), (2), (3).
So far, the whole blood-shot eye illness process of going finishes.By 50 pictures that contain blood-shot eye illness being processed test relatively, this method on average goes the blood-shot eye illness time to be about 3s, successful repair rate to blood-shot eye illness is about 87%, has good blood-shot eye illness repairing effect, is applicable to the picture red eye removal function under the general intelligence cell phone platform.

Claims (1)

1. the picture red eye removal method based on the 3G smart mobile phone is characterized in that the method comprises the steps:
Step (1) is in the scope of the selected people's face of pending picture;
Step (2) is determined to may further comprise the steps red eye region:
2-1, take out the rgb value of each pixel in the selected scope successively;
2-2, the rgb value of each pixel is converted to the value in hsv color space, then by the threshold value of setting the pixel in the selected scope cut apart;
Described dividing method is: judge whether each pixel is in the red color range, if pixel is to be in the red color range, then will covers the plate picture element matrix and be arranged to 255 corresponding to the value of this pixel; If pixel outside red color range, then will cover the plate picture element matrix and be arranged to 0 corresponding to the value of this pixel;
Described red color range refers to the zone that H>290.0 in the hsv color space and S>0.29 and V>0.29 surround, perhaps the zone that surrounds of the H in the hsv color space<21.0 and S>0.45 and V>0.39;
Step (3) is carried out the denoising point to red eye region, comprises isolated non-red noise is processed and isolated red noise is processed, and at first processes isolated non-red noise, the red noise that aftertreatment is isolated;
Isolated non-red noise is processed: at first utilize the matrix of N * M that current pixel point and the pixel around it in the illiteracy plate picture element matrix are sued for peace; Then judge and be worth, if and value is greater than (N-1) * (M-1) * 255, the value that then will cover this pixel in the plate picture element matrix is arranged to 255, and if the value less than or equal to (N-1) * (M-1) * 255, then will cover the value of this pixel in the plate matrix and be arranged to 0; The height of 1<N<selected scope wherein, the width of 1<M<selected scope;
Isolated red noise is processed: at first utilize the matrix of N * M that pixel and the pixel around it in the illiteracy plate picture element matrix are sued for peace; Then judge and be worth, and if value less than (M+N)/min{M, N},
The value that then will cover pixel in the plate picture element matrix is arranged to 0, and if the value more than or equal to (M+N)/min{M, N}, the value that then will cover pixel in the plate picture element matrix is arranged to 255, min{M wherein, N} represents to get value less among M and the N, "/" expression division rounding operation;
Step (4) is repaired red eye region; Rgb value is revised respectively, is obtained revised R ', G ' and B ':
R ′ = G + B 2 , G ′ = G + R ′ 2 , B ′ = B + R ′ 2
Wherein G represents the green channel component value of former pixel, and B represents the blue channel component value of former pixel.
CN 201010295460 2010-09-27 2010-09-27 Picture red eye removal method based on 3G smart phone Expired - Fee Related CN101968849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010295460 CN101968849B (en) 2010-09-27 2010-09-27 Picture red eye removal method based on 3G smart phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010295460 CN101968849B (en) 2010-09-27 2010-09-27 Picture red eye removal method based on 3G smart phone

Publications (2)

Publication Number Publication Date
CN101968849A CN101968849A (en) 2011-02-09
CN101968849B true CN101968849B (en) 2013-01-02

Family

ID=43548000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010295460 Expired - Fee Related CN101968849B (en) 2010-09-27 2010-09-27 Picture red eye removal method based on 3G smart phone

Country Status (1)

Country Link
CN (1) CN101968849B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129673B (en) * 2011-04-19 2012-07-25 大连理工大学 Color digital image enhancing and denoising method under random illumination
CN103106386A (en) * 2011-11-10 2013-05-15 华为技术有限公司 Dynamic self-adaption skin color segmentation method and device
CN102855265A (en) * 2012-04-20 2013-01-02 江苏奇异点网络有限公司 System for browsing and downloading webpage picture
CN103577791B (en) * 2012-07-26 2018-02-23 阿里巴巴集团控股有限公司 A kind of red-eye detecting method and system
CN103455403B (en) * 2013-08-26 2016-03-30 百度在线网络技术(北京)有限公司 Method of testing and device
CN107491741A (en) * 2017-07-28 2017-12-19 广东欧珀移动通信有限公司 Iris identification method and mobile terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1215618A2 (en) * 2000-12-14 2002-06-19 Eastman Kodak Company Image processing method for detecting human figures in a digital image
US7155058B2 (en) * 2002-04-24 2006-12-26 Hewlett-Packard Development Company, L.P. System and method for automatically detecting and correcting red eye
CN101510255A (en) * 2009-03-30 2009-08-19 北京中星微电子有限公司 Method for identifying and positioning human face, apparatus and video processing chip
CN101620679A (en) * 2009-07-22 2010-01-06 凌阳电通科技股份有限公司 Method for eliminating red eye in image
CN101706874A (en) * 2009-12-25 2010-05-12 青岛朗讯科技通讯设备有限公司 Method for face detection based on features of skin colors

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1215618A2 (en) * 2000-12-14 2002-06-19 Eastman Kodak Company Image processing method for detecting human figures in a digital image
US7155058B2 (en) * 2002-04-24 2006-12-26 Hewlett-Packard Development Company, L.P. System and method for automatically detecting and correcting red eye
CN101510255A (en) * 2009-03-30 2009-08-19 北京中星微电子有限公司 Method for identifying and positioning human face, apparatus and video processing chip
CN101620679A (en) * 2009-07-22 2010-01-06 凌阳电通科技股份有限公司 Method for eliminating red eye in image
CN101706874A (en) * 2009-12-25 2010-05-12 青岛朗讯科技通讯设备有限公司 Method for face detection based on features of skin colors

Also Published As

Publication number Publication date
CN101968849A (en) 2011-02-09

Similar Documents

Publication Publication Date Title
CN101968849B (en) Picture red eye removal method based on 3G smart phone
US10509948B2 (en) Method and device for gesture recognition
US8358813B2 (en) Image preprocessing
CN104282002B (en) A kind of quick beauty method of digital picture
US7747071B2 (en) Detecting and correcting peteye
CN104008534B (en) A kind of face intelligence beautification method and device
US8254646B2 (en) Image preprocessing
CN103455790B (en) A kind of skin identification method based on complexion model
US8358812B2 (en) Image Preprocessing
CN105787888A (en) Human face image beautifying method
CN103440633B (en) A kind of digital picture dispels the method for spot automatically
CN101930596A (en) Color constancy method in two steps under a kind of complex illumination
CN104537634A (en) Method and system for removing raindrop influences in dynamic image
CN106296620B (en) A kind of color rendition method based on histogram translation
CN103839245B (en) The Retinex colour-image reinforcing method at night of Corpus--based Method rule
CN103886565A (en) Nighttime color image enhancement method based on purpose optimization and histogram equalization
CN104599297A (en) Image processing method for automatically blushing human face
CN105681775A (en) White balance method and device
CN104899905A (en) Face image processing method and apparatus
US8244004B2 (en) Image preprocessing
CN105976309B (en) U.S. face mobile terminal that is a kind of efficient and being easy to Parallel Implementation
CN108711160B (en) Target segmentation method based on HSI (high speed input/output) enhanced model
CN105763747A (en) Mobile terminal for achieving high-quality real-time facial beautification
CN102915449A (en) Photo classification method
CN105894480A (en) High-efficiency facial beautification device easy for parallel realization

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130102

Termination date: 20150927

EXPY Termination of patent right or utility model