Detection method for camera triangulation distance measurement
Through the camera triangle ranging detection method, corner point detection and dedistortion calculations are used to verify the camera measurement accuracy, solving the problem of unreliable measurement results after internal parameter calibration, and achieving higher measurement accuracy and reliability.
Patent Information
- Application Number
- CN202510298004.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-20
AI Technical Summary
After internal calibration of the prior art, it is difficult to effectively verify the camera measurement accuracy, resulting in unreliable measurement results.
A detection method for camera triangle distance measurement is proposed. Through corner point detection, dedistortion calculation, distance calculation and accuracy error calculation, the accuracy of internal parameter calibration data and the reliability of distortion model are verified.
Through more precise corner positioning, dedistortion processing and three-dimensional coordinate establishment, the measurement accuracy is significantly improved and the reliability of the camera measurement results is ensured.
Smart Images

Figure CN120176627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera testing, and particularly to a detection method for camera triangulation ranging. Background Art
[0002] As an important image acquisition device, cameras are widely used in multiple fields such as mobile phones, vehicles, medical, and drones. In the vehicle field, cameras are generally the core components of the Advanced Driver Assistance System (ADAS) and the Around View Monitor (AVM). To ensure the measurement accuracy of vehicle-mounted cameras, internal parameter calibration has become an indispensable step.
[0003] Internal parameter calibration, that is, through a series of precise calibration processes, the internal parameters and distortion coefficients of the camera are determined, thereby completing the distortion correction work. This step is crucial for improving the imaging quality and measurement accuracy of the camera. However, due to the diversity of internal parameter calibration models and the characteristic differences of different camera lenses, the internal parameter values and distortion coefficients obtained through calibration do not necessarily fully guarantee the measurement accuracy in actual applications. Therefore, additional test steps are generally required to verify and ensure the measurement accuracy of the camera. Summary of the Invention
[0004] The purpose of the present invention is to propose a detection method and device for camera triangulation ranging, and this technical solution can effectively verify the accuracy of the internal parameter calibration data and the reliability of the distortion model.
[0005] To achieve the above purpose, the present invention provides a detection method for camera triangulation ranging, including: selecting the camera to be measured and adjusting the position and angle of the camera; setting the test areas corresponding to pictures with different field of view angles according to the positions of two target points in the image, and adopting the area detection method; performing corner detection on the set areas, including obtaining corner points and sub-pixel level corner points, judging and correcting the central corner points of the checkerboard; according to the distortion calibration model, selecting the corresponding function to perform distortion removal calculation on the corner points, obtaining the normalized distortion-removed corner point coordinates, and converting them into actual distortion-removed pixel coordinates; calculating the calculated distances between the corner points of the two target points in each picture, establishing the normalized three-dimensional coordinates, and using three points to calculate the offset angles of the left and right corner points, and combining the measured parameters to obtain the calculated distances between the two corner points; calculating the accuracy error.
[0006] Advantageous effects of the basic solution: By obtaining corner points and sub-pixel level corner points, this technical solution can more accurately locate the key feature points in the image. Sub-pixel level corner detection can further subdivide the corner positions on the basis of pixel accuracy. Compared with detection only in terms of pixels, it can more accurately capture the true positions of the corner points and reduce the position errors caused by pixel quantization.
[0007] Judging and correcting the central corner points of the checkerboard ensures the accuracy of the corner point positions. The checkerboard pattern is a commonly used calibration pattern, and the accuracy of its central corner points is crucial for subsequent ranging calculations. By correcting the deviation of the central corner points, the accuracy of the entire corner point system can be improved, thereby providing a more reliable data basis for subsequent calculations.
[0008] According to the distortion calibration model, select the corresponding function to perform undistortion calculation on the corner points, obtain the normalized undistorted corner point coordinates, and convert them into actual undistorted pixel coordinates. This step effectively eliminates the influence of lens distortion on the measurement results. Camera lenses often produce distortions during the imaging process, such as barrel distortion or pincushion distortion, which can cause deviations in the shape and position of objects in the image. Through undistortion calculation, the corner point coordinates are made more consistent with the actual physical space, thereby improving the accuracy of distance and angle calculations.
[0009] Calculate the calculated distances between the two target corner points of each image, establish normalized three-dimensional coordinates, and use three points to calculate the offset angles of the left and right corner points. Combine the measured parameters to obtain the calculated distances between the two corner points. The spatial relationships between multiple corner points are fully considered. By establishing three-dimensional coordinates and calculating angle offsets, the object positions and distance relationships in the actual scene are restored more accurately, effectively reducing errors and improving the accuracy of ranging.
[0010] As an implementable preferred solution, it also includes setting a target card, using a BMW board or a black and white checkerboard as the target. If a black and white checkerboard is used, the side length of the black and white grids is set to a preset value; if a black and white checkerboard is used as the target, the side length of the black and white grids is set to 30 cm.
[0011] As an implementable preferred solution, it also includes selecting a test site, determining the relative positions of the camera module under test and the target in the test environment, and measuring the distance between the two target targets and the distances from the surface of the camera module under test to the two target targets respectively and , and then use the entrance pupil distance of the lens to obtain and ; the horizontal heights of the two target targets should be the same as the camera installation height.
[0012] As an implementable preferred solution, the method for judging and correcting the central corner points of the checkerboard includes: Take a preset area in each of the four quadrants of the corner point for judgment. Judge the number of black and white in each area through the grayscale image and the set black and white thresholds. If the characteristics of the central corner points of the checkerboard are met, correction is performed.
[0013] As an implementable preferred solution, relevant functions in the OpenCV library are used to grayscale the collected images. The goodFeaturesToTrack function of OpenCV is used to obtain corner points, and the cornerSubPix function is used to obtain sub-pixel level corner points within the region. ; In each of the four quadrants of the corner points, a 3*3 region is taken for judgment. The number of black and white pixels in the region blocks of these four quadrants is calculated. According to the set black and white thresholds, the number of black and white pixels in each block is recorded. If the number of black or white pixels in each block is 9, it is judged whether the characteristics of the center corner point of the checkerboard are met. If so, the correction of the center corner point of the checkerboard is carried out. If there are more than 2 corner points, it is judged that the corner point is the closest to the center of the region block, and this corner point is used as the final checkerboard corner point.
[0014] As an implementable preferred solution, the obtained normalized undistorted corner point coordinates are converted into actual undistorted pixel coordinates. The conversion formula is as follows:
[0015] Among them, is the normalized undistorted corner point coordinate, is the undistorted pixel coordinate.
[0016] As an implementable preferred solution, a normalized three-dimensional coordinate is established. The origin and the left and right corner point coordinates are O , L , R :
[0017] Among them, , are the left and right undistorted pixel coordinates of the image respectively; The offset angle between the left and right corner points is calculated using three points , and the formula is as follows:
[0018] Then, the calculated distance between the two corner points is obtained using the previously measured parameters , and the formula is as follows: .
[0019] As an implementable preferred solution, the calculation precision error is calculated, and the formula is as follows:
[0020] Among them, For measuring distance, For calculating distance.
[0021] As an implementable preferred solution, compare the measured distance with the calculated distance. If the error exceeds the preset threshold, it indicates that there is a problem with the image accuracy; otherwise, it indicates that the accuracy meets the standard. Brief Description of the Drawings
[0022] Figure 1 It is a schematic structural diagram of an architecture of a detection method for camera triangulation ranging.
[0023] Figure 2 It is a schematic diagram of the BMW board target style.
[0024] Figure 3 It is a schematic diagram of the black and white checkerboard target style.
[0025] Figure 4 It is a schematic diagram of the relative positions of the camera module to be measured and the target.
[0026] Figure 5 It is a schematic diagram of the placement of 16 azimuth fields of view.
[0027] Figure 6 It is a schematic diagram of the corner points of the area detection.
[0028] Figure 7 It is a schematic diagram of the corner point judgment.
[0029] Figure 8 It is a schematic diagram of the actual image corner point judgment.
[0030] Figure 9 It is a schematic diagram of the determination of the actual image corner points.
[0031] Figure 10 It is a diagram of the camera accuracy judgment table for Example 1.
[0032] Figure 11 It is a diagram of the camera accuracy judgment table for Example 2.
[0033] Figure 12 It is a schematic structural diagram of the electronic device according to an embodiment of the present invention. Detailed Embodiments
[0034] To make the technical solutions and their advantages of this application clearer, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings. It can be understood that the specific embodiments described herein are only partial embodiments of the present invention, which are only used to explain this application and not to limit this application. It should be noted that the technical features or combinations of technical features described in the following embodiments should not be considered isolated, and they can be combined with each other to achieve better technical effects. The same reference numerals appearing in the accompanying drawings of the following embodiments represent the same features or components and can be applied to different embodiments.
[0035] In addition, unless otherwise defined, the technical terms or scientific terms used in the description of the present invention should have the ordinary meanings understood by those of ordinary skill in the art to which the present invention pertains.
[0036] The present invention will be further described in detail below with reference to the accompanying drawings: Reference numerals: electronic device 500, processor 501, communication interface 502, memory 503, bus 504.
[0037] The embodiments of the present disclosure provide a detection method for camera triangulation ranging, including: Step S100, set up a target card, and use a BMW board (such as Figure 2 ), or a black and white checkerboard (such as Figure 3 ) as the target. If a black and white checkerboard is used, the side length of the black and white squares is set to 30 cm.
[0038] Step S200: Select a suitable test site. The test site should have relatively stable environmental conditions to avoid interference from external factors such as direct sunlight and vibration during the detection process. At the same time, ensure that the site space is sufficient to reasonably arrange the camera module to be measured and the target.
[0039] Determine the relative positions of the camera module to be measured and the target in the test environment. Refer to Figure 4 , measure the distance between the two target targets and the distances from the surface of the camera module to be measured to the two target targets and respectively through a high-precision rangefinder, and then obtain and by using the entrance pupil distance of the lens. At the same time, the horizontal heights of the two target targets should be the same as the camera installation height (generally required to be ±5 cm) to ensure the consistency of the light propagation path and angle when the camera shoots the target, so as to ensure that the detection result is not affected by the error caused by the height difference.
[0040] Step S300, select the camera to be detected and install it on the jig equipped with a multi-axis adjustment module. The function of the multi-axis adjustment module is to accurately adjust the position and angle of the camera to meet the test requirements of different field of view angles. During the installation process, it should be ensured that the camera is firmly installed to avoid shaking during the test and affecting the shooting effect.
[0041] Refer to Figure 5 , set the orientation between multiple field of view angles of the camera as required by adjusting the placement angle of the multi-axis adjustment module of the device on the jig equipped with the camera.
[0042] Step S400, set the test area. According to the positions of the two targets in the image, set the test areas corresponding to the pictures of different field of view angles. The method of region detection can effectively shorten the detection time and improve the detection efficiency. When setting the test area, the drawing tool in the image acquisition software can be used to manually draw a rectangular area on the real-time preview image to include the target within the area. The size of the area can be set according to the actual situation. In this embodiment, most areas are set to 450pixel * 450pixel. If it is an edge area, it can be appropriately smaller than this size to ensure that the target is completely included and avoid collecting too much irrelevant background information.
[0043] Step S500, perform corner detection according to the set area, including: Step S501, perform image grayscale processing. Use the relevant functions in the OpenCV library (such as the cvtColor function) to perform grayscale processing on the collected image. The purpose of grayscale processing is to convert the color image into a grayscale image to simplify the subsequent image processing process and improve the processing speed.
[0044] Step S502, use the goodFeaturesToTrack function of opencv to obtain the corner points, and obtain the sub-pixel level corner points within the area through the cornerSubPix function , refer to Figure 6 .
[0045] Step S503, for each detected corner point, it is necessary to further determine whether it is the center corner point of the checkerboard. Take a 3 * 3 area in each of the four quadrants of the corner point for judgment. That is, take a 3 * 3 area centered at specific distances of 45°, 135°, 225°, and 315° around the corner point for judgment.
[0046] For example, refer to Figure 7, if the specific distance is 15 pixels and the coordinates of a certain corner point are (200, 500), then the coordinates of the orange center in the first quadrant are (215, 485), the coordinates of the yellow center in the second quadrant are (185, 485), the coordinates of the chocolate - colored center in the third quadrant are (185, 515), and the coordinates of the blue center in the fourth quadrant are (215, 515).
[0047] Calculate the black - and - white quantities of the regional blocks in these four quadrants. Make a judgment through the grayscale - processed image. Judge according to the set black - and - white threshold (for example, set the threshold to 75), record the black - and - white quantities of each block. If the number of black or white blocks in each block is 9, then judge whether it meets the characteristics of the center corner point of the checkerboard, that is, whether the first and third quadrants are of the same color, and whether the second and fourth quadrants are of another color.
[0048] If it meets the requirements, correct the center corner point of the checkerboard. If there are more than 2 corner points, then judge that the corner point closest to the center of the regional block is the final checkerboard corner point, referring to Figure 8 and Figure 9 .
[0049] Step S600: According to the distortion calibration model, select the corresponding OpenCV function to perform undistortion calculation on the corner points. For example, when using the pinhole model, the opencv's undistortPoints function can be called to obtain the normalized undistorted corner point coordinates. When using the fisheye model, the opencv's fisheye::undistortPoints function is called to obtain the normalized undistorted corner point coordinates (this process will involve using the internal parameter and distortion coefficient of the module, and the internal parameter and distortion coefficient are completed by internal parameter calibration and are known data).
[0050] Convert the obtained normalized undistorted corner point coordinates into actual undistorted pixel coordinates. The conversion formula is as follows:
[0051] Among them, is the normalized undistorted corner point coordinate, is the undistorted pixel coordinate.
[0052] Step S700: Calculate the calculated distance between the two target corner points of each image. Establish a normalized three - dimensional coordinate, and the origin and the left and right corner point coordinates are O , L , R :
[0053] Among them, 、 Distort the pixel coordinates of the left and right sides of the image respectively.
[0054] Use three points to calculate the offset angle of the left and right corner points , the formula is as follows:
[0055] Then use the parameters measured previously to obtain the calculated distance between the two corner points , the formula is as follows:
[0056] Step S800, calculate the precision error , the formula is as follows:
[0057] Among them, is the measured distance, is the calculated distance. If it exceeds the preset threshold, it means there is a problem with the picture precision; otherwise, it means the precision meets the standard. In one embodiment, the preset threshold is set to ±0.15%.
[0058] Example 1 Left target corner point distance: 7009.709961mm, right target corner point distance: 7006.740234mm, distance between left and right target corner points 4295.910156mm, entrance pupil depth 3.940mm.
[0059] The regions corresponding to 16 field-of-view angle images are all set to 450pixel * 450pixel (if it is the edge, it can be less than 450).
[0060] The middle positions of the regions of the left and right targets corresponding to each image are respectively:
[0061] Refer to Figure 10 , calculate each field-of-view angle image according to the method of this technical solution, and it can be seen that there are some pictures whose precision does not meet the standard, indicating that the precision of this camera for internal parameter calibration does not meet the standard and does not meet the requirement of threshold = ±0.15%.
[0062] Example 2 Left target corner point distance: 24991.609375mm, right target corner point distance: 24974.830078mm, distance between left and right target corner points 5402.254883mm, entrance pupil depth 3.90mm.
[0063] For example, the areas corresponding to the following 16 pictures are all set to 450 pixel * 450 pixel (if it is the edge, it can be less than 450). The middle positions of the left and right target areas corresponding to each picture are respectively:
[0064] Refer to Figure 11 , it can be seen that the picture accuracy meets the standard, indicating that the accuracy of this camera calibrated by the internal parameters meets the standard and meets the requirement of the threshold = ±0.15%.
[0065] The embodiment of the present disclosure also provides a detection system for camera triangulation ranging, and this system applies the above-mentioned detection method for camera triangulation ranging.
[0066] The embodiment of the present disclosure also provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, it can implement all the steps of the above-mentioned detection method for camera triangulation ranging.
[0067] Those of ordinary skill in the art can understand that all or part of the processes in implementing a detection method for camera triangulation ranging can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of various embodiments of a detection method for camera triangulation ranging. Among them, any reference to a memory, storage, database or other medium used in the various embodiments provided in this application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0068] The embodiments of the present application further provide an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the above detection method for camera triangulation ranging are implemented. In the embodiments of the present application, the processor is the control center of the computer method, which can be the processor of a physical machine or the processor of a virtual machine.
[0069] Referring to Figure 12 , the electronic device 500 includes: at least one processor 501, at least one communication interface 502, at least one memory 503, and at least one bus 504. Among them, the bus 504 is used to realize the connection and communication between these components, the communication interface 502 is used to communicate with other node devices by signaling or data, and the memory 503 stores machine-readable instructions executable by the processor 501. When the electronic device 500 runs, the processor 501 communicates with the memory 503 through the bus 504. When the machine-readable instructions are called by the processor 501, the steps of the above detection method for camera triangulation ranging are executed.
[0070] The above content is only the embodiments of the present invention. Common knowledge such as the specific structure and characteristics in the solution is not described in detail here. Those of ordinary skill in the art know all the common technical knowledge in the technical field to which the invention belongs before the application date or the priority date, can know all the existing technologies in this field, and have the ability to apply the conventional experimental means before this date. Those of ordinary skill in the art can, under the inspiration given in the present application, combine their own abilities to improve and implement this solution. Some typical well-known structures or well-known methods should not become an obstacle for those of ordinary skill in the art to implement the present application. It should be noted that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can still be made, and these should also be regarded as the protection scope of the present invention, which will not affect the implementation effect of the present invention and the practicality of the patent. The protection scope required by the present application should be based on the content of its claims, and the specific implementation manners described in the specification can be used to explain the content of the claims.
Claims
1. A camera triangulation detection method, characterized in that: include: Select the camera to be tested, and adjust the position and angle of the camera; according to the positions of the two targets in the image, set the test areas corresponding to the images with different field of view angles, and use the area detection method; perform corner point detection on the set area, including obtaining corner points and sub-pixel level corner points, and determining and correcting the center corner points of the chessboard; According to the distortion calibration model, the corresponding function is selected to perform dedistortion calculation on the corner points, and the normalized dedistorted corner point coordinates are obtained, and then converted into actual dedistorted pixel coordinates; Calculate the calculated distance between the two target corner points of each image, establish the normalized three-dimensional coordinates, and use the three points to calculate the offset angle of the left and right corner points. Combine the measured parameters to obtain the calculated distance between the two corner points; calculate the accuracy error.
2. The camera triangulation ranging detection method according to claim 1, characterized in that: It also includes setting a target card, using a BMW board card or a black and white chessboard as a target. If a black and white chessboard is used, the side length of the black and white grid is set to a preset value; if a black and white chessboard is used as a target, the side length of the black and white grid is set to 30cm.
3. The camera triangulation ranging detection method according to claim 1, characterized in that: It also includes selecting the test site, determining the relative position of the camera module and the target in the test environment, and measuring the distance between the two target targets. And the distance between the surface of the camera module under test and the two target targets and , and then use the lens entrance pupil distance to get and ; The horizontal height of the two target points should be consistent with the camera installation height.
4. The camera triangulation ranging detection method according to claim 1, characterized in that: Methods for determining and correcting the center corners of a chessboard include: Select a preset area on each of the four quadrants of the corner point for judgment, and judge the amount of black and white in each area through the grayscale processed image and the set black and white threshold. If it meets the characteristics of the central corner point of the chessboard, correction is performed.
5. The camera triangulation ranging detection method according to claim 4, characterized in that: Use the relevant functions in the OpenCV library to grayscale the collected image, use the goodFeaturesToTrack function of opencv to obtain the corner points, and use the cornerSubPix function to obtain the sub-pixel corner points in the area. ; Take a 3*3 area in each of the four quadrants of the corner point for judgment, calculate the number of black and white blocks in the four quadrants, and record the number of black and white blocks of each block according to the set black and white threshold. If the number of black or white blocks of each block is 9, then judge whether it meets the characteristics of the central corner point of the chessboard. If it does, correct the central corner point of the chessboard; If there are more than two corner points, the corner point is determined to be closest to the center of the area block, and this corner point is used as the final chessboard corner point.
6. The camera triangulation ranging detection method according to claim 1, characterized in that: The normalized dedistorted corner point coordinates are converted into actual dedistorted pixel coordinates. The conversion formula is as follows: in, are the normalized dedistorted corner point coordinates, are the pixel coordinates for dedistortion.
7. The camera triangulation ranging detection method according to claim 6, characterized in that: Establish normalized three-dimensional coordinates, the coordinates of the origin and the left and right corners are O , L , R : in, , They are the left and right dedistorted pixel coordinates of the image; Calculate the offset angle of the left and right corners using three points , the formula is as follows: Then use the previously measured parameters to get the calculated distance between the two corner points , the formula is as follows: 。 8. The camera triangulation ranging detection method according to claim 1, characterized in that: Calculation accuracy error , the formula is as follows: in, To measure distance, To calculate the distance.
9. A camera triangulation ranging detection method according to claim 8, characterized in that: The measured distance is compared with the calculated distance. If the error exceeds the preset threshold, it means that there is a problem with the image accuracy; otherwise, it means that the accuracy meets the standard.
Citation Information
Cited By
Three-dimensional positioning method for obstacle with specific color
CN120807621A
Method and system for detecting form and position errors of engine crankshaft
CN121391730A
Method and device for determining distortion center of camera
CN122093554A
