CN112348898A - Calibration method, calibration device and camera - Google Patents

Calibration method, calibration device and camera Download PDF

Info

Publication number
CN112348898A
CN112348898A CN201910725029.9A CN201910725029A CN112348898A CN 112348898 A CN112348898 A CN 112348898A CN 201910725029 A CN201910725029 A CN 201910725029A CN 112348898 A CN112348898 A CN 112348898A
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.)
Granted
Application number
CN201910725029.9A
Other languages
Chinese (zh)
Other versions
CN112348898B (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

Images

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 an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result. Compared with the prior art, the method and the device for calibrating the camera can improve the accuracy of the calibration result of the camera.

Description

Calibration method, calibration 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 daily life of people. For example, a security inspection system of a transportation hub such as an airport and a train station can identify the identity of a passenger through a face recognition technology; the entrance guard system of the residential area can identify whether the vehicles entering the residential area are owner vehicles or not through the license plate identification technology.
The image captured by the camera may include a plurality of objects, and the image recognition technology is only used to recognize one or some of the objects, so that after the image is captured, the camera needs to screen image areas of the plurality of objects included in the image to obtain an image area of the object to be recognized.
Therefore, 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 for screening the image area of the object to be recognized in the image obtained by shooting by the camera.
In the related art, when a camera is calibrated, a pitch angle measured by an accelerometer when the camera photographs an object is used as a pitch angle when the camera photographs the object, and the camera is calibrated based on the pitch angle when the camera photographs the object.
However, the measurement accuracy of the accelerometer of the camera is affected due to the environment of the camera and other reasons, so that the accuracy of the pitch angle of the camera when the camera shoots the object obtained in the related art 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 an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result.
Optionally, in a specific implementation manner, a manner of correcting the zero point offset of the accelerometer includes:
acquiring a preset measurement value, and measuring an obtained real measurement value by the accelerometer when the camera is placed on the optical calibration platform; wherein the preset measurement value has a correspondence with a standing state of the camera on the optical calibration platform;
calculating the difference value between the real measured value and the preset measured value as the preset offset;
wherein the optical calibration platform comprises: the device comprises a collimator, an optical axis adjusting device and a loading platform, wherein the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, light emitted by the collimator is parallel to the ground, a camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera is overlapped with a collimator target.
Alternatively, in one particular implementation,
the camera is provided with a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range; when a target object is shot by a camera, before an initial pitch angle measured by an accelerometer in the camera, the method further comprises:
and setting the angle obtained 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;
the step of obtaining the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object 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 the preset offset to obtain the 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 a non-first period, the preset compensation value of the current period is determined based on an installation pitch angle, and the installation pitch angle is as follows: and after the camera is installed, when the cradle head is rotated to a zero position, the pitch angle obtained by the measurement of the accelerometer.
Optionally, in a specific implementation manner, when the current period is a 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 rotated to a zero position from the current position, and the pitch angle to be corrected measured by the accelerometer when the cradle head is rotated to the zero position is obtained;
and calculating the difference value between the pitch angle to be corrected and the mounting pitch angle as a preset compensation value of the current period.
Optionally, in a specific implementation manner, the step of obtaining an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object includes:
the method comprises the steps that a camera obtains an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object for each time in the process of continuously shooting the target object for multiple times;
the step of correcting the initial pitch angle by using the preset offset to obtain the target pitch angle when the camera shoots the target object comprises the following steps:
calculating 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 step of determining, based on the target pitch angle, the number of pixel points included in an image region of the target object in an image obtained by the camera through shooting the target object includes:
determining the number of pixel points included in an image area of the target object in an image obtained by the camera through shooting 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, α is the target pitch angle, H is the installation 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 center point of the field of view of the camera and the target object.
In a second aspect, an embodiment of the present invention provides a calibration apparatus, where the apparatus includes:
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 pixel points included in the image area of the target object in the image obtained by shooting the target object by the camera 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 the zero point offset of the accelerometer; the zero degree correction module comprises:
the measurement value acquisition sub-module is used for acquiring a preset measurement value and a real measurement value measured by the accelerometer when the camera is placed on the optical calibration platform; wherein the preset measurement value has a correspondence with a standing state of the camera on the optical calibration platform;
an offset calculation submodule, configured to calculate a difference between the true measurement value and the preset measurement value, where the difference is used as the preset offset;
wherein the optical calibration platform comprises: the device comprises a collimator, an optical axis adjusting device and a loading platform, wherein the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, light emitted by the collimator is parallel to the ground, a camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera is overlapped with a collimator target.
Alternatively, in one particular implementation,
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 used for setting an angle acquired by an accelerometer when the real-time temperature of the accelerometer is within the preset temperature range as the initial pitch angle before the initial pitch angle measured by the accelerometer in the camera is acquired when the camera shoots a target object.
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, so as 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 a non-first period, the preset compensation value of the current period is determined based on an installation pitch angle, and the installation pitch angle is as follows: and after the camera is installed, when the cradle head is rotated to a zero position, the pitch angle obtained by the measurement of the accelerometer.
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 not the first period; the compensation value determination module includes:
the holder rotation sub-module is used for rotating the holder 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 holder rotates to the zero position;
and the compensation value operator module is used for calculating a difference value between the pitch angle to be corrected and the mounting pitch angle to serve as a preset compensation value of the current period.
Alternatively, in one particular implementation,
the angle acquisition module is specifically used for acquiring an initial pitch angle measured by an accelerometer in the camera when the camera takes a target object for each time in the process of continuously taking multiple times of target objects;
the angle correction module is specifically used for calculating an average value of the acquired multiple 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 the camera through shooting 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, α is the target pitch angle, H is the installation 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 center point of the field of view of the camera and the target object.
In a third aspect, an embodiment of the present invention provides a camera, which is characterized by including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication 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 by 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 in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of any of the calibration methods provided in the first aspect.
Therefore, when the scheme provided by the embodiment of the invention is applied, the camera is calibrated without directly calibrating the camera based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. Firstly, the initial pitch angle is corrected by using the 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 an accelerometer in the camera caused by chip offset of the accelerometer, 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 improved. Furthermore, because the calibration result is the screening basis relied on when the camera screens the image area of the object to be identified in the shot image, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera in screening the image area of the object to be identified in the shot image can be correspondingly improved, and further, the accuracy of image identification is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a calibration method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a manner of correcting zero offset of an accelerometer according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an optical alignment stage according to an embodiment of the present invention;
fig. 4 is an installation structure diagram of a temperature control device in a camera according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a principle that a temperature control device controls a temperature of an accelerometer in a camera according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a principle of controlling a temperature of an accelerometer in a camera based on a heater according to an embodiment of the present invention;
FIG. 7 is a schematic 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 cycle when the current cycle is a non-first cycle according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a calibration apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a camera according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, when a camera is calibrated, a pitch angle measured by an accelerometer when the camera photographs an object is used as a pitch angle when the camera photographs the object, and the camera is calibrated based on the pitch angle when the camera photographs the object. However, the measurement accuracy of the accelerometer of the camera is affected due to the environment of the camera and other reasons, so that the accuracy of the pitch angle of the camera when the camera shoots the object obtained in the related art is not high, and finally the accuracy of the calibration result of the camera is low. In order to solve the above technical problem, an embodiment of the present invention provides a calibration method.
Next, a calibration method provided in an embodiment of the present invention is 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 or 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 hereinafter, referred to as a camera.
Wherein, the calibration means: the corresponding relation between the world coordinate system and the number of pixel points included in an image area in an image collected by a camera is established by shooting a target object set in the world coordinate system.
Specifically, the method comprises the following steps: 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 central point of the camera field of view and the number of pixel points in the collected image, wherein the pixel points are included in the image area where the target object is located, according to the pitch angle when the target object is shot, the height of the target object and the self-related physical parameters. And the determined number of the pixel points is the finally determined calibration result.
In this way, in the image recognition process, when a plurality of image areas including various types of shot objects exist in an image shot by the camera, for each image area, the camera can judge whether the object included in the image area is an object needing image recognition according to the number relation between the pixel points included in the image area and the determined calibration result.
That is, the camera may perform screening using the determined calibration result for a plurality of image areas including various types of objects to be captured in the captured image, so as to obtain an image area that needs to be subjected to image recognition.
As shown in fig. 1, a calibration method provided in 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 an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result.
Therefore, when the scheme provided by the embodiment of the invention is applied, the camera is not calibrated directly based on the initial pitch angle measured by the accelerometer in the camera. Firstly, the initial pitch angle is corrected by using the 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 an accelerometer in the camera caused by chip offset of the accelerometer, 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 improved. Furthermore, since the image area of the object to be identified is screened in the image depends on the calibration result, when the accuracy of the calibration result of the camera is improved, the accuracy of the camera in 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.
When the camera is installed, that is, the camera is put into use, the camera needs to be calibrated, and the calibration of the camera is realized by shooting an object through the camera to obtain an image.
Based on this, in a calibration method provided in an embodiment of the present invention, a target object for camera calibration is first set. When the application scenes of the cameras are different, the set target objects can be different. For example, when a camera is used for person 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 hung on a vehicle.
After the target object for camera calibration is set, the camera may execute step S101 to obtain an initial pitch angle measured by the accelerometer in the camera when the target object is photographed.
The accelerometer is a sensor in the camera, and it is essential to detect the micro deformation of the sensitive element caused by the inertial force by using the MEMS (micro electro mechanical Systems) technology.
Specifically, in a world coordinate system, a vertical downward direction is a Z-axis, and when the accelerometer is horizontally placed on a horizontal desktop, the accelerometer can output an acceleration of 1g in the Z-axis direction because a sensitive element of the accelerometer deforms downward under the action of gravity in the Z-axis direction. Wherein g represents the acceleration of gravity, and the value of g can be usually 9.8m/s2. Of course, when the accelerometers are located at different geographic locations, the specific value of g may vary with the geographic location.
Based on the above, the accelerometer can measure acceleration including gravity acceleration, and when the camera where the accelerometer is located is in a static state or in a constant-speed motion (constant-speed linear motion), the accelerometer can measure only gravity acceleration. According to the relation between the gravity acceleration and the world coordinate system, the accelerometer can measure the angle relation between the plane where the accelerometer is located and the ground, and further the pitch angle of the camera where the accelerometer is located can be obtained.
After the step S101 is completed and the initial pitch angle measured by the accelerometer in the camera is obtained when the camera shoots the target object, the camera may continue to execute the step S102, that is, the initial pitch angle is corrected by using the offset obtained by correcting the zero offset of the accelerometer in the camera in advance, so as to obtain the target pitch angle when the camera shoots the target object.
Here, for the sensor, the zero degree offset means: in the case of a sensor without an angular input, for example, when the sensor is placed horizontally on a horizontal table, the ideal value of the measurement output of the sensor should be zero. However, the true value of the measurement output of the sensor may not be zero due to die offset, PCB soldering accuracy limitations, die mounting accuracy limitations, and the like. Then when the actual value of the measurement output of the sensor is not zero, the actual value of the measurement output is the zero offset of the sensor.
Obviously, the accelerometer in the camera is also a sensor, and the accelerometer in the camera also has zero offset caused by chip offset, limitation of PCB welding precision, limitation of chip installation precision and the like. In addition, zero offset of the accelerometer in the camera can be influenced by assembly precision of the accelerometer structure in the camera, optical path deviation of a camera lens and the like.
Based on this, when the camera is statically placed on a horizontal desktop, the ideal value of the output of the accelerometer in the camera on the X, Y, Z axis of the world coordinate system should be (0,0,1g) or (0,0, -1g), however, in practical application, when the camera is statically placed on a horizontal desktop, the actual value of the output of the accelerometer in the camera on the X, Y, Z axis of the actual coordinate system is likely not equal to the ideal value, and the difference between the actual value of the output of the accelerometer in the camera on the X, Y, Z axis of the world coordinate system and the ideal value is the zero offset of the accelerometer in the camera.
The sign of the ideal value (0,0,1g) or 1g in (0,0, -1g) 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 should be (0,0,1g), and if the positive direction is (0,0, -1 g).
It can be understood that when the accelerometer in the camera has zero offset, the initial pitch angle measured by the accelerometer of the camera when the camera shoots a target object is affected by the zero offset, so that the accuracy of the initial pitch angle measured is low.
Therefore, after the initial pitch angle measured by the accelerometer in the camera is obtained, the initial pitch angle needs to be corrected, and the accuracy of the target pitch angle used for calibrating the camera is improved.
Specifically, in step S102, the camera may correct the initial pitch angle by using an offset obtained by correcting a zero offset of an accelerometer in the camera in advance, that is, the accuracy of the target pitch angle used for calibrating the camera is improved by eliminating the zero offset of the accelerometer in the camera.
Optionally, in a specific implementation manner, as shown in fig. 2, the manner of correcting the zero-point offset of the accelerometer may include the following steps:
s201: acquiring a preset measurement value, and measuring an obtained real measurement value by an accelerometer when a camera is placed on an optical calibration platform;
the preset measurement value corresponds to the static state of the camera on the optical calibration platform;
s202: calculating the difference value between the real measured value and a preset measured value as a preset offset;
in this particular implementation, the camera may be left standing on the optical school platform before the camera is shipped or installed. At this time, according to the standing state 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 without zero point offset.
For example, when the camera is resting on the optical calibration platform, the pre-set measurement of the accelerometer in the camera should be (0,0,1g) or (0,0, -1 g).
In addition, when the camera is placed on the optical calibration platform, the accelerometer in the camera can also measure a real measurement 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 shown that the accelerometer in the camera does not have zero offset, and the offset obtained by correcting the zero offset of the accelerometer at the moment is 0; on the contrary, when the real measured value is different from the preset measured value, it can be said that the accelerometer in the camera has zero offset, and the difference value between the real measured value and the preset measured value is the zero offset of the accelerometer in the camera, and further, the difference value 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.
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 of 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 on the same side of the loading platform 230. The collimator 220 is suitable for an optical instrument generating a parallel light beam, and a circular target is marked at the center of the section of the collimator 220.
In this embodiment, the light emitted by the collimator 220 is parallel to the ground, the camera 200 to be calibrated for the zero offset of the accelerometer may be fixed to the optical axis adjusting device 210, and the tilt angle of the camera 200 may be adjusted by adjusting the optical axis adjusting device 210, so that the center of the captured image of the camera 200 coincides with the target of the collimator 220, thereby completing the adjustment of the visual axis of the camera 220. When the camera 200 is a rotatable camera, the optical axis adjusting device 210 may be a pan/tilt 220.
This allows the alignment of the visual axis of the camera 200 to be horizontal, thus ensuring that the pre-set measurement of the accelerometer in the camera should be (0,0,1g) or (0,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.
Further, after the collimator 220 and the optical adjustment device 210 are adjusted, the camera 200 may obtain a real measurement value measured by an accelerometer in the camera, and further obtain a preset offset corresponding to the camera 200 by calculating a difference between the real measurement value and a preset measurement value.
Further, after obtaining the preset offset, 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 specific implementation manner, 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 by the user in the camera. The embodiment of the present invention is not particularly limited.
In addition, the camera may perform the step S102 in various ways, and the embodiment of the present invention is not limited in particular.
Preferably, the method for the camera to execute 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 method of executing step S102 by the camera may further include:
and calculating a difference value between the initial pitch angle and a preset offset, further calculating a product of the obtained difference value and a preset correction coefficient, and taking the obtained product as a target pitch angle when the camera shoots a target object.
After the step S102 is executed to obtain the target pitch angle, the camera may continue to execute the step S103, and determine the number of pixel points included in the image region of the target object in the image obtained by the camera through shooting the target object based on the target pitch angle, so as to obtain the calibration result.
Optionally, in a specific implementation manner, the manner in which the camera executes 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 obtained by shooting the target object by a 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))
the method comprises the steps of obtaining a target object, obtaining a pixel value of a camera, obtaining a pixel value of the camera, obtaining a focal length of the camera, obtaining a pixel value of the camera, obtaining a focal length of the camera, obtaining a pixel value of.
The pixel size u of the camera is characterized by the pixel size of the sensor of the camera, and after the sensor of the camera is determined, the pixel size u of the camera is determined accordingly.
Preferably, the first formula and the second formula are connected by R, so that the first formula and the second formula can be combined to obtain a third formula for calculating the number n of pixels included in the image region of the target object. Wherein, the calculated third formula is as follows:
Figure BDA0002158610540000141
based on this, after the camera obtains the target pitch angle α, the number n of pixel points included in the image area of the target object can be calculated by directly using the third formula.
Furthermore, for the accelerometer in the camera, parameters of components in the accelerometer in the camera can change along with the temperature change of the accelerometer in the camera, so that the accelerometer in the camera generates temperature drift, the accuracy of the measured pitch angle is influenced, and the accuracy of the calibration of the camera is further influenced. In addition, in the process of calibration and reception and use of the camera, the temperature drift can continuously influence the accuracy of the pitch angle measured by the accelerometer in the camera, so that the accuracy of the final image identification result can be influenced.
Based on this, 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, optionally, in a specific implementation,
the camera can be internally 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, in step S101, before obtaining an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object, the calibration method further includes the following steps:
and setting the angle acquired when the real-time temperature of the accelerometer is within the preset temperature range as an initial pitch angle.
In this way, in this specific implementation, the initial pitch angle obtained when the camera executes the step S101 is: an angle obtained when the real-time temperature of the accelerometer is within a preset temperature range.
Preferably, as shown in fig. 4, it is a mounting structure diagram of a temperature control device in a camera.
The temperature control device can comprise a temperature control device in direct contact with an accelerometer in the camera and a temperature sensing chip in communication connection with the temperature control device. Specifically, in the embodiment shown in fig. 4, the temperature control device may be a semiconductor 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 obtain the real-time temperature of the accelerometer through the thermistor directly contacted with the semiconductor refrigerator and feed back the real-time temperature to the semiconductor refrigerator, so that the 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 control device controls the real-time temperature of the accelerometer within the preset temperature range, as shown in fig. 5, a schematic diagram of the temperature control device controlling the temperature of the accelerometer in the camera is shown. The SOC sets an output voltage value of a DAC (Digital to Analog Converter) chip. And if the DAC chip outputs the Vset voltage value, comparing the voltage value Vtemp output by the thermistor on the TEC for representing the temperature of the semiconductor refrigerator with the voltage value Vset output by the DAC chip in the TEC control IC. When the value of Vtemp is greater than Vset, the TEC control IC can start the temp control function to regulate the direction and magnitude of output current on pin TEC +/-to control the real-time temp of accelerometer in camera, so stabilizing the real-time temp of accelerometer in camera in predefined temp range.
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, optionally, 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 at around 50 ℃.
Thus, in this particular implementation, temperature compensation for the accelerometer within the camera can be simplified to include only low temperature compensation. Wherein the semiconductor cooler shown in fig. 4 above may 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 principle for controlling the temperature of an accelerometer in a camera based on a heater is shown. The ADC pin of the master control IC acquires the voltage value of the thermistor of the heating plate, converts the voltage value of the thermistor into corresponding temperature information, and then controls the on-off of the power supply of the heating plate through the feedback of the temperature information obtained through conversion, so that the aims of adjusting the real-time temperature of the accelerometer and performing temperature compensation on the accelerometer in the camera are fulfilled.
The active IC may be an MCU (Micro Control Unit), an SOC, or other chips, and the embodiment of the present invention is not limited in particular.
It can be understood that when the camera is a rotatable camera, the camera calibration is completed, and after the camera is put into use, the camera can continuously change the shooting angle of the camera through the rotation of the holder according to the requirements in practical application. Furthermore, the cradle head rotates to cause mechanical deformation such as deformation of a PCB (printed circuit board) and metal plate of the accelerometer in the camera, so that the accelerometer in the camera can generate new mechanical errors in the process of rotating the cradle head for many times. Obviously, the new mechanical error generated as described above may cause the accuracy of the pitch angle measured by the accelerometer in the camera. Therefore, in order to ensure the continuous accuracy of the accelerometer in the rotatable camera for a long time, the rotatable camera can be periodically calibrated according to a preset period, so that the decrease of the accuracy of the pitch angle measured by the accelerometer in the camera caused by the new mechanical error generated in the current period is eliminated, and the pitch angle measured by the accelerometer in the rotatable camera can have higher accuracy in each preset period.
Based on this, optionally, in a specific implementation, when the camera is a rotatable camera;
in step S101, the obtaining of the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object may include the following steps, as shown in fig. 7:
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;
in the step S102, the 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 the preset offset and the 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 as follows: and after the camera is installed, when the cradle head is rotated to a zero position, the pitch angle obtained by the measurement of the accelerometer.
In the step S103, determining the number of pixel points included in the image region of the target object in the image obtained by the camera through shooting the target object based on the target pitch angle, to obtain the calibration result, the method may include the following steps S703:
s703: and 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 to obtain a calibration result in the current period.
It can be understood that, after the camera is installed, the camera enters a first preset period, and at this time, because the cradle head has not rotated for many times, mechanical errors caused by the rotation of the cradle head for many times can be considered to be not generated, 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 obtain and store the installation pitch angle measured by the accelerometer when the pan/tilt is rotated to the zero position, so that the preset compensation value in each period may be determined based on the installation pitch angle at the beginning of the period.
Furthermore, when the camera is ready to enter each period after the first preset period, since the pan/tilt head can be rotated over a number of times, mechanical errors due to the rotation of the pan/tilt head can be generated. Based on this, a preset compensation value for the current period can be determined based on the above-described installation pitch angle. When the current period is a non-first period, the camera may determine the preset compensation value of the current period in various ways, which is not limited in the embodiments of the present invention.
Preferably, as shown in fig. 8, when the current period is a non-first period, the determining of the preset compensation value of the current period may include the following steps:
s801: when the current period starts, the cradle head is rotated to a zero position from the current position, and a pitch angle to be corrected is obtained by measuring through an accelerometer when the cradle head is rotated to the zero position;
s802: and calculating the difference value between the pitch angle to be corrected and the mounting pitch angle 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, 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 when the cradle head rotates to the zero position is obtained, namely the pitch angle to be corrected is obtained. In this way the camera can compare the pitch angle to be corrected with the mounting pitch angle.
Obviously, when the acquired pitch angle to be corrected is the same as the mounting pitch angle, it can be shown that, in the use process from the beginning of the use of the camera to the beginning of the current period, no mechanical error caused by the rotation of the pan-tilt head is generated, and therefore, it can be determined that the preset compensation value is still zero in the current period. And when the current period starts, the acquired pitch angle to be corrected is the same as the mounting pitch angle, and the difference value between the acquired pitch angle to be corrected and the mounting pitch angle is zero. Obviously, the difference between the pitch angle to be corrected and the above-mentioned installation pitch angle acquired at the beginning of the current period may also be determined as the preset compensation value for the current period.
Correspondingly, when the acquired pitch angle to be corrected is different from the mounting pitch angle, it can be shown that, in the use process from the beginning of the camera being put into use to the beginning of the current period, a mechanical error caused by the rotation of the pan-tilt head is generated, and the mechanical error causes the difference between the acquired pitch angle to be corrected and the mounting pitch angle. Therefore, when the current period starts, and the obtained pitch angle to be corrected is different from the installation pitch angle, the camera may calculate a difference between the obtained pitch angle to be corrected and the installation pitch angle at the start of the current period, and determine the calculated difference as a preset compensation value of the current period.
The duration of the preset period may be set according to related mechanical parameters of the camera and an accuracy requirement of a pitch angle measured by an accelerometer in practical application, and therefore, the specific duration of the preset period is not limited in the embodiment of the present invention.
Furthermore, the timing function of the camera itself may be used to allow the camera to perform the above steps S801-802, and the above steps S701-S703 at the beginning of each cycle.
Further, for the rotatable camera, in the process of using the rotatable camera, in the process of acquiring an image and screening image areas of each object in the image, when determining the image area of each object in the image by using the pitch angle measured by the accelerometer in the rotatable camera, it is also necessary to correct the pitch angle measured by the accelerometer in the rotatable camera by using the preset offset and the preset compensation value of the current period, and then determine the image area of each object in the image 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 influenced, and in order to avoid the noise interference, the accuracy of the measured value can be improved by a method of averaging multiple measurements and mutually offsetting the noise among the multiple measured values.
Based on this, because when the camera shoots the target object, the initial pitch angle measured by the accelerometer in the camera may also be interfered by noise, so as to affect the accuracy of the initial pitch angle, optionally, in a specific implementation manner, the camera executes the step S101, and a manner of obtaining the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object may include the following steps:
the method comprises the steps that in the process that a camera continuously shoots a target object for multiple times, an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object every time is obtained;
that is, in a specific implementation, when the camera is calibrated, the camera may continuously capture a target object for a plurality of times according to a preset capture frequency. When shooting at every time, the camera can acquire an initial pitch angle measured by an accelerometer in the camera when shooting at the time, and therefore the camera can obtain a plurality of initial pitch angles.
Based on this, in this specific implementation, the method in which the camera performs the step S102 to correct 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:
step 1: calculating an average value of the obtained plurality of initial pitch angles;
step 2: and correcting the average value by using the preset offset to obtain a target pitch angle when the camera shoots the target object.
That is, in this specific implementation, after obtaining the plurality of initial pitch angles, the camera may calculate an average value of the plurality of initial pitch angles, and further, correct the calculated average value by using the preset offset, so as to obtain the target pitch angle when the camera shoots the 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 apparatus according to an embodiment of the present invention. As shown in fig. 9, the calibration apparatus 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 a target object;
an angle correction module 920, configured to correct 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 a result determining module 930, configured to determine, based on the target pitch angle, the number of pixel points included in an image region of the target object in an image obtained by the camera shooting the target object, so as to obtain a calibration result.
Therefore, when the scheme provided by the embodiment of the invention is applied, the camera is calibrated without directly calibrating the camera based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. Firstly, the initial pitch angle is corrected by using the 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 an accelerometer in the camera caused by chip offset of the accelerometer, 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 improved. Furthermore, because the calibration result is the screening basis relied on when the camera screens the image area of the object to be identified in the shot image, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera in screening the image area of the object to be identified in the shot image can be correspondingly improved, and further, the accuracy of image identification is improved.
Optionally, in a specific implementation manner, the calibration apparatus may further include: the zero degree correction module is used for correcting the zero point offset of the accelerometer;
in this specific implementation manner, the zero degree correction module may include:
the measurement value acquisition sub-module is used for acquiring a preset measurement value and a real measurement value obtained by the measurement of the accelerometer when the camera is placed on the optical calibration platform; the preset measurement value corresponds to the static state of the camera on the optical calibration platform;
the offset calculation submodule 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 device comprises a collimator, an optical axis adjusting device and a loading platform, wherein the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, light emitted by the collimator is parallel to the ground, a camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera is overlapped 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, when a target object is captured by a camera and before an initial pitch angle measured by an accelerometer in the camera, set an angle obtained when a 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 may be a rotatable camera;
in this specific implementation manner, the angle obtaining module 910 may be specifically configured to obtain, at the beginning of each preset period, an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object;
the angle correction module may be specifically configured to correct the initial pitch angle by using a preset offset and a preset compensation value of the current period, so as 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 as follows: and after the camera is installed, when the cradle head is rotated to a zero position, the pitch angle obtained by the measurement of the accelerometer.
Optionally, in a specific implementation manner, the calibration apparatus 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 holder rotation sub-module is used for rotating the holder 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 holder rotates to the zero position;
and the compensation value calculation operator module is used for calculating the difference value between the pitch angle to be corrected and the mounting pitch angle and taking the difference value as the preset compensation value of the current period.
Alternatively, in one particular implementation,
the angle obtaining module 910 may be specifically configured to, in a process that the camera continuously shoots the target object for multiple times, obtain an initial pitch angle measured by an accelerometer in the camera when the camera shoots the target object for each time;
the angle correction module 920 may be specifically configured to calculate an average value of the obtained multiple initial pitch angles; and correcting the average value by using the 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 930 may be specifically configured to:
determining the number of pixel points included in an image area of a target object in an image obtained by shooting the target object by a 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))
the method comprises the steps of obtaining a target object, obtaining a pixel value of a camera, obtaining a pixel value of the camera, obtaining a focal length of the camera, obtaining a pixel value of the camera, obtaining a focal length of the camera, obtaining a pixel value of.
Corresponding to the calibration method provided by the embodiment of the present invention, the embodiment of the present invention further provides a camera, as shown in fig. 10, including 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 mutual communication 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 embodiment of the present invention when executing the program stored in the memory 1003.
Specifically, the calibration 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 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 an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result.
It should be noted that other implementation manners of the 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 foregoing method embodiment section, and are not described herein again.
Therefore, when the scheme provided by the embodiment of the invention is applied, the camera is calibrated without directly calibrating the camera based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. Firstly, the initial pitch angle is corrected by using the 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 an accelerometer in the camera caused by chip offset of the accelerometer, 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 improved. Furthermore, because the calibration result is the screening basis relied on when the camera screens the image area of the object to be identified in the shot image, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera in screening the image area of the object to be identified in the shot image can be correspondingly improved, and further, the accuracy of image identification is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a 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 processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Corresponding to the calibration method provided in the above embodiment of the present invention, an embodiment of the present invention further provides a computer readable storage medium, and the computer program is executed by a processor to implement the calibration method provided in the above embodiment of the present invention.
Specifically, the calibration 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 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 an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result.
It should be noted that other implementation manners of the calibration method implemented when the computer program is executed by the processor are the same as the calibration method embodiment provided in the foregoing method embodiment section, and are not described herein again.
Therefore, when the scheme provided by the embodiment of the invention is applied, the camera is calibrated without directly calibrating the camera based on the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object. Firstly, the initial pitch angle is corrected by using the 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 an accelerometer in the camera caused by chip offset of the accelerometer, 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 improved. Furthermore, because the calibration result is the screening basis relied on when the camera screens the image area of the object to be identified in the shot image, when the accuracy of the calibration result of the camera is improved, the screening accuracy of the camera in screening the image area of the object to be identified in the shot image can be correspondingly improved, and further, the accuracy of image identification is improved.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, the camera embodiment and the computer-readable storage medium embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A calibration method, characterized in that the method comprises:
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 an image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result.
2. The method of claim 1, wherein correcting the zero point bias of the accelerometer comprises:
acquiring a preset measurement value, and measuring an obtained real measurement value by the accelerometer when the camera is placed on the optical calibration platform; wherein the preset measurement value has a correspondence with a standing state of the camera on the optical calibration platform;
calculating the difference value between the real measured value and the preset measured value as the preset offset;
wherein the optical calibration platform comprises: the device comprises a collimator, an optical axis adjusting device and a loading platform, wherein the collimator and the optical axis adjusting device are arranged on the same side of the loading platform, light emitted by the collimator is parallel to the ground, a camera is fixed on the optical axis adjusting device, and the center of a picture shot by the camera is overlapped with a collimator target.
3. The method of claim 1,
the camera is provided with a temperature control device for controlling the real-time temperature of the accelerometer within a preset temperature range; when a target object is shot by a camera, before an initial pitch angle measured by an accelerometer in the camera, the method further comprises:
and setting the angle obtained 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 of claims 1-3, wherein the camera is a rotatable camera;
the step of obtaining the initial pitch angle measured by the accelerometer in the camera when the camera shoots the target object 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 the preset offset to obtain the 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 a non-first period, the preset compensation value of the current period is determined based on an installation pitch angle, and the installation pitch angle is as follows: and after the camera is installed, when the cradle head is rotated to a zero position, the pitch angle obtained by the measurement of the accelerometer.
5. The method of claim 4, wherein when the current period is not the first period, the determining of the preset offset value of the current period comprises:
when the current period starts, the cradle head is rotated to a zero position from the current position, and the pitch angle to be corrected measured by the accelerometer when the cradle head is rotated to the zero position is obtained;
and calculating the difference value between the pitch angle to be corrected and the mounting pitch angle as a preset compensation value of the current period.
6. The method of claim 1, wherein the step of obtaining an initial pitch angle measured by an accelerometer in the camera while the camera is capturing the target object comprises:
the method comprises the steps that a camera obtains an initial pitch angle measured by an accelerometer in the camera when the camera shoots a target object for each time in the process of continuously shooting the target object for multiple times;
the step of correcting the initial pitch angle by using the preset offset to obtain the target pitch angle when the camera shoots the target object comprises the following steps:
calculating 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.
7. The method according to claim 1, wherein the step of determining the number of pixels included in an image region of the target object in the image of the target object captured by the camera 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 the camera through shooting 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, α is the target pitch angle, H is the installation 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 center point of the field of view of the camera and the target object.
8. A calibration arrangement, characterized in that the arrangement comprises:
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 pixel points included in the image area of the target object in the image obtained by shooting the target object by the camera based on the target pitch angle to obtain a calibration result.
9. A camera is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 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 true CN112348898A (en) 2021-02-09
CN112348898B 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)

Cited By (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
CN114217278A (en) * 2021-12-14 2022-03-22 齐鲁空天信息研究院 Dynamic target-based amplitude and phase calibration method and system for phased array radar

Citations (8)

* 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
US20190204084A1 (en) * 2017-09-29 2019-07-04 Goertek Inc. Binocular vision localization method, device and system

Patent Citations (8)

* 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
US20190204084A1 (en) * 2017-09-29 2019-07-04 Goertek Inc. Binocular vision localization method, device and system
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
赵忠: "加速度计零偏测量的一种新方法", 压电与声光, no. 06, pages 3 - 4 *

Cited By (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
CN114217278A (en) * 2021-12-14 2022-03-22 齐鲁空天信息研究院 Dynamic target-based amplitude and phase calibration method and system for phased array radar

Also Published As

Publication number Publication date
CN112348898B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
EP3004957B1 (en) A method for calibrating an image capture device
CN108111828B (en) Projection equipment correction method and device and projection equipment
CN109345467B (en) Imaging distortion correction method, imaging distortion correction device, computer equipment and storage medium
CN113418543B (en) Automatic driving sensor detection method and device, electronic equipment and storage medium
CN110456602B (en) Projection pattern correction device, method and system of projection system
CN104581136A (en) Image calibration system and calibration method of stereo camera
CN112348898B (en) Calibration method and device and camera
US10277819B2 (en) Method for calibrating driving amount of actuator configured to correct blurring of image taken by camera
WO2014106303A1 (en) Panoramic lens calibration for panoramic image and/or video capture apparatus
KR102328240B1 (en) Projection of structured light for a mirror surface
CN111351468B (en) Electronic device and image ranging method thereof
CN112991453A (en) Calibration parameter calibration method and device for binocular camera and electronic equipment
CN115267745A (en) Laser radar calibration device and method
JP2018050298A (en) Imaging apparatus with alignment analysis function
CN111750896B (en) Holder calibration method and device, electronic equipment and storage medium
US10362303B2 (en) Sensor-assisted autofocus calibration
CN108932732B (en) Method and device for acquiring data information of monitored object
CN103297799A (en) Testing an optical characteristic of a camera component
CN111105465B (en) Camera device calibration method, device, system electronic equipment and storage medium
CN108603752B (en) Deflection angle detection method and device and jitter compensation method and device for camera module of terminal
CN106482743B (en) A kind of rapid detection method of relative position measurement equipment
CN114062265B (en) Evaluation method for stability of support structure of vision system
KR101992417B1 (en) Apparatus and method for measuring airburst height of weapon system
JP2002090116A (en) Three-dimensional image detector
CN112013810A (en) Distance measurement method, device and equipment

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