Structured light triangulation automatic calibration system and calibration method
Technical Field
The invention relates to the technical field of laser measurement, in particular to a calibration system and a calibration method for structured light triangulation.
Background
How to quickly, accurately and effectively acquire spatial three-dimensional information is a leading-edge subject of deep research of scholars at home and abroad. With the deepening of information technology research and the appearance of concepts such as smart cities, virtual reality and the like, particularly in the information era depending on computer technology at present, the demand of people on spatial three-dimensional information is more urgent. With the development of technologies such as sensors, electronics, optics, computers and the like, photogrammetry and remote sensing technologies for acquiring three-dimensional information of an object surface based on a computer vision theory become mainstream, but in the process of converting a three-dimensional world into a two-dimensional image, part of geometric information is inevitably lost, so that the understanding of a three-dimensional objective world from the two-dimensional image has self limitations. Therefore, the means for acquiring spatial three-dimensional information is difficult to meet the requirements of future applications, and how to quickly and effectively acquire, model, analyze and store real-world three-dimensional information with high precision becomes a bottleneck for solving the problem.
The appearance and development of the three-dimensional laser measurement technology provide a brand new technical means for acquiring the spatial three-dimensional information and provide necessary survival conditions for the digital development of the information. Because laser has the characteristics of monochromaticity, directivity, coherence, high brightness and the like, the laser has great advantages in the aspects of precision, speed, easy operability and the like when being introduced into a measuring device, the appearance of the laser causes a revolution of modern measuring technology, and a plurality of high-technology companies and research institutions shift the research direction and the emphasis to the research of laser measuring devices. With the promotion of the development and application requirements of laser technology, semiconductor technology, microelectronic technology, computer technology, sensors and other technologies, the laser measurement technology is also developed from point-to-point laser ranging to a three-dimensional laser scanning measurement technology for rapidly acquiring three-dimensional space coordinates of a large number of sampling points on the surface of an object by adopting non-contact active measurement. With the improvement of the three-dimensional laser scanning measuring device in the aspects of precision, speed, easy operability, portability, anti-interference capability and the like and the gradual reduction of the price, the three-dimensional laser scanning measuring device becomes a hotspot of research in the field of surveying and mapping, a scanning object is continuously expanded, the application field is continuously expanded, and the three-dimensional laser scanning measuring device gradually becomes one of the main modes for rapidly acquiring a three-dimensional model of a space entity. The three-dimensional laser scanning measurement technology overcomes the limitation of the traditional measurement technology, adopts a non-contact active measurement mode to directly acquire high-precision three-dimensional data, can scan any object, has no limitation of day and night, and quickly converts the information of the real world into data which can be processed. The system has the characteristics of high scanning speed, strong real-time performance, high precision, strong initiative, full digital characteristic and the like, can greatly reduce the cost, saves the time and is convenient to use.
The three-dimensional laser scanning measurement technology can be divided into three types based on pulse type, phase difference and triangulation principle according to the measurement mode. The pulse method (including the time-of-flight method) is characterized in that a laser generating source emits a laser pulse, the laser pulse is reflected to the generating source when meeting an object, the time interval between the emitting time and the receiving time of the laser is measured, and the distance between the starting point and the target can be calculated through the known light speed. The pulse method is usually used for long-distance and large-range measurement, the measurement distance is from hundreds of meters to kilometers, the measurement precision is usually within centimeter-decimeter, and the measurement time is short. The phase method is to emit continuous pulse waves from an emission source and calculate the distance by calculating the phase difference between the emitted waves and the received waves. The phase method is usually used for medium-distance measurement, the measurement distance is from dozens of centimeters to dozens of meters, the measurement precision can reach millimeters generally, and the measurement time is long.
The basic principle of laser triangulation is shown in fig. 1, the projection direction of the laser beam forms a certain included angle α with the shooting direction of the camera, the beam generated by the laser is projected onto the surface of the object to be measured to form a light spot, and a part of scattered light (including reflected light) of the light spot is imaged on the camera CCD through the lens. If the object to be measured moves A along the direction of the laser beam, the image point on the CCD of the camera moves B along with the object to be measured, and the moving distance A of the surface of the object to be measured can be detected through the moving distance B of the image point. The triangulation method is usually used for short-distance measurement, the measurement distance is usually dozens of millimeters to several meters, the measurement precision can reach the micron level, and the measurement time is very short.
The laser triangulation system is used for three-dimensional measurement, and how to obtain the moving distance A of the surface of the measured object through the known moving distance B of the image point must be known, namely the relationship between the coordinates of the measured point and the coordinates of the corresponding pixel point needs to be known, and the process of solving the corresponding relationship is the process of calibrating the laser triangulation system.
Laser light is one type of structured light. The method for calibrating the structured light triangulation system comprises a standard template method and a direct pixel point calibration method, wherein the standard template method comprises the steps of shooting a measured point with a known three-dimensional coordinate on a standard template through a camera, connecting a pixel point coordinate system of the camera with a reference coordinate system of the measured point, then obtaining a transformation equation between the two coordinate systems through calculation, and calculating the actual measured object coordinate through the pixel point coordinate through the transformation equation. Because the transformation equation is calculated by the measured points with known three-dimensional coordinates, the more the measured points with known three-dimensional coordinates are, the more accurate the actual coordinates of the measured points are, and the more accurate the transformation equation is finally obtained, namely the higher the calibration precision is. However, in practical application, it is difficult to improve the coordinate accuracy of the measured points, and increasing the number of the measured points brings a large amount of calculation, so that the calibration accuracy of the standard template method is not high under the limited number of the measured points in practical application.
The direct pixel point calibration method is characterized in that a camera shoots a section bar with the length covering the transverse range of the camera, the height change of a measured object (namely the coordinate of the measured object) is realized by increasing or decreasing gauge blocks with known thickness, then a series of measured objects with different heights and known coordinates are shot, the coordinates of the series of measured objects correspond to the coordinates of corresponding pixel points one by one, and the coordinates of other pixel points which are not corresponding to the measured objects are obtained through linear interpolation. Finally, a relation table between the pixel point coordinates and the spatial coordinates of the measured object can be obtained, the relation table is directly searched during practical engineering application to obtain the practical object space coordinates corresponding to the pixel points, and further the surface contour information of the measured object can be obtained through the pixel point coordinates.
Therefore, the calibration accuracy of the direct pixel point calibration method is influenced by the number of the direct calibration pixel points and the coordinate accuracy of the measured object. The processing precision of the gauge block with known thickness used for calibration is limited, so that the accuracy of the actual measured object coordinate is limited; on the other hand, because an artificial calibration mode is adopted, the labor cost is considered, the number of the pixel points directly corresponding to the artificial calibration mode in practical application is limited, and other pixel points which are not corresponding to the artificial calibration mode can only be obtained through linear interpolation, so that the calibration precision of the conventional direct pixel point calibration method is not high, and the manual error is easy to cause influence.
Disclosure of Invention
The invention aims to solve the technical problem of providing an automatic calibration system and a calibration method for structured light triangulation to overcome the defects of low calibration precision, large manual error and low calibration efficiency of the existing calibration scheme.
In order to solve the above technical problems, the structured light triangulation automatic calibration system provided by the present invention comprises a processor unit, a control system, a measurement system, a motion system and a power supply system, wherein,
the processor unit is mainly used for storing and calculating data;
the control system is used for controlling the work of the measuring system and the motion system;
the measuring system mainly comprises a camera, a structured light source, a distance measuring machine, a data acquisition card and a calibration section bar, wherein the length of the calibration section bar covers the transverse range of the camera, the camera and the structured light source form a triangulation position relationship, and the data acquisition card is used for reading the value of the distance measuring machine;
the motion system is an electric lifting mechanism, the electric lifting mechanism is fixedly connected with the calibration section bar and is used for driving the calibration section bar to lift relative to the light beam direction of the structured light source, and the distance measuring machine is used for measuring the elevation of the calibration section bar;
and the power supply system provides power for the processor unit, the control system, the measurement system and the motion system.
The number of the electric lifting mechanisms is two, and the electric lifting mechanisms are respectively arranged at two ends of the calibration sectional material.
The invention also provides a calibration method of the structured light triangulation automatic calibration system, which comprises the following steps:
setting a calibration section bar with the length covering the transverse range of a camera as a measured object, and irradiating the surface of the calibration section bar with line structure light emitted by a structured light source; enabling the calibration section bar to vertically and slowly move through an electric lifting mechanism; at regular intervals, a camera shoots the surface of the calibration sectional material to obtain the image space coordinate of a certain light spot on the line structured light, and the object space coordinate of the light spot on the calibration sectional material is measured by a distance measuring machine; establishing a mapping relation between the image space coordinate and the object space coordinate, namely establishing the calibration of a certain pixel point on the target surface of the camera; according to the principle, all pixel points on the target surface of the camera are calibrated.
Preferably, every certain time interval of the camera means that the calibration profile vertically moves by a certain step length by the time interval, and the corresponding displacement of the certain step length on the target surface of the camera is less than or equal to the height of one camera pixel point.
Preferably, the camera and the laser range finder are simultaneously connected with a controller, the controller generates a synchronous trigger signal, the synchronous trigger signal is divided into two paths, one path is connected with the camera, and the camera is triggered to shoot light spots on the calibration section bar; the other path is connected with a data acquisition card in the industrial personal computer, and the data acquisition card is triggered to read the elevation of the light spot on the calibration section bar measured by the distance measuring machine at the current time in real time, namely the object space coordinate of the light spot;
has the advantages that: according to the automatic calibration method for the structured light triangulation, on one hand, a distance measuring machine is adopted to measure the elevation of the measured object in real time on the aspect of calibration precision, so that the accuracy of the elevation value of the measured object is ensured; on the other hand, the method adopts a full-pixel point calibration mode, so that the influence of calculation errors is avoided. Meanwhile, the elevation change of the measured object is realized by adopting the electric lifting mechanism, the change resolution can reach 0.02mm, the accuracy of the elevation value of the measured object is ensured, and the calibration precision is also improved.
In the aspect of artificial errors, the elevation change of the measured object is realized by adopting an electric lifting mechanism, manual intervention is not needed, and the precision influence caused by the artificial errors is effectively avoided.
In the aspect of calibration efficiency, an electric lifting mechanism is adopted for lifting and a distance measuring machine is adopted for measuring, the movement and the measurement process are completed fully automatically, and the calibration efficiency is obviously improved.
Therefore, the invention improves the calibration efficiency and the calibration precision on the premise of saving human resources.
Drawings
The technical solution of the present invention will be further specifically described with reference to the accompanying drawings and the detailed description.
Fig. 1 is a schematic diagram of laser triangulation.
FIG. 2 is a schematic block diagram of the components of the structured light triangulation device of the present invention.
Fig. 3 is a schematic view of a measurement installation according to an embodiment of the present invention.
FIG. 4 is a logic diagram of the operation of the structured light triangulation calibration of the present invention.
FIG. 5 is a detailed flowchart of the present invention for structured light triangulation calibration.
Detailed Description
The invention relates to a processor unit, a control system, a measuring system, a motion system and a power supply system, wherein the processor unit is mainly used for storing and calculating data; the control system is used for controlling the work of the measuring system and the motion system; the measuring system mainly comprises a camera, a structured light source, a distance measuring machine, a data acquisition card and a calibration section bar, wherein the length of the calibration section bar covers the transverse range of the camera, the camera and the structured light source form a triangulation position relationship, and the data acquisition card is used for reading the value of the distance measuring machine; the motion system is an electric lifting mechanism which is fixedly connected with the calibration section bar and is used for driving the calibration section bar to lift relative to the light beam direction of the structured light source, and the distance measuring machine is used for measuring the elevation of the calibration section bar;
the power supply system is an external power supply and provides power for the processor unit, the control system, the measurement system and the motion system.
Referring to fig. 2, an industrial personal computer mainly provides an operating platform and a storage computing device for the system; the control system mainly comprises a controller and is used for controlling the work of the measurement system and the motion system; the measuring system mainly comprises acquisition software, a camera, a structured light source and a distance measuring machine.
Fig. 3 is a schematic view of measurement and installation according to an embodiment of the present invention, specifically: 1. one industrial personal computer; 2. one controller; 3. three distance measuring machines; 4. one camera; 5. one structured light source; 6. two electric lifting mechanisms are provided; 7. one for each calibration profile (i.e. measured object). The industrial personal computer integrates a processor unit and a data acquisition card.
The measured object is an aluminum alloy calibration section 7 with the length covering the transverse range of the camera 4, the controller 2 controls the electric lifting mechanism 6 to enable the calibration section 7 to vertically and slowly ascend, the elevation value of the calibration section 7 is measured in real time through the distance measuring machine 3, the camera 4 shoots the smooth surface of the calibration section 7 at fixed step lengths (such as 0.1mm, corresponding to the height of a pixel point) to obtain the object space coordinate of the position where the structural light of the structural light source 5 is located, the industrial personal computer 1 synchronizes the camera 4 and the distance measuring machine 3 through the synchronous signal of the controller 2, the obtained object space coordinate corresponds to the pixel point on the target surface of the camera 4 to complete the pixel point calibration, and the steps are repeated until all the pixel points on the target surface of the camera 4.
Fig. 4 is a logic diagram of the operation of the present invention, wherein the power supply portion is not shown. The industrial personal computer 1 sends a control command to the controller 2 through software, then the controller 2 controls the lifting mechanism 6 to move, and the calibration section 7 moves along with the lifting mechanism. Meanwhile, the controller 2 also generates a synchronous trigger signal, the synchronous trigger signal is divided into two paths, one path is connected with the camera 4, and the camera 4 is triggered to shoot the calibration sectional material 7; and the other path is connected with a data acquisition card in the industrial personal computer 1 and triggers the data acquisition card to read the value of the distance measuring machine 3 at the current time. The pictures shot by the camera 4 are transmitted back to the industrial personal computer 1 through a data line, and the distance measuring machine 3 and the camera 4 directly measure the surface of the calibration section bar 7 on the electric lifting mechanism 6 to obtain data.
The flow of the structured light triangulation automatic calibration method is shown in the flow chart of fig. 5.
(1) Preparation work
The two electric lifting mechanisms 6 are stably placed and are adjusted to be horizontal, and the electric lifting mechanisms 6 are ensured to lift on a vertical surface. A calibration section bar 7 with the length covering the transverse range of a camera is fixed on two electric lifting mechanisms 6, the camera 4 is fixed and can be ensured to shoot the surface of the calibration section bar 7, and the line structure light emitted by a structured light source irradiates the surface of the calibration section bar.
(2) Determining the position of a distance measuring machine 3
The distance measuring machine 3 is fixed beside the calibration profile 7, so that the distance measuring machine 3 measures the distance from the distance measuring machine 3 to the surface of the calibration profile 7. And adjusting the height of the distance measuring machine 3 to ensure that the calibration section 7 does not exceed the measuring range of the distance measuring machine 3 in the calibration elevation range.
(3) Determining object coordinates of a distance measuring machine 3
During actual calibration, the object coordinates of all points on the surface of the current calibration profile 7 can be directly obtained through the read distance measuring machine 3 value.
(4) Start of collection
The two electric lifting mechanisms 6 synchronously and slowly ascend, the distance measuring machine 3 measures at high frequency, and the camera 4 shoots at a certain frequency. The camera 4 shoots through a trigger signal sent by the controller 2, and simultaneously, a path of the signal is divided to a data acquisition card of the distance measuring machine 3, so that the data acquisition card extracts the value of the distance measuring machine 3 at the moment.
(5) Matching data
At regular intervals, a camera shoots the surface of the calibrated section bar to obtain the image space coordinate of a certain light spot on the line structured light, and the object space coordinate of the light spot on the calibrated section bar is measured by a distance measuring machine; and matching the object space coordinates of the calibration sectional material 7 with the section information shot by the camera 4 in real time, namely assigning the object space coordinates of the calibration sectional material 7 to pixel points corresponding to a pixel table of the camera 4, and finishing the value taking process by the assigned pixel points. Every certain time interval means that the calibration sectional material vertically moves for a certain step length by the time interval, and the corresponding displacement of the certain step length on the camera target surface is less than or equal to the height of one camera pixel point. Therefore, at least one or more structured light points corresponding to each pixel point of the camera 4 are used for acquiring data.
(6) Varying acquisition frequency
The electric lifting mechanism 6 is lifted for a certain stroke and then is lowered by setting parameters of the controller 2, the lowering speed is consistent with the lifting speed, and meanwhile, the camera 4 and the range finder 3 take values synchronously. After the light spot is descended, the light spot is ascended and descended in a reciprocating mode, the two electric lifting mechanisms 6 ascend and descend at different speeds, the speeds of the two electric lifting mechanisms are changed in a disordered mode, and the shooting frequency of the camera is changed accordingly, so that the light spot with the largest structure can be shot.
(7) End of collection
When the value of a certain pixel point is finished, the pixel point does not take the value any more; when an abnormal value which does not accord with the rule is found, the calibration value is considered to be unreliable, and the pixel point needs to be subjected to value re-calibration; and when all the pixel points are evaluated, the system stops collecting and the electric lifting mechanism 6 also stops running.
(8) Data processing
After the collection is finished, averaging the multiple groups of values of each pixel point to be used as the point calibration value, and finally obtaining the object space coordinate corresponding to each pixel point of the camera 4, and completing the calibration of the measurement system.
It can be seen that the outstanding features of the invention are:
the calibration method comprises the following steps: a full-automatic calibration method. The elevation of the measured object is continuously and automatically changed by the electric lifting mechanism 6, the accurate elevation value of the surface of the measured object is measured in real time by the distance measuring machine 3, the measured object is shot by the camera 4 at a certain frequency and matched with the elevation value of the distance measuring machine, the object space coordinate of the measured object can be calculated by the elevation value of the distance measuring machine 3, and finally the object space coordinate of the measured object and the shot image space coordinate of the camera 4 are assigned correspondingly to achieve pixel point calibration.
And (3) calibration mode: and (4) calibrating the whole pixels. The elevation change of the measured object is realized by utilizing the electric lifting mechanism 6, the measured object is shot by the camera 4 at a certain frequency, the elevation resolution of the measured object shot by the camera 4 can be ensured to be smaller than the elevation value corresponding to one pixel point of the camera 4 by the lifting speed of the electric lifting mechanism 6 and the shooting frequency of the camera 4, and then all pixel points on the target surface of the camera 4 can be ensured to be directly assigned and calibrated, namely, full-pixel calibration is achieved, and the calibration error caused by the fact that the calibration values are obtained by interpolation calculation of the pixel points is avoided.
Finally, it should be noted that the above-mentioned embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, which should be covered by the claims of the present invention.