Camera parameter calibration method and device

Through the parallel processing of the video frame extraction and detection process by the PC, the clear checkerboard in camera calibration can be quickly identified, which solves the problem of low efficiency of mass calibration of cameras in the existing technology and improves the calibration efficiency.

CN118799412APending Publication Date: 2024-10-18BEIJING JINGWEI HIRAIN TECH CO INC

Patent Information

Application Number
CN202410850761.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, the efficiency of mass calibration of cameras is low. It requires manual work to select a clear checkerboard image from images at multiple angles and positions, which takes a long time.

Method used

A PC is used to process the video frame extraction process and the clear checkerboard detection process in the video frame in parallel. By receiving the video collected by the camera, playing the video, and extracting and storing the video frame in real time every preset number of frames, it detects whether there is a clear checkerboard in the frame. If the checkerboard meets the requirements, it is determined as the target image and calibrated to obtain the camera parameters.

Benefits of technology

It achieves rapid detection of target images with clear checkerboards, improves camera calibration efficiency, and reduces manual operation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799412A_ABST
    Figure CN118799412A_ABST
Patent Text Reader

Abstract

The invention provides a camera parameter calibration method and device, the camera parameter calibration method and device are applied to a PC, the PC is connected with a controller AVM, the controller AVM is connected with a camera, a checkerboard is preset in the shooting range of the camera, and the calibration method comprises the following steps: receiving a video which is sent by the controller AVM and collected by the camera, playing the video, and sending the video to the controller AVM; video frames are extracted and stored from a video being played in real time every preset frame number until the video is played completely, whether a checkerboard with definition meeting requirements exists in the video frames or not is detected in parallel, if yes, the video frames are determined to be target pictures meeting camera calibration requirements, the target pictures are utilized to calibrate the camera, and if not, the camera is calibrated. And obtaining parameters of the camera. According to the scheme, the PC is used for processing the video frame extraction process and the clear checkerboard detection process in the video frame in parallel, so that the target image with the clear checkerboard can be rapidly detected, and the purpose of improving the camera calibration efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of remote driving technology, and in particular to a camera parameter calibration method and device. Background Art

[0002] At present, the unmanned flatbed transport vehicles in ports have entered the batch deployment and operation stage. Sometimes, due to poor signal or other reasons, the autonomous driving vehicle cannot drive normally, and the remote driver needs to take over the remote driving of the vehicle. During the remote driving process, the vehicle-side controller provides the collected video images to the remote driver for viewing. Before the vehicle is offline, a large number of cameras need to be calibrated. The calibrated parameters will be used to remove image distortion to ensure that the captured images are closer to the real world.

[0003] In the prior art, a checkerboard with a known size is used and placed within the camera shooting range. By taking images at multiple angles and positions, and selecting clear images of the checkerboard, and then analyzing the black and white corner points of the checkerboard in these clear images, the camera's internal parameters (such as focal length, principal point, etc.) and external parameters (camera position and orientation) are calculated, and the camera parameters are calibrated.

[0004] However, currently it takes a lot of time and effort to manually select clear images of the checkerboard from images at multiple angles and positions, which is too inefficient for large-scale camera calibration. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a camera parameter calibration method and device to achieve the purpose of quickly detecting a target image with a clear checkerboard, thereby improving the camera calibration efficiency.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] A first aspect of an embodiment of the present invention discloses a camera parameter calibration method, which is applied to a PC, wherein the PC is connected to a controller AVM, and the controller AVM is connected to a camera, and a checkerboard is pre-set in the shooting range of the camera. The method comprises:

[0008] Receiving the video collected by the camera and sent by the controller AVM;

[0009] Playing the video;

[0010] Extracting and storing video frames from the video being played in real time at preset frame intervals until the video is finished playing, and detecting in parallel whether there is a checkerboard with a definition that meets the requirement in the video frame;

[0011] If so, determining that the video frame is a target image that meets the camera calibration requirements;

[0012] The camera is calibrated using the target image to obtain parameters of the camera.

[0013] Preferably, the receiving the video collected by the camera and sent by the controller AVM comprises:

[0014] Receiving RTP data sent by the controller AVM based on the user datagram protocol; the RTP data is generated by the controller AVM based on the video collected by the camera and the real-time transport protocol package;

[0015] Based on the real-time transport protocol, the RTP data is decoded to obtain the video captured by the camera.

[0016] Preferably, the detecting whether there is the checkerboard with a definition meeting the requirement in the video frame comprises:

[0017] Extracting the area covered by the checkerboard from the video frame to obtain a picture to be detected;

[0018] Establishing a rectangular coordinate system based on the image to be detected;

[0019] Calculate the standard deviation of the gradient of the image to be detected in the X-axis direction and the standard deviation of the gradient of the image to be detected in the rectangular coordinate system;

[0020] Calculate the sum of the gradient standard deviation in the X-axis direction and the gradient standard deviation in the Y-axis direction, and divide the sum by 2 to obtain the mean;

[0021] If the mean value is greater than a threshold value, it is determined that the checkerboard having a definition that meets the requirement exists in the video frame.

[0022] Preferably, extracting the area covered by the checkerboard from the video frame to obtain the image to be detected includes:

[0023] Calculate and obtain the boundary of the checkerboard in the video frame;

[0024] Mask processing is performed on the area outside the boundary of the checkerboard in the video frame to obtain a picture to be detected.

[0025] Preferably, after determining that the video frame is a target image that meets the camera calibration requirements, the method further includes:

[0026] Save the target image to a folder to obtain the save path of the target image;

[0027] Storing the save path in an XML file;

[0028] When receiving a calibration instruction for the camera, obtaining the save path from the XML file, and searching for the target image from the folder based on the save path;

[0029] The camera is calibrated using the target image to obtain parameters of the camera.

[0030] A second aspect of an embodiment of the present invention discloses a camera parameter calibration device, which is applied to a PC, wherein the PC is connected to a controller AVM, and the controller AVM is connected to a camera, and a checkerboard is pre-set in the shooting range of the camera. The device comprises:

[0031] A receiving unit, used for receiving the video collected by the camera and sent by the controller AVM;

[0032] A playback unit, used for playing the video;

[0033] A parallel processing unit is used to extract and store video frames from the video being played in real time at preset frame intervals until the video is finished playing, and to detect in parallel whether there is a checkerboard with a definition that meets the requirement in the video frame;

[0034] A determination unit, configured to determine that the video frame is a target image that meets the camera calibration requirement when there is a checkerboard whose clarity meets the requirement in the video frame;

[0035] A calibration unit is used to calibrate the camera using the target image to obtain parameters of the camera.

[0036] Preferably, the receiving unit is specifically used for:

[0037] Receiving RTP data sent by the controller AVM based on the user datagram protocol; the RTP data is generated by the controller AVM based on the video collected by the camera and the real-time transport protocol package;

[0038] Based on the real-time transport protocol, the RTP data is decoded to obtain the video captured by the camera.

[0039] Preferably, the parallel processing unit comprises:

[0040] A first parallel subunit is used to extract and store video frames from the video being played in real time every preset number of frames until the video is finished playing;

[0041] The second parallel sub-unit is used to extract the area covered by the checkerboard from the video frame to obtain the picture to be detected; establish a rectangular coordinate system based on the picture to be detected; respectively calculate the gradient standard deviation of the picture to be detected in the X-axis direction and the gradient standard deviation of the Y-axis direction in the rectangular coordinate system; calculate the sum of the gradient standard deviation in the X-axis direction and the gradient standard deviation in the Y-axis direction, and divide the sum by 2 to obtain a mean; if the mean is greater than a threshold, it is determined that the checkerboard with clarity that meets the requirements exists in the video frame.

[0042] Preferably, the second parallel subunit for extracting the area covered by the checkerboard from the video frame to obtain the picture to be detected is specifically used for:

[0043] Calculate and obtain the boundary of the checkerboard in the video frame;

[0044] Mask processing is performed on the area outside the boundary of the checkerboard in the video frame to obtain a picture to be detected.

[0045] Preferably, the device further comprises:

[0046] A saving unit, configured to save the target image to a folder after determining that the video frame is a target image that meets the camera calibration requirements, and obtain a saving path for the target image;

[0047] Storing the save path in an XML file;

[0048] When receiving a calibration instruction for the camera, obtaining the save path from the XML file, and searching for the target image from the folder based on the save path;

[0049] The camera is calibrated using the target image to obtain parameters of the camera.

[0050] Based on the above-mentioned embodiment of the present invention, a camera parameter calibration method and device are provided, which are applied to a PC, wherein the PC is connected to a controller AVM, and the controller AVM is connected to a camera, and a checkerboard is pre-set in the shooting range of the camera. The method includes: receiving a video collected by the camera and sent by the controller AVM; playing the video; extracting and storing video frames from the video being played in real time at preset frame intervals until the video is finished playing, and detecting in parallel whether there is a checkerboard with a clarity that meets the requirements in the video frame; if so, determining that the video frame is a target image that meets the camera calibration requirements; and calibrating the camera using the target image to obtain the camera parameters. In this solution, a PC is used to process the video frame extraction process and the clear checkerboard detection process in the video frame in parallel, so as to achieve the purpose of quickly detecting the target image with a clear checkerboard, thereby improving the camera calibration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0052] Figure 1 This is an architecture diagram of a camera parameter calibration system disclosed in an embodiment of the present invention;

[0053] Figure 2 An example diagram of a chessboard disclosed in an embodiment of the present invention;

[0054] Figure 3 A flowchart of a camera parameter calibration method disclosed in an embodiment of the present invention;

[0055] Figure 4 An example diagram for determining a checkerboard boundary disclosed in an embodiment of the present invention;

[0056] Figure 5 A schematic diagram of a corner point disclosed in an embodiment of the present invention;

[0057] Figure 6 A structural diagram of a camera parameter calibration device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0060] As can be seen from the background technology, in the prior art, a checkerboard with a known size is used and placed within the camera shooting range. By taking images at multiple angles and positions, and selecting clear images of the checkerboard, and then analyzing the corner points of the checkerboard in these clear images, the camera's internal parameters (such as focal length, principal point, etc.) and external parameters (camera position and orientation) are calculated, and the camera parameters are calibrated.

[0061] However, currently it takes a lot of time and effort to manually select clear images of the checkerboard from images at multiple angles and positions, which is too inefficient for large-scale camera calibration.

[0062] Therefore, an embodiment of the present invention discloses a method and device for calibrating camera parameters. In this solution, a PC is used to parallelly process a video frame extraction process and a clear checkerboard detection process in a video frame, so as to quickly detect a target image with a clear checkerboard, thereby improving the camera calibration efficiency.

[0063] like Figure 1 , which is an architecture diagram of a camera parameter calibration system disclosed in an embodiment of the present invention, including: a video acquisition end and a video processing end.

[0064] The video acquisition end is composed of a camera 1 and a controller AVM2, the video processing end is composed of a PC 3, and the controller AVM refers to (Around View Monitor, panoramic imaging system).

[0065] Specifically, the camera 1 is connected to the controller AVM2 , and the controller AVM2 is connected to the PC 3 .

[0066] A checkerboard is pre-set in the shooting range of the camera 1, such as Figure 2 The figure shows an example diagram of a checkerboard disclosed in an embodiment of the present invention.

[0067] It should be noted that a checkerboard is set in the shooting range of camera 1, and the picture taken by camera 1 includes the picture in the checkerboard area and the picture outside the checkerboard area, that is, the checkerboard does not completely cover the shooting range of camera 1.

[0068] In a specific implementation, camera 1 acquires a video stream and transmits the video stream to controller AVM2. Controller AVM2 packages the video stream into RTP data based on RTP (Real-time Transport Protocol), and then sends the RTP data to PC 3 based on UDP (User Datagram Protocol). PC 3 decodes the RTP data to obtain the video acquired by camera 1. PC 3 executes any camera parameter calibration method disclosed in the following embodiments of the present invention based on the video.

[0069] Based on the camera parameter calibration system disclosed in the above embodiment of the present invention, Figure 3 FIG. 1 is a flow chart of a camera parameter calibration method disclosed in an embodiment of the present invention. The calibration method is applied to a PC, the PC is connected to a controller AVM, the controller AVM is connected to a camera, and a checkerboard is pre-set in the shooting range of the camera. The method includes the following steps:

[0070] Step S101: receiving a video captured by a camera and sent by a controller AVM.

[0071] It should be noted that a checkerboard is set in the shooting range of the camera, and the picture taken by the camera includes the picture in the checkerboard area and the picture outside the checkerboard area, that is, the checkerboard does not completely cover the shooting range of the camera.

[0072] In the specific implementation process of step S101, the RTP data sent by the receiving controller AVM based on the User Datagram Protocol.

[0073] Among them, the RTP data is generated by the controller AVM based on the video collected by the camera and the real-time transport protocol package.

[0074] Based on the real-time transport protocol, the RTP data is decoded to obtain the video captured by the camera.

[0075] Step S102: Play the video.

[0076] In the specific implementation process of step S102, the video is played through an OpenGL (Open Graphics Library) window.

[0077] Among them, the open graphics library is used to render 2D and 3D vector graphics.

[0078] Specifically, the decoded video is rendered to an OpenGL texture and displayed.

[0079] Step S103: extract and store video frames from the video being played in real time at preset frame intervals until the video is played, and detect whether there is a chessboard with a definition that meets the requirements in the video frame. If not, execute step S104; if so, execute step S105.

[0080] In step S103, a multi-threaded approach is adopted. Specifically, video playback and extraction and storage of video frames are the main thread. During the execution of the main thread, a new thread running in parallel with the main thread is used to detect whether there is a checkerboard with clarity that meets the requirements in the video frame, thereby improving the efficiency of detection and further accelerating the efficiency of camera calibration.

[0081] It is understandable that, while extracting and storing the video frames, the video frames are detected in parallel to see if there are checkerboards with clarity that meets the requirements. When the video is finished playing, if there are video frames that have not been detected, the detection continues until all video frames are detected.

[0082] The preset frame number is preferably 25 frames. This is because the camera usually captures 25-30 frames of video. To ensure efficiency, it is usually reasonable to extract a video frame once every 1 second, that is, once every 25 frames.

[0083] It should be noted that detecting whether there is a checkerboard with a definition that meets the requirement in the video frame mainly involves detecting whether the boundary positions of the checkerboards in the checkerboard are clear, that is, detecting whether the corner points where the checkerboard boundaries meet are clear.

[0084] Specifically, detecting whether there is a checkerboard with a definition that meets the requirement in a video frame includes the following steps:

[0085] Step S201: extracting the area covered by the checkerboard from the video frame to obtain a picture to be detected.

[0086] It should be noted that since the checkerboard board does not completely cover the camera's shooting range, the video frame contains the checkerboard board area and the surrounding background. Although the clarity of the background will not affect the camera calibration, the pixel value of the background will affect the pixel value detection of the checkerboard board. In other words, the clarity of the background will affect the clarity detection of the checkerboard board. Therefore, it is necessary to extract the area covered by the checkerboard board, obtain the picture to be detected, and perform clarity detection on the picture to be detected separately.

[0087] In the specific implementation process of step S201, the boundary of the checkerboard in the video frame is calculated, and the area outside the boundary of the checkerboard in the video frame is masked to obtain a picture to be detected.

[0088] More specifically, the gradient information of pixels can effectively represent the boundaries of the checkerboard. Therefore, by calculating the gradient information of pixels in the video frame, the position where the gradient changes fastest is found to determine the coordinates of the boundaries of the checkerboard. Then, based on the boundary coordinates and the contour detection algorithm, the boundaries of the checkerboard are obtained.

[0089] Among them, the contour detection algorithm includes: findContours function in OpenCV, OpenCV is a cross-platform computer vision and machine learning software library released based on the Apache2.0 license (open source).

[0090] It should be noted that the mask processing is performed on the area outside the boundary of the checkerboard in the video frame, that is, the pixel values ​​of the area outside the boundary of the checkerboard in the video frame are set to 0.

[0091] like Figure 4 FIG. 1 is an example diagram of determining a checkerboard boundary disclosed in an embodiment of the present invention.

[0092] Assume that the positions where the gradient of the chessboard changes fastest are calculated as follows: the corner points corresponding to the lower right corners of blocks 1 and 5, and the corner points corresponding to the upper right corners of blocks 6 and 10.

[0093] Assume that the coordinates of the corner point position corresponding to the lower right corner of block 1 are (x1, y1), the coordinates of the corner point position corresponding to the lower right corner of block 5 are (x5, y5), the coordinates of the corner point position corresponding to the upper right corner of block 6 are (x6, y6), and the coordinates of the corner point position corresponding to the upper right corner of block 10 are (x10, y10). The pixels with pixel coordinates in the interval of [x1-5, x5+5], [x6-5, x10+5] and [y1-5, y6+5], [y5-5, y10+5] are retained. This interval is the picture to be detected.

[0094] The area outside this interval is masked by multiplying all pixel values ​​within the interval by 1 and all pixel values ​​outside the interval by 0, setting all pixel values ​​to 0. The above range of ±5 is to retain the pixel values ​​of a part of the area outside the boundary.

[0095] The blocks mentioned above are the checkerboards in the checkerboard.

[0096] Step S202: Establishing a rectangular coordinate system based on the image to be detected.

[0097] In step S202, the image to be detected is a rectangle, and the intersection of the lower left corner of the image to be detected can be used as the origin. The direction of the X axis is the width of the image to be detected, and the direction of the Y axis is the height of the image to be detected.

[0098] Step S203: respectively calculating the gradient standard deviation of the image to be detected in the X-axis direction and the gradient standard deviation of the Y-axis direction in the rectangular coordinate system.

[0099] In the specific implementation process of step S203, the coordinates of the corner points in the image to be detected, that is, the intersection points between the checkerboards in the checkerboard, are extracted.

[0100] like Figure 5 FIG. 1 is a schematic diagram of a corner point disclosed in an embodiment of the present invention.

[0101] Among them, including chessboard 1 to 4, such as Figure 5 The intersection points of the chessboard grids 1 to 4 shown are the corner points.

[0102] Based on the coordinates of the corner points, the standard deviation of the gradient in the X-axis direction and the standard deviation of the gradient in the Y-axis direction of the image to be detected in the rectangular coordinate system are calculated using the following formula:

[0103] G(x,y)=dx(i,j)+dy(i,j)

[0104] Among them, x represents the direction of the horizontal axis, y represents the direction of the vertical axis, i is the horizontal coordinate, j is the vertical coordinate, G represents the gradient, and the gradient is a vector concept. The differentials on x and y are dx and dy respectively.

[0105] dx(i,j)=[I(i+1,j)-I(i-1,j)] / 2

[0106] dy(i,j)=[I(i,j+1)-I(i,j-1)] / 2

[0107] Among them, I represents a pixel.

[0108] mean_x=∑dx(i,j) / (m*n)

[0109] mean_y=∑dy(i,j) / (m*n)

[0110] Among them, mean_x and mean_y are the gradient means corresponding to the x and y directions respectively, m represents the width of the image to be detected, and n represents the height of the image to be detected.

[0111]

[0112] Among them, std_x and std_y are the gradient variances corresponding to the x and y directions respectively.

[0113] Finally, take the arithmetic square root of std_x and std_y to get the standard deviation of the gradient in the x and y directions.

[0114] Step S204: Calculate the sum of the gradient standard deviation in the X-axis direction and the gradient standard deviation in the Y-axis direction, and divide the sum by 2 to obtain the mean.

[0115] In step S204, the mean refers to an average value.

[0116] Step S205: If the mean value is greater than the threshold, it is determined that there is a checkerboard with a definition that meets the requirement in the video frame.

[0117] In step S205, after multiple rounds of testing, the threshold is set to 105, which is more reasonable.

[0118] The threshold value may also be calculated by std=(std_x+std_y) / 2, where std represents the threshold value.

[0119] Step S104: Determine that the video frame does not meet the camera calibration requirements, and delete the video frame.

[0120] Step S105: Determine that the video frame is a target image that meets the camera calibration requirements.

[0121] In one embodiment, after determining that the video frame is a target image that meets the camera calibration requirements, the target image is saved to a folder, the save path of the target image is obtained, and the save path is stored in an XML file. When a calibration instruction for the camera is received, the save path is obtained from the XML file, and the target image is found in the folder based on the save path. The camera is calibrated using the target image to obtain the camera parameters, so that the camera can be calibrated at an appropriate time according to needs.

[0122] Step S106: Calibrate the camera using the target image to obtain the parameters of the camera.

[0123] A camera parameter calibration method based on the above-mentioned embodiment of the present invention is applied to a PC, the PC is connected to a controller AVM, the controller AVM is connected to a camera, and a checkerboard is pre-set in the shooting range of the camera. The method includes: receiving a video captured by the camera and sent by the controller AVM, playing the video, extracting and storing video frames from the video being played in real time every preset number of frames until the video is finished playing, and detecting in parallel whether there is a checkerboard with a clarity that meets the requirements in the video frame. If so, the video frame is determined to be a target image that meets the camera calibration requirements, and the target image is used to calibrate the camera to obtain the camera parameters. In this solution, a PC is used to process the video frame extraction process and the clear checkerboard detection process in the video frame in parallel to achieve the purpose of quickly detecting the target image with a clear checkerboard, thereby improving the camera calibration efficiency.

[0124] Based on the camera parameter calibration method disclosed in the above embodiment of the present invention, Figure 6 FIG. 1 is a structural diagram of a camera parameter calibration device disclosed in an embodiment of the present invention. The device is applied to a PC, the PC is connected to a controller AVM, the controller AVM is connected to a camera, a checkerboard is pre-set in the shooting range of the camera, and the device includes:

[0125] The receiving unit 601 is used to receive the video collected by the camera and sent by the controller AVM.

[0126] In one embodiment, the receiving unit 601 is specifically configured to:

[0127] The receiving controller AVM sends RTP data based on the user datagram protocol; the RTP data is generated by the controller AVM based on the video collected by the camera and the real-time transport protocol.

[0128] Based on the real-time transport protocol, decode the RTP data to obtain the video captured by the camera.

[0129] The playback unit 602 is used to play the video.

[0130] The parallel processing unit 603 is used to extract and store video frames from the video being played in real time every preset number of frames until the video is finished playing, and to detect in parallel whether there is a checkerboard with a definition that meets the requirements in the video frame.

[0131] In one embodiment, the parallel processing unit 603 includes:

[0132] The first parallel sub-unit is used to extract and store video frames from the video being played in real time every preset number of frames until the video is finished playing;

[0133] The second parallel sub-unit is used to extract the area covered by the checkerboard from the video frame to obtain the picture to be detected, establish a rectangular coordinate system based on the picture to be detected, calculate the gradient standard deviation of the picture to be detected in the X-axis direction and the gradient standard deviation of the Y-axis direction in the rectangular coordinate system, calculate the sum of the gradient standard deviation in the X-axis direction and the gradient standard deviation in the Y-axis direction, and divide the sum by 2 to obtain a mean. If the mean is greater than a threshold, it is determined that there is a checkerboard with clarity that meets the requirements in the video frame.

[0134] In one embodiment, the second parallel subunit for extracting the area covered by the checkerboard from the video frame to obtain the image to be detected is specifically used for:

[0135] Calculate the boundaries of the checkerboard in the video frame.

[0136] The area outside the border of the checkerboard in the video frame is masked to obtain the image to be detected.

[0137] The determination unit 604 is configured to determine that the video frame is a target image that meets the camera calibration requirement when there is a checkerboard whose definition meets the requirement in the video frame.

[0138] The calibration unit 605 is used to calibrate the camera using the target image to obtain the parameters of the camera.

[0139] In one embodiment, the device further comprises:

[0140] The saving unit is used to save the target image to a folder after determining that the video frame is a target image that meets the camera calibration requirements, and obtain a saving path for the target image.

[0141] Stores the save path to an XML file.

[0142] When receiving the calibration instruction for the camera, the save path is obtained from the XML file, and the target image is found in the folder based on the save path.

[0143] Use the target image to calibrate the camera and obtain the camera parameters.

[0144] A camera parameter calibration device based on the above-mentioned embodiment of the present invention is applied to a PC, the PC is connected to a controller AVM, the controller AVM is connected to a camera, a checkerboard is pre-set in the shooting range of the camera, and the method includes: receiving a video captured by the camera and sent by the controller AVM, playing the video, extracting and storing video frames from the video being played in real time every preset number of frames until the video is finished playing, and detecting in parallel whether there is a checkerboard with a clarity that meets the requirements in the video frame, and if so, determining that the video frame is a target image that meets the camera calibration requirements, calibrating the camera using the target image, and obtaining the camera parameters. In this solution, a PC is used to process the video frame extraction process and the clear checkerboard detection process in the video frame in parallel, so as to achieve the purpose of quickly detecting the target image with a clear checkerboard, thereby improving the camera calibration efficiency.

[0145] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0146] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0147] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A camera parameter calibration method, characterized in that: Applied to a PC, the PC is connected to a controller AVM, the controller AVM is connected to a camera, a checkerboard is pre-set in the shooting range of the camera, and the method includes: Receiving the video collected by the camera and sent by the controller AVM; Playing the video; Extracting and storing video frames from the video being played in real time at preset frame intervals until the video is finished playing, and detecting in parallel whether there is a checkerboard with a definition that meets the requirement in the video frame; If so, determining that the video frame is a target image that meets the camera calibration requirements; The camera is calibrated using the target image to obtain parameters of the camera.

2. The method according to claim 1, characterized in that The receiving the video collected by the camera and sent by the controller AVM comprises: Receiving RTP data sent by the controller AVM based on the user datagram protocol; the RTP data is generated by the controller AVM based on the video collected by the camera and the real-time transport protocol package; Based on the real-time transport protocol, the RTP data is decoded to obtain the video captured by the camera.

3. The method according to claim 1, characterized in that The detecting whether there is a checkerboard with a definition meeting the requirement in the video frame comprises: Extracting the area covered by the checkerboard from the video frame to obtain a picture to be detected; Establishing a rectangular coordinate system based on the image to be detected; Calculate the standard deviation of the gradient of the image to be detected in the X-axis direction and the standard deviation of the gradient of the image to be detected in the rectangular coordinate system; Calculate the sum of the gradient standard deviation in the X-axis direction and the gradient standard deviation in the Y-axis direction, and divide the sum by 2 to obtain the mean; If the mean value is greater than a threshold value, it is determined that the checkerboard having a definition that meets the requirement exists in the video frame.

4. The method according to claim 3, characterized in that The step of extracting the area covered by the checkerboard from the video frame to obtain a picture to be detected includes: Calculate and obtain the boundary of the checkerboard in the video frame; Mask processing is performed on the area outside the boundary of the checkerboard in the video frame to obtain a picture to be detected.

5. The method according to any one of claims 1 to 4, characterized in that: After determining that the video frame is a target image that meets the camera calibration requirements, the method further includes: Save the target image to a folder to obtain the save path of the target image; Storing the save path in an XML file; When receiving a calibration instruction for the camera, obtaining the save path from the XML file, and searching for the target image from the folder based on the save path; The camera is calibrated using the target image to obtain parameters of the camera.

6. A camera parameter calibration device, characterized in that: Applied to a PC, the PC is connected to a controller AVM, the controller AVM is connected to a camera, a checkerboard is pre-set in the shooting range of the camera, and the device includes: A receiving unit, used for receiving the video collected by the camera and sent by the controller AVM; A playback unit, used for playing the video; A parallel processing unit is used to extract and store video frames from the video being played in real time at preset frame intervals until the video is finished playing, and to detect in parallel whether there is a checkerboard with a definition that meets the requirement in the video frame; A determination unit, configured to determine that the video frame is a target image that meets the camera calibration requirements when there is a checkerboard whose clarity meets the requirements in the video frame; A calibration unit is used to calibrate the camera using the target image to obtain parameters of the camera.

7. The device according to claim 6, characterized in that The receiving unit is specifically used for: Receiving RTP data sent by the controller AVM based on the user datagram protocol; the RTP data is generated by the controller AVM based on the video collected by the camera and the real-time transport protocol package; Based on the real-time transport protocol, the RTP data is decoded to obtain the video captured by the camera.

8. The device according to claim 6, characterized in that The parallel processing unit comprises: A first parallel subunit is used to extract and store video frames from the video being played in real time every preset number of frames until the video is finished playing; The second parallel sub-unit is used to extract the area covered by the checkerboard from the video frame to obtain the picture to be detected; establish a rectangular coordinate system based on the picture to be detected; respectively calculate the gradient standard deviation of the picture to be detected in the X-axis direction and the gradient standard deviation of the Y-axis direction in the rectangular coordinate system; calculate the sum of the gradient standard deviation in the X-axis direction and the gradient standard deviation in the Y-axis direction, and divide the sum by 2 to obtain a mean; if the mean is greater than a threshold, it is determined that the checkerboard with clarity that meets the requirements exists in the video frame.

9. The device according to claim 6, characterized in that The second parallel subunit is used to extract the area covered by the checkerboard from the video frame to obtain the picture to be detected, specifically used to: Calculate and obtain the boundary of the checkerboard in the video frame; Mask processing is performed on the area outside the boundary of the checkerboard in the video frame to obtain a picture to be detected.

10. The device according to any one of claims 6 to 9, characterized in that: The device also includes: A saving unit, configured to save the target image to a folder after determining that the video frame is a target image that meets the camera calibration requirements, and obtain a saving path for the target image; Storing the save path in an XML file; When receiving a calibration instruction for the camera, obtaining the save path from the XML file, and searching for the target image from the folder based on the save path; The camera is calibrated using the target image to obtain parameters of the camera.

Citation Information

Patent Citations

  • Telephoto camera calibration method based on polynomial projection model

    CN102622744A

  • Computer-implemented method of calibrating a camera

    CN107545588A

  • Image definition detection method, device, storage medium and electronic device

    CN108074237A

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN110717942A

  • Vehicle-mounted camera calibration system and method based on video injection

    CN117036507A

Cited By

  • Contourgraph adjusting method, equipment and medium

    CN120426902A