A calibration plate corner point detection method, device and computer storage medium
By converting RGB images into YCbCr images and dividing quadrants, calculating the brightness difference value, the accuracy and efficiency of calibration plate corner point detection in complex background and fisheye lens imaging is solved, and fully automatic and accurate calibration plate corner point is achieved Test.
Patent Information
- Application Number
- CN202011267639.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-13
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-11-13
AI Technical Summary
The prior art is difficult to accurately detect the corners of the calibration plate in complex backgrounds and images with high noise, especially when the fisheye lens is imaged, resulting in missed or missed detection, and the automatic detection algorithm is inefficient.
By converting the RGB image into a YCbCr image, select neighborhood points in the range of 360 degrees, divide four quadrants, calculate the brightness and difference values, determine the candidate corner points, and remove the false detection points through verification, and finally determine the corner points of the calibration plate. .
Fully automatic and accurate detection in ordinary images and fisheye images with severe distortion is realized, and the accuracy and efficiency of calibration plate corner detection is improved.
Smart Images

Figure CN114494279B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of digital image processing, and in particular relates to a calibration plate corner point detection method, device and computer storage medium. Background Art
[0002] The calibration plate is a commonly used camera calibration tool with a wide range of uses. It is mainly used to calibrate camera parameters. By obtaining the corner points of the calibration plate, the internal and external parameters of the camera are obtained. For fisheye cameras, the calibration plate can be used for distortion correction to restore wide-angle lens imaging to an image that conforms to normal visual effects. For multiple cameras, by shooting the same calibration plate, the positional relationship between cameras can be determined, thereby achieving image stitching, etc. The image of the calibration plate is simple, the contrast is obvious, the features are simple, and the corner points are easy to detect. Therefore, the calibration plate is widely used in the field of computer vision. The accurate detection of the corner points of the calibration plate is also an important topic in the field of digital image processing.
[0003] At present, the detection of the corner points of the calibration plate can be done through human-computer interaction, but this method requires manual selection of all the corner points on the calibration plate, which is time-consuming, inefficient, and not conducive to widespread use. For the automatic detection algorithm, it is generally based on the gradient transformation of the calibration plate to determine the edge of each chessboard, and then obtain the corner points of the calibration plate. However, this method cannot well determine the corner points of the calibration plate under complex backgrounds. The degree of gradient change near the corner points in images with large noise is weakened, which can easily cause missed detection or false detection. There is also a method of using rectangular model comparison to determine the corner points of the calibration plate. This method is not suitable for fisheye lens imaging. The image taken by the fisheye lens is highly distorted, and the captured calibration plate chessboard does not conform to the rectangular template. Summary of the invention
[0004] In view of this, the present invention provides a calibration plate corner point detection method, device and computer storage medium to address the deficiencies of the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical scheme:
[0006] An embodiment of the present invention provides a calibration plate corner point detection method, comprising:
[0007] The acquired RGB image is converted into a YCbCr image according to a preset rule to obtain the brightness information of each pixel;
[0008] Select the coordinates of the neighborhood range; the neighborhood is selected with the coordinates of the point to be judged as the center, and the surrounding 360-degree range is equally divided into n directions, and k points are selected in each direction. These points together constitute the neighborhood of the point to be judged;
[0009] Determine the candidate corner points of the calibration plate; specifically, the following steps include: dividing the n directions of the neighborhood around the point to be detected into four equal parts to represent four quadrants, traversing the cases where the n directions belong to four different quadrants, and calculating the brightness sum of the neighborhood points in each quadrant in each case, wherein the quadrant division of the n directions of the neighborhood around any point to be detected should meet the requirement that the two quadrants with larger brightness sums are diagonal to each other; the other two quadrants with smaller brightness sums are also diagonal to each other; obtain the difference resp between the brightness sum of the two quadrants with the largest brightness sums and the brightness sum of the remaining two quadrants in each case, the quadrant division corresponding to the maximum difference resp is the final four quadrants of the point, and the point to be detected is the candidate corner point of the calibration plate;
[0010] Determine the corner point of the calibration plate; specifically, include: detect each candidate corner point in turn, if there is a candidate point with a larger resp value within a preset range around the candidate point, then remove the point from the candidate point, otherwise the point is determined as the corner point of the calibration plate;
[0011] Verify the effect of detecting the corner points of the calibration plate.
[0012] Furthermore, the preset rule for converting the acquired RGB image into a YCbCr image is as follows:
[0013] Y=0.257*R+0.504*G+0.098*B+16
[0014] Cb=-0.148*R-0.291*G+0.439*B+128
[0015] Cr=0.439*R-0.368*G-0.071*B+128
[0016] Furthermore, the coordinates (x, y) of the neighborhood points can be expressed in plane polar coordinates as follows:
[0017] where r∈[1,k] a∈[0,n-1]
[0018] Furthermore, the surrounding 360-degree range is equally divided into n directions, where n is an integer multiple of 4.
[0019] Furthermore, for the four quadrants, the brightness sum of the neighboring points in each quadrant is sorted from large to small as d0, d1, d2 and d3; the quadrant with a brightness sum of d0 is diagonally opposite to the quadrant with a brightness sum of d1, and the quadrant with a brightness sum of d3 is diagonally opposite to the quadrant with a brightness sum of d2; and satisfy
[0020] Where S is the preset coefficient.
[0021] Furthermore, the situation where n directions belong to four different quadrants can be solved by rotating the rectangular coordinate system each time. Realize the re-division of neighborhood points into quadrants.
[0022] Furthermore, the verification of the effect of detecting the corner points of the calibration plate specifically includes:
[0023] First, determine whether the number of corner points of the calibration plate detected is the same as the actual number of corner points of the calibration plate. If the number is different, the detection is considered invalid.
[0024] If the image to be detected is a fisheye image, the detected corner point coordinates need to be mapped to the dedistorted correction image. If there is a certain deflection of the corner points in the image to be detected, the detected corner point coordinates need to be homographically transformed and mapped to the bird's-eye view image without angle deflection, and then compared with the corner points of the ideal calibration plate to ensure that the detected corner point coordinates are mapped to the distortion-free bird's-eye view coordinates;
[0025] The detection is performed based on the edge and center values of the calibration plate; specifically, the following steps are used: the average value of all corner points is calculated and compared with the center point of the ideal calibration plate. If the average value is greater than the set threshold, the detection is invalid. The upper, lower, left and right edge values of the calibration plate are determined based on the coordinates of the corner points, and the difference is calculated with the corresponding edge of the ideal calibration plate. If the difference of any edge exceeds the set threshold, the detection is invalid.
[0026] The embodiment of the present invention further provides a calibration plate corner point detection device, comprising:
[0027] An image conversion module is used to convert the acquired RGB image into a YCbCr image according to a preset rule to obtain the brightness information of each pixel;
[0028] The neighborhood selection module is used to select the coordinates of the neighborhood range. The neighborhood selection takes the coordinates of the point to be judged as the center, divides the surrounding 360-degree range into n directions, and selects k points in each direction. These points together constitute the neighborhood of the point to be judged.
[0029] The first determination module is used to determine the candidate points of the calibration plate corner points; determining the candidate points of the calibration plate corner points specifically includes: dividing the n directions of the neighborhood around the point to be detected into four equal parts to represent four quadrants, traversing the situation where the n directions belong to four different quadrants, and calculating the brightness sum of the neighborhood points in each quadrant in each case, wherein the quadrant division of the n directions of the neighborhood around any point to be detected should meet the requirement that the two quadrants with larger brightness sums are diagonal to each other; the other two quadrants with smaller brightness sums are also diagonal to each other; obtaining the difference resp between the brightness sum of the two quadrants with the largest brightness sum and the brightness sum of the remaining two quadrants in each case, the quadrant division corresponding to the maximum difference resp is the final four quadrants of the point, and the point to be detected is the candidate point of the calibration plate corner point;
[0030] The second determination module is used to determine the corner points of the calibration plate; determining the corner points of the calibration plate specifically includes: detecting each candidate corner point in turn, if there is a candidate point with a larger resp value within a preset range around the candidate point, then the point is removed from the candidate points, otherwise the point is determined as the corner point of the calibration plate;
[0031] The verification detection module is used to verify the effect of detecting the corner points of the calibration plate.
[0032] An embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the calibration plate corner point detection method described above are implemented.
[0033] An embodiment of the present invention further provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the calibration plate corner point detection method described above when executing the computer program.
[0034] The calibration plate corner point detection method provided by the present invention can be fully automatically applied to ordinary images and severely distorted fisheye images to accurately obtain the coordinates of the calibration plate corner points in the image. By dividing the neighborhood around each point into four quadrants, it is determined whether the point is a corner point based on the relationship between the quadrants, thereby realizing automatic detection of all corner points of the entire calibration plate. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 is a flow chart of a calibration plate corner point detection method provided by an embodiment of the present invention;
[0037] Figure 2 It is the process of dividing the four quadrants when determining the candidate points of the calibration plate corners;
[0038] Figure 3 yes Figure 2 The final division of the four quadrants;
[0039] Figure 4 Ordinary points that do not meet the corner point conditions of the calibration plate cannot well divide the four quadrants that meet the conditions;
[0040] Figure 5 Schematic diagram of a calibration plate corner point detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Figure 1 The figure is a flow chart of a method for detecting corner points of a calibration plate provided by an embodiment of the present invention. The method comprises the following steps:
[0043] S101 . Convert the acquired RGB image into a YCbCr image according to a preset rule to obtain brightness information of each pixel.
[0044] Convert RGB images into YCbCr images. Separating the brightness and chromaticity information of an image can avoid interference between colors and facilitate subsequent image processing.
[0045] In this embodiment, the RGB image can be converted into a YCbCr image using the following preset rules:
[0046] Y=0.257*R+0.504*G+0.098*B+16
[0047] Cb=-0.148*R-0.291*G+0.439*B+128
[0048] Cr=0.439*R-0.368*G-0.071*B+128
[0049] The image is divided into brightness information and chromaticity information to avoid the influence of color on corner point recognition and detection.
[0050] S102, a neighborhood selection module is used to select neighborhood range coordinates; wherein the neighborhood selection is centered on the coordinates of the point to be determined, and the surrounding 360-degree range is equally divided into n directions, and k points are selected in each direction, and these points together constitute the neighborhood of the point to be determined.
[0051] Select the neighborhood range coordinates. To determine whether a point in the image is a corner point of the calibration plate, it is necessary to divide the surrounding 360-degree range into n directions with the coordinates of the point to be determined as the center, and select k points in each direction. These points together constitute the neighborhood of the point.
[0052] Select the neighborhood range coordinates. In order to determine the corner points of the calibration plate, it is necessary to judge each pixel in the image based on the brightness value of the neighborhood pixels around each point, so the neighborhood range must be set. With the point to be detected as the center, the surrounding 360 degrees is evenly divided into n directions, and k points are selected in each direction to form the neighborhood points of the point. n is preferably an integer multiple of 4.
[0053] The coordinates (x, y) of the neighborhood points can be expressed in plane polar coordinates as follows:
[0054] where r∈[1,k] a∈[0,n-1]
[0055] The selection of n and k can be set according to actual needs. In the implementation of the present invention, n=32 and k=18 can be selected.
[0056] S103, determine the candidate points of the corner points of the calibration plate; specifically including: dividing the n directions of the neighborhood around the point to be detected into four equal parts to represent four quadrants, traversing the situation where the n directions belong to four different quadrants respectively, and calculating the brightness sum of the neighborhood points in each quadrant in each case, wherein the quadrant division of the n directions of the neighborhood around any point to be detected should meet the requirement that the two quadrants with larger brightness sum are diagonal to each other; the other two quadrants with smaller brightness sum are also diagonal to each other; in each case, obtain the difference resp between the brightness sum of the two quadrants with the largest brightness sum and the brightness sum of the remaining two quadrants, the quadrant division corresponding to the maximum difference resp is the final four quadrants of the point, and the point to be detected is the candidate point of the corner point of the calibration plate.
[0057] Determine the candidate points for the corners of the calibration plate. For the corners of the calibration plate, their surroundings are divided into two white grids and two black grids, which are naturally divided into four quadrants. Therefore, for each point in the image, it is necessary to determine the most likely four-quadrant division method. Divide the n directions of the neighborhood around the point to be detected into four equal parts, representing the four quadrants. Traverse the cases where the n directions belong to different quadrants, and calculate the brightness sum of each quadrant in each case. The ideal four quadrants should be that two quadrants contain only white chessboard points, and two quadrants contain only black chessboard points, and the same color is diagonal to each other. Using this condition as the basis for judging the quadrant separation, the quadrant division of the n directions of the neighborhood around any point should meet the requirements that the sum of the brightness of the two quadrants is large and diagonal, and the sum of the brightness of the other two groups is small, and they are also diagonal to each other.
[0058] For a point in the image, there are multiple quadrant divisions that meet the above conditions for its division in n directions. In this case, the difference between the two quadrants with the maximum brightness and the brightness of the remaining two quadrants is obtained in each case. The quadrant division corresponding to the maximum difference is the final four quadrants of the point, and the point is used as a candidate point for the corner point of the calibration plate.
[0059] Determine the candidate points of the calibration plate corner points. For the calibration plate corner points, their neighborhood points belong to two diagonal black grids and two diagonal white grids. Based on the above characteristics, all points in the image are judged to obtain candidate points.
[0060] For each point's neighborhood points, it is necessary to divide them into four quadrants, and determine whether the point is a corner point of the calibration plate based on the relationship between the four quadrants. Therefore, it is first necessary to determine how the neighborhood points of each point are divided into four quadrants. In the present invention, the enumeration method is chosen to divide the n angles in the neighborhood into four quadrants in turn. For each point in the image, the brightness sum of the k points in each of the n directions of the neighborhood is counted. Divide the n directions into 4 equal parts, and for the 4 quadrants, sort the neighborhood points in each quadrant from large to small according to the brightness sum as d0, d1, d2, and d3; the quadrant with a brightness sum of d0 is diagonally opposite to the quadrant with a brightness sum of d1, and the quadrant with a brightness sum of d3 is diagonally opposite to the quadrant with a brightness sum of d2; the following conditions should be met for the corner points of the calibration plate
[0061] Where S is the preset coefficient.
[0062] s can be set according to actual conditions. In the embodiment of the present invention, s=3. For the corner points of the calibration plate, d0 is one of the white grid areas, d1 is the diagonal white grid area, and d2 and d3 represent two black grid areas. The above conditions indicate that the brightness of the white grid area should be greater than that of the black grid, and the brightness difference between the black and white grids should be much greater than the brightness difference between the white grids, and also much greater than the brightness difference between the black grids.
[0063] For the quadrant division that meets the above conditions, record the difference between the maximum two quadrants brightness and the minimum two quadrants brightness, resp = (d0 + d1) - (d2 + d3). For the points to be detected that do not meet the above inequality group, the resp value is 0. Then, according to the enumeration method, rotate the rectangular coordinate system clockwise or counterclockwise to re-divide the four quadrants. If the first division is n = 32 parts into four quadrants, the neighborhood points of n = [1, 8] can be divided into the first quadrant, the neighborhood points of n = [9, 16] can be divided into the second quadrant, the neighborhood points of n = [17, 24] can be divided into the third quadrant, and the neighborhood points of n = [25, 32] can be divided into the fourth quadrant. Calculate the resp value. Then rotate the coordinate axis clockwise to re-divide each area, and the neighboring points of n = [2,9] are in the first quadrant, the neighboring points of n = [10,17] are in the second quadrant, the neighboring points of n = [18,25] are in the third quadrant, and the points in the fourth quadrant are composed of the neighboring points of n = [26,32] and n = 1. And so on, complete all possible quadrant divisions.
[0064] Traversing the situation where n directions belong to 4 different quadrants by rotating the rectangular coordinate system each time To realize the re-division of the neighborhood points into quadrants. For example, for n = 32, the rectangular coordinate system can be rotated clockwise or counterclockwise each time. Each area is redivided to complete all possible quadrant divisions to ensure that the maximum difference between the sum of brightness of the two quadrants with the maximum brightness and the sum of brightness of the remaining two quadrants is obtained.
[0065] For all the resp values obtained for this point, the quadrant division represented by the maximum value is the final four-quadrant division method for this point. If the resp value is 0, it means that this point cannot be a corner point of the calibration plate and cannot be divided into four quadrants that meet the conditions.
[0066] like Figures 2 to 4 As shown, the division process between the four quadrants during the enumeration traversal process. Figure 2 and Figure 3 are the same, and this point is determined as the candidate corner point of the calibration plate. Figure 4 The point to be detected cannot be calibrated as a candidate point of the board corner.
[0067] S104, determining the corner points of the calibration plate; specifically comprising: detecting each candidate corner point in turn, if there is a candidate point with a larger resp value within a preset range around the candidate point, then the point is removed from the candidate points, otherwise the point is determined as the corner point of the calibration plate.
[0068] Determine the calibration plate corners. Among the calibration plate corner candidate points, determine the most likely calibration plate corner coordinates. For a candidate point within a certain range (no more than half a grid), there is only one corner coordinate. The larger the difference between the maximum two-quadrant brightness sum and the remaining two-quadrant brightness sum of the candidate point, the more likely it is a calibration plate corner. Therefore, for a candidate point, if there is no point with a larger brightness sum difference within the half grid around it, then the point is a calibration plate corner.
[0069] Determine the calibration plate corners. After performing possible four-quadrant divisions on each point in the image and obtaining the resp value, the calibration plate corners can be determined based on the resp value. For points with a resp value greater than 0, i.e., candidate calibration plate corners, these points appear near the actual calibration plate corners. Only near the intersection of the four grids of the calibration plate are there points that can divide the neighborhood points into four quadrants that meet the conditions. For points with a resp value of 0, it means that the brightness values of its neighborhood points do not meet the conditions for clear division into four regions, and do not meet the characteristics of the calibration plate corners, so they are not considered as candidate calibration plate corners.
[0070] Each candidate corner point is detected in turn. If there is a candidate point with a larger resp value within a certain range less than half a grid around the candidate point, the point is removed from the candidate points, otherwise the point is a corner point of the calibration plate. This step ensures that within the range, the point with the most obvious contrast in the four quadrants is a corner point, and other similar points are eliminated.
[0071] S105, verifying the effect of detecting the corner points of the calibration plate.
[0072] Verify the effect of detecting the corner points of the calibration plate. Compare the detected corner points of the calibration plate with the ideal calibration plate, mainly comparing the edge and center of the calibration plate, to ensure that the detected result is less than half a calibration grid away from the actual situation, which proves that the method is accurate and effective.
[0073] First, determine whether the number of corner points of the calibration plate detected is the same as the actual number of corner points of the calibration plate. If the number is different, the detection is considered invalid.
[0074] If the image to be detected is a fisheye image, the detected corner point coordinates need to be mapped to the dedistorted correction image. If there is a certain deflection of the corner points in the image to be detected, the detected corner point coordinates need to be homographically transformed and mapped to the bird's-eye view image without angle deflection, and then compared with the corner points of the ideal calibration plate to ensure that the detected corner point coordinates are mapped to the distortion-free bird's-eye view coordinates;
[0075] The detection is performed based on the edge and center values of the calibration plate; specifically, the following steps are used: the average value of all corner points is calculated and compared with the center point of the ideal calibration plate. If the average value is greater than the set threshold, the detection is invalid. The upper, lower, left and right edge values of the calibration plate are determined based on the coordinates of the corner points, and the difference is calculated with the corresponding edge of the ideal calibration plate. If the difference of any edge exceeds the set threshold, the detection is invalid.
[0076] Figure 5 FIG. 1 is a schematic diagram of a color image purple fringing correction device provided by an embodiment of the present invention, comprising:
[0077] The image conversion module 101 is used to convert the acquired RGB image into a YCbCr image according to a preset rule to obtain the brightness information of each pixel;
[0078] The neighborhood selection module 102 is used to select the coordinates of the neighborhood range; wherein the neighborhood selection is centered on the coordinates of the point to be determined, and the surrounding 360-degree range is equally divided into n directions, and k points are selected in each direction, and these points together constitute the neighborhood of the point to be determined;
[0079] The first determination module 103 is used to determine the candidate points of the calibration plate corner points; determining the candidate points of the calibration plate corner points specifically includes: dividing the n directions of the neighborhood around the point to be detected into four equal parts to represent four quadrants, traversing the situation where the n directions belong to four different quadrants, and calculating the brightness sum of the neighborhood points in each quadrant in each case, wherein the quadrant division of the n directions of the neighborhood around any point to be detected should meet the requirement that the two quadrants with larger brightness sum are diagonal to each other; the other two quadrants with smaller brightness sum are also diagonal to each other; obtaining the difference resp between the brightness sum of the two quadrants with the largest brightness sum and the brightness sum of the remaining two quadrants in each case, the quadrant division corresponding to the maximum difference resp is the final four quadrants of the point, and the point to be detected is the candidate point of the calibration plate corner point;
[0080] The second determination module 104 is used to determine the corner points of the calibration plate. Determining the corner points of the calibration plate specifically includes: detecting each candidate corner point in turn, and if there is a candidate point with a larger resp value within a preset range around the candidate point, then the point is removed from the candidate points, otherwise the point is determined as the corner point of the calibration plate;
[0081] The verification detection module 105 is used to verify the effect of detecting the corner points of the calibration plate.
[0082] It should be noted that: the calibration plate corner point detection device provided in the above embodiment only uses the division of the above program modules as an example when performing detection. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the calibration plate corner point detection device provided in the above embodiment and the calibration plate corner point detection method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment. The beneficial effects are the same as those in the method embodiment, and will not be repeated here.
[0083] The embodiment of the present invention further provides a computer storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the computer program can be executed by a processor of a computer device to complete the steps of the aforementioned calibration plate corner point detection method. The computer-readable storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like.
[0084] An embodiment of the present invention further provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the calibration plate corner point detection method described above when executing the computer program.
[0085] In the several embodiments provided by the present invention, it should be understood that the disclosed methods and intelligent devices can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0086] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0087] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for detecting corner points of a calibration plate, characterized in that: include: The acquired RGB image is converted into a YCbCr image according to a preset rule to obtain the brightness information of each pixel; Select the coordinates of the neighborhood range; the neighborhood is selected with the coordinates of the point to be judged as the center, and the surrounding 360-degree range is equally divided into n directions, and k points are selected in each direction. These points together constitute the neighborhood of the point to be judged; Determine the candidate corner points of the calibration plate; specifically, the following steps include: dividing the n directions of the neighborhood around the point to be detected into four equal parts to represent four quadrants, traversing the cases where the n directions belong to four different quadrants, and calculating the brightness sum of the neighborhood points in each quadrant in each case, wherein the quadrant division of the n directions of the neighborhood around any point to be detected should meet the requirement that the two quadrants with larger brightness sums are diagonal to each other; the other two quadrants with smaller brightness sums are also diagonal to each other; obtain the difference resp between the brightness sum of the two quadrants with the largest brightness sums and the brightness sum of the remaining two quadrants in each case, the quadrant division corresponding to the maximum difference resp is the final four quadrants of the point, and the point to be detected is the candidate corner point of the calibration plate; Determine the corner point of the calibration plate; specifically, include: detect each candidate corner point in turn, if there is a candidate point with a larger resp value within a preset range around the candidate point, then remove the point from the candidate point, otherwise the point is determined as the corner point of the calibration plate; Verify the effect of detecting the corner points of the calibration plate.
2. The method according to claim 1, characterized in that The preset rules for converting the acquired RGB image into a YCbCr image are as follows: Y=0.257*R+0.504*G+0.098*B+16 Cb=-0.148*R-0.291*G+0.439*B+128 Cr=0.439*R-0.368*G-0.071*B+128.
3. The method according to claim 1, characterized in that The coordinates (x, y) of the neighborhood points can be expressed in plane polar coordinates as follows: where r∈[1,k] 4. The method according to claim 1, characterized in that: Divide the surrounding 360 degrees into n directions, where n is an integer multiple of 4.
5. The method according to claim 1, characterized in that: For the four quadrants, the brightness of the neighboring points in each quadrant is sorted from large to small as d0, d1, d2 and d3; the quadrant with a brightness sum of d0 is diagonally opposite to the quadrant with a brightness sum of d1, and the quadrant with a brightness sum of d3 is diagonally opposite to the quadrant with a brightness sum of d2; and satisfy Where S is the preset coefficient.
6. The method according to claim 1, characterized in that The situation where n directions belong to four different quadrants can be solved by rotating the rectangular coordinate system each time Realize the re-division of neighborhood points into quadrants.
7. The method according to claim 1, characterized in that The verification and detection of the calibration plate corner points specifically include: First, determine whether the number of corner points of the calibration plate detected is the same as the actual number of corner points of the calibration plate. If the number is different, the detection is considered invalid. If the image to be detected is a fisheye image, the detected corner point coordinates need to be mapped to the dedistorted correction image. If there is a certain deflection of the corner points in the image to be detected, the detected corner point coordinates need to be homographically transformed and mapped to the bird's-eye view image without angle deflection, and then compared with the corner points of the ideal calibration plate to ensure that the detected corner point coordinates are mapped to the distortion-free bird's-eye view coordinates; The detection is performed based on the edge and center values of the calibration plate; specifically, the following steps are used: the average value of all corner points is calculated and compared with the center point of the ideal calibration plate. If the average value is greater than the set threshold, the detection is invalid. The upper, lower, left and right edge values of the calibration plate are determined based on the coordinates of the corner points, and the difference is calculated with the corresponding edge of the ideal calibration plate. If the difference of any edge exceeds the set threshold, the detection is invalid.
8. A calibration plate corner point detection device, characterized in that: include: An image conversion module is used to convert the acquired RGB image into a YCbCr image according to a preset rule to obtain the brightness information of each pixel; The neighborhood selection module is used to select the coordinates of the neighborhood range. The neighborhood selection takes the coordinates of the point to be judged as the center, divides the surrounding 360-degree range into n directions, and selects k points in each direction. These points together constitute the neighborhood of the point to be judged. The first determination module is used to determine candidate corner points of the calibration plate; Determining the candidate corner points of the calibration plate specifically includes: dividing the n directions of the neighborhood around the point to be detected into four equal parts to represent four quadrants, traversing the situation where the n directions belong to four different quadrants, and calculating the brightness sum of the neighborhood points in each quadrant in each case, wherein the quadrant division of the n directions of the neighborhood around any point to be detected should meet the requirement that the two quadrants with larger brightness sum are diagonal to each other; the other two quadrants with smaller brightness sum are also diagonal to each other; obtaining the difference resp between the brightness sum of the two quadrants with the largest brightness sum and the brightness sum of the remaining two quadrants in each case, the quadrant division corresponding to the maximum difference resp is the final four quadrants of the point, and the point to be detected is the candidate corner point of the calibration plate; The second determination module is used to determine the corner points of the calibration plate; determining the corner points of the calibration plate specifically includes: detecting each candidate corner point in turn, if there is a candidate point with a larger resp value within a preset range around the candidate point, then the point is removed from the candidate points, otherwise the point is determined as the corner point of the calibration plate; The verification detection module is used to verify the effect of detecting the corner points of the calibration plate.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the calibration plate corner point detection method according to any one of claims 1 to 7 is implemented.
10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the calibration plate corner point detection method according to any one of claims 1 to 7 is implemented.
