Camera correction method and system, storage medium and camera

Through detailed image processing and calculation steps, including picture alignment, feature calculation and fitting, the problem of poor adaptability of existing camera correction technologies is solved, achieving higher correction accuracy and consistency.

CN119603549AInactive Publication Date: 2025-03-11GUANGDONG YUEDIAN ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411582795.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing camera correction technology is difficult to adapt to various camera specifications and installation angles and distance requirements, and has poor adaptability.

Method used

By obtaining the display screen and the standard shooting screen, selecting the same equal points for four equalization operations, performing picture alignment, center relative position calculation, monitoring target shooting dimension line calculation, reference line calibration and angle measurement, calculating the relative angle and relative size proportional coefficients, and finally obtaining the standard image through fitting.

Benefits of technology

Improve the accuracy and consistency of camera correction, making it more adaptable and effective in various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603549A_ABST
    Figure CN119603549A_ABST
Patent Text Reader

Abstract

The invention discloses a camera correction method and system, a storage medium and a camera. The method comprises the following steps: acquiring a display picture and a standard shooting picture; carrying out quartering operation according to the display picture and the standard shooting picture, and then carrying out picture alignment operation to obtain a standard arrangement image; performing calculation according to the standard arrangement image to obtain a center relative position feature and a monitoring target shooting size line feature; performing datum line calibration according to equal blocks of a standard shot picture to obtain datum line features; measuring a reference angle and a monitoring target shooting angle according to the reference line characteristics, and calculating a relative angle to obtain the relative angle; calculating a relative size proportion coefficient according to the reference line features and the monitoring target shooting size line features to obtain the relative size proportion coefficient; and fitting according to the center relative position features, the relative angle and the relative size proportionality coefficient to obtain a standard image. The method can improve the correction adaptability of the camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image correction, and in particular to a camera correction method, system, storage medium and camera. Background Art

[0002] At present, the deviation of the angle between the camera and the display screen used to display its real-time captured images will eventually lead to the captured images not meeting expectations. For example, the camera is at a certain angle above the display screen and captures images at a certain angle for regular monitoring. Although the camera can ensure that the image that meets the expected monitoring target is captured, the image displayed on the display screen cannot be displayed at the expected angle, and usually there will be a certain deviation as a whole; that is, the monitoring image transmitted from the camera displayed on the display screen is deflected as a whole by an angle corresponding to the deviation of the camera's shooting angle.

[0003] In one prior art, an algorithm technology for changing the shooting angle of view is used. This solution can realize the angle deviation correction of the real-time picture shot by the camera, so that the image displayed on the display screen has no deviation from the picture actually shot by the camera.

[0004] The algorithm technology used in the prior art cannot adapt to all camera specifications and installation angles and distances. When the camera specifications are changed or the camera installation height and angle are adjusted, the algorithm parameters need to be reset, which has poor adaptability. Summary of the invention

[0005] The present invention provides a camera calibration method, system, storage medium and camera, so as to improve the adaptability of the camera calibration method.

[0006] In a first aspect, in order to solve the above technical problem, the present invention provides a camera calibration method, comprising: Obtain display screen and standard shooting screen; According to the display screen and the standard shooting screen, selecting the same equal-division point to perform a four-equal division operation to obtain equal-division blocks of the display screen and equal-division blocks of the standard shooting screen respectively; According to the equal blocks of the display screen and the equal blocks of the standard shooting screen, a screen alignment operation is performed, and the order 1 to 4 is calibrated from left to right to obtain a standard arrangement image; Arrange the images according to the standard, calculate the center relative position, and obtain the center relative position feature; Arrange the images according to the standard, calculate the monitored target shooting dimension line, and obtain the monitored target shooting dimension line feature; Divide the standard shooting picture into equal blocks, perform baseline calibration, and obtain baseline features; According to the baseline feature, the baseline angle and the monitoring target shooting angle are measured to obtain the baseline angle and the monitoring target shooting angle; Calculate the relative angle according to the reference angle and the monitoring target shooting angle to obtain the relative angle; Calculating a relative size ratio coefficient according to the baseline characteristics and the monitored target shooting size line characteristics to obtain a relative size ratio coefficient; According to the center relative position feature, the relative angle and the relative size ratio coefficient, fitting is performed to obtain a standard image.

[0007] In an optional implementation, arranging images according to the standard, performing center relative position calculation, and obtaining center relative position features include: The calculation formula of the center relative position feature is as follows:

[0008]

[0009] in, Indicates The center of the equal blocks is relative Axis position offset; Indicates The center of the equal blocks is relative Axis position offset; Indicates the standard shooting screen. Equal block center coordinate; Indicates the display screen Equal block center coordinate; Indicates the standard shooting screen. Equal block center coordinate; Indicates the display screen Equal block center coordinate.

[0010] In an optional implementation, the images are arranged according to the standard, and the monitored target shooting dimension line is calculated to obtain the monitored target shooting dimension line feature, including: According to the standard shooting picture, the center of the third block, the center of the fourth block and the center of the fourth block are selected and connected to obtain the shooting size line characteristics of the monitoring target.

[0011] In an optional implementation, the standard shooting picture is divided into equal blocks, and a baseline calibration is performed to obtain a baseline feature, including: The center of the first block and the center of the second block in the standard shooting picture are obtained, and connected to obtain the baseline feature.

[0012] In an optional implementation, measuring a reference angle and a monitoring target shooting angle according to the reference line feature to obtain the reference angle and the monitoring target shooting angle includes: According to the baseline feature, the straight line where the baseline feature is located is set to 0 degrees to obtain the baseline angle of the camera; According to the third block center and the fourth block center in the standard shooting picture equal blocks, lines are connected to obtain the monitoring target shooting angle.

[0013] In an optional implementation, performing relative angle calculation according to the reference angle and the surveillance target shooting angle to obtain the relative angle includes: The relative angle calculation formula is as follows:

[0014] in, Indicates relative angle; represents the reference angle; Indicates the shooting angle of the monitoring target.

[0015] In an optional implementation, a relative size ratio coefficient is calculated based on the baseline feature and the surveillance target shooting size line feature to obtain the relative size ratio coefficient, which is characterized by comprising: The relative size ratio coefficient calculation formula is as follows:

[0016] in, represents the relative size ratio coefficient; Indicates the photographed dimension line features of the monitoring target; Indicates the length of the reference line feature.

[0017] In an optional implementation, fitting is performed according to the center relative position feature, the relative angle and the relative size ratio coefficient to obtain a standard image, which is characterized by comprising: The calculation formula for fitting the standard ratio image is as follows:

[0018] in, The standard ratio image is represented by Equal blocks; Indicates the display screen Equal blocks; represents the relative size ratio coefficient; Indicates the angle between the four equal lines of the displayed image; Indicates The center of the equal blocks is relative Axis position offset; Indicates The center of the equal blocks is relative Axis position offset; C represents the relative angle.

[0019] In a second aspect, the present invention provides a camera calibration system, comprising: An input module, used to obtain display images and standard shooting images; A block division module, used for selecting the same equal division point to perform a four-equal division operation according to the display picture and the standard shooting picture, to obtain equal blocks of the display picture and equal blocks of the standard shooting picture respectively; An alignment module, used for performing an image alignment operation according to the equal blocks of the display image and the equal blocks of the standard shooting image, to obtain a standard arrangement image, and calibrating the order 1 to 4 from left to right; A center relative position feature calculation module, used to arrange images according to the standard, perform center relative position calculation, and obtain center relative position features; A monitoring target shooting dimension line feature calculation module is used to arrange images according to the standard, perform monitoring target shooting dimension line calculation, and obtain monitoring target shooting dimension line features; A baseline feature module, used to perform baseline calibration according to the standard shooting picture and obtain baseline features; An angle measurement module, used to measure the reference angle and the monitoring target shooting angle according to the reference line feature, so as to obtain the reference angle and the monitoring target shooting angle; A relative angle calculation module, used to perform relative angle calculation according to the reference angle and the monitoring target shooting angle to obtain a relative angle; A relative size ratio coefficient calculation module is used to calculate the relative size ratio coefficient according to the baseline characteristics and the monitoring target shooting size line characteristics to obtain the relative size ratio coefficient; The standard image fitting module is used to perform fitting according to the center relative position feature, the relative angle and the relative size ratio coefficient to obtain a standard image.

[0020] In a third aspect, the present invention further provides a computer storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the camera correction methods described above.

[0021] In a fourth aspect, the present invention further provides a camera for communicating with a camera calibration device as described in any one of the above to achieve camera calibration.

[0022] Compared with the prior art, the present invention has the following beneficial effects: The present invention proposes a camera calibration method, which aims to enhance the adaptability of the camera under various conditions. First, by acquiring a display screen and a standard shooting screen, the same equal-division points are selected to perform a four-equal division operation, and the equal-division blocks of the display screen and the standard shooting screen are obtained respectively. Then, the screen alignment operation is performed, and the calibration sequence is obtained to obtain a standard arrangement image. Next, according to the standard arrangement image, the center relative position feature is calculated, and the monitoring target shooting dimension line is calculated. According to the equal-division blocks of the standard shooting screen, the reference line is calibrated, the reference angle and the monitoring target shooting angle are measured, and then the relative angle is calculated. Finally, these features and parameters are fitted to obtain a standard image. This method improves the accuracy and consistency of camera calibration through detailed calculations and systematic processing, making it more effective in various application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flowchart of a camera calibration method provided by an embodiment of the present invention; Figure 2 It is a structural schematic diagram of a camera calibration system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] 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.

[0025] Reference Figure 1 , an embodiment of the present invention provides a camera calibration method, comprising the following steps: S11, obtaining a display image and a standard shooting image; S12, according to the display picture and the standard shooting picture, selecting the same equal-division point to perform a four-equal division operation to obtain equal-division blocks of the display picture and equal-division blocks of the standard shooting picture respectively; S13, performing a picture alignment operation according to the equal blocks of the display picture and the equal blocks of the standard shooting picture, calibrating the order 1 to 4 from left to right, and obtaining a standard arrangement image; S14, arranging the images according to the standard, calculating the center relative position, and obtaining the center relative position feature; S15, arranging the images according to the standard, calculating the monitored target shooting dimension line, and obtaining the monitored target shooting dimension line feature; S16, performing baseline calibration according to the standard shooting picture and equal blocks to obtain baseline features; S17, measuring a reference angle and a monitoring target shooting angle according to the reference line feature to obtain a reference angle and a monitoring target shooting angle; S18, performing relative angle calculation according to the reference angle and the monitoring target shooting angle to obtain a relative angle; S19, calculating a relative size ratio coefficient according to the baseline feature and the monitored target shooting size line feature to obtain a relative size ratio coefficient; S110, performing fitting according to the center relative position feature, the relative angle and the relative size ratio coefficient to obtain a standard image.

[0026] In step S11, it is necessary to obtain a display screen and a standard shooting screen. It should be noted that the display screen is a direct monitoring screen displayed on a rectangular display, and the standard shooting screen is an ideal monitoring screen for the user.

[0027] In step S12, according to the display screen and the standard shooting screen, the same dividing point is selected to perform a four-equal division operation, and the display screen and the standard shooting screen are respectively obtained. It should be noted that the display screen and the shooting screen are simultaneously divided into four equal blocks by a quadrilateral division method. An equal division point located at the same corner of the display screen and the shooting screen is taken as a monitoring target, and the relative position relationship between the center of the four-equal block in the shooting screen and the center of the corresponding four-equal block on the display screen is obtained. The display screen and the shooting screen are divided into four identical rectangles.

[0028] It should be noted that, according to the display screen and the standard shooting screen, the same dividing point is selected for quartering operation to obtain display screen equal blocks and standard shooting screen equal blocks respectively. This step is achieved through image processing algorithms such as the image segmentation function of the OpenCV library.

[0029] In step S13, according to the display screen equal blocks and the standard shooting screen equal blocks, the screen alignment operation is performed, and the order 1 to 4 is calibrated from left to right to obtain a standard arrangement image. It should be noted that after the alignment operation, the corresponding four blocks are aligned up and down to facilitate the subsequent feature calculation.

[0030] It should be noted that the image alignment operation is performed according to the equal blocks of the display image and the equal blocks of the standard shooting image to obtain a standard arrangement image, and the order from left to right is marked 1 to 4. The alignment can be performed using a feature point detection algorithm such as SIFT (Scale Invariant Feature Transform) or SURF (Speeded Up Robust Features).

[0031] In step S14, the images are arranged according to the standard, and the center relative position is calculated to obtain the center relative position feature, including: The calculation formula of the center relative position feature is as follows:

[0032]

[0033] in, Indicates The center of the equal blocks is relative Axis position offset; Indicates The center of the equal blocks is relative Axis position offset; Indicates the standard shooting screen. Equal block center coordinate; Indicates the display screen Equal block center coordinate; Indicates the standard shooting screen. Equal block center coordinate; Indicates the display screen Equal block center coordinate.

[0034] It should be noted that the image coordinates are set with the upper left corner of the image as the origin, the coordinates are (0, 0), the x-axis is the positive direction from the origin to the right, and the y-axis is the positive direction from the origin to the bottom. Based on the image coordinates, the coordinates of each pixel point in the image are obtained, and then the coordinates of the center point can be directly obtained.

[0035] It should be noted that the calculation of the center relative position feature is based on the coordinates of the center point of each equally divided block. By calculating the relative offset between the standard shooting screen and the display screen of the center point of each equally divided block, the overall arrangement of the image can be determined.

[0036] In one achievable method, this process can be implemented through software programming. Assume that the center x coordinate of the first equally divided block in the standard shooting image is 100, and in the display image it is 95, then , indicating that the first block is shifted 5 units to the left on the x-axis. Similarly, if the center y coordinate of the first block in the standard shooting screen is 50, and in the display screen it is 55, then , indicating that the first equal block is offset 5 units upward on the y-axis.

[0037] In step S15, the images are arranged according to the standard, and the monitored target shooting dimension line is calculated to obtain the monitored target shooting dimension line features, including: According to the standard shooting picture, the center of the third block, the center of the fourth block and the center of the fourth block are selected and connected to obtain the shooting size line characteristics of the monitoring target.

[0038] It should be noted that, preferably, the monitoring target shooting dimension line calculation is performed according to the standard arrangement image to obtain the monitoring target shooting dimension line characteristics, which are determined by selecting and connecting the third block center and the fourth block center in the standard shooting picture.

[0039] In step S16, the reference line is calibrated according to the standard shooting picture and divided into blocks to obtain the reference line features, including: The center of the first block and the center of the second block in the standard shooting picture are obtained, and connected to obtain the baseline feature.

[0040] It should be noted that, preferably, the baseline calibration is performed according to the equal blocks of the standard shooting picture to obtain the baseline feature, which is achieved by connecting the center of the first block and the center of the second equal block in the standard shooting picture.

[0041] In step S17, the reference angle and the monitoring target shooting angle are measured according to the reference line feature to obtain the reference angle and the monitoring target shooting angle, including: According to the baseline feature, the straight line where the baseline feature is located is set to 0 degrees to obtain the baseline angle of the camera; According to the third block center and the fourth block center in the standard shooting picture equal blocks, lines are connected to obtain the monitoring target shooting angle.

[0042] It should be noted that the reference angle, as a standard for angle measurement, can be used to obtain other angle features by intersecting with other straight lines. The monitoring target shooting angle reflects the angle relationship between the camera monitoring target and the reference feature, and also reflects the position of the monitored object in the image coordinate system.

[0043] It should be noted that, preferably, the reference angle and the monitoring target shooting angle are measured according to the baseline feature to obtain the reference angle and the monitoring target shooting angle, which is achieved by setting the baseline to 0 degrees and detecting the angle of the line connecting the center of the third block and the center of the fourth equal block.

[0044] In step S18, a relative angle calculation is performed according to the reference angle and the surveillance target shooting angle to obtain a relative angle, including: The relative angle calculation formula is as follows:

[0045] in, Indicates relative angle; represents the reference angle; Indicates the shooting angle of the monitoring target.

[0046] It should be noted that the relative angle represents the angular relationship between the monitored object and the reference position in the image coordinate system, which facilitates the subsequent adjustment of the angle of the monitored object to a standard angle for display.

[0047] It should be noted that, preferably, a relative angle calculation is performed based on the reference angle and the surveillance target shooting angle to obtain the relative angle, which is achieved by comparing the difference between the two.

[0048] In step S19, a relative size ratio coefficient is calculated based on the baseline feature and the monitored target shooting size line feature to obtain a relative size ratio coefficient, which is characterized by including: The relative size ratio coefficient calculation formula is as follows:

[0049] in, represents the relative size ratio coefficient; Indicates the photographed dimension line features of the monitoring target; Indicates the length of the reference line feature.

[0050] It should be noted that the length of the baseline feature represents the standard length set under the current method, the monitoring target shooting dimension line feature represents the length of the current monitored object in the displayed image, and the relative proportional coefficient represents the conversion relationship between the length of the current monitored object and the standard length.

[0051] It should be noted that, preferably, the relative size ratio coefficient is calculated based on the baseline feature and the surveillance target shooting size line feature to obtain the relative size ratio coefficient, using the ratio formula Calculate, where is the baseline length, Shoot dimension line length for monitoring target.

[0052] In step S110, fitting is performed according to the center relative position feature, the relative angle and the relative size ratio coefficient to obtain a standard image, which is characterized by comprising: The calculation formula for fitting the standard ratio image is as follows:

[0053] in, The standard scale image is represented by Equal blocks; Indicates the display screen Equal blocks; represents the relative size ratio coefficient; Indicates the angle between the four equal lines of the displayed image; Indicates The center of the equal blocks is relative Axis position offset; Indicates The center of the equal blocks is relative Axis position offset; C represents the relative angle.

[0054] It should be noted that the standard image is obtained by fitting according to the center relative position characteristics, the relative angle and the relative size ratio coefficient, and the display image is corrected using a fitting algorithm (such as the least squares method). Through these specific hardware selections and calculation methods, efficient and accurate image correction can be achieved to ensure that the images captured by the camera in various environments meet the expected standards.

[0055] In order to facilitate the understanding of the present invention, some preferred embodiments of the present invention are further described below.

[0056] In one implementation, first, the system obtains a display image and a standard shooting image. The display image is the shooting result of the camera in the current environment, and the standard shooting image is a pre-set reference image for comparison and correction. By comparing the two images, the system can determine the necessity and direction of correction.

[0057] For more precise correction, the system selects the same equal points in the display image and the standard shooting image and performs a quartering operation. This step divides the image into four equal blocks, marked as the first block center, the second and third block centers, and the fourth block. In this way, the system can analyze and align each part of the image more finely.

[0058] Next, the system performs image alignment based on the equal blocks of the display image and the standard shot image. The purpose of this step is to ensure that the relative position and angle of the display image and the standard shot image are consistent. The system calibrates the equal blocks from left to right, in the order of 1 to 4, and finally obtains the standard arrangement image. With this arrangement, the system can compare and adjust the images more intuitively.

[0059] After obtaining the standard arrangement image, the system performs center relative position calculation. This step is to determine the relative position offset between the display screen and the standard shooting screen. The system calculates the position offset of each equally divided block center relative to the x-axis and y-axis to obtain the center relative position features. These features will serve as the basis for subsequent correction steps.

[0060] The system also needs to calculate the surveillance target shooting dimension line features. According to the standard arrangement image, the system selects the third block center and the fourth block center of the standard shooting screen to connect the lines to obtain the surveillance target shooting dimension line features. These features are used to determine the proportional relationship between the display screen and the standard shooting screen in size, so as to make more accurate corrections.

[0061] In order to perform a more comprehensive calibration, the system also needs to calibrate the baseline and measure the baseline angle. The system obtains the baseline feature by connecting the center of the first block and the center of the second block in the standard shooting picture. The baseline serves as an important reference standard in the calibration process. Next, the system sets the straight line where the baseline is located to 0 degrees based on the baseline feature to obtain the baseline angle of the camera. Then, based on the line connecting the center of the third block and the center of the fourth block in the standard shooting picture, the shooting angle of the monitored target is obtained.

[0062] Once the reference angle and the target shooting angle are determined, the system performs relative angle calculation to obtain the relative angle between the reference angle and the target shooting angle. This step ensures accurate calibration of the camera at different shooting angles. In addition, the system also calculates the relative size ratio coefficient based on the reference line features and the target shooting size line features. This ratio coefficient is used to adjust the size ratio of the display screen and the standard shooting screen to ensure that the calibrated image meets the expected proportional relationship.

[0063] Finally, the system performs a fitting process based on the center relative position characteristics, relative angles, and relative size ratio coefficients to obtain a standard image. The fitting process adjusts the display image to an image that conforms to the standard shooting image through a series of mathematical calculations. The result of this process is a calibrated, standard-compliant image, ensuring that the camera can capture accurate and consistent images in various environments.

[0064] In another implementation, the camera calibration can be implemented through a more detailed technical solution to improve the adaptability of the camera calibration method. First, the system obtains a display screen and a standard shooting screen. The display screen is the actual image captured by the current camera, while the standard shooting screen is a preset reference image for comparison and calibration. After obtaining these two screens, the system can start to analyze the differences between them.

[0065] In order to make more accurate corrections, the system needs to select the same equal points in the display screen and the standard shooting screen for quartering. Specifically, the system divides the screen into four equal blocks, each of which is marked as the center of the first block, the center of the second and third blocks, and the fourth block. The purpose of this step is to refine the analysis and alignment of each part of the picture through smaller areas. For example, a corner of the camera in the display screen may be deformed due to perspective problems. By dividing the blocks into equal blocks, the system can better identify and correct these problems.

[0066] Next, the system performs an image alignment operation based on the equal blocks of the display image and the standard shooting image. The goal of the alignment operation is to ensure that the display image and the standard shooting image are consistent in position and angle. In the specific operation, the system will calibrate the order of the equal blocks from left to right, 1 to 4, so that a standard arrangement image can be obtained. Through this standard arrangement, the system can more intuitively compare and adjust the differences between the two images.

[0067] After obtaining the standard arrangement image, the system needs to perform a center relative position calculation to determine the relative position offset between the display screen and the standard shooting screen. By calculating the position offset of the center of each equally divided block relative to the x-axis and y-axis, the system can obtain the center relative position features. These features will play a key role in the subsequent correction steps. The calculation method of the center relative position feature can be implemented in a variety of ways. The simplest method is to directly calculate the coordinate difference of the center point of the equally divided block to obtain the relative position offset.

[0068] While calculating the relative position features, the system also needs to calculate the dimension line features of the monitored target. According to the standard arrangement image, the system selects the center of the third block and the center of the fourth equal block in the standard shooting picture to connect the lines to obtain the dimension line features of the monitored target. These dimension line features are used to determine the size ratio relationship between the display picture and the standard shooting picture, so as to make more accurate corrections. Specifically, the dimension line features can be calculated by measuring the distance between the equal blocks and comparing them with the standard image to determine the proportional coefficient.

[0069] In order to perform a more comprehensive correction, the system also needs to perform baseline calibration and baseline angle measurement. Baseline calibration is to obtain the baseline feature by connecting the center of the first block and the center of the second equal block in the standard shooting picture. The baseline is an important reference standard in the correction process to ensure the accuracy and consistency of the correction operation. Next, the system sets the straight line where the baseline is located to 0 degrees according to the baseline feature to obtain the baseline angle of the camera. The setting of the baseline angle is one of the key steps in the entire correction process, which determines the benchmark for subsequent correction operations.

[0070] Then, the system obtains the monitoring target shooting angle based on the line connecting the center of the third block and the center of the fourth block in the standard shooting picture. The monitoring target shooting angle refers to the viewing angle position that the camera needs to reach during the actual monitoring process. By comparing the reference angle and the monitoring target shooting angle, the system can calculate the relative angle and make corrections. The relative angle is calculated by comparing the difference between the reference line and the monitoring target shooting angle to determine the angle range that needs to be adjusted.

[0071] In addition to angle correction, the system also needs to calculate the relative size ratio coefficient based on the baseline features and the monitored target shooting size line features. The relative size ratio coefficient is used to adjust the size ratio of the display screen and the standard shooting screen to ensure that the corrected image meets the expected proportional relationship. The adjustment of the size ratio can be achieved through a series of mathematical calculations to ensure the accuracy and consistency of the image at different sizes.

[0072] Finally, the system performs a fitting process based on the center relative position characteristics, relative angles, and relative size ratio coefficients to obtain a standard image. The fitting process is the core step of the entire correction method. Through a series of mathematical calculations and algorithm optimization, the display image is adjusted to an image that conforms to the standard shooting image. During the fitting process, the system will comprehensively consider multiple features such as position, angle, and size to ensure that the final correction result is accurate and consistent.

[0073] After fitting is completed, the system can use the corrected standard image in actual monitoring and application scenarios. The advantage of this series of correction operations is that through refined analysis and multi-level correction, the system can capture accurate and consistent images in various environments. This not only improves the adaptability of the camera correction method, but also enhances its reliability and effectiveness in practical applications. For example, in traffic monitoring, the camera needs to work under different light and weather conditions. Through the above correction method, it can be ensured that the camera can provide high-quality images under any conditions.

[0074] The following describes the working process of the present invention using a common scenario as an example. Figure 2 , which is Figure 1 Schematic diagram of the working scenario of the method.

[0075] In a large-scale traffic management system, camera calibration is particularly important. Accurate camera calibration methods are used to ensure that traffic surveillance cameras can provide high-quality surveillance images under various weather and light conditions, which is an important prerequisite for ensuring road safety and smooth traffic.

[0076] First, the system needs to acquire display images and standard shooting images. The display image is the real-time image captured by the current camera in the live environment, while the standard shooting image is a preset reference image, which may be captured in an ideal environment or accurately adjusted. Acquiring these images requires high-quality cameras and image acquisition cards. For example, a 4K camera and a high-speed image acquisition card are used to ensure high resolution and clarity of the image.

[0077] Next, the system needs to divide the display screen and the standard shooting screen into blocks. The block division module will divide the two screens into four equal parts according to the specific points to obtain equal blocks. This step usually uses image processing algorithms, such as the image segmentation function in the OpenCV library. The segmented image blocks are marked as the first block center, the second and third block centers, and the fourth equal block, so that each part can be analyzed more finely.

[0078] After the block operation is completed, the alignment module performs the image alignment operation based on the display screen and the standard shooting screen. The purpose of the alignment operation is to ensure the consistency of the display screen and the standard shooting screen in spatial position and angle. Specifically, feature point detection algorithms such as SIFT (Scale Invariant Feature Transform) or SURF (Speeded Up Robust Features) can be used to detect and match key points in the image, and these key points are used for image registration. The calibration order from left to right is 1 to 4 to obtain a standard arrangement image.

[0079] After obtaining the standard arrangement image, the center relative position feature calculation module starts working. This module calculates the center relative position based on the standard arrangement image and obtains the position offset of each equally divided block center relative to the x-axis and y-axis. This calculation can be done using a simple coordinate difference calculation formula, as follows: and These relative position features will be used in the subsequent correction steps.

[0080] At the same time, the system also needs to calculate the monitoring target shooting dimension line features. The monitoring target shooting dimension line feature calculation module arranges the image according to the standard, selects and connects the third block center and the fourth block center of the standard shooting picture, and obtains the monitoring target shooting dimension line features. This process can use the Euclidean distance formula to calculate the straight-line distance between two points to determine the dimension line features. These features are used to ensure that the size ratio relationship between the display picture and the standard shooting picture is accurate.

[0081] The baseline feature module calibrates the baseline according to the standard shooting screen. The module obtains the baseline feature by connecting the center of the first block and the center of the second block in the standard shooting screen. The setting of the baseline is an important basis for subsequent angle correction. By ensuring the accuracy of the baseline, the system can ensure the accuracy of the entire correction process.

[0082] The angle measurement module measures the reference angle and the monitoring target shooting angle according to the reference line features. Specifically, the system first sets the straight line where the reference line is located to 0 degrees to obtain the reference angle. Then, the monitoring target shooting angle is determined by detecting the angle between the center of the third block and the center of the fourth block in the standard shooting picture. The relative angle calculation module calculates the relative angle by comparing the difference between the reference angle and the monitoring target shooting angle. This process can be calculated using basic trigonometric functions.

[0083] In addition, the relative size ratio coefficient calculation module calculates the relative size ratio coefficient based on the baseline characteristics and the monitored target shooting size line characteristics. This ratio coefficient is used to adjust the size ratio of the display screen and the standard shooting screen to ensure the correct proportional relationship of the image. The specific calculation formula is as follows: Calculate, where is the baseline length, Shoot dimension line length for monitoring target.

[0084] Finally, the standard image fitting module performs an image fitting process based on the center relative position characteristics, relative angles, and relative size ratio coefficients to obtain a standard image. The fitting process uses algorithms such as the least squares method to adjust the display image to an image that conforms to the standard shooting image. The fitting formula is as follows: This series of steps ensures accurate image correction, allowing the camera to provide high-quality and consistent images under a variety of environmental conditions.

[0085] In this process, each module plays an important role. For example, the input module uses high-quality cameras and image acquisition cards to obtain clear image data; the block module uses image processing libraries such as OpenCV to achieve efficient image segmentation; the alignment module ensures the spatial alignment of the image through feature point detection and image registration algorithms; the center relative position feature calculation module and the monitoring target shooting dimension line feature calculation module use simple and effective geometric calculation formulas to obtain accurate relative position and dimension features; the baseline feature module and the angle measurement module ensure the accuracy of the correction process through geometric connection and angle measurement; the relative angle calculation module and the relative dimension ratio coefficient calculation module further improve the accuracy of the correction through comparison and ratio calculation; finally, the standard image fitting module achieves accurate image correction through fitting algorithms.

[0086] In summary, the present invention proposes a camera calibration method, which aims to enhance the adaptability of the camera under various conditions. First, by acquiring a display screen and a standard shooting screen, the same equal-division points are selected to perform a four-equal division operation, and the equal-division blocks of the display screen and the standard shooting screen are obtained respectively. Then, the screen alignment operation is performed, and the calibration sequence is obtained to obtain a standard arrangement image. Next, according to the standard arrangement image, the center relative position feature is calculated, and the monitoring target shooting dimension line is calculated. According to the equal-division blocks of the standard shooting screen, the baseline is calibrated, the baseline angle and the monitoring target shooting angle are measured, and then the relative angle is calculated. Finally, these features and parameters are fitted to obtain a standard image. This method improves the accuracy and consistency of camera calibration through detailed calculations and systematic processing, making it more effective in various application scenarios.

[0087] Reference Figure 2 , an embodiment of the present invention provides a camera calibration system, comprising: An input module, used to obtain display images and standard shooting images; A block division module, used for selecting the same equal division point to perform a four-equal division operation according to the display picture and the standard shooting picture, to obtain equal blocks of the display picture and equal blocks of the standard shooting picture respectively; An alignment module, used for performing an image alignment operation according to the equal blocks of the display image and the equal blocks of the standard shooting image, to obtain a standard arrangement image, and calibrating the order 1 to 4 from left to right; A center relative position feature calculation module, used to arrange images according to the standard, perform center relative position calculation, and obtain center relative position features; A monitoring target shooting dimension line feature calculation module is used to arrange images according to the standard, perform monitoring target shooting dimension line calculation, and obtain monitoring target shooting dimension line features; A baseline feature module, used to perform baseline calibration according to the standard shooting picture and obtain baseline features; An angle measurement module, used to measure the reference angle and the monitoring target shooting angle according to the reference line feature, so as to obtain the reference angle and the monitoring target shooting angle; A relative angle calculation module, used to perform relative angle calculation according to the reference angle and the monitoring target shooting angle to obtain a relative angle; A relative size ratio coefficient calculation module is used to calculate the relative size ratio coefficient according to the baseline characteristics and the monitoring target shooting size line characteristics to obtain the relative size ratio coefficient; The standard image fitting module is used to perform fitting according to the center relative position feature, the relative angle and the relative size ratio coefficient to obtain a standard image.

[0088] It should be noted that a camera calibration system provided in an embodiment of the present invention is used to execute all process steps of a camera calibration method in the above embodiment, and the working principles and beneficial effects of the two correspond one to one, so they will not be repeated here.

[0089] The embodiment of the present invention further provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned camera calibration method embodiments are implemented, for example Figure 1 Alternatively, the processor implements the functions of each module / unit in the above-mentioned device embodiments when executing the computer program.

[0090] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the electronic device.

[0091] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0092] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.

[0093] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0094] Wherein, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0095] It should be noted that the device 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. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0096] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A camera calibration method, characterized in that: Executed by a computer, including: Obtain display screen and standard shooting screen; According to the display screen and the standard shooting screen, selecting the same equal-division point to perform a four-equal division operation to obtain equal-division blocks of the display screen and equal-division blocks of the standard shooting screen respectively; According to the equal blocks of the display screen and the equal blocks of the standard shooting screen, a screen alignment operation is performed, and the order 1 to 4 is calibrated from left to right to obtain a standard arrangement image; Arrange the images according to the standard, calculate the center relative position, and obtain the center relative position feature; Arrange the images according to the standard, calculate the monitored target shooting dimension line, and obtain the monitored target shooting dimension line feature; Divide the standard shooting picture into equal blocks, perform baseline calibration, and obtain baseline features; According to the baseline feature, a baseline angle and a monitoring target shooting angle are measured to obtain a baseline angle and a monitoring target shooting angle; Calculate the relative angle according to the reference angle and the monitoring target shooting angle to obtain the relative angle; Calculating a relative size ratio coefficient according to the baseline characteristics and the monitored target shooting size line characteristics to obtain a relative size ratio coefficient; According to the center relative position feature, the relative angle and the relative size ratio coefficient, fitting is performed to obtain a standard image.

2. The camera calibration method according to claim 1, characterized in that: Arrange the images according to the standard, calculate the center relative position, and obtain the center relative position feature, including: The calculation formula of the center relative position feature is as follows: in, Indicates The center of the equal blocks is relative Axis position offset; Indicates The center of the equal blocks is relative Axis position offset; Indicates the standard shooting screen. Equal block center coordinate; Indicates the display screen Equal block center coordinate; Indicates the standard shooting screen. Equal block center coordinate; Indicates the display screen Equal block center coordinate.

3. The camera calibration method according to claim 1, characterized in that: Arrange the images according to the standard, calculate the monitored target shooting dimension line, and obtain the monitored target shooting dimension line features, including: According to the standard shooting picture, the center of the third block, the center of the fourth block and the center of the fourth block are selected and connected to obtain the shooting size line characteristics of the monitoring target.

4. The camera calibration method according to claim 1, characterized in that: According to the standard shooting picture, the baseline is calibrated and the baseline features are obtained, including: The center of the first block and the center of the second block in the standard shooting picture are obtained, and connected to obtain the baseline feature.

5. The camera calibration method according to claim 1, characterized in that: According to the baseline feature, the baseline angle and the monitoring target shooting angle are measured to obtain the baseline angle and the monitoring target shooting angle, including: According to the baseline feature, the straight line where the baseline feature is located is set to 0 degrees to obtain the baseline angle of the camera; According to the third block center and the fourth block center in the standard shooting picture equal blocks, lines are connected to obtain the monitoring target shooting angle.

6. The camera calibration method according to claim 1, characterized in that: The relative angle is calculated according to the reference angle and the surveillance target shooting angle to obtain the relative angle, including: The relative angle calculation formula is as follows: in, Indicates relative angle; represents the reference angle; Indicates the shooting angle of the monitoring target.

7. The camera calibration method according to claim 1, characterized in that: According to the baseline feature and the surveillance target shooting dimension line feature, a relative dimension ratio coefficient is calculated to obtain a relative dimension ratio coefficient, which is characterized by comprising: The relative size ratio coefficient calculation formula is as follows: in, represents the relative size ratio coefficient; Indicates the photographed dimension line features of the monitoring target; Indicates the length of the reference line feature.

8. The camera calibration method according to claim 1, characterized in that: According to the center relative position feature, the relative angle and the relative size ratio coefficient, fitting is performed to obtain a standard image, which is characterized by comprising: The calculation formula for fitting the standard ratio image is as follows: in, The standard scale image is represented by Equal blocks; Indicates the display screen Equal blocks; represents the relative size ratio coefficient; Indicates the angle between the four equal lines of the displayed image; Indicates The center of the equal blocks is relative Axis position offset; Indicates The center of the equal blocks is relative Axis position offset; C represents the relative angle.

9. A camera calibration system, characterized in that: include: An input module, used to obtain display images and standard shooting images; A block division module, used for selecting the same equal division point to perform a four-equal division operation according to the display picture and the standard shooting picture, to obtain equal blocks of the display picture and equal blocks of the standard shooting picture respectively; An alignment module, used for performing an image alignment operation according to the equal blocks of the display image and the equal blocks of the standard shooting image, to obtain a standard arrangement image, and calibrating the order 1 to 4 from left to right; A center relative position feature calculation module, used to arrange images according to the standard, perform center relative position calculation, and obtain center relative position features; A monitoring target shooting dimension line feature calculation module is used to arrange images according to the standard, perform monitoring target shooting dimension line calculation, and obtain monitoring target shooting dimension line features; A baseline feature module, used to perform baseline calibration according to the standard shooting picture and obtain baseline features; An angle measurement module, used to measure the reference angle and the monitoring target shooting angle according to the reference line feature, so as to obtain the reference angle and the monitoring target shooting angle; A relative angle calculation module, used to perform relative angle calculation according to the reference angle and the monitoring target shooting angle to obtain a relative angle; A relative size ratio coefficient calculation module is used to calculate the relative size ratio coefficient according to the baseline characteristics and the monitoring target shooting size line characteristics to obtain the relative size ratio coefficient; The standard image fitting module is used to perform fitting according to the center relative position feature, the relative angle and the relative size ratio coefficient to obtain a standard image.

10. A camera, characterized in that: Used to communicate with the camera calibration device as described in claim 9 to achieve camera calibration.