CN110108230B - Binary grating projection defocus degree evaluation method based on image difference and LM iteration - Google Patents
Binary grating projection defocus degree evaluation method based on image difference and LM iteration Download PDFInfo
- Publication number
- CN110108230B CN110108230B CN201910372643.1A CN201910372643A CN110108230B CN 110108230 B CN110108230 B CN 110108230B CN 201910372643 A CN201910372643 A CN 201910372643A CN 110108230 B CN110108230 B CN 110108230B
- Authority
- CN
- China
- Prior art keywords
- image
- grating
- iteration
- selecting
- camera
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/24—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
- G01B11/2433—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures for measuring outlines by shadow casting
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Image Processing (AREA)
- Automatic Focus Adjustment (AREA)
Abstract
The invention discloses a binary grating projection defocus degree evaluation method based on image difference and LM iteration, which comprises the following steps of: adjusting parameters of the output grating of the projector before testing; in the testing process, firstly, difference operation is carried out on an image acquired by a camera, and then iteration operation is carried out on the difference image by an LM (least squares) method aiming at a sinusoidal target function; and acquiring absolute errors of data at each point of the image and the actual image when the iteration is ended, and correcting the absolute errors by using the gray scale range of the image to reduce fluctuation errors. The defocusing degree evaluation method is used for evaluating the defocusing degree from the experimental point of view, and has the advantages of high defocusing degree judgment accuracy, simple required equipment, convenience, practicability, real-time display and the like.
Description
Technical Field
The invention relates to the field of optical measurement experiment solid mechanics, in particular to a binary grating projection defocus degree evaluation method based on image difference and LM iteration.
Background
In the field of optical measurement mechanics, a grid line projection method is a basic optical topography measurement method. The grid line projection method directly utilizes the phase distortion information of the modulated grid lines to obtain the three-dimensional information of the object, adopts a mathematical method to demodulate the phase, and can automatically judge the concave-convex property of the object. Therefore, the image processing is easy to realize automation and has higher precision and sensitivity.
For convenience of measurement, in the grid line projection method, a projector projects a two-dimensional structural pattern (stripe pattern) instead of a sinusoidal pattern in a 3D shape, and then a binary pattern is blurred into a quasi-sinusoidal pattern by appropriately defocusing the projector to realize the pattern, which is called a binary defocus technique. It can not only eliminate gamma distortion, but also realize high-speed 3D measurement. However, the binary defocus technique has some problems: if the defocus level is too small, the pattern is not sinusoidal, containing many higher harmonics. If the projector is out of focus, the contrast of the pattern is too low. Non-sinusoidal structures cause harmonics in binary defocus techniques by high orders to introduce errors into the demodulation phase, which can reduce the accuracy of the 3D measurement. In addition, in practical applications, in order to improve the accuracy of measurement, the problem that the beta distortion existing in the electronic device causes the received image to have a certain non-sinusoidal characteristic must be considered. Such problems affect the accuracy of the measurement and are not conducive to the development of high-precision photometry.
Disclosure of Invention
The invention aims to provide a binary grating projection defocus degree evaluation method based on image difference and LM iteration.
The technical solution for realizing the purpose of the invention is as follows: a binary grating projection defocus degree evaluation method based on image difference and LM iteration is disclosed, an experimental device of the method comprises a camera, a camera lens, an optical platform, a computer, a projector and a calibration plate, and the evaluation method comprises the following steps:
step 5, selecting the optimal defocusing degree: and (4) changing the focal length and the aperture, and repeating the step 2 to the step 4, wherein the corresponding defocusing degree under the optimal evaluation value is the optimal defocusing degree.
Compared with the prior art, the invention has the following remarkable advantages: (1) the method starts from the angle of experiment, the accuracy of judging the defocusing degree is high, and for a system with radian fluctuation of +/-0.05 rad without defocusing, the fluctuation error of less than +/-0.01 rad can be achieved under the optimal defocusing degree obtained by the method; (2) the equipment required by the invention is simple, convenient and practical; (3) the algorithm speed of the invention can reach 50 frames per second, meets the requirement of real-time calculation, can display in real time and has strong intuition.
Drawings
FIG. 1 is a schematic view of an experimental apparatus according to the present invention.
FIG. 2 is a flowchart of a binary grating projection defocus degree evaluation method based on image difference and LM iteration.
Detailed Description
A binary grating projection defocus degree evaluation method based on image difference and LM iteration is disclosed, an experimental device of the method comprises a camera, a camera lens, an optical platform, a computer, a projector and a calibration plate, and the evaluation method comprises the following steps:
step 5, selecting the optimal defocusing degree: and (4) changing the focal length and the aperture, and repeating the step 2 to the step 4, wherein the corresponding defocusing degree under the optimal evaluation value is the optimal defocusing degree.
Further, the method for calculating the optimal action length L in step 3 is as follows:
selecting a line or a row with grating characteristics in an original image, selecting one line if the projected grating is a vertical grating, and selecting one row if the projected grating is a horizontal grating; the default is vertical raster in the following steps, if the vertical raster is horizontal raster, only the description of the row and the column need to be exchanged;
wherein k is a periodic coefficient, pi is a circumferential ratio, GmaxMaximum gray value, G, in a selected region of the original imageminMinimum gray value, A, in a selected region for the original image1=Gmax-Gmin;The maximum gray value within the selected area for the first order difference image of the original image,the minimum gray value within the selected region for the first order difference image,
further, the rectangular region selection method in step 3 is as follows:
and selecting a rectangular area with the area size of L multiplied by R pixels by the optimal action length L, wherein R is more than or equal to 50 and less than or equal to 200, and if the total row number of the image is less than 50, taking the row number as the longitudinal side length of the selected rectangular area, wherein the selected rectangular area is completely positioned in the area of raster projection.
Further, the method for generating the feature array in step 3 is as follows:
(1) performing differential operation on each row of the image according to the behavior standard to obtain a numerical value G on each point of a new image*(x, y) ═ G (x +1, y) -G (x, y), where x is 1. ltoreq. x.ltoreq.l-1, and y is 1. ltoreq. y.ltoreq.r; generating a difference image with the size of (L-1) multiplied by R;
(2) taking the column as a reference, carrying out average value operation on each row, and finally generating a characteristic array
Further, step 4 specifically includes:
and fitting the characteristic array by adopting an LM iteration method, wherein the objective function is as follows:
F(x)=a0+a1cos(a2x+a3)
wherein a is0,a1,a2,a3For the coefficients of the objective function, the initial values of the LM iteration are:
by taking the sum of absolute errors between the feature array of the original image and the fitted arrayThe final defocus evaluation value is:
where α is the correction factor.
The present invention will be described in detail with reference to examples.
Examples
As shown in FIG. 1, a binary grating projection defocus degree evaluation method based on image difference and LM (Levenberg-Marquardt) iteration comprises the following equipment: the device comprises an industrial camera 1, a high-resolution lens 2, an optical platform 4, an electronic computer 6, a projector 5, a low-reflection-rate plane calibration plate and a clamping device 3 thereof. The pixels of the industrial camera adopted in the test experiment are 400 ten thousand pixels, and the focal length of the lens is 35 mm. As shown in fig. 2, the evaluation method includes the steps of:
and selecting one line or one row with grating characteristics in the original image, selecting one line if the projected grating is vertical grating, and selecting one row if the projected grating is horizontal grating. In the following description, the vertical raster is taken as an example by default, and in the case of the horizontal raster, the description of the row and the column only need to be exchanged. Assuming that the number of columns of the image is C, the length of the selected row should be controlled to be 0.2C-C, and the selected portion is completely within the area of the raster projection.
Wherein k is a periodic coefficient, and 2 (1.5-3) is generally selected; pi is the circumference ratio; gmaxMaximum gray value, G, in a selected region of the original imageminMinimum gray value, A, in a selected region for the original image1=Gmax-Gmin;The maximum gray value within the selected area for the first order difference image of the original image,the minimum gray value within the selected region for the first order difference image,
the region selection method is as follows:
firstly, selecting a rectangular area with the area size of L multiplied by R (R is more than or equal to 50 and less than or equal to 200) by the optimal action length, and if the total row number of the image is less than 50, directly taking the row number as the longitudinal side length of the selected rectangular area, wherein the selected part is completely positioned in the area of raster projection.
The generation method of the feature array is as follows:
firstly, on the basis of behaviors, each line of the image is subjected to differential operation to obtain a numerical value G on each point of a new image*(x, y) ═ G (x +1, y) -G (x, y), where x is 1. ltoreq. x.ltoreq.l-1, and y is 1. ltoreq. y.ltoreq.r. Finally generating a differential image with the size of (L-1) multiplied by R; further, based on the column, the average value operation is performed on each row, and the feature array finally generated isWherein x is more than or equal to 1 and less than or equal to (L-1).
And fitting the characteristic array by the LM iteration method, wherein the target function is as follows:
F(x)=a0+a1cos(a2x+a3)
wherein the initial values of the LM iteration method are:
by taking the sum of absolute errors between the feature array of the original image and the fitted arrayThe final defocus evaluation value is:
where α is a correction factor, and its specific value can be calibrated by experiment. The calibration method of alpha comprises the following steps:
the system is first fixed according to step 1 as described in claim 1. And focusing the camera to be fuzzy, and carrying out phase reconstruction on the plane of the calibration plate according to a six-step phase shift method. Performing 5-time surface fitting on the restored phase information, and subtracting fitting data from the original data to generate an error matrix F0. Obtaining the variance D under the current defocus degree0. And continuously adjusting the focal length of the camera, and discretely sampling in the process of blurring-sharpness-blurring until the number of samples is more than 5 groups. The selection of alpha only needs to make D and the evaluation value P of each group in positive correlation. For an 8-bit camera, the value of alpha is between 0 and 2.
Step 5, selecting the optimal defocusing degree: and (4) slightly changing the current focal length and the aperture, and repeating the step 2 to the step 4, wherein the corresponding defocusing degree under the optimal evaluation value is the optimal position to be selected.
Claims (1)
1. A binary grating projection defocus degree evaluation method based on image difference and LM iteration is characterized in that an experimental device of the method comprises a camera, a camera lens, an optical platform, a computer, a projector and a calibration plate, and the evaluation method comprises the following steps:
step 1, fixing an experimental device: fixing a calibration plate, a camera and a projector on an optical platform, wherein a camera lens is vertical to the plane of the calibration plate, and a projector lens is aligned to the direction of the maximum plane of the calibration plate for positioning;
step 2, collecting a grating image: projecting a binary grating image to the calibration plane by using a projector, and acquiring images of the calibration plate and the grating by using a camera;
step 3, preprocessing image data: determining the optimal action length, selecting a rectangular area on the image by taking the length as a reference, and generating a feature array required by evaluating the image;
the optimal action length L is calculated by the following method:
selecting a line or a row with grating characteristics in an original image, selecting one line if the projected grating is a vertical grating, and selecting one row if the projected grating is a horizontal grating; the default is vertical raster in the following steps, if the vertical raster is horizontal raster, only the description of the row and the column need to be exchanged;
wherein k is a periodic coefficient, pi is a circumferential ratio, GmaxMaximum gray value, G, in a selected region of the original imageminMinimum gray value, A, in a selected region for the original image1=Gmax-Gmin;The maximum gray value within the selected area for the first order difference image of the original image,the minimum gray value within the selected region for the first order difference image,
the rectangular area selection method is as follows:
selecting a rectangular area with the area size of L multiplied by R pixels by the optimal action length L, wherein R is more than or equal to 50 and less than or equal to 200, and if the total row number of the image is less than 50, taking the row number as the longitudinal side length of the selected rectangular area, wherein the selected rectangular area is completely positioned in the area of raster projection;
the generation method of the feature array in the step 3 is as follows:
(1) performing differential operation on each row of the image according to the behavior standard to obtain a numerical value G on each point of a new image*(x, y) ═ G (x +1, y) -G (x, y), where x is 1. ltoreq. x.ltoreq.l-1, and y is 1. ltoreq. y.ltoreq.r; generating a difference image with the size of (L-1) multiplied by R;
(2) on a column basis, for each rowPerforming an average operation to finally generate a feature array of
Step 4, evaluating the current defocus degree: evaluating the image characteristic array to obtain an evaluation value; the method specifically comprises the following steps:
and fitting the characteristic array by adopting an LM iteration method, wherein the objective function is as follows:
F(x)=a0+a1cos(a2x+a3)
wherein a is0,a1,a2,a3For the coefficients of the objective function, the initial values of the LM iteration are:
by taking the sum of absolute errors between the feature array of the original image and the fitted arrayThe final defocus evaluation values are:
wherein α is a correction coefficient;
step 5, selecting the optimal defocusing degree: and (4) changing the focal length and the aperture, and repeating the step 2 to the step 4, wherein the corresponding defocusing degree under the optimal evaluation value is the optimal defocusing degree.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910372643.1A CN110108230B (en) | 2019-05-06 | 2019-05-06 | Binary grating projection defocus degree evaluation method based on image difference and LM iteration |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910372643.1A CN110108230B (en) | 2019-05-06 | 2019-05-06 | Binary grating projection defocus degree evaluation method based on image difference and LM iteration |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110108230A CN110108230A (en) | 2019-08-09 |
CN110108230B true CN110108230B (en) | 2021-04-16 |
Family
ID=67488326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910372643.1A Active CN110108230B (en) | 2019-05-06 | 2019-05-06 | Binary grating projection defocus degree evaluation method based on image difference and LM iteration |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110108230B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111721237B (en) * | 2020-06-30 | 2021-07-09 | 苏州东方克洛托光电技术有限公司 | Full-automatic multi-frequency defocusing projection three-dimensional imaging measurement system and measurement method thereof |
CN113192146B (en) * | 2021-05-10 | 2022-08-16 | 南京理工大学 | Method for eliminating defocusing error in grid line projection phase shift technology based on deep learning |
CN114923437B (en) * | 2022-05-19 | 2023-09-26 | 四川大学 | Three-dimensional measurement method and device based on defocused binary square wave fringes |
Family Cites Families (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6870609B2 (en) * | 2001-02-09 | 2005-03-22 | August Technology Corp. | Confocal 3D inspection system and process |
CN1241058C (en) * | 2003-01-23 | 2006-02-08 | 浙江大学 | Object plane adjustment method of optical projection system based on defocus depth analysis and its device |
US7286246B2 (en) * | 2003-03-31 | 2007-10-23 | Mitutoyo Corporation | Method and apparatus for non-contact three-dimensional surface measurement |
CN1614353A (en) * | 2003-11-07 | 2005-05-11 | 财团法人工业技术研究院 | System for generating structural light with sine distribution in density |
CN1296742C (en) * | 2004-02-13 | 2007-01-24 | 中国科学院力学研究所 | Angular automatic focusing system and method for optical imaging system |
US7463367B2 (en) * | 2004-07-13 | 2008-12-09 | Micron Technology, Inc. | Estimating overlay error and optical aberrations |
JP2015513070A (en) * | 2012-01-31 | 2015-04-30 | スリーエム イノベイティブ プロパティズ カンパニー | Method and apparatus for measuring the three-dimensional structure of a surface |
CN106725567B (en) * | 2012-11-05 | 2020-02-07 | 上海联影医疗科技有限公司 | Electronic computer X-ray tomography scanner |
CN103134444B (en) * | 2013-02-01 | 2015-07-29 | 同济大学 | The varifocal three-dimension measuring system of double-view field |
CN103292734B (en) * | 2013-05-27 | 2015-10-28 | 华中科技大学 | Gamma value scaling method in phase measuring system |
CN103557808B (en) * | 2013-11-19 | 2016-05-25 | 东南大学 | A kind of out-of-focus projection's grating measuring method based on Sierra Lite dither algorithm |
CN203843368U (en) * | 2014-03-31 | 2014-09-24 | 南京先进激光技术研究院 | Defocusing distance positioning device |
CN104457614B (en) * | 2014-11-11 | 2017-09-01 | 南昌航空大学 | Streak reflex method for three-dimensional measurement based on binary system striped defocus |
CN105157614B (en) * | 2015-06-05 | 2017-11-07 | 四川大学 | Method for three-dimensional measurement based on two-value phase-shift pattern |
CN105783775B (en) * | 2016-04-21 | 2018-05-11 | 清华大学 | A kind of minute surface and class minute surface object surface appearance measuring device and method |
CN105806259B (en) * | 2016-04-29 | 2018-08-10 | 东南大学 | A kind of method for three-dimensional measurement based on the projection of two-value grating defocus |
CN106017357A (en) * | 2016-08-04 | 2016-10-12 | 南昌航空大学 | Defocused projection three-dimensional measuring method based on colorful triangular wave fringes |
CN106780469A (en) * | 2016-12-23 | 2017-05-31 | 浙江大学 | A kind of quality evaluating method of many depth of field scene defocus sequence charts |
CN109242897B (en) * | 2018-09-12 | 2022-02-15 | 广东工业大学 | Binary pattern defocused projection method of structured light measurement system |
CN109596065B (en) * | 2018-12-07 | 2021-06-01 | 中国科学院光电技术研究所 | High-precision micro-nano three-dimensional measurement method based on time domain phase shift algorithm |
CN109579738B (en) * | 2019-01-04 | 2020-08-28 | 北京理工大学 | Low-pass filtering characteristic measuring method of binary fringe defocusing projection system |
-
2019
- 2019-05-06 CN CN201910372643.1A patent/CN110108230B/en active Active
Non-Patent Citations (3)
Title |
---|
Iterative optimum frequency combination method for high efficiency phase imaging of absorptive objects based on phase transfer function;Sun Jiasong等;《Optics Express》;20151231;第23卷(第21期);28031-49 * |
基于光强传输方程的相位恢复与多模式成像研究;张赵;《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》;20190115;C030-112 * |
基于嵌入式系统的摄像头自动调焦关键技术研究;姜晓博;《中国优秀硕士学位论文全文数据库信息科技辑》;20130615;I138-1498 * |
Also Published As
Publication number | Publication date |
---|---|
CN110108230A (en) | 2019-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110108230B (en) | Binary grating projection defocus degree evaluation method based on image difference and LM iteration | |
CN113205593B (en) | High-light-reflection surface structure light field three-dimensional reconstruction method based on point cloud self-adaptive restoration | |
Zhang et al. | A novel calibration approach to structured light 3D vision inspection | |
Douxchamps et al. | High-accuracy and robust localization of large control markers for geometric camera calibration | |
JP5412757B2 (en) | Optical system distortion correction method and optical system distortion correction apparatus | |
US11512946B2 (en) | Method and system for automatic focusing for high-resolution structured light 3D imaging | |
CN105953741B (en) | System and method for measuring local geometric deformation of steel structure | |
CN114359405A (en) | Calibration method of off-axis Samm 3D line laser camera | |
Liu et al. | Large depth-of-field 3D measurement with a microscopic structured-light system | |
Sun et al. | Lens distortion correction for improving measurement accuracy of digital image correlation | |
KR101833245B1 (en) | METHOD AND SYSTEM FOR CALIBRATION OF SURFACE MEASUREMENT DEVICE USING Phase measuring deflectometry | |
Moru et al. | Analysis of different parameters of influence in industrial cameras calibration processes | |
CN112903121B (en) | Wavefront detection method based on cross iterative automatic focusing | |
CN111754587B (en) | Zoom lens rapid calibration method based on single-focus focusing shooting image | |
CN113188671A (en) | Wavefront detection method based on cross iteration automatic position correction | |
EP1256831A1 (en) | Method and system for calibrating an image range device | |
CN113160393B (en) | High-precision three-dimensional reconstruction method and device based on large depth of field and related components thereof | |
Cheng et al. | Camera Calibration Based on Phase Estimation | |
CN113923445B (en) | Light field camera calibration method and system under shift imaging condition | |
Schoenleber et al. | Fast and flexible shape control with adaptive LCD fringe masks | |
US20220398778A1 (en) | Lens calibration method for digital imaging apparatus | |
Li et al. | Identification and correction of microlens array rotation error in plenoptic imaging systems | |
Bergues et al. | Electronic interface with vignetting effect reduction for a Nikon 6B/6D autocollimator | |
Shafer | Automation and calibration for robot vision systems | |
CN111862237A (en) | Camera calibration method for optical surface shape measurement and device for implementing 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 | ||
CB03 | Change of inventor or designer information | ||
CB03 | Change of inventor or designer information |
Inventor after: Liu Cong Inventor after: Yin Zhuoyi Inventor after: Liu Xiaopeng Inventor after: Mei Lin Inventor before: Yin Zhuoyi Inventor before: Liu Cong Inventor before: Liu Xiaopeng Inventor before: Mei Lin |
|
GR01 | Patent grant | ||
GR01 | Patent grant |