Corner point detection method, apparatus, device, and medium

By performing brightness feature calculation and binarization on the checkerboard image, target corner points in the checkerboard image are detected, solving the problems of accuracy and comprehensiveness in corner point detection and meeting the requirements of lens and camera calibration.

CN117474828BActive Publication Date: 2026-11-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210863006.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-21
Publication Date
2026-11-27
Estimated Expiration
2042-07-21

AI Technical Summary

Technical Problem

In existing technologies, the accuracy and comprehensiveness of corner detection are insufficient, which affects the effectiveness of lens and camera calibration.

Method used

By acquiring a checkerboard image, calculating its brightness features, converting it into a binary image, and detecting target corner points based on the grayscale values ​​of the binary image, the influence of brightness features is eliminated, ensuring the accuracy and comprehensiveness of the detection.

Benefits of technology

It achieves accurate and comprehensive corner detection, capable of detecting complex corners at any location, meeting the needs of lens and camera calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117474828B_ABST
    Figure CN117474828B_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of corner point detection method, device, equipment and storage medium, first, obtain checkerboard image;Then, the luminance feature calculation is carried out to checkerboard image, and the luminance feature image corresponding to checkerboard image is obtained;Then, the luminance feature image is converted into binary image;Finally, based on the gray value of binary image, the target corner point in checkerboard image is detected.Thereby, by sequentially carrying out luminance feature calculation and binary processing to checkerboard image, the accuracy of corner point detection result can be guaranteed by excluding the influence of luminance feature on corner point detection result, and any position complex corner point can be detected, so as to meet the demand of accurate and comprehensive corner point detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to a corner detection method, apparatus, device, and medium. Background Technology

[0002] Corner points are pixels in an image that vary greatly in both the horizontal and vertical directions. Corner detection is commonly used for lens or camera calibration, and the accuracy and comprehensiveness of corner detection affect the calibration results.

[0003] Therefore, proposing an accurate corner detection method that can detect all corner points is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a corner detection method, apparatus, device, and storage medium that can accurately and comprehensively detect corners.

[0005] In a first aspect, this disclosure provides a corner detection method, the method comprising:

[0006] Obtain the chessboard image;

[0007] Brightness features are calculated on the checkerboard image to obtain the corresponding brightness feature image.

[0008] Convert the brightness feature image into a binary image;

[0009] Target corner points in a checkerboard image are detected based on the grayscale values ​​of the binarized image.

[0010] Secondly, this disclosure provides a corner detection device, the device comprising:

[0011] The image acquisition module is used to acquire the checkerboard image;

[0012] The brightness feature calculation module is used to calculate the brightness features of the checkerboard image and obtain the brightness feature image corresponding to the checkerboard image.

[0013] The binarization image acquisition module is used to convert the brightness feature image into a binarization image;

[0014] The corner detection module is used to detect target corners in a checkerboard image based on the grayscale values ​​of the binarized image.

[0015] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the above-described method.

[0016] Fourthly, this disclosure provides an apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method described above.

[0017] Fifthly, this disclosure provides a computer program product comprising a computer program / instruction that, when executed by a processor, implements the method described above.

[0018] The technical solution provided in this disclosure has at least the following advantages compared with the prior art:

[0019] This disclosure provides a corner detection method, apparatus, device, and storage medium. First, a checkerboard image is acquired. Then, brightness features are calculated on the checkerboard image to obtain a corresponding brightness feature image. Next, the brightness feature image is converted into a binarized image. Finally, target corners in the checkerboard image are detected based on the grayscale values ​​of the binarized image. Therefore, by sequentially performing brightness feature calculations and binarization on the checkerboard image, the influence of brightness features on the corner detection results can be eliminated, ensuring the accuracy of the corner detection results. Furthermore, it can detect complex corners at any location, thus meeting the requirement for accurate and comprehensive corner detection. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A schematic flowchart of a corner detection method provided in an embodiment of this disclosure;

[0023] Figure 2 A schematic flowchart of another corner detection method provided in this embodiment of the present disclosure;

[0024] Figure 3 A schematic flowchart illustrating another corner detection method provided in this embodiment of the present disclosure;

[0025] Figure 4 A schematic flowchart illustrating another corner detection method provided in this embodiment of the present disclosure;

[0026] Figure 5 A logical schematic diagram of a lens calibration process provided in an embodiment of this disclosure;

[0027] Figure 6 A logical schematic diagram of a corner detection method provided in an embodiment of this disclosure;

[0028] Figure 7 This is a schematic diagram of the structure of a corner detection device provided in an embodiment of the present disclosure;

[0029] Figure 8 This is a schematic diagram of the structure of a corner detection device provided in an embodiment of this disclosure. Detailed Implementation

[0030] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0031] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0032] Currently, many virtual reality (VR) devices can display images captured by cameras to users, who can immerse themselves in the images simply by wearing VR devices. To avoid image distortion, lens calibration is required beforehand using a checkerboard pattern. The lens calibration process needs to accurately and comprehensively detect the corner points of the checkerboard, enabling the lens calibration process to be completed based on these corner points.

[0033] To meet the above requirements, this disclosure provides a corner detection method. Figure 1 A schematic flowchart of a corner detection method provided in an embodiment of this disclosure is shown.

[0034] like Figure 1 As shown, the corner detection method may include the following steps.

[0035] S110. Obtain the chessboard image.

[0036] In practical applications, before corner detection, a camera can be used to photograph the checkerboard pattern set on the calibration board to obtain a checkerboard image.

[0037] In this embodiment of the disclosure, the checkerboard pattern on the calibration board includes alternating black and white squares.

[0038] Optionally, the checkerboard image can be an image of all the checkerboard squares on the calibration board, or an image of a portion of the checkerboard squares on the calibration board.

[0039] S120. Calculate the brightness features of the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image.

[0040] In practical applications, a preset feature detection operator can be used to calculate the brightness features of the checkerboard image, thereby obtaining the brightness feature image corresponding to the checkerboard image.

[0041] In this embodiment of the disclosure, the preset feature detection operator can use the mirror symmetry of the checkerboard pattern to calculate brightness features.

[0042] In some embodiments, a single feature detection operator can be used to calculate the brightness features of the checkerboard image based on a mirror-symmetric direction, thereby obtaining a brightness feature image.

[0043] In other embodiments, multiple feature detection operators can be used to calculate the brightness features of the checkerboard image based on multiple mirror symmetry directions, and then the brightness feature calculation results can be fused to obtain a brightness feature image.

[0044] In this embodiment of the disclosure, the brightness feature image includes the brightness values ​​of each checkerboard square on the calibration board.

[0045] S130. Convert the brightness feature image into a binary image.

[0046] In practical applications, in order to eliminate the influence of factors such as ambient brightness on the corner detection effect, a binarization threshold corresponding to the brightness image can be obtained, and the brightness feature image can be binarized using the binarization threshold to obtain a binarized image.

[0047] In this embodiment of the disclosure, the binarization threshold can be the maximum brightness value. Specifically, the binarization threshold can be determined using algorithms such as the Otsu algorithm or iterative methods.

[0048] Specifically, brightness values ​​in the brightness feature image that are less than or equal to the binarization threshold can be set as one brightness value, and brightness values ​​in the brightness feature image that are greater than the binarization threshold can be set as another brightness value.

[0049] In this embodiment of the disclosure, the binarized image includes two grayscale values: 0 and 255. 0 corresponds to black, and 255 corresponds to white.

[0050] Therefore, by converting the brightness feature image into a binary image, a black and white checkerboard image can be obtained, which can eliminate the interference of environmental brightness and other factors on the corner detection process.

[0051] S140. Detect target corner points in a checkerboard image based on the grayscale values ​​of the binarized image.

[0052] In practical applications, the gray values ​​of each pixel in the binarized image are extracted, and the vertices of the checkerboard with significant gray value changes are extracted from the checkerboard image based on the gray values ​​as target corner points.

[0053] It is understandable that a large number of checkerboard vertices may be detected in the edge regions or outside the checkerboard area of ​​the binarized image. Therefore, the checkerboard vertices in the edge regions or outside the checkerboard area can be erased by erasing to eliminate the false responses of corner points.

[0054] This disclosure provides a corner detection method. First, a checkerboard image is acquired. Then, brightness features are calculated on the checkerboard image to obtain a corresponding brightness feature image. Next, the brightness feature image is converted into a binarized image. Finally, target corners in the checkerboard image are detected based on the grayscale values ​​of the binarized image. Therefore, by sequentially performing brightness feature calculations and binarization on the checkerboard image, the influence of brightness features on the corner detection results can be eliminated, ensuring the accuracy of the corner detection results. Furthermore, it can detect complex corners at any location, thus meeting the requirement for accurate and comprehensive corner detection.

[0055] Furthermore, after detecting the target corner points, these corner points can be used for camera calibration. Specifically, the camera's distortion parameters can be calculated directly based on the coordinates of the target corner points, thereby completing the camera calibration.

[0056] In other cases, when lens calibration is required for VR devices, the checkerboard image is affected by both camera distortion and lens distortion in VR because it is first captured by a camera and then displayed through a lens in VR. Therefore, after detecting the target corner points, camera distortion correction can be performed first to remove its influence, and then the distortion parameters of the lens in VR can be calculated to complete the lens calibration in VR.

[0057] In another embodiment of this disclosure, brightness features can be calculated based on the symmetry direction of the checkerboard image, and binarization processing can be performed using the binarization threshold corresponding to the brightness feature image.

[0058] Figure 2 A flowchart illustrating another corner detection method provided in an embodiment of this disclosure is shown.

[0059] like Figure 2 As shown, the corner detection method may include the following steps.

[0060] S210. Obtain the chessboard image.

[0061] S210 is similar to S110, and will not be described in detail here.

[0062] S220. Based on the symmetry direction of the checkerboard image, perform brightness feature calculation on the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image.

[0063] In practical applications, since a checkerboard image can have a mirror-symmetric feature in a certain direction, the checkerboard direction can be obtained. The feature detection operator is not sensitive to low-frequency global brightness changes. After calculating the brightness features based on the checkerboard direction using the corresponding feature detection operator, the resulting brightness feature image is less affected by low-frequency global brightness interference, thus avoiding the impact of low-frequency global brightness on the accuracy of the brightness feature image.

[0064] Optionally, the symmetry direction of the chessboard grid can include a horizontal mirror symmetry direction, a vertical mirror symmetry direction, and an inclined mirror symmetry direction.

[0065] Therefore, in this embodiment of the disclosure, the brightness feature of the checkerboard image can be calculated by utilizing the mirror-symmetric feature of the checkerboard image in a certain direction. This can ensure the accuracy of the feature calculation and also effectively eliminate the interference of low-frequency global brightness.

[0066] S230, In response to detecting the first region selection operation, determine the region of interest of the chessboard image.

[0067] In practical applications, if a user wants to perform corner detection on a portion of a checkerboard image, the user can select the area where corners may exist. The electronic device can then detect the first region selection operation and, in response to the first region selection operation, determine the region of interest in the checkerboard image.

[0068] In this embodiment of the disclosure, the first region selection operation is a user operation used to trigger the selection of a region of interest.

[0069] Optionally, the first area selection operation can be a mouse selection operation, a click operation, or a key operation, etc.

[0070] In this embodiment of the disclosure, the region of interest is a portion of the image used for detecting corner points.

[0071] S240. Calculate the brightness features of the region of interest to obtain the brightness feature image corresponding to the checkerboard image.

[0072] In practical applications, brightness features can be calculated for the region of interest based on the symmetry direction of the checkerboard pattern in the checkerboard image to obtain the brightness feature image corresponding to the checkerboard pattern.

[0073] Understandably, to eliminate the impact of environmental noise on corner detection accuracy, a pre-defined denoising algorithm can be used to denoise the region of interest (ROI), resulting in a denoised ROI. Furthermore, brightness feature calculations are performed on the denoised ROI to obtain the brightness feature image corresponding to the checkerboard pattern image.

[0074] Optionally, the preset denoising algorithm may include, but is not limited to, Gaussian denoising algorithm.

[0075] Therefore, in this embodiment of the disclosure, the brightness feature calculation of the region of interest of the checkerboard image can be performed through human-computer interaction, which can adapt to the situation where multiple distortions are coupled together, thus ensuring the accuracy of the brightness feature image calculation.

[0076] S250. Determine the binarization threshold corresponding to the brightness feature image.

[0077] Optionally, in this embodiment, S250 may specifically include the following steps:

[0078] S2501. Obtain the filter kernel size of the brightness feature image;

[0079] S2502. Perform maximum value filtering on the brightness feature image based on the filter kernel size;

[0080] S2503. Calculate the binarization threshold of the brightness feature image based on the brightness feature image after maximum value filtering and the preset ratio.

[0081] The filter kernel size can be determined based on the size of the brightness feature image and the number of checkerboard vertices. Optionally, the size of the brightness feature image can be the size of the entire brightness feature image or the size of the region of interest within the brightness feature image.

[0082] Optionally, if the filter kernel size is determined based on the size of the region of interest in the brightness feature image, the size of the brightness feature image, and the number of checkerboard vertices, then the filter kernel size can be expressed as:

[0083] ker size ∈(1.5*ROI size / num, 3*ROI size / num)

[0084] Among them, ker size It is the filter kernel size, ROI size is the size of the region of interest in the brightness feature image, num is the number of checkerboard vertices, and 1.5 and 3 are parameters.

[0085] Specifically, the binarization threshold of the brightness feature image can be the product of the brightness feature image after maximum value filtering and a preset ratio.

[0086] Understandably, in the maximum value filtering process, considering distortion, in order to ensure the maximum spacing of the checkerboard, a threshold can be set in the corner area. The brightness values ​​of non-corner areas can be compared with those of the neighboring corner areas, so that multiple corners do not use the same threshold. Therefore, the maximum value filtering process has good locality.

[0087] The preset ratio can be any value less than 1.

[0088] S260. The brightness feature image is binarized based on the binarization threshold to obtain a binarized image.

[0089] In practical applications, gray values ​​in the brightness feature image that are less than or equal to the binarization threshold can be set to 0, and gray values ​​in the brightness feature image that are greater than the binarization threshold can be set to 255, thus obtaining a binarized image.

[0090] Therefore, by determining a suitable binarization threshold based on the size of the brightness feature image itself and the number of checkerboard vertices, and performing binarization processing based on the binarization threshold, a binarized image corresponding to the brightness feature image can be obtained.

[0091] S270. Detect target corner points in a checkerboard image based on the grayscale values ​​of the binarized image.

[0092] It should be noted that there may be areas that are missed or falsely detected in the binarized image. In such cases, the manually selected area can be determined. Based on the gray values ​​of the checkerboard grid within the manually selected area, the checkerboard grid vertices with significant gray value changes are detected again until there are no more areas that are missed or falsely detected, thus obtaining the target corner points that are re-detected in the checkerboard grid image.

[0093] Accordingly, after executing S270, the method also includes:

[0094] In response to the detection of a second region selection operation, a special point processing region is determined in the brightness feature image;

[0095] The special point processing area is re-binarized to obtain a new binary image;

[0096] Based on the grayscale values ​​of the new binarized image, target corner points in the checkerboard image are re-detected.

[0097] The second region selection operation is a user operation used to trigger the selection of a special point processing region.

[0098] Optionally, the second area selection operation can be a mouse selection operation, a click operation, or a key operation, etc.

[0099] The special point processing area refers to the area that may be missed or falsely detected.

[0100] Specifically, a binarization threshold corresponding to the special point processing region can be determined, and the special point processing region can be binarized based on the binarization threshold to obtain a binarized image corresponding to the special point processing region. Then, the special point processing region can be binarized again based on the binarization threshold corresponding to the special point processing region to obtain a new binarized image.

[0101] Furthermore, after processing the areas that were missed or falsely detected, a new binarized image can be obtained, and the target corner points in the checkerboard image can be detected again based on the gray values ​​of the new binarized image.

[0102] Therefore, in this embodiment of the disclosure, by performing special point region processing, areas that are missed or falsely detected can be eliminated, thereby improving the accuracy of the binarized image.

[0103] Furthermore, even after eliminating areas with missed or false detections, a large number of corner points may still be falsely detected in areas outside the image edges or checkerboard pattern. Therefore, false response deletion processing is still required to further improve the accuracy of the binarized image.

[0104] In another embodiment of this disclosure, the center point and its adjacent points are extracted based on the gray values ​​of the binarized image to obtain the target corner point, and camera distortion correction and lens distortion correction are further performed based on the coordinates of the target corner point.

[0105] Figure 3 A schematic flowchart of another corner detection method provided in an embodiment of this disclosure is shown.

[0106] like Figure 3 As shown, the corner detection method may include the following steps.

[0107] S310. Obtain the chessboard image.

[0108] S320. Calculate the brightness features of the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image.

[0109] S330: Convert the brightness feature image into a binary image.

[0110] The specific implementation methods of S310 to S330 are similar to those in the aforementioned embodiments, and will be repeated here.

[0111] S340. Based on the grayscale values ​​of the binarized image, extract the center point and its adjacent points from the binarized image.

[0112] In practical applications, based on the grayscale values ​​of a binarized image, the coordinates of sub-pixels can be extracted from the binarized image, and the coordinates of the center point and its neighboring points can be extracted from the coordinates of the sub-pixels. Here, a sub-pixel is the smallest unit of measurement on the imaging surface of an area array camera.

[0113] In this embodiment of the disclosure, the center point refers to the center pixel of the binarized image.

[0114] In this embodiment of the disclosure, the adjacent points of the center point can be pixels within the neighborhood of the center point.

[0115] Optionally, in this embodiment, S340 may specifically include the following steps:

[0116] S3401. Based on the grayscale values ​​of the checkerboard pattern, perform connected component extraction on the binarized image to obtain the connected components of the binarized image.

[0117] S3402. The coordinates of the vertices of the chessboard grid in each connected domain are summed by weight to obtain the coordinates of the centroid of the connected domain.

[0118] S3403. Extract the center point from the binarized image based on the centroid coordinates of each connected component.

[0119] S3404. In the binarized image, the adjacent points of the center point of the binarized image are extracted to obtain the adjacent points of the center point.

[0120] For S3401, a region growing algorithm is used to extract connected components from the binarized image based on the grayscale values ​​of the checkerboard grid. The connected components of the binarized image include checkerboard grids with similar grayscale values.

[0121] For S3402, determine all chessboard squares in each connected component and the weight corresponding to each chessboard square, and perform a weighted summation of the vertex coordinates of the chessboard squares in each connected component, and use the weighted summation result as the centroid coordinates of each connected component.

[0122] For S3403, after obtaining the centroid coordinates of each connected component, the centroid coordinates of each connected component can be weighted and summed to obtain the coordinates of the center point of the binarized image, thereby determining the center point.

[0123] For S3404, firstly, the adjacent points of the center point can be found within the four-neighbor range of the center point. Then, the found adjacent points are used as the new center point, and new adjacent points are found within the four-neighbor range of the new center point. The above process is repeated iteratively until all the adjacent points of the center point are found.

[0124] In other embodiments, after obtaining the centroid coordinates of the connected components in S3402, the center point and adjacent points of the binarized image can be determined through human-computer interaction. Accordingly, the method further includes: extracting the center point from the binarized image in response to obtaining the center point selection operation near each connected component; and extracting the adjacent points of the center point from the binarized image in response to obtaining the adjacent point selection operation.

[0125] S350. Use the center point of the binarized image and its adjacent points as the target corner points in the checkerboard image.

[0126] In practical applications, the center point extracted from the binarized image and its adjacent points can be used together as the target corner point in the checkerboard image. This target corner point can be used to calibrate the distortion parameters.

[0127] Therefore, in this embodiment of the disclosure, the center point and its adjacent points can be extracted based on the grayscale value of the checkerboard pattern through an iterative method. This method is also applicable to incomplete checkerboard images, thus improving the comprehensiveness and accuracy of corner detection for incomplete checkerboard images.

[0128] In another embodiment of this disclosure, the target corner points can be used for subsequent camera distortion correction and lens calibration. Camera distortion correction refers to removing the influence of camera distortion parameters, and lens calibration refers to calculating the lens distortion parameters. In this embodiment, the checkerboard image can be captured by a camera of the target checkerboard and displayed through the lens of the target device; therefore, camera distortion correction and lens calibration need to be performed sequentially using the target corner points. The target device can be a VR device.

[0129] Figure 4 A schematic flowchart of another corner detection method provided in an embodiment of this disclosure is shown.

[0130] like Figure 4 As shown, the corner detection method may include the following steps.

[0131] S410, Obtain the chessboard image.

[0132] S420. Calculate the brightness features of the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image.

[0133] S430: Convert the brightness feature image into a binary image.

[0134] S440. Detect target corner points in a checkerboard image based on the grayscale values ​​of the binarized image.

[0135] The specific implementation of S410 to S440 is similar to that of the aforementioned embodiments, and will be repeated here.

[0136] S450. Based on the camera's distortion parameters, the coordinates of the target corner point are corrected for camera distortion, and the coordinates of the target corner point after camera distortion correction are obtained.

[0137] It is understandable that a checkerboard image can be captured by a camera and displayed through the lens of the target device. Therefore, the target corner points in the checkerboard image are affected not only by the lens distortion of the target device but also by the distortion of the camera. Therefore, camera distortion correction is necessary; that is, the influence of camera distortion must be removed before lens calibration.

[0138] Optionally, in this embodiment, S450 may specifically include the following steps:

[0139] S4501. Based on the original coordinates of each corner point on the target chessboard, sort the target corner points to obtain the sorted target corner points.

[0140] S4502. If the sorted target corner points pass the verification, the coordinates of the target corner points are corrected for camera distortion based on the camera distortion parameters to obtain the coordinates of the target corner points after camera distortion correction.

[0141] For S4501, since the target corner points detected based on the checkerboard image are relatively disordered, they cannot be directly used for subsequent distortion correction. Therefore, it is necessary to match the target corner points with the target corner points detected from the target checkerboard image one by one based on the original coordinates of each corner point on the target checkerboard, so that the target corner points are sorted to obtain sorted target corner points.

[0142] For S4502, after sorting the target corner points, the target corner points in each row can be marked with the same color, and the target corner points in the same column can be connected together with lines. The target corner points in all rows and columns can be displayed, allowing users to judge whether the target corner point sorting is correct based on the color and the connection lines. If it is correct, the sorted target corner points are determined to have passed the verification, and the camera distortion correction operation is further performed.

[0143] Specifically, based on the camera's distortion parameters, the coordinates of the target corner point can be converted into coordinates after removing the camera's distortion parameters, thereby achieving camera distortion correction of the target corner point's coordinates and obtaining the target corner point's coordinates after camera distortion correction.

[0144] The camera's distortion parameters can be parameters that affect camera distortion. Optionally, the camera's distortion parameters can include the camera's intrinsic and extrinsic parameters.

[0145] Therefore, in this embodiment of the present disclosure, before performing lens distortion correction, camera distortion correction can be performed based on the camera's distortion parameters, so that camera distortion is removed while only the distortion caused by the lens is retained.

[0146] S460: Based on the coordinates of the target corner point after camera distortion correction, calculate the lens distortion parameters.

[0147] Optionally, in this embodiment of the disclosure, S460 may specifically include the following steps:

[0148] The coordinates of the target corner point after camera distortion correction are input into the pre-fitted lens distortion model to obtain the lens distortion parameters.

[0149] The pre-fitted lens distortion model can be trained based on the distortion coordinates of each corner point and the coordinates of the corner points after camera distortion correction.

[0150] It should be noted that in other cases, if only the effects of camera distortion need to be removed, the camera calibration process can be completed after executing S450, and there is no need to execute S460 again.

[0151] Therefore, in this embodiment of the present disclosure, after removing the influence of camera distortion, the distortion parameters of the lens are calculated based on the coordinates of the target corner point after camera distortion correction, the coordinates of the target corner point, and the pre-fitted lens distortion model, thereby achieving lens calibration.

[0152] In another embodiment of this disclosure, the lens calibration process and the corner detection process are explained in their entirety.

[0153] Figure 5 A logical schematic diagram of a lens calibration process provided in an embodiment of this disclosure is shown.

[0154] like Figure 5 As shown, firstly, a checkerboard image is acquired, and corner detection is performed on the checkerboard image to obtain the target corners in the checkerboard image. The target corners can be used for camera distortion correction and / or lens distortion correction, or the process can end after corner detection is completed. Then, the target corners are sorted to obtain sorted target corners. Next, the sorted target corners are verified. If the sorted target corners pass the verification, they can be stored. Corner mapping is performed on the stored sorted corners, or the sorted corners are directly mapped, thereby realizing camera distortion correction on the coordinates of the target corners to obtain the coordinates of the target corners after camera distortion correction. Finally, based on the coordinates of the target corners after camera distortion correction and the target corner coordinates, the lens distortion parameters are calculated, thereby completing the lens calibration process.

[0155] Figure 6 A logical schematic diagram of a corner detection method provided in an embodiment of this disclosure is shown.

[0156] like Figure 6 As shown, firstly, a region of interest (ROI) is selected from the checkerboard image; then, brightness features are calculated for the ROI to obtain a brightness feature image. Specifically, Gaussian denoising can be performed on the ROI first, and then brightness features are calculated based on the checkerboard symmetry direction to obtain the corresponding brightness feature image; next, initial binarization processing is performed on the brightness feature image to convert it into a binary image. Specifically, the filter kernel size of the brightness feature image can be obtained, and maximum value filtering can be performed on the brightness feature image based on the filter kernel size. A binarization threshold for the brightness feature image is calculated based on the maximum value filtered brightness feature image and a preset ratio. Binarization processing is then performed on the brightness feature image based on the binarization threshold to obtain the binary image; finally, special point processing and... The process of deleting false responses involves several steps. Specifically, special point processing can involve selecting a special point processing area and re-binarizing that area to obtain a new binarized image. This process can involve identifying a manually selected area, and based on the grayscale values ​​of the checkerboard grid within that area, continuing to detect checkerboard vertices with significant grayscale value changes until no missed or false detections are found, thus ending the false response deletion process. Next, sub-pixel level coordinates are extracted. Specifically, the vertex coordinates of the sub-pixel checkerboard grid in the connected components of the binarized image are extracted, and the centroid coordinates of each connected component are calculated based on these vertex coordinates. The center point and its adjacent points are then extracted from the binarized image as target corner points in the checkerboard image. This can be achieved through bounding box selection or automatic extraction of the center point or adjacent points.

[0157] Based on the same inventive concept as the above-described method embodiments, this disclosure also provides a corner detection device, with reference to... Figure 7 This is a schematic diagram of the structure of a corner detection device 700 provided in an embodiment of this disclosure. The device includes:

[0158] The image acquisition module 701 is used to acquire a checkerboard image;

[0159] The brightness feature calculation module 702 is used to calculate the brightness features of the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image.

[0160] Binarized image acquisition module 703 is used to convert a brightness feature image into a binary image;

[0161] The corner detection module 704 is used to detect target corners in a checkerboard image based on the grayscale values ​​of the binarized image.

[0162] This disclosure provides a corner detection device. First, a checkerboard image is acquired. Then, brightness features are calculated on the checkerboard image to obtain a brightness feature image corresponding to the checkerboard image. Next, the brightness feature image is converted into a binary image. Finally, target corners in the checkerboard image are detected based on the grayscale values ​​of the binary image. Therefore, by sequentially performing brightness feature calculations and binarization on the checkerboard image, the influence of brightness features on the corner detection results can be eliminated, ensuring the accuracy of the corner detection results. Furthermore, it can detect complex corners at any location, thus meeting the requirement for accurate and comprehensive corner detection.

[0163] In one optional implementation, the brightness feature calculation module 702 is specifically used to calculate the brightness features of the checkerboard image based on the checkerboard symmetry direction of the checkerboard image, so as to obtain the brightness feature image corresponding to the checkerboard image.

[0164] In one optional embodiment, the device further includes:

[0165] The region of interest determination module is used to determine the region of interest of the chessboard image in response to the detection of the first region selection operation;

[0166] Correspondingly, the brightness feature calculation module 702 is specifically used to calculate the brightness features of the region of interest to obtain the brightness feature image corresponding to the checkerboard image.

[0167] In one optional implementation, the binarized image acquisition module 703 includes:

[0168] The binarization threshold determination unit is used to determine the binarization threshold corresponding to the brightness feature image;

[0169] The binarization image determination unit is used to perform binarization processing on the brightness feature image based on the binarization threshold to obtain a binarized image.

[0170] In one optional implementation, the binarization threshold determination unit is specifically used to obtain the filter kernel size of the brightness feature image;

[0171] Maximum value filtering is performed on the brightness feature image based on the filter kernel size;

[0172] The binarization threshold of the brightness feature image is calculated based on the brightness feature image after maximum value filtering and the preset ratio.

[0173] In one optional implementation, the corner detection module 704 includes:

[0174] The extraction unit is used to extract the center point and its adjacent points from the binarized image based on the gray values ​​of the binarized image.

[0175] The target corner point determination unit is used to determine the center point of the binarized image and its adjacent points as the target corner points in the checkerboard image.

[0176] In one optional implementation, the extraction unit is specifically used to perform connected component extraction on the binarized image based on the grayscale values ​​of the checkerboard pattern, so as to obtain the connected components of the binarized image.

[0177] The coordinates of the centroids of the connected components are obtained by weighted summation of the vertex coordinates of the chessboard grid in each connected component.

[0178] Extract the center point from the binarized image based on the centroid coordinates of each connected component;

[0179] In a binarized image, the neighboring points of the center point are extracted to obtain the neighboring points of the center point.

[0180] In one optional embodiment, the device further includes:

[0181] The special point processing region determination module is used to determine the special point processing region in the brightness feature image in response to the detection of the second region selection operation;

[0182] The re-binarization module is used to re-binarize the special point processing areas to obtain a new binary image;

[0183] Based on the grayscale values ​​of the new binarized image, target corner points in the checkerboard image are re-detected.

[0184] In one alternative implementation, the chessboard image is captured by a camera onto the target chessboard and displayed through the lens of the target display device;

[0185] Accordingly, the device also includes:

[0186] The camera distortion correction module is used to correct the coordinates of the target corner point based on the camera's distortion parameters, and obtain the coordinates of the target corner point after camera distortion correction.

[0187] The lens distortion parameter calculation module is used to calculate the lens distortion parameters based on the coordinates of the target corner point after camera distortion correction.

[0188] In one optional implementation, the camera distortion correction module includes:

[0189] The sorting unit is used to sort the target corner points based on their original coordinates on the target chessboard grid, and obtain the sorted target corner points.

[0190] The camera distortion correction unit is used to correct the coordinates of the target corner points based on the camera's distortion parameters, after the sorted target corner points have passed the verification, so as to obtain the coordinates of the target corner points after camera distortion correction.

[0191] In one optional implementation, the lens distortion parameter calculation module is specifically used to input the coordinates of the target corner point after camera distortion correction and the coordinates of the target corner point into a pre-fitted lens distortion model to obtain the lens distortion parameters.

[0192] In addition to the methods and apparatus described above, this disclosure also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the corner detection method of this disclosure.

[0193] This disclosure also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the corner detection method of this disclosure.

[0194] In addition, this disclosure also provides a corner detection device, see [link to relevant documentation]. Figure 8 As shown, it may include:

[0195] The corner detection device includes a processor 801, a memory 802, an input device 803, and an output device 804. The number of processors 801 in the corner detection device can be one or more. Figure 8 Taking a processor as an example. In some embodiments of this disclosure, the processor 801, memory 802, input device 803, and output device 804 can be connected via a bus or other means, wherein, Figure 8 Taking the example of a connection between China and Israel via a bus.

[0196] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing of the corner detection device by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 803 can be used to receive input digital or character information, and to generate signal inputs related to user settings and function control of the corner detection device.

[0197] Specifically in this embodiment, the processor 801 will load the executable files corresponding to the processes of one or more applications into the memory 802 according to the following instructions, and the processor 801 will run the applications stored in the memory 802 to realize the various functions of the corner detection device.

[0198] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0199] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A corner detection method, characterized in that, The method includes: Obtain the chessboard image; Brightness features are calculated on the chessboard image to obtain a brightness feature image corresponding to the chessboard image; The brightness feature image is converted into a binary image; Based on the grayscale values ​​of the binarized image, target corner points in the checkerboard image are detected; wherein, the detection of target corner points in the checkerboard image based on the grayscale values ​​of the binarized image includes: extracting a center point and adjacent points of the center point from the binarized image based on the grayscale values ​​of the binarized image; and using the center point and adjacent points of the center point of the binarized image as target corner points in the checkerboard image.

2. The method according to claim 1, characterized in that, The step of calculating the brightness features of the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image includes: Based on the symmetry direction of the chessboard image, the brightness features of the chessboard image are calculated to obtain the brightness feature image corresponding to the chessboard image.

3. The method according to claim 1, characterized in that, Before performing brightness feature calculation on the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image, the method further includes: In response to the detection of a first region selection operation, the region of interest of the chessboard image is determined; Accordingly, the step of performing brightness feature calculation on the checkerboard image to obtain the brightness feature image corresponding to the checkerboard image includes: Brightness features are calculated on the region of interest to obtain the brightness feature image corresponding to the checkerboard image.

4. The method according to claim 1, characterized in that, The step of converting the brightness feature image into a binary image includes: Determine the binarization threshold corresponding to the brightness feature image; The brightness feature image is binarized based on the binarization threshold to obtain the binarized image.

5. The method according to claim 4, characterized in that, Determining the binarization threshold corresponding to the brightness feature image includes: Obtain the filter kernel size of the brightness feature image; The brightness feature image is subjected to maximum value filtering based on the filter kernel size; The binarization threshold of the brightness feature image is calculated based on the brightness feature image after maximum value filtering and a preset ratio.

6. The method according to claim 1, characterized in that, The step of extracting the center point and its adjacent points from the binarized image based on the grayscale values ​​of the binarized image includes: Based on the grayscale values ​​of the chessboard grid, a connected component extraction operation is performed on the binarized image to obtain the connected components of the binarized image. The coordinates of the centroid of each connected component are obtained by weighted summation of the vertex coordinates of the chessboard grid in each connected component. Based on the centroid coordinates of each of the connected components, the center point is extracted from the binarized image; In the binarized image, the neighboring points of the center point are extracted to obtain the neighboring points of the center point.

7. The method according to claim 1, characterized in that, After detecting the target corner points in the checkerboard image based on the grayscale values ​​of the binarized image, the method further includes: In response to the detection of a second region selection operation, a special point processing region is determined in the brightness feature image; The special point processing area is re-binarized to obtain a new binary image; Based on the grayscale values ​​of the new binarized image, the target corner points in the checkerboard image are re-detected.

8. The method according to claim 1, characterized in that, The chessboard image is captured by a camera and displayed through the lens of the target display device; Accordingly, the method further includes: Based on the camera's distortion parameters, the coordinates of the target corner point are corrected for camera distortion to obtain the coordinates of the target corner point after camera distortion correction. The distortion parameters of the lens are calculated based on the coordinates of the target corner point after camera distortion correction and the coordinates of the target corner point.

9. The method according to claim 8, characterized in that, The step of correcting the coordinates of the target corner point based on the camera's distortion parameters to obtain the corrected coordinates of the target corner point includes: Based on the original coordinates of each corner point on the target chessboard, the target corner points are sorted to obtain the sorted target corner points; If the sorted target corner points pass the verification, the coordinates of the target corner points are corrected for camera distortion based on the camera's distortion parameters to obtain the coordinates of the target corner points after camera distortion correction.

10. The method according to claim 8, characterized in that, The calculation of the lens distortion parameters based on the coordinates of the target corner point after camera distortion correction and the coordinates of the target corner point includes: The coordinates of the target corner point after camera distortion correction and the coordinates of the target corner point are input into a pre-fitted lens distortion model to obtain the lens distortion parameters.

11. A corner detection device, characterized in that, The device includes: The image acquisition module is used to acquire the checkerboard image; A brightness feature calculation module is used to perform brightness feature calculation on the chessboard image to obtain a brightness feature image corresponding to the chessboard image. The binarization image acquisition module is used to convert the brightness feature image into a binarization image; A corner detection module is used to detect target corners in a checkerboard image based on the grayscale values ​​of the binarized image; wherein, the corner detection module includes: an extraction unit, used to extract a center point and adjacent points of the center point from the binarized image based on the grayscale values ​​of the binarized image; and a target corner determination unit, used to determine the center point of the binarized image and adjacent points of the center point as target corners in the checkerboard image.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method as described in any one of claims 1-10.

13. A device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1-10.

14. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Chessboard corner capturing method, device and system and readable storage medium

    CN110264531A