Checkerboard corner detection method and system based on image texture
By projecting the grid in the grayscale image and judging the grayscale jump point, the problem of poor chess grid point extraction accuracy in the prior art is solved, and higher detection accuracy and lower calculation amount and device dependence are achieved.
Patent Information
- Application Number
- CN202311122796.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-03-04
AI Technical Summary
The commonly used checkerboard point extraction method in the prior art has poor extraction accuracy, especially when detecting relatively fuzzy checkerboard images, there is a large error.
By obtaining the image to be detected, converting it to a grayscale image, and projecting the grid in the grayscale image to determine the grayscale jump point on each grid boundary in the grid area, and then determining the checkerboard corner point.
The accuracy of checkerboard corner point detection is improved, the calculation amount and device dependence are reduced, and the depth processing is avoided through simple projection and grayscale judgment, and the accuracy of detection is enhanced.
Smart Images

Figure CN119559035A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a checkerboard corner point detection method and system based on image texture. Background Art
[0002] Autonomous driving is an important part of the current automotive control technology field. When developing autonomous driving technology, the most commonly used input is image data. In order to obtain the image data, it is necessary to conduct secondary development on the data collected by the camera. One of the important applications is the distance measurement of a single camera.
[0003] Before performing camera ranging, developers need to install the camera and calibrate the internal and external parameters. During the calibration process, the corner points on the chessboard need to be extracted. In the prior art, commonly used extraction methods such as the chessboard detection API in OpenCV and X-ray images using chessboards all have corresponding technical defects. For example, in OpenCV, the chessboard detection API will process the original image to separate the black and white squares on the chessboard and then restore them. This process will change the pixel distribution of the original image and cause errors. For engineers who do not have the conditions to use X-ray equipment, such methods have high limitations.
[0004] [CN202110762788.X] The invention provides a method and device for detecting checkerboard corner points, including: obtaining an X-ray image of a checkerboard calibration plate and marking it; then inputting it into a neural network detection model for detection, determining an image of the area where the checkerboard corner points are located and a first coordinate corresponding to the area where the checkerboard corner points are located; based on the image of the area where the checkerboard corner points are located, using a straight line detection algorithm to determine the second coordinates of the checkerboard corner points in the image of the area where the checkerboard corner points are located; determining the coordinates of the checkerboard corner points according to the first coordinates corresponding to the area where the checkerboard corner points are located and the second coordinates of the checkerboard corner points in the image of the area where the checkerboard corner points are located. The invention has a smaller error when detecting a relatively blurred checkerboard image, thereby improving the detection accuracy; at the same time, the present invention has the advantages of reducing the amount of calculation and high calculation accuracy. This method requires the staff to have X-ray equipment and configure a neural network working environment, which is costly.
[0005] [CN202210665983.5] The present invention discloses a method, device and storage medium for automatic detection and sorting of checkerboard corner points; the method comprises: obtaining a checkerboard grayscale image, extracting pixel-level candidate corner points in the grayscale image using a Geiger corner point detection template; refining the number of corner points of the candidate corner points, thereby filtering out pseudo corner points in the candidate corner points, and determining the candidate corner points retained after filtering as the checkerboard corner points; performing sub-pixel positioning on the checkerboard corner points to obtain sub-pixel corner points; extracting checkerboard quadrupoles from the sub-pixel corner points by the minimum convex hull arrangement principle; determining the starting point of the checkerboard according to the interval distance between the checkerboard quadrupoles; and sorting the checkerboard corner points based on the starting point of the checkerboard using the direction vectors between the checkerboard quadrupoles. The present invention can still detect the precise positions of all valid corner points under conditions such as illumination changes, image rotation and image distortion, thereby improving the accuracy of checkerboard corner point detection. This invention uses the Geiger corner detection template in OpenCV and involves sub-pixel corner detection. The detection speed of this invention is relatively slow. Summary of the invention
[0006] One of the purposes of the present invention is to provide a checkerboard corner point detection method and system based on image texture, so as to solve the technical problem of poor extraction accuracy of the checkerboard point extraction method commonly used in the prior art.
[0007] In order to achieve the above object, the present invention provides a checkerboard corner point detection method based on image texture, comprising:
[0008] Acquire an image to be detected;
[0009] converting the image into a grayscale image;
[0010] Projecting a grid in the grayscale image to obtain a grid area;
[0011] Determine a grayscale transition point on each grid boundary in the grid area;
[0012] The checkerboard corner points are determined according to the grayscale transition points.
[0013] Optionally: converting the image into a grayscale image, comprising:
[0014] Each pixel point on the image is traversed, and weighted calculation is performed according to the pixel channel of the pixel point to obtain the corresponding pixel point on the grayscale image.
[0015] Optionally: the pixel channels include at least two of a red channel, a green channel and a blue channel.
[0016] Optionally: determining the grayscale transition point on each grid boundary in the grid area includes:
[0017] Along the grid boundary, respectively calculating the grayscale difference between two adjacent pixel elements, wherein the pixel element includes at least one pixel point;
[0018] Determining whether the grayscale difference is greater than or equal to a preset grayscale threshold;
[0019] When it is determined that the grayscale difference is greater than or equal to the grayscale threshold, an intersection point of the two pixel elements is determined as the grayscale transition point.
[0020] Optionally: determining a checkerboard corner point according to the grayscale transition point includes:
[0021] Traversing each grid in the grid area, and determining the number of grayscale transition points on the grid boundary of the same grid;
[0022] Determine whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold;
[0023] When it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold, determining that there is a checkerboard corner point in the grid;
[0024] In the grid where there are checkerboard corner points, connect the grayscale jump points on the relative boundaries to obtain corresponding straight line segments;
[0025] The intersection points of the straight line segments are used as the chessboard corner points.
[0026] Optionally: connect the grayscale transition points on the relative boundaries, including:
[0027] Determine whether the grayscale jump points on the relative grid boundaries of the same grid are all greater than or equal to a preset second quantity threshold;
[0028] When it is determined that the grayscale jump points on the relative grid boundaries of the same grid are greater than or equal to a preset second quantity threshold, the grayscale jump points on the relative grid boundaries are connected in the order of arrangement on the grid boundaries to obtain corresponding multiple straight line segments.
[0029] Optionally: projecting a grid in the grayscale image to obtain a grid area includes:
[0030] Projecting the grayscale image using grids of a plurality of preset sizes to obtain a plurality of grid areas;
[0031] Determining a grayscale transition point on each grid boundary in the grid area includes:
[0032] Respectively determine the grayscale jump point on each grid boundary in each of the grid areas;
[0033] Determining the checkerboard corner points according to the grayscale transition points includes:
[0034] Determine the checkerboard corner points on each of the grid areas respectively as the checkerboard corner points to be clustered;
[0035] The detection method comprises:
[0036] The grid corner points to be clustered are clustered using a preset clustering method to obtain the chessboard grid corner points.
[0037] Optionally: the clustering method includes a density-based clustering algorithm.
[0038] Optionally, clustering the to-be-clustered grid corner points using a preset clustering method to obtain the chessboard grid corner points includes:
[0039] Clustering the grid corner points to be clustered to obtain a plurality of clusters;
[0040] Determine whether the number of points in each cluster is greater than or equal to a preset value;
[0041] When it is determined that the number of points is greater than or equal to the preset value, the cluster is used as the checkerboard corner point.
[0042] Optionally, clustering the to-be-clustered grid corner points using a preset clustering method to obtain the chessboard grid corner points includes:
[0043] When it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point.
[0044] On the other hand, the present invention further provides a checkerboard corner point detection system based on image texture, the detection system comprising a processor, and the processor is used to execute any of the detection methods described above.
[0045] In another aspect, the present invention further provides a checkerboard corner point detection system based on image texture, the detection system comprising:
[0046] An input module, used for acquiring an image to be detected and converting the image into a grayscale image;
[0047] A corner point detection module, used for projecting a grid in the grayscale image to obtain a grid area, and determining a grayscale jump point on each grid boundary in the grid area;
[0048] The output module is used to determine the checkerboard corner points according to the grayscale transition points.
[0049] Optionally: the input module is used to traverse each pixel point on the image, and perform weighted calculation according to the pixel channel of the pixel point to obtain the corresponding pixel point on the grayscale image.
[0050] Optionally: the pixel channels include at least two of a red channel, a green channel and a blue channel.
[0051] Optionally: the corner point detection module is used to:
[0052] Along the grid boundary, respectively calculating the grayscale difference between two adjacent pixel elements, wherein the pixel element includes at least one pixel point;
[0053] Determining whether the grayscale difference is greater than or equal to a preset grayscale threshold;
[0054] When it is determined that the grayscale difference is greater than or equal to the grayscale threshold, an intersection point of the two pixel elements is determined as the grayscale transition point.
[0055] Optionally: the output module is used to:
[0056] Traversing each grid in the grid area, and determining the number of grayscale transition points on the grid boundary of the same grid;
[0057] Determine whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold;
[0058] When it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold, determining that there is a checkerboard corner point in the grid;
[0059] In the grid where there are checkerboard corner points, connect the grayscale jump points on the relative boundaries to obtain corresponding straight line segments;
[0060] The intersection points of the straight line segments are used as the chessboard corner points.
[0061] Optionally: the output module is used to:
[0062] Determine whether the grayscale jump points on the relative grid boundaries of the same grid are all greater than or equal to a preset second quantity threshold;
[0063] When it is determined that the grayscale jump points on the relative grid boundaries of the same grid are greater than or equal to a preset second quantity threshold, the grayscale jump points on the relative grid boundaries are connected in the order of arrangement on the grid boundaries to obtain corresponding multiple straight line segments.
[0064] Optionally: the corner point detection module is used to:
[0065] Projecting the grayscale image using grids of a plurality of preset sizes to obtain a plurality of grid areas;
[0066] Respectively determine the grayscale jump point on each grid boundary in each of the grid areas;
[0067] The output module is used for:
[0068] Determine the checkerboard corner points on each of the grid areas respectively as the checkerboard corner points to be clustered;
[0069] The grid corner points to be clustered are clustered using a preset clustering method to obtain the chessboard grid corner points.
[0070] Optionally: the clustering method includes a density-based clustering algorithm.
[0071] Optionally: the output module is used to:
[0072] Clustering the grid corner points to be clustered to obtain a plurality of clusters;
[0073] Determine whether the number of points in each cluster is greater than or equal to a preset value;
[0074] When it is determined that the number of points is greater than or equal to the preset value, the cluster is used as the checkerboard corner point.
[0075] Optionally: the output module is used to:
[0076] When it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point.
[0077] On the other hand, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions are used to be read by a machine so that the machine executes any of the detection methods described above.
[0078] Beneficial effects of the present invention:
[0079] The embodiment of the present invention obtains the checkerboard corner points by projecting the grid area and combining the judgment of the grayscale jump point. Compared with the prior art, the deep processing of image separation and the like is avoided, thereby improving the accuracy of the obtained checkerboard corner points;
[0080] The embodiment of the present invention obtains the checkerboard corner points by projecting the grid area and combining the judgment of the grayscale jump point. Compared with the prior art, it only uses relatively simple projection and grayscale judgment, which reduces the dependence on equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0082] Figure 1 A flowchart of a checkerboard corner point detection method based on image texture according to an embodiment of the present invention;
[0083] Figure 2 is an example diagram of an image to be detected according to an embodiment of the present invention;
[0084] Figure 3 A flowchart of a method for determining a grayscale transition point according to an embodiment of the present invention;
[0085] Figure 4 A flowchart of a method for determining chessboard corner points according to an embodiment of the present invention;
[0086] Figure 5 is an example diagram of a grid containing only one checkerboard corner point according to an embodiment of the present invention;
[0087] Figure 6 A flowchart of a method for obtaining chessboard corner points according to an embodiment of the present invention;
[0088] Figure 7 A schematic diagram of a checkerboard corner point according to an example of the present invention;
[0089] Figure 8 The structure block diagram of a checkerboard corner point detection system based on image texture according to one embodiment of the present invention.
[0090] Description of Reference Numerals
[0091] 1. Input module 2. Corner detection module
[0092] 3. Output module DETAILED DESCRIPTION
[0093] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0094] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0095] like Figure 1 FIG. 1 is a flowchart of a checkerboard corner detection method based on image texture according to an embodiment of the present invention. Figure 1 In the present invention, the detection method may include the following steps:
[0096] In step S10, an image to be detected is obtained;
[0097] In step S11, the image is converted into a grayscale image;
[0098] In step S12, the grid is projected in the grayscale image to obtain a grid area;
[0099] In step S13, a grayscale transition point on each grid boundary in the grid area is determined;
[0100] In step S14, the checkerboard corner point is determined according to the grayscale transition point.
[0101] In this Figure 1 In the illustrated checkerboard corner point detection method based on image texture, step S10 is used to obtain an image to be detected. Given that the technical problem to be solved by the present invention is how to identify checkerboard corner points in image recognition. Therefore, an example of the image to be detected can be as follows: Figure 2 The example diagram shown.
[0102] Since the image to be detected generally has multiple colors in the unprocessed state, and if the image including multiple colors is directly processed, on the one hand, the complexity of the algorithm will be increased, and on the other hand, the computing load of the device will be increased. Therefore, it is necessary to convert the image to be detected into a grayscale image through step S11. As for the specific method of converting to a grayscale image, although it can be a variety of forms known to those skilled in the art, including but not limited to methods such as decolorization and grayscale histogram conversion. In one example of the present invention, considering that the original image to be detected is generally an RGB [R (red, red), G (green, green), B (blue, blue)] image, then weighting can be performed according to at least two of these three colors, so as to calculate the corresponding grayscale value after conversion. Specifically, in this example, when there are three color channels for weighting, the grayscale value after conversion can be calculated according to the following formula (1):
[0103] Gray i,j=λ 1 *R i,j +λ 2 *G i,j +λ 3 *B i,j , (1)
[0104] Among them, i, j are the coordinates of the pixel in the image, Gray i,j is the gray value after conversion, R i,j is the red channel value of the pixel, G i,j is the green channel value of the pixel, B i,j is the blue channel value of the pixel, λ 1 , 2 , 3 are the corresponding weight values respectively.
[0105] In this embodiment, the weight value may be a plurality of values known to those skilled in the art. In this example, the weight values may be 0.299, 0.578, and 0.114, respectively. That is, the method of converting to the corresponding grayscale value may also be to convert according to the following formula (2):
[0106] Gray i,j =0.299*R i,j +0.578*G i,j +0.114*B i,j , (2).
[0107] After converting the grayscale image, considering that there is a large color difference between the colored area and the colorless area in the image to be detected, the color difference can be manifested as a grayscale jump in the grayscale image. Then, in order to detect the grayscale jump, considering the complexity of the algorithm, the intersection between the grayscale jump and the grid, that is, the grayscale jump point, can be determined by grid projection. Figure 1 Steps S12 to S14 in the detection method are shown.
[0108] Step S12 is used to project a grid in the grayscale image to obtain a grid area. Since the size of the projected grid is inconsistent with the chessboard grid of the image to be detected, or there is a boundary misalignment, or both situations exist at the same time. Therefore, the projected grid will have multiple intersections with the chessboard grid. The characteristics of the two sides of the boundary of the chessboard grid in the grayscale image are characterized by a large grayscale difference (greater than a preset grayscale threshold), so the intersection is the grayscale jump point, that is, step S13: determine the grayscale jump point on each grid boundary in the grid area. Since the grayscale jump points are all points on the boundary of the chessboard grid, the boundary of the chessboard grid can be obtained by connecting the grayscale jump points. Further, since the chessboard corner point is actually the intersection point of the boundary of the chessboard grid, the chessboard corner point can be obtained by determining the intersection point of the boundary, that is, step S14: determine the chessboard corner point according to the grayscale jump point.
[0109] In this embodiment, the specific method for determining the grayscale jump point on each grid boundary in the grid area in step S13 can be various forms known to those skilled in the art. In one example of the present invention, in view of the above explanation of the grayscale jump point, step S13 can include the following steps: Figure 3 In the steps shown in Figure 3 In the step S13, the step S13 may include:
[0110] In step S20, the grayscale difference between two adjacent pixel elements is calculated along the grid boundary, wherein the pixel element may include at least one pixel point;
[0111] In step S21, it is determined whether the grayscale difference is greater than or equal to a preset grayscale threshold;
[0112] In step S22, when it is determined that the grayscale difference is greater than or equal to the grayscale threshold, the intersection of the two pixel elements is determined as the grayscale transition point.
[0113] In this Figure 3In the method shown, step S20 is used to calculate the grayscale difference between two adjacent pixel elements along the grid boundary. Since there may be too many pixels in the actual calculation, it is necessary to classify the original multiple pixels into pixel elements to improve the efficiency of calculating the grayscale difference. Therefore, the grayscale difference is calculated by comparing two pixel elements in step S20. Wherein, in the case where the pixel element only includes a single pixel, the grayscale difference can be determined by directly subtracting the grayscales of the two pixel elements. In the case where the pixel element includes multiple pixels, the grayscale difference can be determined by, for example, first calculating the grayscale eigenvalues of the two pixel elements, and then subtracting the two grayscale eigenvalues to obtain the grayscale difference. As for the calculation method of the grayscale eigenvalue, it can be one or more of the average value, mode, median value and extreme average value (average value of the maximum value and the minimum value) of each pixel in the pixel element, but not limited to.
[0114] Step S21 is used to determine whether the grayscale difference is greater than or equal to a preset grayscale threshold, wherein the grayscale threshold can be a plurality of values known to those skilled in the art.
[0115] After the grayscale transition point is determined, step S14 may be used to determine the checkerboard corner point according to the grayscale transition point. Considering that the grayscale transition points are all points on the boundary of the checkerboard grid, the boundary of the checkerboard grid can be obtained by connecting the grayscale transition points, and the intersection of the boundary is the checkerboard corner point. Therefore, in this embodiment, the method for determining the checkerboard corner point may include the following steps: Figure 4 In the method shown in Figure 4 In the step S14, the step S14 may further include the following steps:
[0116] In step S30, each grid in the grid area is traversed to determine the number of grayscale transition points on the grid boundary of the same grid;
[0117] In step S31, it is determined whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first quantity threshold (considering that there are checkerboard corner points in the grid, the grid boundary must intersect with the boundary of the checkerboard grid, so the first quantity threshold for determining the number of grayscale transition points may be 1);
[0118] In step S32, when it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to the preset first number threshold, it is determined that there are checkerboard corner points in the grid; conversely, when it is determined that the number of grayscale transition points on the grid boundary of the same grid is less than the preset first number threshold, it is determined that there are no checkerboard corner points in the grid, and at this time, the process can return to step S30 to select a new grid;
[0119] In step S33, in the grid where the checkerboard corner points exist, the grayscale jump points on the relative boundaries are connected to obtain corresponding straight line segments;
[0120] In step S34, the intersection points of the straight line segments are used as checkerboard corner points.
[0121] In this embodiment, since the checkerboard corner point is the intersection point of the border of the checkerboard grid in the image to be detected, if there is a checkerboard corner point in any grid in the grid area, then there must be two checkerboard grid borders passing through the grid in the grid area. Figure 4 In the method shown, each grid in the grid area is first traversed through step S30 to determine the number of grayscale transition points on the grid boundary of the same grid. Since if there is a checkerboard corner point in any grid in the grid area, there must be two checkerboard grid boundaries passing through the grid in the grid area, that is, there must be at least one grayscale transition point on each grid boundary of the grid. In an example of the present invention, when the grid contains a checkerboard corner point, the schematic diagram of the grid can be as follows Figure 5 Therefore, the Figure 4 The method shown also determines the grid containing the checkerboard corner point through step S31 and step S32. Since the checkerboard corner point is the intersection point of the boundary of the checkerboard grid, the checkerboard corner point can be obtained by connecting the corresponding straight line segments through step S33 and step S34.
[0122] In addition, in order to facilitate the determination of the coordinates of the checkerboard corner points, the coordinates of the grayscale transition points can be converted. As for the coordinate conversion method, there are many methods known to those skilled in the art. In one example of the present invention, Figure 5 Taking the checkerboard corner point shown in as an example, the intersection of grayscale transition points A, B, C, and D is recorded as P, and the center point of the grid is recorded as O. Then the coordinates of the checkerboard corner point Q on the original grayscale image can be calculated using the following formulas (3) and (4):
[0123] Q x =C x +(P x -O x ), (3)
[0124] Q y =C y +(P y -O y ), (4)
[0125] Among them, x and y are the horizontal and vertical coordinates of the pixel.
[0126] Considering that there may be multiple checkerboard corner points in the same grid, when executing step S33, it is necessary to consider the arrangement characteristics of the checkerboard corner points, and the boundaries that pass through different checkerboard corner points and do not intersect with each other are parallel to each other. That is, on two opposite grid boundaries of the same grid, there will be multiple grayscale jump points corresponding to each other. Therefore, before connecting the straight line segments, it can be first determined whether the grayscale jump points on the opposite grid boundaries of the same grid are greater than or equal to the preset second number threshold; in the case of determining that the grayscale jump points on the opposite grid boundaries of the same grid are greater than or equal to the second number threshold, it is determined that the grid contains multiple checkerboard corner points. Therefore, according to the arrangement characteristics of the boundaries connecting the checkerboard corner points (that is, the boundaries that pass through different checkerboard corner points and do not intersect with each other are parallel to each other), the grayscale jump points on the grid boundaries can be connected in the order of arrangement on the grid boundaries, thereby obtaining corresponding multiple straight line segments.
[0127] Among them, since the first quantity threshold used when judging whether there is a single checkerboard corner point in the grid may be 1, the second quantity threshold used for further judging whether there are multiple checkerboard corner points in the grid may be 2 on this basis.
[0128] In this embodiment, since the values of multiple color channels are considered simultaneously when calculating the grayscale value, after the weighting of multiple color channels, the calculated grayscale values may be similar or differ greatly, which may lead to the situation that the grayscale jump point is determined in the subsequent step S13. Therefore, in one embodiment of the present invention, when executing step S12 (i.e., projecting a grid in a grayscale image to obtain a grid area), the grayscale image can be projected using grids of preset multiple sizes to obtain corresponding multiple grid areas. Correspondingly, step S13 can be to determine the grayscale jump points on each grid boundary in each grid area respectively; and step S14 can be to determine the checkerboard corner points on each of the grid areas respectively as the checkerboard corner points to be clustered; finally, the detection method, based on step S13 and step S14, clusters the checkerboard corner points to be clustered by using a preset clustering method to obtain the checkerboard corner points. Among them, the preset multiple sizes can be a variety known to those skilled in the art. In an example of the present invention, the preset multiple sizes may include but are not limited to 3*3, 5*5, 7*7, etc.
[0129] Among them, for the clustering method, although it can be a variety of methods known to those skilled in the art, such as the k-means clustering method. In one example of the present invention, considering that without misidentification of grayscale jump points, the grid points to be clustered obtained under projections of different sizes should all represent the area where the checkerboard corner points are located. Therefore, it can be determined whether the cluster is a checkerboard corner point based on the density of the clustered cluster after clustering. That is, the clustering method can be a density-based clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, DBSCAN). Specifically, the way to obtain the checkerboard corner point can include the following: Figure 6 In the method shown in Figure 6 In the method of obtaining the corner points of the chessboard, the following steps may be included:
[0130] In step S40, the grid corner points to be clustered are clustered to obtain a plurality of clusters;
[0131] In step S41, it is determined whether the number of points in each cluster is greater than or equal to a preset value;
[0132] In step S42, when it is determined that the number of points is greater than or equal to the preset value, the cluster is used as a checkerboard corner point.
[0133] On the contrary, in step S43, when it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point. Finally, the schematic diagram of the checkerboard corner points obtained by the detection method provided by the present invention can be: Figure 7 shown.
[0134] On the other hand, an embodiment of the present invention further provides a checkerboard corner point detection system based on image texture. The detection system may include a processor, and the processor may be used to execute any of the detection methods described above. Specifically, Figure 1 The flowchart of the detection method is shown in FIG. Figure 1 In the present invention, the detection method may include the following steps:
[0135] In step S10, an image to be detected is obtained;
[0136] In step S11, the image is converted into a grayscale image;
[0137] In step S12, the grid is projected in the grayscale image to obtain a grid area;
[0138] In step S13, a grayscale transition point on each grid boundary in the grid area is determined;
[0139] In step S14, the checkerboard corner point is determined according to the grayscale transition point.
[0140] In this Figure 1 In the illustrated checkerboard corner point detection method based on image texture, step S10 is used to obtain an image to be detected. Given that the technical problem to be solved by the present invention is how to identify checkerboard corner points in image recognition. Therefore, an example of the image to be detected can be as follows: Figure 2 The example diagram shown.
[0141] Since the image to be detected generally has multiple colors in the unprocessed state, and if the image including multiple colors is directly processed, on the one hand, the complexity of the algorithm will be increased, and on the other hand, the computing load of the device will be increased. Therefore, it is necessary to convert the image to be detected into a grayscale image through step S11. As for the specific method of converting to a grayscale image, although it can be a variety of forms known to those skilled in the art, including but not limited to methods such as decolorization and grayscale histogram conversion. In one example of the present invention, considering that the original image to be detected is generally an RGB [R (red, red), G (green, green), B (blue, blue)] image, then weighting can be performed according to at least two of these three colors, so as to calculate the corresponding grayscale value after conversion. Specifically, in this example, when there are three color channels for weighting, the grayscale value after conversion can be calculated according to the following formula (1):
[0142] Gray i,j =λ 1 *R i,j +λ 2 *G i,j +λ 3 *B i,j , (1)
[0143] Among them, i, j are the coordinates of the pixel in the image, Gray i,j is the gray value after conversion, R i,j is the red channel value of the pixel, G i,j is the green channel value of the pixel, B i,j is the blue channel value of the pixel, λ 1 , 2 , 3 are the corresponding weight values respectively.
[0144] In this embodiment, the weight value may be a plurality of values known to those skilled in the art. In this example, the weight values may be 0.299, 0.578, and 0.114, respectively. That is, the method of converting to the corresponding grayscale value may also be to convert according to the following formula (2):
[0145] Gray i,j =0.299*Ri,j +0.578*G i,j +0.114*B i,j , (2).
[0146] After converting the grayscale image, considering that there is a large color difference between the colored area and the colorless area in the image to be detected, the color difference can be manifested as a grayscale jump in the grayscale image. Then, in order to detect the grayscale jump, considering the complexity of the algorithm, the intersection between the grayscale jump and the grid, that is, the grayscale jump point, can be determined by grid projection. Figure 1 Steps S12 to S14 in the detection method are shown.
[0147] Step S12 is used to project a grid in the grayscale image to obtain a grid area. Since the size of the projected grid is inconsistent with the chessboard grid of the image to be detected, or there is a boundary misalignment, or both situations exist at the same time. Therefore, the projected grid will have multiple intersections with the chessboard grid. The characteristics of the two sides of the boundary of the chessboard grid in the grayscale image are characterized by a large grayscale difference (greater than a preset grayscale threshold), so the intersection is the grayscale jump point, that is, step S13: determine the grayscale jump point on each grid boundary in the grid area. Since the grayscale jump points are all points on the boundary of the chessboard grid, the boundary of the chessboard grid can be obtained by connecting the grayscale jump points. Further, since the chessboard corner point is actually the intersection point of the boundary of the chessboard grid, the chessboard corner point can be obtained by determining the intersection point of the boundary, that is, step S14: determine the chessboard corner point according to the grayscale jump point.
[0148] In this embodiment, the specific method for determining the grayscale jump point on each grid boundary in the grid area in step S13 can be various forms known to those skilled in the art. In one example of the present invention, in view of the above explanation of the grayscale jump point, step S13 can include the following steps: Figure 3 In the steps shown in Figure 3 In the step S13, the step S13 may include:
[0149] In step S20, the grayscale difference between two adjacent pixel elements is calculated along the grid boundary, wherein the pixel element may include at least one pixel point;
[0150] In step S21, it is determined whether the grayscale difference is greater than or equal to a preset grayscale threshold;
[0151] In step S22, when it is determined that the grayscale difference is greater than or equal to the grayscale threshold, the intersection of the two pixel elements is determined as the grayscale transition point.
[0152] In this Figure 3In the method shown, step S20 is used to calculate the grayscale difference between two adjacent pixel elements along the grid boundary. Since there may be too many pixels in the actual calculation, it is necessary to classify the original multiple pixels into pixel elements to improve the efficiency of calculating the grayscale difference. Therefore, the grayscale difference is calculated by comparing two pixel elements in step S20. Wherein, in the case where the pixel element only includes a single pixel, the grayscale difference can be determined by directly subtracting the grayscales of the two pixel elements. In the case where the pixel element includes multiple pixels, the grayscale difference can be determined by, for example, first calculating the grayscale eigenvalues of the two pixel elements, and then subtracting the two grayscale eigenvalues to obtain the grayscale difference. As for the calculation method of the grayscale eigenvalue, it can be one or more of the average value, mode, median value and extreme average value (average value of the maximum value and the minimum value) of each pixel in the pixel element, but not limited to.
[0153] Step S21 is used to determine whether the grayscale difference is greater than or equal to a preset grayscale threshold, wherein the grayscale threshold can be a plurality of values known to those skilled in the art.
[0154] After the grayscale transition point is determined, step S14 may be used to determine the checkerboard corner point according to the grayscale transition point. Considering that the grayscale transition points are all points on the boundary of the checkerboard grid, the boundary of the checkerboard grid can be obtained by connecting the grayscale transition points, and the intersection of the boundary is the checkerboard corner point. Therefore, in this embodiment, the method for determining the checkerboard corner point may include the following steps: Figure 4 In the method shown in Figure 4 In the step S14, the step S14 may further include the following steps:
[0155] In step S30, each grid in the grid area is traversed to determine the number of grayscale transition points on the grid boundary of the same grid;
[0156] In step S31, it is determined whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first quantity threshold (considering that there are checkerboard corner points in the grid, the grid boundary must intersect with the boundary of the checkerboard grid, so the first quantity threshold for determining the number of grayscale transition points may be 1);
[0157] In step S32, when it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to the preset first number threshold, it is determined that there are checkerboard corner points in the grid; conversely, when it is determined that the number of grayscale transition points on the grid boundary of the same grid is less than the preset first number threshold, it is determined that there are no checkerboard corner points in the grid, and at this time, the process can return to step S30 to select a new grid;
[0158] In step S33, in the grid where the checkerboard corner points exist, the grayscale jump points on the relative boundaries are connected to obtain corresponding straight line segments;
[0159] In step S34, the intersection points of the straight line segments are used as checkerboard corner points.
[0160] In this embodiment, since the checkerboard corner point is the intersection point of the border of the checkerboard grid in the image to be detected, if there is a checkerboard corner point in any grid in the grid area, then there must be two checkerboard grid borders passing through the grid in the grid area. Figure 4 In the method shown, each grid in the grid area is first traversed through step S30 to determine the number of grayscale transition points on the grid boundary of the same grid. Since if there is a checkerboard corner point in any grid in the grid area, there must be two checkerboard grid boundaries passing through the grid in the grid area, that is, there must be at least one grayscale transition point on each grid boundary of the grid. In an example of the present invention, when the grid contains a checkerboard corner point, the schematic diagram of the grid can be as follows Figure 5 Therefore, the Figure 4 The method shown also determines the grid containing the checkerboard corner point through step S31 and step S32. Since the checkerboard corner point is the intersection point of the boundary of the checkerboard grid, the checkerboard corner point can be obtained by connecting the corresponding straight line segments through step S33 and step S34.
[0161] In addition, in order to facilitate the determination of the coordinates of the checkerboard corner points, the coordinates of the grayscale transition points can be converted. As for the coordinate conversion method, there are many methods known to those skilled in the art. In one example of the present invention, Figure 5 Taking the checkerboard corner point shown in as an example, the intersection of grayscale transition points A, B, C, and D is recorded as P, and the center point of the grid is recorded as O. Then the coordinates of the checkerboard corner point Q on the original grayscale image can be calculated using the following formulas (3) and (4):
[0162] Q x =C x +(P x -O x ), (3)
[0163] Q y =C y +(P y -O y ), (4)
[0164] Among them, x and y are the horizontal and vertical coordinates of the pixel.
[0165] In addition, considering that there may be multiple checkerboard corner points in the same grid, when executing step S33, it is necessary to consider the arrangement characteristics of the checkerboard corner points, and the boundaries that pass through different checkerboard corner points and do not intersect with each other are parallel to each other. That is, on two opposite grid boundaries of the same grid, there will be multiple grayscale jump points corresponding to each other. Therefore, before connecting the straight line segments, it can be first determined whether the grayscale jump points on the opposite grid boundaries of the same grid are greater than or equal to the preset second number threshold; in the case of determining that the grayscale jump points on the opposite grid boundaries of the same grid are greater than or equal to the second number threshold, it is determined that the grid contains multiple checkerboard corner points. Therefore, according to the arrangement characteristics of the boundaries connecting the checkerboard corner points (that is, the boundaries that pass through different checkerboard corner points and do not intersect with each other are parallel to each other), the grayscale jump points on the grid boundaries can be connected in the order of arrangement on the grid boundaries, thereby obtaining corresponding multiple straight line segments.
[0166] Among them, since the first quantity threshold used when judging whether there is a single checkerboard corner point in the grid may be 1, the second quantity threshold used for further judging whether there are multiple checkerboard corner points in the grid may be 2 on this basis.
[0167] In this embodiment, since the values of multiple color channels are considered simultaneously when calculating the grayscale value, after the multiple color channels are weighted, the calculated grayscale values may be similar or differ greatly, which may lead to misidentification of the grayscale jump point in the subsequent step S13. Therefore, in one embodiment of the present invention, when executing step S12 (i.e., projecting a grid in a grayscale image to obtain a grid area), a preset grid of multiple sizes may be used to project the grayscale image, thereby obtaining a corresponding plurality of grid areas. Correspondingly, step S13 may be to determine the grayscale jump point on each grid boundary in each grid area respectively; and step S14 may be to determine the checkerboard corner points on each grid area respectively as the checkerboard corner points to be clustered; finally, the detection system clusters the checkerboard corner points to be clustered by using a preset clustering method on the basis of step S13 and step S14, thereby obtaining the checkerboard corner points.
[0168] Among them, for the clustering method, although it can be a variety of methods known to those skilled in the art, such as the k-means clustering method. In one example of the present invention, considering that without misidentification of grayscale jump points, the grid points to be clustered obtained under projections of different sizes should all represent the area where the checkerboard corner points are located. Therefore, it can be determined whether the cluster is a checkerboard corner point based on the density of the clustered cluster after clustering. That is, the clustering method can be a density-based clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, DBSCAN). Specifically, the way to obtain the checkerboard corner point can include the following: Figure 6 In the method shown in Figure 6 In the method of obtaining the corner points of the chessboard, the following steps may be included:
[0169] In step S40, the grid corner points to be clustered are clustered to obtain a plurality of clusters;
[0170] In step S41, it is determined whether the number of points in each cluster is greater than or equal to a preset value;
[0171] In step S42, when it is determined that the number of points is greater than or equal to the preset value, the cluster is used as a checkerboard corner point.
[0172] On the contrary, in step S43, when it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point. Finally, through the detection system provided by the present invention, the schematic diagram of the chessboard corner point obtained can be: Figure 7 shown.
[0173] On the other hand, the embodiment of the present invention also provides a checkerboard corner point detection system based on image texture. The structural block diagram of the detection system can be as follows: Figure 8 As shown. Figure 8 In the present invention, the detection system may include an input module 1, a corner point detection module 2, and an output module 3. The input module 1 may be used to obtain an image to be detected and convert the image into a grayscale image. The corner point detection module 2 may be used to project a grid on the grayscale image to obtain a grid area and determine the grayscale transition point on each grid boundary in the grid area. The output module 3 may be used to determine the checkerboard corner point according to the grayscale transition point.
[0174] Among them, the specific forms of the input module 1, the corner detection module 2 and the output module 3 can be composed of one or more processors, and the processor can include but is not limited to a general-purpose processor, a special-purpose processor, a conventional processor, a digital signal processor (DSP), multiple microprocessors, one or more microprocessors associated with a DSP core, a controller, a microcontroller, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) circuit, any other type of integrated circuit (IC), a state machine, a system-on-chip (SOC), etc.
[0175] In this Figure 8 In the chessboard corner point detection system based on image texture shown, the input module 1 can be used to obtain the image to be detected. In view of the technical problem to be solved by the present invention is how to identify the chessboard corner points in image recognition. Therefore, an example of the image to be detected can be as follows Figure 2 The example diagram shown.
[0176] Since the image to be detected generally has multiple colors in the unprocessed state, if the image including multiple colors is directly processed, on the one hand, the complexity of the algorithm will be increased, and on the other hand, the computing load of the device will be increased. Therefore, it is necessary to convert the image to be detected into a grayscale image through step S11. As for the specific method of converting to a grayscale image, although it can be a variety of forms known to those skilled in the art, including but not limited to methods such as decolorization and grayscale histogram conversion. In one example of the present invention, considering that the original image to be detected is generally an RGB [R (red, red), G (green, green), B (blue, blue)] image, then weighting can be performed according to at least two of these three colors, thereby calculating the corresponding grayscale value after conversion. Specifically, in this example, when there are three color channels for weighting, the input module 1 can calculate the grayscale value after conversion according to the following formula (1):
[0177] Gray i,j =λ 1 *R i,j +λ 2 *G i,j +λ 3 *B i,j , (1)
[0178] Among them, i, j are the coordinates of the pixel in the image, Gray i,j is the gray value after conversion, R i,j is the red channel value of the pixel, G i,j is the green channel value of the pixel, B i,j is the blue channel value of the pixel, λ 1 , 2 ,3 are the corresponding weight values respectively.
[0179] In this embodiment, the weight value may be a plurality of values known to those skilled in the art. In this example, the weight values may be 0.299, 0.578, and 0.114, respectively. That is, the method of converting to the corresponding grayscale value may also be to convert according to the following formula (2):
[0180] Gray i,j =0.299*R i,j +0.578*G i,j +0.114*B i,j , (2).
[0181] After converting the grayscale image, considering that there is a large color difference between the colored area and the colorless area in the image to be detected, the color difference can be manifested as a grayscale jump in the grayscale image. Then, in order to detect the grayscale jump, considering the complexity of the algorithm, the intersection between the grayscale jump and the grid, that is, the grayscale jump point, can be determined by grid projection. Figure 1 Steps S12 to S14 in the detection method are shown.
[0182] Corner point detection module 2 can be used to project a grid in a grayscale image to obtain a grid area. Since the size of the projected grid is either inconsistent with the chessboard grid of the image to be detected, or there is a boundary misalignment, or both situations exist at the same time. Therefore, the projected grid will have multiple intersections with the chessboard grid. The characteristics of both sides of the boundary of the chessboard grid in the grayscale image are characterized by a large grayscale difference (greater than a preset grayscale threshold), so the intersection is the grayscale jump point. Since the grayscale jump points are all points on the boundary of the chessboard grid, the boundary of the chessboard grid can be obtained by connecting the grayscale jump points. Further, since the chessboard corner point is actually the intersection point of the boundary of the chessboard grid, the chessboard corner point can be obtained by determining the intersection point of the boundary. Then, output module 3 can be used to determine the chessboard corner point according to the grayscale jump point.
[0183] In this embodiment, the specific method for the corner point detection module 2 to determine the grayscale jump point on each grid boundary in the grid area can be various forms known to those skilled in the art. In one example of the present invention, in view of the above explanation of the grayscale jump point, the corner point detection module 2 can be used to perform the following steps: Figure 3 In the method shown in Figure 3 In the embodiment, the corner point detection module 2 can be used to perform the following steps:
[0184] In step S20, the grayscale difference between two adjacent pixel elements is calculated along the grid boundary, wherein the pixel element may include at least one pixel point;
[0185] In step S21, it is determined whether the grayscale difference is greater than or equal to a preset grayscale threshold;
[0186] In step S22, when it is determined that the grayscale difference is greater than or equal to the grayscale threshold, the intersection of the two pixel elements is determined as the grayscale transition point.
[0187] In this Figure 3 In the method shown, step S20 is used to calculate the grayscale difference between two adjacent pixel elements along the grid boundary. Since there may be too many pixels in the actual calculation, it is necessary to classify the original multiple pixels into pixel elements to improve the efficiency of calculating the grayscale difference. Therefore, the grayscale difference is calculated by comparing two pixel elements in step S20. Wherein, in the case where the pixel element only includes a single pixel, the grayscale difference can be determined by directly subtracting the grayscales of the two pixel elements. In the case where the pixel element includes multiple pixels, the grayscale difference can be determined by, for example, first calculating the grayscale eigenvalues of the two pixel elements, and then subtracting the two grayscale eigenvalues to obtain the grayscale difference. As for the calculation method of the grayscale eigenvalue, it can be one or more of the average value, mode, median value and extreme average value (average value of the maximum value and the minimum value) of each pixel in the pixel element, but not limited to.
[0188] Step S21 is used to determine whether the grayscale difference is greater than or equal to a preset grayscale threshold, wherein the grayscale threshold can be a plurality of values known to those skilled in the art.
[0189] After the grayscale transition point is determined, step S14 can be used to determine the checkerboard corner point according to the grayscale transition point. Considering that the grayscale transition points are all points on the boundary of the checkerboard grid, the boundary of the checkerboard grid can be obtained by connecting the grayscale transition points, and the intersection of the boundary is the checkerboard corner point. Therefore, in this embodiment, the method for the output module 3 to determine the checkerboard corner point can include the following steps: Figure 4 In the method shown in Figure 4 In the step S14, the step S14 may further include the following steps:
[0190] In step S30, each grid in the grid area is traversed to determine the number of grayscale transition points on the grid boundary of the same grid;
[0191] In step S31, it is determined whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first quantity threshold (considering that there are checkerboard corner points in the grid, the grid boundary must intersect with the boundary of the checkerboard grid, so the first quantity threshold for determining the number of grayscale transition points may be 1);
[0192] In step S32, when it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to the preset first number threshold, it is determined that there are checkerboard corner points in the grid; conversely, when it is determined that the number of grayscale transition points on the grid boundary of the same grid is less than the preset first number threshold, it is determined that there are no checkerboard corner points in the grid, and at this time, the process can return to step S30 to select a new grid;
[0193] In step S33, in the grid where the checkerboard corner points exist, the grayscale jump points on the relative boundaries are connected to obtain corresponding straight line segments;
[0194] In step S34, the intersection points of the straight line segments are used as checkerboard corner points.
[0195] In this embodiment, since the checkerboard corner point is the intersection point of the border of the checkerboard grid in the image to be detected, if there is a checkerboard corner point in any grid in the grid area, then there must be two checkerboard grid borders passing through the grid in the grid area. Figure 4 In the method shown, each grid in the grid area is first traversed through step S30 to determine the number of grayscale transition points on the grid boundary of the same grid. Since if there is a checkerboard corner point in any grid in the grid area, there must be two checkerboard grid boundaries passing through the grid in the grid area, that is, there must be at least one grayscale transition point on each grid boundary of the grid. In an example of the present invention, when the grid contains a checkerboard corner point, the schematic diagram of the grid can be as follows Figure 5 Therefore, the Figure 4 The method shown also determines the grid containing the checkerboard corner point through step S31 and step S32. Since the checkerboard corner point is the intersection point of the boundary of the checkerboard grid, the checkerboard corner point can be obtained by connecting the corresponding straight line segments through step S33 and step S34.
[0196] In addition, in order to facilitate the determination of the coordinates of the checkerboard corner points, the coordinates of the grayscale transition points can be converted. As for the coordinate conversion method, there are many methods known to those skilled in the art. In one example of the present invention, Figure 5 Taking the checkerboard corner point shown in as an example, the intersection of grayscale transition points A, B, C, and D is recorded as P, and the center point of the grid is recorded as O. Then the coordinates of the checkerboard corner point Q on the original grayscale image can be calculated using the following formulas (3) and (4):
[0197] Q x =C x +(P x -O x ), (3)
[0198] Qy =C y +(P y -O y ), (4)
[0199] Among them, x and y are the horizontal and vertical coordinates of the pixel.
[0200] Considering that there may be multiple checkerboard corner points in the same grid, when executing step S33, it is necessary to consider the arrangement characteristics of the checkerboard corner points, and the boundaries that pass through different checkerboard corner points and do not intersect with each other are parallel to each other. That is, on two opposite grid boundaries of the same grid, there will be multiple grayscale jump points corresponding to each other. Therefore, before connecting the straight line segments, it can be first determined whether the grayscale jump points on the opposite grid boundaries of the same grid are greater than or equal to the preset second number threshold; in the case of determining that the grayscale jump points on the opposite grid boundaries of the same grid are greater than or equal to the second number threshold, it is determined that the grid contains multiple checkerboard corner points. Therefore, according to the arrangement characteristics of the boundaries connecting the checkerboard corner points (that is, the boundaries that pass through different checkerboard corner points and do not intersect with each other are parallel to each other), the grayscale jump points on the grid boundaries can be connected in the order of arrangement on the grid boundaries, thereby obtaining corresponding multiple straight line segments.
[0201] Among them, since the first quantity threshold used when judging whether there is a single checkerboard corner point in the grid may be 1, the second quantity threshold used for further judging whether there are multiple checkerboard corner points in the grid may be 2 on this basis.
[0202] In this embodiment, since the values of multiple color channels are considered simultaneously when calculating the grayscale value, after the weighting of multiple color channels, the calculated grayscale values may be similar or differ greatly, which may lead to the situation that the grayscale jump point is determined in the subsequent step S13. Therefore, in one embodiment of the present invention, when executing step S12 (i.e., projecting a grid in a grayscale image to obtain a grid area), the grayscale image can be projected using grids of preset multiple sizes to obtain corresponding multiple grid areas. Correspondingly, step S13 can be to determine the grayscale jump points on each grid boundary in each grid area respectively; and step S14 can be to determine the checkerboard corner points on each of the grid areas respectively as the checkerboard corner points to be clustered; finally, the detection method, based on step S13 and step S14, clusters the checkerboard corner points to be clustered by using a preset clustering method to obtain the checkerboard corner points. Among them, the preset multiple sizes can be a variety known to those skilled in the art. In an example of the present invention, the preset multiple sizes may include but are not limited to 3*3, 5*5, 7*7, etc.
[0203] Among them, for the clustering method, although it can be a variety of methods known to those skilled in the art, such as the k-means clustering method. In one example of the present invention, considering that without misidentification of grayscale jump points, the grid points to be clustered obtained under projections of different sizes should all represent the area where the checkerboard corner points are located. Therefore, it can be determined whether the cluster is a checkerboard corner point based on the density of the clustered cluster after clustering. That is, the clustering method can be a density-based clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, DBSCAN). Specifically, the way to obtain the checkerboard corner point can include the following: Figure 6 In the method shown in Figure 6 In the method of obtaining the corner points of the chessboard, the following steps may be included:
[0204] In step S40, the grid corner points to be clustered are clustered to obtain a plurality of clusters;
[0205] In step S41, it is determined whether the number of points in each cluster is greater than or equal to a preset value;
[0206] In step S42, when it is determined that the number of points is greater than or equal to the preset value, the cluster is used as a checkerboard corner point.
[0207] On the contrary, in step S43, when it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point. Finally, through the detection system provided by the present invention, the schematic diagram of the chessboard corner point obtained can be: Figure 7 shown.
[0208] On the other hand, an embodiment of the present invention further provides a computer-readable storage medium, which stores instructions, and the instructions are used to be read by a machine so that the machine executes the detection method as described above.
[0209] Beneficial effects of the present invention:
[0210] The embodiment of the present invention obtains the checkerboard corner points by projecting the grid area and combining the judgment of the grayscale jump point. Compared with the prior art, the deep processing of image separation and the like is avoided, thereby improving the accuracy of the obtained checkerboard corner points;
[0211] The embodiment of the present invention obtains the checkerboard corner points by projecting the grid area and combining the judgment of the grayscale jump point. Compared with the prior art, it only uses relatively simple projection and grayscale judgment, which reduces the dependence on equipment.
[0212] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.
Claims
1. A checkerboard corner point detection method based on image texture, characterized in that: The detection method comprises: Acquire an image to be detected; converting the image into a grayscale image; Projecting a grid in the grayscale image to obtain a grid area; Determine a grayscale transition point on each grid boundary in the grid area; The checkerboard corner points are determined according to the grayscale transition points.
2. The detection method according to claim 1, characterized in that: Converting the image to a grayscale image includes: Each pixel point on the image is traversed, and weighted calculation is performed according to the pixel channel of the pixel point to obtain the corresponding pixel point on the grayscale image.
3. The detection method according to claim 2, characterized in that: The pixel channels include at least two of a red channel, a green channel, and a blue channel.
4. The detection method according to claim 1, characterized in that: Determining a grayscale transition point on each grid boundary in the grid area includes: Along the grid boundary, respectively calculating the grayscale difference between two adjacent pixel elements, wherein the pixel element includes at least one pixel point; Determining whether the grayscale difference is greater than or equal to a preset grayscale threshold; When it is determined that the grayscale difference is greater than or equal to the grayscale threshold, an intersection point of the two pixel elements is determined as the grayscale transition point.
5. The detection method according to claim 1, characterized in that: Determining the checkerboard corner points according to the grayscale transition points includes: Traversing each grid in the grid area, and determining the number of grayscale transition points on the grid boundary of the same grid; Determine whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold; When it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold, determining that there is a checkerboard corner point in the grid; In the grid where there are checkerboard corner points, connect the grayscale jump points on the relative boundaries to obtain corresponding straight line segments; The intersection points of the straight line segments are used as the chessboard corner points.
6. The detection method according to claim 5, characterized in that: Connect the grayscale transition points on the relative boundaries, including: Determine whether the grayscale jump points on the relative grid boundaries of the same grid are all greater than or equal to a preset second quantity threshold; When it is determined that the grayscale jump points on the relative grid boundaries of the same grid are greater than or equal to a preset second quantity threshold, the grayscale jump points on the relative grid boundaries are connected in the order of arrangement on the grid boundaries to obtain corresponding multiple straight line segments.
7. The detection method according to claim 1, characterized in that: Projecting a grid in the grayscale image to obtain a grid region includes: Projecting the grayscale image using grids of a plurality of preset sizes to obtain a plurality of grid areas; Determining a grayscale transition point on each grid boundary in the grid area includes: Respectively determine the grayscale jump point on each grid boundary in each of the grid areas; Determining the checkerboard corner points according to the grayscale transition points includes: Determine the checkerboard corner points on each of the grid areas respectively as the checkerboard corner points to be clustered; The detection method comprises: The grid corner points to be clustered are clustered using a preset clustering method to obtain the chessboard grid corner points.
8. The detection method according to claim 7, characterized in that: The clustering method includes a density-based clustering algorithm.
9. The detection method according to claim 7, characterized in that: Clustering the to-be-clustered grid corner points using a preset clustering method to obtain the chessboard grid corner points includes: Clustering the grid corner points to be clustered to obtain a plurality of clusters; Determine whether the number of points in each cluster is greater than or equal to a preset value; When it is determined that the number of points is greater than or equal to the preset value, the cluster is used as the checkerboard corner point.
10. The detection method according to claim 9, characterized in that: Clustering the to-be-clustered grid corner points using a preset clustering method to obtain the chessboard grid corner points includes: When it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point.
11. A checkerboard corner point detection system based on image texture, characterized in that: The detection system comprises a processor, and the processor is used to execute the detection method according to any one of claims 1 to 10.
12. A checkerboard corner point detection system based on image texture, characterized in that: The detection system comprises: An input module, used for acquiring an image to be detected and converting the image into a grayscale image; A corner point detection module, used for projecting a grid in the grayscale image to obtain a grid area, and determining a grayscale jump point on each grid boundary in the grid area; The output module is used to determine the checkerboard corner points according to the grayscale transition points.
13. The detection system according to claim 12, characterized in that: The input module is used to traverse each pixel point on the image, and perform weighted calculation according to the pixel channel of the pixel point to obtain the corresponding pixel point on the grayscale image.
14. The detection system according to claim 13, characterized in that: The pixel channels include at least two of a red channel, a green channel, and a blue channel.
15. The detection system according to claim 12, characterized in that: The corner point detection module is used for: Along the grid boundary, respectively calculating the grayscale difference between two adjacent pixel elements, wherein the pixel element includes at least one pixel point; Determining whether the grayscale difference is greater than or equal to a preset grayscale threshold; When it is determined that the grayscale difference is greater than or equal to the grayscale threshold, an intersection point of the two pixel elements is determined as the grayscale transition point.
16. The detection system according to claim 12, characterized in that: The output module is used for: Traversing each grid in the grid area, and determining the number of grayscale transition points on the grid boundary of the same grid; Determine whether the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold; When it is determined that the number of grayscale transition points on the grid boundary of the same grid is greater than or equal to a preset first number threshold, determining that there is a checkerboard corner point in the grid; In the grid where there are checkerboard corner points, connect the grayscale jump points on the relative boundaries to obtain corresponding straight line segments; The intersection points of the straight line segments are used as the chessboard corner points.
17. The detection system according to claim 16, characterized in that: The output module is used for: Determine whether the grayscale jump points on the relative grid boundaries of the same grid are all greater than or equal to a preset second quantity threshold; When it is determined that the grayscale jump points on the relative grid boundaries of the same grid are greater than or equal to a preset second quantity threshold, the grayscale jump points on the relative grid boundaries are connected in the order of arrangement on the grid boundaries to obtain corresponding multiple straight line segments.
18. The detection system according to claim 12, characterized in that: The corner point detection module is used for: Projecting the grayscale image using grids of a plurality of preset sizes to obtain a plurality of grid areas; Respectively determine the grayscale jump point on each grid boundary in each of the grid areas; The output module is used for: Determine the checkerboard corner points on each of the grid areas respectively as the checkerboard corner points to be clustered; The grid corner points to be clustered are clustered using a preset clustering method to obtain the chessboard grid corner points.
19. The detection system according to claim 18, characterized in that: The clustering method includes a density-based clustering algorithm.
20. The detection system according to claim 18, characterized in that: The output module is used for: Clustering the grid corner points to be clustered to obtain a plurality of clusters; Determine whether the number of points in each cluster is greater than or equal to a preset value; When it is determined that the number of points is greater than or equal to the preset value, the cluster is used as the checkerboard corner point.
21. The detection system according to claim 20, characterized in that: The output module is used for: When it is determined that the number of points is less than the preset value, the cluster is regarded as a misjudged point.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are used to be read by a machine so that the machine executes the detection method according to any one of claims 1 to 10.
Citation Information
Patent Citations
A method, device and storage medium for automatic detection and sorting of chessboard corner points
CN115131575B
Checkerboard corner detection method and device
CN115578407A
Cited By
Intelligent catalyst structure detection system and method based on multi-dimensional AI vision
CN120431098A
Intelligent detection system and method for catalyst structure based on multi-dimensional AI vision
CN120431098B