Chessboard correction chart encoding method, device and equipment and storage medium
By extracting feature points and encoding adjacent corner points on the checkerboard correction chart, the problem of difficulty in determining the orientation of the checkerboard correction chart is solved, thus improving the accuracy and efficiency of optical correction.
Patent Information
- Application Number
- CN202211342097.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-10-28
AI Technical Summary
Existing checkerboard correction charts, due to their bidirectional isotropic nature, make it impossible for users to accurately determine their orientation, resulting in low optical correction accuracy.
By extracting feature points from the checkerboard correction chart, determining the mask area and obtaining the diagonal intersection, and then encoding adjacent corner points after setting the origin, the orientation accuracy of the checkerboard correction chart is ensured.
It improves the accuracy and efficiency of optical correction, avoids directional errors caused by rotation at unknown angles, and enhances the accuracy of measurement and reconstruction.
Smart Images

Figure CN116012234B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical correction technology, and in particular to an encoding method, apparatus, device, and storage medium for a checkerboard correction chart. Background Technology
[0002] In the field of optical correction technology, a calibration chart of known size is generally used. The calibration camera takes an image through the calibration chart with a fixed-spacing pattern array, and then the calibration algorithm calculates to obtain the geometric model of the captured image, thereby obtaining the measurement and reconstruction results and correcting the lens distortion. The type of calibration chart used is generally a checkerboard calibration chart.
[0003] However, the checkerboard correction chart has a bidirectional isotropic property, which makes it impossible for users to distinguish the various corner points on the checkerboard correction chart when using it, and thus impossible to determine its direction. This results in a correction deviation for lens distortion, which seriously affects the accuracy of optical correction.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide an encoding method for a checkerboard correction chart, which aims to solve the technical problem that the optical correction is not accurate due to the bidirectional isotropic nature of the checkerboard correction chart during the existing image correction process.
[0006] To achieve the above objectives, the present invention provides an encoding method for a checkerboard correction chart, the encoding method comprising the following steps:
[0007] Extract a first feature point, a second feature point, and a third feature point from a first region of a target checkerboard correction chart with a target image. Determine a mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point. The positions of the first feature point and the second and third feature points are respectively connected, and the second and third feature points are diagonally adjacent.
[0008] Obtain the intersection point of two intersecting diagonals within the mask area, determine the grid where the intersection point is located as the target grid, set any corner point on the target grid as the origin, and extract the four corner points adjacent to the origin.
[0009] After encoding the four corner points respectively, all remaining corner points in the target chessboard correction chart are encoded based on the encoding of the four corner points.
[0010] Optionally, before the step of extracting the first feature point, the second feature point, and the third feature point in the first region of the target checkerboard correction chart with the target image, the method further includes:
[0011] A target scene image and a target checkerboard correction image card are obtained by taking pictures with a calibration camera. The target scene image and the target checkerboard correction image card have the same specifications, and the target image on the target scene image and the target image on the target checkerboard correction image card can correspond and overlap.
[0012] After converting the target scene image into a target grayscale image, the target grayscale image is binarized.
[0013] After determining the image contour of the target image on the target scene map based on the binarized target grayscale image, the image contour is calculated based on the image algorithm to determine the second region of the target scene map;
[0014] The target scene map and the target chessboard correction map are aligned to obtain the corresponding area on the target chessboard correction map after the alignment. The corresponding area is then used as the first area.
[0015] Optionally, the step of determining the mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point includes:
[0016] Using the first feature point as a symmetrical point, the second feature point and the third feature point are mirrored according to the symmetrical point to obtain the fourth feature point and the fifth feature point that are symmetrical to the second feature point and the third feature point;
[0017] Connect the second, third, fourth, and fifth feature points to each other, and determine the maximum bounding rectangle based on the region generated after the connection.
[0018] The largest circumscribed rectangle is defined as the mask region.
[0019] Optionally, the length of any cell on the target checkerboard correction chart is 1 unit. The steps of obtaining the intersection point of two intersecting diagonals within the mask area, determining the cell where the intersection point is located as the target cell, setting any corner point on the target cell as the origin, and then extracting the four corner points adjacent to the origin include:
[0020] Using one unit as a reference, extract the intersection point of two intersecting diagonals within the mask area, and determine the grid cell where the intersection point is located as the target grid cell;
[0021] Extract the four corner points on the target grid, and set any one of the four corner points of the target grid as the origin;
[0022] Extract the four corner points adjacent to the origin.
[0023] Optionally, after the step of extracting the four corner points adjacent to the origin, the method further includes:
[0024] Obtain the test vector set of the four corner points and the target vector set of the second feature point, the third feature point, the fourth feature point and the fifth feature point;
[0025] The direction to be measured corresponding to the set of vectors to be measured is compared with the target direction corresponding to the set of target vectors to determine whether the direction to be measured is consistent with the target direction.
[0026] If the direction to be tested is consistent with the target direction, then the step of encoding the four corner points respectively, and then encoding all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points is performed.
[0027] Optionally, the step of obtaining the test vector set of the four corner points and the target vector set of the second feature point, the third feature point, the fourth feature point, and the fifth feature point includes:
[0028] Based on the positions of the four corner points on the target chessboard correction chart, the test vector groups corresponding to the four corner points are determined. Also, with the first feature point as a reference point, the target vector group of the mask area is determined based on the positions of the second feature point, the third feature point, the fourth feature point, and the fifth feature point.
[0029] Optionally, after the step of encoding all remaining corner points in the target chessboard correction chart based on the encoding of the four corner points, the method further includes:
[0030] The image coordinates of the target image are determined by the codes corresponding to each of the four corner points.
[0031] The image coordinates are input into a preset calculation function to obtain the world coordinates used to construct the geometric model of the target image.
[0032] To achieve the above objectives, the present invention also provides an encoding device for a checkerboard correction chart, the encoding device comprising:
[0033] The determination module is used to extract a first feature point, a second feature point, and a third feature point in a first region of a target checkerboard correction chart with a target image, and to determine a mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point, wherein the position of the first feature point is connected to the position of the second feature point and the position of the third feature point, respectively, and the second feature point and the third feature point are obliquely adjacent to each other;
[0034] The extraction module is used to obtain the intersection point of two intersecting diagonals within the mask area, determine the grid where the intersection point is located as the target grid, set any corner point on the target grid as the origin, and extract the four corner points adjacent to the origin.
[0035] The encoding module is used to encode the four corner points respectively, and then encode all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points.
[0036] To achieve the above objectives, the present invention also provides an encoding device for a checkerboard correction chart. The encoding device for the checkerboard correction chart includes: a memory, a processor, and an encoding program for the checkerboard correction chart stored in the memory and executable on the processor. When the encoding program for the checkerboard correction chart is executed by the processor, it implements the steps of the above-described encoding method for the checkerboard correction chart.
[0037] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing an encoding program for a checkerboard correction chart, wherein when the encoding program for the checkerboard correction chart is executed by a processor, the steps of the above-described encoding method for the checkerboard correction chart are implemented.
[0038] In this invention, the encoding device for the checkerboard correction chart extracts a first feature point, a second feature point, and a third feature point from a first region of the target checkerboard correction chart containing the target image. Based on the first feature point, the second feature point, and the third feature point, the mask region of the target checkerboard correction chart is determined. The intersection point of two intersecting diagonals within the mask region is obtained, and the grid where the intersection point is located is determined as the target grid. After setting any corner point on the target grid as the origin, the four corner points adjacent to the origin are extracted. After encoding the four corner points respectively, all remaining corner points in the target checkerboard correction chart are encoded based on the encoding of the four corner points. This invention encodes all corner points on the checkerboard correction chart, that is, it arranges and encodes all corner points on the checkerboard correction chart in an orderly manner. This allows users to determine the correct orientation of the checkerboard correction chart by using the codes of each corner point. This avoids the inconvenience of the checkerboard correction chart losing its orientation when it rotates at an unknown angle, requiring the use of a new checkerboard correction chart for shooting. This improves the accuracy and efficiency of optical correction. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating the first embodiment of the encoding method for the chessboard correction chart of the present invention;
[0040] Figure 2 This is a schematic diagram illustrating the extraction of the first, second, and third dots in the target chessboard correction chart according to the present invention.
[0041] Figure 3 This is a schematic diagram of the process for determining the Mask region based on the first circle, the second circle, and the third circle in this invention.
[0042] Figure 4 This is a schematic diagram of the encoding process of the present invention based on the origin, which is the four corner points adjacent to the origin and all other remaining corner points;
[0043] Figure 5 This is a schematic diagram of the functional modules of the encoding device of the chessboard correction chart of the present invention.
[0044] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0045] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0046] This invention provides an encoding method for a checkerboard correction chart, referring to... Figure 1 , Figure 1This is a flowchart illustrating a first embodiment of the encoding method for a checkerboard correction chart according to the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here. In this embodiment, the encoding method for the checkerboard correction chart includes:
[0047] Step S10: Extract a first feature point, a second feature point, and a third feature point from the first region of the target checkerboard correction chart with the target image. Determine the mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point. The positions of the first feature point are connected to the positions of the second feature point and the third feature point, respectively, and the second feature point and the third feature point are diagonally adjacent.
[0048] It should be noted that the checkerboard calibration chart is a geometric model with a fixed-spaced grid array. By placing the checkerboard calibration chart in front of the calibration camera lens and taking pictures of both the chart and the target image, the target scene image and the target checkerboard calibration chart can be obtained. Combined with a professional calibration algorithm, the error value at any position within the field of view can be calculated. Then, based on the error value, the position of each pixel in the target scene image is corrected and compensated. This process implements various sophisticated image algorithms such as image translation, rotation, interpolation, reconstruction, and brightness compensation, which will not be elaborated here. By correcting and compensating the target scene image, lens distortion is corrected, and the relationship between the three-dimensional geometric position of a point on the surface of a spatial object and its corresponding point in the target scene image can be determined, thus establishing the geometric model of the target image.
[0049] However, in practical applications, it has been found that due to the bidirectional isotropic nature of the checkerboard correction chart, users cannot accurately determine the correct orientation of the checkerboard correction chart. Consequently, incorrect corrections are made to lens distortion based on the checkerboard correction chart with the wrong orientation, which is extremely detrimental to the accuracy and efficiency of measurement and reconstruction results. Therefore, how to accurately identify the orientation of the checkerboard correction chart is a problem that urgently needs to be solved.
[0050] Specifically, based on the above problems, this embodiment proposes a solution. After extracting three feature points from the first region of the target checkerboard correction chart with the target image, the three feature points are used to expand the dependency index and a self-developed encoding algorithm to encode and sort each corner point on the checkerboard correction chart in an orderly manner. This allows the user to determine the correct orientation of the checkerboard correction chart by encoding each corner point, thereby avoiding the loss of orientation of the checkerboard correction chart when it rotates at an unknown angle, and improving the accuracy and efficiency of optical correction.
[0051] Specifically, after extracting a first feature point on the first region of the target chessboard, a second and third feature point are extracted at any two positions adjacent to the first feature point, wherein the second and third feature points must be diagonally adjacent. Figure 2 For example, Figure 2 The black dot shown is the first feature point, in such a case... Figure 2 After extracting the black dots from the chessboard pattern shown as the first feature points, second feature points are extracted from the left and bottom edges adjacent to the first feature points respectively. Figure 2 The white dot to the left of the black dot) and the third feature point (i.e. Figure 2 (The white dot below the black dot), where the position of the first feature point is the central region of the target image, which is obtained through an image algorithm.
[0052] After extracting the first feature point, the second feature point, and the third feature point, a mask region on the first region is determined based on the first feature point, the second feature point, and the third feature point. The determination of the mask region can avoid interference from the non-mask region, thereby speeding up the processing speed of subsequent encoding operations and improving encoding efficiency.
[0053] Additionally, it should be noted that "connected" means mutually connected, while "adjacent" refers to being close or near. In this embodiment, adjacency is determined based on "connected".
[0054] Optionally, in one embodiment, before step S10, the method further includes:
[0055] Step A1: A target scene image and a target checkerboard correction image card with the target image are obtained by taking pictures with a calibration camera. The target scene image and the target checkerboard correction image card have the same specifications, and the target image on the target scene image and the target image on the target checkerboard correction image card can correspond and overlap.
[0056] Step A2: After converting the target scene image into a target grayscale image, the target grayscale image is binarized.
[0057] Step A3: After determining the image contour of the target image on the target scene map based on the binarized target grayscale image, the image contour is calculated based on the image algorithm to determine the second region of the target scene map;
[0058] Step A4: Align the target scene map and the target chessboard correction map card to obtain the corresponding area on the target chessboard correction map card after the second region is aligned, and use the corresponding area as the first region.
[0059] Specifically, it is not necessarily limited to obtaining the target scene map and the target checkerboard correction map through a calibration camera; it can also be obtained through other optical cameras.
[0060] After obtaining the target scene image and the target checkerboard correction image card, which each contain the same target image, in order to determine the first region of the target image on the target checkerboard correction image card, the target scene image needs to be processed by an image algorithm. Specifically, the target scene image is first converted into a target grayscale image to improve the contour detection accuracy of the target image. Then, the target grayscale image is binarized to make the contour of the target image more prominent, which facilitates the extraction of the contour of the target image.
[0061] After obtaining the contour of the target image from the binarized grayscale image, image algorithms are used to calculate the contour of the target image to obtain the central region (i.e., the second region) of the target image on the target scene map. Since the target scene map and the target checkerboard correction map are obtained by shooting the same scene model, the target scene map and the target checkerboard correction map can be superimposed. Therefore, after determining the central region of the target image on the target scene map, the target scene map and the target checkerboard correction map are superimposed to obtain the central region (i.e., the first region) of the target image on the target checkerboard correction map.
[0062] Optionally, in one embodiment, before step S10, the method further includes:
[0063] Step S101: Using the first feature point as a symmetry point, mirror the second feature point and the third feature point according to the symmetry point to obtain the fourth feature point and the fifth feature point that are symmetrical to the second feature point and the third feature point.
[0064] Step S102: Connect the second feature point, the third feature point, the fourth feature point and the fifth feature point to each other, and determine the maximum bounding rectangle based on the area generated after the connection.
[0065] Step S103: The largest circumscribed rectangle is determined as the mask region.
[0066] by Figure 3For example, in this embodiment, a line of symmetry is obtained by extending the circle A (i.e., the first feature point) as the symmetrical point. Then, a mirror operation is performed on the circles B (i.e., the second feature point) and C (i.e., the third feature point) through the line of symmetry to obtain the circles D (i.e., the fourth feature point) and E (i.e., the fifth feature point), which are symmetrical to the circles B (i.e., the second feature point), C (i.e., the third feature point), D (i.e., the fourth feature point), and E (i.e., the fifth feature point)... The rows are interconnected: connect point B (the second feature point) to point C (the third feature point), connect point C (the third feature point) to point E (the fifth feature point), connect point E (the fifth feature point) to point D (the fourth feature point), and finally connect point D (the fourth feature point) back to point B (the second feature point). This results in a graph of interconnections between the four feature points (i.e., the region generated by these interconnections). After determining the maximum bounding rectangle 'a' of this graph, rectangle 'a' is defined as... Figure 3 The masked area of the first region of the checkerboard correction chart shown avoids interference from the non-masked areas in the first region. At the same time, because the range of the masked area is significantly smaller than that of the non-masked area, the encoding operation can be performed in the smaller masked area, which can speed up the encoding operation and improve the encoding efficiency to a certain extent.
[0067] Step S20: Obtain the intersection point of two intersecting diagonals within the mask area, determine the grid where the intersection point is located as the target grid, set any corner point on the target grid as the origin, and extract the four corner points adjacent to the origin.
[0068] Specifically, the mask area has been determined in the above steps. The grid at the very center of the mask area is extracted as the target grid. Specifically, since the mask area is rectangular, the intersection of the two diagonals in the mask area can be directly extracted. The position of the intersection point is determined as the target grid. After setting any corner point on the target grid as the origin, the four corner points that are adjacent to the origin in the horizontal and vertical directions are extracted according to the origin. This is to obtain the four test directions before formal encoding. By comparing the four test directions with the target directions, the accuracy of direction recognition of the chessboard correction card is enhanced.
[0069] Optionally, in one embodiment, step S20 includes:
[0070] Step S201: Using 1 unit as a reference, extract the intersection point of two intersecting diagonals within the mask area, and determine the grid where the intersection point is located as the target grid.
[0071] Step S202: Extract the four corner points on the target grid, and set any one of the four corner points on the target grid as the origin;
[0072] Step S203: Extract the four corner points adjacent to the origin.
[0073] Specifically, in this embodiment, with Figure 4 For example, based on the steps above, the mask area of the first region on the target checkerboard correction chart has been determined. In this step, the processing range is first determined according to the mask area, that is, the mask area is regarded as the ROI (Region of Interest) to limit the processing range on the checkerboard correction chart. Limiting the processing range can reduce the processing time and reduce the interference of areas outside the ROI to the ROI, thereby improving the accuracy of subsequent processing.
[0074] according to Figure 4 As can be seen, in this embodiment, one unit is 1. Therefore, the grid extracted at the center of the mask area (i.e., ROI) is taken as the target grid (i.e., the grid where point A is located), and the length and width of the target grid are 1*1. Thus, the distance between the four corner points on the target grid is 1. According to conventional technology, this embodiment extracts the top left corner point of the target grid and sets the top left corner point as the origin. Therefore, the code of the top left corner point is (0, 0).
[0075] After obtaining the origin, the four corner points adjacent to the origin in both the horizontal and vertical directions are extracted. Figure 4 It can be seen that the origin is the top left corner of the grid where point A is located, and point A is the first feature point. The four corner points extracted based on the origin correspond to the top left corners of points B, C, D, and E, respectively. However, since the target chessboard correction card may rotate during the encoding process, if the four extracted corner points are directly encoded at this time, there is a high possibility that the orientation of the target chessboard correction card may be deviated, leading to encoding errors. Therefore, after extracting the four corner points adjacent to the origin, the next step should be to verify whether the test direction corresponding to the four corner points is accurate, thereby enhancing the accuracy of orientation recognition of the chessboard correction card.
[0076] Optionally, in one embodiment, after step S20, the method further includes:
[0077] Step S204: Obtain the test vector group of the four corner points and the target vector group of the second feature point, the third feature point, the fourth feature point and the fifth feature point;
[0078] Optionally, in one embodiment, step S204 includes:
[0079] Step B involves determining the test vector group corresponding to each of the four corner points based on their respective positions on the target chessboard correction chart, and determining the target vector group of the mask area based on the positions of the second, third, fourth, and fifth feature points, using the first feature point as a reference point.
[0080] Specifically, the test vector groups corresponding to the four corner points are determined according to their respective positions on the target chessboard correction chart. Since the names of each feature point in the mask area have been marked in the previous steps, and the four corner points exist on each feature point, the test vector groups corresponding to the four corner points can be determined based on the coordinates of the corresponding feature points. Assuming that the test vector groups are [0, 1], [-1, 0], [1, 0] and [0, -1] from top to bottom and from left to right, the test vector groups can be regarded as four quadrants. According to the definition of quadrants, the test directions corresponding to the test vector groups are [up, left, down, right].
[0081] by Figure 3 For example, taking point A (i.e., the first feature point) as the center point, let... Figure 3 The grid length on the chessboard correction chart shown is 1. Since point A (i.e., the first feature point) is the center point, the target basis is e. x =[1,0],e y = [0, 1]. Based on the target base and the positions of point B (i.e., the second feature point), point C (i.e., the third feature point), point D (i.e., the fourth feature point), and point E (i.e., the fifth feature point), determine the target vector groups of each of the following: point B (i.e., the second feature point), point C (i.e., the third feature point), point D (i.e., the fourth feature point), and point E (i.e., the fifth feature point). That is, the target vector groups of the mask region, where point B (i.e., the second feature point) is [0, 1], and point C (i.e., the third feature point) is [0, 1]. [-1, 0], D circle (i.e., the fourth feature point) [1, 0], E circle (i.e., the fifth feature point) [0, -1], therefore [0, 1], [-1, 0], [1, 0] and [0, -1] are the target vector group of the mask area. The target direction of the checkerboard correction card can be determined according to the target vector group, so as to avoid the situation that the direction cannot be accurately identified due to the rotation of the direction of the checkerboard correction card in the subsequent encoding process, and enhance the accuracy of the direction recognition of the checkerboard correction card.
[0082] Step S205: Compare the direction to be measured corresponding to the group of vectors to be measured with the target direction corresponding to the group of target vectors to determine whether the direction to be measured is consistent with the target direction;
[0083] Step S206: If the direction to be tested is consistent with the target direction, then the step of encoding the four corner points respectively, and then encoding all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points is performed.
[0084] After obtaining the test direction [up, left, down, right] and the target direction [up, left, down, right], the two sets of directions are compared. It can be seen that the test direction and the target direction are completely equal. Therefore, it can be concluded that the direction of the target chessboard correction card is correct. The four corner points are encoded based on their current positions, and there is no encoding error caused by directional deviation.
[0085] Step S30: After encoding the four corner points respectively, encode all remaining corner points in the target chessboard correction chart based on the encoding of the four corner points.
[0086] Specifically, refer to Figure 4 As shown, given the correct orientation of the target chessboard correction chart, and knowing that the origin is coded as (0, 0), the four corner points are coded based on the correct orientation and the origin, resulting in corner codes of [0, 1], [-1, 0], [1, 0], and [0, -1]. After confirming the origin and the codes of the four corner points, the remaining corner points on the target chessboard correction chart are then coded, as shown below. Figure 4 The codes (-2,2), (-1,2), (1,0), etc. shown are used to arrange and encode all corner points on the chessboard correction chart in an orderly manner, so that users can determine the correct orientation of the chessboard correction chart by the codes of each corner point.
[0087] Optionally, in one embodiment, after step S30, the method further includes:
[0088] Step S301: Determine the image coordinates of the target image by using the codes corresponding to each of the four corner points and the codes of the four corner points respectively;
[0089] Step S302: Substitute the image coordinates into a preset calculation function to obtain the world coordinates for constructing the geometric model of the target image.
[0090] Specifically, after obtaining the codes corresponding to all the remaining corner points on the target chessboard correction chart through encoding operations, the following can be obtained: Figure 4The target checkerboard correction chart shown is what it looks like after all corner points are encoded. The code corresponding to each corner point is the image coordinate. The image coordinates of the target scene are determined based on the target checkerboard correction chart. The image coordinates are then substituted into a preset calculation function (i.e., the function formula used in conventional technology to obtain world coordinates from image coordinates). After passing through the preset calculation function, the world coordinates of the model corresponding to the target scene can be obtained. Here, the image coordinates are two-dimensional coordinates, and the world coordinates are three-dimensional coordinates.
[0091] It should be noted that when there is a need to enlarge the target scene image due to certain requirements, simply adjusting the number and size of the black and white squares in the target checkerboard correction chart will make the target checkerboard correction chart correspond to the enlarged target scene image. This eliminates the need to replace the checkerboard correction chart with a new one, thus improving the utilization rate of the checkerboard correction chart. Furthermore, multi-view correction can be achieved based on the encoding of the checkerboard correction chart.
[0092] In this embodiment, a first feature point, a second feature point, and a third feature point are extracted from the first region of the target checkerboard correction image. Based on these feature points, a mask region of the target checkerboard correction image is determined. The intersection of two intersecting diagonals within the mask region is obtained, and the cell containing this intersection is identified as the target cell. Any corner point on the target cell is set as the origin. The four corner points adjacent to the origin are then extracted and encoded. Finally, all remaining corner points in the target checkerboard correction image are encoded based on the encoding of these four corner points. This invention encodes all corner points on the checkerboard correction image, i.e., it arranges and encodes all corner points in an orderly manner. This allows users to determine the correct orientation of the checkerboard correction image through the encoding of each corner point. This avoids the inconvenience of losing orientation when the checkerboard correction image rotates at an unknown angle, requiring the use of a new checkerboard correction image for shooting, thus improving the accuracy and efficiency of optical correction.
[0093] The present invention also provides an encoding device for a checkerboard correction chart, referring to... Figure 5 The encoding device for the checkerboard correction chart includes:
[0094] The determining module 10 is used to extract a first feature point, a second feature point, and a third feature point in a first region of a target checkerboard correction chart with a target image, and to determine a mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point, wherein the position of the first feature point is connected to the position of the second feature point and the position of the third feature point, respectively, and the second feature point and the third feature point are diagonally adjacent.
[0095] Extraction module 20 is used to obtain the intersection point of two intersecting diagonals within the mask area, determine the grid where the intersection point is located as the target grid, set any corner point on the target grid as the origin, and extract the four corner points adjacent to the origin.
[0096] The encoding module 30 is used to encode the four corner points separately, and then encode all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points.
[0097] Furthermore, module 10 is determined to be used for:
[0098] A target scene image and a target checkerboard correction image card are obtained by taking pictures with a calibration camera. The target scene image and the target checkerboard correction image card have the same specifications, and the target image on the target scene image and the target image on the target checkerboard correction image card can correspond and overlap.
[0099] After converting the target scene image into a target grayscale image, the target grayscale image is binarized.
[0100] After determining the image contour of the target image on the target scene map based on the binarized target grayscale image, the image contour is calculated based on the image algorithm to determine the second region of the target scene map;
[0101] Align the target scene map and the target chessboard correction map card to match, obtain the corresponding area of the second area after the alignment on the target chessboard correction map card, and take the corresponding area as the first area.
[0102] Furthermore, module 10 is determined to be used for:
[0103] Using the first feature point as the symmetrical point, the second and third feature points are mirrored according to the symmetrical point to obtain the fourth and fifth feature points that are symmetrical to the second and third feature points;
[0104] Connect the second, third, fourth, and fifth feature points to each other, and determine the maximum bounding rectangle based on the region generated after the connection.
[0105] The largest bounding rectangle is defined as the mask region.
[0106] Furthermore, the extraction module 20 is used for:
[0107] Using one unit as a baseline, extract the intersection point of two intersecting diagonals within the mask area, and determine the cell where the intersection point is located as the target cell;
[0108] Extract the four corner points of the target cell, and set any one of the four corner points of the target cell as the origin;
[0109] Extract the four corner points adjacent to the origin.
[0110] Furthermore, module 10 is determined to be used for:
[0111] Obtain the test vector set of the four corner points and the target vector set of the second, third, fourth and fifth feature points;
[0112] The direction to be measured corresponding to the set of vectors to be measured is compared with the target direction corresponding to the set of target vectors to determine whether the direction to be measured is consistent with the target direction.
[0113] If the direction to be measured is consistent with the target direction, then the steps of encoding the four corner points separately and then encoding all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points are performed.
[0114] Furthermore, module 10 is determined to be used for:
[0115] Based on the positions of the four corner points on the target chessboard correction chart, determine the test vector group corresponding to each of the four corner points. Also, using the first feature point as a reference point, determine the target vector group of the mask area based on the positions of the second, third, fourth, and fifth feature points.
[0116] Furthermore, module 10 is determined to be used for:
[0117] The image coordinates of the target image are determined by the codes corresponding to each corner point and the codes of the four corner points;
[0118] The image coordinates are input into a preset calculation function to obtain the world coordinates for constructing the geometric model of the target image.
[0119] Furthermore, this invention also proposes an encoding device for a checkerboard correction chart. The encoding device comprises a housing, a communication module, a main control module (e.g., a microcontroller unit (MCU), a speaker, a microphone, and a memory. The main control module may include a microprocessor, an audio decoding unit, a power supply and power management unit, sensors required by the system, and other active or passive components (which can be replaced, removed, or added according to actual functions) to realize audio reception and playback functions. The encoding device for the checkerboard correction chart can establish a communication connection with a user terminal through the communication module. The memory of the encoding device can store the encoding program for the checkerboard correction chart. The microprocessor can be used to call the encoding program stored in the memory and perform the following operations:
[0120] Extract a first feature point, a second feature point, and a third feature point from the first region of the target checkerboard correction chart with the target image. Determine the mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point. The position of the first feature point is connected to the position of the second feature point and the position of the third feature point, respectively. The second feature point and the third feature point are diagonally adjacent to each other.
[0121] Obtain the intersection point of two intersecting diagonals within the mask area, determine the cell where the intersection point is located as the target cell, set any corner point on the target cell as the origin, and then extract the four corner points adjacent to the origin.
[0122] After encoding the four corner points individually, the remaining corner points in the target chessboard correction chart are encoded based on the encoding of the four corner points.
[0123] Furthermore, prior to the step of extracting the first feature point, the second feature point, and the third feature point in the first region of the target checkerboard correction chart with the target image, the method further includes:
[0124] A target scene image and a target checkerboard correction image card are obtained by taking pictures with a calibration camera. The target scene image and the target checkerboard correction image card have the same specifications, and the target image on the target scene image and the target image on the target checkerboard correction image card can correspond and overlap.
[0125] After converting the target scene image into a target grayscale image, the target grayscale image is binarized.
[0126] After determining the image contour of the target image on the target scene map based on the binarized target grayscale image, the image contour is calculated based on the image algorithm to determine the second region of the target scene map;
[0127] The target scene map and the target chessboard correction map are aligned to obtain the corresponding area on the target chessboard correction map after the alignment. The corresponding area is then used as the first area.
[0128] Further, the step of determining the mask region of the target checkerboard correction chart based on the first feature point, the second feature point, and the third feature point includes:
[0129] Using the first feature point as a symmetrical point, the second feature point and the third feature point are mirrored according to the symmetrical point to obtain the fourth feature point and the fifth feature point that are symmetrical to the second feature point and the third feature point;
[0130] Connect the second, third, fourth, and fifth feature points to each other, and determine the maximum bounding rectangle based on the region generated after the connection.
[0131] The largest circumscribed rectangle is defined as the mask region.
[0132] Furthermore, the length of any cell on the target checkerboard correction chart is 1 unit. The steps of obtaining the intersection point of two intersecting diagonals within the mask area, determining the cell where the intersection point is located as the target cell, setting any corner point on the target cell as the origin, and then extracting the four corner points adjacent to the origin include:
[0133] Using one unit as a reference, extract the intersection point of two intersecting diagonals within the mask area, and determine the grid cell where the intersection point is located as the target grid cell;
[0134] Extract the four corner points on the target grid, and set any one of the four corner points of the target grid as the origin;
[0135] Extract the four corner points adjacent to the origin.
[0136] Furthermore, after the step of extracting the four corner points adjacent to the origin, the method further includes:
[0137] Obtain the test vector set of the four corner points and the target vector set of the second feature point, the third feature point, the fourth feature point and the fifth feature point;
[0138] The direction to be measured corresponding to the set of vectors to be measured is compared with the target direction corresponding to the set of target vectors to determine whether the direction to be measured is consistent with the target direction.
[0139] If the direction to be tested is consistent with the target direction, then the step of encoding the four corner points respectively, and then encoding all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points is performed.
[0140] Further, the step of obtaining the test vector set of the four corner points and the target vector set of the second feature point, the third feature point, the fourth feature point, and the fifth feature point includes:
[0141] Based on the positions of the four corner points on the target chessboard correction chart, the test vector groups corresponding to the four corner points are determined. Also, with the first feature point as a reference point, the target vector group of the mask area is determined based on the positions of the second feature point, the third feature point, the fourth feature point, and the fifth feature point.
[0142] Furthermore, after the step of encoding all remaining corner points in the target chessboard correction chart based on the encoding of the four corner points, the method further includes:
[0143] The image coordinates of the target image are determined by the codes corresponding to each of the four corner points.
[0144] The image coordinates are input into a preset calculation function to obtain the world coordinates used to construct the geometric model of the target image.
[0145] All embodiments of the encoding device for the checkerboard correction chart of the present invention can refer to the various embodiments of the encoding method for the checkerboard correction chart of the present invention, and will not be repeated here.
[0146] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing an encoding program for a checkerboard correction chart. When the encoding program for the checkerboard correction chart is executed by a processor, it implements the steps of the above-described encoding method for the checkerboard correction chart.
[0147] All embodiments of the computer-readable storage medium of the present invention can be referred to in the various embodiments of the encoding method of the checkerboard correction chart of the present invention, which will not be repeated here.
[0148] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0149] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0151] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for encoding a checkerboard correction chart, characterized in that, The encoding method of the chessboard correction chart includes the following steps: Extract a first feature point in a first region of a target checkerboard correction chart with a target image, wherein the position of the first feature point is the center region of the first region, and the first region is the corresponding region of the target image on the target checkerboard correction chart. Extract a second feature point and a third feature point from any two positions connected to the position of the first feature point, wherein the second feature point and the third feature point are obliquely adjacent. Using the first feature point as a symmetrical point, the second feature point and the third feature point are mirrored according to the symmetrical point to obtain the fourth feature point and the fifth feature point that are symmetrical to the second feature point and the third feature point; Connect the second, third, fourth, and fifth feature points to each other, and determine the maximum bounding rectangle based on the region generated after the connection. The maximum circumscribed rectangle is defined as the mask region; Obtain the intersection point of two intersecting diagonals within the mask area, determine the grid where the intersection point is located as the target grid, set any corner point on the target grid as the origin, and extract the four corner points adjacent to the origin. After encoding the four corner points respectively, all remaining corner points in the target chessboard correction chart are encoded based on the encoding of the four corner points.
2. The encoding method of the chessboard correction chart as described in claim 1, characterized in that, Before the step of extracting the first feature point in the first region of the target checkerboard correction chart with the target image, the method further includes: A target scene image and a target checkerboard correction image card are obtained by taking pictures with a calibration camera. The target scene image and the target checkerboard correction image card have the same specifications, and the target image on the target scene image and the target image on the target checkerboard correction image card can correspond and overlap. After converting the target scene image into a target grayscale image, the target grayscale image is binarized. After determining the image contour of the target image on the target scene map based on the binarized target grayscale image, the image contour is calculated based on the image algorithm to determine the second region of the target scene map; The target scene map and the target chessboard correction map are aligned to obtain the corresponding area on the target chessboard correction map after the alignment. The corresponding area is then used as the first area.
3. The encoding method of the chessboard correction chart as described in claim 1, characterized in that, The length of any grid on the target chessboard correction chart is 1 unit. The steps of obtaining the intersection point of two intersecting diagonals within the mask area, determining the grid where the intersection point is located as the target grid, setting any corner point on the target grid as the origin, and then extracting the four corner points adjacent to the origin include: Using one unit as a reference, extract the intersection point of two intersecting diagonals within the mask area, and determine the grid cell where the intersection point is located as the target grid cell; Extract the four corner points on the target grid, and set any one of the four corner points of the target grid as the origin; Extract the four corner points adjacent to the origin.
4. The encoding method of the chessboard correction chart as described in claim 3, characterized in that, After the step of extracting the four corner points adjacent to the origin, the method further includes: Obtain the test vector set of the four corner points and the target vector set of the second feature point, the third feature point, the fourth feature point and the fifth feature point; The direction to be measured corresponding to the set of vectors to be measured is compared with the target direction corresponding to the set of target vectors to determine whether the direction to be measured is consistent with the target direction. If the direction to be tested is consistent with the target direction, then the step of encoding the four corner points respectively, and then encoding all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points is performed.
5. The encoding method of the checkerboard correction chart as described in claim 4, characterized in that, The step of obtaining the test vector group of the four corner points and the target vector group of the second feature point, the third feature point, the fourth feature point and the fifth feature point includes: Based on the positions of the four corner points on the target chessboard correction chart, the test vector groups corresponding to the four corner points are determined. Also, with the first feature point as a reference point, the target vector group of the mask area is determined based on the positions of the second feature point, the third feature point, the fourth feature point, and the fifth feature point.
6. The encoding method of the chessboard correction chart as described in any one of claims 1 to 5, characterized in that, After the step of encoding all remaining corner points in the target chessboard correction chart based on the encoding of the four corner points, the method further includes: The image coordinates of the target image are determined by the codes corresponding to each of the four corner points. The image coordinates are input into a preset calculation function to obtain the world coordinates used to construct the geometric model of the target image.
7. An encoding device for a checkerboard correction chart, characterized in that, The encoding device of the chessboard correction chart includes: A determination module is used to extract a first feature point in a first region of a target checkerboard correction chart containing a target image, wherein the position of the first feature point is the center region of the first region, and the first region is the corresponding region of the target image on the target checkerboard correction chart; extract a second feature point and a third feature point at any two positions adjacent to the position of the first feature point, wherein the second feature point and the third feature point are diagonally adjacent; using the first feature point as a symmetry point, mirror the second feature point and the third feature point according to the symmetry point to obtain a fourth feature point and a fifth feature point symmetrical to the second feature point and the third feature point; connect the second feature point, the third feature point, the fourth feature point and the fifth feature point to each other, and determine the maximum bounding rectangle based on the region generated after the connection; the maximum bounding rectangle is determined as the mask region; The extraction module is used to obtain the intersection point of two intersecting diagonals within the mask area, determine the grid where the intersection point is located as the target grid, set any corner point on the target grid as the origin, and extract the four corner points adjacent to the origin. The encoding module is used to encode the four corner points respectively, and then encode all the remaining corner points in the target chessboard correction chart based on the encoding of the four corner points.
8. An encoding device for a checkerboard correction chart, characterized in that, The encoding device of the checkerboard correction chart includes: a memory, a processor, and an encoding program for the checkerboard correction chart stored in the memory and executable on the processor, wherein the encoding program for the checkerboard correction chart is configured to implement the steps of the encoding method for the checkerboard correction chart as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores an encoding program for a checkerboard correction chart, which, when executed by a processor, implements the steps of the encoding method for the checkerboard correction chart as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Corner point coding method, calibration method and device, electronic equipment and storage medium
CN111739106A
Corner point marking method, parameter calibration method, medium and electronic equipment
CN114494316A