Camera module calibration test pattern angle detection method and device, equipment and medium
By detecting the angle of the camera module calibration test chart, and using the quadrilateral formed by the edge lines and the distance ratio calculated with the reference point, the problem of inaccurate calibration caused by changes in the chart placement angle is solved, thus improving the accuracy of the calibration results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2026-04-14
AI Technical Summary
During the camera module calibration process, changes in the orientation angle of the chart can lead to inaccurate calibration results and affect the imaging effect.
Multiple test images are captured by a camera module, edge lines are extracted to form quadrilaterals, reference points and test points are determined, and distance ratios are calculated to check whether the chart's placement angle is standard.
It improved the accuracy of calibration results and solved the calibration problems caused by changes in the chart angle.
Smart Images

Figure CN115941932B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera module testing technology, and in particular to a method, apparatus, equipment and medium for angle detection of camera module calibration test diagrams. Background Technology
[0002] Before leaving the factory, camera modules usually need to be calibrated to obtain calibration parameters. Then, the images are processed according to the calibration parameters so that the processed images can reproduce objects in three-dimensional space.
[0003] During the calibration of the dual-camera module, four chart test images in different states need to be captured simultaneously. Three of these charts need to be rotated to a preset angle. However, changes in the chart's orientation during calibration can affect the image quality, leading to inaccurate calibration results for the camera module. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a method, apparatus, device and medium for detecting the angle of a camera module calibration test chart to overcome or at least partially solve the above problems. It can detect the placement angle of the chart, solve the calibration failure problem caused by changes in the chart angle during the test, and improve the accuracy of the calibration results.
[0005] Firstly, a method for detecting the angle of a camera module calibration test image is provided, the method comprising:
[0006] A camera module is used to capture multiple test images to be tested to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image.
[0007] Extract the edge lines of the multiple second test images in the target image to obtain multiple second target quadrilaterals;
[0008] Determine the reference point corresponding to each of the second target quadrilaterals, wherein the reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second target quadrilateral;
[0009] Select test points in each of the second target quadrilaterals, where the test points are points on or inside the edges of the second target quadrilaterals;
[0010] When the first test chart is placed at the standard angle, the placement angle of each second test chart relative to the first test chart is determined based on the distance from the test point to the reference point.
[0011] Optionally, when the number of test points is at least one, determining whether the placement angle of each second test pattern relative to the first test pattern is standard based on the distance from the test point to the reference point includes:
[0012] Determine the actual distance from the test point to the reference point;
[0013] Determine the standard distance from the test point to the reference point;
[0014] Based on the ratio of the actual distance to the standard distance, determine whether the placement angle of each second test image relative to the first test image is standard.
[0015] Optionally, determining the standard distance from the test point to the reference point includes:
[0016] Under standard conditions, a camera module is used to capture images of the multiple test diagrams with standard placement angles to obtain standard images;
[0017] Extract the edge lines of the multiple second test images from the standard image to obtain multiple second standard quadrilaterals, and the multiple second standard quadrilaterals correspond one-to-one with the multiple second target quadrilaterals;
[0018] Determine the reference point corresponding to each of the second standard quadrilaterals, wherein the reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second standard quadrilateral;
[0019] In each of the second standard quadrilaterals, a standard point corresponding to the test point is selected, and the position of the standard point in the second standard quadrilateral is the same as the position of the test point in the second target quadrilateral.
[0020] The distance from the standard point in the second standard quadrilateral to the reference point is determined to be the standard distance from the test point in the corresponding second target quadrilateral to the reference point.
[0021] Optionally, when there are multiple test points, determining whether the placement angle of each second test pattern relative to the first test pattern is standard based on the distance from the test point to the reference point may further include:
[0022] Determine a first actual distance from a first test point to the reference point, and a second actual distance from a second test point to the reference point, wherein the first test point and the second test point are any two test points from the plurality of test points;
[0023] The ratio of the first actual distance to the second actual distance is determined to be the first ratio value;
[0024] Determine a first standard distance from the first test point to the reference point, and a second standard distance from the second test point to the reference point;
[0025] The ratio of the first standard distance to the second standard distance is determined to be the second ratio value;
[0026] Based on the difference between the first ratio and the second ratio, determine whether the placement angle of each second test pattern relative to the first test pattern is standard.
[0027] Optionally, when there are multiple test points, determining whether the placement angle of each second test pattern relative to the first test pattern is standard based on the distance from the test point to the reference point may further include:
[0028] Determine the first actual distance from the first test point to the reference point, and the third actual distance from the first test point to the second test point, wherein the first test point and the second test point are any two test points among the plurality of test points;
[0029] The ratio of the first actual distance to the third actual distance is determined to be the third ratio value;
[0030] Determine a first standard distance from the first test point to the reference point, and a third standard distance from the first test point to the second test point;
[0031] The ratio of the first standard distance to the third standard distance is determined to be the fourth ratio.
[0032] Based on the difference between the third ratio and the fourth ratio, it is determined whether the placement angle of each second test pattern relative to the first test pattern is standard.
[0033] Optionally, the method further includes:
[0034] Extract the edge lines of the first test image from the target image to obtain the first target quadrilateral;
[0035] Determine whether the first target quadrilateral is a rectangle;
[0036] When the first target quadrilateral is a rectangle, determine the standard for the placement angle of the first test image;
[0037] When the first target quadrilateral is not rectangular, it is determined that the placement angle of the first test image is not standard.
[0038] Secondly, another method for angle detection of camera module calibration test diagrams is provided, the method comprising:
[0039] A camera module is used to capture multiple test images to be tested to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image.
[0040] Extract the edge lines of the plurality of second test images in the target image to obtain at least two opposing and non-parallel edge lines for each second test image;
[0041] Determine a reference point for each of the second test patterns, wherein the reference point is the intersection of the extensions of the two opposing and non-parallel edge lines;
[0042] In each of the second test graphs, test points are selected, where the test points are points on or inside the edges of the second test graph.
[0043] When the first test chart is placed at the standard angle, the placement angle of each second test chart relative to the first test chart is determined based on the distance from the test point to the reference point.
[0044] Thirdly, an angle detection device for a camera module calibration test pattern is provided, the device comprising:
[0045] The target image acquisition module is used to capture multiple test images to be detected using a camera module to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image.
[0046] An edge line extraction module is used to extract the edge lines of the multiple second test images in the target image to obtain multiple second target quadrilaterals;
[0047] The reference point determination module is used to determine the reference point corresponding to each of the second target quadrilaterals, wherein the reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second target quadrilateral; or, it is used to determine the reference point of each of the second test images, wherein the reference point is the intersection of the extensions of the two opposite and non-parallel edge lines.
[0048] The test point selection module is used to select test points in each of the second target quadrilaterals, wherein the test points are points on or inside the edges of the second target quadrilaterals; or, it is used to select test points in each of the second test diagrams, wherein the test points are points on or inside the edges of the second test diagrams.
[0049] An angle determination module is used to determine whether the placement angle of each second test pattern relative to the first test pattern is standard, based on the distance from the test point to the reference point, when the placement angle of the first test pattern is standard.
[0050] Fourthly, an electronic device is provided, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first or second aspect.
[0051] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing the computer to perform the method described in the first aspect or the second aspect.
[0052] The technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
[0053] This invention provides a method, apparatus, device, and medium for detecting the angle of a camera module calibration test chart. After capturing multiple charts to be tested using a camera module to obtain target images, the edge lines of second charts rotated by a predetermined angle are extracted from the images to obtain reference points for each second chart. Then, the distance between the test point and the corresponding reference point in each second chart can be used to determine whether the chart's placement angle is standard. Since the positions of the edge lines and reference points differ for second charts with different rotation angles, the distances between the test points and the corresponding reference points will also differ. Therefore, this detection method can detect the placement angle of the chart, solving the calibration problems caused by changes in chart angle during testing, thereby improving the accuracy of the calibration results.
[0054] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0055] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0056] In the attached diagram:
[0057] Figure 1 This is a flowchart of an angle detection method for a camera module calibration test image provided in an embodiment of the present invention;
[0058] Figure 2This is a schematic diagram of a structure of multiple test patterns provided in an embodiment of the present invention;
[0059] Figure 3 This is a schematic diagram of the edge line of a test pattern provided in an embodiment of the present invention;
[0060] Figure 4 This is a schematic diagram of a test pattern outline provided in an embodiment of the present invention;
[0061] Figure 5 This is a schematic diagram of a reference point provided in an embodiment of the present invention;
[0062] Figure 6 This is a schematic diagram of the structure of an angle detection device for camera module calibration test diagram provided in an embodiment of the present invention;
[0063] Figure 7 This is a flowchart of a method for detecting the angle of a camera module calibration test pattern provided in another embodiment of the present invention;
[0064] Figure 8 This is another schematic diagram of edge line extraction for a test image provided in an embodiment of the present invention. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0066] Figure 1 This is a flowchart of an angle detection method for a camera module calibration test pattern provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:
[0067] Step S101: Use a camera module to capture multiple test images to be detected to obtain the target image.
[0068] The test charts include a first test chart and multiple second test charts, with the multiple second test charts arranged at an angle relative to the first test chart.
[0069] Figure 2 This is a schematic diagram of a structure of multiple test patterns provided in an embodiment of the present invention, such as... Figure 2 As shown, in this embodiment, the captured target image includes four test images to be detected. These four test images 20 include one first test image 21 and three second test images 22. The three second test images 22 are rotated 30° relative to the first test image 21 in different directions. Furthermore, the three second test images and the first test image are not on the same plane.
[0070] In this embodiment, each test image is an environmental image used by the camera module during calibration testing. For example... Figure 2 As shown, each test pattern can be a checkerboard pattern with alternating black and white lines.
[0071] Step S102: Extract the edge lines of multiple second test images from the target image to obtain multiple second target quadrilaterals.
[0072] Specifically, edge lines can be extracted using the Sobel operator.
[0073] Optionally, before performing step S102, the method may further include: dividing the target image into multiple blocks, each block completely containing a test image. Then, during step S102, the edge lines of the corresponding test images can be extracted sequentially from each block.
[0074] In other words, when there are four test images, the target image can be divided into four parts, and then the corresponding test image edge lines can be extracted from the four parts of the image respectively.
[0075] While performing step S102, the method may also include:
[0076] Extract the edge lines of the first test image from the target image to obtain the first target quadrilateral.
[0077] Since the first test image was not rotated, theoretically, the first target quadrilateral obtained from the edge lines of the captured first test image should be a rectangular structure. Therefore, the angle detection method for the first test image differs from the angle detection method for multiple second test images.
[0078] After obtaining the edge lines of the first test image and thus the first target quadrilateral, the angle detection method provided in this embodiment may further include:
[0079] When the first target quadrilateral is a rectangle, determine the standard for the placement angle of the first test image;
[0080] When the first target quadrilateral is not a rectangle, it is determined that the placement angle of the first test image is not standard.
[0081] The above method can be used to check whether the placement angle of the first test image is standard.
[0082] Once the edge lines of multiple second test images are obtained, resulting in multiple second target quadrilaterals, steps S103 to S105 can be executed to detect whether the placement angles of the multiple first test images are standard.
[0083] Figure 3 This is a schematic diagram of edge line extraction for a test image provided in an embodiment of the present invention, such as... Figure 3As shown, in this embodiment, the edge lines of the first test image 21 are extracted to obtain the first target quadrilateral 31, and the edge lines of the three second test images 22 are extracted to obtain the three second target quadrilaterals 32.
[0084] It should be noted that, in this embodiment, in addition to extracting the edge lines of each test image, the outline lines 33 of each row and column of the checkerboard pattern in each test image can also be extracted, such as... Figure 4 As shown, this is to facilitate the selection of test points in the subsequent step S104.
[0085] Step S103: Determine the reference point corresponding to each second target quadrilateral. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second target quadrilateral.
[0086] Figure 5 This is a schematic diagram of a reference point provided in an embodiment of the present invention, such as... Figure 5 As shown, taking a second target quadrilateral 32 as an example, the second target quadrilateral 32 has two opposite and non-parallel edge lines S1 and S2. The extensions of S1 and S2 intersect at point S, which is the reference point corresponding to the second target quadrilateral 32.
[0087] Step S104: Select test points in each second target quadrilateral. Test points are points on or inside the edges of the second target quadrilateral.
[0088] The number of test points can be one or more. For example... Figure 5 As shown, in one implementation of this embodiment, a point A or point B on the side of the second target quadrilateral 32 can be selected as a test point, or both points A and B can be selected as test points simultaneously. In other implementations of this embodiment, any point in the two target quadrilaterals 32 can be selected as a test point. Preferably, points A and B can be selected as the intersection of any two sides of the second target quadrilateral 32.
[0089] Optionally, when selecting multiple test points, selection can be made from the outline of each row and column of the checkerboard pattern in each test image. This facilitates the subsequent selection of test points in the same position in the standard image to obtain the standard distance. For example, Figure 5 Points A and B in the diagram are two points on the outline of the same column of chessboard squares.
[0090] Step S105: When the first test chart is placed at the standard angle, determine whether the placement angle of each second test chart relative to the first test chart is standard based on the distance from the test point to the reference point.
[0091] In the first implementation of this embodiment, when the number of test points is at least one, step S105 may include:
[0092] Step 1: Determine the actual distance from the test point to the benchmark point;
[0093] The second step is to determine the standard distance between the test point and the benchmark point.
[0094] The third step is to determine whether the placement angle of each second test chart relative to the first test chart is standard, based on the ratio of the actual distance to the standard distance.
[0095] Specifically, when the ratio of the actual distance to the standard distance is close to 1, it indicates that the placement angle of the second chart is more standard. However, a certain error is allowed between the actual and standard environment placement of the chart. Therefore, a certain error range can be set. For example, when the ratio of the actual distance to the standard distance is within the range of 1 ± d, the placement angle of the second chart can be determined to be standard. Conversely, if the ratio exceeds the range of 1 ± d, the placement angle of the second chart is determined to be non-standard. In other implementations of this embodiment, the placement angle of each second chart to be tested can also be determined to be standard based on the difference between the actual distance and the standard distance.
[0096] In the second step above, determining the standard distance from the test point to the benchmark point can be achieved using the following method:
[0097] 1) Under standard conditions, a camera module is used to capture multiple test images with standard placement angles to obtain standard images;
[0098] The standard environment refers to the environment set up according to the manufacturer's requirements, including the distance between the camera module and the chart, the placement of the chart, etc., all of which are set up according to the requirements. The camera module used when shooting standard images can also be a selected high-quality Golden module.
[0099] 2) Extract the edge lines of multiple second test images from the standard image to obtain multiple second standard quadrilaterals, and the multiple second standard quadrilaterals correspond one-to-one with the multiple second target quadrilaterals;
[0100] 3) Determine the reference point for each second standard quadrilateral. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines of the second standard quadrilateral.
[0101] 4) Select a standard point corresponding to the test point in each second standard quadrilateral. The position of the standard point in the second standard quadrilateral is the same as the position of the test point in the second target quadrilateral.
[0102] 5) Determine the distance from the standard point to the reference point in the second standard quadrilateral, which is the standard distance from the test point to the reference point in the corresponding second target quadrilateral.
[0103] In other words, the same method is used to determine the reference points corresponding to each second chart in the standard image. Then, a standard point (corresponding to the test point) is selected at the same location in the standard image. Finally, the distance from this standard point to the reference point in the standard image is determined, thus obtaining the standard distance between the corresponding test point and the reference point in the target image. Since the placement angle of each second chart in the standard image is standard, by comparing the actual distance with the standard distance, it can be determined whether the placement angle of the second chart to be detected is standard.
[0104] To better understand the above implementation method, in conjunction with, for example Figure 5 For example:
[0105] Among the above implementation methods, one can choose Figure 5 Midpoint A is used as the test point. First, determine the actual distance SA from test point A to reference point S in the target image. Then, determine the standard distance S'A' (not shown in the figure) from standard point A' to reference point S' in the standard image, obtaining the ratio SA / S'A'. Finally, determine whether the ratio SA / S'A' is within the range of 1 ± 0.05 to determine the accuracy of the test. Figure 5 Is the placement angle of the second chart corresponding to the second target quadrilateral 32 in the standard?
[0106] Similarly, you can select Figure 5 Using midpoint B as the test point, the ratio SB / S'B' is obtained in the same way, and the determination is based on the ratio SB / S'B'. Figure 5 Is the placement angle of the second chart corresponding to the second target quadrilateral 32 in the standard? Alternatively, points A and B can be selected simultaneously as test points. When both the ratio SA / S'A' and the ratio SB / S'B' are within 1±d, then... Figure 5 The standard for the placement angle of the second chart corresponding to the second target quadrilateral 32.
[0107] It should be understood that in this implementation, three or more test points can also be selected, and the placement angle of the corresponding second chart can be comprehensively determined based on the actual distance and standard distance of each test point. Multi-point detection yields more accurate results.
[0108] In the second implementation of this embodiment, when the number of test points is multiple, step S105 may further include:
[0109] The first step is to determine the first actual distance from the first test point to the reference point and the second actual distance from the second test point to the reference point, wherein the first test point and the second test point are any two test points from a plurality of test points;
[0110] The second step is to determine the ratio of the first actual distance to the second actual distance as the first ratio value;
[0111] The third step is to determine the first standard distance from the first test point to the benchmark point, and the second standard distance from the second test point to the benchmark point.
[0112] Step 4: Determine the ratio of the first standard distance to the second standard distance as the second ratio value;
[0113] Step 5: Based on the difference between the first ratio and the second ratio, determine whether the placement angle of each second test chart relative to the first test chart is standard.
[0114] Specifically, the closer the difference between the first and second ratios is to 0, the more standard the placement angle of the second chart is. However, in practice, a certain degree of error is allowed between the chart placement and the standard environment. Therefore, a certain error range can be set. For example, when the difference between the first and second ratios is within ±d, the placement angle of the second chart can be determined as standard. Conversely, if the difference exceeds ±d, the placement angle of the second chart is determined to be non-standard.
[0115] To better understand the above implementation method, in conjunction with, for example Figure 5 For example:
[0116] Among the above implementation methods, one can choose Figure 5 Midpoints A and B are used as test points. First, determine the actual distance SA from test point A to reference point S and the actual distance SB from test point B to reference point S in the target image, obtaining the first ratio SA / SB. Then, determine the standard distance S'A' from standard point A' to reference point S' and the standard distance S'B' from B' to reference point S' in the standard image (not shown in the figure), obtaining the second ratio S'A' / S'B'. Finally, determine whether the difference between the first ratio SA / SB and the second ratio S'A' / S'B' is within ±d, thus determining the... Figure 5 Is the placement angle of the second chart corresponding to the second target quadrilateral 32 in the standard?
[0117] In the third implementation of this embodiment, when the number of test points is multiple, step S105 may further include:
[0118] The first step is to determine the first actual distance from the first test point to the reference point and the third actual distance from the first test point to the second test point, wherein the first test point and the second test point are any two test points from a plurality of test points;
[0119] The second step is to determine the ratio of the first actual distance to the third actual distance as the third ratio value;
[0120] The third step is to determine the first standard distance from the first test point to the benchmark point, and the third standard distance from the first test point to the second test point.
[0121] Step 4: Determine the ratio of the first standard distance to the third standard distance as the fourth ratio value;
[0122] Step 5: Based on the difference between the third and fourth ratios, determine whether the placement angle of each second test chart relative to the first test chart is standard.
[0123] Specifically, the closer the difference between the third and fourth ratios is to 0, the more standard the placement angle of the second chart is. However, in practice, a certain degree of error is allowed between the chart placement and the standard environment. Therefore, a certain error range can be set. For example, when the difference between the third and fourth ratios is within ±d, the placement angle of the second chart can be determined as standard. Conversely, if the difference exceeds ±d, the placement angle of the second chart is determined to be non-standard.
[0124] To better understand the above implementation method, in conjunction with, for example Figure 5 For example:
[0125] Among the above implementation methods, one can choose Figure 5 Midpoints A and B are used as test points. First, determine the actual distance SA from test point A to reference point S and the actual distance AB from test point B to test point A in the target image, obtaining the third ratio SA / AB. Then, determine the standard distance S'A' from standard point A' to reference point S' and the standard distance A'B' from standard point B' to standard point A' (not shown in the figure) in the standard image, obtaining the fourth ratio S'A' / A'B'. Finally, determine whether the difference between the third ratio SA / AB and the fourth ratio S'A' / A'B' is within ±d, thus determining the target image. Figure 5 Is the placement angle of the second chart corresponding to the second target quadrilateral 32 in the standard?
[0126] Similarly, the determination can also be made by checking whether the difference between the third ratio SB / AB and the fourth ratio S'B' / A'B' is within ±d. Figure 5 Is the placement angle of the second chart corresponding to the second target quadrilateral 32 in the standard?
[0127] The detection method provided in this embodiment can simultaneously detect the placement angles of the first chart to be detected and multiple second charts, which is highly efficient and reliable.
[0128] Based on the same inventive concept, embodiments of the present invention also provide an angle detection device for camera module calibration test patterns. Figure 6This is a schematic diagram of the structure of an angle detection device for camera module calibration test diagram provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the device 600 includes a target image acquisition module 610, an edge line extraction module 620, a reference point determination module 630, a test point selection module 640, and an angle determination module 650.
[0129] The target image acquisition module 610 is used to capture multiple test images to be detected using a camera module to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image.
[0130] The edge line extraction module 620 is used to extract the edge lines of multiple second test images in the target image to obtain multiple second target quadrilaterals;
[0131] The reference point determination module 630 is used to determine the reference point corresponding to each second target quadrilateral. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second target quadrilateral.
[0132] The test point selection module 640 is used to select test points in each second target quadrilateral. The test points are points on or inside the edges of the second target quadrilateral.
[0133] The angle determination module 650 is used to determine whether the placement angle of each second test pattern relative to the first test pattern is standard based on the distance from the test point to the reference point.
[0134] Optionally, when the number of test points is at least one, the angle determination module 650 further includes:
[0135] The actual distance determination unit is used to determine the actual distance from the test point to the reference point;
[0136] The standard distance determination unit is used to determine the standard distance from the test point to the reference point;
[0137] Angle determination unit is used to determine whether the placement angle of each second test chart relative to the first test chart is standard, based on the ratio of the actual distance to the standard distance.
[0138] Optionally, the standard distance determination unit is also used for:
[0139] Under standard conditions, a camera module is used to capture multiple test images with standard placement angles to obtain standard images;
[0140] Extract the edge lines of multiple second test images from the standard image to obtain multiple second standard quadrilaterals, and the multiple second standard quadrilaterals correspond one-to-one with the multiple second target quadrilaterals;
[0141] Determine the reference point for each second standard quadrilateral. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second standard quadrilateral.
[0142] In each second standard quadrilateral, a standard point corresponding to the test point is selected. The position of the standard point in the second standard quadrilateral is the same as the position of the test point in the second target quadrilateral.
[0143] The distance from the standard point to the reference point in the second standard quadrilateral is determined to be the standard distance from the test point to the reference point in the corresponding second target quadrilateral.
[0144] Optionally, when there are multiple test points, the angle determination module 650 is also used for:
[0145] Determine the first actual distance from the first test point to the reference point and the second actual distance from the second test point to the reference point, wherein the first test point and the second test point are any two test points from a plurality of test points;
[0146] The ratio of the first actual distance to the second actual distance is determined as the first ratio value;
[0147] Determine the first standard distance from the first test point to the reference point, and the second standard distance from the second test point to the reference point;
[0148] The ratio of the first standard distance to the second standard distance is determined as the second ratio value;
[0149] Based on the difference between the first ratio and the second ratio, determine whether the placement angle of each second test pattern relative to the first test pattern is standard.
[0150] Optionally, when there are multiple test points, the angle determination module 650 is also used for:
[0151] Determine the first actual distance from the first test point to the reference point and the third actual distance from the first test point to the second test point, wherein the first test point and the second test point are any two test points from a plurality of test points;
[0152] The ratio of the first actual distance to the third actual distance is determined as the third ratio value;
[0153] Determine the first standard distance from the first test point to the reference point, and the third standard distance from the first test point to the second test point;
[0154] The ratio of the first standard distance to the third standard distance is determined to be the fourth ratio.
[0155] Based on the difference between the third and fourth ratios, determine whether the placement angle of each second test chart relative to the first test chart is standard.
[0156] Optionally, the edge line extraction module 620 is also used to extract the edge lines of the first test image in the target image to obtain the first target quadrilateral;
[0157] The angle determination module 650 is also used for:
[0158] Determine whether the first target quadrilateral is a rectangle;
[0159] When the first target quadrilateral is a rectangle, determine the standard for the placement angle of the first test image;
[0160] When the first target quadrilateral is not a rectangle, it is determined that the placement angle of the first test image is not standard.
[0161] Optionally, the device 600 may also include:
[0162] The image segmentation module is used to divide the target image into multiple blocks, each of which completely contains a test image.
[0163] The edge line extraction module 620 is also used to extract the edge lines of the corresponding test image from each block of image in sequence.
[0164] It is understood that the angle detection device provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the angle detection device can be divided into different functional modules to complete all or part of the functions described above.
[0165] Based on the same inventive concept, embodiments of the present invention also provide another method for angle detection of camera module calibration test patterns. This method is similar to... Figure 1 The angle detection methods for the camera module calibration test images shown are basically the same, with the only difference being that this method does not require extracting all edge lines of each test image to obtain the quadrilateral corresponding to the test image, but only needs to extract at least two non-parallel edge lines in each test image.
[0166] Figure 7 This is a flowchart of a method for detecting the angle of a camera module calibration test pattern provided in another embodiment of the present invention, as shown below. Figure 7 As shown, the method includes:
[0167] Step S701: Use a camera module to capture multiple test images to be tested to obtain the target image.
[0168] The test charts include a first test chart and multiple second test charts, with the multiple second test charts arranged at an angle relative to the first test chart.
[0169] The specific implementation of step S701 is the same as step S101 in the above embodiment. For details, please refer to the relevant description of step S101, which will not be repeated here.
[0170] Step S702: Extract the edge lines of multiple second test images from the target image to obtain at least two opposite and non-parallel edge lines for each second test image.
[0171] Specifically, edge lines can be extracted using the Sobel operator.
[0172] The specific implementation of step S702 is similar to step S102 in the above embodiments, except that: in step S102, four edge lines of each test image are extracted to obtain the target quadrilateral corresponding to each test image. However, in step S702, only two opposite and non-parallel edge lines of each test image can be extracted.
[0173] Optionally, when performing step S702, the angle detection method provided in this embodiment may further include:
[0174] Extract at least two opposing edge lines from the first test image in the target image;
[0175] The standard for the placement angle of the first test pattern is determined when at least two opposite edge lines of the first test pattern are parallel.
[0176] When at least two opposite edge lines of the first test pattern are parallel, the placement angle of the first test pattern is determined to be non-standard.
[0177] The above method can be used to check whether the placement angle of the first test image is standard.
[0178] Figure 8 This is another schematic diagram of edge line extraction for a test image provided in an embodiment of the present invention, such as... Figure 8 As shown, at this time, two opposite edge lines are extracted from the first test image 21, and two opposite and non-parallel edge lines are extracted from each second test image 32.
[0179] Step S703: Determine the reference point for each second test image. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines.
[0180] The specific implementation of step S703 is the same as step S103 in the above embodiment. For details, please refer to the relevant description of step S103, which will not be repeated here.
[0181] Step S704: Select test points in each second test graph. Test points are points on or inside the edges of the second test graph.
[0182] The specific implementation of step S704 is the same as step S104 in the above embodiment. For details, please refer to the relevant description of step S104, which will not be repeated here.
[0183] Step S705: When the first test chart is placed at the standard angle, determine whether the placement angle of each second test chart relative to the first test chart is standard based on the distance from the test point to the reference point.
[0184] The specific implementation of step S705 is the same as step S105 in the above embodiment. For details, please refer to the relevant description of step S105, which will not be repeated here.
[0185] It should be noted that, in step S705, the step of determining the standard distance from the test point to the reference point may include:
[0186] Under standard conditions, a camera module is used to capture multiple test images with standard placement angles to obtain standard images;
[0187] Extract the edge lines of multiple second test images from the standard image to obtain at least two opposing and non-parallel edge lines for each second test image;
[0188] Determine the reference point corresponding to each second test image in the standard image. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second test image.
[0189] In each second test image of the standard image, a standard point corresponding to the test point is selected. The position of the standard point in the standard image is the same as the position of the test point in the target image.
[0190] The distance from the standard point to the reference point in the standard image is determined to be the standard distance from the test point to the reference point in the corresponding target image.
[0191] Based on the same inventive concept, embodiments of the present invention also provide another angle detection device for camera module calibration test patterns. This device is similar to... Figure 7 The angle detection method for the camera module calibration test image is corresponding to that described. The device includes a target image acquisition module, an edge line extraction module, a reference point determination module, a test point selection module, and an angle determination module.
[0192] The target image acquisition module is used to capture multiple test images to be detected using a camera module to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image.
[0193] The edge line extraction module is used to extract edge lines from multiple second test images in the target image, and obtain at least two opposite and non-parallel edge lines for each second test image;
[0194] The reference point determination module determines the reference point for each second test image. The reference point is the intersection of the extensions of two opposite and non-parallel edge lines.
[0195] The test point selection module is used to select test points in each second test graph. Test points are points on or inside the edges of the second test graph.
[0196] The angle determination module is used to determine whether the placement angle of each second test pattern relative to the first test pattern is standard, based on the distance from the test point to the reference point, when the first test pattern is placed at a standard angle.
[0197] It should be noted that the above-mentioned device is related to Figure 6 The angle detection devices for the camera module calibration test patterns are basically the same, the only difference being that the edge line extraction module in the above devices is used to extract at least two opposite and non-parallel edge lines for each second test pattern, and the reference point determination module is used to determine the reference point based on the extracted at least two opposite and non-parallel edge lines. Figure 6 The edge line extraction module in the device is used to extract all edge lines of each second test image to obtain the corresponding second target quadrilateral. The reference point determination module is used to determine the reference point based on the extracted second target quadrilateral. For the specific functions of each module in this embodiment, please refer to [link to relevant documentation]. Figure 6 The relevant descriptions will not be repeated here.
[0198] This invention also provides an electronic device, which may include a processor and a memory, wherein the processor and memory can be connected via a bus or other means. The processor may be a Central Processing Unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof. The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the detection method in this invention embodiment. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the detection method in the above method embodiments.
[0199] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. The one or more modules are stored in the memory and, when executed by the processor, perform actions such as... Figure 1 The detection method in the illustrated embodiment. For specific details of the above-described electronic device, please refer to the corresponding reference. Figure 1 The relevant descriptions and effects in the illustrated embodiments are for understanding purposes only and will not be repeated here. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0200] The technical solutions described in the embodiments of this application have at least the following technical effects or advantages:
[0201] This invention provides a method, apparatus, device, and medium for detecting the angle of a camera module calibration test chart. After capturing multiple charts to be tested using a camera module to obtain target images, the edge lines of second charts rotated by a predetermined angle are extracted from the images to obtain reference points for each second chart. Then, the distance between the test point and the corresponding reference point in each second chart can be used to determine whether the chart's placement angle is standard. Since the positions of the edge lines and reference points differ for second charts with different rotation angles, the distances between the test points and the corresponding reference points will also differ. Therefore, this detection method can detect the placement angle of the chart, solving the calibration problems caused by changes in chart angle during testing, thereby improving the accuracy of the calibration results.
[0202] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0203] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.
[0204] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
Claims
1. A method for detecting the angle of a camera module calibration test pattern, characterized in that, The method includes: A camera module is used to capture multiple test images to be tested to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image. Extract the edge lines of the multiple second test images in the target image to obtain multiple second target quadrilaterals; Determine the reference point corresponding to each of the second target quadrilaterals, wherein the reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second target quadrilateral; Select test points in each of the second target quadrilaterals, where the test points are points on or inside the edges of the second target quadrilaterals; When the first test chart is placed at the standard angle, the placement angle of each second test chart relative to the first test chart is determined based on the distance from the test point to the reference point.
2. The method according to claim 1, characterized in that, When the number of test points is at least one, determining whether the placement angle of each second test pattern relative to the first test pattern is standard based on the distance from the test point to the reference point includes: Determine the actual distance from the test point to the reference point; Determine the standard distance from the test point to the reference point; Based on the ratio of the actual distance to the standard distance, determine whether the placement angle of each second test image relative to the first test image is standard.
3. The method according to claim 2, characterized in that, Determining the standard distance from the test point to the reference point includes: Under standard conditions, a camera module is used to capture images of the multiple test diagrams with standard placement angles to obtain standard images; Extract the edge lines of the multiple second test images from the standard image to obtain multiple second standard quadrilaterals, and the multiple second standard quadrilaterals correspond one-to-one with the multiple second target quadrilaterals; Determine the reference point corresponding to each of the second standard quadrilaterals, wherein the reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second standard quadrilateral; In each of the second standard quadrilaterals, a standard point corresponding to the test point is selected, and the position of the standard point in the second standard quadrilateral is the same as the position of the test point in the second target quadrilateral. The distance from the standard point in the second standard quadrilateral to the reference point is determined to be the standard distance from the test point in the corresponding second target quadrilateral to the reference point.
4. The method according to claim 1, characterized in that, When there are multiple test points, determining whether the placement angle of each second test chart relative to the first test chart is standard based on the distance from the test point to the reference point further includes: Determine a first actual distance from a first test point to the reference point, and a second actual distance from a second test point to the reference point, wherein the first test point and the second test point are any two test points from the plurality of test points; The ratio of the first actual distance to the second actual distance is determined to be the first ratio value; Determine a first standard distance from the first test point to the reference point, and a second standard distance from the second test point to the reference point; The ratio of the first standard distance to the second standard distance is determined to be the second ratio value; Based on the difference between the first ratio and the second ratio, determine whether the placement angle of each second test pattern relative to the first test pattern is standard.
5. The method according to claim 1, characterized in that, When there are multiple test points, determining whether the placement angle of each second test chart relative to the first test chart is standard based on the distance from the test point to the reference point further includes: Determine the first actual distance from the first test point to the reference point, and the third actual distance from the first test point to the second test point, wherein the first test point and the second test point are any two test points among the plurality of test points; The ratio of the first actual distance to the third actual distance is determined to be the third ratio value; Determine a first standard distance from the first test point to the reference point, and a third standard distance from the first test point to the second test point; The ratio of the first standard distance to the third standard distance is determined to be the fourth ratio. Based on the difference between the third ratio and the fourth ratio, it is determined whether the placement angle of each second test pattern relative to the first test pattern is standard.
6. The method according to claim 1, characterized in that, The method further includes: Extract the edge lines of the first test image from the target image to obtain the first target quadrilateral; Determine whether the first target quadrilateral is a rectangle; When the first target quadrilateral is a rectangle, determine the standard for the placement angle of the first test image; When the first target quadrilateral is not rectangular, it is determined that the placement angle of the first test image is not standard.
7. A method for detecting the angle of a camera module calibration test diagram, characterized in that, The method includes: A camera module is used to capture multiple test images to be tested to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image. Extract the edge lines of the plurality of second test images in the target image to obtain at least two opposing and non-parallel edge lines for each second test image; Determine a reference point for each of the second test patterns, wherein the reference point is the intersection of the extensions of the two opposing and non-parallel edge lines; In each of the second test graphs, test points are selected, where the test points are points on or inside the edges of the second test graph. When the first test chart is placed at the standard angle, the placement angle of each second test chart relative to the first test chart is determined based on the distance from the test point to the reference point.
8. An angle detection device for a camera module calibration test pattern, characterized in that, The device includes: The target image acquisition module is used to capture multiple test images to be detected using a camera module to obtain a target image. The multiple test images include a first test image and multiple second test images, which are arranged at an angle relative to the first test image. An edge line extraction module is used to extract the edge lines of the plurality of second test images in the target image to obtain a plurality of second target quadrilaterals; or, it is used to extract the edge lines of the plurality of second test images in the target image to obtain at least two opposing and non-parallel edge lines for each second test image. The reference point determination module is used to determine the reference point corresponding to each of the second target quadrilaterals, wherein the reference point is the intersection of the extensions of two opposite and non-parallel edge lines in the second target quadrilateral; or, it is used to determine the reference point of each of the second test images, wherein the reference point is the intersection of the extensions of the two opposite and non-parallel edge lines. The test point selection module is used to select test points in each of the second target quadrilaterals, wherein the test points are points on or inside the edges of the second target quadrilaterals; or, it is used to select test points in each of the second test diagrams, wherein the test points are points on or inside the edges of the second test diagrams. An angle determination module is used to determine whether the placement angle of each second test pattern relative to the first test pattern is standard, based on the distance from the test point to the reference point, when the placement angle of the first test pattern is standard.
9. An electronic device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1-6 or 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method of any one of claims 1-6 or 7.
Citation Information
Patent Citations
Detection method and device, depth camera and computer readable storage medium
CN110602486A