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

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

Info

Publication number
CN114845037B
CN114845037B CN202110139316.9A CN202110139316A CN114845037B CN 114845037 B CN114845037 B CN 114845037B CN 202110139316 A CN202110139316 A CN 202110139316A CN 114845037 B CN114845037 B CN 114845037B
Authority
CN
China
Prior art keywords
ptz camera
preset
offset
threshold value
angle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110139316.9A
Other languages
Chinese (zh)
Other versions
CN114845037A (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

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 device, electronic equipment and a storage medium. According to the embodiment of the invention, the real-time monitoring of the gesture position of the PTZ camera is realized by dynamically detecting the angle offset of the PTZ camera after locking, and the accuracy of the gesture position offset judgment of the PTZ camera is improved by comparing the first threshold value with the second threshold value; after the PTZ camera is detected to be shifted in position, reset operation is executed, automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise that the transmission layout of the camera is not affected and the structural space layout pressure is increased, real-time automatic control is realized, and 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 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, a pitch angle, and zooming control of a lens. However, the PTZ camera may be lost in the vertical direction due to external forces (e.g., strong shock, strong wind, etc.) in a severe environment.
The existing solutions are: in a 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 an initial setting position through an operation software system. And secondly, carrying out current position information feedback by adopting a combination of a Hall element and a magnet, and driving a motor to rotate and control to return to an initial setting position after detecting that the PTZ moves under non-control. And thirdly, an encoder is added on an internal control circuit board of the ball machine, and position information is fed back in real time to form closed loop feedback control.
However, in the first scheme, there is a time difference in manual control, and the PTZ direction is not easy to be found to be lost 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 arranged on the use and installation to ensure the measurement accuracy, so that the difficulty of the structural design of the product is increased. In the third scheme, the encoder is large in size, complex in structure, enough reserved space is needed, difficulty in structural design of products is increased, internal elements of the photoelectric encoder are greatly influenced by environment, the photoelectric encoder is not suitable for being used outdoors and in severe environments, and the magnetoelectric encoder is also easy to be subjected to electromagnetic interference and needs to take compensation and protection measures to 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 as to realize self-calibration of a PTZ camera and ensure the accuracy of self-calibration.
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 PTZ camera position is deviated 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 PTZ camera position is shifted, executing a reset operation of the PTZ camera.
In a second aspect, an embodiment of the present invention further provides a PTZ camera calibration device, including:
the angle offset detection module is used for acquiring the locking position information of the PTZ camera and dynamically detecting the angle offset of the PTZ camera after locking;
the position offset determining module is used for determining whether the PTZ camera position is offset according to a direct comparison result of the angle offset and a preset first threshold value and an accumulated comparison result of the angle offset 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 resetting operation on the PTZ camera if the position of the PTZ camera is deviated.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the PTZ camera calibration method according to any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a PTZ camera calibration method according to any of the embodiments of the present invention.
The embodiment of the invention is based on acquiring the locking position information of the PTZ camera and dynamically detecting the angular offset of the PTZ camera after locking; determining whether the PTZ camera position is deviated 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 PTZ camera position is shifted, executing a reset operation of the PTZ camera. The embodiment of the invention realizes real-time monitoring of the gesture position of the PTZ camera, and improves the accuracy of gesture position deviation judgment of the PTZ camera through comparison of the first threshold value and the second threshold value; after the PTZ camera is detected to be shifted in position, reset operation is executed, automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise that the transmission layout of the camera is not affected and the structural space layout pressure is increased, real-time automatic control is realized, and 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 view 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 invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a PTZ camera calibration method according to a first embodiment of the present invention, and the present embodiment is applicable to a case where a PTZ camera is self-induced to calibrate its pose position after the PTZ camera is lost in a direction under the influence of an external force. The method may be performed by a PTZ camera calibration device, which may be implemented in software and/or hardware, and may be configured in an electronic device, e.g. a device with communication and computing capabilities, such as a background server. As shown in fig. 1, the method specifically includes:
and 101, acquiring locking position information of the PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking.
Wherein, PTZ camera (Pan-Tilt-Zoom camera) can carry out all-round (left and right/up and down) movement of cloud platform and lens Zoom, zoom control. After the PTZ camera is locked at a certain fixed position, the PTZ camera can be lost in the vertical direction after being influenced by external force, and the phenomenon that pictures shot in the PTZ camera are lost or pictures acquired are not pictures acquired at a preset position can occur, so that adverse effects are brought to monitoring of the PTZ camera. 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 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 a preset position, a locking operation of the PTZ camera is performed so as to lock the PTZ camera to the preset position, and current locking position information is acquired. After the current locking position information is obtained, maintaining dynamic detection of the current position information after locking, and feeding back a difference value between the current position information and the locking position information if the current position information changes; correspondingly, if the current position is still detected to be changed subsequently, feeding back the difference value between the current position information and the position information before the change as the angle offset. Illustratively, when the client controls the PTZ camera to give an operation command, the 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 to lock, and meanwhile locking position information of the PTZ camera is recorded. And the 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 amount of single position change of the PTZ camera. The linear acceleration precision output by the accelerometer sensor reaches 0.01g/LSB at present, the angle precision value obtained by the software algorithm can reach 0.1 degree, and the real-time performance and accuracy of detection are ensured.
102, determining whether the PTZ camera position is deviated 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.
The setting of the preset first threshold value and the preset second threshold value is determined according to the actual shooting effect of the PTZ camera, and when the PTZ camera deviates from the preset first threshold value at the initial locking position, the shooting picture of the PTZ camera is thoroughly lost; when the PTZ camera is shifted by a preset second threshold value at the initial locking position, the photographed picture of the PTZ camera is caused to change to some extent. For example, the preset first threshold may be set to 0.5 degrees, and the preset second threshold may be set to 0.2 degrees, where specific values are determined according to the magnification, distance, and the like of the actual PTZ camera, which is not limited herein. By setting the preset first threshold value and the preset second threshold value, the angular offset of the PTZ camera can be judged more accurately.
Specifically, the degree of single angle deviation of the PTZ camera is represented by the angle deviation, the preset first threshold value represents the maximum allowable deviation angle of the PTZ camera without losing pictures, and the preset second threshold value represents the minimum deviation angle of the PTZ camera with changed pictures, so that whether the pictures of the PTZ camera are lost can be reflected according to the direct comparison result of the single angle deviation of the PTZ camera and the preset first threshold value, whether the pictures of the PTZ camera are lost or not can be caused when continuous shaking occurs by the PTZ camera can be reflected by the accumulated comparison result of the preset second threshold value, meanwhile, the interference of the angle deviation caused by non-accumulated shaking can be avoided by the accumulated comparison result, and the accuracy of determining the position deviation of the PTZ camera is improved.
The direct comparison result of the angle offset with the preset first threshold value and the accumulated comparison result with the preset second threshold value have the following cases.
In one possible embodiment, step 102 includes:
if the continuous target angle offset is greater than or equal to a preset second threshold value and smaller than a preset first threshold value, determining an accumulated offset according to the continuous target angle offset;
and determining whether the PTZ camera position is deviated or not according to a comparison result of the accumulated deviation amount and a preset first threshold value.
The continuous target angle offset is greater than or equal to a preset second threshold value and smaller than the preset first threshold value, which means that at least two adjacent single angle offsets are greater than or equal to the preset second threshold value and smaller than the preset first threshold value, namely at least two times of medium-amplitude jitter are generated.
Specifically, if any angle offset is greater than or equal to a preset second threshold and less than a preset first threshold, determining whether the value of the next adjacent angle offset is greater than or equal to the preset second threshold and less than the preset first threshold, if the condition is still met, determining that a continuous target angle offset is greater than or equal to the preset second threshold and less than the preset first threshold, and determining the accumulated offset according to the continuous target angle offset. For example, the current position obtained through accelerometer sensor feedback determines the angle offset to be 0.3 degrees and 0.4 degrees, and if the two continuous single angle offsets are both greater than 0.2 degrees and smaller than 0.5 degrees, the current position is the continuous target angle offset, and the accumulated offset is determined to be 0.7 degrees according to 0.2 degrees and 0.5 degrees.
After the accumulated offset is obtained, whether the PTZ camera position is offset is determined according to a comparison result of the accumulated offset and a preset first threshold value. Since the preset first threshold value represents the maximum allowable offset angle of the PTZ camera without losing pictures, the offset result of the camera position is determined according to the comparison result of the accumulated offset and the preset first threshold value, so that the PTZ camera can be ensured to shoot pictures without losing.
The comparison result of the accumulated offset with the preset first threshold has the following cases.
In one possible embodiment, determining whether the PTZ camera position is offset based on a comparison of the accumulated offset with a preset first threshold includes:
if the accumulated offset is smaller than a preset first threshold, determining whether the PTZ camera position is offset according to the detection times of the continuous target angle offset;
and if the detection times are greater than or equal to a preset times threshold value, determining that the PTZ camera position is shifted.
If the accumulated offset is smaller than the preset first threshold, it means that although the PTZ camera generates a plurality of medium-amplitude jitters, the accumulated offset does not cause the PTZ camera to lose on the screen, and at this time, further judgment is performed according to the number of times of detecting the continuous target angle offset.
The number of times of detection of the continuous target angle offset indicates that the continuous target angle offset included in the calculation of the accumulated offset is obtained through several times of single detection feedback. Specifically, if the detection is greater than or equal to the preset time threshold, the situation that the PTZ camera is continuously swayed under the influence of external force at high frequency is shown although the picture is not lost, and at the moment, the position of the PTZ camera is determined to be shifted. When the accumulated offset is smaller than a preset first threshold value, whether the PTZ camera position is offset is determined according to the detection times, so that 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 reset frequently. If the accumulated offset is smaller than a preset first threshold value and the detection times are smaller than a preset times threshold value, continuing to determine the next angular offset, and if the next angular offset still meets the conditions that the accumulated offset is larger than or equal to a preset second threshold value and smaller than the preset first threshold value, 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 a comparison of the accumulated offset with a preset first threshold includes:
and if the accumulated offset is greater than or equal to a preset first threshold value, determining that the PTZ camera position is offset.
If the accumulated offset is greater than or equal to a preset first threshold, the accumulated offset indicates that continuous jitter causes the loss of the PTZ camera picture, and the position of the PTZ camera is determined to be offset.
By comparing the accumulated offset with a preset first threshold value, adverse effects on PTZ camera shooting caused by repeated medium-amplitude jitter are avoided, and the accuracy of PTZ camera pose detection is improved.
In one possible embodiment, step 102 includes:
and if any angle offset is greater than or equal to a preset first threshold value, determining that the PTZ camera position is offset.
If any detected angle offset is larger than or equal to a preset first threshold value in the dynamic detection process, the PTZ camera is subjected to single large-amplitude jitter, and the jitter causes the 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 condition. For example, the determination of any angular offset greater than or equal to the preset first threshold may be performed at any time during the dynamic detection, for example, during the determination of whether the PTZ camera position is offset according to the accumulated offset, if the angular offset greater than or equal to the preset first threshold occurs once after the continuous target angular offset, the PTZ camera position is directly determined to be offset.
When the single angular offset is larger than or equal to a preset first threshold, the position of the PTZ camera is directly determined to be offset, so that the judgment time of the position offset of the PTZ camera can be reduced, and the resetting efficiency of the PTZ camera is further improved.
In one possible embodiment, step 102 includes:
if any angle offset is smaller than a preset second threshold value, determining that the PTZ camera position is not offset.
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, the PTZ camera shooting cannot be greatly affected, and the PTZ camera shooting can be adversely affected due to excessive times of 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 angular offset less 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 the continuous target angular offset occurs once more, and then the PTZ camera position is directly determined to be not offset.
When the single angular offset is smaller than the preset second threshold value, the position of the PTZ camera is directly determined to be not offset, so that the influence of small-amplitude jitter on frequent reset of the PTZ camera can be avoided, and the monitoring effect of the PTZ camera is ensured.
Step 103, if the position of the PTZ camera is shifted, a reset operation of the PTZ camera is executed.
If the position of the PTZ camera is shifted, the current position of the PTZ camera is greatly deviated from the initial locking position, so that the picture shot by the PTZ camera is not wanted, and the PTZ camera needs to be reset to return to the initial locking position. Illustratively, since the initial lock position is determined based on preset bits, i.e., the reset operation refers to operating the PTZ camera based on preset bits.
In one possible embodiment, performing a reset operation on the PTZ camera includes:
driving the PTZ camera to run in a preset direction, and determining that the PTZ camera moves to a calibrated zero position through an optical interrupter;
and driving the PTZ camera to operate from the calibration zero position to the locking position, and finishing the reset operation.
The PTZ camera is deflected in position, so that the PTZ camera is lost in the appearance direction, and if the PTZ camera is reset to a preset position from the position lost in the current direction, the reset failure or inaccurate reset can be caused. Because the position information of the preset position is determined based on the calibration zero point position, for example, the calibration zero point position is determined to be the initial zero point, and the azimuth information of the preset position is calibrated according to the initial zero point, the PTZ camera is restored to the calibration zero point position, and then is reset to the preset position from the calibration zero point position for locking, so that the reset operation is completed. In the embodiment of the invention, the initial calibration zero position is determined by the optical interrupter, so that the preset direction is predetermined according to the setting position of the optical interrupter.
Specifically, an optical interrupter is arranged in the PTZ camera to determine a calibration zero position, the PTZ camera is driven to run in a preset direction where the optical interrupter is located, and if light emitted by the optical interrupter is blocked at a target position, the target position is indicated to be the calibration zero position. The precision of the PTZ camera recovering to the calibration zero position is guaranteed through the optical interrupter, and the accuracy of the locking position from the calibration zero position to the preset position is further guaranteed.
The embodiment of the invention realizes real-time monitoring of the gesture position of the PTZ camera, and improves the accuracy of gesture position deviation judgment of the PTZ camera through comparison of the first threshold value and the second threshold value; after the PTZ camera is detected to be shifted in position, reset operation is executed, automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise that the transmission layout of the camera is not affected and the structural space layout pressure is increased, real-time automatic control is realized, and manual intervention is reduced.
Example two
Fig. 2 is a flowchart of a PTZ camera calibration method in a second embodiment of the present invention, which is a possible embodiment of the present invention. As shown in fig. 2, the method includes:
and acquiring a command which is issued by a user at a client (PC end) and used for controlling the operation of the PTZ camera, starting the operation of the PTZ camera by electrifying a motor, driving the PTZ camera to operate to a preset position, electrifying and locking the motor after the PTZ camera reaches the preset position, and simultaneously recording the locking position information of the current preset position. The dynamic detection of the angular offset is performed by using an accelerometer sensor, and meanwhile, a jitter threshold X, Y (X < 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, judging whether the current single angle offset is larger than a preset first threshold value, if so, judging that the PTZ camera shakes with single larger amplitude, determining that the position of the PTZ camera is offset at the moment, and directly resetting at the fastest speed to reduce the time for judging the position of the PTZ camera and improve the self-calibration resetting efficiency of the PTZ camera.
If the current single angle offset is smaller than the threshold value Y, the PTZ can be judged to generate small-amplitude jitter. And continuously judging whether the angle offset is larger than the threshold value X, if the angle offset is smaller than or equal to the threshold value X, judging that the PTZ camera has small fine vibration, determining that the PTZ camera does not have offset in position, and returning to continuously judging the newly generated angle offset.
If the current single angle offset is larger than the threshold value X, the PTZ camera is judged to have medium-amplitude abnormal rotation. In order to eliminate some external force influence interference, such as the condition that strong wind influence causes PTZ to continuously shake at high frequency, in the embodiment of the invention, the accumulated shake amount, namely the accumulated shake amount, is determined according to the angle shake amount continuously larger than the threshold value X, whether accumulated shake occurs is judged, if the accumulated shake amount is larger than the threshold value Y, the current PTZ camera position is determined to deviate, and direct reset is carried out. If the accumulated offset is smaller than Y, continuously judging whether the preset frequency threshold M is reached according to the detection frequency in the accumulated offset, if the preset frequency threshold M is reached, resetting, and if the preset frequency threshold M is not reached, continuously judging the newly generated angle offset.
When a reset program is started, firstly, the PTZ camera is driven by a motor to operate towards the position of the optical interrupter, the optical interrupter can feed back whether the PTZ camera operates to the calibration zero position, after the PTZ camera reaches the calibration zero position through the feedback of the optical interrupter, preset position information set by a user is queried, and the PTZ camera is driven to operate from the calibration zero position to the preset position, so that reset operation is completed.
The judgment scene in the embodiment of the invention can have the following cases: and (3) a step of: and when the single-time intensity jitter of the PTZ camera occurs, and the single-time angle offset caused by the jitter is larger than the preset first threshold Y, the reset program is directly and rapidly started, and the self-reset operation is realized. And II: the PTZ camera shakes continuously for a plurality of times, namely shakes with the angle offset larger than a preset second threshold value X and smaller than a preset first threshold value Y continuously occur for a plurality of times, firstly, the accumulated offset of the continuous times is determined, 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 the preset first threshold and the detection times in the accumulated offset are larger than the preset times threshold, automatic reset is also carried out; if the accumulated offset is smaller than the preset first threshold and the detection times are smaller than the preset times threshold, continuing to detect. Thirdly,: discontinuous shaking of multiple times of intensity of the PTZ camera, namely shaking of which the angular offset is larger than a preset second threshold value X and smaller than a preset first threshold value Y appears in the middle of shaking of which the angular offset is smaller than the preset second threshold value X, indicates that accumulated shaking of the PTZ camera does not appear, and the process of dynamically detecting the angular offset is kept. Fourth, 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 PTZ camera does not need to be processed, and the dynamic detection and subsequent judgment processes of the angle offset are continued. The PTZ lens has a certain anti-shake algorithm under the condition of small shake, small shake can be processed, frequent reset operation is regarded as shake, and certain interference can be generated, so that no processing is performed at this time, and the monitoring effect of the PTZ camera is improved.
The embodiment of the invention has the beneficial effects that: the PTZ camera position offset is determined by setting the preset first threshold value and the preset second threshold value, and when the position offset is determined, the PTZ camera is automatically reset, so that the posture self-calibration after the PTZ camera direction is lost is realized. The PTZ camera is automatically induced to reset after losing the direction by arranging the optical interrupter, so that the reset accuracy of the PTZ camera is improved. The PTZ camera position deviation is automatically sensed, so that real-time automatic control is realized, manual intervention is reduced, and the method is easy to realize in a commercialized manner.
Example III
Fig. 3 is a schematic structural diagram of a PTZ camera calibration device according to a third embodiment of the present invention, and the present embodiment is applicable to a case where a PTZ camera is self-induced to calibrate its posture position after the PTZ camera is lost in a direction under the influence of an external force. As shown in fig. 3, the apparatus includes:
an angular offset detection module 310, configured to obtain locking position information of the PTZ camera, and dynamically detect an angular offset of the PTZ camera after locking;
a position offset determining module 320, configured to determine whether the PTZ camera position is offset according to a direct comparison result of the angular offset with a preset first threshold value and an accumulated comparison result with a preset second threshold value; wherein the preset first threshold is greater than the preset second threshold;
and a resetting module 330, configured to execute a resetting operation on the PTZ camera if the PTZ camera position is shifted.
The embodiment of the invention realizes real-time monitoring of the gesture position of the PTZ camera, and improves the accuracy of gesture position deviation judgment of the PTZ camera through comparison of the first threshold value and the second threshold value; after the PTZ camera is detected to be shifted in position, reset operation is executed, automatic posture calibration control after the PTZ camera is lost under the influence of external force is realized on the premise that the transmission layout of the camera is not affected and the structural space layout pressure is increased, real-time automatic control is realized, and 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 larger than or equal to a preset second threshold value and smaller than a preset first threshold value;
and the position offset determining unit is used for determining whether the position of the PTZ camera is offset according to the comparison result of the accumulated offset 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 PTZ camera position is offset according to the detection times of the continuous target angle offset;
and if the detection times are greater than or equal to a preset times threshold value, determining that the PTZ camera position is shifted.
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 value, determining that the PTZ camera position is offset.
Optionally, the position offset determining module is specifically configured to:
and if any angle offset is greater than or equal to a preset first threshold value, determining that the PTZ camera position 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 PTZ camera position is not offset.
Optionally, the reset module is specifically configured to:
driving the PTZ camera to run in a preset direction, and determining that the PTZ camera moves to a calibration zero position through an optical interrupter;
and driving the PTZ camera to run from the calibration zero position to the 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 the corresponding functional modules and beneficial effects of executing the PTZ camera calibration method.
Example IV
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 merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 4, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory device 28, a bus 18 that connects the various system components, including the system memory device 28 and the processing unit 16.
Bus 18 represents one or more of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include 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 can 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 memory such as Random Access Memory (RAM) 30 and/or cache memory 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 or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The storage device 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the 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 or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the device 12, and/or any devices (e.g., network card, modem, etc.) that enable the device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown in fig. 4, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown in fig. 4, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system storage device 28, for example, implementing a PTZ camera calibration method provided by an 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 PTZ camera position is deviated 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 PTZ camera position is shifted, executing a reset operation of the PTZ camera.
Example five
The fifth embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the PTZ camera calibration method as 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 PTZ camera position is deviated 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 PTZ camera position is shifted, executing a reset operation of the PTZ camera.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A method of calibrating a PTZ camera, comprising:
acquiring locking position information of a PTZ camera, and dynamically detecting the angle offset of the PTZ camera after locking;
determining whether the PTZ camera position is deviated 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 value is larger than the preset second threshold value, the preset first threshold value represents the maximum allowable offset angle of a picture which is not lost by the PTZ camera, and the preset second threshold value represents the minimum offset angle of the picture which is shot by the PTZ camera and is changed;
and if the PTZ camera position is shifted, executing a 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 to a preset first threshold and an accumulated comparison to a preset second threshold comprises:
if the continuous target angle offset is greater than or equal to a preset second threshold value and smaller than a preset first threshold value, determining an accumulated offset according to the continuous target angle offset;
and determining whether the PTZ camera position is offset according to a comparison result of the accumulated offset 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 accumulated offset to a preset first threshold comprises:
if the accumulated offset is smaller than a preset first threshold, determining whether the PTZ camera position is offset according to the detection times of the continuous target angle offset;
and if the detection times are greater than or equal to a preset times threshold value, determining that the PTZ camera position is shifted.
4. The method of claim 2, wherein determining whether the PTZ camera position is offset based on a comparison of the accumulated offset 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 PTZ camera position 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 to a preset first threshold and an accumulated comparison to a preset second threshold comprises:
and if any angle offset is greater than or equal to a preset first threshold value, determining that the PTZ camera position 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 to a preset first threshold and an accumulated comparison to a preset second threshold comprises:
and if any angle offset is smaller than a preset second threshold value, determining that the PTZ camera position is not offset.
7. The method of claim 1, wherein performing a reset operation on the PTZ camera comprises:
driving the PTZ camera to run in a preset direction, and determining that the PTZ camera moves to a calibration zero position through an optical interrupter;
and driving the PTZ camera to run from the calibration zero position to the locking position, and finishing the reset operation.
8. A PTZ camera calibration device comprising:
the angle offset detection module is used for acquiring the locking position information of the PTZ camera and dynamically detecting the angle offset of the PTZ camera after locking;
the position offset determining module is used for determining whether the PTZ camera position is offset according to a direct comparison result of the angle offset and a preset first threshold value and an accumulated comparison result of the angle offset and a preset second threshold value; the preset first threshold value is larger than the preset second threshold value, the preset first threshold value represents the maximum allowable offset angle of a picture which is not lost by the PTZ camera, and the preset second threshold value represents the minimum offset angle of the picture which is shot by the PTZ camera and is changed;
and the resetting module is used for executing resetting operation on the PTZ camera if the position of the PTZ camera is deviated.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the PTZ camera calibration method as recited in any one of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the PTZ camera calibration method according to any of claims 1-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 CN114845037A (en) 2022-08-02
CN114845037B true 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 (4)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086650B (en) * 2017-06-14 2022-04-12 现代摩比斯株式会社 Calibration method and calibration apparatus

Patent Citations (4)

* 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
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
CN114845037A (en) 2022-08-02

Similar Documents

Publication Publication Date Title
KR101778420B1 (en) System and method for adjusting orientation of captured video
US20160292512A1 (en) Information transfer apparatus, learning system, information transfer method, and computer-readable recording medium
KR102077597B1 (en) Anti-air tracking device and operation method of the same
CN101236307A (en) Hand-shake correction method and apparatus of camera module for use in mobile device
CN104469139A (en) Image Capturing Apparatus And Image Capturing Method
US11381751B2 (en) Handheld gimbal control method, handheld gimbal, and handheld device
WO2019127344A1 (en) Pan-tilt head reset control method and device, pan-tilt head, and unmanned aerial vehicle
WO2019127094A1 (en) Unmanned aerial vehicle and unmanned aerial vehicle control method and apparatus
US20170261763A1 (en) Anti-shake correction system for curved optical sensor
CN114338994B (en) Optical anti-shake method, apparatus, electronic device, and computer-readable storage medium
CN104767930A (en) Device used for image correction and method
CN113452914A (en) Optical anti-shake control device, optical anti-shake control method thereof and mobile terminal
US20210276700A1 (en) Control method and device for unmanned aerial vehicle, and unmanned aerial vehicle
US7460774B2 (en) Method to control image stabilizer
JP5742086B2 (en) Control device
CN114845037B (en) PTZ camera calibration method, device, electronic equipment and storage medium
KR102176284B1 (en) Digital photographing System and Controlling method thereof
US20170331998A1 (en) Camera device, method for camera device, and non-transitory computer readable storage medium
KR20160093257A (en) Optical image stabilizer and camera module including the same
KR101608828B1 (en) Apparatus for vibration compensation of gyro sensor of mobile camera
CN110868584B (en) Focal length calibration method and device of image acquisition device
US10887517B2 (en) Image stabilization control device for imaging device
US7800653B2 (en) Systems and methods for compensating signal drift according to a calculated absolute difference value
CN112153270B (en) Cloud deck zero point detection method and device, camera and storage medium
JP2019092036A (en) Imaging apparatus and control method

Legal Events

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