CN106504279A - Coloured image auto focusing method - Google Patents

Coloured image auto focusing method Download PDF

Info

Publication number
CN106504279A
CN106504279A CN201610922542.3A CN201610922542A CN106504279A CN 106504279 A CN106504279 A CN 106504279A CN 201610922542 A CN201610922542 A CN 201610922542A CN 106504279 A CN106504279 A CN 106504279A
Authority
CN
China
Prior art keywords
sampled point
window
antagonism
coloured image
chained list
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.)
Granted
Application number
CN201610922542.3A
Other languages
Chinese (zh)
Other versions
CN106504279B (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.)
Hebei Kaitong Information Technology Service Co ltd
Original Assignee
Anqing Normal 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 Anqing Normal University filed Critical Anqing Normal University
Priority to CN201610922542.3A priority Critical patent/CN106504279B/en
Publication of CN106504279A publication Critical patent/CN106504279A/en
Application granted granted Critical
Publication of CN106504279B publication Critical patent/CN106504279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of coloured image auto focusing method, methods described include coloured image antagonism figure obtain, focusing on sampled point collection and improve the sharpness evaluation function of Brenner based on focus window.The method of the invention, make full use of the colouring information of coloured image first, it is to avoid the loss of caused color detail when only going to evaluate definition using gray-scale maps;Secondly, consider the importance of characteristic and golden section point that field of view center is located at subject goal more, reduce the negative effect of the amount of calculation and nontarget area increased because of statistical color information, be effectively improved real-time and the accuracy of focusing;Finally, by improving Brenner functions, on the premise of amount of calculation is not increased, more comprehensively reflect the definition of entire image.

Description

Coloured image auto focusing method
Technical field
The invention belongs to technical field of image processing, more particularly, to a kind of coloured image auto focusing method.
Background technology
With automation equipment, intelligentized development, become photographing unit, video camera, shown based on the automatic focusing of image The key technology of the imaging systems such as micro mirror.Realize based on the key of the Techniques of Automatic Focusing of image it being that construction one is quick, reliable Sharpness evaluation function, the position corresponding to the Function Extreme Value be imaging focal position.Due to image definition evaluation Function need to imaging system gradually convergence focal position to just arriving this complete mistake away from focal position again positioned at focal position Great amount of images in journey all carries out the evaluation of defocusing amount, therefore, a good image definition function except possess unbiasedness, Outside unimodality, sharp and noise immunity, to also be easy to as far as possible calculate, to meet the need of automatic focusing real-time Will.
In order to reduce amount of calculation, existing sharpness evaluation function is calculated just for gray-scale maps, causes a large amount of face The loss of color information.However, in a large amount of actual scene images such as biomedicine, the colouring information of target is most important, loses Colouring information may lead to not obtain best focus position;And comment if all calculating definition to tri- Color Channel figures of RGB Valency function, is difficult to avoid that the problem that amount of calculation is greatly increased again.
Content of the invention
Disadvantages described above or Improvement requirement for prior art, the invention provides a kind of coloured image side of focusing automatically Method, its object is to both make full use of image color information, can realize fast automatic focusing again.Technical side proposed by the present invention Case is as follows:
A kind of coloured image auto focusing method, it is characterised in that methods described includes following step:
(1) original image of rgb format is input into, red-green antagonism figure I is calculated respectivelyrgWith blue-yellow antagonism figure Iby
(2) obtain and focus on sampled point;
Original image is divided into three class focus windows first:Center window, four side window mouths and corner window;
To the red-green antagonism figure I in different focus windowsrgWith blue-yellow antagonism figure IbySet different sampling policies: In the window of center, pixel carries out fully sampled, and in four side window mouths, pixel carries out horizontal dot interlace sampling, in the window of corner pixel laterally and Longitudinal direction carries out dot interlace sampling respectively;Respectively obtain after sampling and red-green antagonism figure IrgCorresponding sampled point chained list first Lrg, and blue- Yellow antagonism figure IbyCorresponding sampled point chained list second Lby, described sampled point chained list first Lrg, sampled point chained list second LbyIn have recorded poly- The picture element position information of burnt sampled point;
(3) red-green antagonism figure I is calculated respectively using improved Brenner functionsrgFocus on the functional value of sampled point with blue- Yellow antagonism figure IbyFocus on the functional value F of sampled pointMBrenner, all functional value sums of the statistics more than given threshold value T, by this Statistical value evaluates the definition of coloured image.
The concrete calculating process of described step (1) is as follows:
Irg=R-G
Iby=B-Y
Wherein,
Y=(R+G)/2
R, G, B are respectively three Color Channels of red, green, blue of input color image.
In step (2):4 adjacent subgraphs of original image central point constitute center window Wa;Original image corner 4 subgraphs constitute corner window Wc;In original image, corner window Wc, center window WaPart in addition constitutes four side window mouths Wb.
Improvement Brenner function computing formula in step (3) are as follows:
Wherein, Lc.length it is sampled point chained list LcLength,
MBc(i)=| Ic(Lc[i] .x+2, Lc[i].y)-Ic(Lc[i] .x, Lc[i].y)|×
|Ic(Lc[i] .x, Lc[i].y+2)-Ic(Lc[i] .x, Lc[i] .y) | c=rg, by
Wherein, (Lc[i] .x, Lc[i] .y) it is sampled point chained list LcIn i-th element location of pixels.
What the present invention can reach has the beneficial effect that:
Very high due to focusing on automatically the requirement to real-time, in the design of substantial amounts of sharpness evaluation function, in order to subtract Few amount of calculation and lose colouring information so that under some specific occasions cannot exact evaluation coloured image definition.And this The method of bright proposition allows the color characteristic of image to maximize the use on the premise of amount of calculation is not increased, to coloured image The evaluation result of definition is more accurate.
Description of the drawings
Fig. 1 is the flow chart of the coloured image auto focusing method of the present invention;
Fig. 2 is the division schematic diagram of focus window in the present invention.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, below in conjunction with drawings and Examples, right The present invention is further elaborated.
Step one, calculates red-green antagonism figure, blue-yellow antagonism figure:
(1.1) original image of RGB patterns is input into, and its width is calculated as W, and which is highly designated as H;Original image is decomposed into red (R), green (G) and blue (B) three color channel images;
(1.2) yellow (Y) channel image is obtained using red, green two color channel images;
Y=(R+G)/2
(1.3) red-green antagonism figure I is calculated using R, G, B, YrgWith blue-yellow antagonism figure Iby
Irg=R-G
Iby=B-Y
Step 2, samples to the pixel position of original image formed objects, builds sampled point chained list first L respectivelyrg With sampled point chained list second Lby.Sampled point chained list first LrgFollow-up red-green antagonism figure I will be used forrgDefinition calculating, sampled point Chained list second LbyBlue-yellow antagonism figure I will be used forbyDefinition calculating.The purpose for building sampled point chained list is have by extraction The representational amount of calculation for focusing on the follow-up sharpness evaluation function of sampled point minimizing.Red-green antagonism figure IrgWith blue-yellow antagonism figure IbyThe respective selection principle for focusing on sampled point is the locations complementary for making two sampled point chained lists as far as possible, is reducing amount of calculation Simultaneously as far as possible fully using the colouring information of entire image.Concrete steps include:
(2.1) original image of input is divided into 16 subgraphs by size, each subgraph size is W/4 × H/4;
(2.2) as shown in Fig. 2 16 subgraphs are divided three classes focus window:Center window Wa, four side window mouth WbAnd Corner window Wc
4 adjacent subgraphs of original image central point constitute center window Wa
4 subgraphs of original image corner constitute corner window Wc
In original image, corner window Wc, center window WaPart in addition constitutes four side window mouth Wb.
(2.3) records center window WaThe position (x, y) of each pixel interior, adds sampled point chained list first LrgIn;In record Heart window WaThe position of each pixel interior, adds sampled point chained list second LbyIn;
(2.4) to four side window mouth WbInterior pixel carries out horizontal dot interlace sampling, specifically, records four side window mouth W line by lineb The position (x, y) of interior odd bits pixel, and it is added into sampled point chained list first LrgIn;Four side window mouth Ws are recorded line by linebInterior The position (x, y) of even bit pixel, and it is added into sampled point chained list second LbyIn;
(2.5) to corner window WcInterior pixel carries out 2 times of down-samplings, i.e., horizontal and vertical carry out dot interlace sampling respectively, And sampled pixel position is added sampled point chained list first LrgOr sampled point chained list second LbyIn.
Specifically, by corner window WcSome subwindows, the left side in the subwindow are divided into respectively according to 2 × 2 pixels The position (x, y) of upper angle pixel adds sampled point chained list first LrgIn, the position (x, y) of the lower right corner pixel in the subwindow adds Enter sampled point chained list second LbyIn.
Due to being located at field of view center subject goal more, therefore center window WaThe sample rate highest of interior pixel;Meanwhile, taking the photograph In shadow composition, the effect of golden section point is most important, therefore, center window WaSize arrange cause golden section point lucky It is located therein.Relative to center window Wa, four side window mouth WbWith corner window WcInterior nontarget area is increased, therefore, this two class The sample rate of window is relatively low.It is 9/8 × W that the setting of focus window and sampling policy causes the length sum of two sampled point chained lists × H, slightly larger than original image size.
Step 3, using all sharpness evaluation function values for focusing on sampled point (x, y) of improved Brenner functions statistics Summation FMBrenner
(3.1) red-green antagonism figure I is counted using improved Brenner function formulasrgBelong to sampled point chained list first in figure LrgIn each pixel functional value and blue-yellow antagonism figure IbyInside belong to sampled point chained list second LbyIn each pixel function Value:
MBc(i)=| Ic(Lc[i] .x+2, Lc[i].y)-Ic(Lc[i] .x, Lc[i].y)|×
|Ic(Lc[i] .x, Lc[i].y+2)-Ic(Lc[i] .x, Lc[i] .y) | c=rg, by
Wherein, (Lc[i] .x, Lc[i] .y) it is sampled point chained list LcIn i-th element location of pixels.
Improved Brenner functions not only allow for the gray scale difference that horizontal direction differs the pixel of two units, it is also contemplated that Vertical direction differs the gray scale difference of the pixel of two units, can more comprehensively reflect the partial gradient change of entire image, meanwhile, Original Brenner functions excessively do not increase amount of calculation relatively.
(3.2) all functional value F more than given threshold value T are countedMBrennerSum, as input color image clear Degree.
Wherein, Lc.length it is sampled point chained list LcLength.
The corresponding program of this method can in embedded images collecting device, in operation process, by contrast result of calculation several times, Select highest statistical value, you can real-time selection best focus scheme.
Coloured image auto focusing method provided by the present invention, makes full use of the colouring information of coloured image first, keeps away The loss of caused color detail when having exempted from only to go to evaluate definition using gray-scale maps;Secondly, consider subject goal multidigit In the importance of the characteristic and golden section point of field of view center, reduce the amount of calculation that increases because of statistical color information and The negative effect of nontarget area, is effectively improved real-time and the accuracy of focusing;Finally, by improving Brenner letters Number, on the premise of amount of calculation is not increased, more comprehensively reflects the definition of entire image.

Claims (4)

1. a kind of coloured image auto focusing method, it is characterised in that methods described includes following step:
(1) original image of rgb format is input into, red-green antagonism figure I is calculated respectivelyrgWith blue-yellow antagonism figure Iby
(2) obtain and focus on sampled point;
Original image is divided into three class focus windows first:Center window, four side window mouths and corner window;
To the red-green antagonism figure I in different focus windowsrgWith blue-yellow antagonism figure IbySet different sampling policies:Central window In mouthful, pixel carries out fully sampled, and in four side window mouths, pixel carries out horizontal dot interlace sampling, horizontal and vertical point of pixel in the window of corner Dot interlace sampling is not carried out;Respectively obtain after sampling and red-green antagonism figure IrgCorresponding sampled point chained list first Lrg, and blue-yellow antagonism Figure IbyCorresponding sampled point chained list second Lby, described sampled point chained list first Lrg, sampled point chained list second LbyIn have recorded focusing sampling The picture element position information of point;
(3) red-green antagonism figure I is calculated respectively using improved Brenner functionsrgThe functional value for focusing on sampled point is short of money with blue-yellow Anti- figure IbyFocus on the functional value F of sampled pointMBrenner, all functional value sums of the statistics more than given threshold value T, by the statistics Value evaluates the definition of coloured image.
2. coloured image definition evaluation methodology according to claim 1, it is characterised in that described step (1) is concrete Calculating process is as follows:
Irg=R-G
Iby=B-Y
Wherein,
Y=(R+G)/2
R, G, B are respectively three Color Channels of red, green, blue of input color image.
3. coloured image definition evaluation methodology according to claim 1 and 2, it is characterised in that:In step (2), 4 adjacent subgraphs of original image central point constitute center window Wa;4 subgraphs of original image corner constitute corner window Wc; In original image, corner window Wc, center window WaPart in addition constitutes four side window mouth Wb.
4. coloured image definition evaluation methodology according to claim 1 and 2, it is characterised in that in step (3) Improve Brenner function computing formula as follows:
F M B r e n n e r = Σ c = r g , b y Σ i = 1 L c . l e n g t h [ MB c ( i ) > T ]
Wherein, Lc.length it is sampled point chained list LcLength,
MBc(i)=| Ic(Lc[i] .x+2, Lc[i].y)-Ic(Lc[i] .x, Lc[i].y)|×|Ic(Lc[i] .x, Lc[i].y+2)- Ic(Lc[i] .x, Lc[i] .y) | c=rg, by
Wherein, (Lc[i] .x, Lc[i] .y) it is sampled point chained list LcIn i-th element location of pixels.
CN201610922542.3A 2016-10-18 2016-10-18 Color image auto focusing method Active CN106504279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610922542.3A CN106504279B (en) 2016-10-18 2016-10-18 Color image auto focusing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610922542.3A CN106504279B (en) 2016-10-18 2016-10-18 Color image auto focusing method

Publications (2)

Publication Number Publication Date
CN106504279A true CN106504279A (en) 2017-03-15
CN106504279B CN106504279B (en) 2019-02-19

Family

ID=58319509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610922542.3A Active CN106504279B (en) 2016-10-18 2016-10-18 Color image auto focusing method

Country Status (1)

Country Link
CN (1) CN106504279B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110455258A (en) * 2019-09-01 2019-11-15 中国电子科技集团公司第二十研究所 A kind of unmanned plane Terrain Clearance Measurement method based on monocular vision
CN112099217A (en) * 2020-08-18 2020-12-18 宁波永新光学股份有限公司 Automatic focusing method for microscope
CN113822877A (en) * 2021-11-17 2021-12-21 武汉中导光电设备有限公司 AOI equipment microscope defect detection picture quality evaluation method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877438A (en) * 2006-07-10 2006-12-13 南京邮电大学 Self-adaptive automatic focusing method used in digital camera
CN101494737A (en) * 2009-03-09 2009-07-29 杭州海康威视数字技术股份有限公司 Integrated camera device and self-adapting automatic focus method
WO2011099626A1 (en) * 2010-02-15 2011-08-18 株式会社ニコン Focus adjusting device and focus adjusting program
CN105938243A (en) * 2016-06-29 2016-09-14 华南理工大学 Multi-magnification microscope fast focusing method applied to TFT-LCD detection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877438A (en) * 2006-07-10 2006-12-13 南京邮电大学 Self-adaptive automatic focusing method used in digital camera
CN101494737A (en) * 2009-03-09 2009-07-29 杭州海康威视数字技术股份有限公司 Integrated camera device and self-adapting automatic focus method
WO2011099626A1 (en) * 2010-02-15 2011-08-18 株式会社ニコン Focus adjusting device and focus adjusting program
CN105938243A (en) * 2016-06-29 2016-09-14 华南理工大学 Multi-magnification microscope fast focusing method applied to TFT-LCD detection

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110455258A (en) * 2019-09-01 2019-11-15 中国电子科技集团公司第二十研究所 A kind of unmanned plane Terrain Clearance Measurement method based on monocular vision
CN112099217A (en) * 2020-08-18 2020-12-18 宁波永新光学股份有限公司 Automatic focusing method for microscope
CN113822877A (en) * 2021-11-17 2021-12-21 武汉中导光电设备有限公司 AOI equipment microscope defect detection picture quality evaluation method and system

Also Published As

Publication number Publication date
CN106504279B (en) 2019-02-19

Similar Documents

Publication Publication Date Title
CN108446617B (en) Side face interference resistant rapid human face detection method
CN103886308B (en) A kind of pedestrian detection method of use converging channels feature and soft cascade grader
CN107133969B (en) A kind of mobile platform moving target detecting method based on background back projection
CN103258232B (en) A kind of public place crowd estimate's method based on dual camera
US11816875B2 (en) Method for estimating and presenting passenger flow, system, and computer readable storage medium
CN103400150A (en) Method and device for road edge recognition based on mobile platform
CN101605209A (en) Camera head and image-reproducing apparatus
US11790499B2 (en) Certificate image extraction method and terminal device
CN104598907B (en) Lteral data extracting method in a kind of image based on stroke width figure
CN106504279A (en) Coloured image auto focusing method
CN106874884A (en) Human body recognition methods again based on position segmentation
CN103226860B (en) Passage passenger traffic density estimation method
CN106384117A (en) Vehicle color recognition method and device
CN102306307B (en) Positioning method of fixed point noise in color microscopic image sequence
CN102890785A (en) Method for service robot to recognize and locate target
CN115303901B (en) Elevator traffic flow identification method based on computer vision
CN107977645A (en) A kind of news-video poster map generalization method and device
CN104143077B (en) Pedestrian target search method and system based on image
CN111415374A (en) KVM system and method for monitoring and managing scenic spot pedestrian flow
CN106599880A (en) Discrimination method of the same person facing examination without monitor
CN106127124A (en) The automatic testing method of the abnormal image signal in region, taxi front row
RU2320011C1 (en) Method for automatic correction of red-eye effect
CN110751635A (en) Oral cavity detection method based on interframe difference and HSV color space
CN105812668A (en) Image processing method, processing device and photographing apparatus
CN106097358B (en) Image background complexity detection method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240403

Address after: 073000 West 200m northbound at the intersection of Dingzhou commercial street and Xingding Road, Baoding City, Hebei Province (No. 1910, 19th floor, building 3, jueshishan community)

Patentee after: Hebei Kaitong Information Technology Service Co.,Ltd.

Country or region after: China

Address before: Anqing Normal University, 1318 Jixian North Road, Anqing City, Anhui Province, 246133

Patentee before: ANQING NORMAL University

Country or region before: China