Checkerboard calibration point extraction method, electronic equipment and computer storage medium
By using the area feature values of corner neighborhood images in camera calibration, the problem of strict requirements on checkerboard image shape information and shooting angle in the prior art is solved, and higher detection accuracy and detection rate are achieved.
Patent Information
- Application Number
- CN202311693783.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2025-06-10
AI Technical Summary
The chessboard point-finding algorithm used in camera calibration in the prior art strictly requires the shape information and shooting angle of the chessboard image. If these requirements are not met, it will lead to the chessboard calibration point detection failure or the accuracy will be reduced.
By obtaining the neighborhood image of each pixel point in the checkerboard image, preliminary corner point screening and regional feature extraction are performed, and the regional feature values of the corner point neighborhood image are filtered to obtain the checkerboard calibration points.
This method can accurately determine the checkerboard calibration point at any irregular checkerboard image or shooting angle, improve the detection accuracy and detection rate of the checkerboard calibration point, and avoid the problems of detection failure or reduction of accuracy.
Smart Images

Figure CN120125670A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic devices, and in particular, to a method for extracting checkerboard calibration points, an electronic device, and a computer storage medium. Background Art
[0002] In the related art, in camera calibration, the checkerboard point-finding algorithm provided by Opencv is usually used to determine the checkerboard calibration points. That is, the white checkerboard area is determined by pixel dilation of the checkerboard image, and then the image is binarized by using a middle threshold operation. Next, the boundaries of the black blocks in the checkerboard image are extracted. Finally, the checkerboard calibration points are located according to the two blocks. However, when obtaining the checkerboard calibration points by the above method, the shape information or shooting angle of the checkerboard image needs to meet the following requirements: the number of rows and columns of the inner corner points of the checkerboard image cannot be less than 3, the checkerboard image must be a whole square checkerboard image, and the included angle between the camera line of sight and the normal line of the checkerboard image is less than a certain value. If the checkerboard image does not meet the above requirements, it will cause the failure of checkerboard calibration point detection or a decrease in accuracy. Summary of the Invention
[0003] The present invention aims to at least solve one of the technical problems existing in the prior art. For this reason, an object of the present invention is to provide a method for extracting checkerboard calibration points. By using this method, the checkerboard calibration points can be screened out through the regional feature values of the corner neighborhood images, thereby avoiding the problems of checkerboard calibration point detection failure or accuracy reduction.
[0004] A second object of the present invention is to provide an electronic device.
[0005] A third object of the present invention is to provide a computer storage medium.
[0006] To solve the above problems, an embodiment of the first aspect of the present invention provides a method for extracting checkerboard calibration points, including: obtaining a checkerboard image; sampling the neighborhood images corresponding to each pixel point within a preset range centered on each pixel point in the checkerboard image; performing preliminary corner screening on each neighborhood image to obtain corner neighborhood images; performing regional feature extraction on each corner neighborhood image to obtain regional feature values; and performing corner screening according to the regional feature values of each corner neighborhood image to obtain checkerboard calibration points.
[0007] The method for extracting checkerboard calibration points according to an embodiment of the present invention screens the checkerboard calibration points based on the regional feature values of the neighborhood images of each corner point. That is to say, in any irregular checkerboard image or shooting angle during the shooting of the checkerboard, the regional feature values of the neighborhood images of the corner points, that is, the local feature information of the checkerboard image, can be used to accurately determine the checkerboard calibration points. Thus, compared with the method of determining the checkerboard calibration points by the existing checkerboard point-finding algorithm, in this application, the regional feature values of the neighborhood images of the corner points are used to screen out the checkerboard calibration points, thereby avoiding the problems of checkerboard calibration point detection failure or reduced accuracy, and improving the detection accuracy and detection rate of the checkerboard calibration points.
[0008] In some embodiments, performing regional feature extraction on the neighborhood image of the corner point to obtain a regional feature value includes: performing binarization processing on the neighborhood image of the corner point to obtain a binarized neighborhood image; performing polar coordinate transformation on each pixel point in the binarized neighborhood image to obtain the polar coordinate value of each pixel point in the polar coordinate system; performing difference processing on the radial distance values in the polar coordinate values corresponding to each pixel point to obtain a radial distance difference result; performing Fourier transform on the radial distance difference result to obtain the regional feature value.
[0009] In some embodiments, performing difference processing on the radial distance values in the polar coordinate values corresponding to each pixel point includes: counting a first type of pixel points according to the polar angle in the polar coordinate values corresponding to each pixel point, where the first type of pixel points are pixel points with non-zero polar angles among all pixel points of the binarized neighborhood image; screening the first type of pixel points according to a preset radial distance stable range to retain a second type of pixel points that meet the preset radial distance stable range among the first type of pixel points; performing difference processing on the radial distance values in the polar coordinate values corresponding to the second type of pixel points.
[0010] In some embodiments, performing Fourier transform on the radial distance difference result to obtain the regional feature value includes: separating the positive and negative values of the radial distance difference result to obtain a positive difference result and a negative difference result; performing Fourier transform on the positive difference result to obtain a first set of feature values; performing Fourier transform on the negative difference result to obtain a second set of feature values; using the first set of feature values and the second set of feature values as the regional feature value.
[0011] In some embodiments, performing preliminary screening of corner points on each neighborhood image to obtain a neighborhood image of the corner point includes: obtaining a checkerboard pixel ratio range; extracting the actual background pixel ratio of each neighborhood image; removing the neighborhood images that do not meet the condition that the actual background pixel ratio is within the checkerboard pixel ratio range among all neighborhood images; retaining the neighborhood images that meet the condition that the actual background pixel ratio is within the checkerboard pixel ratio range among all neighborhood images as the neighborhood image of the corner point.
[0012] In some embodiments, corner points are screened according to the regional feature values of each corner point neighborhood image to obtain checkerboard calibration points, including: classifying according to the regional feature values of each corner point neighborhood image to obtain effective corner point feature values; performing adjacent point processing on the effective corner point feature values to obtain checkerboard calibration points.
[0013] In some embodiments, classifying according to the regional feature values of each corner point neighborhood image to obtain effective corner point feature values includes: inputting the regional feature values of each corner point neighborhood image into a sample training classifier to obtain the effective corner point feature values.
[0014] In some embodiments, classifying according to the regional feature values of each corner point neighborhood image to obtain effective corner point feature values includes: calculating the feature similarity between the regional feature value of each corner point neighborhood image and the sample corner point feature value; obtaining the effective corner point feature values according to the feature similarity.
[0015] In some embodiments, performing adjacent point processing on the effective corner point feature values to obtain checkerboard calibration points includes: screening out the effective corner point feature values that meet the adjacent point processing condition among all the effective corner point feature values, where the adjacent point processing condition is to determine that the distance value between any effective corner point feature value and a certain effective corner point feature value other than the any effective corner point feature value is less than or equal to a preset distance threshold; taking the effective corner point feature values that do not meet the adjacent point processing condition among all the effective corner point feature values as the checkerboard calibration points, and taking any one of the effective corner point feature values between the any effective corner point feature value and the certain effective corner point feature value as the checkerboard calibration points.
[0016] In some embodiments, performing adjacent point processing on the effective corner point feature values to obtain checkerboard calibration points includes: obtaining the confidence of each effective corner point feature value; obtaining the checkerboard calibration points according to the confidence of each effective corner point feature value.
[0017] In some embodiments, a sub-pixel refinement algorithm is used to refine the checkerboard calibration points.
[0018] An embodiment of the second aspect of the present invention provides an electronic device, including: at least one processor; a memory communicatively connected to at least one of the processors; wherein, a computer program executable by at least one of the processors is stored in the memory, and when at least one of the processors executes the computer program, the above-mentioned checkerboard calibration point extraction method in the embodiment is implemented.
[0019] According to the electronic device of the embodiment of the present invention, by executing the checkerboard calibration point extraction method of the above embodiment, the checkerboard calibration points can be screened out through the regional feature values of the corner neighborhood images, thereby avoiding the problems of checkerboard calibration point detection failure or reduced accuracy.
[0020] An embodiment of the third aspect of the present invention provides a computer storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the checkerboard calibration point extraction method described in the above embodiment.
[0021] The additional aspects and advantages of the present invention will be partly given in the following description, partly will become obvious from the following description, or be understood through the practice of the present invention. Description of the Drawings
[0022] The above and / or additional aspects and advantages of the present invention will become obvious and easy to understand from the description of the embodiments in conjunction with the following drawings, wherein:
[0023] Figure 1 is a flowchart of a checkerboard calibration point extraction method according to an embodiment of the present invention;
[0024] Figure 2 is a schematic diagram of a checkerboard image according to an embodiment of the present invention;
[0025] Figure 3 is a schematic diagram of a checkerboard image according to another embodiment of the present invention;
[0026] Figure 4 is a schematic diagram of a checkerboard image according to another embodiment of the present invention;
[0027] Figure 5 is a schematic diagram of a checkerboard image according to another embodiment of the present invention;
[0028] Figure 6 is a schematic diagram of a checkerboard image according to another embodiment of the present invention;
[0029] Figure 7a is a schematic diagram of a corner neighborhood image according to an embodiment of the present invention;
[0030] Figure 7b is a schematic diagram of a binarized neighborhood image according to an embodiment of the present invention;
[0031] Figure 7c is a schematic diagram of the coordinates of each pixel point in the binarized neighborhood image in the polar coordinate system according to an embodiment of the present invention;
[0032] Figure 7d is a schematic diagram of the coordinates of the polar radius difference result according to an embodiment of the present invention;
[0033] Figure 7e Schematic diagram of the coordinates of the first type of pixel points according to an embodiment of the present invention;
[0034] Figure 7f Schematic diagram of the coordinate of the polar radius difference result after positive and negative value separation according to an embodiment of the present invention;
[0035] Figure 7g Schematic diagram of the coordinate of the regional feature value according to an embodiment of the present invention;
[0036] Figure 8 Schematic diagram of the coordinate of the standard regional feature value according to an embodiment of the present invention;
[0037] Figure 9 Block diagram of the structure of an electronic device according to an embodiment of the present invention.
[0038] Reference signs:
[0039] Electronic device 10;
[0040] Processor 1; Memory 2. Detailed implementation manners
[0041] The embodiments of the present invention will be described in detail below. The embodiments described with reference to the drawings are exemplary. The embodiments of the present invention will be described in detail below.
[0042] To solve the above problems, the first aspect embodiment of the present invention provides a method for extracting checkerboard calibration points. By using this method, checkerboard calibration points can be screened out through the regional feature values of the corner neighborhood images, thereby avoiding the problems of checkerboard calibration point detection failure or accuracy reduction.
[0043] The following refers to Figure 1 to describe the method for extracting checkerboard calibration points according to the embodiment of the present invention. As Figure 1 shown, the method includes: Step S1 to Step S5.
[0044] Step S1, obtaining a checkerboard image.
[0045] Specifically, a checkerboard image is obtained by shooting with a camera or an electronic device with a camera function, or obtaining a checkerboard image stored in the electronic device. As Figures 2 to 6 shown is a checkerboard image. Among them, the checkerboard image can be a special-shaped checkerboard image or a distorted special-shaped checkerboard image, etc., which is not limited thereto, and the shooting angle of the checkerboard image in this application is not limited.
[0046] Step S2, sampling the neighborhood image corresponding to each pixel point within a preset range with each pixel point in the checkerboard image as the center.
[0047] Specifically, taking each pixel point in the checkerboard image as the center, sample the neighborhood image composed of the pixel points within a preset range of each pixel point. Here, the preset range is the neighborhood boundary set for sampling the neighborhood image of each pixel point. The width and height of the area corresponding to the preset range can be set according to specific requirements, or the preset range can be an area of 7 pixels. The neighborhood can be square, quadrilateral, circular or of a custom shape, and there is no restriction on this.
[0048] Step S3: Conduct a preliminary screening of corner points for each neighborhood image to obtain a corner point neighborhood image.
[0049] Specifically, the checkerboard is formed by the intersection of a series of parallel lines and vertical lines. The points where the black squares intersect in the checkerboard image are taken as corner points. For example, Figures 2 to 6 in the black points are corner points. After obtaining the neighborhood image of each pixel point in the checkerboard image, conduct a preliminary screening of corner points for the neighborhood image of each pixel point to obtain a corner point neighborhood image. Exemplarily, use a corner point detection algorithm to detect corner points in the neighborhood image of each pixel point. If there are corner points in the neighborhood image, then take this image as the corner point neighborhood image. Here, the corner point detection algorithm can be the harris corner point detection algorithm, scale-invariant feature transform, etc., and there is no restriction on this.
[0050] Step S4: Extract regional features from each corner point neighborhood image to obtain regional feature values.
[0051] Specifically, extract regional features from each corner point neighborhood image. For example, extract the shape features of each corner point neighborhood image to obtain the regional feature values of each corner point neighborhood image. Here, the regional feature values can reflect the characteristics and attributes of the corner point neighborhood image, such as attributes like the structure, shape, and texture of the corner point neighborhood image.
[0052] Step S5: Screen corner points according to the regional feature values of each corner point neighborhood image to obtain the checkerboard calibration points.
[0053] Specifically, in the prior art, the chessboard point finding algorithm provided by Opencv is usually used to determine the calibration points of the chessboard during camera calibration. However, if the chessboard image does not meet the requirements of shape information or shooting angle, it will result in the failure of detecting the calibration points of the chessboard or a decrease in accuracy. To solve this problem, in this application, the calibration points of the chessboard are determined according to the regional feature values of the corner neighborhood images, that is, relying on the local feature information of the chessboard image to determine the calibration points of the chessboard. That is to say, the regional feature values of the corner neighborhood images can reflect the image information around the corners. The corner points are screened according to the regional feature values of each corner neighborhood image, that is, all the corner neighborhood images are screened according to the regional feature values of each corner neighborhood image to obtain the corner neighborhood images corresponding to different corner positions in the accurate chessboard image. The points in all the corner neighborhood images are used as the calibration points of the chessboard, such as Figures 2 to 6 the black points in are all the calibration points of the chessboard. Among them, the calibration points of the chessboard are the points where all each black square in the chessboard intersects with another black square. For example, if the regional feature value of each corner neighborhood image is the same as or highly similar to the standard feature value of the corner neighborhood image, then the corner neighborhood image is regarded as the accurate chessboard image, and the points in the corner neighborhood image are used as the calibration points of the chessboard. Thus, compared with the method of determining the calibration points of the chessboard by the existing chessboard point finding algorithm, in this application, the regional feature values of the corner neighborhood images are used to screen out the calibration points of the chessboard, relying only on the local feature information of the chessboard image to determine the calibration points of the chessboard, and not affected by the shape information or shooting angle of the chessboard image, so that the calibration points of the chessboard can be accurately identified, and the detection accuracy and detection rate of the calibration points of the chessboard are improved.
[0054] According to the method for extracting the calibration points of the chessboard according to the embodiments of the present invention, the calibration points of the chessboard are screened according to the regional feature values of each corner neighborhood image. That is to say, in any irregular chessboard image or shooting angle when shooting the chessboard, the regional feature values of the corner neighborhood images, that is, the local feature information of the chessboard image, can be used to accurately determine the calibration points of the chessboard. Thus, compared with the method of determining the calibration points of the chessboard by the existing chessboard point finding algorithm, in this application, the regional feature values of the corner neighborhood images are used to screen out the calibration points of the chessboard, thereby avoiding the problems of the failure of detecting the calibration points of the chessboard or the decrease in accuracy, and improving the detection accuracy and detection rate of the calibration points of the chessboard.
[0055] In some embodiments, region feature extraction is performed on the diagonal point neighborhood image to obtain region feature values, including: performing binarization processing on the diagonal point neighborhood image to obtain a binarized neighborhood image. That is to say, first, the corner neighborhood image is grayscale processed, and then the grayscale value of each pixel point in the grayscale corner neighborhood image is set to 0 or 255 using a threshold to obtain a binarized neighborhood image. For example, the grayscale value of each pixel point in the grayscale corner neighborhood image is set to 0 or 255 through an adaptive threshold binarization method to facilitate better identification and extraction of region feature values. Exemplarily, as Figure 7a , the grayscale value of each pixel point in the local region of the corner neighborhood image, i.e., the black frame region S in the figure, is set to 0 or 255, as Figure 7b , to obtain a binarized neighborhood image corresponding to the local region in the corner neighborhood image. In addition, the adaptive threshold binarization method includes the local mean method or the local median method. The local mean method takes the average value of the pixel values in each small region as the threshold for that region, and the local median method takes the median value as the threshold for that region after sorting the pixel values in each small region. Thus, the threshold used in the binarization processing in this application can be the average value or the median value of all pixel points in the corner neighborhood image.
[0056] Perform polar coordinate transformation on each pixel point in the binarized neighborhood image to obtain the polar coordinate values of each pixel point in the polar coordinate system. As Figure 7c shows the polar coordinate values of each pixel point in the binarized neighborhood image in the polar coordinate system, where the polar coordinate values include the radial value and the polar angle value to highlight the texture and features of the binarized neighborhood image, so as to be able to extract region feature values more accurately.
[0057] Perform difference processing according to the radial value in the polar coordinate value corresponding to each pixel point, that is, calculate the difference value between the radial value of each pixel point and the radial value of the adjacent pixel point. For example, calculate the difference between the radial value of the next pixel point and the radial value of the previous relative pixel point, that is, use the first element as the post element for the last element, to obtain the radial difference result. As Figure 7d shows the radial difference result of each pixel point to extract the texture and features of the binarized neighborhood image.
[0058] Perform Fourier transform on the radial difference result to obtain the amplitude and phase of the radial difference result, and then analyze the amplitude and phase to obtain the region feature value. For example, use the amplitude as the region feature value.
[0059] In some embodiments, difference processing is performed according to the radial value in the polar coordinate value corresponding to each pixel point. Specifically, the first type of pixel points is counted according to the polar angle in the polar coordinate value corresponding to each pixel point. Among them, as Figure 7eAs shown, the first type of pixel points are the pixel points with non-zero polar angles among all the pixel points of the binarized neighborhood image. Since there are pixel points with unstable polar radii among the first type of pixel points in the image when rotating and translating the binarized neighborhood image, in order to reduce the influence of pixel points with unstable polar radii on feature extraction, the first type of pixel points are screened according to a preset stable range of polar radii. The preset stable range of polar radii is the range where the polar radius values of the pixel points are relatively stable. For example, the preset stable range of polar radii can be the range of polar radius values greater than 5. The first type of pixel points with unstable radii in the binarized neighborhood image are screened out to retain the second type of pixel points that meet the preset stable range of polar radii among the first type of pixel points. For example, the second type of pixel points in the black frame area in Figure 7c are retained, and then the difference processing is performed on the polar radius values in the polar coordinate values corresponding to the second type of pixel points to obtain the polar radius difference result. Thus, in this application, by excluding the binarized neighborhood image corresponding to the unstable pixel points, the regional feature values can be extracted more accurately according to the polar radius difference result, that is, the feature information of the unstable neighborhood image is excluded, and the accuracy and stability of the checkerboard calibration point recognition are improved.
[0060] In some embodiments, a Fourier transform is performed on the polar radius difference result to obtain the regional feature value. Specifically, the checkerboard image is a black-and-white rectangular shape, and the rectangle in the checkerboard image obtained by photographing the checkerboard at different angles will be deformed, such as deformed into a rhombus, so that the regional feature value of the corner neighborhood image changes. Therefore, to solve this problem, the polar radius difference result is separated into positive and negative values to obtain a positive difference result and a negative difference result. As Figure 7f shown, the area above the polar angle horizontal axis is the positive difference result and the area below the polar angle horizontal axis is the negative difference result. Then, a Fourier transform is performed on the positive difference result to obtain the first set of feature values. The first set of feature values is Figure 7g a series of black points in Figure 7g . For example, the first set of feature values can be the amplitudes corresponding to different frequencies. And a Fourier transform is performed on the negative difference result to obtain the second set of feature values. The second set of feature values is Figure 7a a series of gray points in
[0061] . For example, the second set of feature values can be the amplitudes of the negative difference result. Finally, the first set of feature values and the second set of feature values are used as the regional feature values of each corner neighborhood image. For example, the first set of feature values and the second set of feature values are used as Figure 7a the regional feature values of the S area in . Thus, no matter at what angle the checkerboard image is photographed, the regional feature value of the corner neighborhood image will not change, avoiding affecting the accuracy and stability of the checkerboard calibration point recognition.
[0061] In the embodiment, when separating the polar radius difference result into positive and negative values, it can be divided into a positive difference result greater than or equal to 0 and a negative difference result less than or equal to 0.
[0062] In an embodiment, the regional eigenvalue of the corner neighborhood image has perspective transformation invariance.
[0063] In some embodiments, corner pre-screening is performed on each neighborhood image to obtain a corner neighborhood image. Specifically, the checkerboard pixel ratio range is obtained. Herein, the checkerboard pixel ratio range can be understood as the ratio range of the number of pixels in the black area to the number of pixels in the white area in the corner neighborhood image. The checkerboard pixel ratio range is a fixed ratio range. For example, the checkerboard pixel ratio range can be (0.2, 0.8). The actual background pixel ratio of each neighborhood image is extracted, that is, the ratio of the number of pixels in the actual background image (i.e., the black area) to the number of pixels in the white area of each neighborhood image is extracted. Neighborhood images that do not meet the condition that the actual background pixel ratio is within the checkerboard pixel ratio range are removed from all neighborhood images. For example, if the actual background pixel ratio of a neighborhood image is not within the checkerboard pixel ratio range, it means that the neighborhood image is an all-white or all-black image, and thus this neighborhood image is not a corner neighborhood image. Neighborhood images that meet the condition that the actual background pixel ratio is within the checkerboard pixel ratio range are retained from all neighborhood images, that is, the neighborhood images whose actual background pixel ratio conforms to the checkerboard pixel ratio range of the corner neighborhood image are used as corner neighborhood images. That is to say, if the actual background pixel ratio in a neighborhood image is within the checkerboard pixel ratio range, then this neighborhood image can be used as a corner neighborhood image. Thus, non-corner neighborhood images can be quickly excluded through the checkerboard pixel ratio range.
[0064] In some embodiments, corner screening is performed according to the regional eigenvalue of each corner neighborhood image to obtain checkerboard calibration points, including: classifying according to the regional eigenvalue of each corner neighborhood image to obtain effective corner eigenvalues, and performing adjacent point processing on the effective corner eigenvalues to obtain checkerboard calibration points.
[0065] Specifically, since there are multiple corners near each corner, but actually these multiple corners are the same corner. Therefore, in this application, adjacent point processing is performed on the effective corner eigenvalues to screen out high-quality corners from multiple identical corners. That is to say, classification is performed according to the regional eigenvalue of each corner neighborhood image to determine whether the points in each corner neighborhood image are corners of the checkerboard. If so, the regional eigenvalue corresponding to this corner neighborhood image is used as an effective corner eigenvalue. Then, adjacent point processing is performed on the effective corner eigenvalues to screen out high-quality corners from multiple identical corners, and the screened high-quality corners are used as checkerboard calibration points, so as to obtain more accurate and reliable checkerboard calibration points.
[0066] In some embodiments, classification is performed based on the regional feature values of each corner neighborhood image to obtain effective corner feature values. That is, the regional feature values of each corner neighborhood image are input into a sample-trained classifier, where the standard regional feature values of the corner neighborhood images are stored in the sample-trained classifier. As shown in Figure 8, the standard regional feature values are the amplitudes corresponding to different frequencies. That is, the regional feature values of each corner neighborhood image obtained through Fourier transform are compared with the standard regional feature values of the corner neighborhood images to determine whether the points in each corner neighborhood image are the corners of the checkerboard. For example, if the regional feature values of each corner neighborhood image calculated are the same as or similar to the standard regional feature values of the corner neighborhood images, then the points in the corner neighborhood image are the corners of the checkerboard, and the regional feature value corresponding to the corner neighborhood image is used as the effective corner feature value. Thus, the regional feature values of each corner neighborhood image are input into the sample-trained classifier to obtain effective corner feature values, thereby obtaining more accurate and reliable checkerboard calibration points.
[0067] In addition, the regional feature values of each corner neighborhood image can also be classified using a support vector machine in machine learning or a neural network in deep learning to obtain effective corner feature values.
[0068] In some embodiments, classification is performed based on the regional feature values of each corner neighborhood image to obtain effective corner feature values, including: calculating the feature similarity between the regional feature values of each corner neighborhood image and the sample corner feature values; obtaining the effective corner feature values according to the feature similarity. Specifically, calculate the feature similarity between the regional feature values of each corner neighborhood image and the sample corner feature values, where the sample corner feature values are the standard regional feature values of the corner neighborhood images, and then obtain the effective corner feature values according to the feature similarity. For example, if the feature similarity between the regional feature values of each corner neighborhood image and the sample corner feature values is high, it indicates that the points in the corner neighborhood image are the corners of the checkerboard, and the regional feature value corresponding to the corner neighborhood image is used as the effective corner feature value.
[0069] In addition, the feature similarity can be calculated by the Euclidean distance or the cosine of the vector angle between the regional feature values of each corner neighborhood image and the sample corner feature values.
[0070] In some embodiments, proximity point processing is performed on the valid corner eigenvalues to obtain checkerboard calibration points, including: screening out the valid corner eigenvalues that meet the proximity point processing conditions among all the valid corner eigenvalues, where the proximity point processing condition is that the distance value between any valid corner eigenvalue and a certain valid corner eigenvalue other than the any valid corner eigenvalue is less than or equal to a preset distance threshold; determining as checkerboard calibration points any one of the valid corner eigenvalues that do not meet the proximity point processing conditions among all the valid corner eigenvalues, any valid corner eigenvalue, and the certain valid corner eigenvalue.
[0071] Specifically, since there are multiple different corner neighborhood images at the same corner position, and the multiple corner neighborhood images may be the neighborhood images of the same corner. Therefore, in order to screen out the neighborhood images corresponding to high-quality corners from the multiple corner neighborhood images and then use the points in the neighborhood images as high-quality corners, first, the valid corner eigenvalues corresponding to the multiple corner neighborhood images at the same corner position are obtained, and the valid corner eigenvalues that meet the proximity point processing conditions among all the valid corner eigenvalues are screened out. The proximity point processing condition is that the distance value between any valid corner eigenvalue and a certain valid corner eigenvalue other than the any valid corner eigenvalue is less than or equal to a preset distance threshold. That is to say, if the distance value between any valid corner eigenvalue and a certain valid corner eigenvalue is less than or equal to the preset distance threshold, then it is considered that the corners corresponding to any valid corner eigenvalue and a certain valid corner eigenvalue are the same corner. Then, the points in the corner neighborhood image corresponding to any one of the valid corner eigenvalue and a certain valid corner eigenvalue are determined as checkerboard calibration points, or the points in the corner neighborhood image corresponding to the valid corner eigenvalues that do not meet the proximity point processing conditions among all the valid corner eigenvalues are used as checkerboard calibration points. Thus, high-quality corners are screened out from multiple identical corners through the valid corner eigenvalues, and the screened high-quality corners are used as checkerboard calibration points, so as to obtain more accurate and reliable checkerboard calibration points.
[0072] In an embodiment, if the distance value between any valid corner eigenvalue and a certain valid corner eigenvalue is less than or equal to the preset distance threshold, then it is considered that the corners corresponding to any valid corner eigenvalue and a certain valid corner eigenvalue are the same corner, and the corners corresponding to any valid corner eigenvalue and a certain valid corner eigenvalue are merged into the same corner.
[0073] In some embodiments, adjacent point processing is performed on the valid corner feature values to obtain checkerboard calibration points. That is, the confidence of each valid corner feature value is obtained, where the confidence refers to the possibility that the corner is correctly detected as a checkerboard corner. The checkerboard calibration points are obtained according to the confidence of each valid corner feature value, that is, the corner in the corner neighborhood image corresponding to the valid corner feature value with the maximum confidence is used as the checkerboard calibration point. Thus, the checkerboard calibration points are screened according to the confidence of each valid corner feature value, thereby improving the accuracy and stability of checkerboard calibration point calibration.
[0074] In addition, if there is no valid corner feature value with the maximum confidence among all valid corner feature values, the centroid in the corner neighborhood images corresponding to all valid corner feature values is used as the checkerboard calibration point.
[0075] In some embodiments, a sub-pixel refinement algorithm is used to refine the checkerboard calibration points. Among them, the sub-pixel refinement algorithm can be the centroid method, the fitting method, and the gradient method, that is, the checkerboard calibration points are refined at the sub-pixel level to improve the refinement degree and accuracy of the checkerboard calibration points, and the requirements for refining checkerboard corners under noise can be met.
[0076] An embodiment of the second aspect of the present invention provides an electronic device 10, as Figure 9 shown. The electronic device 10 includes: at least one processor 1 and a memory 2 communicatively connected to the at least one processor 1.
[0077] Among them, the memory 2 stores a computer program executable by the at least one processor 1, and when the at least one processor 1 executes the computer program, the checkerboard calibration point extraction method of the above embodiment is implemented.
[0078] It should be noted that the specific implementation manner of the electronic device in the embodiment of the present invention is similar to the specific implementation manner of the checkerboard calibration point extraction method in any of the above embodiments of the present invention. For details, please refer to the description of the method part. To reduce redundancy, it will not be repeated here.
[0079] According to the electronic device of the embodiment of the present invention, by executing the checkerboard calibration point extraction method of the above embodiment, the checkerboard calibration points can be screened out through the regional feature values of the corner neighborhood images, thereby avoiding the problems of checkerboard calibration point detection failure or reduced accuracy.
[0080] An embodiment of the third aspect of the present invention provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the checkerboard calibration point extraction method of the above embodiment is implemented.
[0081] In the description of this specification, any process or method description shown in the flowchart or described otherwise herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logical function or process. The scope of the preferred embodiments of the present invention includes additional implementations, where functions can be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed, which should be understood by those skilled in the technical field to which the embodiments of the present invention pertain.
[0082] The logic and / or steps represented in the flowchart or described otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing a logical function, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.
[0083] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0084] Those of ordinary skill in the art can understand that all or part of the steps carried out in implementing the above-described embodiment methods can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0085] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing module, or each unit can exist physically alone, or two or more units can be integrated in a module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0086] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
[0087] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example.
[0088] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and purposes of the present invention. The scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for extracting checkerboard calibration points, characterized in that, it includes: Obtain a checkerboard image; Sample the neighborhood image corresponding to each pixel point within a preset range centered on each pixel point in the checkerboard image; Perform a preliminary corner screening on each neighborhood image to obtain a corner neighborhood image; Extract regional feature values from each corner neighborhood image; Perform corner screening based on the regional feature values of each corner neighborhood image to obtain checkerboard calibration points.
2. The method for extracting checkerboard calibration points according to claim 1, characterized in that, extracting regional feature values from the corner neighborhood image, including: Perform binarization processing on the corner neighborhood image to obtain a binarized neighborhood image; Perform polar coordinate transformation on each pixel point in the binarized neighborhood image to obtain the polar coordinate values of each pixel point in the polar coordinate system; Perform difference processing on the radial distance values in the polar coordinate values corresponding to each pixel point to obtain a radial distance difference result; Perform Fourier transform on the radial distance difference result to obtain the regional feature value.
3. The method for extracting checkerboard calibration points according to claim 2, characterized in that, performing difference processing on the radial distance values in the polar coordinate values corresponding to each pixel point, including: Count the first type of pixel points according to the polar angle in the polar coordinate values corresponding to each pixel point, where the first type of pixel points are the pixel points with non-zero polar angles among all pixel points in the binarized neighborhood image; Screen the first type of pixel points according to a preset radial distance stable range to retain the second type of pixel points that meet the preset radial distance stable range among the first type of pixel points; Perform difference processing on the radial distance values in the polar coordinate values corresponding to the second type of pixel points.
4. The method for extracting checkerboard calibration points according to claim 2, characterized in that, performing Fourier transform on the radial distance difference result to obtain the regional feature value, including: Separate the positive and negative values of the radial distance difference result to obtain a positive difference result and a negative difference result; Perform Fourier transform on the positive difference result to obtain a first set of feature values; Perform Fourier transform on the negative difference result to obtain a second set of feature values; Use the first set of feature values and the second set of feature values as the regional feature value.
5. The method for extracting checkerboard calibration points according to any one of claims 1-4, characterized in that, performing a preliminary corner screening on each neighborhood image to obtain a corner neighborhood image, including: Obtain the checkerboard pixel ratio range; Extract the actual background pixel ratio of each neighborhood image; Remove the neighborhood images that do not meet the condition that the actual background pixel ratio is within the checkerboard pixel ratio range from all neighborhood images; Retain the neighborhood images that meet the condition that the actual background pixel ratio is within the checkerboard pixel ratio range from all neighborhood images as the corner neighborhood images.
6. The method for extracting checkerboard calibration points according to any one of claims 1-4, characterized in that, performing corner screening based on the regional feature values of each corner neighborhood image to obtain checkerboard calibration points, including: Classify according to the regional feature values of each corner neighborhood image to obtain effective corner feature values; Perform adjacent point processing on the effective corner feature values to obtain checkerboard calibration points.
7. The checkerboard calibration point extraction method according to claim 6, wherein, Classifying according to the regional feature values of each corner neighborhood image to obtain effective corner feature values includes: Input the regional feature values of each corner neighborhood image into a sample training classifier to obtain the effective corner feature values.
8. The checkerboard calibration point extraction method according to claim 6, wherein, Classifying according to the regional feature values of each corner neighborhood image to obtain effective corner feature values includes: Calculate the feature similarity between the regional feature values of each corner neighborhood image and the sample corner feature values; Obtain the effective corner feature values according to the feature similarity.
9. The checkerboard calibration point extraction method according to claim 6, wherein, Performing adjacent point processing on the effective corner feature values to obtain checkerboard calibration points includes: Screen out the effective corner feature values that meet the adjacent point processing conditions among all the effective corner feature values, and the adjacent point processing condition is to determine that the distance value between any effective corner feature value and a certain effective corner feature value other than the any effective corner feature value is less than or equal to a preset distance threshold; Determine the checkerboard calibration points with any one of the effective corner feature values that do not meet the adjacent point processing conditions among all the effective corner feature values, the any effective corner feature value, and the certain effective corner feature value.
10. The checkerboard calibration point extraction method according to claim 6, wherein, Performing adjacent point processing on the effective corner feature values to obtain checkerboard calibration points includes: Obtain the confidence of each effective corner feature value; Obtain the checkerboard calibration points according to the confidence of each effective corner feature value.
11. The checkerboard calibration point extraction method according to claim 1, wherein, The method further includes: Performing refinement processing on the checkerboard calibration points by using a sub-pixel level refinement algorithm.
12. An electronic device, wherein, includes: At least one processor; A memory communicatively connected to at least one of the processors; Wherein, the memory stores a computer program executable by at least one of the processors, and when at least one of the processors executes the computer program, the checkerboard calibration point extraction method according to any one of claims 1-11 is implemented.
13. A computer storage medium, on which a computer program is stored, wherein, When the computer program is executed by a processor, the checkerboard calibration point extraction method according to any one of claims 1-11 is implemented.
Citation Information
Cited By
Corner point extraction method and device, electronic equipment and storage medium
CN120451257A
Image splicing method, device and equipment
CN120807314A