Calibration block, profilometer calibration method, device, equipment and storage medium
By using calibration blocks and image acquisition equipment with different shapes, the low-cost and simple calibration of the profiler is achieved, and the problems of high calibration costs and complex processes in the prior art are solved, and calibration efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411960453.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The existing contour calibration methods require high-precision lifting or translational platforms, resulting in high calibration costs and complex processes.
A calibration block is provided, which includes a plurality of calibration parts arranged in the same direction. The first calibration part and the second calibration part have different shapes. The calibration block is performed by the calibration block, and multiple images are collected by an image acquisition device. Based on the shape and image information of the calibration block, the initial calibration coordinates and the target camera imaging model are determined to complete the calibration of the contour.
A low-cost and simple calibration process is realized, reducing dependence on high-precision lifting platforms or translation platforms, and improving calibration efficiency and accuracy.
Smart Images

Figure CN119374539B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision technology, and in particular to a calibration block, a profilometer calibration method, a device, a equipment and a storage medium. Background Art
[0002] In the field of optical measurement, the profilometer is a precision measuring device, and its accuracy is crucial to obtaining high-quality measurement data. When the measurement accuracy of the profilometer is inaccurate, it will directly affect the validity and reliability of the collected data. In order to ensure the measurement accuracy of the profilometer, a series of standard procedures and methods are usually used to establish the conversion relationship between the pixel coordinate system in the image and the camera coordinate system to ensure the accuracy and reliability of measurement and control. This process is called "calibration".
[0003] The commonly used calibration scheme in the related art is to use a wedge-shaped calibration block for calibration, or to use a grid line ruler for calibration. The calibration block is scanned by translating the translation stage or raising and lowering the lifting stage to complete the calibration of the camera model and the light plane. However, this method also requires a high-precision lifting stage or translation stage to more accurately obtain the coordinates of the calibration points, which makes the calibration cost higher. Summary of the invention
[0004] The present application provides a calibration block, a profilometer calibration method, an apparatus, a device and a storage medium, which are used to provide a calibration block with low calibration cost and simple calibration method, and a profilometer calibration method using the calibration block for calibration.
[0005] A first aspect of an embodiment of the present application provides a calibration block, comprising: a plurality of calibration parts arranged along the same direction, the plurality of calibration parts comprising a first calibration part and a plurality of second calibration parts, and a shape of the first calibration part is different from a shape of the second calibration part.
[0006] In the calibration block provided in the embodiment of the present application, the first calibration part and the plurality of second calibration parts are arranged in the same direction, and the shape of the first calibration part is different from the shape of the second calibration part. In this way, when calibrating the profiler, the contour point corresponding to the first calibration part can be determined based on the shape of the first calibration part in the contour line formed by the intersection of the light plane emitted by the profiler and the calibration block, and then the corresponding relationship of other contour points can be obtained by combining the positional relationship between the first calibration part and the second calibration part, so that the profiler can be calibrated. It can be seen that the calibration block provided in the embodiment of the present application can complete the calibration without the need for a high-precision lifting platform or translation platform, etc., so the calibration cost is low and the calibration method is relatively simple.
[0007] In combination with the first implementation manner of the first aspect, along the arrangement direction of the multiple marking portions, at least one side surface of the second marking portion includes an inclined surface.
[0008] A second aspect of an embodiment of the present application provides a profilometer calibration method, which is based on the calibration block provided by the first method and its possible implementation method for calibration, including: when the calibration block is located in multiple placement positions, respectively collecting multiple images of the calibration block irradiated by light emitted by the profilometer through an image acquisition device; wherein the calibration block includes multiple calibration parts arranged along the same direction, the multiple calibration parts include a first calibration part and multiple second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part; based on the position of the first calibration part on the calibration block and the pixel coordinates of the contour points of the calibration block of each image in the multiple images , determine the initial calibration coordinates corresponding to multiple calibration block contour points, the initial calibration coordinates are the coordinates of the calibration block contour points in the calibration block coordinate system where the calibration block is located; based on the pixel coordinates corresponding to the multiple calibration block contour points and the initial calibration coordinates, solve the parameters in the initial camera imaging model to obtain the target camera imaging model; the target camera imaging model is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and convert the coordinates in the camera coordinate system into pixel coordinates; based on the target camera imaging model, determine the target transformation relationship to calibrate the profilometer; the target transformation relationship is the transformation relationship from pixel coordinates to coordinates in the camera coordinate system.
[0009] The contour meter calibration method provided in the embodiment of the present application only needs to obtain multiple images of the calibration block in multiple placement positions, and can determine the first transformation relationship from the calibration block coordinate system to the camera coordinate system and the transformation relationship from the camera coordinate system to the pixel coordinate system in the image at each placement position of the calibration block according to the contour information in the image and the position of the first calibration part in the calibration block, and then obtain the target transformation relationship from the pixel coordinates to the coordinates in the camera coordinate system to complete the calibration of the contour meter. The calibration can be completed without the need for equipment such as a high-precision lifting platform or a translation platform, the required cost is low, and the calibration process is relatively simple, and the calibration of the contour meter can be completed quickly.
[0010] In combination with the first implementation method of the second aspect, the second calibration part has an inclined surface, and each inclined surface has a corresponding plane equation; based on the pixel coordinates corresponding to the multiple calibration block contour points and the initial calibration coordinates, the parameters in the initial camera imaging model are solved to obtain the target camera imaging model, including: for each calibration block contour point, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, the first error corresponding to the calibration block contour point is determined; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; based on the initial calibration coordinates corresponding to the calibration block contour point and the plane equation of the inclined surface corresponding to the initial calibration coordinates in the calibration block, the second error corresponding to the calibration block contour point is determined; the second error is used to represent the degree of deviation of the initial calibration coordinates from the plane equation of the inclined surface; based on the first errors and second errors corresponding to the multiple calibration block contour points, the parameters in the initial camera imaging model are solved and the initial calibration coordinates corresponding to the calibration block contour point are corrected to obtain the target camera imaging model.
[0011] In combination with a second implementation of the second aspect, based on the pixel coordinates corresponding to the plurality of calibration block contour points and the initial calibration coordinates, the parameters in the initial camera imaging model are solved to obtain a target camera imaging model, including: for each calibration block contour point, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determining a first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; based on the initial calibration coordinates corresponding to the calibration block contour point and the initial calibration coordinates to be determined Solve the light plane equation to determine the third error corresponding to the calibration block contour point; the light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the calibration block contour point relative to the light plane equation; based on the first errors and third errors corresponding to multiple calibration block contour points, solve the initial camera imaging model and the parameters in the light plane equation to be solved to obtain the target camera imaging model and the light plane equation; determine the target transformation relationship based on the target camera imaging model, including: determine the target transformation relationship based on the target camera imaging model and the light plane equation.
[0012] In combination with a third implementation method of the second aspect, the second calibration part has an inclined surface, and each inclined surface has a corresponding plane equation; based on the pixel coordinates corresponding to multiple calibration block contour points and the initial calibration coordinates, the parameters in the initial camera imaging model are solved to obtain the target camera imaging model, including: for each calibration block contour point, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determining the first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; based on the initial calibration coordinates corresponding to the calibration block contour point and the plane equation of the inclined surface corresponding to the initial calibration coordinates in the calibration block, determining the second error corresponding to the calibration block contour point; the second error is used to represent The degree of deviation of the initial calibration coordinates relative to the plane equation of the inclined plane; based on the initial calibration coordinates corresponding to the calibration block contour points and the light plane equation to be solved, determine the third error corresponding to the calibration block contour points; the light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the calibration block contour points relative to the light plane equation; based on the first error, the second error and the third error corresponding to the multiple calibration block contour points, solve the parameters in the initial camera imaging model and the light plane equation to be solved, and correct the initial calibration coordinates corresponding to the calibration block contour points to obtain the target camera imaging model and the light plane equation; determine the target transformation relationship based on the target camera imaging model, including: determining the target transformation relationship based on the target camera imaging model and the light plane equation.
[0013] In combination with a fourth implementation method of the second aspect, the target camera imaging model includes a calibration block extrinsic parameter and a first transformation relationship; wherein each placement posture corresponds to a calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first transformation relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates; determining the target transformation relationship based on the target camera imaging model, including: determining the coordinates of multiple calibration block contour points in the camera coordinate system based on the calibration block extrinsic parameters corresponding to the initial calibration coordinates corresponding to multiple calibration block contour points and the placement postures corresponding to the calibration block contour points; constructing a light plane equation corresponding to the light plane formed by the light emitted by the contour meter based on the coordinates of the multiple calibration block contour points in the camera coordinate system; determining the target transformation relationship based on the light plane equation and the first transformation relationship.
[0014] In combination with the fifth implementation method of the second aspect, a target transformation relationship is determined based on the light plane equation and the first transformation relationship, including: for any pixel coordinate in the image, a first equation for the pixel coordinate and the camera coordinate is established based on the first transformation relationship; a second equation corresponding to the camera coordinate is established based on the light plane equation; the first equation and the second equation are solved together to obtain the camera coordinate in the camera coordinate system corresponding to the pixel coordinate; and the target transformation relationship is determined based on the coordinates in the camera coordinate system corresponding to multiple pixel coordinates in the image.
[0015] In combination with a sixth implementation method of the second aspect, the target camera imaging model includes a calibration block extrinsic parameter and a first transformation relationship; wherein each placement posture corresponds to a calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first transformation relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates; the target transformation relationship is determined based on the target camera imaging model and the light plane equation, including: for any pixel coordinate in the image, establishing a first equation between the pixel coordinate and the camera coordinate based on the first transformation relationship; establishing a second equation corresponding to the camera coordinate based on the light plane equation; solving the camera coordinates by combining the first equation and the second equation to obtain the camera coordinates in the camera coordinate system corresponding to the pixel coordinates; determining the target transformation relationship based on the coordinates in the camera coordinate system corresponding to multiple pixel coordinates in the image.
[0016] According to a third aspect of an embodiment of the present application, there is provided a profilometer calibration device, comprising: an acquisition module, for acquiring, by means of an image acquisition device, a plurality of images of a calibration block irradiated by light emitted by a profilometer when a calibration object is respectively located at a plurality of placement positions; wherein the calibration block comprises a plurality of calibration parts arranged in the same direction, the plurality of calibration parts comprising a first calibration part and a plurality of second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part; and a determination module, for determining, based on the position of the first calibration part on the calibration block and the pixel coordinates of the calibration block contour points of each image in the plurality of images, the initial values corresponding to the contour points of the plurality of calibration blocks; Calibration coordinates, the initial calibration coordinates are the coordinates of the calibration block contour points in the calibration block coordinate system where the calibration block is located; a solution module is used to solve the parameters in the initial camera imaging model based on the pixel coordinates corresponding to multiple calibration block contour points and the initial calibration coordinates to obtain a target camera imaging model; the target camera imaging model is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and convert the coordinates in the camera coordinate system into pixel coordinates; a calibration module is used to determine a target transformation relationship based on the target camera imaging model to calibrate the profilometer; the target transformation relationship is a transformation relationship from pixel coordinates to coordinates in the camera coordinate system.
[0017] A fourth aspect of an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; wherein the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the profilometer calibration method provided in the second aspect and its possible implementation methods.
[0018] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are run on a computer, the computer executes the profilometer calibration method provided by the second aspect and its possible implementation methods.
[0019] A sixth aspect of an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the profilometer calibration method provided in the second aspect and its possible implementation methods.
[0020] Among them, the beneficial effects described in the third to sixth aspects can refer to the beneficial effect analysis of the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.
[0022] Figure 1 A structural schematic diagram of a profilometer calibration system provided in an embodiment of the present application;
[0023] Figure 2 A method flow of a profilometer calibration method provided in an embodiment of the present application Figure 1 ;
[0024] Figure 3 A schematic cross-sectional view of a calibration block provided in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of a contour line provided in an embodiment of the present application;
[0026] Figure 5 A method flow of a profilometer calibration method provided in an embodiment of the present application Figure 2 ;
[0027] Figure 6 A schematic diagram of imaging of a Sham camera provided in an embodiment of the present application;
[0028] Figure 7A schematic diagram of the imaging difference between a Sham camera and an ordinary camera provided in an embodiment of the present application;
[0029] Figure 8 A schematic diagram of the structure of a profilometer calibration device provided in an embodiment of the present application;
[0030] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0032] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0033] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "connected" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances. In addition, when describing a pipeline, the "connected" and "connection" used in this application have the meaning of conduction. The specific meaning needs to be understood in conjunction with the context.
[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0035] In the field of optical measurement, profilometer calibration is a key step to ensure measurement accuracy and reliability. The main purpose of calibration is to eliminate errors caused by the system itself (such as lens distortion, uneven pixel size, etc.) or environmental factors (such as lighting changes) to ensure that the profile data extracted from the image can truly reflect the actual shape and size of the object being measured.
[0036] The calibration process involves establishing an accurate correspondence between the pixel position in the image and the actual physical space position, so as to achieve accurate measurement of the contour of the object being measured. Usually, a calibration block with known geometric characteristics (such as a circular array, a linear array, or a grid plate) is used as a calibration reference, and then the accurate correspondence between the pixel position and the actual physical space position is obtained through image acquisition, parameter calculation, and error evaluation.
[0037] In the related art, line laser or profilometer calibration uses a checkerboard to calibrate the camera intrinsic parameters and the light plane intrinsic parameters. However, the checkerboard itself requires a relatively large depth of field to observe the entire calibration plate in its entirety. Usually, the profilometer is designed for Shaper imaging, and the lens depth of field is small, so the checkerboard calibration plate cannot be photographed, resulting in poor calibration results.
[0038] Another calibration scheme is to use a wedge-shaped calibration block and scan the calibration pattern by translating the translation stage, such as Figure 1 As shown, the camera model and light plane are calibrated. This calibration plate requires a high-precision translation stage to be used. Alternatively, a grid line ruler combined with a high-precision lifting stage can be used to avoid camera model calibration and directly calibrate the lookup table. However, both methods require a high-precision lifting stage or translation stage to more accurately obtain the coordinates of the calibration points, which makes the calibration cost high.
[0039] Based on this, an embodiment of the present application provides a calibration block and a profilometer calibration method using the calibration block for calibration, wherein the calibration block includes a plurality of calibration parts arranged in the same direction, the plurality of calibration parts include a first calibration part and a plurality of second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part. In this way, when the calibration block is used to calibrate the profilometer, light can be emitted to the calibration block and an image can be collected by the profilometer when the calibration object is located in a plurality of placement positions. Then, based on the position of the first calibration part in the collected image and the position of the first calibration part in the calibration block, the pixel coordinates and initial calibration coordinates corresponding to the contour points of the plurality of calibration blocks are determined. It should be understood that the initial calibration coordinates are the coordinates of the contour points of the calibration block in the calibration block coordinate system where the calibration block is located.
[0040] Then, based on the pixel coordinates corresponding to the contour points of the multiple calibration blocks and the initial calibration coordinates, the parameters in the initial camera imaging model can be solved to obtain a target camera imaging model that can convert the initial calibration coordinates into coordinates in the camera coordinate system, and convert the coordinates in the camera coordinate system into pixel coordinates. Finally, the solution of the present application can determine the target conversion relationship from pixel coordinates to coordinates in the camera coordinate system based on the target camera imaging model to complete the calibration of the profilometer.
[0041] It can be seen that the solution provided by the embodiment of the present application only needs to obtain multiple images of the calibration block in multiple placement positions, and can determine the initial calibration coordinates corresponding to the contour points of the multiple calibration blocks according to the contour information in the image and the position of the first calibration part in the calibration block, and then determine the target camera imaging model for converting the initial calibration coordinates to the coordinates in the camera coordinate system according to the pixel coordinates corresponding to the contour points of the multiple calibration blocks and the initial calibration coordinates, and convert the coordinates in the camera coordinate system to pixel coordinates, and then obtain the target conversion relationship from pixel coordinates to coordinates in the camera coordinate system to complete the calibration of the profilometer. The calibration can be completed without the need for high-precision equipment such as a lifting platform or a translation platform, the required cost is low, and the calibration process is relatively simple, and the calibration can be completed quickly.
[0042] It should be understood that the profilometer calibration method provided in this application can be applied to a profilometer calibration system, such as Figure 1 As shown, the profilometer calibration system 100 includes: a profilometer 11 , an image acquisition device 12 and a profilometer calibration device 13 .
[0043] Among them, the profilometer 11, also known as a profilometer, is a precision measuring instrument, which is mainly used to test and inspect the contour, two-dimensional size, and two-dimensional displacement of an object. It mainly uses optical principles, such as using lasers, white light or other light sources of specific wavelengths to emit light to the object to be measured. Then, the image information after the light emitted by the profilometer is irradiated to the surface of the object to be measured is captured by an image acquisition device, and then the contour information, height information, roughness and other parameters of the surface of the object to be measured are extracted to obtain the three-dimensional morphology information of the surface of the object to be measured. These technologies have the advantages of non-contact, high precision, and high efficiency, and can complete the determination of the physical coordinates of the contour of the object to be measured without damaging the surface to be measured, and then obtain the corresponding size and other information.
[0044] It should be noted that the profilometer 11 and the image acquisition device 12 may be an integrated device or two separate devices with a communication connection, and the embodiment of the present application does not limit this.
[0045] It should be understood that the image acquisition device 12 in the embodiment of the present application can be an ordinary camera or a Sham camera, and the embodiment of the present application does not limit this.
[0046] Among them, the Sham camera works based on Sham's law, that is, when the extended planes of the three planes, the object plane, the image plane, and the lens plane, intersect in a straight line, a comprehensive and clear image can be obtained. This feature enables the Sham camera to expand the depth of field in the profilometer application, thereby maintaining the clarity of the image within a larger measurement range. This is especially important for profilometers that need to measure complex shapes or large-sized objects, which can ensure that accurate data can be obtained throughout the measurement area.
[0047] It should be understood that the imaging principle of the Sham camera and the ordinary camera is pinhole imaging, and the difference is only in the conversion process during the imaging process, but the conversion relationship of the coordinate system of the corresponding camera imaging model is similar. Based on this, for the convenience of description, the embodiment of the present application takes the image acquisition device 12 as an ordinary camera as an example for explanation.
[0048] In the embodiment of the present application, the profiler calibration device 13 may be an electronic device, such as a personal computer (PC), a laptop computer, a mobile device, a tablet computer, a laptop computer, etc. The embodiment of the present application does not limit the specific form of the electronic device. Alternatively, the profiler calibration device 13 may also be a separate server, or a server cluster composed of multiple servers. In some implementations, the server cluster may be a distributed cluster server. The embodiment of the present application does not impose any restrictions on the specific form of the model training device.
[0049] It should be pointed out that Figure 1 The structure shown does not constitute a limitation on the profilometer calibration system 100. In other embodiments, the system may include fewer or more components than shown in the figure, or a combination of certain components, or a different arrangement of components. The embodiment of the present application does not impose any limitation on this.
[0050] It should be understood that the profilometer calibration method provided in the embodiment of the present application can be applied to Figure 1 The profiler calibration device 13 in the profiler calibration system 100 shown in FIG. Figure 2 The profilometer calibration method provided in the embodiment of the present application comprises the following steps:
[0051] S201. When the calibration object is located at a plurality of positions, a plurality of images of the calibration block irradiated by the light emitted by the profilometer are respectively captured by an image capture device.
[0052] The calibration block includes a plurality of calibration parts arranged in the same direction, the plurality of calibration parts include a first calibration part and a plurality of second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part.
[0053] It is understandable that in order to facilitate the calibration of the profilometer, the calibration block usually needs to have clear edges, known size and shape so that it can be accurately measured and compared. This ensures that the light emitted by the profilometer can be evenly and clearly irradiated on the calibration object, so that the image acquisition device can clearly capture the contour of the calibration block.
[0054] As a feasible implementation method, Figure 3 As shown, the arrangement direction of multiple calibration parts in the calibration block is as follows Figure 3As shown by the arrow in the middle, the cross section of the first marking portion 10 can be a triangle with different heights or an arc shape, and the cross section of the second marking portion 20 ( Figure 3 The cross section of the second marking portion is only exemplary (the second marking portion is only exemplary) can be a triangular sawtooth shape. For example, see Figure 4 ,During calibration, the light emitted by the profilometer shines on the calibration block, and the light plane intersects with the contour of the calibration block to form a zigzag ,contour line.
[0055] It can be understood that by placing the calibration block in different positions and collecting images, more feature points and information can be captured, so that the conversion relationship between coordinate systems can be more comprehensively determined during calibration, reducing the error caused by a single posture.
[0056] S202: Determine initial calibration coordinates corresponding to a plurality of calibration block contour points based on a position of the first calibration unit on the calibration block and pixel coordinates of the calibration block contour points of each of the plurality of images.
[0057] The initial calibration coordinates are the coordinates of the calibration block contour points in the calibration block coordinate system where the calibration block is located.
[0058] It is understandable that the light emitted by the profilometer will form a contour line when it shines on the calibration block. One or more contour points of the calibration block can be selected from the contour line, and then their corresponding pixel coordinates can be obtained from the image.
[0059] As a feasible implementation method, the center of gravity (COG) method can be used to extract the center point in the image, and then obtain the contour line of the calibration block, and then select multiple calibration block contour points in the contour line. The COG method is a commonly used method in image processing, machine vision, and object recognition. It determines the center point by calculating the weighted average position of pixels in the area.
[0060] like Figure 3 As shown, in the calibration block provided by the embodiment of the present application, the shape of the first calibration part 10 is different from the shape of the second calibration part 20, so that the contours corresponding to the first calibration part and the second calibration part in the acquired image are also different, and then the positional relationship between the calibration contour point and the first calibration part can be determined according to the position of the calibration contour point in the image and the position of the contour of the first calibration part in the image, and then the initial calibration coordinates of the calibration contour point in the calibration block coordinate system can be identified in combination with the position of the first calibration part in the calibration block.
[0061] S203 , based on the pixel coordinates corresponding to the contour points of the plurality of calibration blocks and the initial calibration coordinates, solving the parameters in the initial camera imaging model to obtain the target camera imaging model.
[0062] Among them, the camera imaging model is a core concept in computer vision and photogrammetry, which describes the mapping relationship between points in the three-dimensional world and the two-dimensional image plane. This model is usually based on the pinhole imaging principle and is also called the pinhole imaging model. The target camera imaging model provided in the embodiment of the present application is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and convert the coordinates in the camera coordinate system into pixel coordinates.
[0063] It can be understood that the initial calibration coordinates refer to the coordinates in the calibration block coordinate system. Even for the same calibration block contour point in the calibration block, its position in the camera coordinate system is different when the calibration block is in different placement positions. Therefore, when the target camera imaging model converts the initial calibration coordinates into coordinates in the camera coordinate system, it is necessary to consider the placement position of the calibration block corresponding to the calibration block contour point. Based on this, the target camera imaging model in the embodiment of the present application may include a calibration block extrinsic parameter and a first conversion relationship; wherein each placement position corresponds to a calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first conversion relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates.
[0064] That is, when the calibration block is in each placement position, it corresponds to a calibration block extrinsic parameter. It can be understood that the calibration block extrinsic parameters are mainly used to describe the relative position and posture between the camera coordinate system and the calibration block coordinate system. As a feasible implementation method, the calibration block extrinsic parameters may include: rotation matrix (Rotation Matrix, R) and translation vector (Translation Vector, t), that is, the calibration block extrinsic parameters can be expressed as [R, T]. Among them, the rotation matrix can be a 3x3 matrix, which describes the rotation of the camera coordinate system relative to the calibration block coordinate system. The translation vector is a 3x1 vector, which is used to describe the position of the origin of the camera coordinate system in the calibration block coordinate system. The calibration block extrinsic parameters can be used to convert the initial calibration coordinates into coordinates in the camera coordinate system.
[0065] Furthermore, the coordinate transformation between the camera coordinate system and the pixel coordinate system needs to go through the image coordinate system, that is, when performing the coordinate transformation, it is necessary to first transform from the camera coordinate system to the image coordinate system, and then from the image coordinate system to the pixel coordinate system. Among them, the camera coordinate system (C): takes the optical center of the camera as the origin, the optical axis as the Z axis, and the X axis and Y axis are parallel to the image plane. The image coordinate system (I): is located inside the camera, with the origin at the center of the image plane, and the X axis and Y axis are parallel to the X axis and Y axis of the camera coordinate system, respectively. The pixel coordinate system (P): takes the upper left corner of the image as the origin, and the u axis and v axis are parallel to the X axis and Y axis of the image coordinate system, respectively, but usually in pixels.
[0066] Exemplarily, the target camera imaging model can be expressed by the following formula (1):
[0067] Formula (1).
[0068] in, Where u and v are pixel coordinates in the image, 1 is a homogeneous coordinate used for matrix multiplication; s is the effect of the projection (i.e., the Z-axis coordinate in the camera coordinate system) on the size of the object in the image; K is the camera's intrinsic parameter matrix, which contains information such as the camera's focal length, the pixel's aspect ratio, and the image center; {D} represents the effect of the camera's distortion on the coordinate transformation; To calibrate the block external parameters; In , and Used to represent the coordinates in the calibration block coordinate system, 1 is the homogeneous coordinate.
[0069] As a feasible implementation method, in the actual application process, the target camera imaging model can be divided into a first transformation relationship and a calibration block external parameter. The first transformation relationship can transform the coordinates in the camera coordinate system into pixel coordinates through the following formula (2).
[0070] Formula (2).
[0071] in, The x, y, and z in the image are used to represent the coordinates in the camera coordinate system, and 1 is the homogeneous coordinate.
[0072] In the embodiment of the present application, the initial calibration coordinates corresponding to the calibration block contour points can be converted into coordinates in the camera coordinate system through the calibration block extrinsic parameters in the initial camera imaging model, and then the coordinates in the camera coordinate system can be converted into pixel coordinates through the first transformation relationship in the initial camera imaging model to obtain the predicted pixel coordinates corresponding to the calibration block contour points, and then the parameters in the target camera imaging model can be solved according to the pixel coordinates corresponding to the calibration block contour points and the predicted pixel coordinates, so as to obtain a relatively accurate target camera imaging model, that is, the calibration block extrinsic parameters and the first transformation relationship corresponding to each placement posture are obtained.
[0073] S204: Determine a target conversion relationship based on the target camera imaging model to calibrate the profilometer.
[0074] The target transformation relationship is the transformation relationship from pixel coordinates to coordinates in the camera coordinate system.
[0075] It is understandable that since each pixel coordinate may be the position in the image after the light emitted by the profilometer illuminates the object to be measured, determining the target transformation relationship is to determine the coordinates of each pixel coordinate in the camera coordinate system.
[0076] In some embodiments, since the pixel coordinates are known, the target camera imaging model is also known, but the coordinates corresponding to the pixel coordinates in the camera coordinate system are unknown, the coordinates in the camera coordinate system can be obtained by establishing equations for solving. However, since the coordinates in the camera coordinate system have multiple unknowns (x, y, z), multiple equations need to be established for solving.
[0077] As a feasible implementation method, since the light emitted by the profilometer will form a light plane in space, there is a corresponding light plane equation. This plane is closely related to the camera coordinate system, because the camera imaging process is to capture the projection of these light rays on the imaging plane.
[0078] Therefore, in practical applications, based on the light plane equation and the target camera imaging model, a set of equations with unknown variables as the coordinates in the camera coordinate system can be established. By solving the set of equations, the coordinates of each pixel coordinate in the camera coordinate system can be obtained, and then the target transformation relationship can be obtained.
[0079] After obtaining the target transformation relationship, when using the profilometer to reconstruct the point cloud, the coordinates of the contour of the measured object in the camera coordinate system can be determined based on the pixel coordinates of the contour line of the measured object and the target transformation relationship.
[0080] It can be seen that the solution provided by the embodiment of the present application only needs to obtain multiple images of the calibration block in multiple placement positions, and can determine the first transformation relationship from the calibration block coordinate system to the camera coordinate system and the transformation relationship from the camera coordinate system to the pixel coordinate system in the image at each placement position according to the contour information in the image and the position of the first calibration part in the calibration block, and then obtain the target transformation relationship from the pixel coordinates to the coordinates in the camera coordinate system to complete the calibration of the profilometer. The calibration can be completed without the need for high-precision lifting platforms or translation platforms, the required cost is low, and the calibration process is relatively simple, and the calibration of the profilometer can be completed quickly.
[0081] In some embodiments, during the correction of the initial camera imaging model, there may be some deviations because the light emitted by the profilometer when irradiating the calibration block and the image acquisition device when acquiring images cannot be guaranteed to be completely vertical, resulting in the initial calibration coordinates of the calibration block contour points being acquired with low accuracy and may differ from the actual calibration coordinates. In addition, when using the initial calibration coordinates to solve the parameters of the target camera imaging model, the accuracy may be insufficient.
[0082] Based on this, as a feasible implementation method, the calibration block provided in the embodiment of the present application has at least one side surface of the second calibration part including an inclined surface along the arrangement direction of the multiple calibration parts. It can be understood that the inclined surface in this embodiment refers to a plane inclined to the arrangement direction of the multiple calibration parts, and in the calibration block coordinate system, each inclined surface has a corresponding plane equation.
[0083] For example, Figure 3 As shown, the arrangement direction of multiple calibration parts is as follows Figure 3 As shown by the middle arrow, the second calibration portion 20 may be sawtooth-shaped, with two inclined surfaces on its surface, and each inclined surface has a corresponding plane equation relative to the calibration block coordinate system.
[0084] It can be understood that if the initial physical coordinates corresponding to the calibration block contour points are accurate, then they can completely conform to the plane equation of the inclined plane to which the calibration block contour points belong. Therefore, the degree of deviation of the initial physical coordinates can be determined based on the plane equation of the inclined plane to which the calibration block contour points belong.
[0085] Specifically, as a feasible implementation method, S203 can be specifically implemented as the following steps:
[0086] S211 . For each calibration block contour point, determine a first error corresponding to the calibration block contour point based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates, as well as an initial camera imaging model.
[0087] The first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the contour points of the calibration block.
[0088] As a feasible implementation method, the first error can be determined by the following formula (3):
[0089] Formula (3).
[0090] in, is the first error. The meanings of other parameters can be found in the above formulas (1) and (2), and the embodiments of the present application will not be repeated here.
[0091] S212: Determine a second error corresponding to the calibration block contour point based on the initial calibration coordinates corresponding to the calibration block contour point and a plane equation of the inclined plane corresponding to the initial calibration coordinates in the calibration block.
[0092] The second error is used to indicate the degree of deviation of the initial calibration coordinates from the plane equation of the inclined plane.
[0093] For example, the plane equation of the inclined plane may be: .in, , and is a constant, which is also the parameter of the plane equation of inclined plane i.
[0094] As a feasible implementation method, the second error can be determined by the following formula (4):
[0095] Formula (4).
[0096] in, is the second error, are the parameters of the plane equation of the inclined plane i corresponding to the calibration block contour point.
[0097] S213, based on the first errors and second errors corresponding to the contour points of the multiple calibration blocks, the initial camera imaging model, the first transformation relationship and the initial calibration coordinates corresponding to the contour points of the calibration blocks are corrected to obtain the target camera imaging model and the first transformation relationship corresponding to each placement posture.
[0098] After obtaining the first error and the second error corresponding to multiple calibration block contour points, the initial camera imaging model, the first transformation relationship and the initial calibration coordinates corresponding to the calibration block contour points can be corrected by minimizing the first error and the second error to obtain the target camera imaging model and the first transformation relationship corresponding to each placement posture.
[0099] As a feasible implementation method, it can be corrected through a variety of nonlinear optimization methods, such as: Gradient Descent, a method of finding the minimum value of a function through iteration. In each iteration, it moves a certain step length in the opposite direction of the gradient of the objective function (first error and second error) at the current point (that is, the direction in which the function value increases the fastest) to approach the minimum point of the function. Or, the Gauss-Newton Method, which is mainly used to solve nonlinear least squares problems, Taylor expands the objective function (usually the sum of squared errors), ignores second-order and higher terms, and then updates the parameter value by solving linear equations.
[0100] In other embodiments, since the calibration block contour points are still on the light plane corresponding to the light emitted by the profilometer, the coordinates of the calibration block contour points in the camera coordinate system also satisfy the light plane equation. Based on this, the light plane equation to be solved can be established, and the initial camera imaging model and the light plane equation to be solved can be solved by the calibration block contour points to obtain the target camera imaging model.
[0101] As a feasible implementation method, S203 can be specifically implemented as the following steps:
[0102] S221 . For each calibration block contour point, determine a first error corresponding to the calibration block contour point based on a pixel coordinate corresponding to the calibration block contour point, an initial calibration coordinate, and an initial camera imaging model.
[0103] The first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the contour points of the calibration block.
[0104] It should be understood that the method for determining the first error can refer to the above embodiment, and this application will not elaborate on it.
[0105] S222: Determine a third error corresponding to the calibration block contour point based on the initial calibration coordinates corresponding to the calibration block contour point and the light plane equation to be solved.
[0106] The light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the contour points of the calibration block relative to the light plane equation.
[0107] The light emitted by the profilometer will form a light plane in space. After it is irradiated on the calibration block, it will form a contour line with the contour of the calibration block. The calibration block contour points on it belong to both the calibration block coordinate system and the light plane. Therefore, the third error corresponding to the calibration block contour points can be determined based on the plane equation corresponding to the light plane.
[0108] Specifically, the light plane equation can be: .in, , and is a constant, i.e., a parameter of the light plane equation. The third error can be determined by the following formula (5):
[0109] Formula (5).
[0110] in, is the third error, are the parameters of the light plane equation.
[0111] S223 . Solve the parameters in the initial camera imaging model and the light plane equation to be solved based on the first errors and the third errors corresponding to the contour points of the multiple calibration blocks to obtain the target camera imaging model and the light plane equation.
[0112] After obtaining the first error and the third error corresponding to the contour points of the multiple calibration blocks, the parameters in the initial camera imaging model and the light plane equation to be solved can be solved by minimizing the errors to obtain the target camera imaging model and the light plane equation.
[0113] It can be understood that after solving the light plane equation, the target conversion relationship can be determined based on the target camera imaging model and the light plane equation. The specific implementation method can refer to the following embodiments, and this application will not go into details here.
[0114] It can be seen that the solution provided in this embodiment can accurately solve the parameters of the target camera imaging model and the light plane equation by minimizing the first error and the third error. This solution process can reduce the deviation caused by manufacturing tolerance, installation error or environmental factors (such as temperature change), thereby obtaining more accurate parameters of the target camera imaging model and the light plane equation, thereby improving the accuracy of the overall system.
[0115] As another feasible implementation method, the initial camera imaging model and the parameters in the light plane equation to be solved can be solved simultaneously by the first error, the second error and the third error, and the initial calibration coordinates corresponding to the calibration block contour points can be corrected.
[0116] That is, S203 can be specifically implemented as the following steps:
[0117] S231 . For each calibration block contour point, determine a first error corresponding to the calibration block contour point based on a pixel coordinate corresponding to the calibration block contour point, an initial calibration coordinate, and an initial camera imaging model.
[0118] The first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the contour points of the calibration block.
[0119] S232: Determine a second error corresponding to the calibration block contour point based on the initial calibration coordinates corresponding to the calibration block contour point and a plane equation of the inclined plane corresponding to the initial calibration coordinates in the calibration block.
[0120] The second error is used to indicate the degree of deviation of the initial calibration coordinates from the plane equation of the inclined plane.
[0121] S233 : Determine a third error corresponding to the calibration block contour point based on the initial calibration coordinates corresponding to the calibration block contour point and the light plane equation to be solved.
[0122] The light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the contour points of the calibration block relative to the light plane equation;
[0123] It should be understood that the calculation method of the first error, the second error and the third error in this embodiment can refer to the above embodiment, and this application will not repeat them here.
[0124] S234. Solve the parameters in the initial camera imaging model and the light plane equation to be solved based on the first error, the second error and the third error corresponding to the contour points of the multiple calibration blocks, and correct the initial calibration coordinates corresponding to the contour points of the calibration blocks to obtain the target camera imaging model and the light plane equation.
[0125] It can be understood that after solving the light plane equation, the target conversion relationship can be determined based on the target camera imaging model and the light plane equation. The specific implementation method can refer to the following embodiments, and this application will not go into details here.
[0126] In some embodiments, since the points on the measured contour of the object obtained by the profilometer during measurement belong to the light plane and satisfy the first transformation relationship in the above-mentioned target camera imaging model, the target transformation relationship can be obtained based on the light plane equation and the camera imaging model.
[0127] As a feasible implementation method, the light plane equation can be determined by obtaining the coordinates of multiple calibration block contour points in the camera coordinate system, and then the target transformation relationship can be obtained. For details, please refer to Figure 5 , S204 can be specifically implemented as follows:
[0128] S501. Determine coordinates corresponding to the multiple calibration block contour points in the camera coordinate system based on initial calibration coordinates corresponding to the multiple calibration block contour points and calibration block extrinsics corresponding to the placement postures corresponding to the calibration block contour points.
[0129] It should be understood that the target camera imaging model includes a calibration block extrinsic parameter and a first conversion relationship; wherein each placement posture corresponds to a calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first conversion relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates. Therefore, the initial calibration coordinates corresponding to the multiple calibration block contour points can be converted by using the calibration block extrinsic parameters corresponding to the placement postures corresponding to the multiple calibration block contour points, so as to obtain the coordinates corresponding to the multiple calibration block contour points in the camera coordinate system.
[0130] S502 : constructing a light plane equation corresponding to the light emitted by the profilometer based on the coordinates of the contour points of the multiple calibration blocks in the camera coordinate system.
[0131] It can be understood that in three-dimensional space, any three non-collinear points can determine a plane. This is because, through these three points, we can construct two non-collinear straight lines (for example, construct straight line AB through points A and B, and construct straight line AC through points A and C), and these two straight lines are coplanar because they have a common point A. Therefore, the plane determined by these two straight lines is the only plane containing these three points. Based on this, the light plane equation can be determined by the coordinates of multiple calibration block contour points (at least three non-collinear calibration block contour points) in the camera coordinate system.
[0132] S503: Determine a target conversion relationship based on the light plane equation and the first conversion relationship.
[0133] It can be understood that the target transformation relationship is the transformation relationship from pixel coordinates to coordinates in the camera coordinate system. Since the pixel coordinates in the image are known, the first transformation relationship in the target camera imaging model is also known, and the coordinates in the camera coordinate system corresponding to the pixel coordinates are unknown, the coordinates in the camera coordinate system can be obtained by establishing equations for solving. However, since the coordinates in the camera coordinate system have multiple unknowns (x, y, z), multiple equations need to be established for solving.
[0134] Since the coordinates in the camera coordinate system need to satisfy the light plane equation, a set of equations with unknowns as the coordinates in the camera coordinate system can be established based on the light plane equation and the target camera imaging model. By solving the set of equations, the coordinates of each pixel coordinate in the camera coordinate system can be obtained, and then the target transformation relationship can be obtained.
[0135] As a feasible implementation method, S503 can be specifically implemented as follows:
[0136] S5031. For any pixel coordinate in the image, establish a first equation between the pixel coordinate and the camera coordinate based on a first conversion relationship.
[0137] Exemplarily, as a feasible implementation method, the first equation can be shown as the following formula (6):
[0138] Formula (6).
[0139] S5032. Establish a second equation corresponding to the camera coordinates based on the light plane equation.
[0140] For example, as a feasible implementation method, the second equation can be shown as the following formula (7):
[0141] Formula (7).
[0142] It should be understood that The light plane equation is: The matrix of coefficients in .
[0143] S5033. Solve the first equation and the second equation simultaneously to obtain the camera coordinates in the camera coordinate system corresponding to the pixel coordinates.
[0144] After the first equation and the second equation are obtained, the first equation and the second equation can be combined to solve the camera coordinates to obtain the camera coordinates in the camera coordinate system corresponding to the pixel coordinates.
[0145] S5034. Determine a target transformation relationship based on coordinates in the camera coordinate system corresponding to multiple pixel coordinates in the image.
[0146] As a feasible implementation method, the target transformation relationship can be the correspondence between pixel coordinates and camera coordinates in the camera coordinate system. When storing, it can be stored in the form of a lookup table. In this way, when reconstructing the point cloud, the camera coordinates in the camera coordinate system corresponding to each pixel coordinate can be determined through the lookup table.
[0147] It can be seen that the solution provided in this embodiment solves the coordinates in the camera coordinate system corresponding to the pixel coordinates by establishing the first equation corresponding to the first conversion relationship in the target camera imaging model and the second equation group corresponding to the light plane equation. When the image pixel coordinates are reversed to the coordinates in the camera coordinate system, the error can be reduced and the accuracy of the coordinates can be improved. At the same time, the light plane equation is used to further constrain the solution process, so that the coordinates in the camera coordinate system obtained are closer to the real value.
[0148] In addition, by converting the target conversion relationship into a mathematical optimization problem or a system of equations, and by using efficient numerical algorithms and optimization techniques, the solution speed can be accelerated and the calculation efficiency can be improved. In practical applications, this means that the profiler calibration can be performed faster to meet application scenarios with high real-time requirements.
[0149] As a feasible implementation method, the light plane equation can be obtained by the method provided in the above embodiment (S221-S223 or S231-S234), and then for any pixel coordinate in the image, a first equation of pixel coordinate and camera coordinate is established based on the first conversion relationship; a second equation corresponding to the camera coordinate is established based on the light plane equation; the first equation and the second equation are combined to solve the camera coordinate to obtain the camera coordinate in the camera coordinate system corresponding to the pixel coordinate; based on the coordinates in the camera coordinate system corresponding to multiple pixel coordinates in the image, the target conversion relationship is determined. The specific process can be referred to the above embodiment, and this application will not be repeated here.
[0150] In some embodiments, the image acquisition device may be a Sham camera. The difference between a Sham camera and an ordinary camera is that the CCD and the lens of the camera are not parallel, and the image can be formed on a special plane, such as Figure 6 As shown, when the extended surfaces of the three surfaces, namely the subject plane (object plane), the image plane (image plane), and the lens plane, intersect at one point, a comprehensive and clear image can be obtained.
[0151] Understandably, see Figure 7 Regardless of whether the lens of the image acquisition device is parallel to the charge-coupled device (CCD), the camera is a pinhole imaging model. When the distortion effect is ignored, the imaging of the Sham camera is actually exactly the same as that of an ordinary camera. Therefore, the main function of the Sham is to change the normalized plane posture of the camera, and the distortion of the camera occurs on the normalized plane.
[0152] Therefore, if a Sham camera is selected as the image acquisition device during the calibration process, the camera imaging model used in the calibration process is the Sham camera imaging model. The two-dimensional Sham angle needs to be introduced into the Sham camera imaging model. Characterizing Sham Imaging Impacts, is the angle between the normal direction of the Sham camera lens and the normal direction of the CCD, The Sham transformation matrix represents the angle between the projection of the lens normal on the CCD and the CCD x axis. The main function of is to map the normalized plane coordinates of the ordinary lens to the normalized plane coordinates of the Sham lens, as shown below:
[0153] .
[0154] Since the Sham angle can characterize the tangential distortion, the Sham camera imaging model can include the three-parameter radial distortion , as shown below:
[0155] .
[0156] In addition, the internal reference of the Sham camera A four-parameter model is selected as follows:
[0157] .
[0158] In summary, the coordinate transformation relationship of the Sham camera imaging model is as follows:
[0159] .
[0160] in, is the world 3D coordinate; Characterize the external parameters between the camera and the world coordinate system; is the camera 3D coordinate, is the normalized coordinate of the CCD parallel plane; Normalized coordinates for the Sham parallel plane; is the Sham normalized coordinate after distortion; is the normalized coordinate of the CCD parallel plane after distortion; This is the imaging coordinate of the Sham camera. , then the relationship from the world 3D coordinates to the camera imaging (that is, the Sham camera imaging model) is as shown in the following formula (8):
[0161] Formula (8).
[0162] That is to say, after selecting the Sham camera as the image acquisition device, during the calibration process, it is necessary to solve the camera intrinsic parameters, distortion parameters, two Sham angles and the calibration block extrinsic parameters R and t corresponding to each placement posture in the Sham camera imaging model based on the pixel coordinates corresponding to multiple calibration block contour points and the initial calibration coordinates.
[0163] The present application also provides a profilometer calibration device, such as Figure 8 As shown, the profilometer calibration device 80 includes: a collection module 81 , a determination module 82 , a solution module 83 and a calibration module 84 .
[0164] Among them, the acquisition module 81 is used to collect multiple images of the calibration block illuminated by the light emitted by the profilometer through the image acquisition device when the calibration object is located in multiple placement positions; wherein the calibration block includes multiple calibration parts arranged along the same direction, the multiple calibration parts include a first calibration part and multiple second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part.
[0165] The determination module 82 is used to determine the initial calibration coordinates corresponding to multiple calibration block contour points based on the position of the first calibration part on the calibration block and the pixel coordinates of the calibration block contour points of each image in the multiple images. The initial calibration coordinates are the coordinates of the calibration block contour points in the calibration block coordinate system where the calibration block is located.
[0166] The solving module 83 is used to solve the parameters in the initial camera imaging model based on the pixel coordinates corresponding to the contour points of multiple calibration blocks and the initial calibration coordinates to obtain the target camera imaging model; the target camera imaging model is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and convert the coordinates in the camera coordinate system into pixel coordinates.
[0167] The calibration module 84 is used to determine a target transformation relationship based on a target camera imaging model to calibrate the profilometer; the target transformation relationship is a transformation relationship from pixel coordinates to coordinates in a camera coordinate system.
[0168] In some embodiments, the second calibration part has an inclined surface, and each inclined surface has a corresponding plane equation; the solving module 83 is specifically used to: for each calibration block contour point, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determine the first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; based on the initial calibration coordinates corresponding to the calibration block contour point and the plane equation of the inclined surface corresponding to the initial calibration coordinates in the calibration block, determine the second error corresponding to the calibration block contour point; the second error is used to represent the degree of deviation of the initial calibration coordinates from the plane equation of the inclined surface; based on the first errors and second errors corresponding to multiple calibration block contour points, solve the parameters in the initial camera imaging model and correct the initial calibration coordinates corresponding to the calibration block contour points to obtain the target camera imaging model.
[0169] In some embodiments, the solving module 83 is specifically used for: for each calibration block contour point, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determining the first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; based on the initial calibration coordinates corresponding to the calibration block contour point and the light plane equation to be solved, determining the third error corresponding to the calibration block contour point; the light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the calibration block contour point relative to the light plane equation; based on the first errors and third errors corresponding to multiple calibration block contour points, solving the parameters in the initial camera imaging model and the light plane equation to be solved to obtain the target camera imaging model and the light plane equation; the calibration module 84 is specifically used for: determining the target transformation relationship based on the target camera imaging model and the light plane equation.
[0170] In some embodiments, the second calibration portion has an inclined surface, and each inclined surface has a corresponding plane equation; the solution module 83 is specifically used to: for each calibration block contour point, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determine the first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; based on the initial calibration coordinates corresponding to the calibration block contour point and the plane equation of the inclined surface corresponding to the initial calibration coordinates in the calibration block, determine the second error corresponding to the calibration block contour point; the second error is used to represent the degree of deviation of the initial calibration coordinates from the plane equation of the inclined surface ; Based on the initial calibration coordinates corresponding to the calibration block contour points and the light plane equation to be solved, determine the third error corresponding to the calibration block contour points; the light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the contour meter; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the calibration block contour points relative to the light plane equation; based on the first error, the second error and the third error corresponding to multiple calibration block contour points, solve the parameters in the initial camera imaging model and the light plane equation to be solved, and correct the initial calibration coordinates corresponding to the calibration block contour points to obtain the target camera imaging model and the light plane equation; the calibration module 84 is specifically used to: determine the target transformation relationship based on the target camera imaging model and the light plane equation.
[0171] In some embodiments, the target camera imaging model includes a calibration block extrinsic parameter and a first transformation relationship; wherein each placement posture corresponds to a calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first transformation relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates; the calibration module 84 is specifically used to: determine the coordinates of multiple calibration block contour points in the camera coordinate system based on the initial calibration coordinates corresponding to multiple calibration block contour points and the calibration block extrinsic parameters corresponding to the placement postures corresponding to the calibration block contour points; construct a light plane equation corresponding to the light plane formed by the light emitted by the contour meter based on the coordinates of the multiple calibration block contour points in the camera coordinate system; determine the target transformation relationship based on the light plane equation and the first transformation relationship.
[0172] In some embodiments, the calibration module 84 is specifically used to: for any pixel coordinate in the image, establish a first equation between the pixel coordinate and the camera coordinate based on the first transformation relationship; establish a second equation corresponding to the camera coordinate based on the light plane equation; solve the camera coordinate by combining the first equation and the second equation to obtain the camera coordinate in the camera coordinate system corresponding to the pixel coordinate; determine the target transformation relationship based on the coordinates in the camera coordinate system corresponding to multiple pixel coordinates in the image.
[0173] In some embodiments, the target camera imaging model includes a calibration block extrinsic parameter and a first transformation relationship; wherein each placement posture corresponds to a calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first transformation relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates; the calibration module 84 is specifically used to: for any pixel coordinate in the image, establish a first equation between the pixel coordinate and the camera coordinate based on the first transformation relationship; establish a second equation corresponding to the camera coordinate based on the light plane equation; solve the camera coordinates by combining the first equation and the second equation to obtain the camera coordinates in the camera coordinate system corresponding to the pixel coordinates; determine the target transformation relationship based on the coordinates in the camera coordinate system corresponding to multiple pixel coordinates in the image.
[0174] The present application also provides a calibration block, which includes a plurality of calibration parts arranged in the same direction, the plurality of calibration parts including a first calibration part and a plurality of second calibration parts, the shape of the first calibration part is different from the shape of the second calibration part. In some embodiments, the second calibration part has an inclined surface, and each inclined surface has a corresponding plane equation.
[0175] The present application also provides an electronic device. Fig. 9 The electronic device 201 includes: one or more memories 121, one or more processors 122, a communication bus 123 and a communication interface 124. The processor 122 is connected to the memory 121 via the communication bus 123; the one or more memories 121 are used to store computer program codes, and the computer program codes include computer instructions; when the one or more processors 122 execute the computer instructions, the electronic device 201 executes the profilometer calibration method provided in the above embodiment.
[0176] Optionally, the memory 121 may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc., and the embodiments of the present application do not impose any restrictions on this.
[0177] The processor 122 may be a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof, and the embodiments of the present application do not impose any limitation on this.
[0178] The communication bus 123 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The communication bus 123 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Just one thick line is used, but it does not mean that there is only one bus or one type of communication bus.
[0179] The communication interface 124 uses any transceiver or other device for communicating with other devices or communication networks, such as control systems, radio access networks (RAN), wireless local area networks (WLAN), etc.
[0180] The embodiments of the present application also provide a computer program product including one or more instructions, where the one or more instructions are stored in a memory of a computer device and executed by a processor to complete the various processes of the above embodiments.
[0181] An embodiment of the present application further provides a computer-readable storage medium, which includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer executes the profilometer calibration method provided in the above embodiment.
[0182] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0183] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0184] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0185] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0186] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device or processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD-ROM and other media that can store program code.
[0187] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A profilometer calibration method, characterized in that: The calibration method is based on a calibration block for calibration, wherein the calibration block comprises: a plurality of calibration parts arranged in the same direction, the plurality of calibration parts comprising a first calibration part and a plurality of second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part; The calibration method comprises: When the calibration block is located at a plurality of placement positions, a plurality of images of the calibration block irradiated by the light emitted by the profilometer are respectively acquired by an image acquisition device; Based on the position of the first calibration unit on the calibration block and the pixel coordinates of the calibration block contour points of each of the multiple images, determining initial calibration coordinates corresponding to the multiple calibration block contour points, the initial calibration coordinates being the coordinates of the calibration block contour points in the calibration block coordinate system where the calibration block is located; Based on the pixel coordinates corresponding to the contour points of the calibration blocks and the initial calibration coordinates, the parameters in the initial camera imaging model are solved to obtain a target camera imaging model; the target camera imaging model is used to convert the initial calibration coordinates into coordinates in a camera coordinate system, and convert the coordinates in the camera coordinate system into pixel coordinates; A target conversion relationship is determined based on the target camera imaging model to calibrate the profilometer; the target conversion relationship is a conversion relationship from pixel coordinates to coordinates in a camera coordinate system.
2. The calibration method according to claim 1, characterized in that: At least one side surface of the second calibration portion includes an inclined surface, and each of the inclined surfaces has a corresponding plane equation; The method of solving the parameters in the initial camera imaging model based on the pixel coordinates corresponding to the contour points of the plurality of calibration blocks and the initial calibration coordinates to obtain the target camera imaging model includes: For each of the calibration block contour points, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determine a first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; Determine a second error corresponding to the contour point of the calibration block based on the initial calibration coordinates corresponding to the contour point of the calibration block and the plane equation of the inclined plane corresponding to the initial calibration coordinates in the calibration block; the second error is used to indicate the degree of deviation of the initial calibration coordinates from the plane equation of the inclined plane; The parameters in the initial camera imaging model are solved based on the first errors and the second errors corresponding to the contour points of the calibration blocks, and the initial calibration coordinates corresponding to the contour points of the calibration blocks are corrected to obtain the target camera imaging model.
3. The calibration method according to claim 1, characterized in that: The method of solving the parameters in the initial camera imaging model based on the pixel coordinates corresponding to the contour points of the plurality of calibration blocks and the initial calibration coordinates to obtain the target camera imaging model includes: For each of the calibration block contour points, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determine a first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; Determine the third error corresponding to the contour point of the calibration block based on the initial calibration coordinates corresponding to the contour point of the calibration block and the light plane equation to be solved; the light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the contour point of the calibration block relative to the light plane equation; Solving the parameters in the initial camera imaging model and the light plane equation to be solved based on the first errors and the third errors corresponding to the plurality of calibration block contour points to obtain the target camera imaging model and the light plane equation; The determining of the target conversion relationship based on the target camera imaging model includes: The target conversion relationship is determined based on the target camera imaging model and the light plane equation.
4. The calibration method according to claim 1, characterized in that: The second calibration portion has an inclined surface, and each of the inclined surfaces has a corresponding plane equation; The method of solving the parameters in the initial camera imaging model based on the pixel coordinates corresponding to the contour points of the plurality of calibration blocks and the initial calibration coordinates to obtain the target camera imaging model includes: For each of the calibration block contour points, based on the pixel coordinates corresponding to the calibration block contour point and the initial calibration coordinates and the initial camera imaging model, determine a first error corresponding to the calibration block contour point; the first error is used to represent the error between the pixel coordinates determined by the initial camera imaging model based on the initial calibration coordinates and the pixel coordinates corresponding to the calibration block contour point; Determine a second error corresponding to the contour point of the calibration block based on the initial calibration coordinates corresponding to the contour point of the calibration block and the plane equation of the inclined plane corresponding to the initial calibration coordinates in the calibration block; the second error is used to indicate the degree of deviation of the initial calibration coordinates from the plane equation of the inclined plane; Determine the third error corresponding to the contour point of the calibration block based on the initial calibration coordinates corresponding to the contour point of the calibration block and the light plane equation to be solved; the light plane equation is used to represent the plane equation corresponding to the light plane formed by the light emitted by the profiler; the third error is used to represent the degree of deviation of the initial calibration coordinates corresponding to the contour point of the calibration block relative to the light plane equation; Solving the parameters in the initial camera imaging model and the light plane equation to be solved based on the first error, the second error and the third error corresponding to the plurality of calibration block contour points, and correcting the initial calibration coordinates corresponding to the calibration block contour points to obtain the target camera imaging model and the light plane equation; The determining of the target conversion relationship based on the target camera imaging model includes: The target conversion relationship is determined based on the target camera imaging model and the light plane equation.
5. The calibration method according to claim 1 or 2, characterized in that: The target camera imaging model includes a calibration block extrinsic parameter and a first conversion relationship; wherein each of the placement postures corresponds to one calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first conversion relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates; The determining of the target conversion relationship based on the target camera imaging model includes: Determine the coordinates of the plurality of calibration block contour points in the camera coordinate system based on the initial calibration coordinates corresponding to the plurality of calibration block contour points and the calibration block extrinsics corresponding to the placement poses corresponding to the calibration block contour points; Based on the coordinates of the plurality of contour points of the calibration block in the camera coordinate system, constructing a light plane equation corresponding to the light plane formed by the light emitted by the profilometer; The target transformation relationship is determined based on the light plane equation and the first transformation relationship.
6. The calibration method according to claim 5, characterized in that: The determining the target conversion relationship based on the light plane equation and the first conversion relationship includes: For any pixel coordinate in the image, establishing a first equation between the pixel coordinate and the camera coordinate based on the first conversion relationship; Establishing a second equation corresponding to the camera coordinates based on the light plane equation; Solving the camera coordinates by combining the first equation and the second equation to obtain the camera coordinates in a camera coordinate system corresponding to the pixel coordinates; The target transformation relationship is determined based on coordinates in a camera coordinate system corresponding to a plurality of pixel coordinates in the image.
7. The calibration method according to claim 3 or 4, characterized in that: The target camera imaging model includes a calibration block extrinsic parameter and a first conversion relationship; wherein each of the placement postures corresponds to one calibration block extrinsic parameter, the calibration block extrinsic parameter is used to convert the initial calibration coordinates into coordinates in the camera coordinate system, and the first conversion relationship is used to convert the coordinates in the camera coordinate system into pixel coordinates; The determining the target conversion relationship based on the target camera imaging model and the light plane equation includes: For any pixel coordinate in the image, establishing a first equation between the pixel coordinate and the camera coordinate based on the first conversion relationship; Establishing a second equation corresponding to the camera coordinates based on the light plane equation; Solving the camera coordinates by combining the first equation and the second equation to obtain the camera coordinates in a camera coordinate system corresponding to the pixel coordinates; The target transformation relationship is determined based on coordinates in a camera coordinate system corresponding to a plurality of pixel coordinates in the image.
8. A profilometer calibration device, characterized in that: include: A collection module, used for collecting, through an image collection device, a plurality of images of the calibration block irradiated by the light emitted by the profilometer when the calibration block is located in a plurality of placement positions; wherein the calibration block comprises a plurality of calibration parts arranged in the same direction, the plurality of calibration parts comprises a first calibration part and a plurality of second calibration parts, and the shape of the first calibration part is different from the shape of the second calibration part; a determination module, configured to determine initial calibration coordinates corresponding to a plurality of contour points of the calibration block based on a position of the first calibration unit on the calibration block and pixel coordinates of the contour points of the calibration block of each of the plurality of images, wherein the initial calibration coordinates are coordinates of the contour points of the calibration block in a calibration block coordinate system where the calibration block is located; A solution module, used for solving the parameters in the initial camera imaging model based on the pixel coordinates corresponding to the contour points of the plurality of calibration blocks and the initial calibration coordinates, to obtain a target camera imaging model; the target camera imaging model is used for converting the initial calibration coordinates into coordinates in a camera coordinate system, and converting the coordinates in the camera coordinate system into pixel coordinates; A calibration module is used to determine a target transformation relationship based on the target camera imaging model to calibrate the profilometer; the target transformation relationship is a transformation relationship from pixel coordinates to coordinates in a camera coordinate system.
9. An electronic device, characterized in that: include: one or more processors; one or more memories; Wherein, the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the profilometer calibration method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed on a computer, the computer is enabled to execute the profilometer calibration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Laser displacement sensor calibration device and calibration method for normal detection
CN111964589A
Three-dimensional laser scanning calibration block, calibration method, device, equipment and medium
CN115112046A