CN106772925A - A kind of passive camera automatic focusing method based on inner product energy - Google Patents
A kind of passive camera automatic focusing method based on inner product energy Download PDFInfo
- Publication number
- CN106772925A CN106772925A CN201611182072.8A CN201611182072A CN106772925A CN 106772925 A CN106772925 A CN 106772925A CN 201611182072 A CN201611182072 A CN 201611182072A CN 106772925 A CN106772925 A CN 106772925A
- Authority
- CN
- China
- Prior art keywords
- focusing
- def1
- def2
- inner product
- length
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G02—OPTICS
- G02B—OPTICAL ELEMENTS, SYSTEMS OR APPARATUS
- G02B7/00—Mountings, adjusting means, or light-tight connections, for optical elements
- G02B7/28—Systems for automatic generation of focusing signals
- G02B7/36—Systems for automatic generation of focusing signals using image sharpness techniques, e.g. image processing techniques for generating autofocus signals
-
- G—PHYSICS
- G02—OPTICS
- G02B—OPTICAL ELEMENTS, SYSTEMS OR APPARATUS
- G02B7/00—Mountings, adjusting means, or light-tight connections, for optical elements
- G02B7/28—Systems for automatic generation of focusing signals
- G02B7/282—Autofocusing of zoom lenses
-
- G—PHYSICS
- G03—PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
- G03B—APPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
- G03B13/00—Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
- G03B13/32—Means for focusing
- G03B13/34—Power focusing
- G03B13/36—Autofocus systems
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Optics & Photonics (AREA)
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Studio Devices (AREA)
Abstract
The present invention provides a kind of passive camera automatic focusing method based on inner product energy, belongs to field of photoelectric technology, it is therefore intended that quickly and accurately realize the automatic focusing of camera.Comprise the following steps:Step 1) camera starts working, by image pick-up card, in inputting an image into internal memory;Step 2) calculate image definition;Step 3) definition between movement images, camera lens is moved to the direction for becoming apparent from, until focusing on optimum position, wherein inner product energy need to be more than 10.Because the characteristics of gradient direction of noise, size have random, its inner product energy is close to 0.And the gradient direction of edge details, size have certain rule, direction is consistent, and its inner product energy is relatively large.Therefore inner product energy can effectively suppress noise projecting edge information, while the features such as present invention has quick, accurate, inexpensive.
Description
Technical field
The invention belongs to field of photoelectric technology, it is therefore intended that quickly and accurately realize the automatic focusing of camera.
Background technology
Techniques of Automatic Focusing is widely used in digital camera.Normally, automatic focusing is divided into both of which:Automatic mold
Formula and Passive Mode.Automatic mode measures the distance between target and camera lens using laser, infrared, ultrasonic wave etc., calculates most
Good focal length.But, this pattern increased cost and need additional space to place these sensors.Passively focusing mode is
Realized based on image.Because its cost is relatively low, quick, therefore it is widely used.The core of passive focusing mode is depended on
Judgement to image definition.Clearly image shows as edge details clearly in spatial domain, and high frequency is shown as in the transform domain as illustrated
Coefficient is more.Image definition judges to depend on Image Definition.
Recent years, substantial amounts of image auto-focusing function is suggested.They can probably be divided into two classes, and one kind is to be based on
The method in spatial domain, another kind is the method based on transform domain.The method in spatial domain mainly has Brenner functions, Laplce and side
Method and Roberts functions etc..This is that the method based on gradient judges the clear of image using image pixel edge difference information
Degree.If there is no noise in image, then the method based on gradient is evaluated more accurate, quick.But if contain in image
The accuracy of noise so evaluation result can be greatly reduced.The common Measurement for Digital Image Definition based on transform domain is based on
Discrete cosine transform (DCT) and the method based on wavelet transformation (Wavelet).These methods are mainly the high frequency letter for calculating image
Cease to judge the definition of image.DCT has the ability of good separate picture high-frequency information, and isolated high-frequency information is used as
The foundation of evaluation image definition.And the DC component of DCT can directly embody the brightness and contrast of image, therefore using straight
Flow component and high fdrequency component carry out evaluation image definition.Method based on DCT has certain noiseproof feature, but it also has one
Fixed limitation, its run time is more long, without real-time, and can cause local peaking, and the accuracy to evaluating causes one
Fixed influence.Wavelet transformation has a good decorrelation, and the coefficient amplitude of noise signal can be more with the increase of Decomposition order
Come smaller, and the amplitude of the coefficient of edge details signal can be increasing with the increase of Decomposition order.Therefore figure can be used
The small echo high frequency coefficient of picture carrys out the definition of evaluation image.Method based on small echo has certain noiseproof feature, but high frequency
Some noise coefficients are equally also included in coefficient, therefore it equally will also result in local peaking so that under the accuracy of definition
Drop.
The content of the invention
Based on above mentioned problem, it is proposed that a kind of new image auto-focusing method, it is therefore intended that quickly and accurately realize phase
The automatic focusing of machine.
The technical scheme is that:
Step 1) set and treat focus objects region ImageBlock;
Step 2) camera start-up operation, image Image1 is obtained by CCD camera;
Step 3) calculate the definition values Def1 that focal zone ImageBlock images are treated in image Image1;
Step 4) direction that focuses on of setting, step-length and definition rate of change a, a take 0.1-0.2;
Step 5) direction according to present convergence and step-length moving lens;
Step 6) image Image2 is obtained by CCD camera;
Step 7) calculate the definition values Def2 that focal zone ImageBlock images are treated in image Image2;
Step 8) compare the size of Def1 and Def2;
Step 9) according to the comparative result of Def1 and Def2, adjustment focusing step-length;
Step 10) repeat step 2) to step 9), if focusing direction continuously changes number of times and reaches 5 times, illustrate current burnt
It is pinpointed focus away from position, then focusing terminates;
Wherein step 3) and step 7) definition values of image are by the horizontal and vertical gradient of each pixel Z (x, y)
Value, calculates all pixels value inner product energy and obtains.
Further, step 9) include:
If a, Def1<Difference very little between Def2 and Def1 and Def2, i.e.,Illustrate one
To step-length movement to focus effect very little, current focal distance pinpointed focus can continue to keep focusing farther out, then for secondary focusing
Direction, increase focusing step-length;
If b, Def1<Differing greatly between Def2 and Def1 and Def2, i.e.,Illustrate one
Secondary focusing is very big to focus effect to step-length movement, and current focal distance pinpointed focus is nearer, then can continue to keep focusing
Direction, reduce focusing step-length;
If c, Def1>Differing greatly between Def2 and Def1 and Def2, i.e.,Illustrate one
Secondary focusing is very big to focus effect to step-length movement, and current focal distance pinpointed focus is nearer, then need to change focusing direction,
And reduce focusing step-length;
If d, Def1>Difference very little between Def2 and Def1 and Def2, i.e.,Illustrate one
To step-length movement to focus effect very little, current focal distance pinpointed focus needs to change focusing direction farther out, then for secondary focusing,
And increase focusing step-length.
Step 3) and step 7) include:
Calculate the horizontal and vertical Grad of each pixel Z (x, y);
Calculate each pixel value level and IxAnd vertical gradient and I (X)y(X);
Calculate the inner product energy of each pixel value
Calculate all pixels value inner product energy and:Wherein IE (X) > Thr, Thr are one solid
Determine threshold value, take 10.
Advantages and positive effects of the present invention are:By inner product energy come the definition of evaluation image.The inner product energy of noise
Amount is almost 0, and the inner product energy of fringing coefficient is larger.Therefore inner product energy can effectively suppress the influence of noise, improve figure
As the automatic accuracy for focusing on.And the features such as present invention has quick, accurate, inexpensive.
Specific embodiment
The present invention will be further described below:
A kind of passive camera automatic focusing method based on inner product energy of the present invention, step is as follows:
Step 1) set and treat focus objects region ImageBlock;
Step 2) camera start-up operation, image Image1 is obtained by CCD camera;
Step 3) calculate the definition values Def1 that focal zone ImageBlock images are treated in image Image1;
Step 4) direction that focuses on of setting, step-length and definition rate of change a, a take 0.1-0.2;
Step 5) direction according to present convergence and step-length moving lens;
Step 6) image Image2 is obtained by CCD camera;
Step 7) calculate the definition values Def2 that focal zone ImageBlock images are treated in image Image2;
Step 8) compare the size of Def1 and Def2;
Step 9) if Def1<Difference very little between Def2 and Def1 and Def2Explanation
To step-length movement to focus effect very little, current focal distance pinpointed focus can continue to keep farther out, then for last focusing
The direction of focusing, increase focusing step-length;
Step 10) if Def1<Differing greatly between Def2 and Def1 and Def2Explanation
Last focusing is very big to focus effect to step-length movement, and current focal distance pinpointed focus is nearer, then can continue to keep
The direction of focusing, reduces focusing step-length;
Step 11) if Def1>Differing greatly between Def2 and Def1 and Def2Explanation
Last focusing is very big to focus effect to step-length movement, and current focal distance pinpointed focus is nearer, then need to change and focus
Direction, and reduce focusing step-length;
Step 12) if Def1>Difference very little between Def2 and Def1 and Def2Explanation
To step-length movement to focus effect very little, current focal distance pinpointed focus needs to change farther out, then focuses for last focusing
Direction, and increase focusing step-length;
Step 13) repeat step 2) to step 12), if focusing direction continuously changes number of times and reaches 5 times, illustrate current burnt
It is pinpointed focus away from position, then focusing terminates;
In theory, the degradation model of out-of-focus image is formula (1):
G (x, y)=H (x, y) F (x, y)+N (x, y) (1)
In formula, F (x, y) is real image, and H (x, y) is the point diffusion model function in imaging system, and N (x, y) is additivity
Noise function, G (x, y) is defocus degraded image.Degenerative process can be described as:Original image F (x, y) and point spread function H
After (x, y) carries out convolution algorithm, then additive noise N (x, y) is superimposed, finally obtains defocus degraded image G (x, y).Point expands
Dissipate equivalent to a low pass filter.It is accurate to focus on, and cut-off frequency is high;Conversely, cut-off frequency is relatively low.Analysis shows, positive burnt
In the case of, image is most clear, comprising image detail information at most, edge is the most clear.During image defocus, showed in spatial domain
A certain size circle of confusion is formed for spot light, adjacent pixel influences each other;High fdrequency component loss is shown as in a frequency domain, is caused
Image detail is obscured.As defocus degree increases, image detail tails off, and edge starts smoothened, fuzzy.Fuzzy image is thin
Section be also difficult to recognize, blur margin Chu, thus design based on image Auto-focusing function when, should fully take into account noise and
Edge.
Herein first from mathematical theory, noise image gradient feature is illustrated, common image noise is usually used
Additive Gaussian noise is simulated, such as formula (2):
I (x, y)=Ir(x,y)+ξ(x,y) (2)
I (x, y) is actual grey value, I in formular(x, y) is desired gray level value, and ξ (x, y) is Gaussian noise, and it is equal that ξ obeys zero
Value, the Gaussian Profile of σ standard deviations.
If the gradient of pixel X (x, y) is g (X)=[Ix(X),Iy(X) it is K × K, wherein K that gradient template], is chosen herein
=2r+1, r are the size of template, then image level and vertical gradient are respectively formula (3) and formula (4):
Ix(X)=Irx(X)+ξx(X) (3)
Iy(X)=Iry(X)+ξy(X) (4)
Wherein
Because ξ (x, y)-ξ (x, y-1) is separate, and ξ (x, y)-ξ (x, y-1)~N (0, σ2), then ξx(X) the mathematics phase
Prestige is:
Similarly, ξy(X) mathematic expectaion is:
In r is for the region G of radius, the inner product energy definition at central point X (x, y) place is:
Because
Wherein
ThereforeSimilarly,
So inner product energy can effectively reduce suppression noise.And inner product energy of the noise pixel in region is very small, and edge picture
The gradient of element is roughly the same with adjacent pixel gradient direction so that E { ξx(X) } > 0, E { ξy(X) } > 0, therefore edge pixel exists
Inner product energy in region is larger.Therefore inner product energy can effectively suppress noise.
Claims (3)
1. a kind of passive camera automatic focusing method based on inner product energy, it is characterized in that step is as follows:
Step 1) set and treat focus objects region ImageBlock;
Step 2) camera start-up operation, image Image1 is obtained by CCD camera;
Step 3) calculate the definition values Def1 that focal zone ImageBlock images are treated in image Image1;
Step 4) direction that focuses on of setting, step-length and definition rate of change a, a take 0.1-0.2;
Step 5) direction according to present convergence and step-length moving lens;
Step 6) image Image2 is obtained by CCD camera;
Step 7) calculate the definition values Def2 that focal zone ImageBlock images are treated in image Image2;
Step 8) compare the size of Def1 and Def2;
Step 9) according to the comparative result of Def1 and Def2, adjustment focusing step-length;
Step 10) repeat step 2) to step 9), if focusing direction continuously changes number of times and reaches 5 times, illustrate when front focal length
Pinpointed focus is set to, then focusing terminates;
Wherein step 3) and step 7) definition values of image are by the horizontal and vertical Grad of each pixel Z (x, y), meter
Calculate all pixels value inner product energy and obtain.
2. the passive camera automatic focusing method based on inner product energy according to claim 1, it is characterized in that:Step 9) bag
Include:
If a, Def1<Difference very little between Def2 and Def1 and Def2, i.e.,Illustrate the last time
To step-length movement to focus effect very little, current focal distance pinpointed focus can continue to keep the side of focusing farther out, then for focusing
To increase focusing step-length;
If b, Def1<Differing greatly between Def2 and Def1 and Def2, i.e.,Illustrate the last time
Focusing is very big to focus effect to step-length movement, and current focal distance pinpointed focus is nearer, then can continue to keep the side of focusing
To reduction focusing step-length;
If c, Def1>Differing greatly between Def2 and Def1 and Def2, i.e.,Illustrate the last time
Focusing is very big to focus effect to step-length movement, and current focal distance pinpointed focus is nearer, then need to change focusing direction, and subtract
Small focusing step-length;
If d, Def1>Difference very little between Def2 and Def1 and Def2, i.e.,Illustrate the last time
To step-length movement to focus effect very little, current focal distance pinpointed focus needs to change focusing direction farther out, then, and increases for focusing
Big focusing step-length.
3. the passive camera automatic focusing method based on inner product energy according to claim 1, it is characterized in that:Step 3) and
Step 7) include:
Calculate the horizontal and vertical Grad of each pixel Z (x, y);
Calculate each pixel value level and IxAnd vertical gradient and I (X)y(X);
Calculate the inner product energy of each pixel value
Calculate all pixels value inner product energy and:Wherein IE (X) > Thr, Thr are a fixed threshold
Value, takes 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611182072.8A CN106772925A (en) | 2016-12-20 | 2016-12-20 | A kind of passive camera automatic focusing method based on inner product energy |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611182072.8A CN106772925A (en) | 2016-12-20 | 2016-12-20 | A kind of passive camera automatic focusing method based on inner product energy |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106772925A true CN106772925A (en) | 2017-05-31 |
Family
ID=58891341
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611182072.8A Pending CN106772925A (en) | 2016-12-20 | 2016-12-20 | A kind of passive camera automatic focusing method based on inner product energy |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106772925A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107959767A (en) * | 2017-12-14 | 2018-04-24 | 中国科学院长春光学精密机械与物理研究所 | A kind of focusing light-dimming method using TV track result as guiding |
CN112099216A (en) * | 2020-08-18 | 2020-12-18 | 宁波永新光学股份有限公司 | Focusing method of electric fluorescence microscope |
CN113810616A (en) * | 2021-09-27 | 2021-12-17 | 季华实验室 | Aperture focal length adjusting method, system, electronic device and storage medium |
CN114294780A (en) * | 2021-11-22 | 2022-04-08 | 丁家智 | Cloud online central air conditioner fault analysis system |
CN114544004A (en) * | 2022-02-25 | 2022-05-27 | 浙江天铂云科光电股份有限公司 | Automatic focusing method for thermal infrared imager |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101813823A (en) * | 2010-03-22 | 2010-08-25 | 中国科学院长春光学精密机械与物理研究所 | Automatic focusing method for astronomical telescope |
CN101840055A (en) * | 2010-05-28 | 2010-09-22 | 浙江工业大学 | Video auto-focusing system based on embedded media processor |
US20110280558A1 (en) * | 2010-05-17 | 2011-11-17 | Ability Enterprise Co., Ltd. | Method of calibrating an autofocus lighting device of a camera |
CN103048766A (en) * | 2013-01-24 | 2013-04-17 | 华为技术有限公司 | Automatic focusing method and automatic focusing device |
-
2016
- 2016-12-20 CN CN201611182072.8A patent/CN106772925A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101813823A (en) * | 2010-03-22 | 2010-08-25 | 中国科学院长春光学精密机械与物理研究所 | Automatic focusing method for astronomical telescope |
US20110280558A1 (en) * | 2010-05-17 | 2011-11-17 | Ability Enterprise Co., Ltd. | Method of calibrating an autofocus lighting device of a camera |
CN101840055A (en) * | 2010-05-28 | 2010-09-22 | 浙江工业大学 | Video auto-focusing system based on embedded media processor |
CN103048766A (en) * | 2013-01-24 | 2013-04-17 | 华为技术有限公司 | Automatic focusing method and automatic focusing device |
Non-Patent Citations (1)
Title |
---|
马金伟,薛河儒,苏长明: "基于内积能量的分水岭图像分割方法", <IEEE> * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107959767A (en) * | 2017-12-14 | 2018-04-24 | 中国科学院长春光学精密机械与物理研究所 | A kind of focusing light-dimming method using TV track result as guiding |
CN112099216A (en) * | 2020-08-18 | 2020-12-18 | 宁波永新光学股份有限公司 | Focusing method of electric fluorescence microscope |
CN113810616A (en) * | 2021-09-27 | 2021-12-17 | 季华实验室 | Aperture focal length adjusting method, system, electronic device and storage medium |
CN113810616B (en) * | 2021-09-27 | 2023-05-09 | 季华实验室 | Aperture focal length adjustment method, system, electronic device and storage medium |
CN114294780A (en) * | 2021-11-22 | 2022-04-08 | 丁家智 | Cloud online central air conditioner fault analysis system |
CN114294780B (en) * | 2021-11-22 | 2024-05-07 | 广西联洋数智节能科技有限公司 | Cloud online central air conditioner fault analysis system |
CN114544004A (en) * | 2022-02-25 | 2022-05-27 | 浙江天铂云科光电股份有限公司 | Automatic focusing method for thermal infrared imager |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106772925A (en) | A kind of passive camera automatic focusing method based on inner product energy | |
US9762881B2 (en) | Reducing disparity and depth ambiguity in three-dimensional (3D) images | |
US9307134B2 (en) | Automatic setting of zoom, aperture and shutter speed based on scene depth map | |
US9767568B2 (en) | Image processor, image processing method, and computer program | |
TWI489418B (en) | Parallax Estimation Depth Generation | |
KR100985805B1 (en) | Apparatus and method for image stabilization using adaptive Kalman filter | |
CN103003665B (en) | Stereo distance measurement apparatus | |
KR20140000195A (en) | Autofocus for stereoscopic camera | |
JP2012118698A (en) | Image processing system | |
US9613403B2 (en) | Image processing apparatus and method | |
JP5374119B2 (en) | Distance information acquisition device, imaging device, and program | |
DE102010020867A1 (en) | Road shape recognition device | |
JP2007156939A (en) | Person detector, person detection method, and person detection program | |
JP2011243194A (en) | Image processing method for searching correspondence point | |
US10933931B2 (en) | Image processing method and system, storage medium and moving system | |
CN109064505A (en) | A kind of depth estimation method extracted based on sliding window tensor | |
CN110414385A (en) | A kind of method for detecting lane lines and system based on homography conversion and characteristic window | |
CN108665436B (en) | Multi-focus image fusion method and system based on gray mean reference | |
Chen et al. | Blur-aware disparity estimation from defocus stereo images | |
CN105430277A (en) | Automatic focusing control method and device | |
CN106791353B (en) | The methods, devices and systems of auto-focusing | |
KR101870700B1 (en) | A fast key frame extraction method for 3D reconstruction from a handheld video | |
CN109175718B (en) | Picture laser engraving method based on halftone technology | |
CN113920065B (en) | Imaging quality evaluation method for visual detection system of industrial site | |
Karaali et al. | Adaptive scale selection for multiresolution defocus blur estimation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170531 |