A camera calibration pre-image detection method, device and medium

By detecting the integrity, planar position, and rotational position of the checkerboard calibration board image, the accuracy of its position is ensured, solving the accuracy problem existing in the prior art, ensuring the accuracy of the checkerboard calibration board image detection method, ensuring the accuracy of the checkerboard calibration board image, and improving the accuracy of camera calibration.

CN116228683BActive Publication Date: 2026-01-06KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310071531.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-30
Publication Date
2026-01-06
Estimated Expiration
2043-01-30

AI Technical Summary

Technical Problem

In the current camera calibration process, the incorrect position of the checkerboard calibration board image leads to inaccurate calibration. There is an urgent need for a method to detect the position of the checkerboard calibration board image.

Method used

By acquiring the chessboard image to be calibrated, identifying the number, color, and rotation angle of the chessboard squares, and checking their correspondence with the background image, the integrity, planar position, and rotation position of the chessboard calibration board image are ensured.

Benefits of technology

It improves the accuracy of camera calibration, avoids inaccurate calibration due to positional errors, and enables overall positional detection of the checkerboard calibration board image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116228683B_ABST
    Figure CN116228683B_ABST
Patent Text Reader

Abstract

The application discloses a camera calibration front image detection method and device and medium, wherein the method comprises: obtaining a to-be-calibrated checkerboard image; identifying the number of checkerboards of a target color checkerboard in the to-be-calibrated checkerboard image to detect whether the number of checkerboards is consistent with the actual number of checkerboards of the target color checkerboard in a checkerboard background image; and identifying the color of a target position checkerboard in the to-be-calibrated checkerboard image to detect whether the color of the target position checkerboard is consistent with the actual color of the target position checkerboard in the checkerboard background image. The application can detect the position of an image before camera calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of camera calibration technology, and in particular to a method, apparatus, and medium for image detection before camera calibration. Background Technology

[0002] Camera calibration refers to the process of solving the parameters of the camera's imaging geometric model, which is used to determine the relationship between the three-dimensional geometric position of a point on the surface of a spatial object and its corresponding point in the image.

[0003] Currently, camera calibration is mainly performed using calibration boards. Commonly used calibration boards include checkerboard calibration boards, circular marker calibration boards, QR code calibration boards, and coded marker calibration boards. When using a checkerboard calibration board for camera calibration, images of the checkerboard calibration board at different positions are captured by the camera, and then the calibration is performed directly using these images. However, if the corresponding positions in the checkerboard calibration board images are incorrect, it can easily affect the accuracy of the camera calibration. Therefore, there is an urgent need for a method to perform position detection on the checkerboard calibration board images before calibration. Summary of the Invention

[0004] Embodiments of this application provide a method, apparatus, medium, and electronic device for image detection before camera calibration, capable of performing position detection on a checkerboard calibration board image before camera calibration.

[0005] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0006] According to a first aspect of the embodiments of this application, an image detection method before camera calibration is provided, comprising the following steps:

[0007] A chessboard pattern to be calibrated is obtained by capturing a chessboard background image with the camera. The chessboard background image includes a reference background image and at least one rotated background image that is rotated by a preset angle relative to the reference background image. The chessboard pattern to be calibrated includes a reference chessboard pattern corresponding to the reference background image and a rotated chessboard pattern corresponding to the rotated background image.

[0008] Identify the number of chessboard squares of the target color in the chessboard square image to be calibrated, and detect whether the number of chessboard squares is consistent with the actual number of chessboard squares of the target color in the background image of the chessboard square;

[0009] Identify the color of the chessboard square at the target position in the chessboard grid image to be calibrated, and detect whether the color of the chessboard square is consistent with the actual color of the chessboard square at the target position in the background image of the chessboard grid;

[0010] identify a rotation angle of the rotated checkerboard image relative to the reference checkerboard image to detect whether the rotation angle is consistent with the preset angle.

[0011] In some embodiments of the present application, based on the foregoing scheme, the method further comprises:

[0012] obtaining an original checkerboard image obtained by the camera shooting a checkerboard background image;

[0013] segmenting the original checkerboard image into the reference checkerboard image or the rotated checkerboard image to obtain the to-be-calibrated checkerboard image.

[0014] In some embodiments of the present application, based on the foregoing scheme, the identification of the number of checkerboards of the target color in the to-be-calibrated checkerboard image comprises:

[0015] determining a pixel value interval matching the target color;

[0016] determining, in the to-be-calibrated checkerboard image, a checkerboard in which the pixel value falls into the pixel value interval as a target checkerboard;

[0017] counting the target checkerboard to obtain the number of checkerboards of the target color in the to-be-calibrated checkerboard image.

[0018] In some embodiments of the present application, based on the foregoing scheme, the determination of the checkerboard in which the pixel value falls into the pixel value interval in the to-be-calibrated checkerboard image comprises

[0019] determining, in the to-be-calibrated checkerboard image, a plurality of checkerboard regions in which the pixel value falls into the pixel value interval;

[0020] performing matrix erosion on each of the checkerboard regions to obtain a checkerboard in which the pixel value falls into the pixel value interval.

[0021] In some embodiments of the present application, based on the foregoing scheme, the identification of the checkerboard color of the target position checkerboard in the to-be-calibrated checkerboard image comprises:

[0022] determining a target checkerboard region in the target position in the to-be-calibrated checkerboard image and determining pixel values of each pixel unit in the target checkerboard region;

[0023] counting the number of pixel units falling into different pixel value intervals;

[0024] identifying the checkerboard color of the target position checkerboard in the to-be-calibrated checkerboard image according to the proportional relationship between the number of pixel units falling into different pixel value intervals;

[0025] In some embodiments of this application, based on the foregoing scheme, determining the target chessboard area at the target location in the chessboard to be calibrated includes:

[0026] In the chessboard grid diagram to be calibrated, the corner points of each chessboard grid are determined, and the corner points are the mass points at each corner of the chessboard grid.

[0027] Determine the corner point defined by the target location as the first corner point, and calculate the three corner points closest to the first corner point to obtain the second corner point;

[0028] The target chessboard area is obtained by defining the chessboard area bounded by the first corner point and the second corner point.

[0029] In some embodiments of this application, based on the foregoing scheme, identifying the rotation angle of the rotated chessboard pattern relative to the reference chessboard pattern includes:

[0030] Obtain the field of view of the camera;

[0031] Calculate the side lengths of the baseline chessboard and the rotated chessboard.

[0032] The rotation angle is calculated based on the camera's field of view, the side length of the reference chessboard, and the side length of the rotating chessboard.

[0033] In some embodiments of this application, based on the foregoing scheme, the rotation angle is calculated using the following formula:

[0034]

[0035] Wherein, Angle is the rotation angle, H and W are the side lengths of the base chessboard pattern, L1 and L2 are the side lengths of the rotating chessboard pattern, C is the camera's field of view, H corresponds to the side length of the base chessboard pattern being parallel to the rotation axis when the rotating chessboard pattern rotates by a preset angle, W corresponds to the side length of the base chessboard pattern being perpendicular to the rotation axis when the rotating chessboard pattern rotates by a preset angle, and L1 and L2 correspond to the side lengths of the rotating chessboard pattern being parallel to the side length of the base chessboard pattern corresponding to H.

[0036] In some embodiments of this application, the integrity of the chessboard calibration board image is detected by acquiring a chessboard image to be calibrated, then identifying the number of chessboard squares of the target color in the chessboard image to be calibrated, and detecting whether the number of chessboard squares is consistent with the actual number of chessboard squares of the target color in the chessboard background image; then, the color of the chessboard square at the target position in the chessboard image to be calibrated is identified, and detecting whether the color of the chessboard square is consistent with the actual color of the chessboard square at the target position in the chessboard background image, thereby detecting the planar position of the chessboard calibration board image.

[0037] The rotation angle of the rotating chessboard pattern relative to the reference chessboard pattern is identified to detect whether the rotation angle is consistent with the preset angle, thereby detecting the rotation position of the chessboard calibration board image. In summary, the integrity, planar position, and rotation position of the chessboard calibration board image are detected to achieve the detection of the overall position of the chessboard calibration board image.

[0038] According to a second aspect of the embodiments of this application, a camera calibration pre-image detection apparatus is provided, the apparatus comprising:

[0039] The acquisition unit acquires a chessboard pattern to be calibrated. The chessboard pattern to be calibrated is obtained by capturing a chessboard background image with the camera. The chessboard background image includes a reference background image and at least one rotated background image that is rotated by a preset angle relative to the reference background image. The chessboard pattern to be calibrated includes a reference chessboard pattern corresponding to the reference background image and a rotated chessboard pattern corresponding to the rotated background image.

[0040] The identification unit is used to identify the number of chessboard squares of the target color in the chessboard square image to be calibrated, so as to detect whether the number of chessboard squares is consistent with the actual number of chessboard squares of the target color in the chessboard background image; to identify the color of the chessboard square at the target position in the chessboard square image to be calibrated, so as to detect whether the color of the chessboard square is consistent with the actual color of the chessboard square at the target position in the chessboard background image; and to identify the rotation angle of the rotated chessboard square image relative to the reference chessboard square image, so as to detect whether the rotation angle is consistent with the preset angle.

[0041] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, the computer program including executable instructions that, when executed by a processor, implement the method described in any of the embodiments of the first aspect.

[0042] According to a fourth aspect of the present application, an electronic device is provided, comprising: one or more processors; and a memory for storing executable instructions of the processors, wherein when the executable instructions are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method described in any embodiment of the first aspect above.

[0043] The beneficial effects of the embodiments of the second to fourth aspects described above can be referred to the beneficial effects of the first aspect and the embodiments of the first aspect described above, and will not be repeated here.

[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0046] Figure 1 A flowchart of the image detection method before camera calibration in an embodiment of this application is shown;

[0047] Figure 2 A flowchart of a method for obtaining a chessboard pattern to be calibrated, as shown in an embodiment of this application, is illustrated.

[0048] Figure 3 A detailed flowchart illustrating the identification of the number of chessboard squares of the target color in the chessboard grid to be calibrated in an embodiment of this application is shown.

[0049] Figure 4 This document illustrates a detailed flowchart of an embodiment of the present application, showing how to determine a checkerboard grid in the checkerboard graph to be calibrated where the pixel value falls within the range of the pixel value.

[0050] Figure 5 This document shows a detailed flowchart illustrating the process of identifying the color of a chessboard square at a target location in the chessboard grid diagram to be calibrated, as described in an embodiment of this application.

[0051] Figure 6 This document illustrates a detailed flowchart of the process for determining the target chessboard area at the target location in the chessboard to be calibrated, as described in an embodiment of this application.

[0052] Figure 7 A detailed flowchart illustrating the identification of the rotation angle of the rotating chessboard pattern relative to the reference chessboard pattern in an embodiment of this application is shown.

[0053] Figure 8 An original chessboard diagram is shown in an embodiment of this application;

[0054] Figure 9 The original screenshot is shown, with the baseline chessboard grid as the dividing unit.

[0055] Figure 10 The outline of the original screenshot is shown;

[0056] Figure 11 The baseline chessboard diagram to be calibrated is shown;

[0057] Figure 12 for Figure 8 The rotating background image in the lower left corner corresponds to the rotating chessboard pattern.

[0058] Figure 13 for Figure 8 The rotating background image in the upper right corner corresponds to the rotating chessboard pattern.

[0059] Figure 14 for Figure 8 The rotating background image in the lower right corner corresponds to the rotating chessboard pattern.

[0060] Figure 15 This diagram shows the black checkerboard pattern after it has been broken up by matrix erosion.

[0061] Figure 16 This diagram illustrates the white checkerboard pattern after it has been broken up by matrix erosion.

[0062] Figure 17 The diagram shows the principle of pinhole imaging with side length corresponding to L1;

[0063] Figure 18 A schematic diagram illustrating the relationship between a camera's focal length, image height, and field of view;

[0064] Figure 19 A block diagram of the image detection device before camera calibration in an embodiment of this application is shown;

[0065] Figure 20 A schematic diagram of a computer-readable storage medium in an embodiment of this application is shown;

[0066] Figure 21 A schematic diagram of the system structure of an electronic device in an embodiment of this application is shown. Detailed Implementation

[0067] Figure 1 A flowchart of a pre-calibration image detection method according to an embodiment of this application is shown. This pre-calibration image detection method can be executed by a device with computational processing capabilities. (Refer to...) Figure 1As shown, the image detection method before camera calibration includes at least steps S1 to S4, which are described in detail below:

[0068] In step S1, a chessboard pattern to be calibrated is obtained. The chessboard pattern to be calibrated is obtained by taking a picture of the chessboard background image with the camera. The chessboard background image includes a reference background image and at least one rotated background image that is rotated by a preset angle relative to the reference background image. The chessboard pattern to be calibrated includes a reference chessboard pattern corresponding to the reference background image and a rotated chessboard pattern corresponding to the rotated background image.

[0069] In this application, the reference background image can be a checkerboard calibration plate perpendicular to the camera shooting direction, and the rotating background image can be a checkerboard calibration plate with an acute or obtuse angle between the camera shooting direction and the camera shooting direction.

[0070] In this application, the baseline checkerboard pattern can be an image obtained when the camera captures a baseline background image, and the rotated checkerboard pattern can be an image obtained when the camera captures a rotated background image. The baseline checkerboard pattern and the rotated checkerboard pattern can be processed separately or placed on the same image for unified processing.

[0071] Specifically, when photographing the checkerboard calibration board, the calibration board can be placed directly facing the camera's shooting direction, so that the plane of the calibration board is perpendicular to the camera's shooting direction. The camera is used to photograph the calibration board to obtain a baseline checkerboard image. Then, the calibration board is rotated at a preset angle. After the calibration board is rotated into position, the camera position and shooting direction remain unchanged. The rotated calibration board is then photographed to obtain the rotated checkerboard image.

[0072] In step S2, the number of chessboard squares of the target color in the chessboard pattern to be calibrated is identified to detect whether the number of chessboard squares is consistent with the actual number of chessboard squares of the target color in the chessboard background pattern.

[0073] In this application, the number of chessboard squares can represent the total number of chessboard squares in the chessboard image to be calibrated that are the target color. For example, the number of chessboard squares can represent the total number of chessboard squares in the chessboard image to be calibrated that are black. The actual number of chessboard squares can represent the total number of chessboard squares in the chessboard background image that are the target color. For example, the actual number of chessboard squares can represent the total number of chessboard squares in the chessboard background image that are black.

[0074] In this application, the number of chessboard squares can be compared with the actual number of chessboard squares to determine whether the chessboard diagram to be calibrated is complete and whether there are any omissions. If the two numbers are the same, for example, both the number of chessboard squares and the actual number of chessboard squares are 100, it indicates that the chessboard diagram to be calibrated is complete. If the two numbers are different, for example, the number of chessboard squares is 98 and the actual number of chessboard squares is 100, it indicates that the chessboard diagram to be calibrated is incomplete. In actual production, once an incomplete chessboard diagram to be calibrated occurs, a prompt or alarm will be issued to facilitate automatic processing by the equipment or manual processing.

[0075] In step S3, the color of the chessboard square at the target position in the chessboard pattern to be calibrated is identified to detect whether the color of the chessboard square is consistent with the actual color of the chessboard square at the target position in the background image of the chessboard pattern.

[0076] In this application, the color of the checkerboard grid can represent the color of the checkerboard grid at the target position in the checkerboard grid diagram to be calibrated. For example, if the checkerboard grid color is black, it means that the color of the checkerboard grid at the target position in the checkerboard grid diagram to be calibrated is black. The actual checkerboard grid color can represent the actual color of the checkerboard grid at the target position in the checkerboard grid background image. For example, if the actual checkerboard grid color is black, it means that the actual checkerboard grid color represents that the actual color of the checkerboard grid at the target position in the checkerboard grid background image is black.

[0077] In this application, the color of the chessboard grid can be compared with the actual color of the chessboard grid to determine whether the planar position of the chessboard grid image to be calibrated is correct. Specifically, the chessboard grid image to be calibrated is a planar image taken by a camera. The planar position of the chessboard grid image to be calibrated refers to the distribution position of the chessboard grid in the chessboard grid image to be calibrated. If the planar position of the chessboard grid image to be calibrated is correct, one of the chessboard grids in the chessboard grid image to be calibrated is selected and compared with the chessboard grid in the same position in the original image (chessboard grid background image). The two have the same color, that is, the color of the chessboard grid at the target position in the chessboard grid image to be calibrated is the same as the color of the chessboard grid in the same position in the original image (chessboard grid background image).

[0078] In this application, the color of the checkerboard pattern is compared with the color of the actual checkerboard pattern. If the two colors are the same, for example, both the checkerboard pattern color and the actual checkerboard pattern color are black, it indicates that the planar position of the checkerboard pattern to be calibrated is correct. If the two colors are different, for example, the checkerboard pattern color is black and the actual checkerboard pattern color is white, it indicates that the planar position of the checkerboard pattern to be calibrated is incorrect. Similarly, in the actual production process, once the planar position of the checkerboard pattern to be calibrated is inaccurate, a prompt or alarm will be issued to facilitate automatic processing by the equipment or manual processing.

[0079] In step S4, the rotation angle of the rotating chessboard pattern relative to the reference chessboard pattern is identified to detect whether the rotation angle is consistent with the preset angle.

[0080] In this application, the rotation angle can be compared with the preset angle to determine whether the rotation position of the chessboard pattern to be calibrated is correct. The rotation position of the chessboard pattern to be calibrated represents the rotation angle of the rotating chessboard pattern relative to the reference chessboard pattern. If the rotation position of the chessboard pattern to be calibrated is correct, that is, the rotation angle is correct, then the rotation angle and the preset angle should be consistent.

[0081] In this application, the rotation angle is compared with the preset angle. If the two angles are the same, it indicates that the rotation position of the chessboard pattern to be calibrated is correct. If the two angles are different, for example, the rotation angle is 30° and the preset angle is 35°, it indicates that the rotation position of the calibrated chessboard pattern is incorrect. Similarly, in the actual production process, once the rotation position of the chessboard pattern to be calibrated is inaccurate, a prompt or alarm will be issued to facilitate automatic handling by the equipment or manual handling.

[0082] In this application, the position of the chessboard to be calibrated is determined by detecting the number of chessboard squares, the actual color of the chessboard square at the target position, and the rotation angle of the rotated chessboard relative to the reference chessboard. This prevents incorrectly positioned chessboard squares from entering the camera calibration process and affecting the accuracy of the camera calibration.

[0083] Figure 2 A flowchart of a method for obtaining a chessboard pattern to be calibrated according to an embodiment of this application is shown. Before step S1, this method includes at least steps S00 to S01, which are described in detail below:

[0084] In step S00, the original chessboard pattern is obtained by capturing the chessboard background image with the camera.

[0085] In this application, the original chessboard pattern may include a baseline original chessboard pattern corresponding to the baseline background pattern and a rotated original chessboard pattern corresponding to the rotated background pattern. The baseline original chessboard pattern and the rotated original chessboard pattern may be placed in the same image or in a separate image.

[0086] In step S01, the original chessboard pattern is divided into segments using the reference chessboard pattern or the rotated chessboard pattern as the segmentation unit to obtain the chessboard pattern to be calibrated.

[0087] In this application, the original chessboard pattern is divided into segments using the reference chessboard pattern or the rotated chessboard pattern as the segmentation unit to obtain a chessboard pattern to be calibrated that includes only the reference chessboard pattern or a chessboard pattern to be calibrated that includes only the rotated chessboard pattern. The chessboard pattern to be calibrated may only cover the area where the chessboard pattern is located and not cover other areas.

[0088] The following will address Figure 1 The embodiments of each step are further described below:

[0089] exist Figure 1 In one embodiment of step S2 shown, identifying the number of chessboard squares of the target color in the chessboard grid to be calibrated can be done according to... Figure 3 Perform the steps shown:

[0090] See Figure 3 This document illustrates a detailed flowchart of the process for identifying the number of chessboard squares of the target color in the chessboard grid to be calibrated, as described in an embodiment of this application. Specifically, it includes steps S21 to S23:

[0091] In step S21, a range of pixel values ​​that match the target color is determined.

[0092] In this application, the pixel value corresponding to the target color is in a matching pixel value range, for example, the pixel value range for black is 0 to 40 pixels, and the pixel value range for white is 40 to 255 pixels.

[0093] In step S22, the checkerboard grids whose pixel values ​​fall within the pixel value range are identified as target checkerboard grids in the checkerboard grid to be calibrated.

[0094] In this application, the pixel values ​​of the chessboard grid in the chessboard grid image to be calibrated and the pixel values ​​within the pixel value range can be compared. If the two are consistent, the chessboard grid is taken as the target chessboard grid.

[0095] In step S23, the target chessboard squares are counted to obtain the number of chessboard squares of the target color in the chessboard square map to be calibrated.

[0096] exist Figure 3 In one embodiment of step S22 shown, determining the checkerboard grids whose pixel values ​​fall within the pixel value range in the checkerboard grid image to be calibrated can be done according to... Figure 4 The steps shown are to be performed. Specific steps include steps S221 to S222:

[0097] In step S221, multiple checkerboard regions in the checkerboard map to be calibrated are determined where the pixel values ​​fall within the pixel value range.

[0098] In this application, the checkerboard area can be determined by determining whether the pixel value falls within the pixel value area.

[0099] In step S222, matrix erosion is performed on each of the chessboard regions to obtain chessboard grids whose pixel values ​​fall within the pixel value range.

[0100] In this application, the chessboard area can be reduced in size by performing matrix erosion on each chessboard area, thereby separating adjacent chessboard areas and facilitating the counting of target chessboard areas.

[0101] exist Figure 1 In one embodiment of step S3 shown, identifying the color of the chessboard square at the target position in the chessboard diagram to be calibrated can be done according to... Figure 5 The steps shown are to be performed. Specifically, steps S31 to S33 are included:

[0102] In step S31, a target chessboard area is determined at the target position in the chessboard map to be calibrated, and the pixel value of each pixel unit in the target chessboard area is determined.

[0103] In this application, the target chessboard area can be one of the chessboard squares in the chessboard diagram to be calibrated.

[0104] Furthermore, the target chessboard area refers to the chessboard grids at each corner of the chessboard diagram to be calibrated.

[0105] In step S32, the number of pixel units whose pixel values ​​fall into different pixel value ranges is counted, that is, the number of pixel units corresponding to different pixel values ​​is counted, which can be done by counting.

[0106] In step S33, the color of the chessboard square at the target position in the chessboard map is identified based on the proportional relationship between the number of pixel units falling into different pixel value ranges.

[0107] In this application, the ratio of the number of pixel units corresponding to different pixel values ​​can characterize the color of the chessboard at the target position. For example, if the chessboard at the target position includes two types of pixel values, black and white, and the ratio of black pixel values ​​to white pixel values ​​is 100:1, then the color of the chessboard at the target position is black.

[0108] exist Figure 5 In one embodiment of step S31 shown, the target chessboard area is determined at the target position in the chessboard diagram to be calibrated, which can be done according to... Figure 6 The steps shown are executed. Specifically, steps S311 to S313 are included:

[0109] In step S311, the corner points of each chessboard grid are determined in the chessboard grid diagram to be calibrated, wherein the corner points are the mass points at each corner of the chessboard grid.

[0110] In step S312, a corner point defined by the target position is determined as the first corner point, and the three corner points closest to the first corner point are calculated to obtain the second corner point;

[0111] In step S313, the chessboard area defined by the first corner point and the second corner point is determined to obtain the target chessboard area.

[0112] exist Figure 1 In one embodiment of step S4 shown, identifying the rotation angle of the rotated chessboard pattern relative to the reference chessboard pattern can be done according to... Figure 7 The steps shown are to be performed. Specific steps include steps S41 to S43:

[0113] In step S41, the wide-angle view of the camera is obtained.

[0114] In this application, the field of view of the camera is a proprietary parameter of the camera, which can be obtained from the camera's instruction manual.

[0115] In step S42, the side lengths of the base chessboard and the rotating chessboard are calculated.

[0116] In this application, the side length of the reference chessboard can be obtained by establishing a coordinate system in the reference chessboard and calculating the distance between the corner points. Similarly, the side length of the rotating chessboard can be obtained by establishing a coordinate system in the rotating chessboard and calculating the distance between the corner points.

[0117] In step S43, the rotation angle is calculated based on the camera's field of view, the side length of the reference chessboard pattern, and the side length of the rotated chessboard pattern.

[0118] Continue to refer to Figure 7 S43 is further explained by calculating the rotation angle using the following formula:

[0119]

[0120] Wherein, Angle is the rotation angle, H and W are the side lengths of the base chessboard pattern, L1 and L2 are the side lengths of the rotating chessboard pattern, C is the camera's field of view, H corresponds to the side length of the base chessboard pattern being parallel to the rotation axis when the rotating chessboard pattern rotates by a preset angle, W corresponds to the side length of the base chessboard pattern being perpendicular to the rotation axis when the rotating chessboard pattern rotates by a preset angle, and L1 and L2 correspond to the side lengths of the rotating chessboard pattern being parallel to the side length of the base chessboard pattern corresponding to H.

[0121] To further understand this embodiment, a specific example is provided below:

[0122] Step S00: Obtain the original chessboard image obtained by capturing the chessboard background image with the camera, see [link to relevant documentation]. Figure 8 , Figure 8 This embodiment shows an original chessboard diagram. Figure 8 The specific details of the corresponding chessboard background image are as follows:

[0123] It has 133 (7*19) black chessboard squares and 133 (7*19) white chessboard squares, with the black and white chessboard squares interspersed.

[0124] Specifically, Figure 8 The system includes a baseline original chessboard diagram located in the upper left corner and rotated baseline original chessboard diagrams located in the lower left, upper right, and lower right corners. The upper left corner of the baseline original chessboard diagram is set as the origin, the X-axis is defined as the direction to the right from the origin, and the Y-axis is defined as the direction downward from the origin. The baseline original chessboard diagram is rotated 30° inward around the Y-axis to obtain the rotated baseline original chessboard diagram in the lower left corner. The baseline original chessboard diagram is rotated 180° around the origin and then rotated 30° inward around the Y-axis to obtain the rotated baseline original chessboard diagram in the upper right corner. The baseline original chessboard diagram is rotated 30° outward around the X-axis to obtain the rotated baseline original chessboard diagram in the lower right corner.

[0125] Step S01: Using the reference chessboard pattern or the rotated chessboard pattern as the segmentation unit, segment the original chessboard pattern to obtain the chessboard pattern to be calibrated.

[0126] The specific segmentation method is as follows:

[0127] See Figures 9-11 , Figure 9 The original screenshot is shown, with the baseline chessboard grid as the dividing unit. Figure 10 The outline of the original screenshot is shown. Figure 11 The baseline chessboard diagram to be calibrated is shown;

[0128] First, capture the original screenshot containing the complete baseline checkerboard pattern. Then, average the original screenshot and interpolate the brightness against the original checkerboard pattern to find the image outline, obtaining the outline image of the original screenshot. Next, remove all scattered points and noise, and dilate the outline image, selecting the outline with the largest area. Further dilation and filling are performed, selecting the largest bounding matrix within the region to obtain the baseline checkerboard pattern to be calibrated. The same method can then be used to obtain the rotated checkerboard pattern to be calibrated.

[0129] Step S1: Obtain the chessboard pattern to be calibrated. The chessboard pattern to be calibrated is obtained by capturing a chessboard background image with the camera. The chessboard background image includes a base background image and three rotated background images rotated by a preset angle relative to the base background image. The chessboard pattern to be calibrated includes the base chessboard pattern corresponding to the base background image and the three rotated background images corresponding to the rotated background images. See [link to relevant documentation]. Figure 11 , Figure 11 for Figure 8 The baseline background image in the upper left corner corresponds to the baseline chessboard pattern. See [link / reference]. Figures 12-14 , Figure 12 for Figure 8 The rotating background image in the bottom left corner corresponds to the rotating checkerboard pattern. Figure 13 for Figure 8 The rotating background image in the upper right corner corresponds to the rotating checkerboard pattern. Figure 14 for Figure 8 The rotating background image in the lower right corner corresponds to the rotating chessboard pattern.

[0130] Step S2: Identify the number of chessboard squares of the target color in the chessboard pattern to be calibrated, and check whether the number of chessboard squares is consistent with the actual number of chessboard squares of the target color in the chessboard background image. Since the chessboard calibration board includes black chessboard squares and white chessboard squares, the chessboard pattern to be calibrated and the chessboard background image also include black chessboard squares and white chessboard squares. The target color has two colors: black and white. The number of chessboard squares and the actual number of chessboard squares need to be checked twice, that is, the black chessboard squares and the white chessboard squares are checked separately.

[0131] Specifically, step S2 includes:

[0132] Step S21: Determine the range of pixel values ​​that match the target color;

[0133] Step S22: In the chessboard map to be calibrated, determine the chessboard squares whose pixel values ​​fall within the pixel value range, and use them as target chessboard squares;

[0134] Step S23: Count the target chessboard squares to obtain the number of chessboard squares of the target color in the chessboard square map to be calibrated.

[0135] When detecting the number of black checkerboard squares, the pixel value range matching black is determined to be 0-40 pixels. Checkerboard squares in the checkerboard image to be calibrated are identified as target checkerboard squares (i.e., black checkerboard squares). The number of these target checkerboard squares (i.e., white checkerboard squares) in the checkerboard image to be calibrated is obtained. Similarly, when detecting the number of white checkerboard squares, the pixel value range matching white is determined to be 40-255 pixels. Checkerboard squares in the checkerboard image to be calibrated are identified as target checkerboard squares (i.e., white checkerboard squares). The number of these target checkerboard squares (i.e., white checkerboard squares) in the checkerboard image to be calibrated is obtained.

[0136] Step S22 includes:

[0137] Step S221: In the checkerboard pattern to be calibrated, determine multiple checkerboard areas where the pixel values ​​fall within the pixel value range.

[0138] Step S222: Perform matrix erosion on each of the chessboard regions to obtain chessboard grids whose pixel values ​​fall within the pixel value range.

[0139] When detecting the number of black checkerboard squares, multiple checkerboard square regions falling within the 0-40 pixel value were identified. Adjacent black checkerboard squares were interconnected, making counting difficult. Therefore, matrix erosion was used to erode these regions, reducing their size and resulting in multiple separated black checkerboard squares. After counting, the number of black checkerboard squares was found to be 133. (See [link to relevant documentation]). Figure 15 , Figure 15 The diagram shows the black checkerboard pattern after being broken down by matrix erosion. Similarly, the checkerboard area falling between 40 and 255 pixels was identified, and after matrix erosion, it was broken down into multiple separated white checkerboard patterns. After counting, the number of white checkerboard patterns was found to be 133. See [link to diagram]. Figure 16 , Figure 16 The diagram shows the white checkerboard pattern after it has been broken up by matrix erosion.

[0140] Step S3: Identify the color of the chessboard square at the target position in the chessboard pattern to be calibrated, and detect whether the color of the chessboard square is consistent with the actual color of the chessboard square at the target position in the background image of the chessboard pattern.

[0141] Specifically, step S3 includes:

[0142] Step S31: Determine the target chessboard area at the target location in the chessboard map to be calibrated, and determine the pixel value of each pixel unit in the target chessboard area.

[0143] Step S32: Count the number of pixel units whose pixel values ​​fall into different pixel value ranges, that is, count the number of pixel units corresponding to different pixel values, which can be done by counting.

[0144] Step S33: Identify the color of the chessboard grid at the target position in the chessboard grid map according to the proportional relationship between the number of pixel units falling into different pixel value ranges.

[0145] Step S31 includes:

[0146] Step S311: Determine the corner points of each chessboard grid in the chessboard grid diagram to be calibrated, wherein the corner points are the mass points at each corner of the chessboard grid;

[0147] Step S312: Determine the corner point defined by the target position as the first corner point, and calculate the three corner points closest to the first corner point to obtain the second corner point;

[0148] Step S313: Determine the chessboard area defined by the first corner point and the second corner point to obtain the target chessboard area.

[0149] Taking the baseline chessboard in the upper left corner as an example, and taking the chessboard in the lower right corner of the baseline chessboard as the target position chessboard, first determine the corner points of each chessboard in the baseline chessboard, that is, the points at the four corners of the chessboard. Taking the upper left corner of the baseline chessboard as the origin, the X-axis extends to the right from the origin and the Y-axis extends downward from the origin. The corner point with the largest X value and the largest Y value is the point defined by the target position chessboard, that is, the first corner point. Then, calculate the three corner points closest to the first corner point, that is, the three corner points of the current position chessboard besides the first corner point, as the second corner points. The chessboard area defined by the first corner point and the three second corner points is the target chessboard area where the target position chessboard is located.

[0150] The number of pixel units falling into the range of 0-40 pixel values ​​(black) and the range of 40-255 pixel values ​​is counted. Based on the ratio of black pixel units to white pixel units, the color of the chessboard at the target position is determined. For example, if the ratio of black pixel units to white pixel units is 9:1, the color of the chessboard at the target position is determined to be black; if the ratio of black pixel units to white pixel units is 1:9, the color of the chessboard at the target position is determined to be white.

[0151] See Figure 11 The target position's chessboard square is determined to be black. Using the same method, the rotated chessboard square in the lower left corner is determined (see...). Figure 12 The top left corner is white, and the top right corner features a rotating checkerboard pattern (see...). Figure 13 The bottom left corner is black, and the bottom right corner features a rotating checkerboard pattern (see...).Figure 14 The color in the upper left corner is white.

[0152] Step S4: Identify the rotation angle of the rotating chessboard pattern relative to the reference chessboard pattern, and detect whether the rotation angle is consistent with the preset angle.

[0153] Specifically, step S4 includes:

[0154] Step S41: Obtain the wide-angle view of the camera.

[0155] Step S42: Calculate the side lengths of the base chessboard and the rotating chessboard.

[0156] Step S43: Calculate the rotation angle based on the camera's field of view, the side length of the reference chessboard, and the side length of the rotated chessboard.

[0157] Step S43 includes:

[0158] The rotation angle is calculated using the following formula:

[0159]

[0160] Wherein, Angle is the rotation angle, H and W are the side lengths of the base chessboard pattern, L1 and L2 are the side lengths of the rotating chessboard pattern, C is the camera's field of view, H corresponds to the side length of the base chessboard pattern being parallel to the rotation axis when the rotating chessboard pattern rotates by a preset angle, W corresponds to the side length of the base chessboard pattern being perpendicular to the rotation axis when the rotating chessboard pattern rotates by a preset angle, and L1 and L2 correspond to the side lengths of the rotating chessboard pattern being parallel to the side length of the base chessboard pattern corresponding to H.

[0161] See Figure 11 H represents the side length of the baseline chessboard along the vertical direction, and W represents the side length of the baseline chessboard along the horizontal direction. See [link / reference]. Figure 12 L1 and L2 are the side lengths of the rotating chessboard grid along the vertical direction, where L1 is the right side length and L2 is the left side length. The detailed derivation of the formula is as follows (see below). Figure 17 According to the principle of pinhole imaging, D1 is the distance from the camera to the side corresponding to L1, and f is the focal length of the camera.

[0162] Then we get:

[0163] (1) Equation: D1 / f=H / L1,

[0164] Similarly, we get:

[0165] (2) Equation: D2 / f=H / L2,

[0166] Where D2 is the distance from the camera to the side corresponding to L2.

[0167] Based on the relationship between camera characteristics, including wide-angle view, focal length, and image height, see [link / reference]. Figure 18 ,get:

[0168] (3) Equation: Tan(C / 2)=H / 2f,

[0169] Based on the properties of rotating the baseline chessboard, we obtain:

[0170] (4) Equation: Angle = arcsin[(D1-D2) / W],

[0171] Based on equations (1) to (4), we obtain:

[0172]

[0173] It should be noted that when the above formula is applied to the rotating chessboard diagram in the lower right corner, H corresponds to the side length in the left and right direction of the base chessboard diagram, W corresponds to the side length in the up and down direction of the base chessboard diagram, and L1 and L2 are the side lengths of the rotating chessboard diagram in the left and right direction.

[0174] See Figure 19 The diagram shows a block diagram of the image detection device before camera calibration in an embodiment of this application.

[0175] like Figure 19 As shown, based on the same inventive concept, the second aspect of this application also provides a camera pre-calibration image detection device 100, including: an acquisition unit 101 and a recognition unit 102.

[0176] The acquisition unit 101 is used to acquire a chessboard pattern to be calibrated, which is obtained by capturing a chessboard background image with a camera. The chessboard background image includes a reference background image and at least one rotated background image rotated by a preset angle relative to the reference background image. The chessboard pattern to be calibrated includes a reference chessboard pattern corresponding to the reference background image and a rotated chessboard pattern corresponding to the rotated background image. The identification unit 102 is used to identify the number of chessboard patterns of the target color in the chessboard pattern to be calibrated, to detect whether the number of chessboard patterns is consistent with the actual number of chessboard patterns of the target color in the chessboard background image; to identify the color of the chessboard pattern of the target position in the chessboard pattern to be calibrated, to detect whether the color of the chessboard pattern is consistent with the actual color of the chessboard pattern of the target position in the chessboard background image; and to identify the rotation angle of the rotated chessboard pattern relative to the reference chessboard pattern, to detect whether the rotation angle is consistent with the preset angle.

[0177] In some embodiments of this application, based on the foregoing scheme, the identification unit 102 includes a first identification unit 1021, a second identification unit 1022, and a third identification unit 1023.

[0178] The first identification unit 1021 is used to identify the number of chessboard squares of the target color in the chessboard pattern to be calibrated, so as to detect whether the number of chessboard squares is consistent with the actual number of chessboard squares of the target color in the chessboard background image; the second identification unit 1022 is used to identify the color of the chessboard square of the target position in the chessboard pattern to be calibrated, so as to detect whether the color of the chessboard square is consistent with the actual color of the chessboard square of the target position in the chessboard background image; the third identification unit 1023 is used to identify the rotation angle of the rotated chessboard pattern relative to the reference chessboard pattern, so as to detect whether the rotation angle is consistent with the preset angle.

[0179] In some embodiments of this application, based on the foregoing scheme, the first identification unit 1021 is configured to: determine a pixel value range that matches the target color; determine chessboard grids in the chessboard grid to be calibrated where the pixel values ​​fall within the pixel value range, as target chessboard grids; specifically, determine multiple chessboard grid regions in the chessboard grid to be calibrated where the pixel values ​​fall within the pixel value range, perform matrix erosion on each of the chessboard grid regions to obtain chessboard grids where the pixel values ​​fall within the pixel value range; count the target chessboard grids to obtain the number of chessboard grids with the target color in the chessboard grid to be calibrated.

[0180] In some embodiments of this application, based on the foregoing scheme, the second identification unit 1022 is configured to: determine a target chessboard area at the target position in the chessboard diagram to be calibrated; specifically, determine the corner points of each chessboard square in the chessboard diagram to be calibrated, wherein the corner points are the particles at each corner of the chessboard square; determine the corner point defined by the target position as the first corner point; calculate the three corner points closest to the first corner point to obtain the second corner point; determine the chessboard area defined by the first corner point and the second corner point to obtain the target chessboard area; and determine the pixel value of each pixel unit in the target chessboard area; count the number of pixel units whose pixel values ​​fall into different pixel value intervals; and identify the chessboard color of the chessboard square at the target position in the chessboard diagram to be calibrated based on the proportional relationship between the number of pixel units falling into different pixel value intervals.

[0181] In some embodiments of this application, based on the foregoing scheme, the second identification unit 1023 is configured to: acquire the viewing angle of the camera; calculate the side length of the reference chessboard and the side length of the rotated chessboard; and calculate the rotation angle based on the viewing angle of the camera, the side length of the reference chessboard, and the side length of the rotated chessboard. Specifically, the rotation angle is calculated using the following formula:

[0182]

[0183] Wherein, Angle is the rotation angle, H and W are the side lengths of the base chessboard pattern, L1 and L2 are the side lengths of the rotating chessboard pattern, C is the camera's field of view, H corresponds to the side length of the base chessboard pattern being parallel to the rotation axis when the rotating chessboard pattern rotates by a preset angle, W corresponds to the side length of the base chessboard pattern being perpendicular to the rotation axis when the rotating chessboard pattern rotates by a preset angle, and L1 and L2 correspond to the side lengths of the rotating chessboard pattern being parallel to the side length of the base chessboard pattern corresponding to H.

[0184] In this embodiment of the application, the checkerboard pattern can also be described as a square, and the camera's focal length can be used as a known parameter to calculate the rotation angle.

[0185] Based on the same inventive concept, a third aspect of this application also provides, as another aspect, a computer-readable storage medium storing a program product capable of implementing the bolt preload loading method described above. In some possible implementations, various aspects of this application can also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this application.

[0186] refer to Figure 20 As shown, a program product 200 for implementing the above-described method according to an embodiment of this application is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of this application is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0187] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0188] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0189] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0190] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0191] In another respect, this application also provides an electronic device capable of implementing the above-described method.

[0192] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0193] The following reference Figure 21 To describe an electronic device 300 according to this embodiment of the present application. Figure 21 The electronic device 300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0194] like Figure 21 As shown, the electronic device 300 is manifested in the form of a general-purpose computing device. The components of the electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one storage unit 320, and a bus 330 connecting different system components (including storage unit 320 and processing unit 310).

[0195] The storage unit stores program code that can be executed by the processing unit 310, causing the processing unit 310 to perform the steps described in the "Embodiment Methods" section above according to various exemplary embodiments of this application.

[0196] Storage unit 320 may include readable media in the form of volatile storage units, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.

[0197] Storage unit 320 may also include a program / utility 324 having a set (at least one) of program modules 325, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0198] Bus 330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0199] Electronic device 300 can also communicate with one or more external devices 400 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 300, and / or with any device that enables electronic device 300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 350. Furthermore, electronic device 300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 360. As shown, network adapter 360 communicates with other modules of electronic device 300 via bus 330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

Claims

1. A camera pre-image detection method, characterized in that, The method comprises the following steps: obtaining a to-be-calibrated checkerboard image, wherein the to-be-calibrated checkerboard image is obtained by capturing a checkerboard background image by the camera, the checkerboard background image comprises a reference background image and at least one rotated background image rotated by a preset angle relative to the reference background image, the to-be-calibrated checkerboard image comprises a reference checkerboard image corresponding to the reference background image and a rotated checkerboard image corresponding to the rotated background image, and further comprising: obtaining an original checkerboard image obtained by capturing a checkerboard background image by the camera, and dividing the original checkerboard image by taking the reference checkerboard image or the rotated checkerboard image as a division unit to obtain the to-be-calibrated checkerboard image; identifying the number of checkerboards of a target color in the to-be-calibrated checkerboard image to detect whether the number of checkerboards is consistent with the actual number of checkerboards of the target color in the checkerboard background image; identifying the checkerboard color of a target position checkerboard in the to-be-calibrated checkerboard image to detect whether the checkerboard color is consistent with the actual checkerboard color of the target position checkerboard in the checkerboard background image; identifying the rotation angle of the rotated checkerboard image relative to the reference checkerboard image to detect whether the rotation angle is consistent with the preset angle.

2. The method of claim 1, wherein, The identification of the number of checkerboards of a target color in the to-be-calibrated checkerboard image comprises: determining a pixel value interval matching the target color; determining, in the to-be-calibrated checkerboard image, a checkerboard in which a pixel value falls into the pixel value interval as a target checkerboard; counting the target checkerboard to obtain the number of checkerboards of the target color in the to-be-calibrated checkerboard image.

3. The method of claim 2, wherein, The determination of a checkerboard in which a pixel value falls into the pixel value interval in the to-be-calibrated checkerboard image comprises: determining, in the to-be-calibrated checkerboard image, a plurality of checkerboard regions in which pixel values fall into the pixel value interval; performing matrix erosion on each of the checkerboard regions to obtain a checkerboard in which a pixel value falls into the pixel value interval.

4. The method of claim 1, wherein, The identification of the checkerboard color of a target position checkerboard in the to-be-calibrated checkerboard image comprises: determining a target checkerboard region at a target position in the to-be-calibrated checkerboard image and determining pixel values of each pixel unit in the target checkerboard region; counting the number of pixel units falling into different pixel value intervals; identifying the checkerboard color of the target position checkerboard in the to-be-calibrated checkerboard image according to the proportional relationship between the number of pixel units falling into different pixel value intervals.

5. The method of claim 4, wherein, The determination of a target checkerboard region at a target position in the to-be-calibrated checkerboard image comprises: determining corner points of each checkerboard in the to-be-calibrated checkerboard image, wherein the corner points are mass points at each corner of a checkerboard; determining a corner point defined by the target position as a first corner point, and calculating three corner points closest to the first corner point to obtain second corner points; determining a checkerboard region defined by the first corner point and the second corner points to obtain the target checkerboard region.

6. The method of claim 1, wherein, The identification of the rotation angle of the rotated checkerboard image relative to the reference checkerboard image comprises: obtaining a view angle of the camera; calculate a length of an edge of the reference checkerboard image and a length of an edge of the rotated checkerboard image; calculate a rotation angle according to a view angle of the camera, the length of the edge of the reference checkerboard image, and the length of the edge of the rotated checkerboard image.

7. The method of claim 6, wherein, The rotation angle is calculated by the following formula: Angle = 0° , wherein Angle is the rotation angle, H and W are the length of the edge of the reference checkerboard image, L1 and L2 are the length of the edge of the rotated checkerboard image, C is the view angle of the camera, H corresponds to the length of the edge of the reference checkerboard image parallel to the rotation axis when the rotated checkerboard image is rotated by the preset angle, W corresponds to the length of the edge of the reference checkerboard image vertical to the rotation axis when the rotated checkerboard image is rotated by the preset angle, L1 and L2 correspond to the length of the edge of the rotated checkerboard image parallel to H corresponding to the length of the edge of the reference checkerboard image.

8. A camera calibration pre-image detection device, the device comprising: an acquisition unit configured to acquire a to-be-calibrated checkerboard image, the to-be-calibrated checkerboard image being obtained by capturing a checkerboard background image by the camera, the checkerboard background image comprising a reference background image and at least one rotated background image rotated by a preset angle relative to the reference background image, the to-be-calibrated checkerboard image comprising a reference checkerboard image corresponding to the reference background image and a rotated checkerboard image corresponding to the rotated background image, and further comprising: acquiring an original checkerboard image obtained by capturing the checkerboard background image by the camera, and segmenting the original checkerboard image by taking the reference checkerboard image or the rotated checkerboard image as a segmentation unit to obtain the to-be-calibrated checkerboard image; an identification unit configured to identify a number of checkerboards of a target color in the to-be-calibrated checkerboard image to detect whether the number of checkerboards is consistent with an actual number of checkerboards of the target color in the checkerboard background image, identify a color of a checkerboard of a target position in the to-be-calibrated checkerboard image to detect whether the color of the checkerboard is consistent with an actual color of the checkerboard of the target position in the checkerboard background image, and identify a rotation angle of the rotated checkerboard image relative to the reference checkerboard image to detect whether the rotation angle is consistent with the preset angle.

9. A computer readable storage medium having stored thereon a computer program comprising executable instructions which, when executed by a processor, implement a camera calibration pre-image detection method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Checkerboard corner automatic extraction method, system and device and medium

    CN112446895A

  • Visual pose measurement method based on improved checkerboard target

    CN112923918A