[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN109211264A - Scaling method, device, electronic equipment and the readable storage medium storing program for executing of measuring system - Google Patents

Scaling method, device, electronic equipment and the readable storage medium storing program for executing of measuring system Download PDF

Info

Publication number
CN109211264A
CN109211264A CN201710546626.6A CN201710546626A CN109211264A CN 109211264 A CN109211264 A CN 109211264A CN 201710546626 A CN201710546626 A CN 201710546626A CN 109211264 A CN109211264 A CN 109211264A
Authority
CN
China
Prior art keywords
coordinate
dimensional
camera
laser
coordinate system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710546626.6A
Other languages
Chinese (zh)
Other versions
CN109211264B (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.)
Hangzhou Hikrobot Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201710546626.6A priority Critical patent/CN109211264B/en
Publication of CN109211264A publication Critical patent/CN109211264A/en
Application granted granted Critical
Publication of CN109211264B publication Critical patent/CN109211264B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C25/00Manufacturing, calibrating, cleaning, or repairing instruments or devices referred to in the other groups of this subclass

Landscapes

  • Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The embodiment of the invention provides a kind of scaling method of measuring system, device, electronic equipment and readable storage medium storing program for executing, applied to technical field of machine vision, the described method includes: according to the positional relationship of laser and calibrating block, at least three not conllinear vertex on calibrating block section the first coordinate of three-dimensional in laser coordinates system respectively is obtained.The profile diagram for obtaining the calibrating block section under the line laser irradiation that laser generates, determines at least three not conllinear vertex in the two-dimensional pixel coordinate where profile diagram in image coordinate system.According to the internal reference and distortion factor of the camera obtained in advance, and three-dimensional first coordinate and two-dimensional pixel coordinate, the outer ginseng of camera is determined.According to the outer ginseng of camera and three-dimensional first coordinate, optic plane equations of the optical plane of line laser formation under camera coordinates system are determined.The scaling method of the embodiment of the present invention is simple, quick, is suitable for field calibration.

Description

Calibration method and device of measurement system, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of machine vision technologies, and in particular, to a calibration method and apparatus for a measurement system, an electronic device, and a readable storage medium.
Background
In image measurement processes and machine vision applications, in order to determine the correlation between the three-dimensional geometric position of a certain point on the surface of a space object and the corresponding point of the space object in an image, a geometric model of camera imaging must be established. The geometric model parameters include: camera parameters and a light plane equation, wherein the camera parameters include: camera internal parameters, camera external parameters and distortion coefficients. Focal length f of camera internal reference camera in x direction and y directionxAnd fyAnd image center coordinates (u)0,v0) The distortion coefficients refer to the radial distortion coefficient and the tangential distortion coefficient. The camera external reference refers to a rotation matrix R and a translational vector t of a camera coordinate system relative to a reference coordinate system, and a process of solving camera parameters is camera calibration. In the actual measurement process, besides the camera calibration, the light plane equation also needs to be solved, so that the position of the object to be measured is determined according to the camera parameters and the light plane equation during the image measurement.
In image measurement and machine vision applications, camera calibration and calculation of an optical plane equation are very critical links, and accuracy of a calculation result and stability of an algorithm directly influence accuracy of a measurement result. In the related art, when calculating the light plane equation, calibration blocks need to be respectively placed at positions with different distances from a camera, line laser light emitted by a laser is made to strike on the calibration blocks at different positions, the calibration blocks are imaged by the camera, the line laser light in the imaging of the calibration blocks is extracted, and the line laser light in the imaging of the calibration blocks at different positions is obtained. Because the calibration blocks at different positions correspond to different world coordinates and image coordinates, the camera external parameters are calculated according to the world coordinates and the image coordinates corresponding to the calibration blocks at each position through a camera calibration algorithm, and then the coordinates of the points on the line laser under a reference coordinate system are calculated according to the camera external parameters and the internal parameters. And finally, performing plane fitting on the coordinate points of the same line laser by a least square method to obtain a light plane equation where the line laser is located. Therefore, the calibration block needs to be placed at different positions and then a plurality of pictures are extracted, so that the method is complicated to operate.
Disclosure of Invention
The embodiment of the invention aims to provide a calibration method and device of a measurement system, an electronic device and a readable storage medium, so as to simplify the calibration process of the measurement system. The specific technical scheme is as follows:
the embodiment of the invention discloses a calibration method of a measuring system, wherein the measuring system comprises a laser and a camera, and the method comprises the following steps:
according to the position relation between a preset laser and a calibration block, three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance are obtained;
acquiring a profile map of the cross section of the calibration block under the irradiation of line laser generated by the laser, and determining two-dimensional pixel coordinates of the at least three non-collinear vertexes in an image coordinate system where the profile map is located;
determining external parameters of the camera according to the pre-acquired internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate;
and determining a light plane equation of a light plane formed by the line laser under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate.
Optionally, the step of determining the external parameters of the camera according to the pre-obtained internal parameters and distortion coefficients of the camera, the three-dimensional first coordinates and the two-dimensional pixel coordinates includes:
obtaining a two-dimensional pixel coordinate after distortion removal according to the internal parameters and the distortion coefficient of the camera and the two-dimensional pixel coordinate;
and obtaining the external reference of the camera by solving the perspective N point PnP according to the internal reference of the camera, the three-dimensional first coordinate and the undistorted two-dimensional pixel coordinate.
Optionally, the step of determining a light plane equation of the light plane formed by the line laser in the camera coordinate system according to the external reference of the camera and the three-dimensional first coordinate includes:
obtaining a three-dimensional second coordinate of the three-dimensional first coordinate under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate;
obtaining a three-dimensional third coordinate of the three-dimensional second coordinate mapped in the light plane according to the position relation between the light plane and the section of the calibration block and the three-dimensional second coordinate;
and obtaining the light plane equation by a linear regression method according to the three-dimensional third coordinate.
Optionally, the light plane is parallel to the cross section of the calibration block;
the step of determining the light plane equation of the light plane formed by the line laser under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinates comprises the following steps:
obtaining a three-dimensional second coordinate of the three-dimensional first coordinate under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate;
and obtaining the light plane equation by a linear regression method according to the three-dimensional second coordinate.
Optionally, the step of obtaining a three-dimensional second coordinate of the three-dimensional first coordinate in the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate includes:
according to the formula: xC,i=RXW,i+ t, determining said three-dimensional first coordinate XW,iA three-dimensional second coordinate X in the camera coordinate systemC,i
Wherein i is 1,2, … n, n is more than or equal to 3, and the external parameters of the camera comprise: and R and t, wherein R represents a rotation matrix of the camera coordinate system relative to the laser coordinate system, and t represents a translation vector of the camera coordinate system relative to the laser coordinate system.
Optionally, the step of obtaining three-dimensional first coordinates of at least three non-collinear vertices on the cross section of the calibration block in a pre-constructed laser coordinate system according to a predetermined positional relationship between the laser and the calibration block includes:
and acquiring three-dimensional first coordinates of the at least three non-collinear vertexes in the laser coordinate system respectively according to the position relation between the laser and the calibration block and the size of the calibration block.
Optionally, the obtaining, according to the position relationship between the laser and the calibration block and the size of the calibration block, three-dimensional first coordinates of the at least three non-collinear vertices in the laser coordinate system specifically includes: when the light plane is parallel to the cross section of the calibration block and the coordinate axis in the laser coordinate system is perpendicular to the cross section of the calibration block, if the perpendicular distance between the cross section of the calibration block and the origin of the laser coordinate system is S, the coordinate in the three-dimensional first coordinate of each vertex of the at least three non-collinear vertices, which is perpendicular to the cross section of the calibration block, is S, and the coordinate in the three-dimensional first coordinate of each vertex, which is parallel to the cross section of the calibration block, is the corresponding dimension of each vertex in the cross section of the calibration block.
The embodiment of the invention also discloses a calibration device of the measuring system, the measuring system comprises a laser and a camera, and the device comprises:
the three-dimensional first coordinate determination module is used for acquiring three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance according to the position relation between a preset laser and the calibration block;
the profile acquisition module is used for acquiring a profile of the cross section of the calibration block under the irradiation of line laser generated by the laser;
the two-dimensional pixel coordinate determination module is used for determining the two-dimensional pixel coordinates of the at least three non-collinear vertexes in an image coordinate system where the contour map is located;
the external parameter determining module is used for determining the external parameters of the camera according to the pre-acquired internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate;
and the light plane equation determining module is used for determining a light plane equation of a light plane formed by the line laser under the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate.
Optionally, the external parameter determining module is specifically configured to obtain a two-dimensional pixel coordinate after distortion removal according to the internal parameter and the distortion coefficient of the camera and the two-dimensional pixel coordinate; and obtaining the external reference of the camera by solving the perspective N point PnP according to the internal reference of the camera, the three-dimensional first coordinate and the undistorted two-dimensional pixel coordinate.
Optionally, the light plane equation determining module is specifically configured to obtain a three-dimensional second coordinate of the three-dimensional first coordinate in the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate; obtaining a three-dimensional third coordinate of the three-dimensional second coordinate mapped in the light plane according to the position relation between the light plane and the section of the calibration block and the three-dimensional second coordinate; and obtaining the light plane equation by a linear regression method according to the three-dimensional third coordinate.
Optionally, the light plane is parallel to the cross section of the calibration block;
the light plane equation determining module is specifically configured to obtain a three-dimensional second coordinate of the three-dimensional first coordinate in the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate; and obtaining the light plane equation by a linear regression method according to the three-dimensional second coordinate.
Optionally, the light plane equation determining module is specifically configured to, according to a formula: xC,i=RXW,i+ t, determining said three-dimensional first coordinate XW,iA three-dimensional second coordinate X in the camera coordinate systemC,i
Wherein i is 1,2, … n, n is more than or equal to 3, and the external parameters of the camera comprise: and R and t, wherein R represents a rotation matrix of the camera coordinate system relative to the laser coordinate system, and t represents a translation vector of the camera coordinate system relative to the laser coordinate system.
Optionally, the three-dimensional first coordinate determining module is specifically configured to obtain, according to a position relationship between the laser and the calibration block and a size of the calibration block, three-dimensional first coordinates of the at least three non-collinear vertices in the laser coordinate system, respectively.
Optionally, the three-dimensional first coordinate determining module is specifically configured to, when the light plane is parallel to the cross section of the calibration block and a coordinate axis in the laser coordinate system is perpendicular to the cross section of the calibration block, if a perpendicular distance between the cross section of the calibration block and an origin of the laser coordinate system is S, a coordinate in the three-dimensional first coordinate of each vertex of the at least three non-collinear vertices, which is perpendicular to the cross section of the calibration block, is S, and a coordinate in the three-dimensional first coordinate of each vertex, which is parallel to the cross section of the calibration block, is a corresponding dimension of each vertex in the cross section of the calibration block.
The embodiment of the invention also discloses an electronic device, which comprises: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor implementing the method steps of the calibration method of any of the measurement systems described above when executing the machine-executable instructions.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the steps of the calibration method of any one of the measurement systems are realized.
According to the calibration method, the calibration device, the electronic equipment and the readable storage medium of the measurement system, provided by the embodiment of the invention, the three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system are determined according to the preset position relation between the laser and the calibration block; acquiring a contour map of a section of a fixed block under line laser irradiation generated by a laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located; determining external parameters of the camera according to the internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate which are acquired in advance; and determining a light plane equation of the light plane in the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinates. In the embodiment of the invention, the calibration of the measuring system can be completed only by acquiring one picture on the cross section of the calibration block, so that the calibration method of the measuring system in the embodiment of the invention is simple and rapid. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a calibration method of a measurement system according to an embodiment of the present invention;
FIG. 2 is another flow chart of a calibration method of a measurement system according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a projective transformation in the related art;
FIG. 4 is another flow chart of a calibration method of a measurement system according to an embodiment of the present invention;
FIG. 5 is a side and front view of a camera coordinate system and a laser coordinate system of an embodiment of the present invention;
FIG. 6 is a block diagram of a calibration block under line laser irradiation according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of the coordinates of a calibration block in a laser coordinate system according to an embodiment of the present invention;
FIG. 8 is a schematic cross-sectional view of a calibration block under line laser irradiation according to an embodiment of the present invention;
fig. 9 is a structural diagram of a calibration apparatus of a measurement system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem of tedious calibration of a measurement system, embodiments of the present invention provide a calibration method and apparatus for a measurement system, an electronic device, and a readable storage medium, so as to simplify the calibration process of the measurement system. Wherein the measurement system comprises a laser and a camera. In the actual measurement process, the line laser is irradiated on the measured object, the cross section of the measured object is imaged through the camera, and the physical size of the cross section outline of the measured object can be calculated according to the coordinates of the laser strip formed on the measured object by the line laser in the image. Since the physical dimensions of the cross-sectional profile of the object to be measured need to be calculated according to the parameters of the measurement system, the measurement system needs to be calibrated before actual measurement.
Wherein, the parameters of the measuring system comprise: the internal parameter, the distortion coefficient and the external parameter of the camera and the light plane equation of the light plane formed by the line laser generated by the laser. Since the camera's parameters of reference and distortion are parameters related to the camera itself, the camera's parameters of reference and distortion are determined for a given camera. Focal length f of camera internal reference camera in x direction and y directionxAnd fyAnd image center coordinates (u)0,v0) The distortion coefficients refer to the radial distortion coefficient and the tangential distortion coefficient. The external reference of the camera refers to a rotation matrix R and a translation vector t of the camera coordinate system relative to the reference coordinate system, and when the position of the camera coordinate system or the reference coordinate system changes, the rotation matrix R and the translation vector t also change. Therefore, the relative position of the camera coordinate system and the reference coordinate system changes, and the measurement system needs to be calibrated again.
The calibration method, the calibration device, the electronic device and the readable storage medium of the measurement system in the embodiment of the invention refer to the calibration method, the calibration device, the electronic device and the readable storage medium of the measurement system when the internal parameters and the distortion coefficients of the camera are known. First, a calibration method of a measurement system according to an embodiment of the present invention will be described below.
Referring to fig. 1, fig. 1 is a flowchart of a calibration method of a measurement system according to an embodiment of the present invention, including the following steps:
s101, according to the position relation between a preset laser and a calibration block, three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance are obtained.
In the embodiment of the invention, the calibration block is an object with known structure information and high processing precision. When calibrating the measuring system, firstly, the positions of the camera and the laser are determined, and a camera coordinate system where the camera is located and a laser coordinate system where the laser is located are established, namely a reference coordinate system. Typically, the camera coordinate system and the laser coordinate system differ by an angle. Then, the calibration block is placed at a position with a certain distance from the camera and the laser, and coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a pre-constructed laser coordinate system, namely a three-dimensional first coordinate, are obtained. The method for determining the three-dimensional first coordinate may be determined by a computer, or may be manually measured, which is not limited herein.
S102, acquiring a contour map of the cross section of the fixed block under the irradiation of line laser generated by the laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located.
In the embodiment of the invention, when the measurement system is calibrated, the line laser emitted by the laser can be controlled to irradiate the calibration block, so that the calibration of the measurement system can be carried out according to the profile of the section of the calibration block under the irradiation of the line laser. Specifically, after the contour map of the cross section of the fixed block under the irradiation of the line laser generated by the laser is obtained, in the embodiment of the present invention, the upper left corner of the contour map may be set as the origin of the image coordinate system, so that the X axis of the image coordinate system is horizontally directed to the right, and the Y axis of the image coordinate system is vertically directed downward. In the image coordinate system, two-dimensional pixel coordinates corresponding to at least three non-collinear vertexes can be obtained through an image processing method for extracting the vertexes or a method for manually selecting the vertexes.
S103, determining external parameters of the camera according to the internal parameters and distortion coefficients of the camera, the three-dimensional first coordinates and the two-dimensional pixel coordinates which are acquired in advance, wherein the external parameters of the camera are external parameters of a camera coordinate system which is constructed in advance relative to a laser coordinate system.
It should be noted that the internal reference and distortion coefficient of the camera in the embodiment of the present invention are known. The camera external reference refers to the rotation matrix R and translation vector t of the camera coordinate system relative to the laser coordinate system. The rotation matrix R is a 3 x 3 orthogonal matrix and respectively represents rotation amount in three directions in a three-dimensional coordinate; the translation vector is a vector of 3 × 1, and represents the amount of translation in three directions in the three-dimensional coordinates, respectively.
After the internal reference and the distortion coefficient of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate are obtained, the external reference of the camera can be determined according to the internal reference and the distortion coefficient of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate, wherein the external reference of the camera is the external reference of a camera coordinate system which is constructed in advance relative to a laser coordinate system. For example, the two-dimensional pixel coordinates after distortion removal may be calculated according to the camera parameters, the distortion coefficients, and the two-dimensional pixel coordinates, and then the camera parameters may be obtained by solving the PnP (Perspective N Point) according to the camera parameters, the two-dimensional pixel coordinates after distortion removal, and the three-dimensional first coordinate.
And S104, determining a light plane equation of a light plane formed by the linear laser under a camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate.
Specifically, the three-dimensional first coordinate is a coordinate in a laser coordinate system, and the three-dimensional first coordinate is located in the light plane. And the light plane equation is a light plane equation in a camera coordinate system, so the three-dimensional first coordinate needs to be converted into a coordinate in the camera coordinate system, and the external parameters of the camera are a rotation matrix R and a translation vector t of the camera coordinate system relative to the laser coordinate system. Then, the coordinates of the three-dimensional first coordinates in the camera coordinate system can be obtained according to the external parameters of the camera. And further calculating a light plane equation under the camera coordinate system according to the coordinates under the camera coordinate system.
According to the calibration method of the measuring system, provided by the embodiment of the invention, the three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in the laser coordinate system are obtained according to the preset position relation between the laser and the calibration block. The method comprises the steps of obtaining a contour map of a section of a fixed block under line laser irradiation generated by a laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located. And determining external parameters of the camera according to the internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate which are acquired in advance. And determining a light plane equation of a light plane formed by the line laser under a camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate. In the embodiment of the invention, the calibration of the measuring system can be completed only by acquiring one picture on the cross section of the calibration block, so that the calibration method of the measuring system in the embodiment of the invention is simple and rapid. In addition, when the relative position between the camera and the laser changes, the calibration can be conveniently carried out again, and the method is more suitable for field calibration.
Referring to fig. 2, fig. 2 is another flow chart of a calibration method of a measurement system according to an embodiment of the present invention, including the following steps:
s201, according to the position relation between a preset laser and a calibration block, three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance are obtained.
S202, acquiring a contour map of the cross section of the fixed block under the irradiation of line laser generated by the laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located.
Since S201 and S202 are respectively the same as S101 and S102 in the embodiment of fig. 1, all embodiments of S101 and S102 in fig. 1 are applicable to fig. 2, and can achieve the same or similar beneficial effects, and are not described herein again.
And S203, obtaining the two-dimensional pixel coordinate after distortion removal according to the internal reference and distortion coefficient of the camera obtained in advance and the two-dimensional pixel coordinate.
In the embodiment of the invention, because the camera has a certain distortion coefficient, the two-dimensional pixel coordinate in the profile of the cross section of the calibration block acquired in the image coordinate system is the distorted two-dimensional pixel coordinate, so that in order to obtain the calibration result of the measurement system with higher precision, the two-dimensional pixel coordinate can be subjected to distortion removal to obtain the two-dimensional pixel coordinate after distortion removal. In an implementation manner of the embodiment of the present invention, a method for calculating distortion removal of a two-dimensional pixel coordinate includes:
if k is1、k2And k3Representing the radial distortion coefficient, p, of the camera1And p2Representing the tangential distortion coefficient of the camera, fxAnd fyDenotes the focal lengths of the camera in the x-and y-directions, respectively, (u)0,v0) The two-dimensional pixel coordinate in the embodiment of the present invention, i.e., the distorted two-dimensional pixel coordinate, representing the image center coordinate is (u ', v').
The following variables are initialized:
x'=(u'-u0)/fx
y′=(v'-v0)/fy
x=x′;
y=y′;
iter is 0; wherein x ', y', x and y are intermediate variables, and iter is the cycle number.
When iter < N, the following loop is performed:
r2=x2+y2
x=[x′-2p1xy-p2(r2+2x2)]/(1+k1r2+k2r4+k3r6);
y=[y′-2p2xy-p1(r2+2y2)]/(1+k1r2+k2r4+k3r6);
iter=iter+1;
and N is the number of times of circular execution, and according to experiments, when the value of N is 5, the obtained calibration result has high precision, and the embodiment of the invention does not limit the value of N. From the above loop, the values of x and y can be obtained, according to the formula: f ═ uxx+u0And v ═ fyy+v0And obtaining the two-dimensional pixel coordinate (u, v) after distortion removal.
Because the distortion coefficients of different cameras are different, optionally, the external parameters of the camera may also be calculated according to the two-dimensional pixel coordinates obtained in S102, the internal parameters of the camera, and the three-dimensional first coordinates, that is, the two-dimensional pixel coordinates are not subjected to distortion removal.
And S204, obtaining the external reference of the camera by solving the PnP according to the internal reference, the three-dimensional first coordinate and the two-dimensional pixel coordinate after distortion removal of the camera.
It should be noted that, if N three-dimensional points are provided in the reference coordinate system, and two-dimensional points corresponding to the N three-dimensional points in the image coordinate system are provided, the image coordinate system is a coordinate system in which the images of the N three-dimensional points acquired by the camera are located. The PnP is a point which is used for calibrating the camera according to the N three-dimensional points and the two-dimensional points corresponding to the N three-dimensional points.
If the corresponding two-dimensional point and three-dimensional point pair are x ═ u v respectively]TAnd XL=[xLyLzL]TThe PnP solving method comprises the following steps:
in the first step, a new coordinate system, namely an A coordinate system, is selected.
Selecting three-dimensional point X corresponding to projection point farthest awayL0And XL1With XL0And XL1Is the midpoint of the point OAEstablishing an A coordinate system for the Z axis, and simultaneously obtaining a point X in the laser coordinate systemLRepresentation in the A coordinate System
Second, calculatingRepresentation in camera coordinate system.
Divide the n three-dimensional points into (n-2) three-point pairs { XL0XL1XLiAnd if i is not equal to 0 and i is not equal to 1, the PnP problem is converted into (n-2) P3P problems, and P3P is solved.
The method for solving the P3P specifically comprises the following steps:
since the coordinates of the three-dimensional points in the light plane are known, X can be calculatedL0And XL1Distance D of0,XL0And XLiDistance D of1,i,XL1And XLiDistance D of2,i. Due to the co-ordinates (u) of the two-dimensional pointsj,vj) It is known to convert the coordinates of two-dimensional points into homogeneous coordinates.
I.e. the direction vector of the line of sight. From which the line of sight is calculatedAndangle of (a) gamma0Andangle of (a) gamma1,iAndangle of (a) gamma2,i. Wherein f isx、fy、u0And v0Representing the internal parameters of the camera, fxAnd fyDenotes the focal length, u, of the camera in the x-and y-directions, respectively0And v0Representing the center of the image.
From the nature of the projection transform, there is always a triangle Δ X'L0X′L1X′LiAnd triangle DeltaXL0XL1XLiSimilarly, and X'L0Is 1, see fig. 3, and fig. 3 is a schematic diagram of a projective transformation in the related art. Suppose X'L1Has a depth of cos gamma0+t1Simply find t1The Z axis of the A coordinate system can be obtainedRepresentation in camera coordinate system.
The following variables were obtained by calculation:
A1,i=A0,isin2γ0-sin2γ1,i
A2,i=cosγ1,icosγ2,i-cosγ0
A3,i=cosγ0cosγ2,i-cosγ1,i
A4,i=cosγ2,i
A6,i=sin2γ0-cos2γ1,i+cosγ0cosγ1,icosγ2,i+A5,isin2γ0
further get the information about t1Fourth order polynomial of (1):
wherein,
B3,i=2(A2,iA5,i-A0,iA3,iA4,i),
B1,i=2(A2,iA6,i-A1,iA3,iA4,i),
t can then be obtained by polynomial root-finding1
According to the method for solving P3P described above, for (n-2) three-point pairs, (n-2) fourth-order polynomials can be obtained, and a cost function can be constructed:
then t1=argminF(t1)。
For F (t)1) Derivation yields a seventh order polynomial:
wherein,
solving the root of the seven-degree polynomial to obtain an extreme point not exceeding seven real numbers, if the extreme point is F' (t)1)>0 is a minimum value.
Third, calculating XLRepresentation X in the Camera coordinate SystemC
The projective transformation between the camera coordinate system and the reference coordinate system (the laser coordinate system in the embodiment of the present invention) can be expressed as:
wherein [ r ]2r5r8]TIs a representation of the Z axis of the A coordinate system in the camera coordinate system, i.e. as determined in the previous stepThe representation in the camera coordinate system is,are homogeneous image coordinates. A system of linear equations can be constructed: the x is equal to the b, and the x is equal to the b,
wherein,
a least squares solution may be obtained from SVD decomposition.
Since the least squares solution does not constrain the orthogonality of the rotation matrix, the calculated rotation and translation (of the camera coordinate system with respect to the a coordinate system) cannot be used to derive the rotation and translation of the camera coordinate system with respect to the laser coordinate system. If it is
Can be calculated to obtain:
and fourthly, calculating the rotation R and the translation t of the camera coordinate system relative to the laser coordinate system.
First calculate XLAnd XCThe covariance matrix S.
And then carrying out SVD on the covariance matrix to obtain: UDV (Universal description video)T
If det (U) det (V)>0,R=UVT
If not, then,
t=μC-RμL
and fifthly, determining external parameters R and t of the camera.
In the second step, a plurality of minimum values are usually obtained, the number of the minimum values is not more than 4, and each minimum value can be calculated to obtain a group of R and t, so that calculation results need to be screened.
According to the formula:and calculating residual errors, and taking a group of R and t with the minimum residual error as a final result so as to obtain the external parameters of the camera.
S205, obtaining a three-dimensional second coordinate of the three-dimensional first coordinate under a camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate.
Specifically, the three-dimensional first coordinate is a coordinate in a laser coordinate system, and the three-dimensional first coordinate is located in the light plane. The light plane equation is a light plane equation in a camera coordinate system, and therefore, a three-dimensional first coordinate in a laser coordinate system needs to be converted into a three-dimensional second coordinate in the camera coordinate system. Then, according to the external parameters of the camera and the three-dimensional first coordinate, a three-dimensional second coordinate of the three-dimensional first coordinate under a camera coordinate system is obtained.
For example, the following may be expressed according to the formula: xC,i=RXW,i+ t, determining the three-dimensional first coordinate XW,iThree-dimensional second coordinate X in camera coordinate systemC,i
Wherein i is 1,2, … n, n is more than or equal to 3, and the external parameters of the camera comprise: and R and t, wherein R represents a rotation matrix of the camera coordinate system relative to the laser coordinate system, and t represents a translation vector of the camera coordinate system relative to the laser coordinate system.
In the embodiment of the invention, the three-dimensional first coordinate XW,iAnd a three-dimensional second coordinate XC,iSatisfies the formula: xC,i=RXW,i+ t, therefore, in order to obtain the light plane equation in the camera coordinate system, it is necessary to obtain the three-dimensional first coordinate X according to the external parameters (R and t) of the cameraW,iAnd the formula: xC,i=RXW,i+ t, obtaining a three-dimensional first coordinate XW,iThree-dimensional second coordinate X in camera coordinate systemC,i
And S206, obtaining a three-dimensional third coordinate of the three-dimensional second coordinate mapped in the optical plane according to the position relation between the optical plane and the section of the calibration block and the three-dimensional second coordinate.
In the embodiment of the invention, the three-dimensional second coordinate is a coordinate of at least three non-collinear vertexes on the cross section of the calibration block, the cross section of the calibration block and the light plane have a certain position relation, and in order to obtain a light plane equation, the three-dimensional second coordinate needs to be mapped in the light plane to obtain a three-dimensional third coordinate. Of course, the cross section of the calibration block cannot be perpendicular to the light plane, otherwise, the three-dimensional third coordinate will be collinear in the light plane, and the light plane equation cannot be obtained.
And S207, obtaining an optical plane equation through a linear regression method according to the three-dimensional third coordinate.
Assuming the light plane equation is: and BX + CY + Z + D is 0, and the three-dimensional third coordinate is positioned in the light plane, so that the three-dimensional third coordinate meets the light plane equation, the obtained at least three-dimensional third coordinates are substituted into the light plane equation, and the light plane equation is obtained through a linear regression method. Alternatively, the light plane equation may be obtained by solving the least squares solution of the following equation set to obtain coefficients B, C and D.
Ey=a。
Wherein,coordinate (x)Cn,yCn,ZCn) Representing a three-dimensional second coordinate.
According to the calibration method of the measuring system, provided by the embodiment of the invention, the three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in the laser coordinate system are obtained according to the preset position relation between the laser and the calibration block. The method comprises the steps of obtaining a contour map of a section of a fixed block under line laser irradiation generated by a laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located. And determining external parameters of the camera according to the internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate which are acquired in advance. And determining a light plane equation of a light plane formed by the line laser under a camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate. In the embodiment of the invention, the calibration of the measuring system can be completed only by acquiring one picture on the cross section of the calibration block, so that the calibration method of the measuring system in the embodiment of the invention is simple and rapid. In addition, when the relative position between the camera and the laser changes, the calibration can be conveniently carried out again, and the method is more suitable for field calibration.
Referring to fig. 4, fig. 4 is another flowchart of a calibration method of a measurement system according to an embodiment of the present invention, including the following steps:
s401, according to the position relation between the preset laser and the calibration block, three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance are obtained.
In the embodiment of the invention, the calibration block is an object with known structure information and high processing precision. Then, when the light plane is parallel to the cross section of the calibration block, the method for acquiring the three-dimensional first coordinate is simplified, that is, the three-dimensional first coordinate of at least three non-collinear vertexes in the laser coordinate system can be acquired according to the position relationship between the laser and the calibration block and the size of the calibration block. Specifically, when the calibration block is placed, the cross section of the calibration block is parallel to the light plane formed by the line laser generated by the laser as much as possible. Since at least three non-collinear vertices can define a plane, the light plane equation can be determined by determining the three-dimensional coordinates of the at least three non-collinear vertices of the cross-section of the block in the camera coordinate system when calculating the light plane equation.
Optionally, for convenience of measurement, an axis of the reference coordinate system is parallel to the laser, an axis of the reference coordinate system is parallel to the line laser, and an axis of the reference coordinate system is perpendicular to the light plane and the cross section of the calibration block, so as to obtain a laser coordinate system. Then, obtaining three-dimensional first coordinates of the at least three non-collinear vertices in the laser coordinate system according to the position relationship between the laser and the calibration block and the size of the calibration block specifically includes: when the light plane is parallel to the cross section of the calibration block and the coordinate axis in the laser coordinate system is perpendicular to the cross section of the calibration block, if the perpendicular distance between the cross section of the calibration block and the origin of the laser coordinate system is S, the coordinate in the three-dimensional first coordinate of each vertex in at least three non-collinear vertexes in the direction perpendicular to the cross section of the calibration block is S, and the coordinate parallel to the cross section of the calibration block in the three-dimensional first coordinate of each vertex is the corresponding dimension of each vertex in the cross section of the calibration block. Referring to fig. 5, fig. 5 is a side view and a front view of a camera coordinate system and a laser coordinate system of an embodiment of the present invention. Y in the laser coordinate system in FIG. 5wThe coordinates of the axes are the height of the contour of the calibration block or the distance of the calibration block from the laser (depending on the position of the origin of the laser coordinate system, which indicates the height of the calibration block if the origin is on the plane in which the calibration block is located, and the distance of the calibration block from the laser if the origin is on the laser emitting end), X in the laser coordinate systemwThe coordinates of the axes represent the width of the contour of the calibration block, Z in the laser coordinate systemwThe coordinates of the axes indicate the position of the cross-section of the calibration block, which may optionally be set to ZwAxial origin, i.e. Z at any point on the cross-section of the calibration blockwThe axis coordinate is 0. Thus, in the constructed laser coordinate system, three-dimensional first coordinates of at least three non-collinear vertices on the calibration block in the laser coordinate system can be determined.
For example, FIG. 6 shows the present inventionThe structure of the calibration block under line laser irradiation according to the embodiment is illustrated, but of course, the structure of the calibration block may be various, and the calibration block in fig. 6 is only one of them. X of laser coordinate systemwAxis and YwThe plane of the axis is set on the cross section of the calibration block, as shown in fig. 7, fig. 7 is a schematic diagram of the coordinates of the calibration block in the laser coordinate system according to the embodiment of the present invention, wherein Z iswAxis perpendicular to XwAxis and YwThe plane of the shaft is not shown in fig. 7. Z of any point on the cross section of the calibration blockwThe coordinates of the axes being identical, ZwThe coordinates of the axes are determined according to the position of the established laser coordinate system. If the origin of the laser coordinate system is at XwAxis and YwThe axis lying in a plane, then, Z for any point on the cross-section of the calibration blockwThe coordinates of the axes are 0, XwAxis and YwThe coordinates of the axes are the dimensions of the calibration block. Therefore, the three-dimensional first coordinates of the at least three non-collinear vertices in the laser coordinate system can be conveniently derived from the dimensions of the calibration block.
S402, acquiring a contour map of the cross section of the fixed block under the irradiation of the line laser generated by the laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located.
Specifically, after line laser generated by the laser is irradiated onto the calibration block, a profile of a cross section of the calibration block under the irradiation of the line laser may be obtained by the camera, as shown in fig. 8, fig. 8 is a schematic cross section of the calibration block under the irradiation of the line laser according to the embodiment of the present invention, and the at least three non-collinear vertexes may be vertexes of a bright bar in the profile.
And S403, obtaining the two-dimensional pixel coordinate after distortion removal according to the internal reference and distortion coefficient of the camera obtained in advance and the two-dimensional pixel coordinate.
S404, obtaining the external reference of the camera by solving the PnP according to the internal reference, the three-dimensional first coordinate and the two-dimensional pixel coordinate after distortion removal of the camera.
S405, obtaining a three-dimensional second coordinate of the three-dimensional first coordinate in a camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate.
Since S401, S402, S403, S404, and S405 are respectively the same as S201, S202, S203, S204, and S205 in the embodiment of fig. 2, all embodiments of S201, S202, S203, S204, and S205 in fig. 2 are applicable to fig. 4, and can achieve the same or similar beneficial effects, and are not repeated herein.
And S406, obtaining an optical plane equation through a linear regression method according to the three-dimensional second coordinate.
In the embodiment of the invention, because the three-dimensional first coordinate is positioned in the light plane, after the three-dimensional first coordinate is converted into the three-dimensional second coordinate in the camera coordinate system, the light plane equation can be directly obtained through a linear regression method according to the three-dimensional second coordinate without converting the three-dimensional second coordinate.
According to the calibration method of the measuring system, provided by the embodiment of the invention, the three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in the laser coordinate system are obtained according to the preset position relation between the laser and the calibration block. The method comprises the steps of obtaining a contour map of a section of a fixed block under line laser irradiation generated by a laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located. And determining external parameters of the camera according to the internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate which are acquired in advance. And determining a light plane equation of the light plane in the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinates. In the embodiment of the invention, under the condition that the light plane is parallel to the cross section of the calibration block, the calibration of the measurement system can be completed only by collecting one picture containing three non-collinear vertexes on the calibration block, so that the calibration method of the measurement system in the embodiment of the invention is simple and rapid. In addition, when the relative position between the camera and the laser changes, the calibration can be conveniently carried out again, and the method is more suitable for field calibration.
Corresponding to the above method embodiment, the embodiment of the present invention further discloses a calibration apparatus of a measurement system, referring to fig. 9, where fig. 9 is a structural diagram of the calibration apparatus of the measurement system according to the embodiment of the present invention, including:
a three-dimensional first coordinate determining module 901, configured to obtain, according to a predetermined position relationship between the laser and the calibration block, three-dimensional first coordinates of at least three non-collinear vertices on a cross section of the calibration block in a laser coordinate system that is pre-constructed.
A profile acquisition module 902 for acquiring a profile of a cross-section of the gauge block under line laser illumination by the laser.
The two-dimensional pixel coordinate determining module 903 determines two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located.
And an external parameter determining module 904, configured to determine an external parameter of the camera according to the pre-obtained internal parameter and distortion coefficient of the camera, the three-dimensional first coordinate, and the two-dimensional pixel coordinate.
And the light plane equation determining module 905 is configured to determine a light plane equation of a light plane formed by the line laser in the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate.
According to the calibration device of the measurement system, provided by the embodiment of the invention, the three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in the laser coordinate system are obtained according to the preset position relation between the laser and the calibration block. The method comprises the steps of obtaining a contour map of a section of a fixed block under line laser irradiation generated by a laser, and determining two-dimensional pixel coordinates of at least three non-collinear vertexes in an image coordinate system where the contour map is located. And determining external parameters of the camera according to the internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate which are acquired in advance. And determining a light plane equation of a light plane formed by the line laser under a camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate. In the embodiment of the invention, the calibration of the measuring system can be completed only by acquiring one picture on the cross section of the calibration block, so that the calibration method of the measuring system in the embodiment of the invention is simple and rapid. In addition, when the relative position between the camera and the laser changes, the calibration can be conveniently carried out again, and the method is more suitable for field calibration.
It should be noted that, the apparatus according to the embodiment of the present invention is an apparatus applying the calibration method of the measurement system, and all embodiments of the calibration method of the measurement system are applicable to the apparatus and can achieve the same or similar beneficial effects.
Optionally, in the calibration apparatus of the measurement system according to the embodiment of the present invention, the external parameter determining module 904 is specifically configured to obtain a two-dimensional pixel coordinate after distortion removal according to an internal parameter and a distortion coefficient of a camera and the two-dimensional pixel coordinate; and obtaining the external reference of the camera by solving the PnP according to the internal reference, the three-dimensional first coordinate and the two-dimensional pixel coordinate after distortion removal of the camera.
Optionally, in the calibration device of the measurement system according to the embodiment of the present invention, the optical plane equation determining module 905 is specifically configured to obtain a three-dimensional second coordinate of the three-dimensional first coordinate in a camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate; obtaining a three-dimensional third coordinate of the three-dimensional second coordinate mapped in the optical plane according to the position relation between the optical plane and the section of the calibration block and the three-dimensional second coordinate; and obtaining a light plane equation by a linear regression method according to the three-dimensional third coordinate.
Optionally, in the calibration device of the measurement system according to the embodiment of the present invention, the light plane is parallel to the cross section of the calibration block;
the light plane equation determining module 905 is specifically configured to obtain a three-dimensional second coordinate of the three-dimensional first coordinate in a camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate; and obtaining a light plane equation by a linear regression method according to the three-dimensional second coordinate.
Optionally, in the calibration apparatus of the measurement system according to the embodiment of the present invention, the optical plane equation determining module 905 is specifically configured to, according to a formula: xC,i=RXW,i+ t, determining the three-dimensional first coordinate XW,iThree-dimensional second seat in camera coordinate systemMark XC,i
Wherein i is 1,2, … n, n is more than or equal to 3, and the external parameters of the camera comprise: and R and t, wherein R represents a rotation matrix of the camera coordinate system relative to the laser coordinate system, and t represents a translation vector of the camera coordinate system relative to the laser coordinate system.
Optionally, in the calibration apparatus of the measurement system according to the embodiment of the present invention, the three-dimensional first coordinate determining module 901 is specifically configured to obtain three-dimensional first coordinates of at least three non-collinear vertices in a laser coordinate system according to a position relationship between a laser and a calibration block and a size of the calibration block.
Optionally, in the calibration apparatus of the measurement system according to the embodiment of the present invention, the three-dimensional first coordinate determining module 901 is specifically configured to, when the light plane is parallel to the cross section of the calibration block and the coordinate axis in the laser coordinate system is perpendicular to the cross section of the calibration block, if a perpendicular distance between the cross section of the calibration block and the origin of the laser coordinate system is S, a coordinate in the three-dimensional first coordinate of each vertex that is not collinear and is perpendicular to the cross section of the calibration block is S, and a coordinate in the three-dimensional first coordinate of each vertex that is parallel to the cross section of the calibration block is a corresponding dimension of each vertex in the cross section of the calibration block.
An embodiment of the present invention further provides an electronic device, including: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions capable of being executed by the processor, the processor implementing the steps of the calibration method of the measurement system when executing the machine-executable instructions, the calibration method of the measurement system may be the calibration method of the measurement system in the embodiment of fig. 1, the embodiment of fig. 2, and the embodiment of fig. 4.
It should be noted that the machine-readable storage medium may include: a RAM (Random Access Memory), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the machine-readable storage medium may be at least one memory device located remotely from the processor.
The processor may be a general-purpose processor comprising: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital signal processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
The embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the calibration method of the measurement system are implemented, where the calibration method of the measurement system may be the calibration method of the measurement system in the embodiment of fig. 1, the embodiment of fig. 2, and the embodiment of fig. 4.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the calibration device, the electronic device and the readable storage medium of the measurement system, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the partial description of the embodiments of the method.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (16)

1. A method of calibrating a measurement system, the measurement system comprising a laser and a camera, the method comprising:
according to the position relation between a preset laser and a calibration block, three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance are obtained;
acquiring a profile map of the cross section of the calibration block under the irradiation of line laser generated by the laser, and determining two-dimensional pixel coordinates of the at least three non-collinear vertexes in an image coordinate system where the profile map is located;
determining external parameters of the camera according to the pre-acquired internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate;
and determining a light plane equation of a light plane formed by the line laser under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate.
2. The calibration method of the measurement system according to claim 1, wherein the step of determining the external parameters of the camera according to the pre-acquired internal parameters and distortion coefficients of the camera, the three-dimensional first coordinates and the two-dimensional pixel coordinates comprises:
obtaining a two-dimensional pixel coordinate after distortion removal according to the internal parameters and the distortion coefficient of the camera and the two-dimensional pixel coordinate;
and obtaining the external reference of the camera by solving the perspective N point PnP according to the internal reference of the camera, the three-dimensional first coordinate and the undistorted two-dimensional pixel coordinate.
3. The method for calibrating a measuring system according to claim 1, wherein the step of determining the light plane equation of the light plane formed by the line laser in the camera coordinate system according to the external reference of the camera and the three-dimensional first coordinate comprises:
obtaining a three-dimensional second coordinate of the three-dimensional first coordinate under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate;
obtaining a three-dimensional third coordinate of the three-dimensional second coordinate mapped in the light plane according to the position relation between the light plane and the section of the calibration block and the three-dimensional second coordinate;
and obtaining the light plane equation by a linear regression method according to the three-dimensional third coordinate.
4. A method for calibration of a measuring system according to claim 1, wherein the light plane is parallel to the calibration block cross-section;
the step of determining the light plane equation of the light plane formed by the line laser under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinates comprises the following steps:
obtaining a three-dimensional second coordinate of the three-dimensional first coordinate under the camera coordinate system according to the external parameters of the camera and the three-dimensional first coordinate;
and obtaining the light plane equation by a linear regression method according to the three-dimensional second coordinate.
5. The method for calibrating a measuring system according to claim 3 or 4, wherein the step of obtaining a three-dimensional second coordinate of the three-dimensional first coordinate in the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate comprises:
according to the formula: xC,i=RXW,i+ t, determining said three-dimensional first coordinate XW,iA three-dimensional second coordinate X in the camera coordinate systemC,i
Wherein i is 1,2, … n, n is more than or equal to 3, and the external parameters of the camera comprise: and R and t, wherein R represents a rotation matrix of the camera coordinate system relative to the laser coordinate system, and t represents a translation vector of the camera coordinate system relative to the laser coordinate system.
6. The method for calibrating a measuring system according to claim 1, wherein the step of obtaining three-dimensional first coordinates of at least three non-collinear vertices on the cross-section of the calibration block in a pre-established laser coordinate system according to a predetermined positional relationship between the laser and the calibration block comprises:
and acquiring three-dimensional first coordinates of the at least three non-collinear vertexes in the laser coordinate system respectively according to the position relation between the laser and the calibration block and the size of the calibration block.
7. The method for calibrating a measurement system according to claim 6, wherein the obtaining three-dimensional first coordinates of the at least three non-collinear vertices in the laser coordinate system according to the positional relationship between the laser and the calibration block and the size of the calibration block is specifically: when the light plane is parallel to the cross section of the calibration block and the coordinate axis in the laser coordinate system is perpendicular to the cross section of the calibration block, if the perpendicular distance between the cross section of the calibration block and the origin of the laser coordinate system is S, the coordinate in the three-dimensional first coordinate of each vertex of the at least three non-collinear vertices, which is perpendicular to the cross section of the calibration block, is S, and the coordinate in the three-dimensional first coordinate of each vertex, which is parallel to the cross section of the calibration block, is the corresponding dimension of each vertex in the cross section of the calibration block.
8. Calibration arrangement for a measurement system, wherein the measurement system comprises a laser and a camera, the arrangement comprising:
the three-dimensional first coordinate determination module is used for acquiring three-dimensional first coordinates of at least three non-collinear vertexes on the cross section of the calibration block in a laser coordinate system which is constructed in advance according to the position relation between a preset laser and the calibration block;
the profile acquisition module is used for acquiring a profile of the cross section of the calibration block under the irradiation of line laser generated by the laser;
the two-dimensional pixel coordinate determination module is used for determining the two-dimensional pixel coordinates of the at least three non-collinear vertexes in an image coordinate system where the contour map is located;
the external parameter determining module is used for determining the external parameters of the camera according to the pre-acquired internal parameters and distortion coefficients of the camera, the three-dimensional first coordinate and the two-dimensional pixel coordinate;
and the light plane equation determining module is used for determining a light plane equation of a light plane formed by the line laser under the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate.
9. The calibration device of the measurement system according to claim 8, wherein the external parameter determining module is specifically configured to obtain a two-dimensional pixel coordinate after distortion removal according to the internal parameter and the distortion coefficient of the camera and the two-dimensional pixel coordinate; and obtaining the external reference of the camera by solving the perspective N point PnP according to the internal reference of the camera, the three-dimensional first coordinate and the undistorted two-dimensional pixel coordinate.
10. The calibration device of the measurement system according to claim 8, wherein the light plane equation determining module is specifically configured to obtain a three-dimensional second coordinate of the three-dimensional first coordinate in the camera coordinate system according to the external reference of the camera and the three-dimensional first coordinate; obtaining a three-dimensional third coordinate of the three-dimensional second coordinate mapped in the light plane according to the position relation between the light plane and the section of the calibration block and the three-dimensional second coordinate; and obtaining the light plane equation by a linear regression method according to the three-dimensional third coordinate.
11. Calibration arrangement of a measurement system according to claim 8, wherein the light plane is parallel to the calibration block cross-section;
the light plane equation determining module is specifically configured to obtain a three-dimensional second coordinate of the three-dimensional first coordinate in the camera coordinate system according to the external parameter of the camera and the three-dimensional first coordinate; and obtaining the light plane equation by a linear regression method according to the three-dimensional second coordinate.
12. The calibration apparatus of a measurement system according to claim 10 or 11, wherein the light plane equation determining module is specifically configured to, according to the formula: xC,i=RXW,i+ t, determining said three-dimensional first coordinate XW,iA three-dimensional second coordinate X in the camera coordinate systemC,i
Wherein i is 1,2, … n, n is more than or equal to 3, and the external parameters of the camera comprise: and R and t, wherein R represents a rotation matrix of the camera coordinate system relative to the laser coordinate system, and t represents a translation vector of the camera coordinate system relative to the laser coordinate system.
13. The calibration apparatus of the measurement system according to claim 8, wherein the three-dimensional first coordinate determination module is specifically configured to obtain three-dimensional first coordinates of the at least three non-collinear vertices in the laser coordinate system according to a positional relationship between the laser and the calibration block and a size of the calibration block.
14. The apparatus of claim 13, wherein the three-dimensional first coordinate determination module is specifically configured to, when the light plane is parallel to the cross section of the calibration block and the coordinate axis of the laser coordinate system is perpendicular to the cross section of the calibration block, if the perpendicular distance between the cross section of the calibration block and the origin of the laser coordinate system is S, the coordinate of each vertex in the three-dimensional first coordinate in the at least three non-collinear vertices perpendicular to the cross section of the calibration block is S, and the coordinate of each vertex in the three-dimensional first coordinate in the each vertex parallel to the cross section of the calibration block is the corresponding dimension of each vertex in the cross section of the calibration block.
15. An electronic device, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor implementing the method steps of any of claims 1-7 when executing the machine-executable instructions.
16. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN201710546626.6A 2017-07-06 2017-07-06 Calibration method and device of measurement system, electronic equipment and readable storage medium Active CN109211264B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710546626.6A CN109211264B (en) 2017-07-06 2017-07-06 Calibration method and device of measurement system, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710546626.6A CN109211264B (en) 2017-07-06 2017-07-06 Calibration method and device of measurement system, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109211264A true CN109211264A (en) 2019-01-15
CN109211264B CN109211264B (en) 2021-04-30

Family

ID=64992303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710546626.6A Active CN109211264B (en) 2017-07-06 2017-07-06 Calibration method and device of measurement system, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109211264B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109737230A (en) * 2019-02-25 2019-05-10 河海大学常州校区 A kind of intelligent hydraulic control system and method for non-cpntact measurement
CN110135277A (en) * 2019-07-05 2019-08-16 南京邮电大学 A kind of Human bodys' response method based on convolutional neural networks
CN110378971A (en) * 2019-07-25 2019-10-25 Oppo广东移动通信有限公司 A kind of detection method and device of image alignment precision, equipment, storage medium
CN110473262A (en) * 2019-08-22 2019-11-19 北京双髻鲨科技有限公司 Outer ginseng scaling method, device, storage medium and the electronic equipment of more mesh cameras
CN111028337A (en) * 2019-12-04 2020-04-17 南京大学 Three-dimensional photoacoustic imaging method for improving problem of limited visual angle
CN111161358A (en) * 2019-12-31 2020-05-15 华中科技大学鄂州工业技术研究院 Camera calibration method and device for structured light depth measurement
CN111739104A (en) * 2020-06-24 2020-10-02 深圳市道通科技股份有限公司 Calibration method and device of laser calibration system and laser calibration system
CN111750896A (en) * 2019-03-28 2020-10-09 杭州海康机器人技术有限公司 Holder calibration method and device, electronic equipment and storage medium
CN111915681A (en) * 2019-05-08 2020-11-10 长沙智能驾驶研究院有限公司 External parameter calibration method and device for multi-group 3D camera group, storage medium and equipment
CN112562003A (en) * 2019-09-10 2021-03-26 北京京东乾石科技有限公司 Calibration method and calibration system for external parameters of camera
CN112857249A (en) * 2019-11-28 2021-05-28 株洲中车时代电气股份有限公司 Calibration method and device for contact net detection equipment
CN114062265A (en) * 2021-11-11 2022-02-18 易思维(杭州)科技有限公司 Method for evaluating stability of supporting structure of visual system
WO2022134328A1 (en) * 2020-12-21 2022-06-30 福建汇川物联网技术科技股份有限公司 Construction method and apparatus for building information model
CN114963025A (en) * 2022-04-19 2022-08-30 深圳市城市公共安全技术研究院有限公司 Leakage point positioning method and device, electronic equipment and readable storage medium
CN115393442A (en) * 2022-03-02 2022-11-25 深圳市深视智能科技有限公司 Calibration method, device and system of three-dimensional camera
WO2023020575A1 (en) * 2021-08-18 2023-02-23 深圳市创客工场科技有限公司 Calculation method, laser machining device and computer-readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104677305A (en) * 2015-02-11 2015-06-03 浙江理工大学 Method and system for three-dimensionally reconstructing object surface based on cross-structured light
CN105118040A (en) * 2015-09-18 2015-12-02 中国科学院自动化研究所 Document image distortion rectifying method based on structured laser beams
CN106097348A (en) * 2016-06-13 2016-11-09 大连理工大学 A kind of three-dimensional laser point cloud and the fusion method of two dimensional image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104677305A (en) * 2015-02-11 2015-06-03 浙江理工大学 Method and system for three-dimensionally reconstructing object surface based on cross-structured light
CN105118040A (en) * 2015-09-18 2015-12-02 中国科学院自动化研究所 Document image distortion rectifying method based on structured laser beams
CN106097348A (en) * 2016-06-13 2016-11-09 大连理工大学 A kind of three-dimensional laser point cloud and the fusion method of two dimensional image

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
朱耀轩等: "基于单目视觉的火炮身管指向静态测量", 《兵工学报》 *
李冠楠等: "一字线结构光三维测量模型的新型标定方法", 《光子学报》 *
李龙等: "结构光视觉引导的轨迹跟踪系统的标定技术", 《计算机工程与应用》 *
陈文亮等: "三维空间中线结构光与相机快速标定方法", 《红外技术》 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109737230A (en) * 2019-02-25 2019-05-10 河海大学常州校区 A kind of intelligent hydraulic control system and method for non-cpntact measurement
CN111750896A (en) * 2019-03-28 2020-10-09 杭州海康机器人技术有限公司 Holder calibration method and device, electronic equipment and storage medium
CN111915681B (en) * 2019-05-08 2023-12-29 长沙智能驾驶研究院有限公司 External parameter calibration method, device, storage medium and equipment for multi-group 3D camera group
CN111915681A (en) * 2019-05-08 2020-11-10 长沙智能驾驶研究院有限公司 External parameter calibration method and device for multi-group 3D camera group, storage medium and equipment
CN110135277B (en) * 2019-07-05 2022-08-16 南京邮电大学 Human behavior recognition method based on convolutional neural network
CN110135277A (en) * 2019-07-05 2019-08-16 南京邮电大学 A kind of Human bodys' response method based on convolutional neural networks
CN110378971A (en) * 2019-07-25 2019-10-25 Oppo广东移动通信有限公司 A kind of detection method and device of image alignment precision, equipment, storage medium
CN110473262A (en) * 2019-08-22 2019-11-19 北京双髻鲨科技有限公司 Outer ginseng scaling method, device, storage medium and the electronic equipment of more mesh cameras
CN112562003A (en) * 2019-09-10 2021-03-26 北京京东乾石科技有限公司 Calibration method and calibration system for external parameters of camera
CN112857249A (en) * 2019-11-28 2021-05-28 株洲中车时代电气股份有限公司 Calibration method and device for contact net detection equipment
CN111028337A (en) * 2019-12-04 2020-04-17 南京大学 Three-dimensional photoacoustic imaging method for improving problem of limited visual angle
CN111161358A (en) * 2019-12-31 2020-05-15 华中科技大学鄂州工业技术研究院 Camera calibration method and device for structured light depth measurement
CN111161358B (en) * 2019-12-31 2022-10-21 华中科技大学鄂州工业技术研究院 Camera calibration method and device for structured light depth measurement
CN111739104A (en) * 2020-06-24 2020-10-02 深圳市道通科技股份有限公司 Calibration method and device of laser calibration system and laser calibration system
CN111739104B (en) * 2020-06-24 2024-05-03 深圳市道通科技股份有限公司 Calibration method and device of laser calibration system and laser calibration system
WO2022134328A1 (en) * 2020-12-21 2022-06-30 福建汇川物联网技术科技股份有限公司 Construction method and apparatus for building information model
WO2023020575A1 (en) * 2021-08-18 2023-02-23 深圳市创客工场科技有限公司 Calculation method, laser machining device and computer-readable storage medium
CN114062265A (en) * 2021-11-11 2022-02-18 易思维(杭州)科技有限公司 Method for evaluating stability of supporting structure of visual system
CN115393442A (en) * 2022-03-02 2022-11-25 深圳市深视智能科技有限公司 Calibration method, device and system of three-dimensional camera
CN114963025A (en) * 2022-04-19 2022-08-30 深圳市城市公共安全技术研究院有限公司 Leakage point positioning method and device, electronic equipment and readable storage medium
CN114963025B (en) * 2022-04-19 2024-03-26 深圳市城市公共安全技术研究院有限公司 Leakage point positioning method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN109211264B (en) 2021-04-30

Similar Documents

Publication Publication Date Title
CN109211264B (en) Calibration method and device of measurement system, electronic equipment and readable storage medium
JP6602867B2 (en) How to update the calibration of a 3D measurement system
CN109697736B (en) Calibration method and device of measurement system, electronic equipment and readable storage medium
JP5029618B2 (en) Three-dimensional shape measuring apparatus, method and program by pattern projection method
US20150279016A1 (en) Image processing method and apparatus for calibrating depth of depth sensor
JP6041513B2 (en) Image processing apparatus, image processing method, and program
CN104392435B (en) Fisheye camera scaling method and caliberating device
Zhao et al. Calibration for stereo vision system based on phase matching and bundle adjustment algorithm
CN106705849B (en) Calibrating Technique For The Light-strip Sensors
CN104266608B (en) Field calibration device for visual sensor and calibration method
CN110689581A (en) Structured light module calibration method, electronic device and computer readable storage medium
CN110345921B (en) Stereo visual field vision measurement and vertical axis aberration and axial aberration correction method and system
CN109827521B (en) Calibration method for rapid multi-line structured optical vision measurement system
CN107610183B (en) Calibration method of fringe projection phase height conversion mapping model
WO2018201677A1 (en) Bundle adjustment-based calibration method and device for telecentric lens-containing three-dimensional imaging system
CN106570907B (en) Camera calibration method and device
CN104807405B (en) Three-dimensional coordinate measurement method based on light ray angle calibration
CN104794718A (en) Single-image CT (computed tomography) machine room camera calibration method
CN109544642B (en) N-type target-based TDI-CCD camera parameter calibration method
CN116071433A (en) Camera calibration method and system, and computer-readable storage medium
CN104036518B (en) Camera calibration method based on vector method and three collinear points
JP6989276B2 (en) Position measuring device
CN113658270B (en) Method, device, medium and system for multi-vision calibration based on workpiece hole center
CN110736426A (en) Object size acquisition method and device, computer equipment and storage medium
JP6560159B2 (en) Position measuring device

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310051 room 304, B / F, building 2, 399 Danfeng Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Hikvision Robot Co.,Ltd.

Address before: No.555, Qianmo Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: HANGZHOU HIKROBOT TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address