Search

CN-121437651-B - Camera preset position deviation rectifying method, device and storage medium

CN121437651BCN 121437651 BCN121437651 BCN 121437651BCN-121437651-B

Abstract

The application discloses a camera preset position deviation rectifying method, equipment and a storage medium, wherein the method comprises the steps of obtaining a first collected image of a target preset position corresponding to a camera, and obtaining a reference image and reference depth data corresponding to the target preset position, wherein the first collected image is collected after a cradle head of the camera rotates according to cradle head posture parameters corresponding to the target preset position; the method comprises the steps of obtaining a first collected image, obtaining reference depth data, calculating the current absolute pose of the camera by using a matching result between the first collected image and the reference depth data, determining a first pose deviation of the camera at the target preset position based on the current absolute pose, and rectifying at least the target preset position of the camera based on the first pose deviation. Through the mode, the preset position correction efficiency and accuracy of the camera can be improved.

Inventors

  • ZHANG KAI
  • JIN HENG
  • LI QIANKUN

Assignees

  • 浙江大华技术股份有限公司

Dates

Publication Date
20260508
Application Date
20251230

Claims (12)

  1. 1. A method for correcting a preset position of a camera, the method comprising: acquiring a first acquisition image of a target preset position corresponding to a camera, and acquiring a reference image and reference depth data corresponding to the target preset position, wherein the first acquisition image is acquired after a holder of the camera rotates according to holder posture parameters corresponding to the target preset position; the camera is correspondingly provided with a first internal parameter and a first external parameter which are positioned at the target preset position during calibration, and the reference depth data is obtained based on the steps that in a three-dimensional model of a scene corresponding to the scene where the camera is positioned, parameters of a view port camera are set by using the first internal parameter and the first external parameter, and the depth data corresponding to the target preset position is obtained by using the set view port camera and is used as the reference depth data of the target preset position; Calculating the current absolute pose of the camera by using a matching result between the first acquired image and the reference depth data, wherein the matching result comprises a plurality of matching point pairs between the first acquired image and the reference image, the matching point pairs comprise three-dimensional space coordinate points corresponding to two-dimensional pixel points of the first acquired image and two-dimensional pixel points of the reference image, and the three-dimensional space coordinate points of the reference image are positioned in a world coordinate system of a scene three-dimensional model corresponding to the current scene of the camera; Determining a first pose deviation of the camera at the target preset position based on the current absolute pose; and correcting at least the target preset position of the camera based on the first pose deviation.
  2. 2. The method of claim 1, wherein the determining a first pose bias of the camera at the target preset position based on the current absolute pose comprises: Acquiring a reference absolute pose of the camera at the target preset position, wherein the reference absolute pose is an initial absolute pose which is preset for the target preset position or a latest absolute pose which is updated for the target preset position after the last deviation correction; And calculating the deviation between the current absolute pose and the reference absolute pose to obtain the first pose deviation.
  3. 3. The method of claim 1, wherein the rectifying at least the target preset bit of the camera based on the first pose deviation comprises: converting the first pose deviation into a cradle head pose adjustment quantity; and adjusting the position parameters of the cradle head corresponding to the preset positions by utilizing the cradle head pose adjustment quantity aiming at each preset position in at least one preset position, wherein the at least one preset position comprises the target preset position.
  4. 4. The method of claim 3, wherein the first pose bias comprises a rotational bias, and wherein converting the first pose bias to a pan-tilt pose adjustment comprises: Decomposing the rotation deviation into n M rotating the matrix; Calculating a horizontal rotation adjustment amount in the cradle head pose adjustment amount by using a first element and a second element in the rotation matrix and a trigonometric function relation, wherein the first element and the second element are respectively an element of a third row and a first column in the rotation matrix and an element of a third row and a third column in the rotation matrix, and Calculating to obtain a vertical rotation adjustment amount in the cradle head pose adjustment amount by using a third element, a fourth element and a trigonometric function relation in the rotation matrix, wherein the third element and the fourth element are respectively an element of a first row and a second column and an element of a second row and a second column in the rotation matrix; and/or, the pan-tilt position parameter comprises a horizontal rotation value, a vertical rotation value and a lens zoom value, the pan-tilt position and pose adjustment amount comprises a horizontal rotation adjustment amount and a vertical rotation adjustment amount, the pan-tilt position parameter corresponding to the preset position is adjusted by using the pan-tilt position and pose adjustment amount, and the pan-tilt position parameter comprises: The method comprises the steps of taking the sum of a horizontal rotation value in a holder position parameter before adjustment and the horizontal rotation adjustment amount as the horizontal rotation value in the holder position parameter after adjustment, taking the sum of a vertical rotation value in the holder position parameter before adjustment and the vertical rotation adjustment amount as the vertical rotation value in the holder position parameter after adjustment, and taking the lens zoom value in the holder position parameter before adjustment as the lens zoom value in the holder position parameter after adjustment.
  5. 5. The method of claim 1, wherein the matching results include pairs of matching points between the first captured image and the reference image, wherein the calculating the current absolute pose of the camera using the matching results between the first captured image and the reference depth data comprises: calculating a current external parameter of the camera by using the plurality of matching point pairs, the reference depth data and the internal parameter of the camera, and taking the current external parameter as the current absolute pose; And/or before calculating the current absolute pose of the camera using the matching result between the first acquired image and the reference depth data, further comprising: and matching the first acquired image with the reference image by using the first acquired image and the reference image to obtain the matching result, or matching the first acquired image with the reference image and the reference depth data to obtain the matching result.
  6. 6. The method of claim 1, further comprising, prior to said calculating a current absolute pose of the camera using a result of a match between the first acquired image and the reference depth data: determining that the camera is offset at the target preset position in response to the pixel deviation distribution of each matching point pair meeting an offset condition, and executing the matching result between the first acquired image and the reference depth data to calculate the current absolute pose of the camera and the subsequent steps; the offset condition is that the number of matching point pairs with the pixel deviation larger than a deviation threshold exceeds a quantity threshold, and/or the pixel deviation of the matching point pairs is the sum of absolute values of coordinate differences of all axes of the matching point pairs.
  7. 7. The method of claim 1, further comprising, after said rectifying at least a target preset bit of the camera based on the first pose deviation: taking a preset position after correction as a reference preset position, and acquiring a second acquired image by using a camera after correction of the reference preset position; acquiring a cross-correlation diagram of the second acquired image and the reference image of the reference preset position in a spatial domain; Acquiring the distance between a pixel coordinate of a preset pixel value in the cross-correlation diagram and a position point of a reference image as an image offset distance; and determining that the correction is effective in response to the image offset distance being smaller than a distance threshold.
  8. 8. The method of claim 7, wherein the acquiring the cross-correlation map of the second acquired image and the reference image of the reference preset bit in the spatial domain comprises: Taking the second acquired image as a first image, taking the reference image of the reference preset position as a second image, or taking the area where the target object is located in the second acquired image as the first image and taking the area where the target object is located in the reference image of the reference preset position as the second image; converting the first image and the second image into a gray scale image; Performing Fourier transform on the converted first image and the converted second image respectively to obtain frequency spectrums corresponding to the first image and the second image respectively; calculating conjugate products of frequency spectrums corresponding to the first image and the second image respectively; and performing inverse Fourier transform on the conjugate product to obtain the cross-correlation diagram, or performing inverse Fourier transform on the conjugate product after normalizing to obtain the cross-correlation diagram.
  9. 9. The method according to claim 1, wherein the reference picture corresponding to the target preset bit and the first internal reference and the first external reference of the target preset bit are configured by: after the camera is determined to be positioned on the target preset position, acquiring an image acquired by the camera as a reference image corresponding to the target preset position, and acquiring the current holder posture parameter of the holder as the holder posture parameter configured for the target preset position; Calculating to obtain a first internal parameter and a first external parameter of the camera at the target preset position by using the calibration parameters of the camera and the holder posture parameters configured for the target preset position, wherein the first external parameter is used as an initial absolute posture configured for the target preset position, and the calibration parameters comprise the holder posture parameters of the camera at the time of calibration and a second external parameter.
  10. 10. The method of claim 9, wherein calculating the first internal parameter and the first external parameter of the camera at the target preset position by using the calibration parameter of the camera and the pan-tilt attitude parameter configured for the target preset position comprises: Taking a holder posture parameter configured for the target preset position as a first holder posture parameter and a holder posture parameter of the camera in the standard process as a second holder posture parameter, and acquiring holder posture deviation between the first holder posture parameter and the second holder posture parameter; Calculating a second pose deviation of the camera between the target preset position and the calibration position by using the horizontal rotation deviation and the vertical rotation deviation in the cradle head pose deviation; calculating a first internal parameter of the camera by using the lens zoom deviation, the second pose deviation and the second external parameter in the cradle head pose deviation, and Calculating a first external parameter of the camera by using the second pose deviation and the second external parameter; and/or, the calibrating step of the camera comprises the following steps: The camera is controlled to rotate to a view angle meeting the calibration requirement, and a third acquired image acquired by the camera is utilized to acquire the current holder posture parameter of the camera as the holder posture parameter of the camera in the calibration process; loading a scene three-dimensional model corresponding to the scene where the camera is located, and generating a current rendering picture with the visual overlapping degree of the third acquired image meeting the overlapping requirement; Acquiring a current rendering image corresponding to the current rendering picture by using the view port camera, and acquiring depth data corresponding to the current rendering picture as current depth data; And calculating a second external reference and a second internal reference of the camera in calibration by using a matching result between the third acquired image and the current rendered image and the current depth data.
  11. 11. An electronic device comprising a processor, a memory, the processor coupled to the memory, the processor configured to perform one or more steps of the camera preset deskewing method of any of claims 1-10 based on instructions stored in the memory.
  12. 12. A computer readable storage medium storing a computer program for execution by a processor to implement the steps of the camera preset deskewing method according to any one of claims 1 to 10.

Description

Camera preset position deviation rectifying method, device and storage medium Technical Field The application relates to the technical field of computer vision, in particular to a camera preset position deviation rectifying method, equipment and a storage medium. Background The video acquisition system is commonly used for picture acquisition and state recording of a specific scene area, and takes a transformer substation as an example, and the system captures images or records videos through a camera to realize real-time viewing of the state of equipment in the transformer substation. To facilitate accurate coverage of a particular location within the area, a preset bit needs to be set for the camera. In the related art, the preset position is set by manual operation, specifically, the camera cradle head rocker, the direction button or the 3D positioning function is operated, the rotation angle and the scaling multiple of the camera are adjusted, and the preset position setting is completed by combining the field picture. However, because the rotational inertia of the load of the camera pan-tilt is large, the pan-tilt driving motor is required to have a large torque, and the precision error of the preset position is caused by the mechanical gear gap and the precision of the structural component of the driving motor. And the error is accumulated when the preset position is called for a long time, and the preset position deviates from the initial setting position due to the influence of factors such as mechanical abrasion and the like, so that the normal check and record of the system on the equipment state are influenced. The current preset position deviation correction mainly depends on manual operation, and the method is time-consuming and labor-consuming and consumes a great amount of human resources. Especially in scenes such as transformer substations, chemical energy sources and the like, thousands of camera equipment are often arranged in a single scene, and hundreds of preset bits are arranged on average in each equipment. Disclosure of Invention In order to solve the technical problems, the application provides a method, equipment and a storage medium for correcting a preset position of a camera so as to improve the efficiency and accuracy of correcting the preset position of the camera. According to an embodiment of the present application, there is provided a camera preset position rectification method including: Acquiring a first acquisition image of a target preset position corresponding to a camera, and acquiring a reference image and reference depth data corresponding to the target preset position, wherein the first acquisition image is acquired after a holder of the camera rotates according to holder posture parameters corresponding to the target preset position; calculating the current absolute pose of the camera by using the matching result between the first acquired image and the reference depth data; Determining a first pose deviation of the camera at the target preset position based on the current absolute pose; and correcting at least the target preset position of the camera based on the first pose deviation. In order to solve the technical problems, the technical scheme adopted by the application is that the electronic equipment comprises a memory and a processor, wherein the memory is used for storing a computer program, and the computer program is used for realizing the camera preset bit deviation correcting method in the technical scheme when being executed by the processor. In order to solve the technical problems, the application adopts a technical scheme that a computer readable storage medium is provided, the computer readable storage medium is used for storing a computer program, and the computer program is used for realizing the camera preset position deviation correcting method in the technical scheme when being executed by a processor. According to the camera preset position deviation correcting method, the first acquired image of the camera corresponding to the target preset position and the reference image and the reference depth data corresponding to the target preset position are acquired, the current absolute pose of the camera is calculated by using the matching result between the first acquired image and the reference depth data, the first pose deviation of the camera at the target preset position is determined based on the current absolute pose, and the deviation of the target preset position of the camera is corrected based on the first pose deviation. Drawings In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort fo