Camera correction method and device and storage medium

By detecting the number of identified points of cross-crossing points in the grid image captured by the camera, outputting abnormal information and adjusting according to the user, replenishing points or deleting points, the problem of low camera correction accuracy in the prior art is solved, and higher corrections are achieved Accuracy and efficiency.

CN119068061APending Publication Date: 2024-12-03SHENZHEN RUIDA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411122710.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Existing camera correction methods rely on manual identification of grid intersections, resulting in inefficiency and prone to errors, and low camera correction accuracy.

Method used

By detecting the number of identified points at cross-crossing points in the grid image captured by the camera, if the number of identified points is inconsistent with the theoretical number, abnormal information will be output and the user will be prompted to adjust. After the user enters the adjustment operation, fill or delete points and performs camera correction.

Benefits of technology

It improves the accuracy of camera correction, reduces errors caused by human factors, and improves correction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068061A_ABST
    Figure CN119068061A_ABST
Patent Text Reader

Abstract

The invention discloses a camera correction method and device and a storage medium, and relates to the technical field of digital imaging, and the method comprises the steps: detecting the number of recognition points of cross points in a grid image shot by a camera; if the identification point number is not consistent with the theoretical point number, abnormal information is output, and the abnormal information comprises the abnormal position of the cross point, so that a user is prompted to execute adjustment operation; according to the method and the device, the cross-shaped cross points at the abnormal positions are calibrated in the grid image, point supplement and / or point deletion are / is performed on the cross-shaped cross points at the abnormal positions based on the adjustment operation input by the user, and camera correction is performed based on the adjusted cross-shaped cross points, so that the accuracy of camera correction is improved by calibrating the cross-shaped cross points in the grid image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital imaging technology, and in particular to a camera calibration method, device and storage medium. Background Art

[0002] In the field of image processing and machine vision, accurate calibration of the camera is crucial. Before calibrating the camera, it is necessary to obtain parameters through calibration to achieve camera calibration. Currently, camera calibration is generally performed by photographing a standard film grid identification plate, but the calibration process usually relies on manual identification of grid intersections, which is not only inefficient, but also prone to errors in camera calibration due to human factors.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The present application provides a camera calibration method, device and storage medium, aiming to solve the problem of low camera calibration accuracy in related solutions.

[0005] To achieve the above object, the present application provides a camera calibration method, which comprises the following steps:

[0006] Detect the number of identification points of the cross intersections in the grid image captured by the camera;

[0007] If the number of identified points is inconsistent with the theoretical number of points, an abnormality message is output, wherein the abnormality message includes an abnormal position of the cross point, so as to prompt the user to perform an adjustment operation;

[0008] Based on the adjustment operation input by the user, the cross points at the abnormal position are supplemented and / or deleted, and the camera is calibrated based on the adjusted cross points.

[0009] In one embodiment, before the step of detecting the number of identification points of the cross intersections of the grid interface, the method further includes:

[0010] Outputting an image correction interface, the image correction interface comprising a grid display box, a prompt information display box and a correction control, the grid display box is used to display the grid image, and the prompt information display box is used to display the abnormal information;

[0011] When the correction control is triggered, the operation of performing camera correction based on the adjusted cross point is executed.

[0012] In one embodiment, if the recognition points are inconsistent with the theoretical points, the step of outputting abnormal information includes:

[0013] If the theoretical points are inconsistent with the identification points, the missing points or excess points are determined according to the size of the theoretical points and the identification points;

[0014] The abnormal information of the missing points or the excess points is displayed in the prompt information display box.

[0015] In one embodiment, the step of adding and / or deleting points at the cross intersections of the abnormal positions based on the adjustment operation input by the user includes:

[0016] When the abnormal information is missing points, obtaining a first point position selected by the user based on the grid display frame, and marking the first point position in the grid image;

[0017] When the abnormal information is excess points, a second point position selected by the user based on the grid display frame is obtained, and the second point position is deleted from the grid image.

[0018] In one embodiment, before the step of detecting the number of identification points of the cross intersections in the grid image, the method further includes:

[0019] Outputting an advanced setting interface, wherein the advanced setting interface includes a detection rate input box, a line length filter input box, and a line width filter input box;

[0020] In response to the selection operation of the detection rate input box, the line length screening input box and the line width screening input box, the input detection rate, line length screening value and line width screening value are obtained;

[0021] Cross-intersection points in the grid image are identified based on the detection rate, the line length filter value, and the line width filter value.

[0022] In one embodiment, after the step of performing camera calibration based on the adjusted cross point, the method further includes:

[0023] Acquire the grid image;

[0024] Determine pixel coordinates and corresponding world coordinates according to the positions of the cross points in the grid image;

[0025] Calculating the internal parameters and distortion coefficients of the camera based on the pixel coordinates and the corresponding world coordinates and based on a preset algorithm;

[0026] The camera is calibrated based on the internal parameters and the distortion coefficients.

[0027] In one embodiment, the step of calibrating the camera based on the internal parameters and the distortion coefficients includes:

[0028] Constructing an internal parameter matrix according to the internal parameters, wherein the internal parameter matrix includes a focal length and a principal point position;

[0029] The grid image is corrected according to the internal parameter matrix and the distortion coefficient, and when the grid image meets the preset requirements, the internal parameters are applied to the camera.

[0030] In one embodiment, after the step of performing camera calibration based on the adjusted cross point, the method further includes:

[0031] Obtain the target image and the initial image taken by the calibrated camera;

[0032] Inputting the target image and the initial image into a preset evaluation model to obtain an evaluation result;

[0033] When the evaluation result is that the imaging quality is improved, a prompt message indicating that the correction is completed is fed back.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a camera calibration device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the camera calibration method as described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the camera calibration method as described above are implemented.

[0036] The present application provides a camera calibration method, a camera calibration device and a storage medium. The method detects the number of identification points of cross intersections in a grid image taken by a camera. If the number of identification points is inconsistent with the theoretical number of points, abnormal information is output. The abnormal information includes the abnormal position of the cross intersection to prompt the user to perform an adjustment operation. Finally, based on the adjustment operation input by the user, the cross intersection at the abnormal position is supplemented or deleted, and camera calibration is performed based on the adjusted cross intersection, thereby improving the accuracy of camera calibration. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 This is a schematic diagram of the flow chart of the first embodiment of the camera calibration method of the present application;

[0040] Figure 2 This is a schematic diagram of the image correction interface involved in the embodiment of the present application;

[0041] Figure 3 This is a schematic diagram of the flow chart of the second embodiment of the camera calibration method of the present application;

[0042] Figure 4 This is a schematic diagram of the advanced settings interface involved in the embodiment of the present application;

[0043] Figure 5 This is a schematic flow chart of a third embodiment of the camera calibration method of the present application;

[0044] Figure 6 A schematic diagram of the architecture of the hardware operating environment of the camera calibration device involved in an embodiment of the present application.

[0045] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] In order to better understand the above technical solution, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0048] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0049] The main solution of the present application is: to detect the number of identification points of the cross intersections in the grid image taken by the camera; if the number of identification points is inconsistent with the theoretical number of points, output abnormal information, and the abnormal information includes the abnormal position of the cross intersections to prompt the user to perform adjustment operations; based on the adjustment operations input by the user, add points and / or delete points of the cross intersections in the abnormal positions, and perform camera calibration based on the adjusted cross intersections.

[0050] Currently, camera calibration is generally performed by photographing a standard film grid identification plate. However, the calibration process usually relies on manual identification of grid intersections, which is not only inefficient but also prone to errors in camera calibration due to human factors.

[0051] The present application detects the number of identification points of cross intersections in a grid image taken by a camera. If the number of identification points is inconsistent with the theoretical number of points, abnormal information is output, and the abnormal information includes the abnormal position of the cross intersection to prompt the user to perform an adjustment operation. Finally, based on the adjustment operation input by the user, the cross intersection at the abnormal position is supplemented or deleted, and camera calibration is performed based on the adjusted cross intersection, thereby improving the accuracy of camera calibration.

[0052] Embodiment 1

[0053] Please refer to Figure 1 In a first embodiment, the camera calibration method comprises the following steps:

[0054] Step S10: Detect the number of identification points of the cross intersections in the grid image captured by the camera.

[0055] In this embodiment, the processing action is performed by the camera calibration system. First, a clean white A4 paper is placed within the field of view of the camera, and a standard film grid calibration plate is laid flat on the surface of the A4 paper, wherein the standard film grid calibration plate has a precise grid, and the default spacing between the grids is 5mm. Then the camera takes a picture of the standard film grid calibration plate, and uploads this picture as a grid image to the camera calibration system. After receiving the grid image, the camera calibration system detects the number of identification points of the cross intersections of each grid in the grid image.

[0056] As an optional implementation method for detecting the number of recognition points of cross intersections in a grid image, the color image is first converted into a grayscale image, and the image is converted into a black and white image using threshold segmentation to reduce computational complexity and more easily identify lines and intersections. Then, an edge detection algorithm is used to find the lines in the image, and the Hough line detection method is used to find the line segments in the image. Finally, based on the detected line segments, the intersection of two line segments is found, and which intersections are true intersections are determined based on a certain tolerance range, and the number of these intersections is determined as the number of recognition points of cross intersections in the grid image.

[0057] Optionally, in this embodiment, before step S10, the following steps are further included:

[0058] An image correction interface is output, wherein the image correction interface includes a grid display box, a prompt information display box, and a correction control, wherein the grid display box is used to display the grid image, and the prompt information display box is used to display the abnormal information; when the correction control is triggered, the operation of performing camera correction based on the adjusted cross intersection point is executed.

[0059] Specifically, the front end of the camera correction system includes an image correction interface, wherein the image correction interface includes a grid display box, a prompt information display box, and a correction control. Figure 2 As shown, Figure 2 Schematic diagram of the image correction interface involved in the embodiment of the present application. The grid display frame is used to display the grid image so that the image correction system can detect the cross intersection in the grid image. The prompt information display frame is as follows: Figure 2 As shown, it is used to display abnormal information or normal prompt information. The correction control is associated with a camera correction instruction. When the correction control is triggered, that is, the camera correction instruction is triggered, the camera correction system automatically performs the camera correction operation.

[0060] Step S20: If the number of identified points is inconsistent with the theoretical number of points, abnormal information is output, and the abnormal information includes an abnormal position of the cross point to prompt the user to perform an adjustment operation.

[0061] In this embodiment, the theoretical number of points is a preset number of points, which conforms to all the points of the basic model of lens imaging. By comparing the number of identified points with the theoretical number of points, it is determined whether the number of points of the two is consistent, and then whether the number of identified points is wrong. It can also be compared with a preset calibration plate, wherein the positions of all theoretical points are marked in the preset calibration plate. By comparing the preset calibration plate with the grid image, the efficiency of comparing the theoretical points with the number of identified points can be improved. When the number of identified points is inconsistent with the theoretical number of points, the position information of the excess or missing points is determined by comparison, and abnormal information is output, wherein the abnormal information includes the abnormal position of the cross point, and then the user is prompted to adjust the grid image according to the output abnormal information; when the number of identified points is consistent with the theoretical number of points, normal information is output.

[0062] Optionally, in this embodiment, if the recognition points are inconsistent with the theoretical points, the step of outputting abnormal information includes:

[0063] If the theoretical points are inconsistent with the identification points, the missing points or excess points are determined according to the size of the theoretical points and the identification points; and the abnormal information of the missing points or the excess points is displayed in the prompt information display box.

[0064] Specifically, the number of recognition points can be less than or more than the theoretical points. When the recognition points are less than the theoretical points, the specific number of missing points is determined and determined as missing points; when the recognition points are more than the theoretical points, the redundant recognition points are determined and determined as excess points. The specific number of missing points or excess points is then displayed in the prompt information display box.

[0065] Step S30: Based on the adjustment operation input by the user, the cross intersection points at the abnormal position are supplemented and / or deleted, and the camera is calibrated based on the adjusted cross intersection points.

[0066] In this embodiment, the user adjusts the grid image of the grid display frame in the image correction interface according to the abnormal information displayed in the prompt information display frame. When the front end detects the user's adjustment operation, it feeds back the adjustment operation to the back end of the camera correction system, and the back end supplements and / or deletes the cross points of the abnormal position based on the adjustment operation, wherein the adjustment operation includes adding cross points in the grid image, which corresponds to a point supplement operation, or deleting cross points in the grid image, which corresponds to a point deletion operation. After the adjustment of the cross points is completed, the camera calibration is performed according to the cross points.

[0067] Optionally, in this embodiment, the step of supplementing and / or deleting the cross points at the abnormal position based on the adjustment operation input by the user includes:

[0068] When the abnormal information is missing points, the first point selected by the user based on the grid display box is obtained, and the first point is calibrated in the grid image; when the abnormal information is excess points, the second point selected by the user based on the grid display box is obtained, and the second point is deleted in the grid image.

[0069] Specifically, when the prompt information display box in the image correction interface displays the number of missing points, wherein the missing points include the specific number of missing points, the user can use a selection device connected to the terminal device, optionally, the selection device can be a mouse, or a touch screen, and the user completes the corresponding operation by clicking the touch screen. When the user double-clicks in the grid display box based on the selection device, the front end detects the specific position of the first point double-clicked by the user, and calibrates the first point as an identification point in the grid image. When the prompt information display box in the image correction interface displays the number of excess points, the user can click on the second point to be deleted in the grid display box based on the selection device, and when the front end detects the second point clicked by the user, the calibration of the cross point corresponding to the second point is deleted in the grid image.

[0070] In addition, when there is no abnormal information in the grid image, that is, the theoretical number of points is consistent with the recognition point number, the grid image can be re-detected and the recognition point number can be compared with the theoretical point number to complete the removal of abnormal points in the grid image, thereby realizing iterative calibration of the grid image.

[0071] In the technical solution provided in this embodiment, by detecting the number of identification points of the cross intersections in the grid image taken by the camera, if the number of identification points is inconsistent with the theoretical number of points, abnormal information is output, and the abnormal information includes the abnormal position of the cross intersection to prompt the user to perform an adjustment operation. Finally, based on the adjustment operation input by the user, the cross intersections at the abnormal position are supplemented or deleted, and the camera calibration is performed based on the adjusted cross intersections, thereby improving the accuracy of camera calibration.

[0072] Embodiment 2

[0073] Please refer to Figure 3 In the second embodiment, before step S10, the following steps are also included:

[0074] Step S40: outputting an advanced setting interface, wherein the advanced setting interface includes a detection rate input box, a line length filter input box, and a line width filter input box.

[0075] Step S50: In response to the selection operation of the detection rate input box, the line length filter input box, and the line width filter input box, the input detection rate, line length filter value, and line width filter value are obtained.

[0076] In this embodiment, if Figure 4 As shown, Figure 4 This is a schematic diagram of the advanced settings interface involved in the embodiment of the present application. Figure 4 In the advanced setting interface, the advanced setting interface includes a detection rate input box, a line length filter input box, and a line width filter input box. The user can input the detection rate in the detection rate input box, input the line length filter value in the line length filter input box, and input the line width filter value in the line width filter input box. When the user inputs a value in the advanced setting interface, or the user selects a preset value in the detection rate input box, the line length filter input box, and the line width filter input box based on the selection device, the front end feeds back the received value or the selected value to the back end, so that the camera correction system obtains the detection rate, the line length filter value, and the line width filter value.

[0077] Specifically, the detection rate refers to the probability or proportion of the algorithm detecting lines during the image processing process. A higher detection rate indicates that the algorithm tends to detect more lines. The purpose of setting the detection rate is to adjust the detection rate to balance the relationship between false detection and missed detection. A lower detection rate may miss some real lines, while a too high detection rate may lead to false detection, that is, mistaking noise or other non-line features for grid lines. The line length filtering value is a method for filtering out lines that do not meet a specific length range. By setting the minimum and maximum length thresholds, lines that are too short or too long can be excluded. These lines are often not part of the grid lines. The purpose is to remove noise lines in the image through line length filtering to ensure that only truly meaningful lines are detected. The line width filtering value refers to excluding lines whose widths do not meet expectations by setting the width range of the lines. This can further improve the detection accuracy and ensure that only lines whose widths match the grid lines are detected.

[0078] Step S60: identifying cross points in the grid image according to the detection rate, the line length screening value, and the line width screening value.

[0079] In this embodiment, after the user inputs the detection rate, the line length filtering value, and the line width filtering value based on the detection rate input box, the line length filtering input box, and the line width filtering input box, the front end of the advanced setting interface will feed back the above data to the back end of the camera correction system. The back end uses the Hough line detection method to find the line segments in the image, and adjusts the threshold of the Hough transform, that is, the detection rate, to control the number of detected line segments. A lower threshold will detect more line segments, but may introduce more noise; a higher threshold may cause some real line segments to be missed. Then, according to the line length filtering value, a minimum length threshold is set to exclude those line segments that are too short; and according to the line width filtering value, the pixel values ​​around the line segment are analyzed to estimate the width of the line, and those line segments that are too thin are excluded based on this width. Then, the recognition of the cross intersection in the grid image is completed.

[0080] In the technical solution provided in this embodiment, an advanced setting interface is output, wherein the advanced setting interface includes a detection rate input box, a line length filtering input box, and a line width filtering input box, and then in response to the selection operation of the detection rate input box, the line length filtering input box, and the line width filtering input box, the input detection rate, line length filtering value, and line width filtering value are obtained, and finally, according to the detection rate, the line length filtering value, and the line width filtering value, the cross intersections in the grid image are identified. This embodiment improves the accuracy of cross intersection recognition by setting the detection rate, the line length filtering value, and the line width filtering value.

[0081] Embodiment 3

[0082] Please refer to Figure 5 In a third embodiment, the step of performing camera calibration based on the adjusted cross point includes:

[0083] Step S70: Acquire the grid image.

[0084] Step S80: Determine pixel coordinates and corresponding world coordinates according to the positions of the cross points in the grid image.

[0085] In this embodiment, a correction control is provided in the image correction interface of the front end. When the user completes filling and / or deleting points, the correction control in the image correction interface is triggered by a selection device. The back end of the camera correction system detects that the correction control is triggered and obtains a calibrated grid image. Then, according to the calibrated cross points of the grid image, the cross points in the grid image are detected and the positions of the cross points are determined, and then the pixel coordinates and the corresponding world coordinates of the cross points in the grid image are determined, where the pixel coordinates are in pixels, for example (x, y), where x and y are the horizontal and vertical positions in the image. In addition, before determining the world coordinates, the pixel coordinates are converted to world coordinates.

[0086] Specifically, to convert pixel coordinates to world coordinates, you need to determine the image resolution, the actual size of the image, usually in pixels, and the actual size of the grid in the real world, which can be meters, centimeters, etc. Then choose a reference point in reality as the origin, and the pixel coordinates of that point in the image. If the actual size of the grid is known, you can determine the conversion relationship from pixels to actual units by calculating the scale. Finally, you can choose the intersection point in the lower left corner of the grid as the origin, whose pixel coordinates in the image are (x0, y0). By converting the pixel coordinates to world coordinates, for each cross intersection (x, y) in the image, convert it to world coordinates (X, Y) in the following way:

[0087] X=(x-x0)*scale

[0088] Y=(y-y0)*scale

[0089] Where x0 and y0 are the pixel coordinates of the origin in the image, and scale is the scale calculated previously.

[0090] Step S90: Calculating the internal parameters and distortion coefficients of the camera according to the pixel coordinates and the corresponding world coordinates based on a preset algorithm.

[0091] In this embodiment, by determining the position of each corner point of each cross intersection in the grid image in the world coordinate system, and the cross intersections are located in a plane, the distance between the cross intersections is known. A series of linear equations can be constructed based on the pixel coordinates of the cross intersections in the grid image and the corresponding world coordinates. These linear equations are solved by the least squares method to obtain the internal parameters of the camera, including focal length, principal point position, etc. At the same time, the distortion parameters of the camera, including radial distortion and tangential distortion, are calculated by the least squares method.

[0092] For example, assuming that the acquired grid image contains the cross points of the grid image, the internal parameter matrix of the camera can be obtained through the camera projection model, and the formula is as follows:

[0093]

[0094] Where K is the camera's intrinsic parameter matrix, fx and fy are the focal lengths along the x and y directions, cx and cy are the positions of the principal points, and s is the slope of the pixel (for most modern cameras, s=0). The camera's projection model can be expressed by the formula: p=K[R|t]X, where p is the coordinate of the corner point in the normalized coordinate system, K is the camera's intrinsic parameter matrix, R is the rotation matrix, which represents the rotation from the world coordinate system to the camera coordinate system, t is the translation vector, which represents the translation from the world coordinate system to the camera coordinate system, and X is the coordinate of the corner point in the world coordinate system. Then, in order to solve the intrinsic parameter matrix, p and X are expressed as homogeneous coordinates and converted into two linear equations, so that a linear system of equations can be constructed based on the linear equations, and then the unknown coefficients in the linear system of equations are solved by the least squares method, and the values ​​of each parameter in the intrinsic parameter matrix are obtained.

[0095] Step S100: Calibrate the camera based on the internal parameters and the distortion coefficients.

[0096] In this embodiment, after the internal parameters and distortion coefficients are determined, two mapping tables are constructed based on the internal parameter matrix K and the distortion coefficients and based on a preset function, which are used to map the images in the horizontal and vertical directions respectively. Then, the grid image is mapped based on the two mapping tables, and the corrected image is output through a preset function, and finally, the internal parameters of the camera are modified according to the calculated internal parameters.

[0097] Optionally, in this embodiment, step S90 includes:

[0098] An internal parameter matrix is ​​constructed according to the internal parameters, wherein the internal parameter matrix includes a focal length and a principal point position; the grid image is corrected according to the internal parameter matrix and the distortion coefficient, and when the grid image meets preset requirements, the internal parameters are applied to the camera.

[0099] Specifically, the internal parameter matrix includes the focal length and the principal point position, and the distortion coefficient includes the radial distortion coefficient and the tangential distortion coefficient, and then the grid image captured by the camera is obtained based on the internal parameter matrix and the distortion coefficient. After the grid image correction is completed, the grid image is detected based on a preset function to see whether it complies, wherein the preset function detects whether there is an obvious brightness change in the corrected grid image, and whether geometric shapes such as straight lines and circles become straight and circular. By comparing the images before and after correction, it is determined whether the corrected grid image meets the above requirements. After the above requirements are met, the correction parameters are applied to the camera to complete the camera correction.

[0100] Furthermore, in this embodiment, after the step of performing camera calibration based on the adjusted cross point, the method further includes:

[0101] The target image and the initial image taken by the calibrated camera are obtained; the target image and the initial image are input into a preset evaluation model to obtain an evaluation result; when the evaluation result is that the imaging quality is improved, a prompt message indicating that the correction is completed is fed back.

[0102] Specifically, after the camera calibration is completed, the target image and the initial image taken by the calibrated camera are obtained, wherein the initial image is the image taken before the camera calibration. Then, the target image and the initial image are compared and evaluated by a preset evaluation model, wherein the preset evaluation model is provided with at least one evaluation index, such as mean square error, which is used to measure the degree of difference between the two images; peak signal-to-noise ratio, which is another index for evaluating image quality; and structural similarity index, which is an index for measuring the structural similarity of the two images. The initial image and the target image are compared by the above evaluation indexes, and it is judged whether the quality of the target image is improved relative to the initial image according to the evaluation results. If the evaluation result shows that the quality of the target image is better, it can be considered that the calibration process is successful, and a prompt message indicating that the calibration is completed is fed back to the front end. Otherwise, a prompt message indicating that there is an error in the calibration is fed back to the front end.

[0103] In the technical solution provided in this embodiment, the grid image is acquired, and the pixel coordinates and the corresponding world coordinates are determined according to the positions of the cross points in the grid image. Then, the internal parameters and distortion coefficients of the camera are calculated based on the pixel coordinates and the corresponding world coordinates and based on a preset algorithm. Finally, the camera is calibrated based on the internal parameters and the distortion coefficients. This embodiment corrects the image through a distortion correction method to complete the camera correction, thereby improving the efficiency of camera correction.

[0104] Since the system introduced in the embodiment of the present application is a system used to implement the method of the embodiment of the present application, based on the method introduced in the embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the system, so it is not repeated here. All systems used in the method of the embodiment of the present application belong to the scope of protection of this application.

[0105] The present application provides a camera calibration device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the camera calibration method in the above-mentioned embodiment 1.

[0106] Reference below Figure 6, which shows a schematic diagram of the structure of a camera calibration device suitable for implementing the embodiment of the present application. The camera calibration device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The camera calibration device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0107] like Figure 6 As shown, the camera calibration device may include a processing device 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the camera calibration device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the camera calibration device to communicate with other devices wirelessly or by wire to exchange data. Although the camera calibration device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0108] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0109] The camera calibration device provided by the present application adopts the camera calibration method in the above embodiment, which can solve the technical problem of low camera calibration accuracy in related solutions. Compared with the prior art, the beneficial effects of the camera calibration device provided by the present application are the same as the beneficial effects of the camera calibration method provided by the above embodiment, and the other technical features in the camera calibration device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0110] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0111] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0112] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the camera calibration method in the above-mentioned embodiment.

[0113] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0114] The computer-readable storage medium may be included in the camera calibration device; or may exist independently without being assembled into the camera calibration device.

[0115] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the camera calibration device, the camera calibration device: detects the number of identification points of the cross intersections in the grid image taken by the camera; if the number of identification points is inconsistent with the theoretical number of points, outputs abnormal information, and the abnormal information includes the abnormal position of the cross intersection to prompt the user to perform an adjustment operation; based on the adjustment operation input by the user, adds points and / or deletes points of the cross intersections at the abnormal position, and performs camera calibration based on the adjusted cross intersections.

[0116] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0117] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0118] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0119] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned camera calibration method, and can solve the technical problem of low camera calibration accuracy in related solutions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the camera calibration method provided in the above-mentioned embodiment, and will not be repeated here.

[0120] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the camera calibration method as described above when the computer program is executed by a processor.

[0121] The computer program product provided in this application can solve the technical problem of low camera calibration accuracy in related solutions. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the camera calibration method provided in the above embodiment, which will not be repeated here.

[0122] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A camera calibration method, characterized in that: The method comprises the following steps: Detect the number of identification points of the cross intersections in the grid image captured by the camera; If the number of identified points is inconsistent with the theoretical number of points, an abnormality message is output, wherein the abnormality message includes an abnormal position of the cross point, so as to prompt the user to perform an adjustment operation; Based on the adjustment operation input by the user, the cross points at the abnormal position are supplemented and / or deleted, and the camera is calibrated based on the adjusted cross points.

2. The method according to claim 1, characterized in that Before the step of detecting the number of identification points of the cross intersections of the grid interface, the method further includes: Outputting an image correction interface, the image correction interface comprising a grid display box, a prompt information display box and a correction control, the grid display box is used to display the grid image, and the prompt information display box is used to display the abnormal information; When the correction control is triggered, the operation of performing camera correction based on the adjusted cross point is executed.

3. The method according to claim 2, characterized in that If the recognition points are inconsistent with the theoretical points, the step of outputting abnormal information comprises: If the theoretical points are inconsistent with the identification points, the missing points or excess points are determined according to the size of the theoretical points and the identification points; The abnormal information of the missing points or the excess points is displayed in the prompt information display box.

4. The method according to claim 3, characterized in that The step of supplementing and / or deleting the cross points at the abnormal position based on the adjustment operation input by the user includes: When the abnormal information is missing points, obtaining a first point position selected by the user based on the grid display frame, and marking the first point position in the grid image; When the abnormal information is excess points, a second point position selected by the user based on the grid display frame is obtained, and the second point position is deleted from the grid image.

5. The method according to claim 1, characterized in that Before the step of detecting the number of identification points of the cross intersections in the grid image, the method further includes: Outputting an advanced setting interface, wherein the advanced setting interface includes a detection rate input box, a line length filter input box, and a line width filter input box; In response to the selection operation of the detection rate input box, the line length screening input box and the line width screening input box, the input detection rate, line length screening value and line width screening value are obtained; Cross-intersection points in the grid image are identified based on the detection rate, the line length filter value, and the line width filter value.

6. The method according to claim 1, characterized in that The step of performing camera calibration based on the adjusted cross point comprises: Acquire the grid image; Determine pixel coordinates and corresponding world coordinates according to the positions of the cross points in the grid image; Calculating the internal parameters and distortion coefficients of the camera based on the pixel coordinates and the corresponding world coordinates and based on a preset algorithm; The camera is calibrated based on the internal parameters and the distortion coefficients.

7. The method according to claim 6, characterized in that The step of calibrating the camera based on the internal parameters and the distortion coefficients comprises: Constructing an internal parameter matrix according to the internal parameters, wherein the internal parameter matrix includes a focal length and a principal point position; The grid image is corrected according to the internal parameter matrix and the distortion coefficient, and when the grid image meets the preset requirements, the internal parameters are applied to the camera.

8. The method according to claim 1, characterized in that After the step of performing camera calibration based on the adjusted cross point, the method further includes: Obtain the target image and the initial image taken by the calibrated camera; Inputting the target image and the initial image into a preset evaluation model to obtain an evaluation result; When the evaluation result is that the imaging quality is improved, a prompt message indicating that the correction is completed is fed back.

9. A camera calibration device, characterized in that: The camera calibration device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the camera calibration method according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the camera calibration method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • An improved checkerboard corner detection method

    CN109949373A

  • Calibration board corner detection method and device and computer storage medium

    CN114494279A

  • Speed detection method and electronic equipment

    CN116844102A

  • Corner point detection method, device, equipment and medium

    CN117474828A