CN-117274394-B - Self-calibration method of pan-tilt camera, storage medium and electronic equipment
Abstract
The invention relates to a self-calibration method, a storage medium and electronic equipment of a tripod head camera, which comprise the steps of controlling the selected tripod head camera to rotate for three times, calculating an initial tilt error of the tripod head, selecting a median from a plurality of initial tilt errors of the tripod head as a final initial tilt error of the tripod head, controlling the tripod head camera to rotate for two times, calculating the height of the camera, selecting the median from the heights of the plurality of cameras as the final height of the camera, recording parameters corresponding to the height of the final camera, calculating the longitude and latitude of the tripod head camera and the deflection angle of the camera in the tripod head camera when the Pan value is equal to 0, and determining the position information of the camera by utilizing the height of the camera and the longitude and latitude of the tripod head camera and determining the attitude information of the camera by utilizing the final initial tilt error and the attitude angle of the tripod head, so that the attitude angle precision can be improved.
Inventors
- Ru Junren
- GUO CHANGZHU
- WU SHENGYANG
Assignees
- 江苏范特科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230828
Claims (8)
- 1. The self-calibration method of the pan-tilt camera is characterized by comprising the following steps of: A first data recording step of controlling the selected tripod head camera to rotate for three times, wherein when the rotation of the tripod head camera is stopped each time in the three rotations, the central point of the picture of the tripod head camera is a ground area, and the PT value of the tripod head camera after each rotation in the three rotations and the longitude and latitude of the central point of the picture of the tripod head camera after each rotation in the three rotations are recorded, wherein the PT value comprises a Pan value and a tilt value; An error calculation step of calculating an initial tilt error of the cradle head based on the PT value of the cradle head camera after each rotation in the three rotations and the longitude and latitude of the central point of the picture of the cradle head camera after each rotation in the three rotations; Repeating the first data recording step and the error calculating step until the preset execution times are reached, stopping circulation, and selecting a median from a plurality of initial tilt errors of the cradle head as a final initial tilt error of the cradle head; A second data recording step, after determining the initial tilt error of the final pan-tilt, controlling the pan-tilt camera to rotate twice, wherein when the rotation of the pan-tilt camera is stopped each time in the two rotations, the center point of the picture of the pan-tilt camera is also a ground area, and recording the PT value of the pan-tilt camera after each rotation in the two rotations and the longitude and latitude of the center point of the picture of the pan-tilt camera after each rotation in the two rotations; A height calculating step, based on the initial tilt error of the final pan-tilt, the PT value of the pan-tilt camera after each rotation in the two rotations and the longitude and latitude of the central point of the picture of the pan-tilt camera after each rotation in the two rotations, calculating the height of the camera; repeating the second data recording step and the height calculating step until the preset execution times are reached, stopping circulation, selecting a median from the heights of a plurality of cameras as the final height of the cameras, and recording parameters corresponding to the final height of the cameras; calculating longitude and latitude of the Pan-tilt camera and a deflection angle of the camera in the Pan-tilt camera when the Pan value is equal to 0 based on parameters corresponding to the final height of the camera, wherein the deflection angle is an included angle between the camera and the north direction; And determining the position information of the camera by utilizing the final camera height and the longitude and latitude of the cradle head camera, and determining the attitude information of the camera by utilizing the final cradle head initial tilt error and the deflection angle.
- 2. The self-calibration method according to claim 1, wherein the longitude and latitude of the center point of the frame of the pan-tilt camera after each rotation in the three rotations are obtained by a hundred-degree pick-up coordinate system.
- 3. The self-calibration method according to claim 1 or 2, wherein the initial tilt error of the pan/tilt is obtained by the following formula: ; Wherein, O represents the projection point of the camera on the ground, A represents the central point of the picture of the tripod head camera after one rotation in the three rotations, L represents the position of the tripod head camera; representing the initial tilt error of the cradle head; And representing the tilt value corresponding to the central point A.
- 4. The self-calibration method according to claim 1, wherein the difference between Pan values for the two rotations is controlled between 45 degrees and 135 degrees.
- 5. The self-calibration method according to claim 4, wherein the camera height is obtained by the following formula: ; Wherein O represents a projection point of the camera on the ground, L represents a position of the tripod head camera, and C represents a center point of a picture of the tripod head camera after one rotation in the two rotations.
- 6. The self-calibration method according to claim 5, wherein the deflection angle is obtained by the following formula: ; Wherein, the The coordinate of the projection point O is (x, y), and pan_C represents the Pan value corresponding to the center point C of the frame of the cradle head camera after one rotation in the two rotations.
- 7. A storage medium having stored thereon a computer program, which when executed by a processor performs a method of self-calibrating a pan-tilt camera according to any of claims 1-6.
- 8. An electronic device comprising a processor, a memory and a computer program stored on the memory, wherein the processor executes the computer program to implement the method of self-calibrating a pan-tilt camera according to any of claims 1-6.
Description
Self-calibration method of pan-tilt camera, storage medium and electronic equipment Technical Field The present invention relates to the field of shooting devices, and in particular, to a self-calibration method for a pan-tilt camera, a storage medium, and an electronic device. Background Nowadays, shooting is performed by loading a shooting device such as a camera on a pan-tilt, and the like, and the shooting device is widely applied to various fields such as aerial photography, inspection, and the like. And, at present, the attitude of the pan-tilt camera can be measured by adopting a mode of installing an attitude measurement gyroscope, but the performance of an attitude measurement element is limited due to the limitations of volume, weight, cost and the like, so that the measured attitude angle of the pan-tilt camera is poor in precision. Disclosure of Invention First, the technical problem to be solved In view of the above-mentioned drawbacks and shortcomings of the prior art, the present invention provides a self-calibration method, a storage medium and an electronic device for a pan-tilt camera, which solve the technical problem of poor precision of the measured attitude angle of the pan-tilt camera in the prior art. (II) technical scheme In order to achieve the above purpose, the main technical scheme adopted by the invention comprises the following steps: In a first aspect, an embodiment of the present invention provides a self-calibration method for a Pan-tilt camera, where the self-calibration method includes a first data recording step of controlling a selected Pan-tilt camera to perform three rotations, and when rotation is stopped in each rotation of the Pan-tilt camera, a center point of a frame of the Pan-tilt camera is a ground area, and recording a PT value of the Pan-tilt camera after each rotation of the three rotations and a longitude and latitude of the center point of the frame of the Pan-tilt camera after each rotation of the three rotations; An error calculation step of calculating an initial tilt error of the cradle head based on the PT value of the cradle head camera after each rotation in three rotations and the longitude and latitude of the center point of the picture of the cradle head camera after each rotation in three rotations; Repeating the first data recording step and the error calculating step until the preset execution times are reached, stopping circulation, and selecting a median from the plurality of initial tilt errors of the cradle head as a final initial tilt error of the cradle head; The second data recording step, after determining the initial tilt error of the final cradle head, controls the cradle head camera to rotate twice, and when the cradle head camera stops rotating every time in the two rotations, the center point of the picture of the cradle head camera is also a ground area, and the PT value of the cradle head camera after each rotation in the two rotations and the longitude and latitude of the center point of the picture of the cradle head camera after each rotation in the two rotations are recorded; A height calculating step of calculating the height of the camera based on the PT value of the cradle head camera rotated each time in the two rotations and the longitude and latitude of the center point of the picture of the cradle head camera rotated each time in the two rotations; repeating the second data recording step and the height calculating step until the preset execution times are reached, stopping circulation, selecting a median from the heights of the plurality of cameras as the final height of the cameras, and recording parameters corresponding to the final height of the cameras; calculating longitude and latitude of the cradle head camera and a deflection angle of the camera in the cradle head camera when the Pan value is equal to 0 based on parameters corresponding to the height of the final camera, wherein the deflection angle is an included angle between the camera and the north direction; And determining the position information of the camera by using the height of the camera and the longitude and latitude of the cradle head camera, and determining the attitude information of the camera by using the final initial tilt error and deflection angle of the cradle head. In one possible embodiment, the longitude and latitude of the center point of the frame of the pan-tilt camera after each of the three rotations are obtained by using a hundred-degree pick-up coordinate system. In one possible embodiment, the initial tilt error of the pan/tilt is obtained by the following formula: The method comprises the steps of enabling an image of a camera to be projected on the ground, enabling A to be a center point of a picture of the camera with the cradle head after one rotation in three rotations, enabling L to be a position of the camera with the cradle head, enabling Tilt_error to be an initial Tilt error of the cradle head, and enabling Tilt_A