A method and device for calibrating the rotation angle of a camera
By performing multi-angle shooting and image feature data extraction on the camera, calculating radial and tangential distortions, establishing an image quality detection model, and calibrating the camera rotation angle, the problem of traditional methods ignoring image distortion is solved, and image quality and calibration efficiency are improved.
Patent Information
- Application Number
- CN202410982660.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Traditional camera calibration methods ignore image distortion analysis, resulting in obvious deformation of images captured by the camera at different rotation angles, affecting the visual effect and geometric accuracy of the image and increasing measurement errors.
By fixing and connecting the camera to the control device, images are captured from multiple angles, image feature data is extracted for radial distortion and tangential distortion calculations, an image quality detection model is established, a comprehensive image quality index is calculated, and the rotation angle of the camera is calibrated based on the image quality judgment results.
It improves the geometric accuracy and visual effect of the image, reduces image quality problems caused by angle deviation, realizes automation and intelligence of the calibration process, improves work efficiency and reduces the risk of human error.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and more specifically to a method and device for calibrating the rotation angle of a camera. Background Art
[0002] With the rapid development of information technology, cameras, as important devices for obtaining information, have been widely used in various fields. Whether in the consumer market or industrial applications, the requirements for camera performance are constantly increasing. Therefore, calibrating the rotation angle of the camera has become a key link to ensure stable camera performance and excellent image quality. The advancement of image processing technology has provided strong support for calibrating the rotation angle of the camera. Through advanced image processing algorithms, the images taken by the camera can be accurately detected and analyzed, so as to calculate the rotation angle error of the camera and perform corresponding calibration. By accurately controlling the rotation mechanism of the camera, the precise adjustment of the camera rotation angle can be achieved.
[0003] However, image distortion is a common problem in the camera imaging process, which may be caused by a variety of factors, including errors in lens manufacturing and assembly, nonlinear characteristics of the optical system, etc. These distortions will cause the image to deform and affect the geometric accuracy and visual effect of the image. Traditional camera calibration methods ignore the analysis of image distortion during the calibration process. Therefore, the images captured by the camera at different rotation angles may have obvious deformations, affecting the visual effect and geometric accuracy of the image, resulting in increased measurement errors and affecting image quality. Summary of the invention
[0004] In order to overcome the above defects of the prior art, the present invention provides a method for calibrating the rotation angle of a camera to solve the problems existing in the above background technology.
[0005] The present invention provides the following technical solution: a method for calibrating the rotation angle of a camera, comprising the following steps:
[0006] Step S01: Fixing the camera and connecting it to a control device: Fixing the camera with a tripod and connecting the camera to a control device, wherein the control device is used to receive adjustment instructions to adjust the parameters of the camera;
[0007] Step S02: shooting images at multiple angles: select different viewing angles, and shoot i images by moving the camera up, down, left, and right to change the shooting angle, where i=1, 2, 3, ..., n;
[0008] Step S03: extracting feature data from the image in step S02: extracting feature data from the image in step S02 using computer vision processing technology, including radial distortion data and tangential distortion data;
[0009] Step S04: performing radial distortion calculation on the image feature data extracted in step S03: based on the extracted image feature data, the radial distortion coefficient of each image is calculated by using a radial distortion detection mathematical model;
[0010] Step S05: performing tangential distortion calculation on the image feature data extracted in step S03: calculating the tangential distortion coefficient of each image through the tangential distortion detection mathematical model based on the extracted image feature data;
[0011] Step S06: Establishing an image quality detection model and calculating a comprehensive image quality index: establishing an image quality detection model based on the radial distortion coefficient and the tangential distortion coefficient of each image and calculating a comprehensive image quality index;
[0012] Step S07: performing image quality judgment processing according to the comprehensive image quality index in step S06: comparing the comprehensive image quality index with a preset image quality threshold to judge whether the image quality is qualified;
[0013] Step S08: receiving the image quality judgment result in step S07 and calibrating the camera rotation angle: when the image quality judgment result is that the image is unqualified, the control device receives the adjustment instruction and calibrates the camera rotation angle.
[0014] Preferably, in step S01, the control device is a control panel used in the monitoring system, which communicates with the camera wirelessly, receives adjustment instructions, and sends the instructions to the camera to execute corresponding parameter adjustments.
[0015] Preferably, in step S03, feature data of the image in step S02 is extracted by computer vision processing technology, including radial distortion data and tangential distortion data, wherein the radial distortion data includes the image coordinates of the center point of the optical axis, the actual image coordinates and the distance from the actual image coordinates to the image coordinates of the center point of the optical axis, and the tangential distortion data includes the number of image coverage grids, the ideal image height corresponding to each grid point and the lens focal length of each image.
[0016] Preferably, in step S04, the specific steps of calculating the radial distortion coefficient of each image through the radial distortion detection mathematical model are as follows:
[0017] Step S11: Radial distortion takes the coordinates of the optical axis center point of each image as the reference point, and sets the image coordinates of the optical axis center point to (Δx i , Δy i ), the actual image coordinates are (x i ,y i ), the preset ideal image coordinates are
[0018] Step S12: Calculate the radial distortion coefficient of the horizontal coordinate of each image, and the calculation formula is: where α i1 Represents the radial distortion coefficient of each image, d i Indicates the distance from the actual image coordinates to the image coordinates of the center point of the optical axis;
[0019] Step S13: Calculate the longitudinal radial distortion coefficient of each image, and the calculation formula is: where α i2 Represents the radial distortion coefficient of the ordinate of each image;
[0020] Step S14: Calculate the radial distortion coefficient of each image according to step S11, step S12 and step S13, and the calculation formula is: Where Rd i Represents the radial distortion coefficient of each image.
[0021] Preferably, in step S05, the specific steps of calculating the tangential distortion coefficient of each image through the tangential distortion detection mathematical model are as follows:
[0022] Step S11: Gridding each image. The number of grids covered by each image is m, where m = 1, 2, 3, ..., k, and the ideal image height corresponding to each grid point is H im ;
[0023] Step S12: Calculate the field of view angle corresponding to the ideal image height of each grid point, and the calculation formula is: where β im represents the field of view angle corresponding to the ideal image height of each grid point, f i represents the focal length of the lens for each image;
[0024] Step S13: Calculate the tangential distortion coefficient of each image according to step S11 and step S12, and the calculation formula is: Among them, R i Represents the tangential distortion coefficient of each image.
[0025] Preferably, in step S06, an image quality detection model is established based on the radial distortion coefficient and the tangential distortion coefficient of each image, and the calculation formula of the comprehensive image quality index is calculated as follows: Where D represents the comprehensive image quality index, Rd i Represents the radial distortion coefficient of each image, Rl i Represents the tangential distortion coefficient of each image.
[0026] Preferably, in step S07, the comprehensive image quality index D is compared with a preset image quality threshold ΔD. If the comprehensive image quality index D is greater than the preset image quality threshold ΔD, the image quality judgment result is that the image is qualified. If the comprehensive image quality index D is less than or equal to the preset image quality threshold ΔD, the image quality judgment result is that the image is unqualified.
[0027] Preferably, in step S08, when the image quality judgment result is that the image is unqualified, an adjustment instruction is sent to the control device, the control device receives the adjustment instruction, and calibrates the camera rotation angle according to the adjustment instruction; when the image quality judgment result is that the image is qualified, the setting parameters are saved.
[0028] A device for calibrating the rotation angle of a camera, comprising an electronic device and a computer-readable storage medium;
[0029] The electronic device comprises a processor, a memory and a communication bus, wherein the memory stores a computer-readable program executable by the processor;
[0030] The communication bus realizes the connection and communication between the processor and the memory;
[0031] When the processor executes the computer readable program, the processor implements the steps in a method for calibrating the rotation angle of a camera;
[0032] The computer-readable storage medium stores one or more programs that can be executed by one or more processors.
[0033] Technical effects and advantages of the present invention:
[0034] The present invention is provided with step S01: fixing and connecting a camera to a control device, step S02: shooting images at multiple angles, step S03: extracting feature data of the image in step S02, step S04: performing radial distortion calculation on the image feature data extracted in step S03, step S05: performing tangential distortion calculation on the image feature data extracted in step S03, step S06: establishing an image quality detection model, and calculating a comprehensive image quality index, step S07: performing image quality judgment processing according to the comprehensive image quality index in step S06, step S08: receiving the image quality judgment result in step S07, and calibrating the rotation angle of the camera. In short, a method and device for calibrating the rotation angle of a camera are provided, which extract image feature data to perform radial distortion calculation and tangential distortion calculation, calibrate the rotation angle of the camera according to the distortion judgment result of the image, improve the geometric accuracy and visual effect of the image, and reduce the image quality problem caused by angle deviation by accurately controlling the rotation angle of the camera. The calibration process is automated and intelligent, further improving work efficiency and reducing the risk of human error. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The present invention is a flow chart of a method for calibrating the rotation angle of a camera. DETAILED DESCRIPTION
[0036] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. In addition, the forms of the various structures recorded in the following embodiments are merely illustrative. The method for calibrating the rotation angle of a camera involved in the present invention is not limited to the various structures recorded in the following embodiments. All other implementations obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0037] like Figure 1 As shown, the present invention provides a method for calibrating the rotation angle of a camera, comprising the following steps:
[0038] Step S01: Fixing the camera and connecting it to a control device: Fixing the camera with a tripod and connecting the camera to a control device, wherein the control device is used to receive adjustment instructions to adjust the parameters of the camera;
[0039] Step S02: shooting images at multiple angles: select different viewing angles, and shoot i images by moving the camera up, down, left, and right to change the shooting angle, where i=1, 2, 3, ..., n;
[0040] Step S03: extracting feature data from the image in step S02: extracting feature data from the image in step S02 using computer vision processing technology, including radial distortion data and tangential distortion data;
[0041] Step S04: performing radial distortion calculation on the image feature data extracted in step S03: based on the extracted image feature data, the radial distortion coefficient of each image is calculated by using a radial distortion detection mathematical model;
[0042] Step S05: performing tangential distortion calculation on the image feature data extracted in step S03: calculating the tangential distortion coefficient of each image through the tangential distortion detection mathematical model based on the extracted image feature data;
[0043] Step S06: Establishing an image quality detection model and calculating a comprehensive image quality index: establishing an image quality detection model based on the radial distortion coefficient and the tangential distortion coefficient of each image and calculating a comprehensive image quality index;
[0044] Step S07: performing image quality judgment processing according to the comprehensive image quality index in step S06: comparing the comprehensive image quality index with a preset image quality threshold to judge whether the image quality is qualified;
[0045] Step S08: receiving the image quality judgment result in step S07 and calibrating the camera rotation angle: when the image quality judgment result is that the image is unqualified, the control device receives the adjustment instruction and calibrates the camera rotation angle.
[0046] In this embodiment, it should be specifically explained that in step S01, the control device is a control panel used in the monitoring system, which communicates with the camera wirelessly, receives adjustment instructions, and sends the instructions to the camera to perform corresponding parameter adjustments. The adjusted parameters include:
[0047] Rotation angle: adjust the direction of the image to ensure flexibility in camera installation;
[0048] Exposure: Controls the light sensitivity of the camera and the brightness of the image. By adjusting the exposure time and exposure compensation, you can ensure the correct brightness level in different lighting conditions.
[0049] Focal length: Adjusting the focal length of the camera can change the image magnification ratio, switching from wide angle to telephoto, making it easier to capture distant details or a wider field of view;
[0050] White balance: adjusts the color of white objects in an image so that they appear white under different light sources, thus maintaining the natural color of the image;
[0051] Contrast: adjust the difference between the bright and dark parts of the image to enhance the layering of the image;
[0052] Saturation: controls the vividness of the colors in the image;
[0053] Resolution: Set the number of pixels of the camera to capture the image. High resolution can provide clearer images.
[0054] Image compression: By adjusting the compression algorithm and compression ratio, the storage space and transmission bandwidth requirements can be reduced while maintaining image quality.
[0055] In this embodiment, it should be specifically explained that in step S02, the monitoring screen is observed in real time by moving the camera up, down, left, and right. When moving the camera, the stability of the bracket must be ensured to avoid shaking that causes image blur or distortion, and the image capture operation is performed when the camera is stable.
[0056] In this embodiment, it should be specifically explained that in step S03, feature data of the image in step S02 is extracted by computer vision processing technology, including radial distortion data and tangential distortion data. Radial distortion refers to the position deviation of image pixels along the radial direction with the distortion center as the center point, thereby causing the image formed in the image to deform. Tangential distortion refers to the change in the angle of the vector endpoint along the tangent line, wherein the radial distortion data includes the image coordinates of the center point of the optical axis, the actual image coordinates and the distance from the actual image coordinates to the image coordinates of the center point of the optical axis, and the tangential distortion data includes the number of image coverage grids, the ideal image height corresponding to each grid point and the lens focal length of each image.
[0057] In this embodiment, it should be specifically explained that in step S04, the specific steps of calculating the radial distortion coefficient of each image through the radial distortion detection mathematical model are as follows:
[0058] Step S11: Radial distortion takes the coordinates of the optical axis center point of each image as the reference point, and sets the image coordinates of the optical axis center point to (Δx i , Δy i ), the actual image coordinates are (x i ,y i ), where the actual image coordinates are the average coordinates of each pixel in the image, and the preset ideal image coordinates are
[0059] Step S12: Calculate the radial distortion coefficient of the horizontal coordinate of each image, and the calculation formula is: where α i1 Represents the radial distortion coefficient of each image, d i Indicates the distance from the actual image coordinates to the image coordinates of the center point of the optical axis;
[0060] Step S13: Calculate the longitudinal radial distortion coefficient of each image, and the calculation formula is: where α i2 Represents the radial distortion coefficient of the ordinate of each image;
[0061] Step S14: Calculate the radial distortion coefficient of each image according to step S11, step S12 and step S13, and the calculation formula is: Where Rd i Represents the radial distortion coefficient of each image.
[0062] In this embodiment, it should be specifically explained that in step S05, the specific steps of calculating the tangential distortion coefficient of each image through the tangential distortion detection mathematical model are as follows:
[0063] Step S11: Gridding each image. The number of grids covered by each image is m, where m = 1, 2, 3, ..., k, and the ideal image height corresponding to each grid point is H im ;
[0064] Step S12: Calculate the field of view angle corresponding to the ideal image height of each grid point, and the calculation formula is: where β im represents the field of view angle corresponding to the ideal image height of each grid point, f i represents the focal length of the lens for each image;
[0065] Step S13: Calculate the tangential distortion coefficient of each image according to step S11 and step S12, and the calculation formula is: Among them, R i Represents the tangential distortion coefficient of each image.
[0066] In this embodiment, it should be specifically explained that in step S06, an image quality detection model is established based on the radial distortion coefficient and the tangential distortion coefficient of each image, and the calculation formula for the comprehensive image quality index is calculated as follows: Where D represents the comprehensive image quality index, Rd i Represents the radial distortion coefficient of each image, Rl i Represents the tangential distortion coefficient of each image.
[0067] In this embodiment, it should be specifically explained that in step S07, the comprehensive image quality index D is compared with the preset image quality threshold ΔD. If the comprehensive image quality index D is greater than the preset image quality threshold ΔD, the image quality judgment result is that the image is qualified. If the comprehensive image quality index D is less than or equal to the preset image quality threshold ΔD, the image quality judgment result is that the image is unqualified.
[0068] In this embodiment, it should be specifically explained that in step S08, when the image quality judgment result is that the image is unqualified, an adjustment instruction is sent to the control device, and the control device receives the adjustment instruction and calibrates the rotation angle of the camera according to the adjustment instruction; when the image quality judgment result is that the image is qualified, the setting parameters are saved;
[0069] Calibrate the camera rotation angle according to the adjustment instructions including:
[0070] Calibrate camera parameters: Use a calibration board or other calibration tools to calibrate the camera and obtain the camera's internal and external parameters;
[0071] Measuring the rotation angle: Compare the difference between the actual angle value and the expected angle value to determine the error of the rotation angle;
[0072] Send adjustment instructions: send adjustment instructions based on the error;
[0073] Adjust the rotation angle: Adjust the rotation angle of the camera according to the adjustment instructions.
[0074] A device for calibrating the rotation angle of a camera, comprising an electronic device and a computer-readable storage medium;
[0075] The electronic device comprises a processor, a memory and a communication bus, wherein the memory stores a computer-readable program executable by the processor;
[0076] The communication bus realizes the connection and communication between the processor and the memory;
[0077] When the processor executes the computer readable program, the processor implements the steps in a method for calibrating the rotation angle of a camera;
[0078] The computer-readable storage medium stores one or more programs that can be executed by one or more processors.
[0079] The difference between the present embodiment and the prior art mainly lies in that the present embodiment is provided with step S01: fixing and connecting the camera to a control device, step S02: taking images at multiple angles, step S03: extracting feature data of the image in step S02, step S04: performing radial distortion calculation on the image feature data extracted in step S03, step S05: performing tangential distortion calculation on the image feature data extracted in step S03, step S06: establishing an image quality detection model, and calculating a comprehensive image quality index, step S07: performing image quality judgment processing according to the comprehensive image quality index in step S06, step S08: receiving the image quality judgment result in step S07, and calibrating the rotation angle of the camera. In short, a method and device for calibrating the rotation angle of a camera, extracting image feature data to perform radial distortion calculation and tangential distortion calculation, calibrating the rotation angle of the camera according to the distortion judgment result of the image, improving the geometric accuracy and visual effect of the image, and reducing the image quality problem caused by angle deviation by accurately controlling the rotation angle of the camera. The calibration process is automated and intelligent, further improving work efficiency and reducing the risk of human error.
[0080] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0081] 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.
Claims
1. A method for calibrating the rotation angle of a camera, characterized in that: The following steps are involved: Step S01: Fixing the camera and connecting it to a control device: Fixing the camera with a tripod and connecting the camera to a control device, wherein the control device is used to receive adjustment instructions to adjust the parameters of the camera; Step S02: shooting images at multiple angles: select different viewing angles, and shoot i images by moving the camera up, down, left, and right to change the shooting angle, where i=1, 2, 3, ..., n; Step S03: extracting feature data from the image in step S02: extracting feature data from the image in step S02 using computer vision processing technology, including radial distortion data and tangential distortion data; Step S04: performing radial distortion calculation on the image feature data extracted in step S03: based on the extracted image feature data, the radial distortion coefficient of each image is calculated by using a radial distortion detection mathematical model; Step S05: performing tangential distortion calculation on the image feature data extracted in step S03: calculating the tangential distortion coefficient of each image through the tangential distortion detection mathematical model based on the extracted image feature data; Step S06: Establishing an image quality detection model and calculating a comprehensive image quality index: establishing an image quality detection model based on the radial distortion coefficient and the tangential distortion coefficient of each image and calculating a comprehensive image quality index; Step S07: performing image quality judgment processing according to the comprehensive image quality index in step S06: comparing the comprehensive image quality index with a preset image quality threshold to judge whether the image quality is qualified; Step S08: receiving the image quality judgment result in step S07 and calibrating the camera rotation angle: when the image quality judgment result is that the image is unqualified, the control device receives the adjustment instruction and calibrates the camera rotation angle.
2. A method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In step S01, the control device is a control panel used in the monitoring system, which communicates with the camera wirelessly, receives adjustment instructions, and sends the instructions to the camera to perform corresponding parameter adjustments.
3. The method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In the step S03, feature data of the image in step S02 is extracted by computer vision processing technology, including radial distortion data and tangential distortion data, wherein the radial distortion data includes the image coordinates of the center point of the optical axis, the actual image coordinates, and the distance from the actual image coordinates to the image coordinates of the center point of the optical axis, and the tangential distortion data includes the number of image coverage grids, the ideal image height corresponding to each grid point, and the lens focal length of each image.
4. The method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In step S04, the specific steps of calculating the radial distortion coefficient of each image through the radial distortion detection mathematical model are as follows: Step S11: Radial distortion takes the coordinates of the optical axis center point of each image as the reference point, and sets the image coordinates of the optical axis center point to (Δx i , Δy i ), the actual image coordinates are (x i ,y i ), the preset ideal image coordinates are Step S12: Calculate the radial distortion coefficient of the horizontal coordinate of each image, and the calculation formula is: where α i1 Represents the radial distortion coefficient of each image, d i Indicates the distance from the actual image coordinates to the image coordinates of the center point of the optical axis; Step S13: Calculate the longitudinal radial distortion coefficient of each image, and the calculation formula is: where α i2 Represents the radial distortion coefficient of the ordinate of each image; Step S14: Calculate the radial distortion coefficient of each image according to step S11, step S12 and step S13, and the calculation formula is: Where Rd i Represents the radial distortion coefficient of each image.
5. The method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In step S05, the specific steps of calculating the tangential distortion coefficient of each image through the tangential distortion detection mathematical model are as follows: Step S11: Gridding each image. The number of grids covered by each image is m, where m = 1, 2, 3, ..., k, and the ideal image height corresponding to each grid point is H im ; Step S12: Calculate the field of view angle corresponding to the ideal image height of each grid point, and the calculation formula is: where β im represents the field of view angle corresponding to the ideal image height of each grid point, f i represents the focal length of the lens for each image; Step S13: Calculate the tangential distortion coefficient of each image according to step S11 and step S12, and the calculation formula is: Among them, R i Represents the tangential distortion coefficient of each image.
6. The method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In step S06, an image quality detection model is established based on the radial distortion coefficient and the tangential distortion coefficient of each image, and the calculation formula of the comprehensive image quality index is calculated as follows: Where D represents the comprehensive image quality index, Rd i Represents the radial distortion coefficient of each image, Rl i Represents the tangential distortion coefficient of each image.
7. The method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In step S07, the comprehensive image quality index D is compared with the preset image quality threshold ΔD. If the comprehensive image quality index D is greater than the preset image quality threshold ΔD, the image quality judgment result is that the image is qualified. If the comprehensive image quality index D is less than or equal to the preset image quality threshold ΔD, the image quality judgment result is that the image is unqualified.
8. The method for calibrating the rotation angle of a camera according to claim 1, characterized in that: In the step S08, when the image quality judgment result is that the image is unqualified, an adjustment instruction is sent to the control device, and the control device receives the adjustment instruction and calibrates the camera rotation angle according to the adjustment instruction; when the image quality judgment result is that the image is qualified, the setting parameters are saved.
9. A device for calibrating the rotation angle of a camera, characterized in that: It is implemented based on a method for calibrating the rotation angle of a camera according to any one of claims 1 to 8, comprising an electronic device and a computer-readable storage medium; The electronic device comprises a processor, a memory and a communication bus, wherein the memory stores a computer-readable program executable by the processor; The communication bus realizes the connection and communication between the processor and the memory; When the processor executes the computer-readable program, the processor implements the steps in the method for calibrating the rotation angle of a camera as described in any one of claims 1 to 8; The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the method for calibrating the rotation angle of a camera as described in any one of claims 1-8.
Citation Information
Patent Citations
Remote camera control method and system
CN116528042A
Camera calibrating device, and camera calibrating method
JP2017211200A