CN105701776B - A kind of lens distortion antidote and system for automatic optics inspection - Google Patents

A kind of lens distortion antidote and system for automatic optics inspection Download PDF

Info

Publication number
CN105701776B
CN105701776B CN201610008261.7A CN201610008261A CN105701776B CN 105701776 B CN105701776 B CN 105701776B CN 201610008261 A CN201610008261 A CN 201610008261A CN 105701776 B CN105701776 B CN 105701776B
Authority
CN
China
Prior art keywords
distortion
coordinate
angle point
pixel
obtains
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
Application number
CN201610008261.7A
Other languages
Chinese (zh)
Other versions
CN105701776A (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.)
Wuhan Jingce Electronic Group Co Ltd
Original Assignee
Wuhan Jingce Electronic Group Co Ltd
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 Wuhan Jingce Electronic Group Co Ltd filed Critical Wuhan Jingce Electronic Group Co Ltd
Priority to CN201610008261.7A priority Critical patent/CN105701776B/en
Publication of CN105701776A publication Critical patent/CN105701776A/en
Application granted granted Critical
Publication of CN105701776B publication Critical patent/CN105701776B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of lens distortion antidotes and system for automatic optics inspection.Its process is:Non-homogeneous gridiron pattern is chosen as scaling board, obtains distortion figure;Angle point coarse extraction is carried out to distortion figure;Accurate angle point grid is carried out by corroding expansion and blob analyses to the intensive angle point of coarse extraction, obtains real angle point;Calculate the distortion model parameter between real angular coordinate and ideograph angular coordinate;The coordinate of each pixel in distortion figure is calculated according to the coordinate of pixel each in distortion model parameter and ideograph;It is obtained according to the coordinate of pixel each in distortion figure according to the corresponding pixel value of pixel coordinate each in distortion figure.The present invention uses chessboard heterogeneous, makes Edge Feature Points distribution more more dense, is more nearly actual conditions in this way, the distortion model parameter calculated is more reasonable;Real angle point is extracted by corroding expansion and blob analyses, angle point grid precision is high, and distortion correction effect is good.

Description

A kind of lens distortion antidote and system for automatic optics inspection
Technical field
The invention belongs to AOI automatic measurement techniques fields, and in particular to a kind of lens distortion for automatic optics inspection Antidote and system.
Background technology
In automatic detection field and vision measurement field, the quality of camera lens directly affects detection or measures effect Fruit has the camera lens of many types, but can cause distortion in varying degrees currently on the market, even expensive again, effect is good again Camera lens can not evade distortion.So in detection and measurement, the influence to distort to subsequent processing will be solved first, as possible Correction distortion.Existing distortion correction is distributed in edge, using uniform gridiron pattern more using uniform gridiron pattern due to distorting The resultant error of calculating is larger;And redundancy angle is generally rejected using the method for angle point removal during accurately extraction angle point Point, process is complicated, and angle point grid precision is low, and final rectification effect is poor.
Invention content
The purpose of the present invention is exactly insufficient existing for above-mentioned background technology in order to solve, and is provided a kind of for automated optical inspection The lens distortion antidote and system of survey.
The technical solution adopted by the present invention is:A kind of lens distortion antidote for automatic optics inspection, including with Lower step:
Step 1, non-homogeneous gridiron pattern is chosen as scaling board, and camera lens shooting scaling board to be corrected obtains distortion figure;
Step 2, angle point coarse extraction is carried out to distortion figure, obtains intensive angle point;
Step 3, accurate angle point grid is carried out by corroding expansion and blob analyses to the intensive angle point of coarse extraction, obtained true Positive angle point;
Step 4, the distortion model parameter between real angular coordinate and ideograph angular coordinate is calculated;
Step 5, each picture in distortion figure is calculated according to the coordinate of pixel each in distortion model parameter and ideograph The coordinate of vegetarian refreshments;
It step 6, should according to each pixel coordinate pair in the coordinate acquisition distortion figure of pixel each in distortion figure Pixel value.
Further, the process of described pair of distortion figure progress angle point coarse extraction is:Distortion figure is carried out at binaryzation Reason obtains bianry image, carries out template matches to bianry image, obtains intensive angle point.
Further, the distortion model parameter is calculated by least square method and LM optimizations.
Further, the computational methods of the coordinate of each pixel are in the distortion figure:
In formula:X, y is respectively the transverse and longitudinal coordinate of each pixel in distortion figure, and u, v are respectively every in ideograph The transverse and longitudinal coordinate of a pixel, aij、bijDistortion model parameter between respectively real angular coordinate and ideograph angular coordinate, N Value is 3 or 4.
Further, each the corresponding pixel value of pixel coordinate passes through in the figure that will distort often in the distortion figure The method that the coordinate of a pixel carries out bilinear interpolation in distortion figure obtains.
A kind of lens distortion correction system for automatic optics inspection, including:
Distortion figure for acquiring the figure that distorts, and is sent to angle point coarse extraction module by image capture module;
Angle point coarse extraction module for carrying out angle point coarse extraction to the distortion figure received, obtains intensive angle point, and by its It is sent to the accurate extraction module of angle point;
The accurate extraction module of angle point, for intensive angle point to be carried out accurate angle point and carried by corroding expansion and blob analyses It takes, obtains real angle point, and send it to distortion Coordinate generation module;
Distort Coordinate generation module, for calculating distortion figure according to pixel parameter each in real angular coordinate and ideograph The coordinate of each pixel in shape;
Coordinate mapping module, for obtaining each pixel in distortion figure according to the coordinate of pixel each in distortion figure The corresponding pixel value of point coordinates.
Further, described image acquisition module includes distortion figure acquisition module, is used to choose non-homogeneous chessboard After lattice are as scaling board, camera lens shooting scaling board to be corrected obtains distortion figure.
Further, the distortion Coordinate generation module includes coordinate calculation module, based on according to distortion model The coordinate of each pixel in distortion figure is calculated, the distortion model is:
In formula:X, y is respectively the transverse and longitudinal coordinate of each pixel in distortion figure, and u, v are respectively every in ideograph The transverse and longitudinal coordinate of a pixel, aij、bijDistortion model parameter between respectively real angular coordinate and ideograph angular coordinate, N Value is 3 or 4.
The present invention uses chessboard heterogeneous, makes Edge Feature Points distribution more more dense, is more nearly practical feelings in this way Condition, the distortion model parameter calculated are more reasonable;Real angle point, angle point grid essence are extracted by corroding expansion and blob analyses Degree is high, and distortion correction effect is good, and robustness is higher.The energy in the case where picture quality is poor, noise is relatively more, distortion is more serious Enough very accurately extraction angle points, and highly stable, entire correcting process is simple, fast and easy.
Description of the drawings
The connection diagram of the system module of Fig. 1 present invention;
Fig. 2 is control flow chart of the present invention;
Fig. 3 is the non-homogeneous tessellated schematic diagram of the present invention;
Fig. 4 is the schematic diagram of angle point coarse extraction of the present invention;
Fig. 5 is the schematic diagram that angle point of the present invention accurately extracts.
Specific embodiment
The present invention is described in further detail in the following with reference to the drawings and specific embodiments, convenient for this hair is well understood It is bright, but they do not form the present invention and limit.
As shown in Figure 1, a kind of lens distortion correction system for automatic optics inspection of the invention, including:
Distortion figure for acquiring the figure that distorts, and is sent to angle point coarse extraction module by image capture module;Image is adopted Collect module and include distortion figure acquisition module, be used for after non-homogeneous gridiron pattern is chosen as scaling board, camera lens to be corrected is clapped It takes the photograph scaling board and obtains distortion figure;
Angle point coarse extraction module for carrying out angle point coarse extraction to the distortion figure received, obtains intensive angle point, and by its It is sent to the accurate extraction module of angle point;
The accurate extraction module of angle point, for intensive angle point to be carried out accurate angle point and carried by corroding expansion and blob analyses It takes, obtains real angle point, and send it to distortion Coordinate generation module;
Distort Coordinate generation module, for calculating distortion figure according to pixel parameter each in real angular coordinate and ideograph The coordinate of each pixel in shape;The Coordinate generation module that distorts includes coordinate calculation module, is used to be calculated according to distortion model The coordinate of each pixel in distortion figure;
Coordinate mapping module, for obtaining each pixel in distortion figure according to the coordinate of pixel each in distortion figure The corresponding pixel value of point coordinates.
As shown in Figure 2-5, the present invention realizes that the process of lens distortion antidote is as follows using above-mentioned correction system:
Step 1, scaling board is set:The present invention chooses non-homogeneous gridiron pattern as scaling board, and non-homogeneous gridiron pattern refers to it Internal blockage is in the gradual change formal distribution that center (center refers to gridiron pattern center) area is big, edge area is small, i.e. chessboard Lattice are smaller than comparatively dense, area close to the blockage of surrounding boundary, and the blockage close to position among gridiron pattern compares Dispersion, area is bigger, as shown in figure 3, only giving the calibration plate shape of 3*3.Boundary is distributed in due to distorting, by chessboard more Lattice edge blockage area design is smaller, then the comparison that edge angle point is just distributed is more, is more nearly actual conditions.It is this non- Uniform gridiron pattern can make edge angle point distribution more more dense, the distortion figure angle point calculated in this way and ideograph angle point it Between mapping relations (distortion model parameter) it is just more reasonable, final distortion correction effect is more preferable.After scaling board is selected, wait to correct It after camera lens shooting scaling board obtains distortion figure, is stored in image capture module, image capture module sends distortion figure To angle point coarse extraction module.
Step 2, angle point coarse extraction module carries out X-comers coarse extraction to the distortion figure received:Angle point coarse extraction It is to extract a series of angle point around real angle point.
When carrying out angle point coarse extraction to the distortion figure of above-mentioned acquisition, binary conversion treatment first is carried out to distortion figure and obtains two It is worth image, template matches then is carried out to bianry image further according to the symmetry of gridiron pattern intensity profile, obtain the close of some row Collect angle point, be sent to the accurate extraction module of angle point.
As shown in figure 4, template matches refer to by the way that a rectangle template is set to be matched or to abnormal with distortion figure Become figure to be traversed, the intensive angle point for being distributed in gridiron pattern intersection for the condition that meets is found in the figure that distorts.To abnormal Following condition need to be met by becoming the intensive angle point found after figure is traversed:A-quadrant angle point is consistent with the gray scale of D regions angle point, B Region angle point is consistent with the gray scale of C regions angle point, and the gray scale of a-quadrant angle point and B area angle point is inconsistent, shared by the angle point of a-quadrant Area and D regions angle point shared by area equation, the area shared by B area angle point and the area equation shared by the angle point of C regions.
Step 3, X-comers accurately extract:To a series of intensive angle points obtained in step 2, due to angle point quantity very It is more, it is distributed than comparatively dense, but be not strictly to connect together, obtain real angle according to the existing mode for rejecting redundancy angle point Point, then processing procedure is more complicated, therefore the present invention is according to its angle point distribution situation, these angle points are corroded and expansion at A little intensive angle points are all linked up to form a connected region by reason, obtain the angle point distribution blob of white as shown in Figure 5 Then block carries out blob analyses to blob blocks again, is eventually found the particle of connected region as real angle point, real angle point determines Afterwards, the coordinate in the figure that distorts can determine.Blob analyses are a kind of conventional image processing methods, of the invention by blob Analysis is applied in the accurate extraction of angle point, connected region is detected, by the perimeter of connected region, area, particle etc. spy Sign is calculated, and finally searches out connected region central point as real angle point.
Step 4, distortion model parameter calculates:After real angle point grid comes out, it is thus necessary to determine that real angle point and ideograph angle Correspondence between point, is specifically embodied in the mapping relations between its coordinate, this pass during distortion correction Key point, the method that the present invention is optimized by least square method and LM, calculates the coordinate of real angle point and corresponding ideograph angle Distortion model parameter a between the coordinate of pointij、bij(mapping relations).
Least square method is a kind of conventional mathematical optimization techniques, by according to the mean square deviation between actual value and ideal value The sum of minimum, to calculate the distortion model parameter a between the coordinate of real angle point and the coordinate of corresponding ideograph angle pointij、 bij.Since the parameter that least square method calculates distortion model is not optimal, when application is higher to rectification effect requirement Occasion, also corresponding requirements are higher for the precision of distortion model parameter, can obtain optimized parameter by LM optimizations at this time.LM optimizations are logical Cross ceaselessly recursive iteration, each iteration cause by the angular coordinate that distortion model calculates and practical distortion figure coordinate it Between poor smaller, when setting a poor standard, after iteration is multiple, so that it may reach the standard of setting.
Step 5, distortion correction:By the coordinate of pixel each in the distortion model parameter in step 4 and ideograph, substitute into Into the distortion model of setting, you can coordinate x, y of each pixel in distortion figure is obtained.It is calculated by distortion model Coordinate be floating number, there is no completely the same point on distortion figure, it is therefore necessary to be calculated pair by ad hoc approach Mark corresponding pixel value.The present invention is made by interpolation algorithm, the preferably mode of bilinear interpolation using the pixel value of surrounding To calculate the corresponding gray value of coordinate by distortion model, the coordinate of each pixel that will be obtained in distortion figure into Row bilinear interpolation, you can obtain the corresponding pixel value of each pixel coordinate in distortion figure.Each pixel in distortion figure The coordinate and pixel value of point all determine, that is, realize distortion correction.
The distortion model of the coordinate of each pixel is in present invention calculating distortion figure:
In formula:X, y is respectively the transverse and longitudinal coordinate of each pixel in distortion figure, and u, v are respectively every in ideograph The transverse and longitudinal coordinate of a pixel, aij、bijDistortion model parameter between respectively real angular coordinate and ideograph angular coordinate, N For setting value, to ideal situation, the value of N is bigger, and rectification effect is better, but N values cross conference and cause to calculate excessively complexity, because This, N values of the present invention are 3 or 4.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, although with reference to aforementioned reality Example is applied the present invention is described in detail, it for those skilled in the art, still can be to aforementioned each implementation Technical solution recorded in example modifies or carries out equivalent replacement to which part technical characteristic.All essences in the present invention With within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention god.

Claims (8)

1. a kind of lens distortion antidote for automatic optics inspection, which is characterized in that include the following steps:
Step 1, non-homogeneous gridiron pattern is chosen as scaling board, and camera lens shooting scaling board to be corrected obtains distortion figure;
Step 2, angle point coarse extraction is carried out to distortion figure, obtains intensive angle point;
Step 3, accurate angle point grid is carried out by corroding expansion and blob analyses to the intensive angle point of coarse extraction, obtains real angle Point;
Step 4, the distortion model parameter between real angular coordinate and ideograph angular coordinate is calculated;
Step 5, each pixel in distortion figure is calculated according to the coordinate of pixel each in distortion model parameter and ideograph Coordinate;
Step 6, according to the corresponding picture of pixel coordinate each in the coordinate acquisition distortion figure of pixel each in distortion figure Element value.
2. a kind of lens distortion antidote for automatic optics inspection according to claim 1, it is characterised in that:Institute The blockage inside non-homogeneous gridiron pattern is stated in the gradual change formal distribution that center area is big, edge area is small.
A kind of 3. lens distortion antidote for automatic optics inspection according to claim 1, which is characterized in that institute It states and is to the process of distortion figure progress angle point coarse extraction:Binary conversion treatment is carried out to distortion figure and obtains bianry image, to two It is worth image and carries out template matches, obtains intensive angle point.
4. a kind of lens distortion antidote for automatic optics inspection according to claim 1, it is characterised in that:Institute Distortion model parameter is stated to be calculated by least square method and LM optimizations.
A kind of 5. lens distortion antidote for automatic optics inspection according to claim 1, which is characterized in that institute The computational methods for stating the coordinate of each pixel in distortion figure are:
In formula:X, y is respectively the transverse and longitudinal coordinate of each pixel in distortion figure, and u, v are respectively each picture in ideograph The transverse and longitudinal coordinate of vegetarian refreshments, aij、bijDistortion model parameter between respectively real angular coordinate and ideograph angular coordinate, N values It is 3 or 4.
6. a kind of lens distortion antidote for automatic optics inspection according to claim 1, it is characterised in that:Institute It states the corresponding pixel value of each pixel coordinate in distortion figure and passes through and the coordinate of pixel each in the figure that distorts is distorting The method that bilinear interpolation is carried out in figure obtains.
7. a kind of lens distortion correction system for automatic optics inspection, it is characterised in that:Including
Distortion figure for acquiring the figure that distorts, and is sent to angle point coarse extraction module by image capture module;
Angle point coarse extraction module for carrying out angle point coarse extraction to the distortion figure received, obtains intensive angle point, and be sent to To the accurate extraction module of angle point;
The accurate extraction module of angle point for carrying out accurate angle point grid by corroding expansion and blob analyses to intensive angle point, obtains To real angle point, and send it to distortion Coordinate generation module;
Distort Coordinate generation module, for being calculated in distortion figure according to pixel parameter each in real angular coordinate and ideograph The coordinate of each pixel;
Coordinate mapping module is sat for obtaining each pixel in distortion figure according to the coordinate of pixel each in distortion figure Mark corresponding pixel value;
Described image acquisition module includes distortion figure acquisition module, is used to choose non-homogeneous gridiron pattern as scaling board Afterwards, camera lens shooting scaling board to be corrected obtains distortion figure.
8. a kind of lens distortion correction system for automatic optics inspection according to claim 7, it is characterised in that:Institute It states distortion Coordinate generation module and includes coordinate calculation module, be used to calculate each pixel in distortion figure according to distortion model Coordinate, the distortion model is:
In formula:X, y is respectively the transverse and longitudinal coordinate of each pixel in distortion figure, and u, v are respectively each picture in ideograph The transverse and longitudinal coordinate of vegetarian refreshments, aij、bijDistortion model parameter between respectively real angular coordinate and ideograph angular coordinate, N values It is 3 or 4.
CN201610008261.7A 2016-01-07 2016-01-07 A kind of lens distortion antidote and system for automatic optics inspection Active CN105701776B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610008261.7A CN105701776B (en) 2016-01-07 2016-01-07 A kind of lens distortion antidote and system for automatic optics inspection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610008261.7A CN105701776B (en) 2016-01-07 2016-01-07 A kind of lens distortion antidote and system for automatic optics inspection

Publications (2)

Publication Number Publication Date
CN105701776A CN105701776A (en) 2016-06-22
CN105701776B true CN105701776B (en) 2018-07-03

Family

ID=56226204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610008261.7A Active CN105701776B (en) 2016-01-07 2016-01-07 A kind of lens distortion antidote and system for automatic optics inspection

Country Status (1)

Country Link
CN (1) CN105701776B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109191374B (en) 2018-10-10 2020-05-08 京东方科技集团股份有限公司 Distortion parameter measuring method, device and system
CN109341555A (en) * 2018-11-05 2019-02-15 内蒙古科技大学 A kind of detection method of micron-scale droplet size
CN110738707B (en) * 2019-10-16 2023-05-26 北京华捷艾米科技有限公司 Distortion correction method and device for camera, equipment and storage medium
CN111260565B (en) * 2020-01-02 2023-08-11 北京交通大学 Distortion image correction method and system based on distortion distribution diagram
CN113592956B (en) * 2021-07-30 2023-12-19 武汉精测电子集团股份有限公司 Multi-lens combined calibration method and device based on microscopic detection machine

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882309A (en) * 2009-05-07 2010-11-10 上海世汇电子科技有限公司 Calibration pattern of camera and calibration and detection method based on same
CN101673397B (en) * 2009-09-30 2012-04-25 青岛大学 Digital camera nonlinear calibration method based on LCDs
US9621823B2 (en) * 2010-09-16 2017-04-11 Honeywell International Inc. Thermal camera calibration
CN103150724B (en) * 2013-02-06 2015-06-03 长春师范大学 Segmented model-based camera calibration method
CN105023265A (en) * 2014-04-29 2015-11-04 东北大学 Checkerboard angular point automatic detection method under fish-eye lens

Also Published As

Publication number Publication date
CN105701776A (en) 2016-06-22

Similar Documents

Publication Publication Date Title
CN105701776B (en) A kind of lens distortion antidote and system for automatic optics inspection
CN111260731B (en) A Checkerboard Sub-pixel Level Corner Adaptive Detection Method
WO2021138995A1 (en) Fully automatic detection method for checkerboard corners
CN103411553B (en) The quick calibrating method of multi-linear structured light vision sensors
CN102800096B (en) Robustness estimation algorithm of camera parameter
CN103530880A (en) Camera calibration method based on projected Gaussian grid pattern
KR102073468B1 (en) System and method for scoring color candidate poses against a color image in a vision system
CN101865679A (en) A Plane Area Measurement Method Based on Digital Image Technology
CN108257187B (en) Camera-projector system calibration method
CN108833912A (en) A kind of measurement method and system of video camera machine core optical axis center and field angle
CN106485749A (en) A kind of rectangular pins element rough localization method based on angle point
CN114998448B (en) A method for multi-constrained binocular fisheye camera calibration and spatial point positioning
CN114972633B (en) Fast scanning point cloud interpolation method under constraint of crossed laser lines
CN106651959A (en) Optical field camera micro-lens array geometric parameter calibration method
CN111402330A (en) Laser line key point extraction method based on plane target
CN114241061A (en) Calibration method, calibration system and calibration target for line structured light imaging and measurement system using calibration target
Zhang et al. A new algorithm for accurate and automatic chessboard corner detection
CN108805939A (en) The caliberating device and method of trinocular vision system based on statistics feature
CN117372498A (en) Multi-pose bolt size measurement method based on three-dimensional point cloud
CN114612412B (en) Processing method of three-dimensional point cloud data, application of processing method, electronic equipment and storage medium
CN112184784A (en) Double-spectrum image alignment method and device, electronic equipment and storage medium
CN112489141B (en) Production line calibration method and device for single-board single-image strip relay lens of vehicle-mounted camera
CN107392948B (en) An image registration method for a sub-amplitude real-time polarization imaging system
CN117392211B (en) BGA element rapid identification positioning method and system and storage medium
CN102620655A (en) Method for measuring size of light spot

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 430070 Hubei Province, Wuhan city Hongshan District Road No. 48 bookstore (North Industrial Park) 1 building 11 layer

Applicant after: Wuhan fine test electronics group Limited by Share Ltd

Address before: 430070 Hongshan entrepreneurship center, No. 53, Nanhu Avenue, Hongshan District, Wuhan, Hubei Province, 4

Applicant before: Wuhan Jingce Electronic Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant