Angular point extraction method and system based on checkerboard
By introducing feature circles and affine transformation matrix into the corner point extraction method, combined with yolov8 model detection, the problem of cumbersome, time-consuming, misidentified and unidentified corner point extraction process in the existing technology is solved, and high precision and high Efficient corner coordinate extraction.
Patent Information
- Application Number
- CN202411775782.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN119251516A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer data processing, and in particular to a checkerboard-based corner point extraction method and system. Background Art
[0002] Corner point extraction plays a key role in camera calibration, and the accuracy of corner point extraction determines whether the camera calibration result is accurate.
[0003] At present, the main method for calibrating corner points is to preprocess the image through a corner extraction function (such as findChessboardCorners in opencv), extract corner points based on pixel difference values, and finally determine the precise corner point information through a sub-pixel gradient descent method.
[0004] However, the above method has the following defects, including: (1) When the image quality is not high or there are complex background factors, a large number of corner points will not be recognized or will be misrecognized during the recognition process. Even for the points that are successfully recognized, the accuracy still does not meet the requirements, and the error is more than 10 pixels, requiring further sub-pixel extraction. (2) The corner point extraction process is cumbersome. The image needs to be preprocessed, grayscale binarized, and blurred to improve the recognition accuracy, and the extracted corner points still have errors, requiring further sub-pixel corner point detection to obtain the final corner point results. (3) Corner point extraction takes a long time. Under the premise of good image quality, it still takes 1-2 seconds to complete. Under the premise of average quality, it is easy to fail to recognize or it takes 10 seconds or even more to complete the recognition.
[0005] Therefore, there is an urgent need for a new corner point extraction method that can obtain the precise corner point coordinates more directly and quickly, solving the problems of cumbersome corner point extraction process, time-consuming, misidentification and non-recognition in the prior art. Summary of the invention
[0006] The technical problem to be solved by the embodiments of the present invention is to provide a checkerboard-based corner point extraction method and system, which can obtain the precise corner point coordinate position more directly and quickly, and solve the problems of cumbersome corner point extraction process, time-consuming, misidentification and non-identification in the prior art.
[0007] In order to solve the above technical problem, an embodiment of the present invention provides a checkerboard-based corner point extraction method, the method comprising the following steps: A checkerboard is obtained, which is composed of cells arranged in a determinant-column combination, and each cell at the three vertex corners of the checkerboard is covered with a characteristic circle, and other cells in the checkerboard except the three cells covered with the characteristic circles are set to be characterized as a corner point; In the chessboard, a characteristic circle is selected as the origin to construct a plane rectangular coordinate system, and based on the plane rectangular coordinate system, the plane coordinates of three characteristic circles and the plane coordinates of all corner points in the plane rectangular coordinate system are calculated, and based on the plane coordinates of the three characteristic circles in the plane rectangular coordinate system, the first right triangle is drawn; Acquire an image of the chessboard taken by a camera, and import the acquired image into a preset characteristic circle detection model to obtain pixel coordinates of three characteristic circles and pixel coordinates of all corner points in a pixel coordinate system, and draw a second right triangle based on the pixel coordinates of the three characteristic circles in the pixel coordinate system; Determine the correspondence between the first right triangle and the second right triangle, and construct an affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system based on the plane coordinates and pixel coordinates of the three characteristic circles, and further convert the plane coordinates of all corner points into corresponding pixel coordinates based on the transformation matrix to achieve extraction of all corner points in the acquired image based on pixel coordinates.
[0008] The total length of the chessboard is 12 mm and the total width is 7.5 mm; the cell is 12*12, with a total of 3 characteristic circles and 141 corner points.
[0009] The plane coordinates and pixel coordinates of the three characteristic circles are all represented by the coordinates of their respective circle centers.
[0010] The characteristic circle detection model is constructed based on the yolov8 model and is trained using the original chessboard image as a training sample.
[0011] The embodiment of the present invention further provides a checkerboard-based corner point extraction system, comprising: A chessboard acquisition unit is used to acquire a chessboard composed of cells arranged in a determinant-column combination, and each cell at the three vertex corners of the chessboard is covered with a characteristic circle, and the other cells in the chessboard except the three cells covered with the characteristic circles are set to be characterized as a corner point; A plane rectangular coordinate calculation unit, used for selecting a characteristic circle as the origin in the chessboard to construct a plane rectangular coordinate system, and based on the plane rectangular coordinate system, calculating the plane coordinates of three characteristic circles and the plane coordinates of all corner points in the plane rectangular coordinate system, and drawing the first right triangle based on the plane coordinates of the three characteristic circles in the plane rectangular coordinate system; A pixel coordinate calculation unit, used for acquiring an image of the chessboard taken by a camera, and importing the acquired image into a preset characteristic circle detection model to obtain the pixel coordinates of three characteristic circles and the pixel coordinates of all corner points in a pixel coordinate system, and drawing a second right triangle based on the pixel coordinates of the three characteristic circles in the pixel coordinate system; An affine transformation unit is used to determine the correspondence between the first right triangle and the second right triangle, and to construct an affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system according to the plane coordinates and pixel coordinates of the three characteristic circles, and further to convert the plane coordinates of all corner points into corresponding pixel coordinates according to the transformation matrix, so as to realize the extraction of all corner points in the acquired image based on pixel coordinates.
[0012] The total length of the chessboard is 12 mm and the total width is 7.5 mm; the cell is 12*12, with a total of 3 characteristic circles and 141 corner points.
[0013] The plane coordinates and pixel coordinates of the three characteristic circles are all represented by the coordinates of their respective circle centers.
[0014] The characteristic circle detection model is constructed based on the yolov8 model and is trained using the original chessboard image as a training sample.
[0015] Implementing the embodiments of the present invention has the following beneficial effects: Different from the traditional direct corner point identification method, the present invention designs a chessboard with a characteristic circle, which uses the characteristic circle to determine the corner point position, avoiding misjudgment and missed judgment. It only needs to identify the obvious characteristic circle position to quickly affine the corner point image position, so that the precise corner point coordinate position can be obtained more directly and quickly, solving the problems of cumbersome corner point extraction process, time-consuming, misidentification and non-identification in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, without paying creative labor, other drawings obtained based on these drawings still belong to the scope of the present invention.
[0017] Figure 1 A flowchart of a checkerboard-based corner point extraction method provided by an embodiment of the present invention; Figure 2 A diagram of a chessboard architecture in a chessboard-based corner point extraction method provided by an embodiment of the present invention; Figure 3 A schematic structural diagram of a checkerboard-based corner point extraction system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings.
[0019] like Figure 1 As shown in the figure, a checkerboard-based corner point extraction method is proposed in an embodiment of the present invention, comprising the following steps: Step S1, obtaining a chessboard composed of cells arranged in a determinant-column combination, wherein the cells at the three vertex corners of the chessboard are each covered with a characteristic circle, and setting the other cells in the chessboard except the three cells covered with the characteristic circles to be characterized as a corner point; The specific process is to design a rectangular chessboard with a total length of 12mm and a total width of 7.5mm; the cells are arranged in a determinant combination of 12*12, such as Figure 2 shown.
[0020] At this time, each cell at the three corners of the chessboard is covered with a characteristic circle, so that the three characteristic circles at the three corners of the chessboard form a right triangle, with the center of the circle at the center of the grid, and the grid where the characteristic circle is located as the boundary. Figure 2 In the figure, the chessboard has four circles representing characteristic circles, among which the upper left, lower left and upper right circles are recorded as three characteristic circles, and the remaining 141 cells are recorded as corner points.
[0021] Step S2, in the chessboard, a characteristic circle is selected as the origin to construct a plane rectangular coordinate system, and based on the plane rectangular coordinate system, the plane coordinates of three characteristic circles and the plane coordinates of all corner points in the plane rectangular coordinate system are calculated, and based on the plane coordinates of the three characteristic circles in the plane rectangular coordinate system, the first right triangle is drawn; The specific process is to construct a plane rectangular coordinate system with the cell where the characteristic circle in the upper left corner of the chessboard is located as the origin, and make the horizontal and vertical distances of each adjacent corner point 1, so that the plane coordinates of all corner points and the plane coordinates of the three characteristic circles can be obtained. Among them, the plane coordinates of the three characteristic circles are expressed by the coordinates of their respective centers. For example, the plane coordinates of the three characteristic circles are arranged in order as (0.5, 0.5), (11.5, 0.5), and (0.5, 11.5).
[0022] At this time, the long side, short side and hypotenuse of the first right triangle are drawn according to the plane coordinates of the three characteristic circles, so as to establish a corresponding relationship with the second right triangle in the pixel coordinate system later.
[0023] Step S3, obtaining an image of the chessboard taken by a camera, and importing the obtained image into a preset characteristic circle detection model to obtain pixel coordinates of three characteristic circles and pixel coordinates of all corner points in a pixel coordinate system, and drawing a second right triangle based on the pixel coordinates of the three characteristic circles in the pixel coordinate system; The specific process is as follows: first, a characteristic circle detection model is pre-built based on the yolov8 model, and the original checkerboard image with characteristic circles is used as a training sample for training; wherein the original checkerboard image with characteristic circles is taken at multiple angles and different light intensities, and carries the logos of three characteristic circles. It should be noted that the construction and training of the characteristic circle detection model are both achieved by using common technical means in this field, which will not be repeated here.
[0024] Secondly, by importing the live image of the chessboard captured by the camera into the characteristic circle detection model, the three characteristic circles can be quickly detected, and based on the pixel coordinates of the image, the pixel coordinates of the three characteristic circles in the pixel coordinate system are obtained, and the pixel coordinates of all corner points are further obtained. Among them, the pixel coordinates of the three characteristic circles are also expressed by the coordinates of their respective center points.
[0025] Finally, based on the pixel coordinates of the three characteristic circles in the pixel coordinate system, the long side, short side and hypotenuse of the second right triangle are drawn to establish a corresponding relationship with the first right triangle in the plane coordinate system in step S2. For example, the distance between the pixel points of the three characteristic circles is calculated, and the long side, short side and hypotenuse are determined according to the right triangle, thereby determining the right angle point and the two corner points.
[0026] Step S4, determine the correspondence between the first right triangle and the second right triangle, and construct an affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system based on the plane coordinates and pixel coordinates of the three characteristic circles, and further convert the plane coordinates of all corner points into corresponding pixel coordinates based on the transformation matrix to achieve extraction of all corner points in the acquired image based on pixel coordinates.
[0027] The specific process is as follows: first, determine the corresponding relationship between the first right triangle and the second right triangle. For example, by calculating the angle between the long side of the second right triangle and the long side of the first right triangle, the direction of the chessboard on the image can be determined. At the same time, with the right angle point as the reference, the remaining characteristic circles are sorted clockwise.
[0028] Secondly, through the getPerspectiveTransform function, the plane coordinates of the three characteristic circles in the plane rectangular coordinate system and the pixel coordinates of the three characteristic circles identified on the image are input, and the affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system is calculated.
[0029] Finally, since the order of the three feature circles is fixed, the matching of the three feature circles is indirectly completed, and the transformation matrix is also the transformation matrix of the corner points. Therefore, according to the transformation matrix, the plane coordinates of all corner points are converted into corresponding pixel coordinates, thereby realizing the extraction of all corner points based on pixel coordinates in the acquired image.
[0030] In an embodiment of the present invention, a checkerboard-based corner point extraction method in an embodiment of the present invention is simulated and verified. It can be seen that only by identifying the obvious feature point positions, the position information of all corner points can be accurately extracted with an accuracy of 0.0001 pixels. Moreover, it takes 7200ms from the start of operation to the completion of the corner point extraction of 9 pictures, and an average of 0.8s per picture. This is different from the traditional opencv extraction method, which needs to complete the extraction in 1-2s at the fastest according to the quality of the picture.
[0031] like Figure 3 As shown in the figure, a checkerboard-based corner point extraction system is provided in an embodiment of the present invention, comprising: A chessboard acquisition unit 110 is used to acquire a chessboard composed of cells arranged in a determinant-column combination, and each cell at the three vertex corners of the chessboard is covered with a characteristic circle, and the other cells in the chessboard except the three cells covered with the characteristic circle are set to be characterized as a corner point; A plane rectangular coordinate calculation unit 120, configured to select a characteristic circle as the origin in the chessboard to construct a plane rectangular coordinate system, and calculate the plane coordinates of three characteristic circles and the plane coordinates of all corner points in the plane rectangular coordinate system based on the plane rectangular coordinate system, and draw a first right-angled triangle based on the plane coordinates of the three characteristic circles in the plane rectangular coordinate system; A pixel coordinate calculation unit 130 is used to obtain an image of the chessboard taken by a camera, and import the obtained image into a preset characteristic circle detection model to obtain the pixel coordinates of the three characteristic circles and the pixel coordinates of all corner points in the pixel coordinate system, and draw a second right triangle based on the pixel coordinates of the three characteristic circles in the pixel coordinate system; The affine transformation unit 140 is used to determine the correspondence between the first right triangle and the second right triangle, and construct an affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system according to the plane coordinates and pixel coordinates of the three characteristic circles, and further convert the plane coordinates of all corner points into corresponding pixel coordinates according to the transformation matrix, so as to realize the extraction of all corner points in the acquired image based on pixel coordinates.
[0032] The total length of the chessboard is 12 mm and the total width is 7.5 mm; the cell is 12*12, with a total of 3 characteristic circles and 141 corner points.
[0033] The plane coordinates and pixel coordinates of the three characteristic circles are all represented by the coordinates of their respective circle centers.
[0034] The characteristic circle detection model is constructed based on the yolov8 model and is trained using the original chessboard image as a training sample.
[0035] Implementing the embodiments of the present invention has the following beneficial effects: Different from the traditional direct corner point identification method, the present invention designs a chessboard with a characteristic circle, which uses the characteristic circle to determine the corner point position, avoiding misjudgment and missed judgment. It only needs to identify the obvious characteristic circle position to quickly affine the corner point image position, so that the precise corner point coordinate position can be obtained more directly and quickly, solving the problems of cumbersome corner point extraction process, time-consuming, misidentification and non-identification in the prior art.
[0036] It is worth noting that in the above system embodiment, the various system modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the various functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0037] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, disk, CD-ROM, etc.
[0038] The above disclosure is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A checkerboard-based corner point extraction method, characterized in that: The method comprises the following steps: A checkerboard is obtained, which is composed of cells arranged in a determinant-column combination, and each cell at the three vertex corners of the checkerboard is covered with a characteristic circle, and other cells in the checkerboard except the three cells covered with the characteristic circles are set to be characterized as a corner point; In the chessboard, a characteristic circle is selected as the origin to construct a plane rectangular coordinate system, and based on the plane rectangular coordinate system, the plane coordinates of three characteristic circles and the plane coordinates of all corner points in the plane rectangular coordinate system are calculated, and based on the plane coordinates of the three characteristic circles in the plane rectangular coordinate system, the first right triangle is drawn; Acquire an image of the chessboard taken by a camera, and import the acquired image into a preset characteristic circle detection model to obtain pixel coordinates of three characteristic circles and pixel coordinates of all corner points in a pixel coordinate system, and draw a second right triangle based on the pixel coordinates of the three characteristic circles in the pixel coordinate system; Determine the correspondence between the first right triangle and the second right triangle, and construct an affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system based on the plane coordinates and pixel coordinates of the three characteristic circles, and further convert the plane coordinates of all corner points into corresponding pixel coordinates based on the transformation matrix to achieve extraction of all corner points in the acquired image based on pixel coordinates.
2. The checkerboard-based corner point extraction method according to claim 1, characterized in that: The total length of the chessboard is 12 mm and the total width is 7.5 mm; wherein the cell is 12*12, with a total of 3 characteristic circles and 141 corner points.
3. The checkerboard-based corner point extraction method according to claim 2, characterized in that: The plane coordinates and pixel coordinates of the three characteristic circles are all expressed by the coordinates of their respective circle centers.
4. The checkerboard-based corner point extraction method according to claim 3, characterized in that: The characteristic circle detection model is constructed based on the yolov8 model and is trained using the original chessboard image as a training sample.
5. A checkerboard-based corner point extraction system, characterized in that: include: A chessboard acquisition unit is used to acquire a chessboard composed of cells arranged in a determinant-column combination, and each cell at the three vertex corners of the chessboard is covered with a characteristic circle, and the other cells in the chessboard except the three cells covered with the characteristic circles are set to be characterized as a corner point; A plane rectangular coordinate calculation unit, used for selecting a characteristic circle as the origin in the chessboard to construct a plane rectangular coordinate system, and based on the plane rectangular coordinate system, calculating the plane coordinates of three characteristic circles and the plane coordinates of all corner points in the plane rectangular coordinate system, and drawing the first right triangle based on the plane coordinates of the three characteristic circles in the plane rectangular coordinate system; A pixel coordinate calculation unit, used for acquiring an image of the chessboard taken by a camera, and importing the acquired image into a preset characteristic circle detection model to obtain the pixel coordinates of three characteristic circles and the pixel coordinates of all corner points in a pixel coordinate system, and drawing a second right triangle based on the pixel coordinates of the three characteristic circles in the pixel coordinate system; An affine transformation unit is used to determine the correspondence between the first right triangle and the second right triangle, and to construct an affine transformation matrix between the pixel coordinate system and the plane rectangular coordinate system according to the plane coordinates and pixel coordinates of the three characteristic circles, and further to convert the plane coordinates of all corner points into corresponding pixel coordinates according to the transformation matrix, so as to realize the extraction of all corner points in the acquired image based on pixel coordinates.
6. The checkerboard-based corner point extraction system according to claim 5, characterized in that: The total length of the chessboard is 12 mm and the total width is 7.5 mm; wherein the cell is 12*12, with a total of 3 characteristic circles and 141 corner points.
7. The checkerboard-based corner point extraction system according to claim 6, characterized in that: The plane coordinates and pixel coordinates of the three characteristic circles are all expressed by the coordinates of their respective circle centers.
8. The checkerboard-based corner point extraction system according to claim 7, characterized in that: The characteristic circle detection model is constructed based on the yolov8 model and is trained using the original chessboard image as a training sample.
Citation Information
Patent Citations
Checkerboard image recognition and positioning system and method based on convolutional neural network and nested contour recognition
CN111784779A
Camera calibration method, electronic equipment and storage medium
CN115457147A
High-robustness and high-precision camera calibration board and angular point detection method
CN118674789A
