CN109307970A - A kind of automatic focusing method of camera - Google Patents
A kind of automatic focusing method of camera Download PDFInfo
- Publication number
- CN109307970A CN109307970A CN201811399037.0A CN201811399037A CN109307970A CN 109307970 A CN109307970 A CN 109307970A CN 201811399037 A CN201811399037 A CN 201811399037A CN 109307970 A CN109307970 A CN 109307970A
- Authority
- CN
- China
- Prior art keywords
- camera
- width
- line
- curve
- gray
- 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
- 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
-
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
Abstract
The present invention provides a kind of automatic focusing method of camera, include the following steps: step 1: shooting picture with camera, choose a line of demarcation, separated black, the edge margin in region one side in this line of demarcation;Step 2: calculating the width of gray area between region on line of demarcation selected by picture;Step 3: finding theoretical focal range, then moved up and down with to fix paces and taken pictures;Step 4: the curve of the width of straight line fitting camera site and gray area;Step 5: optimal camera site being found by curve, realizes focusing.The present invention can accurately control the adjustment of camera focus, and it is universal to carry out volume production while being conducive to improve precision.
Description
Technical field
The present invention relates to field of industry detection more particularly to a kind of automatic focusing method of camera.
Background technique
Field of industry detection, camera are most crucial one of test components.For the detection scheme that Different Industries are used, all
Play significant role.Including assembly line, product defects inspection, product function module testing etc..But in terms of camera focusing,
There are no relatively advanced debugging plan is popularized, the method for still using depth of field ruler, visual equally accurate not high more at present is single
Platform machine can manually accomplish, total more particularly to several machines when machine quantity increases to dozens or even hundreds of
With detection is completed, it require that the being consistent property of parameter of machine, it will the problem of being difficult control occur, directly affect and most terminate
Fruit.
Summary of the invention
In order to solve the problems, such as that in the prior art, the present invention provides a kind of automatic focusing method of camera.
1, the readability of image can be measured with such as under type:
1) with camera shooting a line boundary line (black a, edge margin on one side)
2) width of gray area between region on picture is calculated
3) when width is smaller, image is more clear
2, the method for gray area width is calculated:
1) line (such as figure two) across black and white region is drawn from image
2) gray scale-location drawing and its derivative figure (such as figure three) of this line are drawn
3) width of gray area is calculated according to gray scale-location drawing and its derivative figure:
Using the point of the highest point corresponding grey scale location drawing of derivative figure as starting point, to two sides find on curve black area white area it
Between the point (A, B) of certain proportion gray value gray area width (curve is found out according to slope according to AB point calculated curve slope
The width of upper region of variation).
3, according to telecentric lens, following method is carried out:
1) according to theoretical calculation, the width of gray area is linear in object-focal plane distance and picture
2) theoretical focal range (from product specification book) is found, then to fix on paces (determining according to the camera depth of field)
Lower movement is taken pictures
3) curve (such as figure four) of the width of straight line fitting camera site and gray area
4) it is found optimal camera site (intersection point of two matched curves) by curve, realizes focusing.
The beneficial effects of the present invention are:
The present invention can accurately control the adjustment of camera focus, and it is universal to carry out volume production while being conducive to improve precision.
The technology can quantify picture readability.
The technology can rapidly find out focal position to telecentric lens by way of fitting.
Detailed description of the invention
Fig. 1 a is the picture being taken;Fig. 1 b is the enlarged drawing of the middle section in Fig. 1 a, and a line of demarcation is selected in display;Figure
1c is the magnified partial view in Fig. 1 b, and the gray area on line of demarcation is shown in figure;
Fig. 2 is for showing the line across black and white region;
Fig. 3 is gray scale-location drawing;
Fig. 4 is matched curve.
Specific embodiment
The present invention will be further described with reference to the accompanying drawing.
A kind of automatic focusing method of camera, includes the following steps:
Step 1: shooting picture (as shown in Figure 1a) with camera, choose a line of demarcation, the separated region in this line of demarcation
It is black on one side, an edge margin;It as shown in Figure 1 b, is above black, here is white;
Step 2: calculating the width of gray area between region on line of demarcation selected by picture;See the line of demarcation in Fig. 1 c
On gray area;When gray area width is smaller, image is more clear;
Wherein calculate the method for gray area width:
Step 2.1: a line across black and white region is drawn from image;As shown in Figure 2;
Step 2.2: drawing the gray scale-location drawing and its derivative figure of this line;As shown in Figure 3;
Step 2.3: the width of gray area is calculated according to gray scale-location drawing and its derivative figure:
Using the point of the highest point C corresponding grey scale location drawing of derivative figure as starting point, black area white area on curve is found to two sides
Between the point A and B of certain proportion gray value gray area width, grey are found out according to slope according to AB point calculated curve slope
Peak width is the width of region of variation on curve;
Step 3: according to theoretical calculation, the width of gray area is linear in object-focal plane distance and picture, finds
Theoretical focal range (coming from product specification book) then moves up and down and takes pictures to fix paces (determining according to the camera depth of field);
Step 4: the curve (such as Fig. 4) of the width of straight line fitting camera site and gray area;
Step 5: being found optimal camera site (intersection point of two matched curves) by curve, realize focusing.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that
Specific implementation of the invention is only limited to these instructions.For those of ordinary skill in the art to which the present invention belongs, exist
Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to of the invention
Protection scope.
Claims (4)
1. a kind of automatic focusing method of camera, which comprises the steps of:
Step 1: shooting picture with camera, choose a line of demarcation, separated black, the edge margin in region one side in this line of demarcation;
Step 2: calculating the width of gray area between region on line of demarcation selected by picture;
Wherein calculate the method for gray area width:
Step 2.1: a line across black and white region is drawn from image;
Step 2.2: drawing the gray scale-location drawing and its derivative figure of this line;
Step 2.3: the width of gray area is calculated according to gray scale-location drawing and its derivative figure:
Using the point of the highest point C corresponding grey scale location drawing of derivative figure as starting point, found on curve between the white area of black area to two sides
The point A and B of certain proportion gray value find out gray area width, gray area according to slope according to AB point calculated curve slope
Width is the width of region of variation on curve;
Step 3: finding theoretical focal range, then moved up and down with to fix paces and taken pictures;
Step 4: the curve of the width of straight line fitting camera site and gray area;
Step 5: optimal camera site being found by curve, realizes focusing.
2. a kind of automatic focusing method of camera according to claim 1, it is characterised in that: the theory focal range comes from
Product specification book.
3. a kind of automatic focusing method of camera according to claim 1, it is characterised in that: the fixed paces are according to camera
The depth of field determines.
4. a kind of automatic focusing method of camera according to claim 1, it is characterised in that: the optimal shooting of the step 5
Position is the intersection point of two matched curves.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811399037.0A CN109307970A (en) | 2018-11-22 | 2018-11-22 | A kind of automatic focusing method of camera |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811399037.0A CN109307970A (en) | 2018-11-22 | 2018-11-22 | A kind of automatic focusing method of camera |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109307970A true CN109307970A (en) | 2019-02-05 |
Family
ID=65222372
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811399037.0A Pending CN109307970A (en) | 2018-11-22 | 2018-11-22 | A kind of automatic focusing method of camera |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109307970A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112102395A (en) * | 2020-11-09 | 2020-12-18 | 广东科凯达智能机器人有限公司 | Autonomous inspection method based on machine vision |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5878152A (en) * | 1997-05-21 | 1999-03-02 | Cognex Corporation | Depth from focal gradient analysis using object texture removal by albedo normalization |
CN102053339A (en) * | 2010-11-23 | 2011-05-11 | 天津市亚安科技电子有限公司 | Automatic focusing method |
CN103686023A (en) * | 2012-09-11 | 2014-03-26 | 精工爱普生株式会社 | Image processing device, projector, and image processing method |
CN103875019A (en) * | 2011-10-11 | 2014-06-18 | 安奇逻辑股份有限公司 | All-focused image generation method, device using same, and program using same, and object height data acquisition method, device using same, and program using same |
WO2016161734A1 (en) * | 2015-04-07 | 2016-10-13 | 中兴通讯股份有限公司 | Autofocusing method and device |
CN106707674A (en) * | 2015-11-17 | 2017-05-24 | 深圳市绎立锐光科技开发有限公司 | Automatic focusing method of projection equipment and the projection equipment |
CN107783250A (en) * | 2016-08-26 | 2018-03-09 | 昆山丘钛微电子科技有限公司 | Picture pick-up device quick focusing method with automatic focusing function |
-
2018
- 2018-11-22 CN CN201811399037.0A patent/CN109307970A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5878152A (en) * | 1997-05-21 | 1999-03-02 | Cognex Corporation | Depth from focal gradient analysis using object texture removal by albedo normalization |
CN102053339A (en) * | 2010-11-23 | 2011-05-11 | 天津市亚安科技电子有限公司 | Automatic focusing method |
CN103875019A (en) * | 2011-10-11 | 2014-06-18 | 安奇逻辑股份有限公司 | All-focused image generation method, device using same, and program using same, and object height data acquisition method, device using same, and program using same |
US20150332473A1 (en) * | 2011-10-11 | 2015-11-19 | Acutelogic Corporation | All-focused image generation method, device for same, and recording medium for same, and object height data acquisition method, device for same, and recording medium for same |
CN103686023A (en) * | 2012-09-11 | 2014-03-26 | 精工爱普生株式会社 | Image processing device, projector, and image processing method |
WO2016161734A1 (en) * | 2015-04-07 | 2016-10-13 | 中兴通讯股份有限公司 | Autofocusing method and device |
CN106707674A (en) * | 2015-11-17 | 2017-05-24 | 深圳市绎立锐光科技开发有限公司 | Automatic focusing method of projection equipment and the projection equipment |
CN107783250A (en) * | 2016-08-26 | 2018-03-09 | 昆山丘钛微电子科技有限公司 | Picture pick-up device quick focusing method with automatic focusing function |
Non-Patent Citations (2)
Title |
---|
尤玉虎等: "基于图像处理的自动对焦技术综述", 《激光与红外》 * |
廖定安: "自动图像聚焦判别的数字图像处理算法分析", 《数字技术与应用》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112102395A (en) * | 2020-11-09 | 2020-12-18 | 广东科凯达智能机器人有限公司 | Autonomous inspection method based on machine vision |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10664992B2 (en) | Non-contact visual detection method for mark positioning of mobile phone touch screen | |
CN102540636B (en) | Lens calibration system | |
CN105025290B (en) | A kind of inclined method between adjust automatically camera module sensor and camera lens | |
CN103604815B (en) | Chip glass pick-up unit and scaling method | |
US9791725B2 (en) | Method and system for repairing defective pixel, and display panel | |
CN203929068U (en) | A kind of wide field optical system | |
CN103149789A (en) | Image modulation transfer function (MTF) evaluation-based module motor curve testing method | |
CN106017350A (en) | Machine-vision-based rapid detection device and detection method for medium and small module gears | |
CN104021540A (en) | Static state calibration device and method for machine visual surface detection equipment | |
CN101726246A (en) | Correcting sheet and correcting method | |
CN103858001A (en) | Method for inspecting flat panel | |
CN102735699B (en) | For the positioning mark system of x-ray inspection aftertreatment | |
CN108489394A (en) | A kind of large-scale sheet metal works almost T-stable automatic detection device and method | |
CN103162939A (en) | Camera lens focusing detection method and device using the same | |
CN111338051B (en) | Automatic focusing method and system based on TFT liquid crystal panel | |
CN102854195B (en) | Method for detecting defect coordinates on color filter | |
CN110646376A (en) | Lens defect detection method based on fringe deflection | |
CN104034259B (en) | A kind of image measurer bearing calibration | |
CN109307970A (en) | A kind of automatic focusing method of camera | |
CN106441162A (en) | Cylindrical object verticality noncontact detection device and method | |
CN208042989U (en) | A kind of large-scale sheet metal works almost T-stable automatic detection device | |
CN107643611A (en) | A kind of automatic checkout system of liquid crystal display and backlight assembly precision | |
CN206281468U (en) | A kind of contactless detection device of columnar object perpendicularity | |
CN113538399A (en) | Method for obtaining accurate contour of workpiece, machine tool and storage medium | |
CN112378797A (en) | Full-automatic indentation measuring device and method |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190205 |