CN112348898B - Calibration method and device and camera - Google Patents

Calibration method and device and camera Download PDF

Info

Publication number
CN112348898B
CN112348898B CN201910725029.9A CN201910725029A CN112348898B CN 112348898 B CN112348898 B CN 112348898B CN 201910725029 A CN201910725029 A CN 201910725029A CN 112348898 B CN112348898 B CN 112348898B
Authority
CN
China
Prior art keywords
camera
pitch angle
target object
accelerometer
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910725029.9A
Other languages
Chinese (zh)
Other versions
CN112348898A (en
Inventor
林克荣
张振洲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikmicro Sensing Technology Co Ltd
Original Assignee
Hangzhou Hikmicro Sensing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikmicro Sensing Technology Co Ltd filed Critical Hangzhou Hikmicro Sensing Technology Co Ltd
Priority to CN201910725029.9A priority Critical patent/CN112348898B/en
Publication of CN112348898A publication Critical patent/CN112348898A/en
Application granted granted Critical
Publication of CN112348898B publication Critical patent/CN112348898B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration

Abstract

The embodiment of the invention provides a calibration method, a calibration device and a camera. The method comprises the following steps: acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object; correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots a target object; the preset offset is obtained by correcting zero offset of the accelerometer; and determining the number of pixel points included in an image area of the target object in the image shot by the camera on the target object based on the target pitch angle, and obtaining a calibration result. Compared with the prior art, the scheme provided by the embodiment of the invention can improve the accuracy of the camera calibration result.

Description

Calibration method and device and camera
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a calibration method, a calibration device and a camera.
Background
With the rapid development of artificial intelligence technology, image recognition technology is widely applied to people's daily life. For example, security inspection systems of transportation hubs such as airports, railway stations and the like can recognize the identity of passengers through face recognition technology; the access control system of the residential area can identify whether the vehicles entering the residential area are owner vehicles or not through license plate identification technology.
The image collected by the camera may include a plurality of objects, and the image recognition technology is only used for recognizing one or a plurality of objects, so that after the image is collected, the camera needs to screen the image areas of the plurality of objects included in the image to obtain the image area of the object to be recognized.
Based on this, in order to improve the accuracy of the image recognition result, after the camera is installed, the camera needs to be calibrated, and the calibration result is used as a screening basis on which the camera depends when screening the image area of the object to be recognized from the captured image.
In the related art, when a camera is calibrated, a pitch angle measured by an accelerometer when the camera shoots an object is used as a pitch angle when the camera shoots the object, and the camera is calibrated based on the pitch angle when the camera shoots the object.
However, the measurement accuracy of the camera accelerometer is affected due to the environment where the camera is located, so that the accuracy of the pitch angle of the camera obtained in the related art when shooting the object is not high, and finally the accuracy of the calibration result of the camera is low.
Disclosure of Invention
The embodiment of the invention aims to provide a calibration method, a calibration device and a camera, so as to improve the accuracy of a camera calibration result. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a calibration method, where the method includes:
acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object; the preset offset is obtained by correcting zero offset of the accelerometer;
and determining the number of pixel points included in an image area of the target object in the image shot by the camera on the target object based on the target pitch angle, and obtaining a calibration result.
Optionally, in a specific implementation manner, the method for correcting the zero offset of the accelerometer includes:
acquiring a preset measured value, and measuring an obtained real measured value by the accelerometer when the camera is kept on the optical calibration platform; wherein the preset measurement value corresponds to a standing state of the camera on the optical calibration platform;
Calculating a difference value between the real measured value and the preset measured value as the preset offset;
wherein the optical calibration platform comprises: the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, the emitted light of the collimator is parallel to the ground, the camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera coincides with the collimator target.
Alternatively, in one embodiment,
the camera is provided with a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range; before the initial pitch angle measured by the accelerometer in the camera is obtained when the camera shoots the target object, the method further comprises:
and setting an angle acquired when the real-time temperature of the accelerometer is within the preset temperature range as the initial pitch angle.
Optionally, in a specific implementation manner, the camera is a rotatable camera;
when the camera is used for shooting a target object, the step of obtaining the initial pitch angle measured by the accelerometer in the camera comprises the following steps:
When each preset period starts, acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
the step of correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object comprises the following steps:
correcting the initial pitch angle by using a preset offset and a preset compensation value of the current period to obtain a target pitch angle when the camera shoots the target object;
when the current period is a first period, the preset compensation value of the current period is zero; when the current period is not the first period, the preset compensation value of the current period is determined based on an installation pitch angle, and the installation pitch angle is: and after the camera is installed, when the cradle head is rotated to a zero position, the accelerometer measures the obtained pitch angle.
Optionally, in a specific implementation manner, when the current period is the non-first period, the determining manner of the preset compensation value of the current period includes:
when the current period starts, the cradle head is turned from the current position to a zero position, and when the cradle head is turned to the zero position, the accelerometer measures the pitch angle to be corrected;
And calculating the difference value between the pitch angle to be corrected and the installation pitch angle to serve as a preset compensation value of the current period.
Optionally, in a specific implementation manner, the step of obtaining the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object includes:
the method comprises the steps that in the process of continuously shooting a target object for multiple times, a camera obtains an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object each time;
the step of correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object comprises the following steps:
calculating an average value of the acquired plurality of initial pitch angles;
and correcting the average value by using a preset offset to obtain a target pitch angle when the camera shoots the target object.
Optionally, in a specific implementation manner, the step of determining, based on the target pitch angle, the number of pixels included in the image area of the target object in the image obtained by shooting the target object by the camera includes:
Determining the number of pixel points included in an image area of the target object in an image obtained by shooting the target object by the camera by using a first formula and a second formula;
wherein, the first formula is:
R*tg(α)=H
the second formula is:
n=h/(R*(u/f))
wherein n is the number of pixel points included in the image area of the target object, alpha is the target pitch angle, H is the mounting height of the camera, H is the height value of the target object, u is the pixel size of the camera, f is the focal length of the camera, and R is the distance between the field center point of the camera and the target object.
In a second aspect, an embodiment of the present invention provides a calibration device, including:
the angle acquisition module is used for acquiring an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object;
the angle correction module is used for correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object; the preset offset is obtained by correcting zero offset of the accelerometer;
and the result determining module is used for determining the number of pixels included in an image area of the target object in the image shot by the camera on the target object based on the target pitch angle to obtain a calibration result.
Optionally, in a specific implementation manner, the apparatus further includes: the zero degree correction module is used for correcting zero point offset of the accelerometer; the zero degree correction module includes:
the measured value acquisition sub-module is used for acquiring a preset measured value and a real measured value obtained by the accelerometer when the camera is kept on the optical calibration platform; wherein the preset measurement value corresponds to a standing state of the camera on the optical calibration platform;
the offset calculation operator module is used for calculating the difference value between the real measured value and the preset measured value to be used as the preset offset;
wherein the optical calibration platform comprises: the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, the emitted light of the collimator is parallel to the ground, the camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera coincides with the collimator target.
Alternatively, in one embodiment,
the camera is provided with a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range;
The angle acquisition module is specifically configured to, before acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object, set an angle acquired when a real-time temperature of the accelerometer is within the preset temperature range to the initial pitch angle.
Optionally, in a specific implementation manner, the camera is a rotatable camera;
the angle acquisition module is specifically used for acquiring an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object at the beginning of each preset period;
the angle correction module is specifically configured to correct the initial pitch angle by using a preset offset and a preset compensation value of a current period to obtain a target pitch angle when the camera shoots the target object;
when the current period is a first period, the preset compensation value of the current period is zero; when the current period is not the first period, the preset compensation value of the current period is determined based on an installation pitch angle, and the installation pitch angle is: and after the camera is installed, when the cradle head is rotated to a zero position, the accelerometer measures the obtained pitch angle.
Optionally, in a specific implementation manner, the apparatus further includes: the compensation value determining module is used for determining a preset compensation value of the current period when the current period is a non-first period; the compensation value determining module includes:
the cradle head rotating sub-module is used for rotating the cradle head from the current position to the zero position when the current period starts, and acquiring a pitch angle to be corrected, which is obtained by measuring the accelerometer when the cradle head rotates to the zero position;
and the compensation value calculation sub-module is used for calculating the difference value between the pitch angle to be corrected and the installation pitch angle and taking the difference value as a preset compensation value of the current period.
Alternatively, in one embodiment,
the angle acquisition module is specifically used for acquiring an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object every time in the process of continuously shooting the target object many times;
the angle correction module is specifically used for calculating the average value of the acquired initial pitch angles; and correcting the average value by using a preset offset to obtain a target pitch angle when the camera shoots the target object.
Optionally, in a specific implementation manner, the result determining module is specifically configured to:
determining the number of pixel points included in an image area of the target object in an image obtained by shooting the target object by the camera by using a first formula and a second formula;
wherein, the first formula is:
R*tg(α)=H
the second formula is:
n=h/(R*(u/f))
wherein n is the number of pixel points included in the image area of the target object, alpha is the target pitch angle, H is the mounting height of the camera, H is the height value of the target object, u is the pixel size of the camera, f is the focal length of the camera, and R is the distance between the field center point of the camera and the target object.
In a third aspect, an embodiment of the present invention provides a camera, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of any calibration method provided in the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the steps of any of the calibration methods provided in the first aspect.
The above can be seen that when the scheme provided by the embodiment of the invention is applied to calibrating the camera, the camera is not directly calibrated based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. The initial pitch angle is corrected by using an offset obtained by correcting the zero offset of the accelerometer in advance to obtain a target pitch angle, and then the camera is calibrated based on the obtained target pitch angle.
The initial pitch angle is corrected by using the preset offset, so that zero offset of the accelerometer in the camera caused by chip offset, PCB (Printed Circuit Board ) welding precision limitation and the like can be eliminated, the precision of the obtained target pitch angle is improved, and the accuracy of a camera calibration result is further improved. Furthermore, since the calibration result is the screening basis on which the camera depends when screening the image area of the object to be identified in the image obtained by shooting, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera when screening the image area of the object to be identified in the image obtained by shooting can be correspondingly improved, and further, the accuracy of image identification is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a calibration method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for correcting zero bias of an accelerometer according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an optical calibration platform according to an embodiment of the present invention;
FIG. 4 is a diagram showing an installation structure of a temperature controller in a camera according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a temperature controller for controlling the temperature of an accelerometer in a camera according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a heater-based control of temperature of an accelerometer in a camera according to an embodiment of the present invention;
FIG. 7 is a flow chart of another calibration method according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a method for determining a preset compensation value of a current period when the current period is a non-first period according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a calibration device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a video camera according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the related art, when a camera is calibrated, a pitch angle measured by an accelerometer when the camera shoots an object is used as a pitch angle when the camera shoots the object, and the camera is calibrated based on the pitch angle when the camera shoots the object. However, the measurement accuracy of the camera accelerometer is affected due to the environment where the camera is located, so that the accuracy of the pitch angle of the camera obtained in the related art when shooting the object is not high, and finally the accuracy of the calibration result of the camera is low. In order to solve the technical problems, the embodiment of the invention provides a calibration method.
Next, a calibration method provided by the embodiment of the present invention will be described first.
Fig. 1 is a schematic flow chart of a calibration method according to an embodiment of the present invention. The method can be applied to any camera needing calibration, the camera can be a fixed-point camera with a fixed shooting angle, and also can be a rotatable camera with a tripod head, and when the camera is the rotatable camera, the shooting angle of the camera can be changed along with the rotation of the tripod head. The embodiment of the present invention is not particularly limited, and is hereinafter referred to as a camera.
Wherein, the calibration refers to: and establishing a corresponding relation between the world coordinate system and the number of pixel points included in an image area in the image acquired by the camera by shooting a target object set in the world coordinate system.
Specific: after the camera is installed, the camera shoots a target object with known height in a world coordinate system, and then the camera determines the distance between the target object and the center point of the visual field of the camera and the number of pixel points included in the acquired image according to the pitch angle when shooting the target object, the height of the target object and related physical parameters of the camera. The determined number of the pixels is the final determined calibration result.
In this way, in the image recognition process, when there are a plurality of image areas including various shooting objects in the image shot by the camera, for each image area, the camera can judge whether the object included in the image area is the object needing to perform image recognition according to the number relation between the number of pixel points included in the image area and the determined calibration result.
That is, the camera can screen by using the determined calibration result for a plurality of image areas including various types of photographing subjects existing in the photographed image, to obtain an image area required for image recognition.
As shown in fig. 1, a calibration method provided by an embodiment of the present invention may include the following steps:
s101: acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
s102: correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots a target object;
the preset offset is obtained by correcting zero offset of the accelerometer;
s103: and determining the number of pixel points included in an image area of the target object in the image shot by the camera on the target object based on the target pitch angle, and obtaining a calibration result.
The above can be seen that when the scheme provided by the embodiment of the invention is applied to calibrating the camera, the camera is not calibrated directly based on the initial pitch angle measured by the accelerometer in the camera. The initial pitch angle is corrected by using an offset obtained by correcting the zero offset of the accelerometer in advance to obtain a target pitch angle, and then the camera is calibrated based on the obtained target pitch angle.
The initial pitch angle is corrected by using the preset offset, so that zero offset of the accelerometer in the camera caused by chip offset, PCB (Printed Circuit Board ) welding precision limitation and the like can be eliminated, the precision of the obtained target pitch angle is improved, and the accuracy of a camera calibration result is further improved. Furthermore, since the calibration result is relied on when the image area of the object to be identified is screened in the image, when the accuracy of the calibration result of the camera is improved, the accuracy of the camera when the image area of the object to be identified is screened in the image obtained by shooting can be correspondingly improved, and further, the accuracy of image identification is improved.
When the camera is installed, the camera needs to be calibrated when the camera is about to be put into use, and the calibration of the camera is realized based on the fact that the camera shoots an object to obtain an image.
Based on this, in the calibration method provided by the embodiment of the invention, a target object for camera calibration is set first. When the application scenes of the cameras are different, the set target objects can be different. For example, when the camera is used for personnel detection, the target object may be a person or a mannequin; when the camera is used for license plate detection, the target object may be a license plate suspended from the vehicle.
After the target object for camera calibration is set, the camera may execute the above step S101, and acquire the initial pitch angle obtained from measurement by the accelerometer in the camera when shooting the target object.
Among them, an accelerometer is a sensor in a camera, which essentially detects micro-deformations of a sensitive element due to inertial forces using MEMS (Microelectromechanical Systems, microelectromechanical system) technology.
Specifically, in the world coordinate system, the vertical downward direction is the Z axis, and when the accelerometer is horizontally placed on the horizontal desktop, the accelerometer can output 1g of acceleration in the Z axis direction because the sensitive element of the accelerometer generates downward deformation under the action of gravity in the Z axis direction. Wherein g represents the acceleration of gravity, which may typically be 9.8m/s 2 . Of course, when the geographic locations at which the accelerometers are located are different, the particular value of g may vary as the geographic locations vary.
Based on this, the accelerometer can measure acceleration including gravitational acceleration, and the accelerometer can measure only gravitational acceleration when the camera in which the accelerometer is located is in a stationary or uniform motion (uniform linear motion). According to the relationship between the gravity acceleration and the world coordinate system, the accelerometer can measure the angle relationship between the plane where the accelerometer is positioned and the ground, and then the pitch angle of the camera where the accelerometer is positioned can be obtained.
After the step S101 is completed to obtain the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object, the camera may continue to execute the step S102, that is, correct the initial pitch angle by using the offset obtained by correcting the zero offset of the accelerometer in the camera in advance, to obtain the target pitch angle when the camera shoots the target object.
Wherein, for the sensor, zero degree offset means: in the case where the sensor has no angular input, for example, when the sensor is placed horizontally on a horizontal table, the ideal value of the measured output of the sensor should be zero. However, the true value of the measured output of the sensor may not be zero due to chip offset, PCB soldering accuracy limitations, chip mounting accuracy limitations, and the like. The true value of the measured output of the sensor is the zero offset of the sensor when the true value of the measured output is not zero.
Obviously, the accelerometer in the camera is also a sensor, and then the accelerometer in the camera also has zero offset caused by chip offset, PCB welding precision limitation, chip mounting precision limitation and the like. In addition, zero offset of the accelerometer in the camera can be influenced by the structural assembly precision of the accelerometer in the camera, the optical path deviation of a camera lens and the like.
Based on this, when the camera is resting on a horizontal table, the ideal value of the output of the in-camera accelerometer on the X, Y, Z axis of the world coordinate system should be (0, 1 g) or (0, -1 g), however, in practical application, when the camera is resting on the horizontal table, the actual value of the output of the in-camera accelerometer on the X, Y, Z axis of the actual coordinate system is likely to be unequal to the ideal value, and the difference between the actual value of the output of the in-camera accelerometer on the X, Y, Z axis of the world coordinate system and the ideal value is the zero offset of the in-camera accelerometer.
Wherein the sign of 1g in the ideal value (0, 1 g) or (0, -1 g) depends on whether the positive direction of the Z-axis in the world coordinate system is vertically upward or vertically downward, and when the positive direction of the Z-axis in the world coordinate system is vertically upward, the ideal value of the output of the accelerometer in the camera on the X, Y, Z axis of the actual coordinate system is (0, 1 g), and the ideal value of the output of the accelerometer in the camera on the X, Y, Z axis of the actual coordinate system is (0, -1 g).
It can be understood that when the zero offset exists in the accelerometer in the camera, the measured initial pitch angle is affected by the zero offset when the camera is shooting the target object, so that the accuracy of the measured initial pitch angle is lower.
Because of this, in order to improve the calibration accuracy of the camera, the accuracy of the pitch angle measured by the accelerometer in the camera needs to be improved when the camera shoots the target object, and therefore, after the initial pitch angle measured by the accelerometer in the camera is obtained, the initial pitch angle needs to be corrected, so that the accuracy of the target pitch angle used for calibrating the camera is improved.
Specifically, in the step S102, the camera may correct the initial pitch angle by using an offset obtained by correcting the zero offset of the accelerometer in the camera in advance, that is, by eliminating the zero offset of the accelerometer in the camera, the accuracy of the target pitch angle used for calibrating the camera is improved.
Optionally, in a specific implementation manner, as shown in fig. 2, the manner of correcting the zero offset of the accelerometer may include the following steps:
S201: acquiring a preset measured value, and measuring a real measured value by an accelerometer when the camera is kept on the optical calibration platform;
the preset measured value corresponds to the standing state of the camera on the optical calibration platform;
s202: calculating a difference value between the real measured value and a preset measured value to serve as a preset offset;
in this particular implementation, the camera may be left on the optical school platform before the camera is shipped or installed. At this time, according to the state of rest of the camera on the optical correction platform, a preset measurement value of the accelerometer in the camera can be determined, and the preset measurement value is a measurement value of the accelerometer in the camera in an ideal state in which zero point bias does not exist.
For example, when the camera is resting on the optical correction stage, the preset measurements of the accelerometer within the camera should be (0, 1 g) or (0, -1 g).
In addition, when the camera is placed on the optical calibration platform, the accelerometer in the camera can also measure and obtain a real measured value according to the current placement state of the camera.
Obviously, when the real measured value is the same as the preset measured value, it can be stated that the accelerometer in the camera has no zero offset, and the offset obtained by correcting the zero offset of the accelerometer at the moment is 0; in contrast, when the real measured value is different from the preset measured value, it can be stated that the zero offset exists in the accelerometer in the camera, and the difference between the real measured value and the preset measured value is the zero offset of the accelerometer in the camera, and then the difference can be used as the offset obtained by correcting the zero offset of the accelerometer.
Specifically, in this embodiment, as shown in fig. 3, the optical calibration platform may be composed of a collimator 220, an optical axis adjusting device 210, and a loading platform 230.
Wherein, the loading platform 230 may also be referred to as an optical stabilization platform 230, which is a horizontal table. In order to ensure that the offset obtained by correcting the zero offset of the accelerometer can have higher accuracy, the horizontal accuracy of the loading platform 230 needs to be higher than the preset accuracy requirement for the target pitch angle when the camera shoots the target object.
In addition, the collimator 220 and the optical axis adjusting device 210 may be installed at the same side of the loading platform 230. The collimator 220 is suitable for an optical instrument for generating a parallel light beam, and a circular target is marked at the center of a tangential plane of the collimator 220.
In this embodiment, the light emitted by the collimator 220 is parallel to the ground, the camera 200 to be subjected to zero offset correction of the accelerometer may be fixed on the optical axis adjustment device 210, and the tilt angle of the camera 200 may be adjusted by adjusting the optical axis adjustment device 210 so that the center of the image shot by the camera 200 coincides with the target of the collimator 220, thereby completing the adjustment of the viewing axis of the camera 220. When the camera 200 is a rotatable camera, the optical axis adjusting device 210 may be a cradle head 220.
In this way, the alignment of the visual axis of the camera 200 can be made horizontal, thereby ensuring that the predetermined measurement of the accelerometer in the camera should be (0, 1 g) or (0, -1 g). The visual axis is an axis on which a line connecting the center of the image captured by the camera 200 and the center of the lens is located.
After the collimator 220 and the optical adjustment device 210 are adjusted, the camera 200 can obtain a real measurement value obtained by measuring an accelerometer in the camera, and further, a preset offset corresponding to the camera 200 is obtained by calculating a difference between the real measurement value and a preset measurement value.
Further, after the preset offset is obtained, the camera 200 may store the preset offset in a nonvolatile memory area in a local SOC (System on Chip) for practical use in a subsequent calibration process of the camera.
In this embodiment, the manner in which the camera obtains the preset measurement value may be obtained from other electronic devices connected in communication, or may be input in advance in the camera by a user. The embodiment of the present invention is not particularly limited in this regard.
In addition, the camera may perform the above step S102 in various manners, and thus, embodiments of the present invention are not particularly limited.
Preferably, the manner in which the camera performs the above step S102 may include:
and calculating a difference value between the initial pitch angle and a preset offset, and taking the obtained difference value as a target pitch angle when the camera shoots a target object.
Preferably, the manner in which the camera performs the above step S102 may further include:
and calculating the difference between the initial pitch angle and the preset offset, further calculating the product of the obtained difference and the preset correction coefficient, and taking the obtained product as the target pitch angle when the camera shoots the target object.
After the step S102 is performed to obtain the target pitch angle, the camera may continue to perform the step S103, and determine, based on the target pitch angle, the number of pixels included in the image area of the target object in the image obtained by shooting the target object by the camera, thereby obtaining the calibration result.
Optionally, in a specific implementation manner, the manner in which the camera performs the step S103 may include the following steps:
determining the number of pixel points included in an image area of a target object in an image shot by a camera on the target object by using a first formula and a second formula;
Wherein, the first formula is:
R*tg(α)=H
the second formula is:
n=h/(R*(u/f))
wherein n is the number of pixel points included in the image area of the target object, alpha is the target pitch angle, H is the mounting height of the camera, H is the height value of the target object, u is the pixel size of the camera, f is the focal length of the camera, and R is the distance between the central point of the field of view of the camera and the target object.
The pixel size u of the camera characterizes the pixel size of the camera sensor, which is then determined after the sensor of the camera has been determined.
Preferably, since the first formula and the second formula are connected through R, the first formula and the second formula may be combined, thereby obtaining a third formula for calculating the number n of pixels included in the image area of the target object. Wherein, the third formula obtained by calculation is as follows:
based on this, after the camera obtains the target pitch angle α, the number n of pixels included in the image area of the target object may also be calculated directly by using the third formula.
Further, for the accelerometer in the camera, along with the temperature change of the accelerometer in the camera, parameters of components in the accelerometer in the camera also change, so that the accelerometer in the camera generates temperature drift, the accuracy of a pitch angle obtained by measurement is influenced, and the accuracy of camera calibration is further influenced. In addition, in the process of camera calibration and receiving and in the process of being put into use, the temperature drift can continuously influence the accuracy of the pitch angle measured by the accelerometer in the camera, so that the accuracy of a final image recognition result can be influenced.
Based on this, in order to suppress the above-mentioned influence of temperature drift on the accuracy of the pitch angle measured by the in-camera accelerometer, i.e. in order to temperature compensate the in-camera accelerometer, optionally in a specific implementation,
a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range can be arranged in the camera;
in this specific implementation manner, before the initial pitch angle measured by the accelerometer in the camera is obtained when the camera shoots the target object in step S101, the calibration method further includes the following steps:
and setting an angle acquired when the real-time temperature of the accelerometer is within a preset temperature range as an initial pitch angle.
Thus, in this specific implementation manner, the initial pitch angle obtained when the camera executes the above step S101 is: and the real-time temperature of the accelerometer is within a preset temperature range.
Preferably, as shown in fig. 4, an installation structure of the temperature controller in the camera is shown.
The temperature control device can comprise a temperature control device which is in direct contact with the accelerometer in the camera, and a temperature sensing chip which is in communication connection with the temperature control device. Specifically, in the embodiment shown in fig. 4, the temperature control device may be a semiconductor refrigerator (Thermoelectric Cooler, TEC), and the temperature sensing chip may be a dedicated TEC control IC (semiconductor chip). Specifically, the temperature of the TEC control IC is controlled by the TEC control IC; meanwhile, the TEC control IC can acquire the real-time temperature of the accelerometer through a thermistor in direct contact with the semiconductor refrigerator and feed the real-time temperature back to the semiconductor refrigerator, so that closed-loop control of the real-time temperature of the accelerometer is realized, and the aim of controlling the real-time temperature of the accelerometer is fulfilled.
In order to better understand how the temperature controller controls the real-time temperature of the accelerometer within the preset temperature range, as shown in fig. 5, a schematic diagram of the temperature controller controlling the temperature of the accelerometer in the camera is shown. The SOC sets the output voltage value of the DAC (Digital to Analog Converter, digital-to-analog converter) chip. Wherein the DAC chip outputs the Vset voltage value, and the voltage value Vtemp output by the thermistor on the TEC for representing the temperature of the semiconductor refrigerator is compared with the voltage value Vset output by the DAC chip in the TEC control IC. When the value of Vtemp is larger than Vset, the TEC control IC can start a temperature control function, and adjust the direction and the magnitude of the output current on the pin TEC +/-to control the real-time temperature of the accelerometer in the camera, so that the real-time temperature of the accelerometer in the camera is stabilized in a preset temperature range, and the effect of temperature compensation of the accelerometer in the camera is achieved.
In addition, in order to suppress the influence of the temperature drift on the accuracy of the pitch angle measured by the accelerometer in the camera, that is, in order to perform temperature compensation on the accelerometer in the camera, in another specific implementation manner, the camera may be calibrated in a higher temperature environment.
For example, the camera may be calibrated in a thermostatic chamber around 50 ℃.
Thus, in this particular implementation, temperature compensation for the accelerometer within the camera may be reduced to include only low temperature compensation. Wherein the semiconductor refrigerator shown in fig. 4 above can be replaced with a heater, thereby simplifying the design, reducing the cost and engineering complexity of the accelerometer within the camera.
For example, as shown in fig. 6, a schematic diagram of a heater-based control of the temperature of an accelerometer in a camera is shown. The ADC (Analog to Digital Converter, analog-to-digital converter) pin of the main control IC obtains the thermistor voltage value of the heating plate, converts the thermistor voltage value into corresponding temperature information, and further realizes the control of the on-off of the heating plate power supply through the feedback of the temperature information obtained by conversion, thereby achieving the purpose of adjusting the real-time temperature of the accelerometer and performing temperature compensation on the accelerometer in the camera.
The active IC may be an MCU (Micro Control Unit micro control unit) or an SOC, and of course, may also be other chips, which is not limited in particular.
It can be understood that when the camera is a rotatable camera, after the calibration of the camera is completed and the camera is put into use, the camera can continuously change the shooting angle of the camera by rotating the holder according to the requirements in practical application. Furthermore, as the rotation of the cradle head can cause mechanical deformation such as PCB deformation, sheet metal deformation and the like of the accelerometer in the camera, the accelerometer in the camera can generate new mechanical errors in the process of multiple rotation of the cradle head. Obviously, the new mechanical errors generated above may lead to the accuracy of the pitch angle measured by the accelerometer inside the camera. In this way, in order to ensure continuous accuracy of the accelerometer in the rotatable camera in a long time, the rotatable camera can be periodically calibrated according to a preset period, so as to eliminate the decrease of the accuracy of the pitch angle measured by the accelerometer in the camera in the current period due to the new mechanical error generated in the current period, thereby ensuring that the pitch angle measured by the accelerometer in the rotatable camera can have higher accuracy in each preset period.
Based on this, in an alternative, in a specific implementation, when the camera is a rotatable camera;
the step S101 may be performed to obtain the initial pitch angle measured by the accelerometer in the camera when the camera photographs the target object, as shown in fig. 7, and may include the following steps:
s701: when each preset period starts, acquiring an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object;
the step S102 of correcting the initial pitch angle by using the preset offset to obtain the target pitch angle when the camera shoots the target object may include the following steps S702:
s702: correcting the initial pitch angle by using a preset offset and a preset compensation value of the current period to obtain a target pitch angle when the camera shoots a target object;
when the current period is the first period, the preset compensation value of the current period is zero; when the current period is not the first period, the preset compensation value of the current period is determined based on the installation pitch angle, and the installation pitch angle is: after the camera is installed, when the cradle head is rotated to a zero position, the accelerometer measures the obtained pitch angle.
Step S103, based on the target pitch angle, determines the number of pixels included in the image area of the target object in the image captured by the camera on the target object, so as to obtain a calibration result, and may include the following step S703:
s703: and determining the number of pixel points included in an image area of the target object in the image shot by the camera on the basis of the target pitch angle, and obtaining a calibration result in the current period.
It will be appreciated that when the camera is installed, the camera will enter a first preset period, and at this time, since the pan-tilt has not rotated many times, it can be considered that no mechanical error has occurred due to the multiple rotations of the pan-tilt, and based on this, the preset compensation value in the first preset period can be considered to be zero. At this time, the camera may acquire and store the installation pitch angle measured by the accelerometer when the pan-tilt is turned to the zero position, so that a preset compensation value in each period can be determined based on the installation pitch angle at the beginning of the period.
Further, when the camera is ready to enter each cycle after the first preset cycle, since the pan-tilt can be rotated many times, a mechanical error due to the rotation of the pan-tilt can be generated. Based on this, a preset compensation value for the current period can be determined based on the installation pitch angle described above. When the current period is not the first period, the camera may determine the preset compensation value of the current period in a plurality of ways, which is not particularly limited in the embodiment of the present invention.
Preferably, as shown in fig. 8, when the current period is not the first period, the determining method of the preset compensation value of the current period may include the following steps:
s801: when the current period starts, the cradle head is turned from the current position to a zero position, and when the cradle head is turned to the zero position, the accelerometer measures the pitch angle to be corrected;
s802: and calculating the difference between the pitch angle to be corrected and the installation pitch angle, and taking the difference as a preset compensation value of the current period.
When the current period is not the first preset period, the camera is ready to enter the current period when the current period starts, and at the moment, the camera can rotate the cradle head from the current position to the zero position, and then the pitch angle of the current moment measured by the accelerometer is obtained when the cradle head rotates to the zero position, namely the pitch angle to be corrected is obtained. Thus, the camera can compare the pitch angle to be corrected with the installation pitch angle.
Obviously, when the obtained pitch angle to be corrected is the same as the installation pitch angle, it can be stated that no mechanical error caused by rotation of the pan-tilt is generated in the use process from the start of the camera to the start of the current period, so that it can be determined that the preset compensation value is still zero in the current period. And when the current period starts, the difference between the acquired pitch angle to be corrected and the installation pitch angle is zero. Obviously, the difference between the acquired pitch angle to be corrected and the installation pitch angle at the beginning of the current period may also be determined as a preset compensation value of the current period.
Correspondingly, when the obtained pitch angle to be corrected is different from the installation pitch angle, it can be stated that a mechanical error caused by rotation of the pan-tilt is generated in the use process from the start of the camera to the start of the current period, and the mechanical error causes the difference between the obtained pitch angle to be corrected and the installation pitch angle. Therefore, when the current period starts, the obtained pitch angle to be corrected is different from the installation pitch angle, the camera can calculate the difference between the obtained pitch angle to be corrected and the installation pitch angle at the beginning of the current period, and the calculated difference is determined as a preset compensation value of the current period.
The duration of the preset period can be set according to the related mechanical parameters of the camera and the accuracy requirement of the pitch angle measured by the accelerometer in practical application, and therefore the embodiment of the invention does not limit the specific duration of the preset period.
Further, the camera may be allowed to execute the above steps S801 to 802, and the above steps S701 to S703 at the start of each cycle by the timing function of the camera itself.
Further, for the rotatable camera, in the process of acquiring an image and screening the image area of each object in the image in the process of putting the rotatable camera into use, when the image area of each object in the image is determined by using the pitch angle measured by the accelerometer in the rotatable camera, the pitch angle measured by the accelerometer in the rotatable camera is corrected by using the preset offset and the preset compensation value of the current period, and then the image area of each object in the image is determined by using the corrected pitch angle.
In practical application, the measured value of the sensor is easily interfered by noise, so that the accuracy of the measured value is affected, and in order to avoid the noise interference, the accuracy of the measured value is usually improved by a method of measuring an average value by a plurality of times, and by canceling the noise among the plurality of times of measured values.
Based on this, since the initial pitch angle measured by the accelerometer in the camera may also be disturbed by noise when the camera photographs the target object, thereby affecting the accuracy of the initial pitch angle, in an alternative embodiment, the method for obtaining the initial pitch angle measured by the accelerometer in the camera when the camera photographs the target object may include the following steps:
The method comprises the steps that in the process of continuously shooting a target object for multiple times, a camera obtains an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object each time;
that is, in a specific implementation, when the camera is calibrated, the camera may take a plurality of consecutive shots of the target object at a preset shooting frequency. The camera can acquire initial pitch angles measured by the accelerometer in the camera during each shooting, so that the camera can acquire a plurality of initial pitch angles.
Based on this, in this specific implementation manner, the camera executes the above step S102, and corrects the initial pitch angle by using the preset offset, so as to obtain the target pitch angle when the camera shoots the target object, and may include the following steps:
step 1: calculating an average value of the acquired plurality of initial pitch angles;
step 2: and correcting the average value by using a preset offset to obtain a target pitch angle when the camera shoots the target object.
That is, in this embodiment, after obtaining a plurality of initial pitch angles, the camera may calculate an average value of the plurality of initial pitch angles, and then correct the calculated average value by using a preset offset, so as to obtain a target pitch angle when the camera photographs a target object.
Corresponding to the calibration method provided by the embodiment of the invention, the embodiment of the invention also provides a calibration device.
FIG. 9 is a schematic structural diagram of a calibration device according to an embodiment of the present invention. As shown in fig. 9, the calibration device may include the following modules:
the angle acquisition module 910 is configured to acquire an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object;
the angle correction module 920 is configured to correct the initial pitch angle by using a preset offset, so as to obtain a target pitch angle when the camera shoots a target object; the preset offset is obtained by correcting zero offset of the accelerometer;
and the result determining module 930 is configured to determine, based on the target pitch angle, the number of pixels included in the image area of the target object in the image captured by the camera on the target object, and obtain a calibration result.
The above can be seen that when the scheme provided by the embodiment of the invention is applied to calibrating the camera, the camera is not directly calibrated based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. The initial pitch angle is corrected by using an offset obtained by correcting the zero offset of the accelerometer in advance to obtain a target pitch angle, and then the camera is calibrated based on the obtained target pitch angle.
The initial pitch angle is corrected by using the preset offset, so that zero offset of the accelerometer in the camera caused by chip offset, PCB (Printed Circuit Board ) welding precision limitation and the like can be eliminated, the precision of the obtained target pitch angle is improved, and the accuracy of a camera calibration result is further improved. Furthermore, since the calibration result is the screening basis on which the camera depends when screening the image area of the object to be identified in the image obtained by shooting, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera when screening the image area of the object to be identified in the image obtained by shooting can be correspondingly improved, and further, the accuracy of image identification is improved.
Optionally, in a specific implementation manner, the calibration device may further include: the zero degree correction module is used for correcting zero point offset of the accelerometer;
in this specific implementation, the zero degree correction module may include:
the measured value acquisition sub-module is used for acquiring a preset measured value and a real measured value obtained by measuring the accelerometer when the camera is placed on the optical calibration platform; the preset measured value corresponds to the standing state of the camera on the optical calibration platform;
The offset calculation operator module is used for calculating the difference value between the real measured value and the preset measured value to be used as the preset offset;
wherein, optical calibration platform includes: the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, the emitted light of the collimator is parallel to the ground, the camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera coincides with a collimator target.
Optionally, in a specific implementation manner, the camera is provided with a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range;
in this specific implementation manner, the angle obtaining module 910 may be specifically configured to, before obtaining the initial pitch angle measured by the accelerometer in the camera when the camera photographs the target object, set the angle obtained when the real-time temperature of the accelerometer is within the preset temperature range to the initial pitch angle.
Optionally, in a specific implementation manner, the camera may be a rotatable camera;
in this specific implementation manner, the angle obtaining module 910 may be specifically configured to obtain, when each preset period starts, an initial pitch angle measured by an accelerometer in the camera when the camera photographs the target object;
The angle correction module can be specifically used for correcting the initial pitch angle by using a preset offset and a preset compensation value of the current period to obtain a target pitch angle when the camera shoots a target object;
when the current period is the first period, the preset compensation value of the current period is zero; when the current period is not the first period, the preset compensation value of the current period is determined based on the installation pitch angle, and the installation pitch angle is: after the camera is installed, when the cradle head is rotated to a zero position, the accelerometer measures the obtained pitch angle.
Optionally, in a specific implementation manner, the calibration device may further include: the compensation value determining module is used for determining a preset compensation value of the current period when the current period is not the first period;
in this specific implementation manner, the compensation value determining module may include:
the cradle head rotating sub-module is used for rotating the cradle head from the current position to a zero position when the current period starts, and acquiring a pitch angle to be corrected, which is measured by the accelerometer when the cradle head rotates to the zero position;
and the compensation value calculation sub-module is used for calculating the difference value between the pitch angle to be corrected and the installation pitch angle and taking the difference value as a preset compensation value of the current period.
Alternatively, in one embodiment,
the angle obtaining module 910 may be specifically configured to obtain, when the camera photographs the target object for a plurality of times, an initial pitch angle measured by an accelerometer in the camera during each time of photographing the target object by the camera;
the angle correction module 920 may be specifically configured to calculate an average value of the obtained plurality of initial pitch angles; and correcting the average value by using a preset offset to obtain a target pitch angle when the camera shoots the target object.
Optionally, in a specific implementation manner, the above result determining module 930 may be specifically configured to:
determining the number of pixel points included in an image area of a target object in an image shot by a camera on the target object by using a first formula and a second formula;
wherein, the first formula is:
R*tg(α)=H
the second formula is:
n=h/(R*(u/f))
wherein n is the number of pixel points included in the image area of the target object, alpha is the target pitch angle, H is the mounting height of the camera, H is the height value of the target object, u is the pixel size of the camera, f is the focal length of the camera, and R is the distance between the central point of the field of view of the camera and the target object.
Corresponding to the calibration method provided by the embodiment of the invention, the embodiment of the invention also provides a camera, as shown in fig. 10, comprising a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004,
a memory 1003 for storing a computer program;
the processor 1001 is configured to implement the calibration method provided in the above embodiment of the present invention when executing the program stored in the memory 1003.
Specifically, the calibration method comprises the following steps:
acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots a target object; the preset offset is obtained by correcting zero offset of the accelerometer;
and determining the number of pixel points included in an image area of the target object in the image shot by the camera on the target object based on the target pitch angle, and obtaining a calibration result.
It should be noted that, other implementation manners of a calibration method implemented by the processor 1001 executing the program stored in the memory 1003 are the same as the calibration method embodiment provided in the method embodiment section, and are not repeated here.
The above can be seen that when the scheme provided by the embodiment of the invention is applied to calibrating the camera, the camera is not directly calibrated based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. The initial pitch angle is corrected by using an offset obtained by correcting the zero offset of the accelerometer in advance to obtain a target pitch angle, and then the camera is calibrated based on the obtained target pitch angle.
The initial pitch angle is corrected by using the preset offset, so that zero offset of the accelerometer in the camera caused by chip offset, PCB (Printed Circuit Board ) welding precision limitation and the like can be eliminated, the precision of the obtained target pitch angle is improved, and the accuracy of a camera calibration result is further improved. Furthermore, since the calibration result is the screening basis on which the camera depends when screening the image area of the object to be identified in the image obtained by shooting, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera when screening the image area of the object to be identified in the image obtained by shooting can be correspondingly improved, and further, the accuracy of image identification is improved.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Corresponding to the calibration method provided by the embodiment of the invention, the embodiment of the invention also provides a computer readable storage medium, and the computer program realizes the calibration method provided by the embodiment of the invention when being executed by a processor.
Specifically, the calibration method comprises the following steps:
acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots a target object; the preset offset is obtained by correcting zero offset of the accelerometer;
and determining the number of pixel points included in an image area of the target object in the image shot by the camera on the target object based on the target pitch angle, and obtaining a calibration result.
It should be noted that, other implementation manners of a calibration method implemented when the computer program is executed by the processor are the same as the embodiments of a calibration method provided in the foregoing method embodiment, and are not described herein again.
The above can be seen that when the scheme provided by the embodiment of the invention is applied to calibrating the camera, the camera is not directly calibrated based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. The initial pitch angle is corrected by using an offset obtained by correcting the zero offset of the accelerometer in advance to obtain a target pitch angle, and then the camera is calibrated based on the obtained target pitch angle.
The initial pitch angle is corrected by using the preset offset, so that zero offset of the accelerometer in the camera caused by chip offset, PCB (Printed Circuit Board ) welding precision limitation and the like can be eliminated, the precision of the obtained target pitch angle is improved, and the accuracy of a camera calibration result is further improved. Furthermore, since the calibration result is the screening basis on which the camera depends when screening the image area of the object to be identified in the image obtained by shooting, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera when screening the image area of the object to be identified in the image obtained by shooting can be correspondingly improved, and further, the accuracy of image identification is improved.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus embodiment, the camera embodiment, the computer readable storage medium embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points are referred to in the partial description of the method embodiment.
The foregoing is merely illustrative of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method of calibration, the method comprising:
acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object; the preset offset is obtained by correcting zero offset of the accelerometer;
Determining the number of pixel points included in an image area of the target object in an image obtained by shooting the target object by the camera based on the target pitch angle, and obtaining a calibration result;
and in the image recognition process, the number relation between the calibration result and the number of the pixel points included in the image region acquired in the image recognition process is used for screening the image region to be subjected to image recognition from the image region acquired in the image recognition process.
2. The method of claim 1, wherein correcting for zero bias of the accelerometer comprises:
acquiring a preset measured value, and measuring an obtained real measured value by the accelerometer when the camera is kept on the optical calibration platform; wherein the preset measurement value corresponds to a standing state of the camera on the optical calibration platform;
calculating a difference value between the real measured value and the preset measured value as the preset offset;
wherein the optical calibration platform comprises: the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, the emitted light of the collimator is parallel to the ground, the camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera coincides with the collimator target.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the camera is provided with a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range; before the initial pitch angle measured by the accelerometer in the camera is obtained when the camera shoots the target object, the method further comprises:
and setting an angle acquired when the real-time temperature of the accelerometer is within the preset temperature range as the initial pitch angle.
4. A method according to any one of claims 1-3, wherein the camera is a rotatable camera;
when the camera is used for shooting a target object, the step of obtaining the initial pitch angle measured by the accelerometer in the camera comprises the following steps:
when each preset period starts, acquiring an initial pitch angle measured by an accelerometer in a camera when the camera shoots a target object;
the step of correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object comprises the following steps:
correcting the initial pitch angle by using a preset offset and a preset compensation value of the current period to obtain a target pitch angle when the camera shoots the target object;
When the current period is a first period, the preset compensation value of the current period is zero; when the current period is not the first period, the preset compensation value of the current period is determined based on an installation pitch angle, and the installation pitch angle is: and after the camera is installed, when the cradle head is rotated to a zero position, the accelerometer measures the obtained pitch angle.
5. The method of claim 4, wherein determining the preset compensation value for the current period when the current period is not the first period comprises:
when the current period starts, the cradle head is turned from the current position to a zero position, and when the cradle head is turned to the zero position, the accelerometer measures the pitch angle to be corrected;
and calculating the difference value between the pitch angle to be corrected and the installation pitch angle to serve as a preset compensation value of the current period.
6. The method according to claim 1, wherein the step of obtaining an initial pitch angle measured by an accelerometer in the camera when the camera photographs the target object, comprises:
the method comprises the steps that in the process of continuously shooting a target object for multiple times, a camera obtains an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object each time;
The step of correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object comprises the following steps:
calculating an average value of the acquired plurality of initial pitch angles;
and correcting the average value by using a preset offset to obtain a target pitch angle when the camera shoots the target object.
7. The method according to claim 1, wherein the step of determining the number of pixels included in the image area of the target object in the image captured by the camera on the target object based on the target pitch angle includes:
determining the number of pixel points included in an image area of the target object in an image obtained by shooting the target object by the camera by using a first formula and a second formula;
wherein, the first formula is:
R*tg(α)=H
the second formula is:
n=h/(R*(u/f))
wherein n is the number of pixel points included in the image area of the target object, alpha is the target pitch angle, H is the mounting height of the camera, H is the height value of the target object, u is the pixel size of the camera, f is the focal length of the camera, and R is the distance between the field center point of the camera and the target object.
8. A calibration device, the device comprising:
the angle acquisition module is used for acquiring an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object;
the angle correction module is used for correcting the initial pitch angle by using a preset offset to obtain a target pitch angle when the camera shoots the target object; the preset offset is obtained by correcting zero offset of the accelerometer;
the result determining module is used for determining the number of pixels included in an image area of the target object in an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result;
and in the image recognition process, the number relation between the calibration result and the number of the pixel points included in the image region acquired in the image recognition process is used for screening the image region to be subjected to image recognition from the image region acquired in the image recognition process.
9. The camera is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
A memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-7 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-7.
CN201910725029.9A 2019-08-07 2019-08-07 Calibration method and device and camera Active CN112348898B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910725029.9A CN112348898B (en) 2019-08-07 2019-08-07 Calibration method and device and camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910725029.9A CN112348898B (en) 2019-08-07 2019-08-07 Calibration method and device and camera

Publications (2)

Publication Number Publication Date
CN112348898A CN112348898A (en) 2021-02-09
CN112348898B true CN112348898B (en) 2024-04-05

Family

ID=74366637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910725029.9A Active CN112348898B (en) 2019-08-07 2019-08-07 Calibration method and device and camera

Country Status (1)

Country Link
CN (1) CN112348898B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113670201A (en) * 2021-08-24 2021-11-19 杭州微影软件有限公司 Calibration data generation method and device and calibration data generation system
CN114217278B (en) * 2021-12-14 2023-03-24 齐鲁空天信息研究院 Dynamic target-based amplitude and phase calibration method and system for phased array radar

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102636081A (en) * 2011-12-29 2012-08-15 南京航空航天大学 Transfer alignment method and device based on visual movement modeling
CN105513072A (en) * 2015-12-05 2016-04-20 中国航空工业集团公司洛阳电光设备研究所 PTZ correction method
CN106643792A (en) * 2016-10-26 2017-05-10 中国科学院长春光学精密机械与物理研究所 Inertial measurement unit and geomagnetic sensor integrated calibration apparatus and calibration method
CN107240117A (en) * 2017-05-16 2017-10-10 上海体育学院 The tracking and device of moving target in video
CN109034138A (en) * 2018-09-11 2018-12-18 湖南拓视觉信息技术有限公司 Image processing method and device
CN109459585A (en) * 2018-10-25 2019-03-12 北京航天计量测试技术研究所 A kind of accelerometer zero biasing modification method
CN109636857A (en) * 2018-10-16 2019-04-16 歌尔股份有限公司 Alignment method and calibration system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107747941B (en) * 2017-09-29 2020-05-15 歌尔股份有限公司 Binocular vision positioning method, device and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102636081A (en) * 2011-12-29 2012-08-15 南京航空航天大学 Transfer alignment method and device based on visual movement modeling
CN105513072A (en) * 2015-12-05 2016-04-20 中国航空工业集团公司洛阳电光设备研究所 PTZ correction method
CN106643792A (en) * 2016-10-26 2017-05-10 中国科学院长春光学精密机械与物理研究所 Inertial measurement unit and geomagnetic sensor integrated calibration apparatus and calibration method
CN107240117A (en) * 2017-05-16 2017-10-10 上海体育学院 The tracking and device of moving target in video
CN109034138A (en) * 2018-09-11 2018-12-18 湖南拓视觉信息技术有限公司 Image processing method and device
CN109636857A (en) * 2018-10-16 2019-04-16 歌尔股份有限公司 Alignment method and calibration system
CN109459585A (en) * 2018-10-25 2019-03-12 北京航天计量测试技术研究所 A kind of accelerometer zero biasing modification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
加速度计零偏测量的一种新方法;赵忠;压电与声光(第06期);第3-4节 *

Also Published As

Publication number Publication date
CN112348898A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
US10123003B2 (en) Method for calibrating an image capture device
US7564482B2 (en) Image capturing device, correction device, mobile phone, and correcting method
CN103018015A (en) Device and method for detecting optical-axis offset of lens in equipment
CN112348898B (en) Calibration method and device and camera
CN109345467B (en) Imaging distortion correction method, imaging distortion correction device, computer equipment and storage medium
US10277819B2 (en) Method for calibrating driving amount of actuator configured to correct blurring of image taken by camera
US9235023B2 (en) Variable lens sleeve spacer
JP2008129088A (en) Method for eliminating error of camera equipped with angular velocity detection system
US10567628B2 (en) Imaging device and calibration method thereof
JP2008128674A (en) Angular velocity calibration method
WO2014106303A1 (en) Panoramic lens calibration for panoramic image and/or video capture apparatus
KR20100034086A (en) Method and apparatus for the aging monitoring of electric device using image acquisition
CN110501026B (en) Camera internal orientation element calibration device and method based on array star points
JP2020030221A (en) Calibration method, calibration device, measuring instrument, and program
US10362303B2 (en) Sensor-assisted autofocus calibration
CN111750896B (en) Holder calibration method and device, electronic equipment and storage medium
CN108932732B (en) Method and device for acquiring data information of monitored object
JP2006214799A (en) Gyro signal processing device
EP2284487A1 (en) Information device, imaging apparatus having the same, and method of angle correction of object
JP5487946B2 (en) Camera image correction method, camera apparatus, and coordinate transformation parameter determination apparatus
CN108603752B (en) Deflection angle detection method and device and jitter compensation method and device for camera module of terminal
CN114062265B (en) Evaluation method for stability of support structure of vision system
CN112013810A (en) Distance measurement method, device and equipment
JP2002090116A (en) Three-dimensional image detector
CN114370866B (en) Star sensor principal point and principal distance measuring system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant