CN114845037A - PTZ camera calibration method and device, electronic equipment and storage medium - Google Patents

PTZ camera calibration method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114845037A
CN114845037A CN202110139316.9A CN202110139316A CN114845037A CN 114845037 A CN114845037 A CN 114845037A CN 202110139316 A CN202110139316 A CN 202110139316A CN 114845037 A CN114845037 A CN 114845037A
Authority
CN
China
Prior art keywords
ptz camera
preset
offset
threshold
threshold value
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
CN202110139316.9A
Other languages
Chinese (zh)
Other versions
CN114845037B (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202110139316.9A priority Critical patent/CN114845037B/en
Publication of CN114845037A publication Critical patent/CN114845037A/en
Application granted granted Critical
Publication of CN114845037B publication Critical patent/CN114845037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/695Control of camera direction for changing a field of view, e.g. pan, tilt or based on tracking of objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention discloses a PTZ camera calibration method, a PTZ camera calibration device, electronic equipment and a storage medium. The method and the device have the advantages that the real-time monitoring of the attitude and the position of the PTZ camera is realized by dynamically detecting the angle offset of the PTZ camera after being locked, and the accuracy of judging the attitude and the position offset of the PTZ camera is improved by comparing the first threshold value with the second threshold value; after the position deviation of the PTZ camera is detected, the reset operation is executed, the automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise of not influencing the transmission layout of the camera and increasing the structural space layout pressure, the real-time automatic control is realized, and the work of manual intervention is reduced.

Description

PTZ camera calibration method, device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of monitoring, in particular to a PTZ camera calibration method, a PTZ camera calibration device, electronic equipment and a storage medium.
Background
The PTZ camera is a monitoring camera capable of moving in all directions and zooming, and is capable of adjusting a horizontal angle and a pitch angle and zooming a lens. However, the PTZ camera has a problem of being lost in the vertical direction due to an external force (e.g., strong shock, strong wind, etc.) in a severe environment.
The existing solutions are: in the first scheme, manual intervention control is adopted, and when the PTZ is lost in the vertical direction, a user manually controls the PTZ to return to the initial setting position through an operating software system. And in the second scheme, the Hall element and the magnet are combined to feed back the current position information, and when the PTZ is detected to move under the non-control condition, the motor is driven to rotate and control to return to the initial setting position. And according to the third scheme, an encoder is added on a control circuit board in the dome camera to feed back position information in real time, so that closed-loop feedback control is formed.
However, in the first scheme, time difference exists in manual control, and the loss of the PTZ direction is not easy to be found without an early warning system, so that the video stream in a certain time node is lost. In the second scheme, the Hall element has poor temperature characteristics, nonlinear output needs to be corrected, and special installation specifications are provided for use and installation so as to ensure the measurement precision, thereby increasing the difficulty of product structural design. The volume of encoder is great in scheme three, and the structure is loaded down with trivial details, need have sufficient headspace, increases product structural design's the degree of difficulty, and photoelectric encoder inner member receives the environmental impact great, is not suitable for outdoor and use under the adverse circumstances, and the magnetoelectric encoder also easily receives electromagnetic interference, need to take compensation and safeguard measure and avoid temperature drift.
Disclosure of Invention
The embodiment of the invention provides a PTZ camera calibration method, a PTZ camera calibration device, electronic equipment and a storage medium, so that self-calibration of a PTZ camera is realized, and the accuracy of the self-calibration is ensured.
In a first aspect, an embodiment of the present invention provides a PTZ camera calibration method, including:
acquiring locking position information of a PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking;
determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and if the position of the PTZ camera is deviated, executing the reset operation of the PTZ camera.
In a second aspect, an embodiment of the present invention further provides a PTZ camera calibration apparatus, including:
the angle deviation detection module is used for acquiring locking position information of the PTZ camera and dynamically detecting the angle deviation amount of the PTZ camera after locking;
the position deviation determining module is used for determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and the resetting module is used for executing the resetting operation of the PTZ camera if the position of the PTZ camera deviates.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a PTZ camera calibration method as described in any embodiment of the invention.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the PTZ camera calibration method according to any one of the embodiments of the present invention.
The method and the device are based on the steps that locking position information of the PTZ camera is obtained, and the angle offset of the PTZ camera after locking is dynamically detected; determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold; and if the position of the PTZ camera is deviated, executing the reset operation of the PTZ camera. The embodiment of the invention realizes the real-time monitoring of the attitude position of the PTZ camera, and improves the accuracy of judging the attitude position offset of the PTZ camera through the comparison of the first threshold and the second threshold; after the position deviation of the PTZ camera is detected, the reset operation is executed, the automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise of not influencing the transmission layout of the camera and increasing the structural space layout pressure, the real-time automatic control is realized, and the work of manual intervention is reduced.
Drawings
FIG. 1 is a flow chart of a PTZ camera calibration method in accordance with a first embodiment of the present invention;
FIG. 2 is a flow chart of a PTZ camera calibration method in a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a PTZ camera calibration device in a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device in a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a calibration method for a PTZ camera according to a first embodiment of the present invention, which is applicable to a situation where a self-induction attitude position calibration is performed on the PTZ camera after the PTZ camera loses its direction under the influence of an external force. The method may be performed by a PTZ camera calibration apparatus, which may be implemented in software and/or hardware, and may be configured in an electronic device, for example, the electronic device may be a device with communication and computing capabilities such as a backend server. As shown in fig. 1, the method specifically includes:
and step 101, acquiring locking position information of the PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking.
Among them, the PTZ camera (Pan-Tilt-Zoom camera) can perform Pan-Tilt omni-directional (left-right/up-down) movement and Zoom control of the lens. After the PTZ camera is locked at a certain fixed position, the PTZ camera is lost in the vertical direction due to the influence of external force, and the phenomenon that the picture shot in the PTZ camera is lost or the collected picture is not collected at a preset position can occur, so that the monitoring of the PTZ camera is adversely affected. The locking position information refers to a position where the PTZ camera is locked after being operated to a preset position, the preset position is determined according to a direction needing to be monitored by the PTZ camera, and the preset position is determined according to actual monitoring requirements of a user.
Specifically, after the PTZ camera is operated to the preset position, a locking operation of the PTZ camera is performed to lock it to the preset position, and the current locking position information is acquired. After the current locking position information is obtained, the dynamic detection of the current position information after locking is kept, and if the current position information changes, the difference value between the current position information and the locking position information is fed back; correspondingly, if the current position is still detected to be changed continuously subsequently, the difference between the current position information and the position information before the change is fed back to be used as the angle offset. Illustratively, when the client controls the PTZ camera to give out an operation command, a motor in the PTZ camera is electrified to start operation, the PTZ camera is driven to operate to a preset position, and after the preset position is reached, the motor is electrified and locked, and meanwhile, the locking position information of the PTZ camera is recorded. And an accelerometer sensor is adopted to dynamically detect the angle offset, the detection result of the angle offset of the PTZ camera is fed back in real time, and the angle offset is the change quantity of the change of the single position of the PTZ camera. The precision of the linear acceleration output by the accelerometer sensor reaches 0.01g/LSB at present, the actual angle precision value obtained through a software algorithm can reach 0.1 degree, and the real-time performance and the accuracy of detection are guaranteed.
Step 102, determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; the preset first threshold is larger than the preset second threshold.
The setting of the preset first threshold and the preset second threshold is determined according to the actual shooting effect of the PTZ camera, and when the PTZ camera deviates from the initial locking position by the preset first threshold, the shooting picture of the PTZ camera is completely lost; when the PTZ camera is shifted by the preset second threshold value in the initial locking position, the shot image of the PTZ camera may be changed to some extent. For example, the preset first threshold may be set to 0.5 degrees, the preset second threshold may be set to 0.2 degrees, and the specific numerical value needs to be determined according to the magnification, the distance, and the like of the actual PTZ camera, which is not limited herein. The angle deviation of the PTZ camera can be judged more accurately by setting a preset first threshold and a preset second threshold.
Specifically, the angle offset represents the degree of single angular offset of the PTZ camera, the preset first threshold represents the maximum allowable offset angle at which the PTZ camera does not lose pictures, and the preset second threshold represents the minimum offset angle at which the pictures shot by the PTZ camera change, so that whether the pictures of the PTZ camera are lost or not can be reflected according to the direct comparison result of the single angular offset of the PTZ camera and the preset first threshold, and whether the pictures shot by the PTZ camera are lost or not can be reflected according to the accumulated comparison result of the preset second threshold when continuous jitter occurs, meanwhile, the interference of angular offset caused by non-accumulated jitter can be avoided according to the accumulated comparison result, and the accuracy of determining the position offset of the PTZ camera is improved.
The direct comparison of the angle offset with the preset first threshold and the cumulative comparison with the preset second threshold may be as follows.
In one possible embodiment, step 102 includes:
if the continuous target angle offset is greater than or equal to a preset second threshold and smaller than a preset first threshold, determining the accumulated offset according to the continuous target angle offset;
and determining whether the position of the PTZ camera deviates or not according to the comparison result of the accumulated deviation and a preset first threshold.
The continuous target angle offset is greater than or equal to a preset second threshold, and is smaller than the preset first threshold, which means that the value of at least two adjacent single angle offsets is greater than or equal to the preset second threshold, and is smaller than the preset first threshold, that is, at least two times of medium amplitude jitter occurs.
Specifically, if any angle offset is greater than or equal to a preset second threshold and smaller than a preset first threshold, it is determined whether a value of an adjacent next angle offset is greater than or equal to the preset second threshold and smaller than the preset first threshold, if the condition is still met, it is determined that a continuous target angle offset is greater than or equal to the preset second threshold and smaller than the preset first threshold, and an accumulated offset is determined according to the continuous target angle offset. Illustratively, the current position determination angle offset obtained through the feedback of the accelerometer sensor is 0.3 degree and 0.4 degree, and if the two continuous single angle offsets are both greater than 0.2 degree and less than 0.5 degree, the current position determination angle offset is a continuous target angle offset, and the cumulative offset is determined to be 0.7 degree according to 0.2 degree and 0.5 degree.
And after the accumulated offset is obtained, determining whether the position of the PTZ camera is offset according to a comparison result of the accumulated offset and a preset first threshold. Since the preset first threshold value represents the maximum allowable deviation angle of the PTZ camera without losing pictures, the deviation result of the camera position is determined according to the comparison result of the accumulated deviation amount and the preset first threshold value, so that the PTZ camera can be ensured not to lose the pictures.
The following situations exist as a result of comparing the accumulated offset with the preset first threshold.
In one possible embodiment, determining whether the PTZ camera position is offset based on the comparison of the accumulated offset amount with a preset first threshold value includes:
if the accumulated offset is smaller than a preset first threshold, determining whether the position of the PTZ camera deviates according to the detection times of the continuous target angle offset;
and if the detection times are larger than or equal to a preset time threshold value, determining that the position of the PTZ camera deviates.
If the accumulated offset is smaller than the preset first threshold, it indicates that although the PTZ camera generates multiple moderate-amplitude shakes, the offset caused by the accumulated shakes does not cause the PTZ camera to lose the picture, and at this time, further judgment is performed according to the detection times of the continuous target angle offset.
The number of times of detection of the successive target angular offset amounts indicates that the successive target angular offset amounts included in the cumulative offset amount calculation are obtained by several single detection feedbacks. Specifically, if the detection is greater than or equal to the preset time threshold value at this time, it indicates that the PTZ camera has not lost the picture, but has a high-frequency continuous shaking condition under the influence of an external force, and at this time, it is determined that the position of the PTZ camera has shifted. When the accumulated offset is smaller than a preset first threshold value, whether the position of the PTZ camera deviates or not is determined according to the detection times, on one hand, the detection accuracy of the PTZ camera affected by external force is improved, and on the other hand, the PTZ camera is prevented from being frequently reset. If the accumulated offset is smaller than a preset first threshold and the detection times are smaller than a preset time threshold, continuing to determine the next angular offset, and if the next angular offset is still larger than or equal to a preset second threshold and smaller than the preset first threshold, updating the accumulated offset and the detection times according to the next angular offset; and if the next angular offset is smaller than a preset second threshold, resetting the accumulated offset and the detection times.
In one possible embodiment, determining whether the PTZ camera position is offset based on the comparison of the accumulated offset amount with a preset first threshold value includes:
and if the accumulated offset is larger than or equal to a preset first threshold, determining that the position of the PTZ camera is offset.
If the accumulated offset is larger than or equal to a preset first threshold value, the loss of the PTZ camera picture caused by continuous jitter is indicated, and the position of the PTZ camera is determined to be offset.
By comparing the accumulated offset with the preset first threshold, the adverse effect of multiple moderate-amplitude shakes on the PTZ camera shooting is avoided, and the accuracy of the position and posture detection of the PTZ camera is improved.
In one possible embodiment, step 102 includes:
and if any angle offset is larger than or equal to a preset first threshold value, determining that the position of the PTZ camera is offset.
If any detected angle offset is larger than or equal to a preset first threshold value in the dynamic detection process, the situation shows that single large-amplitude jitter occurs in the PTZ camera, and the jitter causes loss of a picture shot by the PTZ camera, so that the position of the PTZ camera is directly determined to be offset under the situation. For example, the determination of any angle offset greater than or equal to the preset first threshold may be performed at any time during the dynamic detection process, for example, during the process of determining whether the PTZ camera position is offset according to the accumulated offset, if the angle offset greater than or equal to the preset first threshold occurs once after the consecutive target angle offsets, the PTZ camera position is directly determined to be offset.
When the single angular offset is larger than or equal to the preset first threshold, the position of the PTZ camera is directly determined to be offset, the judgment time of the position offset of the PTZ camera can be shortened, and the efficiency of resetting the PTZ camera is further improved.
In one possible embodiment, step 102 includes:
and if any angle offset is smaller than a preset second threshold value, determining that the position of the PTZ camera does not deviate.
If any detected angle offset is smaller than a preset second threshold value in the dynamic detection process, the PTZ camera only shakes in a small amplitude, so that the shooting of the PTZ camera cannot be greatly influenced, and the shooting of the PTZ camera is also adversely influenced due to excessive resetting, so that the position of the PTZ camera is determined not to be offset under the condition, and the new angle offset is continuously judged again. For example, the determination of any angle offset smaller than the preset second threshold may be performed at any time during the dynamic detection process, for example, during the process of determining whether the PTZ camera position is offset according to the accumulated offset, if an angle offset smaller than the preset second threshold is subsequently generated once at a continuous target angle offset, it is directly determined that the PTZ camera position is not offset.
When the single angular offset is smaller than the preset second threshold, the position of the PTZ camera is directly determined not to be offset, the influence of frequent resetting brought to the PTZ camera by small-amplitude jitter can be avoided, and the monitoring effect of the PTZ camera is ensured.
And 103, if the position of the PTZ camera is deviated, resetting the PTZ camera.
If the position of the PTZ camera is shifted, it indicates that the current position of the PTZ camera deviates greatly from the initial locking position, which makes the picture taken by the PTZ camera undesirable, and the PTZ camera needs to be reset to the initial locking position. For example, since the initial locking position is determined based on a preset bit, that is, the reset operation is to operate the PTZ camera based on a preset bit.
In one possible embodiment, a reset operation of the PTZ camera is performed, comprising:
driving the PTZ camera to operate in a preset direction, and determining that the PTZ camera moves to a calibration zero point position through a photo interrupter;
and driving the PTZ camera to run from the calibration zero point position to the locking position, and finishing the reset operation.
The PTZ camera is deflected in position, which means that the PTZ camera is lost in direction, and if the PTZ camera is directly reset to a preset position from the position lost in the current direction, the PTZ camera may fail to be reset or the PTZ camera may be reset inaccurately. Because the position information of the preset position is determined based on the calibration zero position, for example, the calibration zero position is determined as an initial zero, and the azimuth information of the preset position is calibrated according to the initial zero, the PTZ camera is restored to the calibration zero position first, and then is reset to the preset position from the calibration zero position for locking, and the reset operation is completed. In the embodiment of the present invention, the initial calibration zero point position is determined by the photo interrupter, and thus the preset direction is predetermined according to the setting position of the photo interrupter.
Specifically, the photo interrupter is arranged in the PTZ camera to determine the calibration zero point position, the PTZ camera is driven to operate in the preset direction where the photo interrupter is located, and if the light emitted by the photo interrupter is blocked at the target position, the target position is the calibration zero point position. The precision that the PTZ camera recovers to the calibration zero position is guaranteed through the photo-interrupter, and then the accuracy that the PTZ camera subsequently runs to the locking position where the preset position is located from the calibration zero position is guaranteed.
The embodiment of the invention realizes the real-time monitoring of the attitude position of the PTZ camera, and improves the accuracy of judging the attitude position offset of the PTZ camera through the comparison of the first threshold and the second threshold; after the position deviation of the PTZ camera is detected, the reset operation is executed, the automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise of not influencing the transmission layout of the camera and increasing the structural space layout pressure, the real-time automatic control is realized, and the work of manual intervention is reduced.
Example two
Fig. 2 is a flowchart of a PTZ camera calibration method in the second embodiment of the present invention, and the second embodiment is a possible embodiment of the present invention. As shown in fig. 2, the method includes:
the method comprises the steps that a command for controlling the operation of the PTZ camera issued by a user at a client (PC end) is acquired, a motor in the PTZ camera starts to operate when being electrified, the PTZ camera is driven to operate to a preset position, after the preset position is reached, the motor is electrified and locked, and meanwhile locking position information of the current preset position is recorded. The accelerometer sensor is used for dynamic detection of the angle offset, and a jitter threshold X, Y (X is less than Y) is set, wherein X is a threshold range exceeding the locking threshold, namely a preset second threshold, and Y is a threshold range with larger jitter, namely a preset first threshold.
When the PTZ camera shakes, whether the current single angular offset is larger than a preset first threshold value or not is judged, if the current single angular offset is larger than a threshold value Y, the PTZ camera shakes with a single large amplitude is judged, at the moment, the position of the PTZ camera is determined to shift, resetting operation is directly carried out at the highest speed, the time for judging the position of the PTZ camera is shortened, and the efficiency of self-calibration resetting of the PTZ camera is improved.
If the current single angular offset is smaller than the threshold value Y, the small-amplitude jitter in the PTZ can be judged. And continuously judging whether the angle offset is greater than a threshold value X, if the angle offset is less than or equal to the threshold value X, judging that the PTZ camera has small slight vibration, determining that the PTZ camera does not have offset on the position, and returning to continuously judge the newly generated angle offset.
And if the current single angular offset is larger than the threshold value X, judging that the PTZ camera has abnormal rotation with medium amplitude. In order to eliminate some external force influence interference, such as the situation that the PTZ continuously shakes at a high frequency due to the influence of strong wind, in the embodiment of the present invention, an accumulated shake amount, that is, an accumulated shift amount, is determined according to an angle shift amount continuously larger than a threshold value X, whether accumulated shake occurs or not is determined, and if the accumulated shift amount is larger than a threshold value Y, it is determined that the current PTZ camera position is shifted, and direct reset is performed. If the accumulated offset is smaller than Y, whether the detection times in the accumulated offset reach a preset time threshold M is continuously judged, if the detection times M are reached, resetting operation is carried out, and if the detection times M are not reached, returning is carried out to continuously judge the newly generated angle offset.
When a reset program is started, firstly, the motor drives the PTZ camera to operate towards the position of the photo interrupter, the photo interrupter can feed back whether the PTZ camera operates to the position of the standard zero point, after the PTZ camera is fed back to the position of the standard zero point through the photo interrupter, preset position information set by a user is inquired, the PTZ camera is driven to operate to the preset position from the position of the standard zero point, and reset operation is completed.
The following situations can occur in the judgment scene in the embodiment of the invention: firstly, the method comprises the following steps: when the PTZ camera shakes in a single violent degree, and the single angular offset caused by shaking is larger than a preset first threshold value Y, a reset program is directly and quickly started, and self-reset operation is realized. II, secondly: the method comprises the steps that continuous and multiple times of shaking with intensity degree occur to the PTZ camera, namely the continuous and multiple times of shaking with the angle offset larger than a preset second threshold value X and smaller than a preset first threshold value Y occur, the continuous and multiple times of accumulated offset is determined firstly, and if the accumulated offset is larger than the preset first threshold value Y, automatic resetting is carried out; if the accumulated offset is smaller than a preset first threshold value and the detection times in the accumulated offset are larger than a preset time threshold value, automatic reset is also carried out; if the accumulated offset is smaller than a preset first threshold value and the detection times are smaller than a preset time threshold value, the detection is continued. Thirdly, the method comprises the following steps: and the PTZ camera has discontinuous shaking with a plurality of degrees of intensity, namely shaking with the angle offset smaller than the preset second threshold X appears in the middle of shaking with the angle offset larger than the preset second threshold X and smaller than the preset first threshold Y for a plurality of times, which indicates that the PTZ camera has no accumulative shaking, and the dynamic detection process of the angle offset is kept. Fourthly, the method comprises the following steps: and if the PTZ camera shakes to a small extent, namely the angle offset is smaller than a preset second threshold value X, the dynamic detection and subsequent judgment processes of the angle offset are continued without processing. The reason is that under the condition of small jitter, the PTZ lens has a certain anti-jitter algorithm, can process the small jitter, and frequent reset operation is also regarded as jitter and generates certain interference, so that no processing is performed at this time, so as to improve the monitoring effect of the PTZ camera.
The embodiment of the invention has the following beneficial effects: the PTZ camera position deviation is determined through setting of the preset first threshold and the preset second threshold, and after the position deviation is determined, the PTZ camera is automatically reset, so that the attitude self-calibration after the PTZ camera is lost is realized. The closed-loop operation of posture automatic induction reset after the PTZ camera is lost in direction is realized by arranging the photo-interrupter, and the reset accuracy of the PTZ camera is improved. By automatically sensing the position offset change of the PTZ camera, the real-time automatic control is realized, the work of manual intervention is reduced, and the production is easy to realize.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a calibration apparatus for a PTZ camera according to a third embodiment of the present invention, which is applicable to a situation where a self-induction attitude position calibration is performed on the PTZ camera after the PTZ camera loses its direction under the influence of an external force. As shown in fig. 3, the apparatus includes:
the angle offset detection module 310 is configured to acquire locking position information of the PTZ camera and dynamically detect an angle offset of the PTZ camera after locking;
a position deviation determining module 320, configured to determine whether the PTZ camera position deviates according to a direct comparison result between the angle deviation amount and a preset first threshold, and an accumulated comparison result between the angle deviation amount and a preset second threshold; wherein the preset first threshold is greater than the preset second threshold;
a resetting module 330, configured to perform a resetting operation on the PTZ camera if the PTZ camera is shifted in position.
The embodiment of the invention realizes the real-time monitoring of the attitude position of the PTZ camera, and improves the accuracy of judging the attitude position offset of the PTZ camera through the comparison of the first threshold and the second threshold; after the position deviation of the PTZ camera is detected, the reset operation is executed, the automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise of not influencing the transmission layout of the camera and increasing the structural space layout pressure, the real-time automatic control is realized, and the work of manual intervention is reduced.
Optionally, the position offset determining module includes:
the accumulated offset determining unit is used for determining the accumulated offset according to the continuous target angle offset if the continuous target angle offset is greater than or equal to a preset second threshold and smaller than a preset first threshold;
and the position deviation determining unit is used for determining whether the position of the PTZ camera deviates or not according to the comparison result of the accumulated deviation amount and a preset first threshold value.
Optionally, the position offset determining unit is specifically configured to:
if the accumulated offset is smaller than a preset first threshold, determining whether the position of the PTZ camera deviates according to the detection times of the continuous target angle offset;
and if the detection times are larger than or equal to a preset time threshold value, determining that the position of the PTZ camera deviates.
Optionally, the position offset determining unit is specifically configured to:
and if the accumulated offset is greater than or equal to a preset first threshold, determining that the position of the PTZ camera is offset.
Optionally, the position offset determining module is specifically configured to:
and if any angle offset is larger than or equal to a preset first threshold value, determining that the position of the PTZ camera is offset.
Optionally, the position offset determining module is specifically configured to:
and if any angle offset is smaller than a preset second threshold value, determining that the position of the PTZ camera does not offset.
Optionally, the reset module is specifically configured to:
driving the PTZ camera to operate in a preset direction, and determining that the PTZ camera moves to a calibration zero point position through a photo interrupter;
and driving the PTZ camera to run from the calibration zero point position to a locking position, and finishing the reset operation.
The PTZ camera calibration device provided by the embodiment of the invention can execute the PTZ camera calibration method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the PTZ camera calibration method.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 4, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory device 28, and a bus 18 that couples various system components including the system memory device 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system storage 28 may include computer system readable media in the form of volatile storage, such as Random Access Memory (RAM)30 and/or cache storage 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Storage 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in storage 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 4, the network adapter 20 communicates with the other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system storage device 28, for example, to implement the PTZ camera calibration method provided by the embodiment of the present invention, including:
acquiring locking position information of a PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking;
determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and if the position of the PTZ camera is deviated, executing the reset operation of the PTZ camera.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a PTZ camera calibration method provided in an embodiment of the present invention, where the method includes:
acquiring locking position information of a PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking;
determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and if the position of the PTZ camera is deviated, executing the reset operation of the PTZ camera.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. A PTZ camera calibration method, comprising:
acquiring locking position information of a PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking;
determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and if the position of the PTZ camera is deviated, executing the reset operation of the PTZ camera.
2. The method of claim 1, wherein determining whether the PTZ camera position is offset based on a direct comparison of the angular offset with a preset first threshold and a cumulative comparison with a preset second threshold comprises:
if the continuous target angle offset is greater than or equal to a preset second threshold and smaller than a preset first threshold, determining an accumulated offset according to the continuous target angle offset;
and determining whether the position of the PTZ camera deviates or not according to a comparison result of the accumulated deviation amount and a preset first threshold value.
3. The method of claim 2, wherein determining whether the PTZ camera position is offset based on a comparison of the cumulative offset amount to a preset first threshold comprises:
if the accumulated offset is smaller than a preset first threshold, determining whether the position of the PTZ camera deviates according to the detection times of the continuous target angle offset;
and if the detection times are larger than or equal to a preset time threshold value, determining that the position of the PTZ camera deviates.
4. The method of claim 2, wherein determining whether the PTZ camera position is offset based on a comparison of the cumulative offset amount to a preset first threshold comprises:
and if the accumulated offset is greater than or equal to a preset first threshold value, determining that the position of the PTZ camera is offset.
5. The method of claim 1, wherein determining whether the PTZ camera position is offset based on a direct comparison of the angular offset with a preset first threshold and a cumulative comparison with a preset second threshold comprises:
and if any angle offset is larger than or equal to a preset first threshold value, determining that the position of the PTZ camera is offset.
6. The method of claim 1, wherein determining whether the PTZ camera position is offset based on a direct comparison of the angular offset with a preset first threshold and a cumulative comparison with a preset second threshold comprises:
and if any angle offset is smaller than a preset second threshold value, determining that the position of the PTZ camera does not offset.
7. The method of claim 1, wherein performing a reset operation on the PTZ camera comprises:
driving the PTZ camera to operate towards a preset direction, and determining that the PTZ camera moves to a calibration zero point position through a photo interrupter;
and driving the PTZ camera to run from the calibration zero point position to a locking position, and finishing the reset operation.
8. A PTZ camera calibration device, comprising:
the angle deviation detection module is used for acquiring locking position information of the PTZ camera and dynamically detecting the angle deviation amount of the PTZ camera after locking;
the position deviation determining module is used for determining whether the position of the PTZ camera deviates or not according to a direct comparison result of the angle deviation amount and a preset first threshold value and an accumulated comparison result of the angle deviation amount and a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and the resetting module is used for executing the resetting operation of the PTZ camera if the position of the PTZ camera deviates.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a PTZ camera calibration method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a PTZ camera calibration method according to any one of claims 1 to 7.
CN202110139316.9A 2021-02-01 2021-02-01 PTZ camera calibration method, device, electronic equipment and storage medium Active CN114845037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110139316.9A CN114845037B (en) 2021-02-01 2021-02-01 PTZ camera calibration method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110139316.9A CN114845037B (en) 2021-02-01 2021-02-01 PTZ camera calibration method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114845037A true CN114845037A (en) 2022-08-02
CN114845037B CN114845037B (en) 2024-02-13

Family

ID=82560838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110139316.9A Active CN114845037B (en) 2021-02-01 2021-02-01 PTZ camera calibration method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114845037B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937816A (en) * 2012-11-22 2013-02-20 四川华雁信息产业股份有限公司 Method and device for calibrating preset position deviation of camera
JP2017026667A (en) * 2015-07-16 2017-02-02 日本電産サンキョー株式会社 Imaging apparatus
US20180365857A1 (en) * 2017-06-14 2018-12-20 Hyundai Mobis Co., Ltd. Camera angle estimation method for around view monitoring system
CN111669508A (en) * 2020-07-01 2020-09-15 海信视像科技股份有限公司 Camera control method and display device
CN111932609A (en) * 2020-07-08 2020-11-13 广州科易光电技术有限公司 Cloud deck calibration method and device for valve hall equipment inspection robot and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937816A (en) * 2012-11-22 2013-02-20 四川华雁信息产业股份有限公司 Method and device for calibrating preset position deviation of camera
JP2017026667A (en) * 2015-07-16 2017-02-02 日本電産サンキョー株式会社 Imaging apparatus
US20180365857A1 (en) * 2017-06-14 2018-12-20 Hyundai Mobis Co., Ltd. Camera angle estimation method for around view monitoring system
CN111669508A (en) * 2020-07-01 2020-09-15 海信视像科技股份有限公司 Camera control method and display device
CN111932609A (en) * 2020-07-08 2020-11-13 广州科易光电技术有限公司 Cloud deck calibration method and device for valve hall equipment inspection robot and storage medium

Also Published As

Publication number Publication date
CN114845037B (en) 2024-02-13

Similar Documents

Publication Publication Date Title
US10061989B2 (en) Information transfer apparatus and method for image recognition
JP5854655B2 (en) A method for evaluating the horizontal speed of drones, especially drones capable of hovering flight under autopilot
US7032469B2 (en) Three axes line-of-sight transducer
EP2214403B1 (en) Image processing device, photographing device, reproducing device, integrated circuit, and image processing method
CN110246182B (en) Vision-based global map positioning method and device, storage medium and equipment
KR102077597B1 (en) Anti-air tracking device and operation method of the same
CN111666891B (en) Method and device for estimating movement state of obstacle
JP2006099109A (en) System and method for detecting image capture device movement with two dual axis linear accelerometers
JPH11271831A (en) Interchangeable lens and shake correction camera
JP5742086B2 (en) Control device
KR102176284B1 (en) Digital photographing System and Controlling method thereof
CN114845037A (en) PTZ camera calibration method and device, electronic equipment and storage medium
CN111783611B (en) Unmanned vehicle positioning method and device, unmanned vehicle and storage medium
CN117294938A (en) Camera focusing method and device, electronic equipment and computer readable storage medium
CN112578355A (en) Radar calibration method, device, equipment and storage medium
KR101608828B1 (en) Apparatus for vibration compensation of gyro sensor of mobile camera
KR102468355B1 (en) Apparatus and method for monitoring moving target based on complementary gimbal control through displacement partitioning
JP7455558B2 (en) Imaging device and its spatial stabilization method
CN109891872B (en) Image stabilization control apparatus for image forming apparatus
US7800653B2 (en) Systems and methods for compensating signal drift according to a calculated absolute difference value
JP2019092036A (en) Imaging apparatus and control method
EP3522520B1 (en) Image processing method, electronic device, and non-transitory computer readable storage medium
CN112153270A (en) Cloud deck zero point detection method and device, camera and storage medium
RU184765U1 (en) DEVICE FOR TECHNICAL VISION
US9621801B2 (en) Imaging apparatus to control rotation of an image capturing device

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