WO2022022118A1 - Dome camera control method, apparatus, and device - Google Patents

Dome camera control method, apparatus, and device Download PDF

Info

Publication number
WO2022022118A1
WO2022022118A1 PCT/CN2021/099895 CN2021099895W WO2022022118A1 WO 2022022118 A1 WO2022022118 A1 WO 2022022118A1 CN 2021099895 W CN2021099895 W CN 2021099895W WO 2022022118 A1 WO2022022118 A1 WO 2022022118A1
Authority
WO
WIPO (PCT)
Prior art keywords
target object
camera
command
dome camera
control
Prior art date
Application number
PCT/CN2021/099895
Other languages
French (fr)
Chinese (zh)
Inventor
仇悦
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022022118A1 publication Critical patent/WO2022022118A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/292Multi-camera tracking
    • 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
    • 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/61Control of cameras or camera modules based on recognised objects
    • 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/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Definitions

  • the present application relates to the technical field of control, and in particular, to a ball machine control method, device and device.
  • the dome camera is a commonly used equipment in the field of intelligent security video surveillance, including a camera and a pan/tilt for supporting the camera.
  • the stepping motor in the pan/tilt drives the camera installed on the pan/tilt to rotate to realize the change of the shooting picture. Because the camera in the dome camera can be rotated and the magnification can be changed, it is widely used in the target tracking scene in security monitoring.
  • the dome camera when it is tracking the target object, it usually first determines the square frame where the target object is located based on the collected image, and then calculates the angle deviation of the dome camera according to the pixel deviation between the center point of the square frame and the center point of the image. Then, the camera in the dome camera is driven by the PTZ to rotate. However, because the above control process is to determine the angle deviation, then send commands to control the rotation of the gimbal. In the specific implementation process, the response of the gimbal tends to lag significantly behind the change of the position of the target object in the actual screen, and the rotation and magnification of the dome camera will change. The camera shakes and the captured image is blurred or lagged. It is impossible to control the rotation of the dome camera and capture the image smoothly and stably, which affects the monitoring quality. Therefore, how to provide a smooth and stable ball machine control method has become an urgent technical problem to be solved.
  • the present disclosure provides a method, device and equipment for controlling a ball machine, so that the ball machine can achieve smooth and stable tracking of a target object and improve the use experience of the ball machine.
  • a ball machine control method is provided, and the method is applied to a processing device.
  • the method may include: after the processing device determines the target object to be tracked, periodically sending control instructions to the dome camera, and controlling the stepping motor in the dome camera through the control instructions to drive the camera installed on the dome camera to rotate to the location where the target object is located. The area is monitored so that the processing device can track the target object based on the images received from the dome. In this way, considering that the response of the gimbal tends to lag significantly behind the change of the position of the target object in the actual picture, the rotation of the dome camera and the change of the magnification will cause the camera to shake and cause the problem of blurring or lag in the captured image.
  • the processing device periodically sends control commands to the dome camera with rotatable and variable magnification, which effectively overcomes the shortcomings of the current lack of smoothness and stability when controlling the rotation of the camera of the dome camera, so that the rotation process of the dome camera is no longer stuck. to achieve smooth and stable tracking of the target object, thereby improving the use experience of the dome camera.
  • the stepper motor considering that if there is a backlog of unexecuted control commands in the dome camera, it will cause the stepper motor to be unable to make tracking adjustments in a timely and effective manner according to the actual situation of the target object in the dome camera screen.
  • the preset cycle of sending control commands to the dome camera in the processing device is greater than the excitation response delay of the stepping motor, so that it can ensure that there is no backlog of unexecuted control commands in the dome camera, so that the stepping motor can follow the target object in the ball machine.
  • the actual situation in the screen of the machine can track the target object in a timely and effective manner.
  • the method may further include: determining the control instruction according to the tracking result of the target object in the image, where the tracking result includes a normal state and an abnormal state.
  • the corresponding control commands can be effectively generated according to the actual tracking results, which provides a reliable data basis for periodically sending control commands to the dome camera, and makes high-quality tracking of the target object possible.
  • the control command sent to the dome machine is specifically a first control command
  • the first control command is used to instruct the dome machine to continue tracking the target object.
  • the first control instruction is a movement instruction.
  • periodically sending the control command to the dome machine may specifically be sending the newly generated first control command to the dome machine in the same cycle. For example, assuming that when cycle 1 is reached, there are no unsent control commands in the processing device, and the dome camera is always in normal state 1 during this cycle 1, and the movement command 1, movement command 2 and movement command 3 are generated in the order of time. Then, when entering the next cycle 2 from cycle 1, the processing device sends the newly generated movement command 3 to the dome camera, and the movement command 1 and movement command 2 can be discarded by the processing device.
  • the control command sent to the dome machine is specifically a second control command
  • the second command is used to instruct the dome machine to execute the control command when the dome machine is in an abnormal state.
  • the second control instruction includes at least one of the following instructions: a stop instruction, a magnification reduction instruction, or a return to a preset point instruction.
  • the processing device saves the control command through the command queue
  • the periodic sending of the control command to the dome machine may specifically be directed to the dome machine to send the earliest generated second control command stored in the command queue.
  • the command queue includes stop command 1 , stop command 2 and magnification reduction command 1 .
  • the processing device sends the earliest generated stop command 1 to the dome camera, and the command queue includes stop command 2 and reduce magnification command 1; when entering the next cycle 5 from cycle 4, The stop command 2 generated after the processing device sends the stop command 1 to the dome camera, and the command queue includes the lowering magnification command 1; when entering the next cycle 6 from cycle 5, the processing device sends the stop command 2 to the dome camera.
  • determining the control instruction according to the tracking result of the target object in the image may specifically refer to: determining the first control instruction according to a preset rule, wherein , the first control command may include a first adjustment speed in the first direction, a second adjustment speed in the second direction, and a target magnification adjustment speed.
  • the preset rule may include determining the first control instruction according to the magnification of the camera in the dome camera and a proportional integral derivative (proportional integral derivative, PID) parameter group.
  • the processing device includes multiple sets of correspondences between magnifications and PID parameter groups, and the process of determining the first control command according to the magnification of the camera in the dome camera and the PID parameter group may include: according to the current magnification of the camera in the dome camera , determine the PID parameter group corresponding to the magnification; then, according to the PID parameter group, determine the first adjustment speed and the second adjustment speed; determine the first control command based on the first adjustment speed and the second adjustment speed.
  • determining the first adjustment speed and the second adjustment speed according to the PID parameter group may include: determining the first adjustment speed according to the PID parameter and the first deviation in the first direction (such as the x direction), where the first deviation is The distance in the first direction between the center point of the image and the center point of the area where the target object is located in the image; the second adjustment speed is determined according to the PID parameters and the second deviation in the second direction (such as the y direction). The second deviation is the distance in the second direction between the center point of the image and the center point of the area where the target object is located in the image.
  • the area where the target object is located in the image refers to an area in the image that can completely include the target object, for example, a rectangular area (also called a square frame) that completely includes the target object.
  • the corresponding relationship between the magnification and the PID parameter group is preset in the processing device.
  • the adjustment speed of the rotating stepper motor needs to be calculated, the corresponding PID parameter group can be determined directly according to the current magnification of the camera in the dome camera.
  • the adjustment speed of the stepping motor suitable for the current magnification is obtained by calculation, so that the generated first control command can be used for tracking control of the target object more effectively.
  • the method may further include: if the first deviation is smaller than the preset first deviation threshold, then setting the first deviation and, before determining the second adjustment speed according to the PID parameter and the second deviation in the second direction, the method may further include: if the second deviation is less than a preset second deviation threshold, then, setting the second deviation Zero.
  • the first deviation threshold and the second deviation threshold are determined based on a preset central area of the image.
  • the deviation in the corresponding direction is set to zero, so that the PID is calculated and output in the corresponding direction
  • the adjustment speed of the stepper motor is more accurate to avoid the vibration of the PID due to the too small input value in the PID calculation when the adjustment range is small and the effect is not obvious, which makes the stepper motor shake.
  • a dead zone judgment can also be performed, specifically: judging whether the first adjustment speed is within the dead zone range, and if so, Then, set the first adjustment speed to zero; determine whether the second adjustment speed is within the dead zone range, and if so, set the second adjustment speed to zero.
  • the dead zone range is determined according to the adjustment accuracy of the stepping motor. For example, if the minimum rotation gear of the stepping motor is 0.1, then the dead zone range can be -0.1-0.1.
  • the adjustment speed of the stepper motor calculated by the PID is effectively prevented from being smaller than the minimum rotation gear of the stepper motor, which causes the stepper motor to rotate too far, which makes the rotation process of the stepper motor shake back and forth and cannot be stabilized.
  • the machine can track the target object smoothly and stably.
  • the preset rule may further include determining the first control instruction according to the proportion of the target object in the image in the preset direction.
  • the process of determining the first control instruction according to the proportion of the target object in the image in the preset direction may include: obtaining the proportion of the target object in the image in the preset direction; then, according to the proportion and the preset proportion threshold, determining The target magnification adjustment speed, the target magnification adjustment speed is the preset magnification adjustment speed or the opposite number of the preset magnification adjustment speed; then, the first control command can be determined according to the target magnification adjustment speed.
  • the preset magnification adjustment speed itself is determined as the target magnification adjustment speed, so as to control the camera to increase the camera's zoom rate according to the target magnification adjustment speed.
  • magnification when the ratio is greater than the preset second ratio threshold, the opposite number of the preset magnification adjustment speed is determined as the target magnification adjustment speed, so as to control the camera to reduce the camera's magnification according to the target magnification adjustment speed, wherein the second ratio threshold is greater than The first scale threshold.
  • the preset direction can be determined based on different target objects.
  • the target object is a slender shape (such as a person)
  • the height of the target object in the image is determined as the preset direction
  • the target object is a short and wide shape (such as a vehicle)
  • the width of the target object in the image is determined as the preset direction.
  • determining the control instruction according to the tracking result of the target object in the image may specifically refer to: determining the second control instruction according to a preset rule, the The preset rule may include determining the second control instruction according to the type of abnormal state.
  • the types of the abnormal state may include, but are not limited to: a first abnormal state, a second abnormal state, a third abnormal state, and a fourth abnormal state.
  • the dome camera when the dome camera is in a normal state and the captured image does not include the target object, it is determined that the dome camera enters the first abnormal state (also referred to as a possible loss state), and indicates that the camera is in the PTZ
  • the stepper motor stopped working. That is, when the dome machine changes from the normal state to the first abnormal state within one cycle of sending the control command to the dome machine, the control command sent to the PTZ may be, for example, the first stop command.
  • the dome camera when the dome camera is in the first abnormal state and the target object is not included in the multi-frame images collected at the first preset time, it is determined that the dome camera enters the second abnormal state (also It can be called as determining the lost state), and instruct the camera to reduce the magnification to expand the monitoring range. That is, when the dome machine changes from the first abnormal state to the second abnormal state within one cycle of sending the control command to the dome machine, if there is still a third stop command to be sent, the control command sent to the PTZ is the first Three stop commands; if there is no third stop command to be sent, the control command sent to the PTZ is the first magnification reduction command.
  • the dome camera when the dome camera is in the fourth abnormal state and the image collected by the dome camera within the third preset time does not include the target object, it is determined that the dome camera has entered the second abnormal state, and an indication The camera reduces the magnification to expand the monitoring range. That is, when the dome machine changes from the fourth abnormal state to the second abnormal state within one cycle of sending the control command to the dome machine, if there is still a sixth stop command to be sent, the control command sent to the PTZ is the first Six stop instructions; if there is no sixth stop instruction to be sent, the control instruction sent to the PTZ is the fourth reduction magnification instruction.
  • the dome camera when the dome camera is in the second abnormal state and no target object is included in the multi-frame images collected at the second preset time, it is determined that the dome camera enters the third abnormal state (also It can be called idle state), and instructs the stepper motor to drive the camera to return to the preset point and exit the tracking of the target object. That is, when the dome camera changes from the second abnormal state to the third abnormal state within one cycle of sending the control command to the dome camera, if there is still a second lower magnification command to be sent, the control command sent to the PTZ is: The second magnification reduction command; if there is no second magnification reduction command to be sent, the control command sent to the PTZ is the first return to the preset point command.
  • the third abnormal state also It can be called idle state
  • the dome camera when the dome camera is in the second abnormal state and the collected image includes the target object, it is determined that the dome camera enters the fourth abnormal state (also referred to as a possible recovery state), And instruct the stepper motor in the gimbal to stop working. That is, within one cycle of sending the second control command to the dome camera, when the dome camera changes from the second abnormal state to the fourth abnormal state, if there is still a third command to reduce the magnification to be sent, send it to the PTZ.
  • the control command is the third magnification reduction command; if there is no third magnification reduction command to be sent, the control command sent to the PTZ is the fourth stop command.
  • the dome camera when the dome camera is in the fourth abnormal state and the multi-frame images collected by the dome camera at the third preset time all include the target object, it is determined that the dome camera has entered a normal state. That is, when the dome machine changes from the fourth abnormal state to the normal state within one cycle of sending the control command to the dome machine, if there is a fifth stop command to be sent, the control command sent to the PTZ is the first Five stop instructions; if there is no fifth stop instruction to be sent, the control instruction sent to the PTZ is the newly generated movement instruction.
  • the dome machine when the dome machine is in the first abnormal state and the image collected by the dome machine within the first preset time includes the target object, it is determined that the dome machine enters the normal state. That is, when the dome camera changes from the first abnormal state to the normal state within one cycle of sending the control command to the dome camera, if there is a second stop command to be sent, the control command sent to the PTZ is the second stop command. instruction; if there is no second stop instruction to be sent, the control instruction sent to the PTZ is the first movement instruction.
  • the method may further include: when the dome camera has acquired the key information of the target object, determining that the dome camera has entered the fifth abnormal state, and instructing the stepper motor to drive the camera to return to the preset Click to exit the tracking of the target object.
  • the key information may be identification information used to indicate the target object, such as a frontal face image of the target person, or a license plate image of the target vehicle.
  • the processing device can send the image including the key information of the target person to the central device, so that the central device can analyze and summarize the key information of the target person in the image, so that the tracking of the target object can achieve more important value.
  • the instructions generated by the processing device may also be stored through the instruction queue.
  • periodically sending control commands to the dome camera may include, for example: at the first moment, sending the first control command in the first command queue to the gimbal; at the second moment, sending the second command in the second command queue to the gimbal. Control instruction.
  • the time from the first time to the second time is one cycle of the ball machine sending the control command
  • the control command sent at the first time is the first control command
  • the control command sent at the second time is the second control command
  • all the control instructions generated at the first moment only include movement instructions
  • the first control instructions are the latest generated movement instructions before the first moment
  • the deadline All control commands generated at the first moment include at least one of a stop command, a magnification reduction command, or a return to the preset point command
  • the first command queue includes all stop commands, reduce For a magnification command or a return to a preset point command, the first command queue does not include a movement command
  • the first control command is the command whose generation time is the longest from the first moment in the first command queue.
  • the method may further include: at a third moment, generating a fifth stop command, and overwriting the fifth stop command For the first move instruction in the instruction queue, obtain the updated first instruction queue, and the updated first instruction queue includes the first stop instruction; at the fourth moment, generate the second move instruction, according to the updated first instruction queue Discard the second movement instruction; at the fifth moment, generate a second return preset point instruction, and add the second return preset point instruction to the updated fifth stop instruction of the first instruction queue, and obtain the second instruction queue , the second instruction queue includes a fifth stop instruction and a second return to the preset point instruction.
  • sending the second control instruction in the second instruction queue to the PTZ includes: sending a fifth stop instruction to the PTZ to control the stepping motor in the PTZ to stop working.
  • the method may further include: at the sixth moment, sending a second return to the preset point instruction to the PTZ, so as to control the stepping motor in the PTZ to drive the dome camera to return to the preset point, wherein the second The time from the moment to the sixth moment is a cycle.
  • the present application provides a ball camera control device, the device including each module for executing the ball camera control method in the first aspect or any possible implementation manner of the first aspect.
  • a ball machine control device in a third aspect, includes a processor and a memory.
  • the memory is used to store computer instructions; the processor is used to execute the operation steps of the ball camera control method in the first aspect or any possible implementation manner of the first aspect according to the computer instructions.
  • a monitoring system in a fourth aspect, includes a first device, a second device, and a processing device, and the processing device communicates with the first device and the second device, respectively.
  • the first device is configured to acquire an image within a fixed monitoring range, and send the first image including the target object to the processing device;
  • the processing device is configured to execute the first aspect or any of the first aspect based on the first image.
  • the operation steps of the dome camera control method in a possible implementation manner include sending a control instruction to a second device; the second device is configured to complete the tracking of the target object based on the control instruction sent by the processing device.
  • the second device is a ball machine.
  • the first device may be a bolt action.
  • the monitoring system may further include a central device, a processing device, which is further configured to acquire key information of the target object, and send the key information to the central device; the central device is used to monitor the key information analysis and processing.
  • the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer performs the operation steps of the methods of the above aspects.
  • the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the operation steps of the methods of the above aspects.
  • the present application may further combine to provide more implementation manners.
  • FIG. 1 is a schematic diagram of the logical architecture of a monitoring system 10 suitable for ball machine control provided in this embodiment;
  • FIG. 2 is a schematic diagram of a monitoring process of a target person by a monitoring system 10 provided in this embodiment
  • FIG. 3 is a flowchart interaction diagram of a ball machine control method provided in this embodiment
  • FIG. 4 is a schematic diagram of state flow of a ball machine provided in this embodiment
  • FIG. 5 is a schematic diagram of an instruction queue for saving control instructions according to the present embodiment
  • FIG. 6 is a schematic diagram of a center area judgment provided by the present embodiment.
  • Fig. 7 is a kind of schematic flow chart of calculating moving speed based on PID provided by this embodiment.
  • FIG. 8 is a schematic structural diagram of a ball machine control device provided in this embodiment.
  • FIG. 9 is a schematic structural diagram of a ball machine control device provided in this embodiment.
  • FIG. 1 is a schematic diagram of the logical architecture of a monitoring system 10 suitable for dome camera control in this embodiment.
  • the monitoring system 10 includes: a processing device 100 , at least one bolt 200 , at least one dome 300 and a central device 400.
  • the processing device 100 can communicate with at least one trigger 200, at least one dome 300, and the central device 400, respectively, receive data signals corresponding to images collected by the trigger 200 or the dome 300, and send control signals to the dome 300, Realize the control of at least one ball machine 300, and send the monitoring results obtained by the trigger 200 or the ball machine 300 to the central device 400, and the central device 400 analyzes and summarizes the monitoring results.
  • the monitoring result includes key information of the target object, such as: the frontal face image of the target person, and another example: the license plate image of the target vehicle.
  • the processing device 100 may include at least a communication module 110 and a processing module 120.
  • the communication module 110 is used to implement communication with other devices (such as the camera 200, the ball camera 300 and the central device 400), and the processing module 120 is used to communicate with other devices according to the central
  • the signals sent by the device 400 , the trigger 200 and/or the dome machine 300 are processed to obtain control signals suitable for the dome machine 300 .
  • the bolt 200 may at least include: a communication module 210 , a processing module 220 and a camera 230 .
  • the communication module 210 is used to implement communication with other devices (such as the processing device 100 ); the processing module 220 is used to process the data signals output by the camera 230 (such as decoding, unpacking, compression, conversion, etc.); the camera 230 is used to capture the image of the corresponding area of the bolt 200 .
  • the dome camera 300 may at least include: a communication module 310 , a processing module 320 , a camera 330 and a pan/tilt 340 .
  • the communication module 310 is used to implement communication with other devices (such as the processing device 100 );
  • the data signal and the control signal sent by the processing device 100 are processed;
  • the pan/tilt 340 is used to support the camera 330, the rotation of the stepping motor 341 in the pan/tilt 340 can drive the camera 330 to rotate, and the camera 330 also has the function of changing the magnification, so,
  • the camera 330 is used to photograph objects of different distances from different angles.
  • the central device 400 is configured to communicate with multiple processing devices 100 , analyze and summarize the monitoring results sent by the multiple processing devices 400 , and monitor and manage the areas covered by the multiple processing devices 100 .
  • the processing device 100 can be a device with computing capabilities, for example, it can be a street cabinet (also called an edge station) corresponding to at least one trigger 200 and at least one dome 300, and the trigger 200 refers to the monitoring area that cannot be switched.
  • the dome camera 300 refers to a monitoring device that can switch the monitoring area and can change the magnification
  • the central device 400 can be a server, such as a cloud server.
  • the processing device 100 may control and manage monitoring devices on multiple adjacent monitoring poles, and may also control and manage some or all monitoring devices on one monitoring pole.
  • Each monitoring rod may include one trigger 200 and one ball machine 300, or multiple triggers 200 and one ball machine 300, and may also include multiple triggers 200 and multiple ball machines 300, which is not correct in this application.
  • the number of triggers 200 and the number of ball machines 300 included on each monitoring rod are specifically limited.
  • the processing device 100 can also be integrated into any one of the bolts 200 or the dome 300 managed by it.
  • the processing module 320 of the camera 300 for another example, the processing device 100 can be integrated in the gun camera 200 or the dome camera 300 as an independent module, and the independent module is only used to realize the function of the processing device 100.
  • the specific implementation form is in This application is not limited. For the convenience of description, this application describes the processing device 100 as a separate entity device from the trigger 200 and the dome camera 300.
  • FIG. 2 may include:
  • the central device 400 generates and sends a task instruction to the multiple processing devices 100 connected to it, where the task instruction includes feature information of the target person, and the feature information is used to indicate the feature of the target person.
  • the feature information can indicate the target person.
  • the character is wearing a red shirt.
  • the processing device 100 processes the received task instruction, generates a request instruction that can be recognized by the trigger 200 and the ball camera 300, and sends the request instruction to at least one trigger 200 and at least one ball camera 300 controlled by it.
  • the processing device 100 receives the images collected by the trigger 200 and the dome camera 300, and performs target detection and feature matching. If the detected object and the target object are successfully matched, it is determined that the target object is detected.
  • the detection process may include: the trigger 200 sends the image 1 of the target object to the processing device 100, and the processing device 100 detects at least the image 1 through the target detection algorithm. After one object, perform feature matching on the detected object and the target object, and take the successfully matched object as the target object; The image including the target object obtained after matting.
  • the processing device 100 generates based on the square frame 1 and sends the return to the preset point command 1 to the dome camera 300.
  • the return to the preset point command 1 is used to instruct the dome camera 300 at the initial position to turn to the monitoring range of the trigger 200.
  • the Returning to the preset point command 1 can carry the identification of the trigger 200 (ie, the identification of the preset point).
  • the detection process may include: the dome camera 300 sends the image 1' of the target object to the processing device 100, and the processing device 100 detects at least the image 1' through the target detection algorithm. After one object, feature matching is performed between the detected object and the target object, and the successfully matched object is used as the target object; the image 1' is processed to obtain a square frame 1' corresponding to the target object in the image 1'.
  • the square frame 1' refers to the image including the target object obtained after matting from the image 1.
  • the center of the target object in the image can be used as the origin, and the preset length is used as the radius to obtain the circular area including the target object in the image.
  • the center of the target object is the intersection of the diagonal lines, resulting in a rectangular area including the target object (ie, the square box mentioned in other parts).
  • the setting of the radius of the circular area or the length and width of the rectangular area needs to make the obtained area completely include the target object.
  • a square frame obtained by cutout is taken as an example for description.
  • the dome camera 300 collects the image 2 and sends it to the processing device 100;
  • the processing device 100 matches the image 2 with the square frame 1 (or the square frame 1'), and if the matching is completed, generates a square frame 2 including the target object in the image 2, and triggers the ball camera 300 to track the target object.
  • the processing device 100 executes the following S17-S23 for each image 2 collected by the dome camera 300, until the image 2 including the key information of the target person acquired by the processing device 100 is received, the operation times out, or the state 0 becomes an abnormal state In the idle state, the following S25 is performed.
  • the processing device 100 obtains the status flag bit of whether the tracking is successful or not according to the image 2, the target detection algorithm and the preset tracking algorithm.
  • the relevant parameters of the square frame 2 corresponding to the target object in the image 2 can also be obtained, such as (x, y, w, h) corresponding to the square frame 2, where (x, y) is the coordinate value of the center point of the square frame 2 in the image 2, w and h are the width and height of the square frame 2, respectively;
  • the processing device 100 determines the state 0 to which the target object is currently being tracked according to the change of the state flag bit.
  • the states may include, for example, a normal state and an abnormal state, wherein the abnormal state includes information used to indicate the tracking result of the target object.
  • abnormal states include a possible lost state, a certain lost state, a possible retrieved state, and an idle state.
  • the processing device 100 determines whether the state 0 is a normal state, and if so, executes S20, otherwise, executes S22;
  • the processing device 100 determines the PID parameters corresponding to the current magnification 1: KP1, KI1 and KD1 according to the corresponding relationship between the preset magnification and proportional integral derivative (PID) parameters of the ball camera 300, and according to the following Formula (1) and formula (2) calculate the moving speed Vpan on the x direction and the moving speed Vtilt on the y direction; And, according to the ratio of h accounting for the total height of the image 2, determine the direction of the preset magnification adjustment speed Vzoom;
  • PID proportional integral derivative
  • ⁇ x(t) and ⁇ y(t) are the deviation values between the center point (x0, y0) of the image 2 collected at time t and the center point (x, y) of the square frame 2 .
  • the calculated V pan and V tilt are continuous values corresponding to the fixed rotational gears of the stepping motor 341 .
  • the rotational speed of the stepping motor 341 ranges from -1.0 to 1.0 (positive and negative values represent The rotation direction of the stepper motor 341, the absolute value represents the rotation speed), and every 0.1 is divided into 1 rotation gear.
  • the stepper motor 341 includes 10 rotation gears in two directions respectively.
  • the calculated V pan and The value of Vtilt ranges from -1.0 to 1.0.
  • V pan 0.17
  • the processing device 100 generates a movement instruction 1, which includes (V pan , V tilt , V zoom ) and includes a forced execution flag.
  • the value of the forced execution flag may be 0, which is used to indicate Move instruction 1 is not a mandatory operation, and can be discarded or overwritten with move instructions in the instruction queue;
  • the processing device 100 generates a stop command 1 , a magnification reduction command 1 or a return to preset point command 2 based on the specific abnormal state.
  • the stop command 1, the magnification reduction command 1 and the return to preset point command 2 all include mandatory execution flags.
  • the value of the mandatory execution flag of the stop command 1, the magnification reduction command 1 and the return to preset command 2 can be set to 1. , used to indicate that these instructions are operations that need to be enforced and cannot be discarded;
  • the processing device 100 periodically sends a control command to the ball camera 300 to realize the tracking of the target object, and the period is greater than the excitation response time delay T1 of the stepping motor 341;
  • the dome camera 300 controls the stepping motor 341 and/or the camera 330 based on the received control instruction to track the target object.
  • the processing device 100 generates and sends an instruction to return to the preset point to the dome machine 300 to control the dome machine 300 to return to the initial position, wherein the key information includes the identification information of the target object, for example, when the target object is the target person, the key information can be Including the frontal face image of the target person;
  • the processing device 100 sends the image 2 including the key information of the target person to the central device 300 , and the central device 300 analyzes and summarizes the key information of the target person in the image 2 .
  • the specific manner of triggering the dome camera 300 to start tracking the target object may include:
  • the processing device 100 detects the target object from the images sent by other monitoring devices (for example, the trigger 200), and then the processing device 100 triggers the dome camera 300 to start tracking the target object;
  • the processing device 100 may also detect the target object from the image sent by the dome camera 300, and then the processing device 100 triggers the dome camera 300 to start tracking the target object.
  • the manner of triggering the ball machine 300 to track the target object is not specifically limited in this application.
  • the following description takes the triggering manner of the first case as an example.
  • system architecture shown in FIG. 1 is only an example of the system architecture provided by the ball machine control method provided in this application, and the monitoring process of the target person by the monitoring system shown in FIG. This is a scenario example provided to better illustrate the overall flow of the ball machine control method provided by the present application, and does not constitute a limitation to the embodiments of the present application.
  • the present application provides a dome camera control method.
  • the processing device acquires the first image of the target object to be tracked, it can be based on the preset association relationship between the first device and the second device (ie, the dome camera). , control the stepping motor of the pan/tilt in the second device to work to drive the second device to rotate to the monitoring area corresponding to the first device, so that the camera in the second device can capture the second image including the target object and Send to the processing device, the processing device can generate control instructions for the dome camera based on the second image sent by the second device, and periodically send control instructions to the PTZ to control the stepping motor in the PTZ Work to achieve the tracking of the target object.
  • this method considers that the rotation of the camera in the dome camera is driven by the rotation of the stepper motor, the stepper motor has a certain excitation response time delay, and the process of capturing images by the camera in the dome camera is discrete.
  • the cycle of sending control commands is preset, and the processing device periodically sends control commands to the dome camera with rotatable and variable magnification, which effectively overcomes the shortcomings of the current lack of smoothness and stability when controlling the rotation of the dome camera.
  • the process is no longer stuck, and smooth and stable tracking of the target object is achieved, thereby improving the use experience of the dome camera.
  • the camera of the dome camera that is triggered to track the target object usually collects images at equal time intervals, and sends the images to the processing device.
  • the equal time interval is related to the frequency at which the camera collects images. For example, if the frequency at which the camera collects images is 25 frames per second, the time interval at which the camera collects images is 40 milliseconds.
  • every time the camera collects a frame of image the image will be sent to the processing device, and the processing device will generate a corresponding control command through the processing of algorithms such as target detection algorithm and tracking algorithm.
  • the processing device can also perform frame skipping processing on the images captured by the camera.
  • the image will be sent to the processing device, and the processing device will send the image to the processing device every time it receives five frames of images.
  • the fifth frame of image is processed to generate a corresponding control command; for another example: every five frames of images are collected by the camera, the fifth frame of image is sent to the processing device, and the processing device processes each received frame of image and generates a corresponding one. Control instruction.
  • the processing device periodically sends control commands to the dome camera.
  • control commands for example: stop command, reduce magnification command, or return to the preset command) Positioning command
  • the processing device has no backlog of mandatory execution commands (for example: stop command, reduce magnification command, or return to the preset command) Positioning command)
  • all the movement commands are generated in this cycle, then only the latest generated movement command will be kept, and when the command is sent, the latest generated movement command will be sent to the PTZ of the dome camera, so that the dome camera can follow the
  • the position of the target object in the newly collected image can be adjusted adaptively to the camera of the dome camera to achieve fast and effective tracking of the target object.
  • the cycle of sending the control command needs to be greater than the excitation response delay of the stepping motor (that is, the time interval between the excitation of the input stepping motor and the output response of the stepping motor), which is different from the frequency at which the camera captures images. It doesn't matter.
  • the ball camera control method provided by the present application is described in detail with reference to FIG. 3 , and the method is applied to the processing device 100 in the monitoring system 10 .
  • the method includes:
  • S301 Acquire a first image sent by the trigger 200 in the monitoring system 10, where the first image includes the target object to be tracked.
  • S301 is only an exemplary description, and in specific implementation, the processing device 100 only needs to acquire the target object to be tracked, thereby triggering the dome camera 300 to track the target object.
  • the method of acquiring the target object may be acquired based on the first image collected by the bolt 200 in the monitoring system, or acquired from the first video, or may be triggered based on the user's manual operation, which is not specifically limited in this embodiment. .
  • the acquisition of the target object from the first image is taken as an example for description.
  • the bolt 200 may refer to any monitoring device in the monitoring system 10 that can communicate with the processing device 100 .
  • the combination of the trigger 200 and the ball camera 300 is selected to provide an intelligent and comprehensive monitoring service.
  • the processing device 100 in the monitoring system 10 can obtain a task instruction, which includes Feature information of the target object.
  • Feature information refers to the features of the target object that can be significantly distinguished from other objects.
  • the feature information of the target object can be the person's clothing features, such as wearing a red shirt;
  • the feature information of the target object may be the model, color and other features of the vehicle, for example, a small black car.
  • the task instruction can be triggered and generated on the central device 400 of the monitoring system 10 and sent to the processing device 100 by the central device 400. Then, the processing device 100 can translate the task into the ability of the bolt 200 and the dome 300 to be able to After identifying the request command, the request command is sent to the trigger 200 and the ball camera 300 controlled by the processing device 100, and the request command includes the feature information of the target object.
  • This example is suitable for situations where the possible range of activity of the target object is large or the possible range of activity of the target object is uncertain.
  • the central device 400 can issue task instructions to some or all of the processing devices 100 in the monitoring system 10 in batches, so that the monitoring
  • the mass monitoring devices in the system 10 can search and monitor the target objects in most or all of the monitoring areas covered by the monitoring system 10, without the need for separate configuration and triggering on each processing device 100, saving manpower and material resources to a certain extent, Improve the efficiency of monitoring services.
  • the task instruction may also be a request instruction that is directly generated on the processing device 100 of the monitoring system 10 and can be recognized by the trigger 200 and the dome camera 300. Then, the processing device 100 can send the request instruction to the processing device 100.
  • the trigger 200 and the dome 300 responsible for control include the characteristic information of the target object in the request command.
  • This example is applicable to the situation where the possible range of activities of the target object has been determined, and a request instruction can be configured on the processing device 100 responsible for the monitoring device within the range of activities, so that the corresponding monitoring device can quickly monitor the target in a small coverage area.
  • To search and monitor objects there is no need for the central device 400 to issue a task request to the corresponding processing device 100 or for the processing device 100 to process the task request, which saves network resources in the monitoring system 10 and improves the efficiency of monitoring services.
  • the processing process of the processing device 100 may include: the processing device 100 performs target detection on the first image, and detects at least one object; the processing device 100 extracts the at least one object The feature information of the object, and the feature information of the at least one object and the feature information of the target object are matched, if the matching is successful, the object corresponding to the feature information is determined as the target object;
  • the detection frame that completely encloses the target object is used as a square frame including the target object in the first image, and the square frame can be used as basic data for subsequent tracking of the target object.
  • the processing device 100 performs matting processing on the acquired first image to obtain a square frame including the target object.
  • the square box is an image.
  • each monitoring device (including the trigger 200 and the dome camera 300 ) that has received the request instruction sends the images collected by itself to the processing device 100 for target detection and feature matching.
  • the processing device 100 can Generate and send the control command 1 to the dome camera 300 to control the stepper motor 341 of the gimbal 340 in the dome camera 300 to work, and drive the camera 330 to rotate through the stepper motor 341, so that the camera 330 faces the monitoring area corresponding to the gun 200.
  • the camera 330 faces the monitoring area corresponding to the gun 200, which may mean that the monitoring area of the camera 330 completely covers the monitoring range of the gun 200.
  • S302 may specifically include: after the processing device 100 obtains the square frame including the target object in the first image, it can determine that the target object is within the monitoring range of the camera 200, so as to generate and send a return preview to the camera 300.
  • the return preset point instruction 1 includes the logo of the trigger 200, which is used to instruct the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to rotate to the monitoring range of the trigger 200 corresponding to the logo.
  • the dome camera 300 can record the position of the trigger 200, then, the dome camera 300 rotates to the position of the trigger 200 according to the return to preset point command 1, and then stops rotating.
  • the positional relationship between the dome machine 300 and the trigger 200 is stored in the dome machine 300. Then, the dome machine 300 returns to the preset point command 1 according to the identification of the trigger 200 and the locally saved trigger 200 and trigger 200.
  • the positional relationship of the dome camera 300 determines the rotation parameters that need to be rotated for the dome camera 300 to turn to the coverage area of the trigger 200, so as to rotate the monitoring area of the steering trigger 200 based on the rotation parameters.
  • the dome camera 300 may also be rotated to the monitoring area of the trigger 200 based on the preset positional relationship between the trigger 200 and the dome 300 .
  • the processing device 100 may be preset with the positional relationship between all monitoring devices it is responsible for, including the positional relationship between the trigger 200 and the dome camera 300, then, S302 may specifically include: after the processing device 100 obtains the first image, It can be determined that the target object is within the monitoring range of the trigger 200, thus, based on the positional relationship between the trigger 200 and the dome 300, determine the rotation parameters that the dome 300 needs to rotate to turn to the coverage of the trigger 200; then, the processing device 100 The movement command 1 can be generated and sent to the dome camera 300 according to the determined rotation parameters, and the movement command 1 includes the rotation parameters to instruct the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to work according to the rotation parameters; in this way, The pan/tilt 340 in the dome camera 300 parses the control command 1 to obtain rotation
  • the above-mentioned rotation parameters can be the angle and direction of rotation, for example, rotate 90 degrees counterclockwise; or, the rotation parameters can also be the rotation speed and rotation time, for example, rotate at a rotation gear of 0.1 for 9 seconds.
  • the processing device 100 performs target detection and feature matching on the first frame of the second image sent by the dome camera 300, and when it is determined that the second image includes a target object, the dome camera 300 is triggered to track the target object.
  • the feature matching performed by the processing device 100 on the first frame of the second image may be to match the second image with the first image (ie, the square frame including the target object in the image collected by the gun machine 200 ). If the ball camera 300 starts to track the target object, the ball camera 300 can send the second image of each frame to be processed to the processing device 100, and the processing device 100 executes S303 to control the ball camera 300 to track the target object .
  • the processing device 100 includes a complete ball machine control flow, and for details of the flow, please refer to the relevant descriptions of S11 to S26 corresponding to FIG. 2 .
  • the frequency of processing the second image in the processing device 100 may be consistent with the frequency of collecting the second image by the camera 330, for example, the camera 330 collects a second image every 40 milliseconds, and After the collected second image is sent to the processing device 100, the processing device 100 processes the received second image every 40 milliseconds.
  • the frequency of processing the second image in the processing device 100 may also have a certain multiple relationship with the frequency at which the camera 330 collects the second image, for example, the camera 330 collects one frame of the second image every 40 milliseconds , and send the collected second image to the processing device 100, and the processing device 100 processes the latest received second image every 200 milliseconds; or, the camera 330 collects a second image every 40 milliseconds, but every 200 milliseconds In 200 milliseconds, the newly collected frame of the second image is sent to the processing device 100, and the processing device 100 processes the received second image every 200 milliseconds.
  • the period for sending the control command 2 is preset in the processing device 100 , and the period may be greater than the excitation response time delay of the stepping motor 341 .
  • the implementation process of S303 includes: S3031, the processing device 100 processes the second image according to the target detection algorithm and the tracking algorithm, and determines whether the second image includes the target object, and if it does, it is determined that it is currently in a normal state, if If not included, it is determined that it is currently in an abnormal state; S3032, the processing device 100 generates a corresponding control instruction 2 according to the current state; S3033, the processing device 100 periodically sends the control instruction 2 to the ball machine 300 according to a preset rule.
  • the second image includes the target object, which may include that the confidence of the square frame including the target object in the second image is greater than a preset confidence threshold, and the second image is incompletely detected in the second image.
  • the processing device 100 in S3031 subdivides the current state of the dome machine 300 into an initial state, a normal state, an abnormal state and an idle state, wherein the abnormal state
  • the state is divided into: possible loss state, definite loss state and possible recovery state according to the actual tracking situation.
  • the processing device 100 has a state flow diagram as shown in FIG. 4 .
  • the corresponding state is the initial state 0.
  • the processing device If the second image 1 received by the processing device 100 includes the target object, it is determined that the current corresponding state becomes the normal state 1; if the second image 1 received by the processing device 100 does not include the target object, then it is determined that the current corresponding state becomes the normal state 1. State 2 may be lost.
  • the processing device 100 After entering the normal state 1, if the second image 2 received by the processing device 100 includes the target object, it is determined that the current corresponding state remains the normal state 1; once the second image 2 received by the processing device 100 does not include the target object, then , it is determined that the current corresponding state becomes the possible loss state 2.
  • the processing device 100 After entering the possible loss state 2, once the processing device 100 receives the second image 3 including the target object within the preset time t1, it is determined that the current corresponding state becomes the normal state 1; If any frame of the second image 3 is received within a period of time that does not include the target object, it is determined that the current corresponding state remains in the possible loss state 2; if the processing device 100 reaches the preset time t1, the received second image 3 does not include the target object object, then it is determined that the current corresponding state becomes the determined loss state 3.
  • the processing device 100 After entering the determined loss state 3, once the processing device 100 receives the second image 4 including the target object within the preset time t2, it is determined that the current corresponding state becomes possible to retrieve the state 4; if the processing device 100 is in the preset time t2 If any frame of the second image 4 is received within the time t2 and does not include the target object, then it is determined that the current corresponding state remains the determined loss state 3; if the processing device 100 reaches the preset time t2, neither of the received second images 4 If the target object is included, it is determined that the current corresponding state becomes the determined idle state 5 .
  • the processing device 100 After entering the possible retrieval state 4, once the processing device 100 receives the second image 5 that does not include the target object within the preset time t3, it is determined that the current corresponding state becomes the determined loss state 3; Assuming that the target object is included in any frame of the second image 5 received within the time t3, it is determined that the current corresponding state remains the possible retrieval state 4; if the processing device 100 reaches the preset time t3, the received second image 5 is all in the state 4. If the target object is included, it is determined that the current corresponding state becomes the normal state 1. From the determined loss state 3 to the idle state 5, it can be considered that the tracking of the target object has completely failed.
  • the processing device 100 can send an exit instruction to the dome camera 300 to instruct the dome camera 300 to stop tracking the target object; and, processing The device 100 may also send a tracking failure notification to the central device 400 to inform the central device 400 that the tracking of the target object fails.
  • the processing device 100 can calculate the adjustment speed according to the method shown in FIG. 7 below.
  • the control command 2 generated in S3032 is a movement command generated based on the adjustment speed, and the movement command includes the adjustment speed. speed. Compared with adjusting the angle included in the moving command, adjusting the monitoring image of the camera at the speed makes the rotation of the stepping motor 341 smoother, thereby ensuring that the tracking of the target object can be more detailed and smooth.
  • the control command 2 generated by the processing device 100 in S3032 may be a stop command, a magnification reduction command, or a return to a preset command.
  • the processing device 100 may generate a stop instruction 1, which is used to instruct the stepper motor 341 in the gimbal 340 to stop working, and instruct the camera 330 to stop changing magnification.
  • the processing device 100 may generate a magnification reduction instruction, which is used to instruct the camera 330 to reduce the magnification to expand the monitoring range and increase the probability of finding the target object.
  • the processing device 100 may generate a return to the preset point instruction, and the return to the preset point instruction is used to instruct the stepping motor 341 to drive the camera 330 to return to the preset point, and to exit the target object tracking.
  • the processing device 100 may generate a stop instruction 2, which is used to instruct the stepper motor 341 in the gimbal 340 to stop working, and instruct the camera 330 Stop changing the magnification.
  • the preset rules for sending control instruction 2 in S3033 can be implemented by adding mandatory execution flags to various instructions in the dome communication protocol.
  • the movement command is time-sensitive, and it takes time to send, process and execute the command, and the stepper motor also has an excitation response delay, so the movement command does not have to be executed every time, only the distance is sent when the command is sent.
  • the movement command generated at the most recent time can achieve the best adjustment effect for the ball machine 300, so as to ensure that the target object is not easily lost.
  • the forced flag bit of the move instruction can be set to 0, indicating that the move instruction is not a necessary instruction for forced execution.
  • the stop command, the magnification reduction command and the return to the preset point command are the commands that must be executed by the dome camera 300 to handle exceptions. If they are not executed, the exception may not be handled correctly, resulting in a complete failure to track the target object. Therefore, the stop command, The mandatory flag bit of the lower magnification command and the command of returning to the preset point can be set to 1, indicating that these commands are necessary commands that need to be forced to be executed.
  • the processing device 100 saves a non-mandatory execution instruction that is not executed, then the subsequently generated non-mandatory execution instruction or mandatory execution instruction can overwrite the previously generated non-mandatory execution instruction; if The processing device 100 saves the mandatory execution instructions that are not executed, then the non-mandatory execution instructions generated subsequently are discarded, the mandatory execution instructions generated subsequently are also saved, and the two mandatory execution instructions are periodically sent in the order in which they were generated. Give the ball machine 300.
  • cycle 1 there are no unsent control commands in the processing device 100, and the dome camera 300 is always in the normal state 1 during the cycle 1, and the movement command 1, the movement command 2 and the movement command are generated in the order of time. 3. Then, when the cycle 1 ends and the next cycle 2 starts, the processing device 100 sends the newly generated movement command 3 to the ball machine 300, and the movement command 1 and the movement command 2 can be discarded by the processing device 100.
  • cycle 3 there are no unsent control commands in the processing device 100, and the dome camera 300 is always in an abnormal state during cycle 3, and the stop command 1, the stop command 2 and the reduction ratio are sequentially generated in the order of time.
  • the processing device 100 sends the earliest generated stop command 1 to the dome camera 300, the move command 2 and the magnification reduction command 1 can be saved by the processing device 100 ;
  • the processing device 100 sends the stop command 2 generated after the stop command 1 to the dome camera 300;
  • the processing device 100 sends the dome camera 300 Decrease magnification command 1 generated after stop command 2 is sent.
  • the processing device 100 may generate multiple movement commands, but only saves the latest movement command as the control command 2 to be sent.
  • the processing device 100 sends the latest generated movement to the dome camera 300 instruction.
  • the processing device 100 can generate at least one stop command, each stop command is stored in the processing device 100, and when the control command is sent At the time of 2, the processing device 100 sends the stop command 1 that is generated earliest in the cycle to the ball machine 300.
  • the processing device 100 may generate at least one magnification reduction command, and each reduction magnification command is stored in the processing device 100.
  • control command 2 When the control command 2 is sent, if there is a stop command 2 to be sent, the stop command 2 is sent to the pan/tilt 340; if there is no stop command to be sent, a magnification reduction command 1 is sent to the pan/tilt 340.
  • the processing device 100 may generate at least one return to preset point instruction, and each return to preset point instruction is stored in the processing device 100 , when the time to send the control command 2 arrives, if there is still a lower magnification command 2 to be sent, then send the lower magnification command 2 to the pan/tilt 340; if there is no lower magnification command to be sent, then send the Return to preset point command 1.
  • the processing device 100 may generate at least one stop command, and each stop command is stored in the processing device 100.
  • the processing device 100 may generate at least one movement command, and if there is still a stop command 4 to be sent, then all the generated movements are lost.
  • the processing device 100 determines that the second image sent by the dome camera 300 includes the key information of the target object, the processing device 340 can also transfer the tracking state flow to the idle state 5 shown in FIG. 4 .
  • the processing device 100 A return to preset point instruction can be sent to the dome camera 300 to control the stepping motor 341 to drive the camera 330 to return to the preset point and to exit the tracking of the target object.
  • the instruction for returning to the preset point includes a preset point identifier, and the preset point identifier is used to uniquely identify the preset point.
  • the related information of at least one preset point can be preset and recorded in the dome camera 300.
  • the dome camera 300 When the dome camera 300 receives the instruction to return to the preset point, it can parse the return preset point.
  • the instruction acquires the preset point identifier, so as to determine the preset point to be returned based on the preset point identifier, so as to return to the corresponding preset point based on the relevant information of the preset point, and complete the instruction of returning to the preset point.
  • the processing device 300 presets and records the relevant information of at least one preset point (including the preset point identifier and position) for the dome machine, and the processing device 100 generates and sends the return preset point of the dome machine 300
  • the command includes the position of the preset point.
  • the dome camera 300 When the dome camera 300 receives the instruction of returning to the preset point, it can parse the instruction of returning to the preset point to obtain the position of the preset point, so as to return to the corresponding preset point based on the position of the preset point. Complete the command of returning to the preset point.
  • the local storage manner of the generated control instruction 2 to be sent in the processing device 100 is not specifically limited in this embodiment.
  • At least one control instruction 2 may be stored in the processing device 100 in the form of an instruction queue.
  • the move instruction generated before can be overwritten with the move instruction generated later to ensure that only the move instruction generated newly is stored in the instruction queue.
  • the command queue of the processing device 100 stores a move command, and generates a stop command, a magnification reduction command, or a return to preset command
  • the stop command, magnification reduction command, or return to preset command generated later can be used to overwrite the previously generated movement command. command to ensure that only stop commands, lower magnification commands or return to preset commands are stored in the command queue.
  • the move instruction can be discarded.
  • the command queue of the processing device 100 includes a stop command, a magnification reduction command, or a return to preset command, and a stop command, a magnification reduction command, or a return to preset command is generated, the newly generated stop command, magnification reduction command may be Or the command to return to the preset point is also saved, and then periodically sent to the ball machine 300 according to the generation sequence.
  • the movement instruction Move may include a first adjustment speed V pan in the first direction, a second adjustment speed V tilt in the second direction, a first magnification adjustment speed V zoom and a forced flag F, wherein , the calculation methods of the values of V pan in the first direction and V pan in the second direction refer to the relevant description in the embodiment shown in Figure 7 below; the value of V zoom is the preset magnification adjustment speed, and the direction is based on The actual state of the target object in the second image is determined; the value of the mandatory flag bit F is 0.
  • the stop command Stop can include the stop rotation indicator bit T, the stop zoom ratio indicator bit M, and the mandatory flag bit F.
  • the stop rotation indicator bit T takes the value of 1
  • the stop zoom indicator bit M takes the value of 1
  • the mandatory value is 1.
  • the value of the flag bit F is 1.
  • the Stop is used to instruct the dome camera 300 to stop rotating and stop changing the magnification, and the Stop is an instruction that needs to be enforced.
  • the preset point return command GotoPreset can include the preset point identifier D and the mandatory flag bit F.
  • the preset point identifier D is used to uniquely identify a preset point of the dome camera 300, and the value of the mandatory flag bit F is 1.
  • the GotoPreset is used to instruct the dome camera 300 to return to the preset point corresponding to the identifier D, for example, the preset point named home, and the GotoPreset is an instruction that needs to be enforced.
  • the processing device 100 determines that the dome camera 300 is in the lost state 3, it can also generate a magnification reduction command ZoomOut (also referred to as a zoom-out command), and the ZoomOut can include a stop rotation indication bit T, a stop zoom ratio indication bit M and
  • the mandatory flag bit F usually, the value of the stop rotation indicator bit T is 1, the value of the stop zoom indicator bit M is 0, and the value of the mandatory flag bit F is 1.
  • ZoomOut is used to indicate the ball
  • the machine 300 stops rotating and reduces the magnification to expand the monitoring range, so as to search for the target object from a larger monitoring area and increase the probability of retrieving the target object.
  • ZoomOut is an instruction that needs to be enforced. It should be noted that ZoomOut and Stop can be two different types of instructions, or two instructions with different functions under the same type of instruction, which are distinguished based on the value of the stop zoom indicator bit M, and are implemented in this application. Examples are not specifically limited.
  • the above-mentioned PID algorithm calculates the parameters V pan and V tilt in the movement command Move.
  • prominent contribution points include:
  • the corresponding relationship between the magnification and the PID parameter group ⁇ K P , K I and K D ⁇ is preset in the processing device 100 , for example, the magnification change of the camera 330 in the dome camera 300 is divided into 1.0 ⁇ 30.0
  • 10 sets of corresponding relationships are preset: 1.0 ⁇ 2.9 correspond to PID parameter group 1 ⁇ K P1 , K I1 and K D1 ⁇ , 3.0 ⁇ 5.9 correspond to PID parameter group 2 ⁇ K P2 , K I2 and K D2 ⁇ ,...
  • the processing device 100 calculates V based on the PID Before pan and V tilt , it is also possible to judge whether the target object is in the center area of the second image, and if so, set the deviation between the center point of the second image at the current moment and the center point of the target object in the second image. PID calculation is performed after zero; if not, PID calculation is directly performed according to the deviation between the center point of the second image at the current moment and the center point of the target object in the second image.
  • , ⁇ y
  • the PID outputs a more accurate adjustment speed in the corresponding direction.
  • the stepper motor 341 rotates according to different rotation gears, and usually has the smallest gear (eg, 0.1 gear), then, in order to avoid that the V pan and V tilt calculated by the PID are too small (for example, less than 0.1 ) causes the stepping motor 341 to rotate too far, so that the rotation process of the stepping motor 341 shakes back and forth and cannot be stabilized .
  • the dead zone is judged separately. When it is in the dead zone, the adjustment speed is set to zero (that is, no adjustment is performed in this direction).
  • S33 respectively determine whether ⁇ x is less than or equal to the ⁇ x threshold value , and whether ⁇ y is less than or equal to the ⁇ y threshold value , if yes, then perform S34 after setting the corresponding deviation to zero, if not, directly perform S34;
  • S37 respectively determine whether V pan and V tilt are located in the preset dead zone, if so, set V pan and/or V tilt located in the dead zone to zero and then execute S38, if otherwise, directly execute S38;
  • central area judgment i.e. S33
  • the dead zone judgment i.e. S37
  • the magnification adjustment speed is determined by using a preset value instead of using the PID algorithm for calculation, and the preset value is used as the magnification adjustment speed to adjust the magnification, which can ensure that the second data collected by the camera 330 during the magnification adjustment process can be ensured.
  • the image is also sharp and does not affect the tracking of the target object.
  • the method for determining the magnification adjustment speed V zoom may include: S41, obtaining the proportion of the target object in the second image in the second image; S42, judging the proportion and the preset Set the size relationship between the ratio threshold 1 and the ratio threshold 2, if the ratio is less than the ratio threshold 1, then execute S43, if the ratio is greater than or equal to the ratio threshold 1 and less than or equal to the ratio threshold 2, then execute S44, if the ratio is greater than or equal to the ratio threshold 2, then execute S44 If the scale threshold value is 2, execute S45, wherein the scale threshold value 1 is smaller than the scale threshold value 2; S43, determine V zoom as a, so as to control the camera 330 to increase the magnification of the camera 330 according to a; S44, determine V zoom as 0, so as to control the wrong Adjust the magnification of the camera 330; S45, determine V zoom to be -a, so as to control the camera 330 to reduce the magnification
  • the processing device 100 may determine a reference factor for magnification adjustment according to different target objects. For example, when the target object is an elongated shape (such as a person), the height h of the target object in the second image is determined as the magnification.
  • the reference factor for adjustment for another example, when the target object is a short and wide shape (such as a vehicle), the width w of the target object in the second image is determined as the reference factor for magnification adjustment; for another example, when the target object is short and wide If the shape is wide (such as a vehicle), but the width is approximately equal to the width of other objects, it is determined that the height h and width w of the target object in the second image are taken together as a reference factor for magnification adjustment.
  • the target object is a person
  • the height h is used as the reference factor for magnification adjustment
  • the preset value a 1.5/sec
  • the preset scale threshold value 1 and scale threshold value 2 the scale threshold value 1 is 1/3
  • the scale threshold value is 2 bits 2/3
  • the processing device 100 determines that the ratio of the height of the person to the height of the second image 1 is 1/5, then, since 1/5 is less than 1/3
  • the generated movement instruction Move includes the magnification ratio
  • the adjustment speed V zoom is 1.5/second; if at time t2, the processing device 100 determines that the ratio of the height of the person to the height of the second image 2 is 1/2, then, since 1/2 is less than 2/3 and greater than 1/ 3.
  • the magnification adjustment speed V zoom included in the generated movement instruction Move is 0; if at time t3, the processing device 100 determines that the ratio of the height of the person to the height of the second image 3 is 5/6, then, since 5/ 6 is greater than 2/3, the magnification adjustment speed V zoom included in the generated movement command Move is -1.5/sec.
  • the processing device 100 can control the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to work when acquiring the first image including the target object to be tracked sent by the trigger 200 in the monitoring system , in order to drive the dome camera 300 to rotate to the monitoring area corresponding to the bolt 200, so that the camera in the dome camera 300 can collect the second image including the target object and send it to the processing device 100.
  • the processing device 100 can be based on the dome camera
  • the second image sent by 300 generates a control command for the dome camera 300, and periodically sends control commands to the PTZ 340 to control the stepping motor 341 in the PTZ 340 to work, so as to track the target object .
  • the stepper motor 341 has a certain excitation response time delay, and the process of capturing images by the camera 330 in the dome camera 300 is discrete
  • the processing device 100 periodically sends control commands to the dome camera 300 with rotatable and variable magnification by presetting the period for sending control commands, which effectively overcomes the lack of smooth rotation of the camera 330 currently controlling the dome camera 300.
  • the shortcoming of stability makes the rotation process of the dome machine 300 no longer stuck, and realizes smooth and stable tracking of the target object, thereby improving the use experience of the dome machine 300 .
  • FIG. 8 provides a ball camera control apparatus 800 provided in this embodiment, the ball camera control apparatus 800 is applied to a processing device, and the ball camera control apparatus 800 includes: a determination unit 801, a transmission unit 802, and a tracking unit 803;
  • the sending unit 802 is used to periodically send a control command to the dome camera, the control command is used to control the stepping motor of the pan/tilt in the dome camera to drive the camera in the dome camera to rotate to the monitoring area where the target object is located;
  • the tracking unit 803 is used for tracking the target object based on the image collected by the camera in the dome camera.
  • the period of sending control commands to the dome camera is greater than the excitation response time delay of the stepping motor.
  • the determining unit 801 is further configured to determine the control instruction according to the tracking result of the target object in the image before periodically sending the control instruction to the dome camera, where the tracking result includes a normal state and an abnormal state.
  • the control instruction is a first control instruction
  • the first control instruction is used to instruct the dome camera to continue tracking the target object.
  • the sending unit 802 is further configured to: send the newly generated first control instruction in the same cycle to the ball machine.
  • the determining unit 801 is further configured to determine the first control instruction according to a preset rule, and the preset rule includes determining the first control instruction according to the magnification of the camera in the dome camera and the proportional-integral-derivative PID parameter group.
  • the determining unit 801 includes: a first determining subunit, a second determining subunit and a third determining subunit.
  • the first determination subunit is used to determine the PID parameter group corresponding to the magnification according to the current magnification of the camera in the dome camera;
  • the second determination subunit is used to determine the first adjustment speed and the second adjustment speed according to the PID parameter group ;
  • a third determination sub-unit for determining the first control command according to the first adjustment speed and the second adjustment speed.
  • the second determination subunit is further configured to determine the first adjustment speed according to the PID parameter and the first deviation in the first direction, wherein the first deviation is the center point of the image and the area where the target object is located in the image. The distance between the center points in the first direction.
  • the determining unit 801 further includes a first zero-setting sub-unit, where the first zero-setting sub-unit is configured to, before determining the first adjustment speed according to the PID parameters and the first deviation in the first direction, if the first If the deviation is smaller than the preset first deviation threshold, the first deviation is set to zero, and the first deviation threshold is determined based on the preset central area of the image.
  • the determining unit 801 further includes a second zero-setting subunit, the second zero-setting subunit is configured to set the first adjustment speed to zero if the first adjustment speed is within the dead zone range, and the dead zone The range is determined according to the adjustment accuracy of the stepper motor.
  • the preset rule may further include determining the first control instruction according to the proportion of the target object in the image in the preset direction.
  • the determining unit 801 further includes: an acquiring subunit, a fourth determining subunit, and a fifth determining subunit.
  • the acquisition subunit is used to acquire the proportion of the target object in the image in the preset direction
  • the fourth determination subunit is used to determine the target magnification adjustment speed according to the proportion and the preset proportion threshold, and the target magnification adjustment speed is preset The magnification adjustment speed or the opposite number of the preset magnification adjustment speed
  • the fifth determination subunit is used for determining the first control command according to the target magnification adjustment speed.
  • control instruction is a second control instruction
  • the second instruction is used to instruct the dome camera to control the dome camera in an abnormal state
  • the determining unit 801 is further configured to determine a second control instruction according to a preset rule, the preset rule includes determining a second control instruction according to the type of abnormal state, and the second control instruction includes at least one of the following instructions: stop command, reduce magnification command or return to preset point command.
  • the sending unit 802 is further configured to send the earliest generated second control instruction stored in the instruction queue to the ball machine.
  • the abnormal state includes a first abnormal state, a second abnormal state, a third abnormal state and a fourth abnormal state
  • the apparatus 800 further includes: a first processing unit to a fifth processing unit.
  • the first processing unit is used to determine that the dome camera has entered the first abnormal state when the dome camera is in a normal state and the collected image does not include the target object, and instruct the stepper motor in the gimbal to stop working;
  • the second process The unit is used when the dome camera is in the first abnormal state and the multi-frame images collected at the first preset time do not include the target object, or when the dome camera is in the first abnormal state and the dome camera is in the first preset time
  • the images collected within the time include the target object, determine that the dome camera has entered the second abnormal state, and instruct the camera to reduce the magnification to expand the monitoring range;
  • the third processing unit is used for when the dome camera is in the second abnormal state and in the second preset state.
  • the stepper motor is instructed to drive the camera to return to the preset point and exit the tracking of the target object;
  • the fourth processing unit is used for When the dome camera is in the second abnormal state and the collected image includes the target object, it is determined that the dome camera enters the fourth abnormal state, and the stepping motor in the gimbal is instructed to stop working;
  • the fifth processing unit is used for when the dome camera is in the fourth abnormal state.
  • the fourth abnormal state and the multi-frame images collected by the dome camera within the third preset time all include the target object, or, when the dome camera is in the first abnormal state and the images collected by the dome camera within the first preset time include the target object.
  • the target object confirm that the dome camera enters the normal state.
  • the sending unit 802 is used to send the first stop instruction to the PTZ when the dome machine changes from the normal state to the first abnormal state within one cycle of sending the control command to the dome machine; or, the sending unit 802 is used to When the dome camera changes from the first abnormal state to the normal state within one cycle of sending the control command to the dome camera, if there is a second stop command to be sent, it will send the second stop command to the PTZ; if there is no second stop command to be sent If the second stop command is given, then send the first movement command to the PTZ; or, the sending unit 802 is used to change the dome machine from the first abnormal state to the second abnormal state within one cycle of sending the control command to the dome machine When there is still a third stop command to be sent, send a third stop command to the PTZ; if there is no third stop command to be sent, send a first lower magnification command to the PTZ; or, the sending unit 802 , used to send the second reduction ratio command to the PTZ when the dome camera changes from the second abnormal
  • the sending unit 802 is used for when the dome machine changes from the fourth abnormal state to the normal state within one cycle of sending the control command to the dome machine, if there is still a fifth stop command to be sent , then, send the fifth stop instruction to the PTZ; if there is no fifth stop instruction to be sent, then send the newly generated movement instruction to the PTZ; or, the sending unit 802 is used to send the control instruction to the ball machine In one cycle, when the dome camera changes from the fourth abnormal state to the second abnormal state, if there is a sixth stop command to be sent, it will
  • the apparatus 800 may further include: a sixth processing unit.
  • the sixth processing unit is used for determining that the dome camera has entered the fifth abnormal state when the dome camera has acquired the key information of the target object, and instructing the stepper motor to drive the camera to return to the preset point and exit the tracking of the target object.
  • the sending unit 802 may include: a first sending subunit and a second sending subunit. The first sending subunit is used to send the first control command in the first command queue to the PTZ at the first moment; the second sending subunit is used to send the second command to the PTZ at the second moment The second control instruction in the queue.
  • the time from the first time to the second time is one cycle of the ball machine sending the control command
  • the control command sent at the first time is the first control command
  • the control command sent at the second time is the second control command
  • all the control instructions generated at the first moment only include movement instructions
  • the first control instructions only included in the first instruction queue the first control instructions are the latest generated movement instructions before the first moment
  • All the control commands generated at a moment include at least one of a stop command, a command to reduce the magnification, or a command to return to a preset point
  • the first command queue includes all stop commands, a command to reduce the magnification, and all the stop commands, the magnification decrease, and the commands generated by the first moment in sequence according to the generation sequence.
  • An instruction or a return to a preset point instruction the first instruction queue does not include a move instruction
  • the first control instruction is an instruction in the first instruction queue whose generation time is the longest from the first time.
  • the apparatus 800 may further include: a first queue updating unit to a third queue updating unit.
  • the first queue updating unit is configured to generate a fifth stop instruction at the third moment, and overlay the fifth stop instruction over the first movement instruction in the first instruction queue to obtain the updated first instruction queue, and after the update
  • the first instruction queue includes a first stop instruction;
  • a second queue updating unit is used to generate a second moving instruction at the fourth moment, and discard the second moving instruction according to the updated first instruction queue;
  • the third queue updating unit used to generate a second return preset point instruction at the fifth moment, and add the second return preset point instruction to the updated fifth stop instruction of the first instruction queue to obtain the second instruction queue, the second instruction
  • the instruction queue includes a fifth stop instruction and a second return to the preset point instruction.
  • the second sending subunit is configured to send a fifth stop instruction to the PTZ, so as to control the stepping motor in the PTZ to stop working.
  • the sending unit 802 is further configured to send the second return preset point instruction to the gimbal at the sixth time after the second time, so as to control the stepping motor in the gimbal to drive the dome camera to return to the preset point, wherein , the time from the second moment to the sixth moment is one cycle.
  • the apparatus 800 in this embodiment of the present application may be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the PLD may be a complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the PLD may be a complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL general array logic
  • the dome machine control device 800 may correspond to executing the method described in this embodiment, and the above-mentioned and other operations and/or functions of each unit in the dome machine control device 800 are respectively for the purpose of realizing the method in FIG. 3 . For the sake of brevity, the corresponding process is not repeated here.
  • FIG. 9 is a schematic diagram of a ball machine control device 900 provided in this embodiment.
  • the ball machine control device 900 includes a processor 901 , a memory 902 , a communication interface 903 and a memory unit 904 .
  • the processor 901, the memory 902, the communication interface 903, and the memory unit 904 communicate through the bus 905, and can also communicate through other means such as wireless transmission.
  • the memory 902 is used for storing instructions, and the processor 901 is used for executing the instructions stored in the memory 902 .
  • the memory 902 stores program codes, and the processor 901 can call the program codes stored in the memory 902 to perform the following operations:
  • control commands Periodically send control commands to the dome camera, where the control commands are used to control the stepping motor of the pan/tilt in the dome camera to drive the camera in the dome camera to rotate to the monitoring area where the target object is located;
  • the target object is tracked based on images collected by a camera in the dome camera.
  • the processor 901 may be a CPU, and the processor 901 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGA field programmable gate arrays
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the memory 902 which may include read-only memory and random access memory, provides instructions and data to the processor 901 .
  • Memory 902 may also include non-volatile random access memory.
  • memory 902 may also store device type information.
  • the memory 902 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous link dynamic random access memory direct rambus RAM, DR RAM
  • bus 905 may also include a power bus, a control bus, a status signal bus, and the like. However, for the sake of clarity, the various buses are labeled as bus 905 in the figure.
  • the ball machine control device 900 may correspond to the ball machine control device 800 in the embodiment of the present application, and may correspond to the corresponding subject in executing the method shown in FIG. 3 according to the embodiment of the present application,
  • the above and other operations and/or functions of each module in the ball machine control device 900 are to implement the corresponding flow of each method in FIG. 3 , and are not repeated here for brevity.
  • the present application further provides a monitoring system, where the monitoring system includes a first device, a second device, and a processing device, and the processing device communicates with the first device and the second device respectively.
  • the first device is used to acquire an image within a fixed monitoring range, and send the first image including the target object to the processing device;
  • the processing device is used to execute each operation step of the above-mentioned method as shown in FIG.
  • the second device sends a control instruction to control the second device, which is not repeated here for brevity; the second device is used to complete the tracking of the target object based on the control instruction sent by the processing device.
  • the second device is a ball machine.
  • the first device may be a bolt action.
  • the specific structure can be found in Figure 1.
  • the monitoring system may further include a central device and a processing device, which are further used to acquire key information of the target object and send the key information to the central device; the central device is used to analyze and process the key information.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media.
  • the semiconductor medium may be a solid state drive (SSD).

Abstract

A dome camera control method, applicable in a processing device. The method comprises: when a target subject to be tracked is determined, periodically transmitting a control instruction to a dome camera, controlling via the control instruction a stepping motor of a gimbal in the dome camera to drive a camera mounted on the gimbal to rotate to a monitoring area in which the target subject is located, thus allowing a processing device to track the target subject on the basis of images received from the dome camera. By presetting the period for transmitting the control instruction, the processing device periodically transmits the control instruction to the rotatable, variable-magnification dome camera; this effectively overcomes the current shortcoming in which when controlling the rotation of a camera of a dome camera, the rotation of the dome camera is insufficiently smooth and steady due to the tendency for gimble response to lag significantly behind changes in the location of a target subject in the actual picture. The invention thus prevents lag in the dome camera rotation process, and thereby achieves the smooth and steady tracking of the target subject, and enhances use experience of the dome camera.

Description

球机控制方法、装置及设备Ball machine control method, device and equipment 技术领域technical field
本申请涉及控制技术领域,尤其涉及一种球机控制方法、装置及设备。The present application relates to the technical field of control, and in particular, to a ball machine control method, device and device.
背景技术Background technique
球机是一种智能安防视频监控领域常用的设备,包括摄像机和用于支撑摄像机的云台,云台内的步进电机带动云台上安装的摄像机转动,实现拍摄画面的变化。由于球机中的摄像机可以转动、可以变倍率的特点,被广泛的应用于安防监控中的目标跟踪场景。The dome camera is a commonly used equipment in the field of intelligent security video surveillance, including a camera and a pan/tilt for supporting the camera. The stepping motor in the pan/tilt drives the camera installed on the pan/tilt to rotate to realize the change of the shooting picture. Because the camera in the dome camera can be rotated and the magnification can be changed, it is widely used in the target tracking scene in security monitoring.
目前,球机在进行跟踪目标对象时,通常基于所采集的图像先确定目标对象所在的方形框,然后根据方形框的中心点和该图像中心点之间的像素偏差计算球机的角度偏差,进而由云台带动该球机中的摄像机转动。但是,由于上述控制过程是确定角度偏差则发送指令控制云台转动,而具体实施过程中,云台的响应往往会明显滞后于实际画面中目标对象位置的变化,球机转动、倍率的变化会导致摄像机抖动从而导致采集图像模糊或滞后的问题,无法平滑稳定的控制球机转动和采集图像,影响监控质量。因此,如何提供一种平滑稳定的球机控制方法成为亟待解决的技术问题。At present, when the dome camera is tracking the target object, it usually first determines the square frame where the target object is located based on the collected image, and then calculates the angle deviation of the dome camera according to the pixel deviation between the center point of the square frame and the center point of the image. Then, the camera in the dome camera is driven by the PTZ to rotate. However, because the above control process is to determine the angle deviation, then send commands to control the rotation of the gimbal. In the specific implementation process, the response of the gimbal tends to lag significantly behind the change of the position of the target object in the actual screen, and the rotation and magnification of the dome camera will change. The camera shakes and the captured image is blurred or lagged. It is impossible to control the rotation of the dome camera and capture the image smoothly and stably, which affects the monitoring quality. Therefore, how to provide a smooth and stable ball machine control method has become an urgent technical problem to be solved.
发明内容SUMMARY OF THE INVENTION
本公开提供了一种球机控制方法、装置及设备,使得球机能够实现对目标对象平滑稳定的跟踪,提升球机的使用体验。The present disclosure provides a method, device and equipment for controlling a ball machine, so that the ball machine can achieve smooth and stable tracking of a target object and improve the use experience of the ball machine.
第一方面,提供了一种球机控制方法,该方法应用于处理设备。该方法可以包括:处理设备确定待跟踪的目标对象后,周期性向球机发送控制指令,通过控制指令控制球机中云台内的步进电机带动云台上安装的摄像机转动至目标对象所在的监控区域,从而,处理设备可以基于从球机所接收的图像跟踪目标对象。这样,考虑到云台的响应往往会明显滞后于实际画面中目标对象位置的变化,球机转动、倍率的变化会导致摄像机抖动从而导致采集图像模糊或滞后的问题,该方法通过预设发送控制指令的周期,处理设备周期性向具有可转动、可变倍率的球机发送控制指令,有效的克服了目前在控制球机的摄像机转动时不够平滑稳定的缺点,使得球机的转动过程不再卡顿,实现对目标对象平滑稳定的跟踪,从而提升球机的使用体验。其中,考虑到球机中如果积压有未执行的控制指令,会导致步进电机总是无法按照目标对象在球机画面中的实际情况及时有效的作出跟踪调整,为了克服这个问题,该方法中,处理设备中预设的向球机发送控制指令的周期大于步进电机的激励响应时延,这样,能够保证球机中不积压未执行的控制指令,使得步进电机能够按照目标对象在球机画面中的实际情况及时有效的对目标对象进行跟踪。In a first aspect, a ball machine control method is provided, and the method is applied to a processing device. The method may include: after the processing device determines the target object to be tracked, periodically sending control instructions to the dome camera, and controlling the stepping motor in the dome camera through the control instructions to drive the camera installed on the dome camera to rotate to the location where the target object is located. The area is monitored so that the processing device can track the target object based on the images received from the dome. In this way, considering that the response of the gimbal tends to lag significantly behind the change of the position of the target object in the actual picture, the rotation of the dome camera and the change of the magnification will cause the camera to shake and cause the problem of blurring or lag in the captured image. The cycle of the command, the processing device periodically sends control commands to the dome camera with rotatable and variable magnification, which effectively overcomes the shortcomings of the current lack of smoothness and stability when controlling the rotation of the camera of the dome camera, so that the rotation process of the dome camera is no longer stuck. to achieve smooth and stable tracking of the target object, thereby improving the use experience of the dome camera. Among them, considering that if there is a backlog of unexecuted control commands in the dome camera, it will cause the stepper motor to be unable to make tracking adjustments in a timely and effective manner according to the actual situation of the target object in the dome camera screen. In order to overcome this problem, in this method , the preset cycle of sending control commands to the dome camera in the processing device is greater than the excitation response delay of the stepping motor, so that it can ensure that there is no backlog of unexecuted control commands in the dome camera, so that the stepping motor can follow the target object in the ball machine. The actual situation in the screen of the machine can track the target object in a timely and effective manner.
在一种可能的实现方式中,在所述周期性向球机发送控制指令之前,该方法还可以包括:根据图像中目标对象的跟踪结果确定控制指令,该跟踪结果包括正常状态和异常状态。这样,能够有效的根据实际的跟踪结果生成对应的控制指令,为周期性向球机发送控制指令提供了可靠的数据基础,使得对目标对象的高质量跟踪成为了可能。In a possible implementation manner, before the periodic sending of the control instruction to the dome camera, the method may further include: determining the control instruction according to the tracking result of the target object in the image, where the tracking result includes a normal state and an abnormal state. In this way, the corresponding control commands can be effectively generated according to the actual tracking results, which provides a reliable data basis for periodically sending control commands to the dome camera, and makes high-quality tracking of the target object possible.
在另一种可能的实现方式中,当目标对象的跟踪结果为正常状态时,向球机发送的控制指令具体为第一控制指令,该第一控制指令用于指示球机继续跟踪目标对象。其中,该第一 控制指令为移动指令。该示例下,周期性向球机发送控制指令,具体可以是指向球机发送同一周期中最新生成的第一控制指令。例如,假设到达周期1时,处理设备中没有未发送的控制指令,且该周期1期间球机一直处于正常状态1,按照时间的先后顺序依次生成移动指令1、移动指令2和移动指令3,那么,当从周期1进入下一个周期2的时刻,处理设备向球机发送最新生成的移动指令3,移动指令1和移动指令2可以被处理设备丢弃。In another possible implementation manner, when the tracking result of the target object is in a normal state, the control command sent to the dome machine is specifically a first control command, and the first control command is used to instruct the dome machine to continue tracking the target object. Wherein, the first control instruction is a movement instruction. In this example, periodically sending the control command to the dome machine may specifically be sending the newly generated first control command to the dome machine in the same cycle. For example, assuming that when cycle 1 is reached, there are no unsent control commands in the processing device, and the dome camera is always in normal state 1 during this cycle 1, and the movement command 1, movement command 2 and movement command 3 are generated in the order of time. Then, when entering the next cycle 2 from cycle 1, the processing device sends the newly generated movement command 3 to the dome camera, and the movement command 1 and movement command 2 can be discarded by the processing device.
在另一种可能的实现方式中,当目标对象的跟踪结果为异常状态时,向球机发送的控制指令具体为第二控制指令,该第二指令用于指示球机在异常状态时执行对球机的控制。其中,第二控制指令包括下述指令中的至少一个:停止指令、降低倍率指令或返回预置点指令。该示例下,如果处理设备通过指令队列保存控制指令,周期性向球机发送控制指令具体可以是指向球机发送指令队列中保存的最早生成的第二控制指令。例如,假设到达周期3时,处理设备中没有未发送的控制指令,且该周期3期间球机一直处于异常状态,按照时间的先后顺序依次生成停止指令1、停止指令2和降低倍率指令1,那么,指令队列中包括停止指令1、停止指令2和降低倍率指令1。当从周期3进入下一个周期4的时刻,处理设备向球机发送最早生成的停止指令1,指令队列中包括停止指令2和降低倍率指令1;当从周期4进入下一个周期5的时刻,处理设备向球机发送停止指令1之后生成的停止指令2,指令队列中包括降低倍率指令1;当从周期5进入下一个周期6的时刻,处理设备向球机发送停止指令2之后生成的降低倍率指令1。In another possible implementation manner, when the tracking result of the target object is in an abnormal state, the control command sent to the dome machine is specifically a second control command, and the second command is used to instruct the dome machine to execute the control command when the dome machine is in an abnormal state. Ball machine control. Wherein, the second control instruction includes at least one of the following instructions: a stop instruction, a magnification reduction instruction, or a return to a preset point instruction. In this example, if the processing device saves the control command through the command queue, the periodic sending of the control command to the dome machine may specifically be directed to the dome machine to send the earliest generated second control command stored in the command queue. For example, assuming that when cycle 3 is reached, there are no unsent control commands in the processing device, and the dome camera is always in an abnormal state during cycle 3, and the stop command 1, stop command 2 and magnification reduction command 1 are generated in the order of time. Then, the command queue includes stop command 1 , stop command 2 and magnification reduction command 1 . When entering the next cycle 4 from cycle 3, the processing device sends the earliest generated stop command 1 to the dome camera, and the command queue includes stop command 2 and reduce magnification command 1; when entering the next cycle 5 from cycle 4, The stop command 2 generated after the processing device sends the stop command 1 to the dome camera, and the command queue includes the lowering magnification command 1; when entering the next cycle 6 from cycle 5, the processing device sends the stop command 2 to the dome camera. Override command 1.
在另一种可能的实现方式中,对于目标对象的跟踪结果为正常状态的情况,根据图像中目标对象的跟踪结果确定控制指令,具体可以是指:按照预设规则确定第一控制指令,其中,第一控制指令可以包括第一方向上的第一调整速度、第二方向上的第二调整速度和目标倍率调整速度。In another possible implementation manner, when the tracking result of the target object is in a normal state, determining the control instruction according to the tracking result of the target object in the image may specifically refer to: determining the first control instruction according to a preset rule, wherein , the first control command may include a first adjustment speed in the first direction, a second adjustment speed in the second direction, and a target magnification adjustment speed.
在另一种可能的实现方式中,预设规则可以包括根据球机中摄像机的倍率和比例积分微分(proportional integral derivative,PID)参数组确定第一控制指令。具体而言,处理设备中包括倍率和PID参数组的多组对应关系,根据球机中摄像机的倍率和PID参数组确定所述第一控制指令的过程可以包括:根据球机中摄像机当前的倍率,确定该倍率对应的PID参数组;接着,根据PID参数组,确定第一调整速度和第二调整速度;基于第一调整速度和第二调整速度确定第一控制指令。其中,根据PID参数组确定第一调整速度和第二调整速度,例如可以包括:根据PID参数和第一方向(如x方向)上的第一偏差,确定第一调整速度,该第一偏差为图像的中心点和图像中目标对象所在区域的中心点之间在第一方向上的距离;根据PID参数和第二方向(如y方向)上的第二偏差,确定第二调整速度,该第二偏差为图像的中心点和图像中目标对象所在区域的中心点之间在第二方向上的距离。需要说明的是,图像中目标对象所在的区域是指图像中能够完全将目标对象包括在内的区域,例如,完全包括目标对象的矩形区域(也称为方形框)。这样,处理设备中预设有倍率和PID参数组之间的对应关系,当需要计算转动步进电机的调整速度时,可以直接根据球机中摄像机的当前倍率,确定出对应的PID参数组,计算得到适合当前倍率的步进电机的调整速度,从而使得生成的第一控制指令能够更加有效的被用于对目标对象的跟踪控制。In another possible implementation manner, the preset rule may include determining the first control instruction according to the magnification of the camera in the dome camera and a proportional integral derivative (proportional integral derivative, PID) parameter group. Specifically, the processing device includes multiple sets of correspondences between magnifications and PID parameter groups, and the process of determining the first control command according to the magnification of the camera in the dome camera and the PID parameter group may include: according to the current magnification of the camera in the dome camera , determine the PID parameter group corresponding to the magnification; then, according to the PID parameter group, determine the first adjustment speed and the second adjustment speed; determine the first control command based on the first adjustment speed and the second adjustment speed. Wherein, determining the first adjustment speed and the second adjustment speed according to the PID parameter group, for example, may include: determining the first adjustment speed according to the PID parameter and the first deviation in the first direction (such as the x direction), where the first deviation is The distance in the first direction between the center point of the image and the center point of the area where the target object is located in the image; the second adjustment speed is determined according to the PID parameters and the second deviation in the second direction (such as the y direction). The second deviation is the distance in the second direction between the center point of the image and the center point of the area where the target object is located in the image. It should be noted that the area where the target object is located in the image refers to an area in the image that can completely include the target object, for example, a rectangular area (also called a square frame) that completely includes the target object. In this way, the corresponding relationship between the magnification and the PID parameter group is preset in the processing device. When the adjustment speed of the rotating stepper motor needs to be calculated, the corresponding PID parameter group can be determined directly according to the current magnification of the camera in the dome camera. The adjustment speed of the stepping motor suitable for the current magnification is obtained by calculation, so that the generated first control command can be used for tracking control of the target object more effectively.
需要说明的是,在根据PID参数和第一方向上的第一偏差确定第一调整速度之前,该方法还可以包括:如果第一偏差小于预设的第一偏差阈值,则,将第一偏差置零;并且,在根据PID参数和第二方向上的第二偏差确定第二调整速度之前,该方法还可以包括:如果第二偏差小于预设的第二偏差阈值,则,将第二偏差置零。其中,第一偏差阈值和第二偏差阈值基于该图像预设的中心区域确定。如此,通过判断目标对象是否在图像的中心区域,如果目 标对象位于图像的中心或目标对象距离图像的中心不远的情况,将对应方向上的偏差置零,使得PID计算后在对应方向上输出更加精确的步进电机的调整速度,避免在调整范围较小且效果不明显的情况下,由于PID计算中输入数值太小导致PID发生震荡,使得步进电机出现抖动现象。It should be noted that, before determining the first adjustment speed according to the PID parameters and the first deviation in the first direction, the method may further include: if the first deviation is smaller than the preset first deviation threshold, then setting the first deviation and, before determining the second adjustment speed according to the PID parameter and the second deviation in the second direction, the method may further include: if the second deviation is less than a preset second deviation threshold, then, setting the second deviation Zero. Wherein, the first deviation threshold and the second deviation threshold are determined based on a preset central area of the image. In this way, by judging whether the target object is in the center area of the image, if the target object is located in the center of the image or the target object is not far from the center of the image, the deviation in the corresponding direction is set to zero, so that the PID is calculated and output in the corresponding direction The adjustment speed of the stepper motor is more accurate to avoid the vibration of the PID due to the too small input value in the PID calculation when the adjustment range is small and the effect is not obvious, which makes the stepper motor shake.
需要说明的是,在得到第一调整速度和第二调整速度后,生成第一控制指令之前,还可以进行死区判断,具体为:判断第一调整速度是否位于死区范围内,如果是,则,将第一调整速度置零;判断第二调整速度是否位于死区范围内,如果是,则,将第二调整速度置零。其中,死区范围根据步进电机的调整精度确定,例如,步进电机的最小转动档位为0.1,那么,死区范围可以是-0.1-0.1。这样,有效的避免PID计算出的步进电机的调整速度小于步进电机的最小转动档位,导致步进电机转动过头,使得步进电机的转动过程发生来回晃动、无法稳定的现象,使得球机能够平滑、稳定的跟踪目标对象。It should be noted that, after obtaining the first adjustment speed and the second adjustment speed, and before generating the first control command, a dead zone judgment can also be performed, specifically: judging whether the first adjustment speed is within the dead zone range, and if so, Then, set the first adjustment speed to zero; determine whether the second adjustment speed is within the dead zone range, and if so, set the second adjustment speed to zero. The dead zone range is determined according to the adjustment accuracy of the stepping motor. For example, if the minimum rotation gear of the stepping motor is 0.1, then the dead zone range can be -0.1-0.1. In this way, the adjustment speed of the stepper motor calculated by the PID is effectively prevented from being smaller than the minimum rotation gear of the stepper motor, which causes the stepper motor to rotate too far, which makes the rotation process of the stepper motor shake back and forth and cannot be stabilized. The machine can track the target object smoothly and stably.
在另一种可能的实现方式中,预设规则还可以包括根据目标对象在预设方向上占图像的比例确定第一控制指令。具体而言,根据目标对象在预设方向上占图像的比例确定第一控制指令的过程可以包括:获取在预设方向上目标对象占图像的比例;接着,根据比例和预设比例阈值,确定目标倍率调整速度,该目标倍率调整速度为预设倍率调整速度或预设倍率调整速度的相反数;那么,即可根据目标倍率调整速度确定第一控制指令。例如,假设预设倍率调整指令大于零,当比例小于预设的第一比例阈值时,则,确定预设倍率调整速度本身为目标倍率调整速度,以控制摄像机按照目标倍率调整速度增大摄像机的倍率;当比例大于预设的第二比例阈值时,确定预设倍率调整速度的相反数为目标倍率调整速度,以控制摄像机按照目标倍率调整速度减小摄像机的倍率,其中,第二比例阈值大于第一比例阈值。需要说明的是,预设方向可以基于目标对象的不同确定,例如,当目标对象是细长的形态(如人物),则,确定以目标对象在图像中的高度作为预设方向;又例如,当目标对象是矮宽的形态(如车辆),则,确定以目标对象在图像中的宽度作为预设方向。这样,通过合理的预设倍率调整速度,按照该预设倍率调整速度或其相反数调整摄像机的倍率,避免由于倍率调整速度过快导致球机在变化倍率的时采集的图像模糊不清,从而严重影响对目标对象的跟踪的问题,提高了摄像机的监控质量。In another possible implementation manner, the preset rule may further include determining the first control instruction according to the proportion of the target object in the image in the preset direction. Specifically, the process of determining the first control instruction according to the proportion of the target object in the image in the preset direction may include: obtaining the proportion of the target object in the image in the preset direction; then, according to the proportion and the preset proportion threshold, determining The target magnification adjustment speed, the target magnification adjustment speed is the preset magnification adjustment speed or the opposite number of the preset magnification adjustment speed; then, the first control command can be determined according to the target magnification adjustment speed. For example, assuming that the preset magnification adjustment command is greater than zero, when the ratio is smaller than the preset first ratio threshold, the preset magnification adjustment speed itself is determined as the target magnification adjustment speed, so as to control the camera to increase the camera's zoom rate according to the target magnification adjustment speed. magnification; when the ratio is greater than the preset second ratio threshold, the opposite number of the preset magnification adjustment speed is determined as the target magnification adjustment speed, so as to control the camera to reduce the camera's magnification according to the target magnification adjustment speed, wherein the second ratio threshold is greater than The first scale threshold. It should be noted that the preset direction can be determined based on different target objects. For example, when the target object is a slender shape (such as a person), the height of the target object in the image is determined as the preset direction; for another example, When the target object is a short and wide shape (such as a vehicle), the width of the target object in the image is determined as the preset direction. In this way, through a reasonable preset magnification adjustment speed, adjust the magnification of the camera according to the preset magnification adjustment speed or its opposite, so as to avoid blurred images collected by the dome camera when the magnification is changed due to the excessively fast magnification adjustment speed. The problem that seriously affects the tracking of the target object improves the monitoring quality of the camera.
在另一种可能的实现方式中,对于目标对象的跟踪结果为异常状态的情况,根据图像中目标对象的跟踪结果确定控制指令,具体可以是指:按照预设规则确定第二控制指令,该预设规则可以包括根据异常状态的类型确定第二控制指令。其中,异常状态的类型可以包括但不限于:第一异常状态、第二异常状态、第三异常状态和第四异常状态。In another possible implementation manner, in the case where the tracking result of the target object is an abnormal state, determining the control instruction according to the tracking result of the target object in the image may specifically refer to: determining the second control instruction according to a preset rule, the The preset rule may include determining the second control instruction according to the type of abnormal state. The types of the abnormal state may include, but are not limited to: a first abnormal state, a second abnormal state, a third abnormal state, and a fourth abnormal state.
在另一种可能的实现方式中,当球机处于正常状态且采集到的图像中不包括目标对象时,确定球机进入第一异常状态(也可以称为可能丢失状态),并指示云台中的步进电机停止工作。即,当向球机发送控制指令的一个周期内,球机从正常状态变为第一异常状态时,向云台发送的控制指令例如可以是第一停止指令。In another possible implementation manner, when the dome camera is in a normal state and the captured image does not include the target object, it is determined that the dome camera enters the first abnormal state (also referred to as a possible loss state), and indicates that the camera is in the PTZ The stepper motor stopped working. That is, when the dome machine changes from the normal state to the first abnormal state within one cycle of sending the control command to the dome machine, the control command sent to the PTZ may be, for example, the first stop command.
在另一种可能的实现方式中,当球机处于第一异常状态且在第一预设时间采集的多帧图像中均不包括所述目标对象时,确定球机进入第二异常状态(也可以称为确定丢失状态),并指示摄像机降低倍率,以扩大监控范围。即,当向球机发送控制指令的一个周期内,球机从第一异常状态变为第二异常状态时,如果还有待发送的第三停止指令,则,向云台发送的控制指令为第三停止指令;如果没有待发送的第三停止指令,则,向云台发送的控制指令为第一降低倍率指令。In another possible implementation manner, when the dome camera is in the first abnormal state and the target object is not included in the multi-frame images collected at the first preset time, it is determined that the dome camera enters the second abnormal state (also It can be called as determining the lost state), and instruct the camera to reduce the magnification to expand the monitoring range. That is, when the dome machine changes from the first abnormal state to the second abnormal state within one cycle of sending the control command to the dome machine, if there is still a third stop command to be sent, the control command sent to the PTZ is the first Three stop commands; if there is no third stop command to be sent, the control command sent to the PTZ is the first magnification reduction command.
在另一种可能的实现方式中,当球机处于第四异常状态且球机在第三预设时间内采集的图像中不包括目标对象,确定球机进入所述第二异常状态,并指示摄像机降低倍率,以扩大监控范围。即,当向球机发送控制指令的一个周期内,球机从第四异常状态变为第二异常状态时,如果还有待发送的第六停止指令,则,向云台发送的控制指令为第六停止指令;如果没有待发送的第六停止指令,则,向云台发送的控制指令为第四降低倍率指令。In another possible implementation manner, when the dome camera is in the fourth abnormal state and the image collected by the dome camera within the third preset time does not include the target object, it is determined that the dome camera has entered the second abnormal state, and an indication The camera reduces the magnification to expand the monitoring range. That is, when the dome machine changes from the fourth abnormal state to the second abnormal state within one cycle of sending the control command to the dome machine, if there is still a sixth stop command to be sent, the control command sent to the PTZ is the first Six stop instructions; if there is no sixth stop instruction to be sent, the control instruction sent to the PTZ is the fourth reduction magnification instruction.
在另一种可能的实现方式中,当球机处于第二异常状态且在第二预设时间采集的多帧图像中均不包括目标对象时,确定所述球机进入第三异常状态(也可以称为空闲状态),并指示步进电机驱动摄像机返回预置点,退出对目标对象的跟踪。即,当向球机发送控制指令的一个周期内,球机从第二异常状态变为第三异常状态时,如果还有待发送的第二降低倍率指令,则,向云台发送的控制指令为第二降低倍率指令;如果没有待发送的第二降低倍率指令,则,向云台发送的控制指令为第一返回预置点指令。In another possible implementation manner, when the dome camera is in the second abnormal state and no target object is included in the multi-frame images collected at the second preset time, it is determined that the dome camera enters the third abnormal state (also It can be called idle state), and instructs the stepper motor to drive the camera to return to the preset point and exit the tracking of the target object. That is, when the dome camera changes from the second abnormal state to the third abnormal state within one cycle of sending the control command to the dome camera, if there is still a second lower magnification command to be sent, the control command sent to the PTZ is: The second magnification reduction command; if there is no second magnification reduction command to be sent, the control command sent to the PTZ is the first return to the preset point command.
在另一种可能的实现方式中,当球机处于所述第二异常状态且采集到的图像中包括目标对象时,确定球机进入第四异常状态(也可以称为可能找回状态),并指示云台中的步进电机停止工作。即,当向球机发送所述第二控制指令的一个周期内,球机从第二异常状态变为第四异常状态时,如果还有待发送的第三降低倍率指令,则,向云台发送的控制指令为第三降低倍率指令;如果没有待发送的第三降低倍率指令,则,向云台发送的控制指令为第四停止指令。In another possible implementation manner, when the dome camera is in the second abnormal state and the collected image includes the target object, it is determined that the dome camera enters the fourth abnormal state (also referred to as a possible recovery state), And instruct the stepper motor in the gimbal to stop working. That is, within one cycle of sending the second control command to the dome camera, when the dome camera changes from the second abnormal state to the fourth abnormal state, if there is still a third command to reduce the magnification to be sent, send it to the PTZ. The control command is the third magnification reduction command; if there is no third magnification reduction command to be sent, the control command sent to the PTZ is the fourth stop command.
在另一种可能的实现方式中,当球机处于所述第四异常状态且球机在第三预设时间采集的多帧图像中均包括目标对象,确定球机进入正常状态。即,当向球机发送所述控制指令的一个周期内,球机从第四异常状态变为正常状态时,如果还有待发送的第五停止指令,则,向云台发送的控制指令为第五停止指令;如果没有待发送的第五停止指令,则,向云台发送的控制指令为最新生成的移动指令。In another possible implementation manner, when the dome camera is in the fourth abnormal state and the multi-frame images collected by the dome camera at the third preset time all include the target object, it is determined that the dome camera has entered a normal state. That is, when the dome machine changes from the fourth abnormal state to the normal state within one cycle of sending the control command to the dome machine, if there is a fifth stop command to be sent, the control command sent to the PTZ is the first Five stop instructions; if there is no fifth stop instruction to be sent, the control instruction sent to the PTZ is the newly generated movement instruction.
在另一种可能的实现方式中,当球机处于第一异常状态且球机在第一预设时间内采集的图像中包括目标对象,确定球机进入正常状态。即,当向球机发送控制指令的一个周期内,球机从第一异常状态变为正常状态时,如果还有待发送的第二停止指令,则,向云台发送的控制指令为第二停止指令;如果没有待发送的第二停止指令,则,向云台发送的控制指令为第一移动指令。In another possible implementation manner, when the dome machine is in the first abnormal state and the image collected by the dome machine within the first preset time includes the target object, it is determined that the dome machine enters the normal state. That is, when the dome camera changes from the first abnormal state to the normal state within one cycle of sending the control command to the dome camera, if there is a second stop command to be sent, the control command sent to the PTZ is the second stop command. instruction; if there is no second stop instruction to be sent, the control instruction sent to the PTZ is the first movement instruction.
可见,通过在处理设备中预设细分的状态流转逻辑,实现更加高效和有序的球机控制,使得球机能够高质量的完成对目标对象的跟踪。It can be seen that by presetting the subdivided state flow logic in the processing device, a more efficient and orderly control of the dome camera is realized, so that the dome camera can complete the tracking of the target object with high quality.
在另一种可能的实现方式中,该方法还可以包括:当所述球机已经获取到目标对象的关键信息时,确定球机进入第五异常状态,并指示步进电机驱动摄像机返回预置点,退出对目标对象的跟踪。其中,关键信息可以是用于指示目标对象的标识信息,如:目标人物的正脸图像,又如:目标车辆的车牌图像。这样,处理设备即可将包括目标人物的关键信息的图像发送给中心设备,以便中心设备对图像中目标人物的关键信息进行分析和汇总,使得对目标对象的跟踪实现更加重要的价值。In another possible implementation manner, the method may further include: when the dome camera has acquired the key information of the target object, determining that the dome camera has entered the fifth abnormal state, and instructing the stepper motor to drive the camera to return to the preset Click to exit the tracking of the target object. The key information may be identification information used to indicate the target object, such as a frontal face image of the target person, or a license plate image of the target vehicle. In this way, the processing device can send the image including the key information of the target person to the central device, so that the central device can analyze and summarize the key information of the target person in the image, so that the tracking of the target object can achieve more important value.
在另一种可能的实现方式中,也可以通过指令队列保存处理设备生成的指令。具体实现时,周期性向球机发送控制指令例如可以包括:第一时刻,向云台发送第一指令队列中的第一控制指令;第二时刻,向云台发送第二指令队列中的第二控制指令。其中,第一时刻到第二时刻所经历的时间为球机发送控制指令的一个周期,在第一时刻发送的控制指令为第一控制指令,在第二时刻发送的控制指令为第二控制指令;如果截止第一时刻生成的所有控制指令中仅包括移动指令,则,第一指令队列中仅包括的第一控制指令,该第一控制指令为第一 时刻之前最新生成的移动指令;如果截止第一时刻生成的所有控制指令中包括停止指令、降低倍率指令或返回预置点指令中的至少一个,则,第一指令队列中按照生成顺序依次包括截止第一时刻生成的所有停止指令、降低倍率指令或返回预置点指令,第一指令队列不包括移动指令,第一控制指令为第一指令队列中生成时刻距离第一时刻的时间最长的指令。作为一个示例,如果第一控制指令为第一移动指令,在第一时刻和第二时刻之间,该方法还可以包括:第三时刻,生成第五停止指令,并将第五停止指令覆盖第一指令队列中的第一移动指令,获得更新后的第一指令队列,更新后的第一指令队列包括第一停止指令;第四时刻,生成第二移动指令,根据更新后的第一指令队列将第二移动指令丢弃;第五时刻,生成第二返回预置点指令,并将第二返回预置点指令添加到更新后的第一指令队列的第五停止指令之后,获得第二指令队列,该第二指令队列包括第五停止指令和第二返回预置点指令。那么,该示例下,向云台发送第二指令队列中的第二控制指令,包括:向云台发送第五停止指令,以控制云台中的步进电机停止工作。之后,在第二时刻之后,该方法还可以包括:第六时刻,向云台发送第二返回预置点指令,以控制云台中的步进电机驱动球机返回预置点,其中,第二时刻到第六时刻所经历的时间为一个周期。可见,通过指令队列的形式保存待发送给球机的控制指令,能够确保有序的向球机发送控制指令从而有效的对球机进行控制。In another possible implementation manner, the instructions generated by the processing device may also be stored through the instruction queue. In specific implementation, periodically sending control commands to the dome camera may include, for example: at the first moment, sending the first control command in the first command queue to the gimbal; at the second moment, sending the second command in the second command queue to the gimbal. Control instruction. Among them, the time from the first time to the second time is one cycle of the ball machine sending the control command, the control command sent at the first time is the first control command, and the control command sent at the second time is the second control command ; If all the control instructions generated at the first moment only include movement instructions, then, only the first control instructions included in the first instruction queue, the first control instructions are the latest generated movement instructions before the first moment; if the deadline All control commands generated at the first moment include at least one of a stop command, a magnification reduction command, or a return to the preset point command, then the first command queue includes all stop commands, reduce For a magnification command or a return to a preset point command, the first command queue does not include a movement command, and the first control command is the command whose generation time is the longest from the first moment in the first command queue. As an example, if the first control command is the first movement command, between the first moment and the second moment, the method may further include: at a third moment, generating a fifth stop command, and overwriting the fifth stop command For the first move instruction in the instruction queue, obtain the updated first instruction queue, and the updated first instruction queue includes the first stop instruction; at the fourth moment, generate the second move instruction, according to the updated first instruction queue Discard the second movement instruction; at the fifth moment, generate a second return preset point instruction, and add the second return preset point instruction to the updated fifth stop instruction of the first instruction queue, and obtain the second instruction queue , the second instruction queue includes a fifth stop instruction and a second return to the preset point instruction. Then, in this example, sending the second control instruction in the second instruction queue to the PTZ includes: sending a fifth stop instruction to the PTZ to control the stepping motor in the PTZ to stop working. Then, after the second moment, the method may further include: at the sixth moment, sending a second return to the preset point instruction to the PTZ, so as to control the stepping motor in the PTZ to drive the dome camera to return to the preset point, wherein the second The time from the moment to the sixth moment is a cycle. It can be seen that by storing the control commands to be sent to the dome machine in the form of an instruction queue, it can ensure that the control commands are sent to the dome machine in an orderly manner so as to effectively control the dome machine.
第二方面,本申请提供一种球机控制装置,所述装置包括用于执行第一方面或第一方面任一种可能实现方式中的球机控制方法的各个模块。In a second aspect, the present application provides a ball camera control device, the device including each module for executing the ball camera control method in the first aspect or any possible implementation manner of the first aspect.
第三方面,还提供了一种球机控制的设备,该球机控制设备包括处理器和存储器。其中,存储器,用于存储计算机指令;所述处理器,用于根据计算机指令执行如上第一方面或第一方面任一种可能实现方式中的球机控制方法的操作步骤。In a third aspect, a ball machine control device is also provided, and the ball machine control device includes a processor and a memory. Wherein, the memory is used to store computer instructions; the processor is used to execute the operation steps of the ball camera control method in the first aspect or any possible implementation manner of the first aspect according to the computer instructions.
第四方面,还提供了一种监控系统,该监控系统包括第一设备、第二设备和处理设备,处理设备分别和所述第一设备、所述第二设备通信。其中,第一设备,用于获取固定监控范围内的图像,并将包括目标对象的第一图像发送给处理设备;处理设备,用于基于第一图像,执行上述第一方面或第一方面任一种可能实现方式中的球机控制方法的操作步骤,向第二设备发送控制指令;第二设备,用于基于处理设备发送的控制指令,完成对目标对象的跟踪。In a fourth aspect, a monitoring system is also provided. The monitoring system includes a first device, a second device, and a processing device, and the processing device communicates with the first device and the second device, respectively. Wherein, the first device is configured to acquire an image within a fixed monitoring range, and send the first image including the target object to the processing device; the processing device is configured to execute the first aspect or any of the first aspect based on the first image. The operation steps of the dome camera control method in a possible implementation manner include sending a control instruction to a second device; the second device is configured to complete the tracking of the target object based on the control instruction sent by the processing device.
其中,第二设备为球机。第一设备可以是枪机。Wherein, the second device is a ball machine. The first device may be a bolt action.
在一种可能的实现方式中,该监控系统还可以包括中心设备,处理设备,还用于获取目标对象的关键信息,并将关键信息发送给所述中心设备;中心设备,用于对关键信息进行分析和处理。In a possible implementation manner, the monitoring system may further include a central device, a processing device, which is further configured to acquire key information of the target object, and send the key information to the central device; the central device is used to monitor the key information analysis and processing.
第五方面,本申请提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面的方法的操作步骤。In a fifth aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer performs the operation steps of the methods of the above aspects.
第六方面,本申请提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面的方法的操作步骤。In a sixth aspect, the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the operation steps of the methods of the above aspects.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided by the above aspects, the present application may further combine to provide more implementation manners.
附图说明Description of drawings
图1为本实施例提供的一种适用球机控制的监控系统10的逻辑架构示意图;FIG. 1 is a schematic diagram of the logical architecture of a monitoring system 10 suitable for ball machine control provided in this embodiment;
图2为本实施例提供的一种监控系统10对目标人物的监控过程的示意图;FIG. 2 is a schematic diagram of a monitoring process of a target person by a monitoring system 10 provided in this embodiment;
图3为本实施例提供的一种球机控制方法的流程交互图;FIG. 3 is a flowchart interaction diagram of a ball machine control method provided in this embodiment;
图4为本实施例提供的一种球机状态流转示意图;FIG. 4 is a schematic diagram of state flow of a ball machine provided in this embodiment;
图5为本实施例提供的一种保存控制指令的指令队列的示意图;FIG. 5 is a schematic diagram of an instruction queue for saving control instructions according to the present embodiment;
图6为本实施例提供的一种中心区域判断的示意图;FIG. 6 is a schematic diagram of a center area judgment provided by the present embodiment;
图7为本实施例提供的一种基于PID计算移动速度的流程示意图;Fig. 7 is a kind of schematic flow chart of calculating moving speed based on PID provided by this embodiment;
图8为本实施例提供的一种球机控制装置的结构示意图;FIG. 8 is a schematic structural diagram of a ball machine control device provided in this embodiment;
图9为本实施例提供的一种球机控制设备的结构示意图。FIG. 9 is a schematic structural diagram of a ball machine control device provided in this embodiment.
具体实施方式detailed description
下面将结合附图,对本申请的技术方案进行描述。The technical solutions of the present application will be described below with reference to the accompanying drawings.
图1为本实施例中适用球机控制的监控系统10的逻辑架构示意图,如图1所示,该监控系统10包括:处理设备100、至少一个枪机200、至少一个球机300和中心设备400。其中,处理设备100能够分别和至少一个枪机200、至少一个球机300、中心设备400进行通信,接收枪机200或球机300采集的图像对应的数据信号,向球机300发送控制信号,实现对至少一个球机300的控制,并且将枪机200或球机300获取到的监控结果发送给中心设备400,由中心设备400对该监控结果进行分析和汇总。其中,监控结果包括目标对象的关键信息,如:目标人物的正脸图像,又如:目标车辆的车牌图像。其中,该处理设备100至少可以包括通信模块110和处理模块120,通信模块110用于实现与其他设备(如枪机200、球机300以及中心设备400)的通信,处理模块120用于根据中心设备400、枪机200和/或球机300发送的信号进行处理,得到适用于球机300的控制信号。枪机200至少可以包括:通信模块210、处理模块220和摄像机230,通信模块210用于实现与其他设备(如处理设备100)的通信;处理模块220用于对摄像机230输出的数据信号进行处理(如解码、解包、压缩、转换等);摄像机230用于采集枪机200对应区域的图像。球机300至少可以包括:通信模块310、处理模块320、摄像机330和云台340,通信模块310用于实现与其他设备(如处理设备100)的通信;处理模块320用于对摄像机330输出的数据信号以及处理设备100发送的控制信号进行处理;云台340用于支撑摄像机330,云台340中的步进电机341的转动能够带动摄像机330转动,摄像机330还具有变倍率的功能,所以,摄像机330用于对不同远近的物体进行不同角度的拍摄。中心设备400用于和多个处理设备100通信,对多个处理设备400发送的监控结果进行分析和汇总,实现对多个处理设备100所覆盖的区域的监控和管理。FIG. 1 is a schematic diagram of the logical architecture of a monitoring system 10 suitable for dome camera control in this embodiment. As shown in FIG. 1 , the monitoring system 10 includes: a processing device 100 , at least one bolt 200 , at least one dome 300 and a central device 400. The processing device 100 can communicate with at least one trigger 200, at least one dome 300, and the central device 400, respectively, receive data signals corresponding to images collected by the trigger 200 or the dome 300, and send control signals to the dome 300, Realize the control of at least one ball machine 300, and send the monitoring results obtained by the trigger 200 or the ball machine 300 to the central device 400, and the central device 400 analyzes and summarizes the monitoring results. Wherein, the monitoring result includes key information of the target object, such as: the frontal face image of the target person, and another example: the license plate image of the target vehicle. The processing device 100 may include at least a communication module 110 and a processing module 120. The communication module 110 is used to implement communication with other devices (such as the camera 200, the ball camera 300 and the central device 400), and the processing module 120 is used to communicate with other devices according to the central The signals sent by the device 400 , the trigger 200 and/or the dome machine 300 are processed to obtain control signals suitable for the dome machine 300 . The bolt 200 may at least include: a communication module 210 , a processing module 220 and a camera 230 . The communication module 210 is used to implement communication with other devices (such as the processing device 100 ); the processing module 220 is used to process the data signals output by the camera 230 (such as decoding, unpacking, compression, conversion, etc.); the camera 230 is used to capture the image of the corresponding area of the bolt 200 . The dome camera 300 may at least include: a communication module 310 , a processing module 320 , a camera 330 and a pan/tilt 340 . The communication module 310 is used to implement communication with other devices (such as the processing device 100 ); The data signal and the control signal sent by the processing device 100 are processed; the pan/tilt 340 is used to support the camera 330, the rotation of the stepping motor 341 in the pan/tilt 340 can drive the camera 330 to rotate, and the camera 330 also has the function of changing the magnification, so, The camera 330 is used to photograph objects of different distances from different angles. The central device 400 is configured to communicate with multiple processing devices 100 , analyze and summarize the monitoring results sent by the multiple processing devices 400 , and monitor and manage the areas covered by the multiple processing devices 100 .
处理设备100可以是具有计算能力的设备,例如,可以是至少一个枪机200和至少一个球机300对应的街边柜(也可以称为边缘小站),枪机200是指无法切换监控区域的监控设备,球机300是指可以切换监控区域以及可以改变倍率的监控设备,中心设备400可以是服务器,例如云端服务器。根据实际的部署需求,处理设备100可以对多个临近的监控杆上的监控设备进行控制和管理,也可以对一个监控杆上的部分或全部监控设备进行控制和管理。每个监控杆上可以包括一个枪机200和一个球机300,也可以包括多个枪机200和一个球机300,还可以包括多个枪机200和多个球机300,本申请中不对每个监控杆上包括的枪机200的数量和球机300的数量进行具体限定。The processing device 100 can be a device with computing capabilities, for example, it can be a street cabinet (also called an edge station) corresponding to at least one trigger 200 and at least one dome 300, and the trigger 200 refers to the monitoring area that cannot be switched. The dome camera 300 refers to a monitoring device that can switch the monitoring area and can change the magnification, and the central device 400 can be a server, such as a cloud server. According to actual deployment requirements, the processing device 100 may control and manage monitoring devices on multiple adjacent monitoring poles, and may also control and manage some or all monitoring devices on one monitoring pole. Each monitoring rod may include one trigger 200 and one ball machine 300, or multiple triggers 200 and one ball machine 300, and may also include multiple triggers 200 and multiple ball machines 300, which is not correct in this application. The number of triggers 200 and the number of ball machines 300 included on each monitoring rod are specifically limited.
可选地,监控系统10中,处理设备100也可以集成在其所管理的任意一个枪机200中或球机300中,例如:处理设备100可以集成在枪机200的处理模块220中或球机300的处理模块320中;又例如:处理设备100可以作为一个独立的模块集成在枪机200中或球机300中,该独立的模块仅用于实现处理设备100的功能,具体实现形式在本申请不作限定。为了 方便描述,本申请以处理设备100为与枪机200以及球机300独立的实体设备进行说明。Optionally, in the monitoring system 10, the processing device 100 can also be integrated into any one of the bolts 200 or the dome 300 managed by it. In the processing module 320 of the camera 300; for another example, the processing device 100 can be integrated in the gun camera 200 or the dome camera 300 as an independent module, and the independent module is only used to realize the function of the processing device 100. The specific implementation form is in This application is not limited. For the convenience of description, this application describes the processing device 100 as a separate entity device from the trigger 200 and the dome camera 300.
举例来说:对于监控系统10中,假设需要搜索目标人物,该目标人物显著的特征为穿着红色上衣,那么,监控系统10对目标人物的监控过程参见图2,可以包括:For example: in the monitoring system 10, it is assumed that a target person needs to be searched, and the distinctive feature of the target person is wearing a red shirt, then, the monitoring process of the target person by the monitoring system 10 is shown in FIG. 2, which may include:
S11,中心设备400生成并向其所连接的多个处理设备100发送任务指令,该任务指令中包括目标人物的特征信息,该特征信息用于指示目标人物的特征,例如,特征信息可以指示目标人物穿着红色上衣。S11, the central device 400 generates and sends a task instruction to the multiple processing devices 100 connected to it, where the task instruction includes feature information of the target person, and the feature information is used to indicate the feature of the target person. For example, the feature information can indicate the target person. The character is wearing a red shirt.
S12,处理设备100将所接收的任务指令进行处理,生成枪机200和球机300能够识别的请求指令,并将请求指令发送给受其控制的至少一个枪机200和至少一个球机300。S12, the processing device 100 processes the received task instruction, generates a request instruction that can be recognized by the trigger 200 and the ball camera 300, and sends the request instruction to at least one trigger 200 and at least one ball camera 300 controlled by it.
S13,处理设备100接收枪机200和球机300采集的图像,并进行目标检测和特征匹配,如果检测到的对象和目标对象匹配成功,则,确定检测到目标对象。S13, the processing device 100 receives the images collected by the trigger 200 and the dome camera 300, and performs target detection and feature matching. If the detected object and the target object are successfully matched, it is determined that the target object is detected.
其中,如果先检测到目标对象的图像来自枪机200,则检测过程可以包括:枪机200将目标对象的图像1发送给处理设备100,处理设备100通过目标检测算法在图像1中检测到至少一个对象后,对检测到的对象和目标对象进行特征匹配,将匹配成功的对象作为目标对象;目标对象在图像1中对应的检测框作为方形框1,该方形框1是指从图像1中进行抠图后得到的包括目标对象的图像。该情况下,处理设备100基于方形框1生成并向球机300发送返回预置点指令1,返回预置点指令1用于指示位于初始位置的球机300转向枪机200的监控范围,该返回预置点指令1中可以携带枪机200的标识(即预置点的标识)。Wherein, if it is first detected that the image of the target object comes from the trigger 200, the detection process may include: the trigger 200 sends the image 1 of the target object to the processing device 100, and the processing device 100 detects at least the image 1 through the target detection algorithm. After one object, perform feature matching on the detected object and the target object, and take the successfully matched object as the target object; The image including the target object obtained after matting. In this case, the processing device 100 generates based on the square frame 1 and sends the return to the preset point command 1 to the dome camera 300. The return to the preset point command 1 is used to instruct the dome camera 300 at the initial position to turn to the monitoring range of the trigger 200. The Returning to the preset point command 1 can carry the identification of the trigger 200 (ie, the identification of the preset point).
如果先检测到目标对象的图像来自球机300,则检测过程可以包括:球机300将目标对象的图像1’发送给处理设备100,处理设备100通过目标检测算法在图像1’中检测到至少一个对象后,对检测到的对象和目标对象进行特征匹配,将匹配成功的对象作为目标对象;对图像1’进行处理,得到图像1’中包括目标对象对应的方形框1’。该方形框1’是指从图像1中进行抠图后得到的包括目标对象的图像。If it is first detected that the image of the target object comes from the dome camera 300, the detection process may include: the dome camera 300 sends the image 1' of the target object to the processing device 100, and the processing device 100 detects at least the image 1' through the target detection algorithm. After one object, feature matching is performed between the detected object and the target object, and the successfully matched object is used as the target object; the image 1' is processed to obtain a square frame 1' corresponding to the target object in the image 1'. The square frame 1' refers to the image including the target object obtained after matting from the image 1.
需要说明的是,对图像进行抠图,具体可以是以图像中的目标对象的中心为原点,以预设长度为半径得到图像中包括目标对象的圆形区域,或者,也可以是以图像中的目标对象的中心为对角线的交点,得到的包括目标对象的矩形区域(即其他部分提及的方形框)。其中,圆形区域的半径或矩形区域的长宽的设定,需要使得得到的区域完全包括目标对象。为了方便描述,本实施例中以抠图得到方形框为例进行说明。It should be noted that, to cut out the image, specifically, the center of the target object in the image can be used as the origin, and the preset length is used as the radius to obtain the circular area including the target object in the image. The center of the target object is the intersection of the diagonal lines, resulting in a rectangular area including the target object (ie, the square box mentioned in other parts). Wherein, the setting of the radius of the circular area or the length and width of the rectangular area needs to make the obtained area completely include the target object. For the convenience of description, in this embodiment, a square frame obtained by cutout is taken as an example for description.
S14,球机300采集图像2并发送给处理设备100;S14, the dome camera 300 collects the image 2 and sends it to the processing device 100;
S15,处理设备100对图像2和方形框1(或方形框1’)进行匹配,如果匹配完成,则,生成图像2中包括目标对象的方形框2,触发球机300对目标对象进行跟踪。S15, the processing device 100 matches the image 2 with the square frame 1 (or the square frame 1'), and if the matching is completed, generates a square frame 2 including the target object in the image 2, and triggers the ball camera 300 to track the target object.
S16,处理设备100针对球机300采集的每个图像2都执行下述S17~S23,直到接收到处理设备100获取到包括目标人物的关键信息的图像2、运行超时或状态0变为异常状态中的空闲状态,执行下述S25。S16, the processing device 100 executes the following S17-S23 for each image 2 collected by the dome camera 300, until the image 2 including the key information of the target person acquired by the processing device 100 is received, the operation times out, or the state 0 becomes an abnormal state In the idle state, the following S25 is performed.
S17,处理设备100根据图像2、目标检测算法和预设的跟踪算法,得到跟踪成功与否的状态标志位。当该状态标志位指示跟踪成功时,还可以获得图像2中目标对象对应的方形框2的相关参数,例如方形框2对应的(x,y,w,h),其中,(x,y)为方形框2的中心点在图像2中的坐标值,w和h分别为方形框2的宽和高;S17, the processing device 100 obtains the status flag bit of whether the tracking is successful or not according to the image 2, the target detection algorithm and the preset tracking algorithm. When the status flag indicates that the tracking is successful, the relevant parameters of the square frame 2 corresponding to the target object in the image 2 can also be obtained, such as (x, y, w, h) corresponding to the square frame 2, where (x, y) is the coordinate value of the center point of the square frame 2 in the image 2, w and h are the width and height of the square frame 2, respectively;
S18,处理设备100根据状态标志位的变化情况,确定当前跟踪该目标对象属于的状态0,状态例如可以包括:正常状态和异常状态,其中,异常状态包括用于指示目标对象跟踪结果的信息。例如,异常状态包括可能丢失状态、确定丢失状态、可能找回状态和空闲状态。S18, the processing device 100 determines the state 0 to which the target object is currently being tracked according to the change of the state flag bit. The states may include, for example, a normal state and an abnormal state, wherein the abnormal state includes information used to indicate the tracking result of the target object. For example, abnormal states include a possible lost state, a certain lost state, a possible retrieved state, and an idle state.
S19,处理设备100判断状态0是否为正常状态,如果是,则执行S20,否则,执行S22;S19, the processing device 100 determines whether the state 0 is a normal state, and if so, executes S20, otherwise, executes S22;
S20,处理设备100根据球机300预设的倍率和比例积分微分(proportional integral derivative,PID)参数的对应关系,确定与当前的倍率1对应的PID参数:KP1、KI1和KD1,并根据下述公式(1)和公式(2)计算x方向上的移动速度Vpan和y方向上的移动速度Vtilt;并且,根据h占图像2总高度的比例,确定预设的倍率调整速度Vzoom的方向;S20, the processing device 100 determines the PID parameters corresponding to the current magnification 1: KP1, KI1 and KD1 according to the corresponding relationship between the preset magnification and proportional integral derivative (PID) parameters of the ball camera 300, and according to the following Formula (1) and formula (2) calculate the moving speed Vpan on the x direction and the moving speed Vtilt on the y direction; And, according to the ratio of h accounting for the total height of the image 2, determine the direction of the preset magnification adjustment speed Vzoom;
Figure PCTCN2021099895-appb-000001
Figure PCTCN2021099895-appb-000001
Figure PCTCN2021099895-appb-000002
Figure PCTCN2021099895-appb-000002
其中,Δx(t)、Δy(t)是t时刻采集的图像2的中心点(x0,y0)和方形框2的中心点(x,y)的偏差值。需要说明的是,计算出的V pan和V tilt是与步进电机341的固定转动档位对应的连续值,例如:步进电机341的转动速度范围为-1.0~1.0(数值的正负代表步进电机341的转动方向,绝对值代表转动速度),每0.1划分为1个转动档位,那么,步进电机341在两个方向上分别包括10个转动档位,计算出的V pan和V tilt的数值范围为-1.0~1.0。如果V pan=0.17,那么,步进电机341可以按照0.1或0.2的转动档位进行转动。需要说明的是,如果计算的V pan和V tilt的数值范围不在-1.0~1.0的范围,则,可以按照最大的转动档位执行,例如:计算得到V pan=1.2,那么,步进电机341可以按照1.0的转动档位进行转动。 Among them, Δx(t) and Δy(t) are the deviation values between the center point (x0, y0) of the image 2 collected at time t and the center point (x, y) of the square frame 2 . It should be noted that the calculated V pan and V tilt are continuous values corresponding to the fixed rotational gears of the stepping motor 341 . For example, the rotational speed of the stepping motor 341 ranges from -1.0 to 1.0 (positive and negative values represent The rotation direction of the stepper motor 341, the absolute value represents the rotation speed), and every 0.1 is divided into 1 rotation gear. Then, the stepper motor 341 includes 10 rotation gears in two directions respectively. The calculated V pan and The value of Vtilt ranges from -1.0 to 1.0. If V pan =0.17, then the stepper motor 341 can rotate according to the rotation gear of 0.1 or 0.2. It should be noted that, if the calculated value ranges of V pan and V tilt are not in the range of -1.0 to 1.0, then it can be executed according to the maximum rotation gear. For example, if V pan =1.2 is calculated, then the stepping motor 341 It can be rotated according to the rotation gear of 1.0.
S21,处理设备100生成移动指令1,该移动指令1中包括(V pan,V tilt,V zoom),且包括强制执行标志位,例如,该强制执行标志位的值可以取0,用于指示移动指令1不是强制执行的操作,可以被丢弃或覆盖指令队列中移动指令; S21, the processing device 100 generates a movement instruction 1, which includes (V pan , V tilt , V zoom ) and includes a forced execution flag. For example, the value of the forced execution flag may be 0, which is used to indicate Move instruction 1 is not a mandatory operation, and can be discarded or overwritten with move instructions in the instruction queue;
S22,处理设备100基于具体的异常状态,生成停止指令1、降低倍率指令1或返回预置点指令2。停止指令1、降低倍率指令1和返回预置点指令2中均包括强制执行标志位,例如,停止指令1、降低倍率指令1和返回预置点指令2的强制执行标志位的值可以取1,用于指示这些指令是需要强制执行的操作,不能丢弃;S22 , the processing device 100 generates a stop command 1 , a magnification reduction command 1 or a return to preset point command 2 based on the specific abnormal state. The stop command 1, the magnification reduction command 1 and the return to preset point command 2 all include mandatory execution flags. For example, the value of the mandatory execution flag of the stop command 1, the magnification reduction command 1 and the return to preset command 2 can be set to 1. , used to indicate that these instructions are operations that need to be enforced and cannot be discarded;
S23,处理设备100周期性的向球机300发送控制指令,以实现对目标对象的跟踪,该周期大于步进电机341的激励响应时延T1;S23, the processing device 100 periodically sends a control command to the ball camera 300 to realize the tracking of the target object, and the period is greater than the excitation response time delay T1 of the stepping motor 341;
S24,球机300基于接收到的控制指令,对步进电机341和/或摄像机330进行控制,以跟踪目标对象。S24, the dome camera 300 controls the stepping motor 341 and/or the camera 330 based on the received control instruction to track the target object.
S25,处理设备100生成并向球机300发送返回预置点指令,控制球机300返回初始位置,其中,关键信息包括目标对象的标识信息,例如,当目标对象为目标人物时,关键信息可以包括目标人物的正脸图像;S25, the processing device 100 generates and sends an instruction to return to the preset point to the dome machine 300 to control the dome machine 300 to return to the initial position, wherein the key information includes the identification information of the target object, for example, when the target object is the target person, the key information can be Including the frontal face image of the target person;
S26,处理设备100将包括目标人物的关键信息的图像2发送给中心设备300,中心设备300对图像2中目标人物的关键信息进行分析和汇总。S26 , the processing device 100 sends the image 2 including the key information of the target person to the central device 300 , and the central device 300 analyzes and summarizes the key information of the target person in the image 2 .
需要说明的是,触发球机300开始跟踪目标对象的方式具体可以包括:It should be noted that the specific manner of triggering the dome camera 300 to start tracking the target object may include:
第一种情况,可以是处理设备100从其他监控设备(例如枪机200)发送的图像中检测到目标对象,再由处理设备100触发球机300开始跟踪目标对象;In the first case, it may be that the processing device 100 detects the target object from the images sent by other monitoring devices (for example, the trigger 200), and then the processing device 100 triggers the dome camera 300 to start tracking the target object;
第二种情况,也可以是处理设备100从球机300自己发送的图像中检测到目标对象,再由处理设备100触发球机300开始跟踪目标对象。In the second case, the processing device 100 may also detect the target object from the image sent by the dome camera 300, and then the processing device 100 triggers the dome camera 300 to start tracking the target object.
触发球机300跟踪目标对象的方式在本申请中不作具体限定,下文中为了方便描述,以第一种情况的触发方式为例进行说明。The manner of triggering the ball machine 300 to track the target object is not specifically limited in this application. For the convenience of description, the following description takes the triggering manner of the first case as an example.
需要说明的是,图1所示的系统架构仅仅是为了更好的说明本申请所提供的球机控制方法所提供的系统架构的示例,图2所示的监控系统对目标人物的监控过程仅仅是为了更好的说明本申请所提供的球机控制方法的整体流程提供的一个场景示例,并不构成对本申请实施 例的限定。It should be noted that the system architecture shown in FIG. 1 is only an example of the system architecture provided by the ball machine control method provided in this application, and the monitoring process of the target person by the monitoring system shown in FIG. This is a scenario example provided to better illustrate the overall flow of the ball machine control method provided by the present application, and does not constitute a limitation to the embodiments of the present application.
基于上述系统架构,本申请提供一种球机控制方法,处理设备在获取待跟踪的目标对象的第一图像时,能够根据第一设备和第二设备(即,球机)的预设关联关系,控制第二设备中云台的步进电机工作,以驱动该第二设备转动到第一设备对应的监控区域,这样,第二设备中的摄像机即可采集到包括目标对象的第二图像并发送给处理设备,处理设备能够基于第二设备发来的第二图像,生成对球机的控制指令,并且周期性的向所述云台发送控制指令,以控制所述云台中的步进电机工作,实现对目标对象的跟踪。可见,该方法考虑到球机中的摄像机的转动是通过步进电机的转动而带动的,步进电机存在一定的激励响应时延,球机中摄像机采集图像的过程是离散的这些特点,通过预设发送控制指令的周期,处理设备周期性向具有可转动、可变倍率的球机发送控制指令,有效的克服了目前在控制球机的摄像机转动时不够平滑稳定的缺点,使得球机的转动过程不再卡顿,实现对目标对象平滑稳定的跟踪,从而提升球机的使用体验。Based on the above system architecture, the present application provides a dome camera control method. When the processing device acquires the first image of the target object to be tracked, it can be based on the preset association relationship between the first device and the second device (ie, the dome camera). , control the stepping motor of the pan/tilt in the second device to work to drive the second device to rotate to the monitoring area corresponding to the first device, so that the camera in the second device can capture the second image including the target object and Send to the processing device, the processing device can generate control instructions for the dome camera based on the second image sent by the second device, and periodically send control instructions to the PTZ to control the stepping motor in the PTZ Work to achieve the tracking of the target object. It can be seen that this method considers that the rotation of the camera in the dome camera is driven by the rotation of the stepper motor, the stepper motor has a certain excitation response time delay, and the process of capturing images by the camera in the dome camera is discrete. The cycle of sending control commands is preset, and the processing device periodically sends control commands to the dome camera with rotatable and variable magnification, which effectively overcomes the shortcomings of the current lack of smoothness and stability when controlling the rotation of the dome camera. The process is no longer stuck, and smooth and stable tracking of the target object is achieved, thereby improving the use experience of the dome camera.
作为一种可能的实施例,被触发跟踪目标对象的球机,其摄像机通常会等时间间隔的采集图像,并将图像发送给处理设备。其中,等时间间隔与摄像机采集图像的频率相关,例如:假设摄像机采集图像的频率为每秒25帧,则,该摄像机采集图像的时间间隔为40毫秒。一种情况下,摄像机每采集一帧图像,就会将该图像发送给处理设备,由处理设备通过目标检测算法、跟踪算法等的算法的处理,生成对应的一个控制指令。另一种情况下,处理设备也可以对摄像机采集的图像进行跳帧处理,如:摄像机每采集一帧图像,就会将该图像发送给处理设备,而处理设备每接收到五帧图像时对第五帧图像进行处理,生成对应的一个控制指令;又如:摄像机每采集五帧图像,将第五帧图像发送给处理设备,处理设备对接收到的每帧图像进行处理,生成对应的一个控制指令。As a possible embodiment, the camera of the dome camera that is triggered to track the target object usually collects images at equal time intervals, and sends the images to the processing device. The equal time interval is related to the frequency at which the camera collects images. For example, if the frequency at which the camera collects images is 25 frames per second, the time interval at which the camera collects images is 40 milliseconds. In one case, every time the camera collects a frame of image, the image will be sent to the processing device, and the processing device will generate a corresponding control command through the processing of algorithms such as target detection algorithm and tracking algorithm. In another case, the processing device can also perform frame skipping processing on the images captured by the camera. For example, every time the camera captures one frame of image, the image will be sent to the processing device, and the processing device will send the image to the processing device every time it receives five frames of images. The fifth frame of image is processed to generate a corresponding control command; for another example: every five frames of images are collected by the camera, the fifth frame of image is sent to the processing device, and the processing device processes each received frame of image and generates a corresponding one. Control instruction.
作为另一种可能的实施例,处理设备周期性的向球机发送控制指令,在一个发送指令的周期内,如果处理设备没有积压的强制执行指令(例如:停止指令、降低倍率指令或返回预置点指令),且该周期内生成均为移动指令,则,只保留最新生成的移动指令,等到发送指令的时刻,将最新生成的移动指令发送给球机的云台,以便球机能够按照目标对象在最新采集的图像中的位置适应性的对球机的摄像机进行调整,实现对目标对象快速有效的跟踪。如果处理设备内有未发送的强制执行指令或该周期内生成了强制执行指令,则,所有的强制执行指令均需要按照生成时间的早晚被保存,而该周期内生成的移动指令均被覆盖或丢弃,等到发送指令的时刻,将积压的最早生成的强制指令发送给球机的云台,以便球机能够按照出现异常的顺序有序的对球机的摄像机进行调整,使得球机对目标对象的跟踪能够尽可能的回归正常状态。需要说明的是,该发送控制指令的周期需要大于步进电机的激励响应时延(即,输入步进电机的激励和该步进电机输出响应之间的时间间隔),与摄像机采集图像的频率无关。As another possible embodiment, the processing device periodically sends control commands to the dome camera. In a cycle of sending commands, if the processing device has no backlog of mandatory execution commands (for example: stop command, reduce magnification command, or return to the preset command) Positioning command), and all the movement commands are generated in this cycle, then only the latest generated movement command will be kept, and when the command is sent, the latest generated movement command will be sent to the PTZ of the dome camera, so that the dome camera can follow the The position of the target object in the newly collected image can be adjusted adaptively to the camera of the dome camera to achieve fast and effective tracking of the target object. If there is an unsent mandatory execution instruction in the processing device or a mandatory execution instruction is generated in this cycle, all the mandatory execution instructions need to be saved according to the generation time, and the movement instructions generated in this cycle are overwritten or Discard, wait until the moment of sending the command, and send the backlog of the earliest generated mandatory command to the dome camera's PTZ, so that the dome camera can adjust the camera of the dome camera in an orderly manner according to the abnormal order, so that the dome camera can adjust the target object. The tracking can return to the normal state as much as possible. It should be noted that the cycle of sending the control command needs to be greater than the excitation response delay of the stepping motor (that is, the time interval between the excitation of the input stepping motor and the output response of the stepping motor), which is different from the frequency at which the camera captures images. It doesn't matter.
接下来,以图1所示的监控系统10为例,结合图3详细介绍本申请所提供的球机控制方法,该方法应用于监控系统10中的处理设备100。如图3所示,该方法包括:Next, taking the monitoring system 10 shown in FIG. 1 as an example, the ball camera control method provided by the present application is described in detail with reference to FIG. 3 , and the method is applied to the processing device 100 in the monitoring system 10 . As shown in Figure 3, the method includes:
S301,获取监控系统10中枪机200发送的第一图像,所述第一图像中包括待跟踪的目标对象。S301: Acquire a first image sent by the trigger 200 in the monitoring system 10, where the first image includes the target object to be tracked.
需要说明的是,S301仅是示例性的描述,具体实现时,处理设备100仅需要获取待跟踪的目标对象,从而触发球机300对目标对象进行跟踪。其中,获取目标对象的方式,可以基于监控系统中枪机200采集的第一图像中获取,也可以从第一视频中获取,还可以基于用户的手动操作触发,在本实施例中不作具体限定。下文中为了方便描述,以从第一图像中获取 目标对象为例进行说明。It should be noted that S301 is only an exemplary description, and in specific implementation, the processing device 100 only needs to acquire the target object to be tracked, thereby triggering the dome camera 300 to track the target object. The method of acquiring the target object may be acquired based on the first image collected by the bolt 200 in the monitoring system, or acquired from the first video, or may be triggered based on the user's manual operation, which is not specifically limited in this embodiment. . In the following, for the convenience of description, the acquisition of the target object from the first image is taken as an example for description.
其中,枪机200可以指代该监控系统10中能够和处理设备100进行通信的任何监控设备。本实施例中考虑到枪机能够清晰的监控较大的范围,所以,选择枪机200和球机300的组合提供智能、全面的监控服务。The bolt 200 may refer to any monitoring device in the monitoring system 10 that can communicate with the processing device 100 . In this embodiment, considering that the trigger can clearly monitor a large range, the combination of the trigger 200 and the ball camera 300 is selected to provide an intelligent and comprehensive monitoring service.
具体实现时,当监控系统10根据实际需求,需要从监控中调取具有某个或某些特征的目标对象时,该监控系统10中的处理设备100能够获取到任务指令,该任务指令中包括目标对象的特征信息。特征信息是指目标对象具有的特征中能够显著和其他对象加以区分的特征,例如:如果目标对象是人,则,目标对象的特征信息可以是该人的衣着特征,如,穿红色上衣;又例如:如果目标对象是车辆,则,目标对象的特征信息可以是该车辆的型号、颜色等特征,如,黑色小型轿车。During specific implementation, when the monitoring system 10 needs to retrieve a target object with certain or certain characteristics from monitoring according to actual needs, the processing device 100 in the monitoring system 10 can obtain a task instruction, which includes Feature information of the target object. Feature information refers to the features of the target object that can be significantly distinguished from other objects. For example, if the target object is a person, the feature information of the target object can be the person's clothing features, such as wearing a red shirt; For example, if the target object is a vehicle, the feature information of the target object may be the model, color and other features of the vehicle, for example, a small black car.
作为一个示例,任务指令可以在监控系统10的中心设备400上触发生成,并由中心设备400发送给处理设备100的,那么,处理设备100可以将该任务翻译为枪机200和球机300能够识别的请求指令后,将请求指令发送给处理设备100负责控制的枪机200和球机300,请求指令中包括目标对象的特征信息。该示例适用于目标对象可能的活动范围较大或目标对象可能的活动范围不确定的情况,中心设备400能够将任务指令批量的发布到监控系统10中部分或全部处理设备100上,以便该监控系统10中的海量监控设备能够在监控系统10所覆盖的大部分或全部监控区域对目标对象进行搜索和监控,无需在各个处理设备100上进行分别配置和触发,一定程度节约了人力和物力,提高了监控服务的效率。As an example, the task instruction can be triggered and generated on the central device 400 of the monitoring system 10 and sent to the processing device 100 by the central device 400. Then, the processing device 100 can translate the task into the ability of the bolt 200 and the dome 300 to be able to After identifying the request command, the request command is sent to the trigger 200 and the ball camera 300 controlled by the processing device 100, and the request command includes the feature information of the target object. This example is suitable for situations where the possible range of activity of the target object is large or the possible range of activity of the target object is uncertain. The central device 400 can issue task instructions to some or all of the processing devices 100 in the monitoring system 10 in batches, so that the monitoring The mass monitoring devices in the system 10 can search and monitor the target objects in most or all of the monitoring areas covered by the monitoring system 10, without the need for separate configuration and triggering on each processing device 100, saving manpower and material resources to a certain extent, Improve the efficiency of monitoring services.
作为另一个示例,任务指令也可以是监控系统10的处理设备100上直接生成的能够被枪机200和球机300识别的请求指令,那么,处理设备100可以将该请求指令发送给处理设备100负责控制的枪机200和球机300,请求指令中包括目标对象的特征信息。该示例适用于目标对象可能的活动范围已经确定的情况,能够在负责该活动范围内监控设备的处理设备100上配置请求指令,以便该对应的监控设备能够快速在较小的覆盖范围内对目标对象进行搜索和监控,无需由中心设备400向对应的处理设备100发布任务请求也无需处理设备100再对任务请求进行处理,节约了监控系统10中的网络资源,提高了监控服务的效率。As another example, the task instruction may also be a request instruction that is directly generated on the processing device 100 of the monitoring system 10 and can be recognized by the trigger 200 and the dome camera 300. Then, the processing device 100 can send the request instruction to the processing device 100. The trigger 200 and the dome 300 responsible for control include the characteristic information of the target object in the request command. This example is applicable to the situation where the possible range of activities of the target object has been determined, and a request instruction can be configured on the processing device 100 responsible for the monitoring device within the range of activities, so that the corresponding monitoring device can quickly monitor the target in a small coverage area. To search and monitor objects, there is no need for the central device 400 to issue a task request to the corresponding processing device 100 or for the processing device 100 to process the task request, which saves network resources in the monitoring system 10 and improves the efficiency of monitoring services.
其中,枪机200向处理设备100发送第一图像后,处理设备100的处理过程可以包括:处理设备100对该第一图像进行目标检测,检测到至少一个对象;处理设备100提取所述至少一个对象的特征信息,并将所述至少一个对象的特征信息和目标对象的特征信息进行匹配,如果匹配成功,则,将该特征信息对应的对象确定为目标对象;接着,将第一图像中能够完全包住目标对象的检测框作为第一图像中包括目标对象的方形框,该方形框可以作为后续进行目标对象跟踪的基础数据。After the trigger 200 sends the first image to the processing device 100, the processing process of the processing device 100 may include: the processing device 100 performs target detection on the first image, and detects at least one object; the processing device 100 extracts the at least one object The feature information of the object, and the feature information of the at least one object and the feature information of the target object are matched, if the matching is successful, the object corresponding to the feature information is determined as the target object; The detection frame that completely encloses the target object is used as a square frame including the target object in the first image, and the square frame can be used as basic data for subsequent tracking of the target object.
需要说明的是,S301之后,处理设备100对获取到的第一图像进行抠图处理,得到的包括目标对象的方形框。该方形框是一个图像。It should be noted that, after S301, the processing device 100 performs matting processing on the acquired first image to obtain a square frame including the target object. The square box is an image.
需要说明的是,各接收到请求指令的监控设备(包括枪机200和球机300)均将自身采集的图像发送给处理设备100进行目标检测和特征匹配。It should be noted that each monitoring device (including the trigger 200 and the dome camera 300 ) that has received the request instruction sends the images collected by itself to the processing device 100 for target detection and feature matching.
S302,向球机300发送控制指令1,控制指令1用于控制球机300中云台340的步进电机341工作,以驱动球机300转动到枪机200对应的监控区域。S302 , send a control command 1 to the dome camera 300 , and the control command 1 is used to control the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to work, so as to drive the dome camera 300 to rotate to the monitoring area corresponding to the trigger 200 .
考虑到球机300的摄像机330能够调节拍摄的角度和倍率,适用于处于活动状态的目标对象的跟踪,所以,在处理设备100获得第一图像中包括目标对象的方形框后,处理设备100可以生成并向球机300发送控制指令1,用于控制球机300中云台340的步进电机341工作,通过步进电机341带动摄像头330转动,使得摄像头330面向枪机200对应的监控区域。其 中,摄像头330面向枪机200对应的监控区域,可以是指摄像头330的监控区域完全覆盖枪机200的监控范围。Considering that the camera 330 of the dome camera 300 can adjust the shooting angle and magnification, it is suitable for the tracking of the target object in the active state. Therefore, after the processing device 100 obtains the square frame including the target object in the first image, the processing device 100 can Generate and send the control command 1 to the dome camera 300 to control the stepper motor 341 of the gimbal 340 in the dome camera 300 to work, and drive the camera 330 to rotate through the stepper motor 341, so that the camera 330 faces the monitoring area corresponding to the gun 200. Wherein, the camera 330 faces the monitoring area corresponding to the gun 200, which may mean that the monitoring area of the camera 330 completely covers the monitoring range of the gun 200.
作为一个示例,S302具体可以包括:处理设备100获得第一图像中包括目标对象的方形框后,即可确定目标对象处于枪机200的监控范围内,从而,生成并向球机300发送返回预置点指令1,该返回预置点指令1中包括枪机200的标识,用于指示球机300中云台340的步进电机341转动到该标识对应的枪机200的监控范围内。一种情况下,球机300可以记录枪机200的位置,那么,球机300按照返回预置点指令1转动到该枪机200的位置即停止转动。另一种情况下,球机300中保存有球机300和枪机200的位置关系,那么,球机300根据该返回预置点指令1中枪机200的标识以及本地保存的枪机200和球机300的位置关系,确定球机300转向枪机200的覆盖范围需要转动的转动参数,从而基于转动参数转动转向枪机200的监控区域。As an example, S302 may specifically include: after the processing device 100 obtains the square frame including the target object in the first image, it can determine that the target object is within the monitoring range of the camera 200, so as to generate and send a return preview to the camera 300. Set point instruction 1, the return preset point instruction 1 includes the logo of the trigger 200, which is used to instruct the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to rotate to the monitoring range of the trigger 200 corresponding to the logo. In one case, the dome camera 300 can record the position of the trigger 200, then, the dome camera 300 rotates to the position of the trigger 200 according to the return to preset point command 1, and then stops rotating. In another case, the positional relationship between the dome machine 300 and the trigger 200 is stored in the dome machine 300. Then, the dome machine 300 returns to the preset point command 1 according to the identification of the trigger 200 and the locally saved trigger 200 and trigger 200. The positional relationship of the dome camera 300 determines the rotation parameters that need to be rotated for the dome camera 300 to turn to the coverage area of the trigger 200, so as to rotate the monitoring area of the steering trigger 200 based on the rotation parameters.
作为另一个示例,S302中也可以基于预设的枪机200和球机300的位置关系使得球机300转动到枪机200的监控区域。例如:处理设备100中可以预设有其负责的所有监控设备之间的位置关系,包括枪机200和球机300的位置关系,那么,S302具体可以包括:处理设备100得到第一图像后,即可确定目标对象处于枪机200的监控范围内,从而,基于枪机200和球机300的位置关系,确定球机300转向枪机200的覆盖范围需要转动的转动参数;接着,处理设备100可以根据所确定的转动参数生成并向球机300发送移动指令1,该移动指令1中包括转动参数,用于指示球机300中云台340的步进电机341按照该转动参数工作;如此,球机300中的云台340对控制指令1进行解析,获取转动参数,并且云台340的步进电机341基于转动参数转动,带动摄像机330转向枪机200的监控范围。As another example, in S302 , the dome camera 300 may also be rotated to the monitoring area of the trigger 200 based on the preset positional relationship between the trigger 200 and the dome 300 . For example, the processing device 100 may be preset with the positional relationship between all monitoring devices it is responsible for, including the positional relationship between the trigger 200 and the dome camera 300, then, S302 may specifically include: after the processing device 100 obtains the first image, It can be determined that the target object is within the monitoring range of the trigger 200, thus, based on the positional relationship between the trigger 200 and the dome 300, determine the rotation parameters that the dome 300 needs to rotate to turn to the coverage of the trigger 200; then, the processing device 100 The movement command 1 can be generated and sent to the dome camera 300 according to the determined rotation parameters, and the movement command 1 includes the rotation parameters to instruct the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to work according to the rotation parameters; in this way, The pan/tilt 340 in the dome camera 300 parses the control command 1 to obtain rotation parameters, and the stepping motor 341 of the pan/tilt 340 rotates based on the rotation parameters to drive the camera 330 to turn to the monitoring range of the gun 200 .
上述转动参数可以是转动的角度和方向,例如:逆时针转动90度;或者,转动参数也可以是转动速度和转动时间,例如:以0.1的转动档位转动9秒。The above-mentioned rotation parameters can be the angle and direction of rotation, for example, rotate 90 degrees counterclockwise; or, the rotation parameters can also be the rotation speed and rotation time, for example, rotate at a rotation gear of 0.1 for 9 seconds.
可见,球机300转动到枪机200对应的监控区域,能够采集到包括目标对象的图像,为实现对目标对象的跟踪,从而获得目标对象的关键信息提供了前提条件。It can be seen that when the dome camera 300 rotates to the monitoring area corresponding to the trigger 200, an image including the target object can be collected, which provides a prerequisite for tracking the target object and obtaining key information of the target object.
S303,基于球机300中摄像机330采集的第二图像,周期性的向云台340发送控制指令,该控制指令用于控制云台340中的步进电机341工作,以跟踪目标对象。S303 , based on the second image collected by the camera 330 in the dome camera 300 , periodically send a control command to the pan-tilt 340 , where the control command is used to control the stepping motor 341 in the pan-tilt 340 to work to track the target object.
应理解,当球机300转向枪机200的监控区域时,该球机300的摄像机330可以拍摄到枪机200的监控区域内的目标对象。此时,处理设备100对球机300发送的首帧第二图像进行目标检测和特征匹配,以确定该第二图像中包括目标对象时,触发该球机300对该目标对象进行跟踪。其中,处理设备100对首帧第二图像进行特征匹配可以是将第二图像和第一图像(即枪机200采集的图像中包括目标对象的方形框)进行匹配。如果球机300开始对目标对象进行跟踪,则,该球机300可以将之后待处理的每帧第二图像发送给处理设备100,由处理设备100执行S303以控制球机300对目标对象的跟踪。It should be understood that when the dome camera 300 turns to the monitoring area of the gun 200 , the camera 330 of the dome 300 can photograph the target object in the monitoring area of the gun 200 . At this time, the processing device 100 performs target detection and feature matching on the first frame of the second image sent by the dome camera 300, and when it is determined that the second image includes a target object, the dome camera 300 is triggered to track the target object. The feature matching performed by the processing device 100 on the first frame of the second image may be to match the second image with the first image (ie, the square frame including the target object in the image collected by the gun machine 200 ). If the ball camera 300 starts to track the target object, the ball camera 300 can send the second image of each frame to be processed to the processing device 100, and the processing device 100 executes S303 to control the ball camera 300 to track the target object .
具体实现时,处理设备100中包括完整的球机控制流程,该流程具体可以参见图2对应的S11~S26的相关描述。During specific implementation, the processing device 100 includes a complete ball machine control flow, and for details of the flow, please refer to the relevant descriptions of S11 to S26 corresponding to FIG. 2 .
需要说明的是,一种情况下,处理设备100中对第二图像进行处理的频率可以与摄像机330采集第二图像的频率一致,例如:摄像机330每40毫秒采集一帧第二图像,并将采集到的第二图像发送给处理设备100,那么,处理设备100每40毫秒对接收的一帧第二图像进行处理。或者,另一种情况下,处理设备100中对第二图像进行处理的频率也可以与摄像机330采集第二图像的频率存在一定的倍数关系,例如:摄像机330每40毫秒采集一帧第二图像,并将采集到的第二图像发送给处理设备100,而处理设备100每200毫秒对最新接收的一帧 第二图像进行处理;或者,摄像机330每40毫秒采集一帧第二图像,但每200毫秒将最新采集到的一帧第二图像发送给处理设备100,处理设备100每200毫秒对接收的一帧第二图像进行处理。It should be noted that, in one case, the frequency of processing the second image in the processing device 100 may be consistent with the frequency of collecting the second image by the camera 330, for example, the camera 330 collects a second image every 40 milliseconds, and After the collected second image is sent to the processing device 100, the processing device 100 processes the received second image every 40 milliseconds. Or, in another case, the frequency of processing the second image in the processing device 100 may also have a certain multiple relationship with the frequency at which the camera 330 collects the second image, for example, the camera 330 collects one frame of the second image every 40 milliseconds , and send the collected second image to the processing device 100, and the processing device 100 processes the latest received second image every 200 milliseconds; or, the camera 330 collects a second image every 40 milliseconds, but every 200 milliseconds In 200 milliseconds, the newly collected frame of the second image is sent to the processing device 100, and the processing device 100 processes the received second image every 200 milliseconds.
需要说明的是,处理设备100中预设发送控制指令2的周期,该周期大于步进电机341的激励响应时延即可。It should be noted that the period for sending the control command 2 is preset in the processing device 100 , and the period may be greater than the excitation response time delay of the stepping motor 341 .
具体实现时,S303的实现过程包括:S3031,处理设备100根据目标检测算法、跟踪算法对第二图像进行处理,确定第二图像中是否包括目标对象,如果包括,则确定当前处于正常状态,如果不包括,则确定当前处于异常状态;S3032,处理设备100根据当前所处的状态,生成对应的控制指令2;S3033,处理设备100根据预设规则周期性的向球机300发送控制指令2。其中,第二图像中包括目标对象,可以包括第二图像中包括目标对象的方形框的置信度大于预设的置信度阈值,以及第二图像中未完整的检测到第二图像。When specifically implemented, the implementation process of S303 includes: S3031, the processing device 100 processes the second image according to the target detection algorithm and the tracking algorithm, and determines whether the second image includes the target object, and if it does, it is determined that it is currently in a normal state, if If not included, it is determined that it is currently in an abnormal state; S3032, the processing device 100 generates a corresponding control instruction 2 according to the current state; S3033, the processing device 100 periodically sends the control instruction 2 to the ball machine 300 according to a preset rule. Wherein, the second image includes the target object, which may include that the confidence of the square frame including the target object in the second image is greater than a preset confidence threshold, and the second image is incompletely detected in the second image.
本实施例中,为了实现更加高效和有序的球机控制,对于S3031中处理设备100将球机300当前所处的状态细分为初始状态、正常状态、异常状态和空闲状态,其中,异常状态又按照实际的跟踪情况划分为:可能丢失状态、确定丢失状态和可能找回状态。In this embodiment, in order to achieve more efficient and orderly control of the dome machine, the processing device 100 in S3031 subdivides the current state of the dome machine 300 into an initial state, a normal state, an abnormal state and an idle state, wherein the abnormal state The state is divided into: possible loss state, definite loss state and possible recovery state according to the actual tracking situation.
可以形象的理解为,处理设备100中具有如图4所示的状态流转图,参见图4,当处理设备100被触发跟踪目标对象时,对应的状态为初始状态0,此时,如果处理设备100接收的第二图像1中包括目标对象,则,确定当前对应的状态变为正常状态1;如果处理设备100接收的第二图像1中不包括目标对象,则,确定当前对应的状态变为可能丢失状态2。进入正常状态1后,如果处理设备100接收的第二图像2中包括目标对象,则,确定当前对应的状态保持正常状态1;一旦处理设备100接收的第二图像2中不包括目标对象,则,确定当前对应的状态变为可能丢失状态2。进入可能丢失状态2后,一旦处理设备100在预设时间t1内接收到包括目标对象的第二图像3,则,确定当前对应的状态变为正常状态1;如果处理设备100在预设时间t1内接收到任意一帧第二图像3中不包括目标对象,则,确定当前对应的状态保持可能丢失状态2;如果处理设备100到达预设时间t1,接收的第二图像3中都不包括目标对象,则,确定当前对应的状态变为确定丢失状态3。进入确定丢失状态3后,一旦处理设备100在预设时间t2内接收到包括目标对象的第二图像4,则,确定当前对应的状态变为可能找回状态4;如果处理设备100在预设时间t2内接收到任意一帧第二图像4中不包括目标对象,则,确定当前对应的状态保持确定丢失状态3;如果处理设备100到达预设时间t2,接收的第二图像4中都不包括目标对象,则,确定当前对应的状态变为确定空闲状态5。进入可能找回状态4后,一旦处理设备100在预设时间t3内接收到不包括目标对象的第二图像5,则,确定当前对应的状态变为确定丢失状态3;如果处理设备100在预设时间t3内接收到任意一帧第二图像5中包括目标对象,则,确定当前对应的状态保持可能找回状态4;如果处理设备100到达预设时间t3,接收的第二图像5中都包括目标对象,则,确定当前对应的状态变为正常状态1。从确定丢失状态3进入空闲状态5,可以认为对目标对象的跟踪彻底失败,此时,处理设备100可以向球机300发送退出指令,以指示球机300停止对目标对象的跟踪;并且,处理设备100还可以向中心设备400发送跟踪失败通知,用以告知中心设备400对目标对象的跟踪失败。It can be visually understood that the processing device 100 has a state flow diagram as shown in FIG. 4 . Referring to FIG. 4 , when the processing device 100 is triggered to track the target object, the corresponding state is the initial state 0. At this time, if the processing device If the second image 1 received by the processing device 100 includes the target object, it is determined that the current corresponding state becomes the normal state 1; if the second image 1 received by the processing device 100 does not include the target object, then it is determined that the current corresponding state becomes the normal state 1. State 2 may be lost. After entering the normal state 1, if the second image 2 received by the processing device 100 includes the target object, it is determined that the current corresponding state remains the normal state 1; once the second image 2 received by the processing device 100 does not include the target object, then , it is determined that the current corresponding state becomes the possible loss state 2. After entering the possible loss state 2, once the processing device 100 receives the second image 3 including the target object within the preset time t1, it is determined that the current corresponding state becomes the normal state 1; If any frame of the second image 3 is received within a period of time that does not include the target object, it is determined that the current corresponding state remains in the possible loss state 2; if the processing device 100 reaches the preset time t1, the received second image 3 does not include the target object object, then it is determined that the current corresponding state becomes the determined loss state 3. After entering the determined loss state 3, once the processing device 100 receives the second image 4 including the target object within the preset time t2, it is determined that the current corresponding state becomes possible to retrieve the state 4; if the processing device 100 is in the preset time t2 If any frame of the second image 4 is received within the time t2 and does not include the target object, then it is determined that the current corresponding state remains the determined loss state 3; if the processing device 100 reaches the preset time t2, neither of the received second images 4 If the target object is included, it is determined that the current corresponding state becomes the determined idle state 5 . After entering the possible retrieval state 4, once the processing device 100 receives the second image 5 that does not include the target object within the preset time t3, it is determined that the current corresponding state becomes the determined loss state 3; Assuming that the target object is included in any frame of the second image 5 received within the time t3, it is determined that the current corresponding state remains the possible retrieval state 4; if the processing device 100 reaches the preset time t3, the received second image 5 is all in the state 4. If the target object is included, it is determined that the current corresponding state becomes the normal state 1. From the determined loss state 3 to the idle state 5, it can be considered that the tracking of the target object has completely failed. At this time, the processing device 100 can send an exit instruction to the dome camera 300 to instruct the dome camera 300 to stop tracking the target object; and, processing The device 100 may also send a tracking failure notification to the central device 400 to inform the central device 400 that the tracking of the target object fails.
如果确定球机300处于正常状态1,那么,处理设备100可以根据下述图7所示的方法计算调整速度,S3032中生成的控制指令2是基于调整速度生成的移动指令,移动指令中包括调整速度。相比于移动指令中包括调整角度,以速度进行摄像机监控画面的调整使得步进电机341的转动更加顺畅,从而确保对目标对象的跟踪能够更加细致和平滑。If it is determined that the ball machine 300 is in the normal state 1, the processing device 100 can calculate the adjustment speed according to the method shown in FIG. 7 below. The control command 2 generated in S3032 is a movement command generated based on the adjustment speed, and the movement command includes the adjustment speed. speed. Compared with adjusting the angle included in the moving command, adjusting the monitoring image of the camera at the speed makes the rotation of the stepping motor 341 smoother, thereby ensuring that the tracking of the target object can be more detailed and smooth.
如果确定球机300处于异常状态,那么,S3032中处理设备100生成的控制指令2可以是停止指令、降低倍率指令或返回预置点指令。作为一个示例,当球机300进入可能丢失状态2时,处理设备100可以生成停止指令1,该停止指令1用于指示云台340中的步进电机341停止工作,并且,指示摄像机330停止变化倍率。作为另一个示例,当球机300进入确定丢失状态3时,处理设备100可以生成降低倍率指令,该降低倍率指令用于指示摄像机330降低倍率,以扩大监控范围,增加搜索到目标对象的概率。作为又一个示例,当球机300进入空闲状态5时,处理设备100可以生成返回预置点指令,该返回预置点指令用于指示步进电机341驱动摄像机330返回预置点,退出对目标对象的跟踪。作为再一个示例,当球机300进入可能找回状态4时,处理设备100可以生成停止指令2,该停止指令2用于指示云台340中的步进电机341停止工作,并且,指示摄像机330停止变化倍率。If it is determined that the ball machine 300 is in an abnormal state, the control command 2 generated by the processing device 100 in S3032 may be a stop command, a magnification reduction command, or a return to a preset command. As an example, when the dome camera 300 enters the possible loss state 2, the processing device 100 may generate a stop instruction 1, which is used to instruct the stepper motor 341 in the gimbal 340 to stop working, and instruct the camera 330 to stop changing magnification. As another example, when the dome camera 300 enters the determined loss state 3, the processing device 100 may generate a magnification reduction instruction, which is used to instruct the camera 330 to reduce the magnification to expand the monitoring range and increase the probability of finding the target object. As yet another example, when the dome camera 300 enters the idle state 5, the processing device 100 may generate a return to the preset point instruction, and the return to the preset point instruction is used to instruct the stepping motor 341 to drive the camera 330 to return to the preset point, and to exit the target object tracking. As another example, when the dome camera 300 enters the possible recovery state 4, the processing device 100 may generate a stop instruction 2, which is used to instruct the stepper motor 341 in the gimbal 340 to stop working, and instruct the camera 330 Stop changing the magnification.
对于S3033中发送控制指令2的预设规则,可以通过在球机通信协议的各种指令中增加强制执行标志位实现。考虑到移动指令是有时效性的,而指令发送、处理和执行均是需要时间的,步进电机也有激励响应时延,所以,移动指令不必每条都执行,只在发送指令的时机发送距离该时机最近的时间生成的移动指令,对球机300实现最好的调整效果,以确保不容易跟丢目标对象。基于此,移动指令的强制标志位可以取0,指示该移动指令不是强制执行的必要指令。但是,停止指令、降低倍率指令和返回预置点指令是球机300进行异常处理必须执行的指令,如果不执行很可能无法正确处理异常,导致对目标对象的跟踪彻底失败,因此,停止指令、降低倍率指令和返回预置点指令的强制标志位可以取1,指示这些指令是需要强制执行的必要指令。需要说明的是,预设规则中,如果处理设备100中保存中未执行的非强制执行指令,那么,后续生成的非强制执行指令或强制执行指令均可以覆盖之前生成的非强制执行指令;如果处理设备100中保存中未执行的强制执行指令,那么,后续生成的非强制执行指令被丢弃,后续生成的强制执行指令也被保存下来,两个强制执行指令按照生成的先后顺序周期性的发送给球机300。The preset rules for sending control instruction 2 in S3033 can be implemented by adding mandatory execution flags to various instructions in the dome communication protocol. Considering that the movement command is time-sensitive, and it takes time to send, process and execute the command, and the stepper motor also has an excitation response delay, so the movement command does not have to be executed every time, only the distance is sent when the command is sent. The movement command generated at the most recent time can achieve the best adjustment effect for the ball machine 300, so as to ensure that the target object is not easily lost. Based on this, the forced flag bit of the move instruction can be set to 0, indicating that the move instruction is not a necessary instruction for forced execution. However, the stop command, the magnification reduction command and the return to the preset point command are the commands that must be executed by the dome camera 300 to handle exceptions. If they are not executed, the exception may not be handled correctly, resulting in a complete failure to track the target object. Therefore, the stop command, The mandatory flag bit of the lower magnification command and the command of returning to the preset point can be set to 1, indicating that these commands are necessary commands that need to be forced to be executed. It should be noted that, in the preset rule, if the processing device 100 saves a non-mandatory execution instruction that is not executed, then the subsequently generated non-mandatory execution instruction or mandatory execution instruction can overwrite the previously generated non-mandatory execution instruction; if The processing device 100 saves the mandatory execution instructions that are not executed, then the non-mandatory execution instructions generated subsequently are discarded, the mandatory execution instructions generated subsequently are also saved, and the two mandatory execution instructions are periodically sent in the order in which they were generated. Give the ball machine 300.
例如,假设到达周期1时,处理设备100中没有未发送的控制指令,且该周期1期间球机300一直处于正常状态1,按照时间的先后顺序依次生成移动指令1、移动指令2和移动指令3,那么,当从周期1结束,进入下一个周期2的起始时刻,处理设备100向球机300发送最新生成的移动指令3,移动指令1和移动指令2可以被处理设备100丢弃。又例如,假设到达周期3时,处理设备100中没有未发送的控制指令,且该周期3期间球机300一直处于异常状态,按照时间的先后顺序依次生成停止指令1、停止指令2和降低倍率指令1,那么,当从周期3结束,进入下一个周期4的起始时刻,处理设备100向球机300发送最早生成的停止指令1,移动指令2和降低倍率指令1可以被处理设备100保存;当从周期4进入下一个周期5的时刻,处理设备100向球机300发送停止指令1之后生成的停止指令2;当从周期5进入下一个周期6的时刻,处理设备100向球机300发送停止指令2之后生成的降低倍率指令1。For example, suppose that when cycle 1 is reached, there are no unsent control commands in the processing device 100, and the dome camera 300 is always in the normal state 1 during the cycle 1, and the movement command 1, the movement command 2 and the movement command are generated in the order of time. 3. Then, when the cycle 1 ends and the next cycle 2 starts, the processing device 100 sends the newly generated movement command 3 to the ball machine 300, and the movement command 1 and the movement command 2 can be discarded by the processing device 100. For another example, suppose that when cycle 3 is reached, there are no unsent control commands in the processing device 100, and the dome camera 300 is always in an abnormal state during cycle 3, and the stop command 1, the stop command 2 and the reduction ratio are sequentially generated in the order of time. Command 1, then, when the cycle 3 ends and the next cycle 4 starts, the processing device 100 sends the earliest generated stop command 1 to the dome camera 300, the move command 2 and the magnification reduction command 1 can be saved by the processing device 100 ; When entering the next cycle 5 from cycle 4, the processing device 100 sends the stop command 2 generated after the stop command 1 to the dome camera 300; when entering the next cycle 6 from cycle 5, the processing device 100 sends the dome camera 300 Decrease magnification command 1 generated after stop command 2 is sent.
在发送控制指令2的一个预设周期内,一种情况下,如果球机300均处于正常状态1且处理设备100中不存在未发送的停止指令、降低倍率指令和返回预置点指令,那么,处理设备100可能生成多个移动指令,但是仅保存最新的移动指令作为待发送的控制指令2,当到达发送控制指令2的时刻时,处理设备100向球机300发送该周期最新生成的移动指令。另一种情况下,如果球机300从正常状态1变为可能丢失状态2,那么,处理设备100可以生成至少一个停止指令,每个停止指令都保存在处理设备100中,当到达发送控制指令2的时刻时,处理设备100向球机300发送该周期最早生成的停止指令1。又一种情况下,如果球 机300从可能丢失状态2变为确定丢失状态3,那么,处理设备100可能生成至少一个降低倍率指令,每个降低倍率指令都保存在处理设备100中,当到达发送控制指令2的时刻时,如果还有待发送的停止指令2,则,向云台340发送停止指令2;如果没有待发送的停止指令,则,向云台340发送降低倍率指令1。另一种情况下,如果球机300从确定丢失状态3变为空闲状态5,那么,处理设备100可能生成至少一个返回预置点指令,每个降返回预置点指令都保存在处理设备100中,当到达发送控制指令2的时刻时,如果还有待发送的降低倍率指令2,则,向云台340发送降低倍率指令2;如果没有待发送的降低倍率指令,则,向云台340发送返回预置点指令1。又一种情况下,如果球机300从确定丢失状态3变为可能找回状态4,那么,处理设备100可能生成至少一个停止指令,每个停止指令都保存在处理设备100中,当到达发送控制指令2的时刻时,如果还有待发送的降低倍率指令3,则,向云台340发送降低倍率指令3;如果没有待发送的降低倍率指令,则,向云台340发送停止指令3。再一种情况下,如果球机300从可能找回状态4变为正常状态1,那么,处理设备100可能生成至少一个移动指令,如果还有待发送的停止指令4,则,丢失所有生成的移动指令,当到达发送控制指令2的时刻时,向云台340发送停止指令4;如果没有待发送的停止指令,则,仅保存最新生成的移动指令,当到达发送控制指令2的时刻时,向云台340发送最新生成的移动指令。In a preset cycle of sending the control command 2, in one case, if the dome camera 300 is in the normal state 1 and there is no unsent stop command, magnification reduction command and return to the preset point command in the processing device 100, then , the processing device 100 may generate multiple movement commands, but only saves the latest movement command as the control command 2 to be sent. When the time to send the control command 2 arrives, the processing device 100 sends the latest generated movement to the dome camera 300 instruction. In another case, if the dome camera 300 changes from the normal state 1 to the possible loss state 2, then the processing device 100 can generate at least one stop command, each stop command is stored in the processing device 100, and when the control command is sent At the time of 2, the processing device 100 sends the stop command 1 that is generated earliest in the cycle to the ball machine 300. In another case, if the dome camera 300 changes from the possible loss state 2 to the definite loss state 3, then the processing device 100 may generate at least one magnification reduction command, and each reduction magnification command is stored in the processing device 100. When the control command 2 is sent, if there is a stop command 2 to be sent, the stop command 2 is sent to the pan/tilt 340; if there is no stop command to be sent, a magnification reduction command 1 is sent to the pan/tilt 340. In another case, if the dome machine 300 changes from the determined loss state 3 to the idle state 5, then the processing device 100 may generate at least one return to preset point instruction, and each return to preset point instruction is stored in the processing device 100 , when the time to send the control command 2 arrives, if there is still a lower magnification command 2 to be sent, then send the lower magnification command 2 to the pan/tilt 340; if there is no lower magnification command to be sent, then send the Return to preset point command 1. In another case, if the dome camera 300 changes from the determined loss state 3 to the possible recovery state 4, then the processing device 100 may generate at least one stop command, and each stop command is stored in the processing device 100. At the time of the control command 2, if there is still a magnification reduction command 3 to be sent, send the magnification reduction command 3 to the pan/tilt 340; if there is no magnification reduction command to be sent, then send a stop command 3 to the pan/tilt 340. In another case, if the dome camera 300 changes from the possible recovery state 4 to the normal state 1, then the processing device 100 may generate at least one movement command, and if there is still a stop command 4 to be sent, then all the generated movements are lost. command, when the time to send the control command 2 is reached, send the stop command 4 to the PTZ 340; if there is no stop command to be sent, only the latest generated movement command is saved, and when the time to send the control command 2 is reached, it will be sent to the PTZ 340. The pan/tilt 340 sends the newly generated movement command.
如果处理设备100确定球机300发送的第二图像中包括了目标对象的关键信息,则,该处理设备340也可以将跟踪状态流转到图4所示的空闲状态5,此时,处理设备100可以向球机300发送返回预置点指令,用于控制步进电机341驱动摄像机330返回预置点,退出对目标对象的跟踪。其中,返回预置点指令中包括预置点标识,预置点标识用于唯一标识预置点。一种情况下,球机300中可以预设并记录至少一个预置点的相关信息(包括预置点标识),当球机300接收到返回预置点指令后,可以解析该返回预置点指令获取预置点标识,从而基于该预置点标识确定待返回的预置点,从而基于该预置点的相关信息返回到对应的预置点,完成该返回预置点指令。另一种情况下,处理设备300中为球机预设并记录至少一个预置点的相关信息(包括预置点标识、位置),处理设备100生成并发送给球机300的返回预置点指令中包括预置点位置,当球机300接收到返回预置点指令后,可以解析该返回预置点指令获取预置点位置,从而基于该预置点位置返回到对应的预置点,完成该返回预置点指令。If the processing device 100 determines that the second image sent by the dome camera 300 includes the key information of the target object, the processing device 340 can also transfer the tracking state flow to the idle state 5 shown in FIG. 4 . At this time, the processing device 100 A return to preset point instruction can be sent to the dome camera 300 to control the stepping motor 341 to drive the camera 330 to return to the preset point and to exit the tracking of the target object. The instruction for returning to the preset point includes a preset point identifier, and the preset point identifier is used to uniquely identify the preset point. In one case, the related information of at least one preset point (including the preset point identifier) can be preset and recorded in the dome camera 300. When the dome camera 300 receives the instruction to return to the preset point, it can parse the return preset point. The instruction acquires the preset point identifier, so as to determine the preset point to be returned based on the preset point identifier, so as to return to the corresponding preset point based on the relevant information of the preset point, and complete the instruction of returning to the preset point. In another case, the processing device 300 presets and records the relevant information of at least one preset point (including the preset point identifier and position) for the dome machine, and the processing device 100 generates and sends the return preset point of the dome machine 300 The command includes the position of the preset point. When the dome camera 300 receives the instruction of returning to the preset point, it can parse the instruction of returning to the preset point to obtain the position of the preset point, so as to return to the corresponding preset point based on the position of the preset point. Complete the command of returning to the preset point.
处理设备100中生成待发送的控制指令2在本地的保存方式在本实施例中不作具体限定。The local storage manner of the generated control instruction 2 to be sent in the processing device 100 is not specifically limited in this embodiment.
作为一个示例,至少一个控制指令2可以以指令队列的形式在处理设备100中保存。当处理设备100的指令队列为空,且持续生成移动指令时,可以用后生成的移动指令覆盖之前生成的移动指令,保证指令队列中仅保存最新生成的移动指令。当处理设备100的指令队列保存有移动指令,又生成停止指令、降低倍率指令或返回预置点指令时,可以用后生成的停止指令、降低倍率指令或返回预置点指令覆盖之前生成的移动指令,保证指令队列中仅保存停止指令、降低倍率指令或返回预置点指令。当处理设备100的指令队列保存有停止指令、降低倍率指令或返回预置点指令,又生成移动指令时,可以丢弃该移动指令。当处理设备100的指令队列中包括有停止指令、降低倍率指令或返回预置点指令,又生成停止指令、降低倍率指令或返回预置点指令时,可以将新生成的停止指令、降低倍率指令或返回预置点指令也保存起来,然后按照生成顺序周期性向球机300发送。As an example, at least one control instruction 2 may be stored in the processing device 100 in the form of an instruction queue. When the instruction queue of the processing device 100 is empty and the move instruction is continuously generated, the move instruction generated before can be overwritten with the move instruction generated later to ensure that only the move instruction generated newly is stored in the instruction queue. When the command queue of the processing device 100 stores a move command, and generates a stop command, a magnification reduction command, or a return to preset command, the stop command, magnification reduction command, or return to preset command generated later can be used to overwrite the previously generated movement command. command to ensure that only stop commands, lower magnification commands or return to preset commands are stored in the command queue. When the instruction queue of the processing device 100 stores a stop instruction, a magnification reduction instruction, or a return to a preset point instruction, and a move instruction is generated, the move instruction can be discarded. When the command queue of the processing device 100 includes a stop command, a magnification reduction command, or a return to preset command, and a stop command, a magnification reduction command, or a return to preset command is generated, the newly generated stop command, magnification reduction command may be Or the command to return to the preset point is also saved, and then periodically sent to the ball machine 300 according to the generation sequence.
举例来说:假设处理设备100预设的发送控制指令的一个周期为120毫秒,如图5所示,指令队列的情况具体为:t=10毫秒,处理设备100生移动指令成Move 1,该指令队列仅包括Move 1,处理设备100将指令队列中的Move 1向球机300的云台340发送,云台340按照该 Move 1中的参数控制步进电机转动和/或变倍率;第一个周期内,t=50毫秒,处理设备100生成Move 2,该指令队列仅包Move 2,t=90毫秒,处理设备100生成Move 3并丢弃Move 2,该指令队列仅包括Move 3,t=130毫秒,处理设备100生成停止指令Stop 1并丢弃Move 3,此时,该指令队列仅包括Stop 1,处理设备100向云台340发送Stop 1,云台340按照该Stop 1控制步进电机341停止转动和变倍率;第二个周期内,t=170毫秒,处理设备100生成Stop 2,该指令队列仅包括Stop 2,t=210毫秒时,处理设备100生成Move 4并丢弃Move 4,该指令队列仅包括Stop 2,t=250毫秒,处理设备100生成返回预置点指令GotoPreset 1,该指令队列包括Stop 2和GotoPreset 1,处理设备100向云台340发送Stop 2,云台340按照该Stop 2控制步进电机341停止转动和变倍率;第三个周期内,t=290毫秒,处理设备100生成Move 5并丢弃Move 5,该指令队列包括GotoPreset 1,t=330毫秒时,处理设备100生成Move 6并丢弃Move 6,该指令队列包括GotoPreset 1,t=370毫秒,处理设备100生成Move 7并丢弃Move 7,该指令队列包括GotoPreset 1,处理设备100向云台340发送GotoPreset 1,云台340按照该GotoPreset 1中控制步进电机341转动到预置点。For example: Assuming that the preset cycle of the processing device 100 for sending control commands is 120 milliseconds, as shown in FIG. 5 , the specific situation of the command queue is: t=10 milliseconds, the processing device 100 generates a move command as Move 1, the The instruction queue only includes Move 1, and the processing device 100 sends the Move 1 in the instruction queue to the PTZ 340 of the ball camera 300, and the PTZ 340 controls the rotation of the stepping motor and/or the zoom ratio according to the parameters in the Move 1; the first In a cycle, t=50 milliseconds, the processing device 100 generates Move 2, the instruction queue only includes Move 2, t=90 milliseconds, the processing device 100 generates Move 3 and discards Move 2, the instruction queue only includes Move 3, t= 130 milliseconds, the processing device 100 generates a stop instruction Stop 1 and discards Move 3. At this time, the instruction queue only includes Stop 1, and the processing device 100 sends Stop 1 to the PTZ 340, and the PTZ 340 controls the stepping motor 341 according to the Stop 1. Stop the rotation and the zoom ratio; in the second cycle, t=170 milliseconds, the processing device 100 generates Stop 2, the instruction queue only includes Stop 2, and when t=210 milliseconds, the processing device 100 generates Move 4 and discards Move 4, the The instruction queue only includes Stop 2, t=250 milliseconds, the processing device 100 generates a return preset point instruction GotoPreset 1, the instruction queue includes Stop 2 and GotoPreset 1, the processing device 100 sends Stop 2 to the PTZ 340, and the PTZ 340 follows this Stop 2 controls the stepping motor 341 to stop rotating and changing the magnification; in the third cycle, t=290 milliseconds, the processing device 100 generates Move 5 and discards Move 5, the instruction queue includes GotoPreset 1, and when t=330 milliseconds, the processing device 100 generates Move 6 and discards Move 6, the instruction queue includes GotoPreset 1, t=370 milliseconds, the processing device 100 generates Move 7 and discards Move 7, the instruction queue includes GotoPreset 1, the processing device 100 sends GotoPreset 1 to the PTZ 340, The PTZ 340 controls the stepping motor 341 to rotate to the preset point according to the GotoPreset 1.
其中,如图5所示,移动指令Move中可以包括第一方向的第一调整速度V pan、第二方向的第二调整速度V tilt、第一倍率调整速度V zoom和强制标志位F,其中,第一方向的V pan和第二方向的V pan的取值的计算方式参见下述图7所示的实施例中的相关说明;V zoom的数值大小为预设倍率调整速度,方向按照当前第二图像中目标对象的实际状态进行确定;强制标志位F的取值为0。停止指令Stop中可以包括停止转动指示位T、停止变倍率指示位M和强制标志位F,通常,停止转动指示位T的取值为1,停止变倍率指示位M的取值为1,强制标志位F的取值为1,该情况下,该Stop用于指示球机300停止转动和停止变倍率,且该Stop为需要强制执行的指令。返回预置点指令GotoPreset中可以包括预置点的标识D和强制标志位F,通常,预置点的标识D用于唯一标识球机300的一个预置点,强制标志位F的取值为1,该情况下,该GotoPreset用于指示球机300返回标识D对应的预置点,例如返回名称为home的预置点,且该GotoPreset为需要强制执行的指令。此外,处理设备100在确定球机300处于丢失状态3时,还可以生成降低倍率指令ZoomOut(也称为收缩焦距指令),该ZoomOut中可以包括停止转动指示位T、停止变倍率指示位M和强制标志位F,通常,停止转动指示位T的取值为1,停止变倍率指示位M的取值为0,强制标志位F的取值为1,该情况下,该ZoomOut用于指示球机300停止转动并缩小倍率扩大监控范围,从而从更大的监控区域中搜索目标对象,增大找回目标对象的概率,ZoomOut为需要强制执行的指令。需要说明的是,ZoomOut和Stop可以是两种不同类型的指令,也可以是同一类型的指令下基于停止变倍率指示位M取值的不同而区分的两条功能不同的指令,在本申请实施例中不作具体限定。 Wherein, as shown in FIG. 5 , the movement instruction Move may include a first adjustment speed V pan in the first direction, a second adjustment speed V tilt in the second direction, a first magnification adjustment speed V zoom and a forced flag F, wherein , the calculation methods of the values of V pan in the first direction and V pan in the second direction refer to the relevant description in the embodiment shown in Figure 7 below; the value of V zoom is the preset magnification adjustment speed, and the direction is based on The actual state of the target object in the second image is determined; the value of the mandatory flag bit F is 0. The stop command Stop can include the stop rotation indicator bit T, the stop zoom ratio indicator bit M, and the mandatory flag bit F. Usually, the stop rotation indicator bit T takes the value of 1, and the stop zoom indicator bit M takes the value of 1, and the mandatory value is 1. The value of the flag bit F is 1. In this case, the Stop is used to instruct the dome camera 300 to stop rotating and stop changing the magnification, and the Stop is an instruction that needs to be enforced. The preset point return command GotoPreset can include the preset point identifier D and the mandatory flag bit F. Usually, the preset point identifier D is used to uniquely identify a preset point of the dome camera 300, and the value of the mandatory flag bit F is 1. In this case, the GotoPreset is used to instruct the dome camera 300 to return to the preset point corresponding to the identifier D, for example, the preset point named home, and the GotoPreset is an instruction that needs to be enforced. In addition, when the processing device 100 determines that the dome camera 300 is in the lost state 3, it can also generate a magnification reduction command ZoomOut (also referred to as a zoom-out command), and the ZoomOut can include a stop rotation indication bit T, a stop zoom ratio indication bit M and The mandatory flag bit F, usually, the value of the stop rotation indicator bit T is 1, the value of the stop zoom indicator bit M is 0, and the value of the mandatory flag bit F is 1. In this case, the ZoomOut is used to indicate the ball The machine 300 stops rotating and reduces the magnification to expand the monitoring range, so as to search for the target object from a larger monitoring area and increase the probability of retrieving the target object. ZoomOut is an instruction that needs to be enforced. It should be noted that ZoomOut and Stop can be two different types of instructions, or two instructions with different functions under the same type of instruction, which are distinguished based on the value of the stop zoom indicator bit M, and are implemented in this application. Examples are not specifically limited.
本实施例中上述PID算法计算移动指令Move中的参数V pan和V tilt。为了能够更加准确的计算出使得跟踪目标对象效果最佳的参数V pan和V tilt,本实施例提供的PID计算中,突出的贡献点包括: In this embodiment, the above-mentioned PID algorithm calculates the parameters V pan and V tilt in the movement command Move. In order to more accurately calculate the parameters V pan and V tilt that make the tracking target object have the best effect, in the PID calculation provided by this embodiment, prominent contribution points include:
一方面,处理设备100中预设有倍率和PID参数组{K P、K I和K D}之间的对应关系,例如:对于球机300中摄像机330的倍率变化分为为1.0~30.0的情况下,预设10组对应关系:1.0~2.9对应PID参数组1{K P1、K I1和K D1},3.0~5.9对应PID参数组2{K P2、K I2和K D2},……,24.0~26.9对应PID参数组9{K P9、K I9和K D9}以及27.0~30.0对应PID参数组10{K P10、K I10和K D10}。这样,当需要计算V pan和V tilt时,可以直接根据球机300中摄像机330的当前倍率,确定出对应的PID参数组,并基于上述公式(1)和公式(2)计算V pan和V tiltOn the one hand, the corresponding relationship between the magnification and the PID parameter group {K P , K I and K D } is preset in the processing device 100 , for example, the magnification change of the camera 330 in the dome camera 300 is divided into 1.0~30.0 In this case, 10 sets of corresponding relationships are preset: 1.0~2.9 correspond to PID parameter group 1 {K P1 , K I1 and K D1 }, 3.0~5.9 correspond to PID parameter group 2 {K P2 , K I2 and K D2 },... , 24.0~26.9 correspond to PID parameter group 9 {K P9 , K I9 and K D9 } and 27.0~30.0 correspond to PID parameter group 10 {K P10 , K I10 and K D10 }. In this way, when V pan and V tilt need to be calculated, the corresponding PID parameter group can be determined directly according to the current magnification of the camera 330 in the dome camera 300, and V pan and V can be calculated based on the above formulas (1) and (2). tilt .
另一方面,考虑到步进电机341执行的移动指令Move过程中的调整速度V pan和V tilt是离 散的,而PID输出的调整速度是连续的,所以,处理设备100中在基于PID计算V pan和V tilt之前,也可以先判断目标对象是否在第二图像的中心区域,如果在,则,将当前时刻第二图像的中心点和第二图像中目标对象的中心点之间的偏差置零后再进行PID计算;如果不在,则,直接根据当前时刻第二图像的中心点和第二图像中目标对象的中心点之间的偏差进行PID计算。其中,第二图像的中心区域是处理设备100预先设置的,预先设置:第二图像的中心点和第二图像中目标对象的中心点之间的偏差△x≤△x 阈值且△y≤△y 阈值,如图6所示,第二图像的中心点坐标为(x0,y0),在第二图像中包括目标对象的方形框的中心点为(x,y),偏差为(△x,△y),预设的中心区域在x方向上的长度为△x 阈值,y方向上的长度为△y 阈值,其中,△x=|x-x0|,△y=|y-y0|。在t时刻,如果△x(t)≤△x 阈值且△y(t)>△y 阈值,则,将公式(2)中的△y(t)置零后根据公式(2)计算V tilt,不对△x(t)做指令处理,直接带入公式(1)计算V pan;如果△x(t)>△x 阈值且△y(t)≤△y 阈值,则,将公式(1)中的△x(t)置零后根据公式(1)计算V pan,不对△y(t)做指令处理,直接带入公式(2)计算V tilt;如果△x(t)≤△x 阈值且△y(t)≤△y 阈值,则,将公式(1)中的△x(t)置零后根据公式(1)计算V pan,将公式(2)中的△y(t)置零后根据公式(2)计算V tilt;如果△x(t)>△x 阈值且△y(t)>△y 阈值,则,不对△x(t)做指令处理,直接带入公式(1)计算V pan,不对△y(t)做指令处理,直接带入公式(2)计算V tilt。这样,对于目标对象位于第二图像的中心或目标对象距离第二图像的中心不远的情况,通过将对应方向上的偏差置零,使得PID在对应方向上输出更加精确的调整速度。 On the other hand, considering that the adjustment speeds V pan and V tilt during the movement command Move executed by the stepping motor 341 are discrete, while the adjustment speed of the PID output is continuous, the processing device 100 calculates V based on the PID Before pan and V tilt , it is also possible to judge whether the target object is in the center area of the second image, and if so, set the deviation between the center point of the second image at the current moment and the center point of the target object in the second image. PID calculation is performed after zero; if not, PID calculation is directly performed according to the deviation between the center point of the second image at the current moment and the center point of the target object in the second image. Wherein, the center area of the second image is preset by the processing device 100, and preset: the deviation between the center point of the second image and the center point of the target object in the second image Δx≤Δx threshold and Δy≤Δ y threshold , as shown in Figure 6, the coordinates of the center point of the second image are (x0, y0), the center point of the square frame including the target object in the second image is (x, y), and the deviation is (△x, Δy), the preset length of the central region in the x direction is the Δx threshold , and the length in the y direction is the Δy threshold , where Δx=|x-x0|, Δy=|y-y0|. At time t, if △x(t)≤△x threshold and △y(t)>△y threshold , then, after setting △y(t) in formula (2) to zero, calculate V tilt according to formula (2) , do not perform instruction processing on △x(t), directly bring it into formula (1) to calculate V pan ; if △x(t)>△x threshold and △y(t)≤△y threshold , then formula (1) After setting △x(t) to zero, calculate V pan according to formula (1), without performing instruction processing on △y(t), directly bring it into formula (2) to calculate V tilt ; if △x(t)≤△x threshold And △y(t)≤△y threshold , then, after setting △x(t) in formula (1) to zero, calculate V pan according to formula (1), and set △y(t) in formula (2) to After zero, calculate V tilt according to formula (2); if △x(t)>△x threshold and △y(t)>△y threshold , then do not perform instruction processing on △x(t), and directly bring it into formula (1) ) to calculate V pan , without performing instruction processing on △y(t), directly bring it into formula (2) to calculate V tilt . In this way, for the case where the target object is located in the center of the second image or the target object is not far from the center of the second image, by setting the deviation in the corresponding direction to zero, the PID outputs a more accurate adjustment speed in the corresponding direction.
再一方面,考虑到步进电机341是按照不同的转动档位转动的,通常具有最小档位(如0.1档),那么,为了避免PID计算出的V pan和V tilt过小(例如小于0.1)导致步进电机341转动过头,使得步进电机341的转动过程发生来回晃动、无法稳定的现象,处理设备100在计算出V pan和V tilt之后生成移动指令之前,还对V pan和V tilt分别进行死区判断,当位于死区时,将该调整速度置零(即不再该方向上进行调整)。举例来说,处理设备100可以预设死区为-ζ~ζ,通常ζ的取值为步进电机341的最小转动档位,例如ζ=0.1,那么,如果V pan=0.07,则,由于-0.1≤0.07≤0.1,则,设置V pan=0;如果V tilt=-0.05,则,由于-0.1≤-0.05≤0.1,则,设置V tilt=0。 On the other hand, considering that the stepper motor 341 rotates according to different rotation gears, and usually has the smallest gear (eg, 0.1 gear), then, in order to avoid that the V pan and V tilt calculated by the PID are too small (for example, less than 0.1 ) causes the stepping motor 341 to rotate too far, so that the rotation process of the stepping motor 341 shakes back and forth and cannot be stabilized . The dead zone is judged separately. When it is in the dead zone, the adjustment speed is set to zero (that is, no adjustment is performed in this direction). For example, the processing device 100 can preset the dead zone to be -ζ˜ζ, usually the value of ζ is the minimum rotation gear of the stepper motor 341, for example, ζ=0.1, then, if V pan =0.07, then, because -0.1≤0.07≤0.1, then, set V pan =0; if Vtilt =-0.05, then, since -0.1≤-0.05≤0.1, then set Vtilt =0.
接下来,结合图7进一步介绍本实施例中采用PID算法计算移动指令Move中的参数V pan和V tilt的具体过程如下: Next, the specific process of calculating the parameters V pan and V tilt in the movement command Move by using the PID algorithm in the present embodiment is further described in conjunction with FIG. 7 as follows:
S31,获取第二图像中包括目标对象方形框的中心点(x,y);S31, obtaining the center point (x, y) of the square frame including the target object in the second image;
S32,计算(x,y)和第二图像的中心点(x0,y0)的偏差(△x,△y);S32, calculate the deviation (Δx, Δy) between (x, y) and the center point (x0, y0) of the second image;
S33,分别判断△x是否小于或等于△x 阈值,△y是否小于或等于△y 阈值,如果是,则将对应的偏差置零后执行S34,如果否,则直接执行S34; S33, respectively determine whether △x is less than or equal to the △x threshold value , and whether △y is less than or equal to the △y threshold value , if yes, then perform S34 after setting the corresponding deviation to zero, if not, directly perform S34;
S34,获取球机300当前的倍率n;S34, obtain the current magnification n of the ball camera 300;
S35,根据预设的倍率和PID参数组{K P、K I和K D}之间的对应关系,确定与倍率n对应的PID参数组n{K Pn、K In和K Dn}; S35, according to the preset magnification and the corresponding relationship between the PID parameter groups {K P , K I and K D }, determine the PID parameter group n {K Pn , K In and K Dn } corresponding to the magnification n;
S36,根据PID参数组n{K Pn、K In和K Dn}、△x、△y以及公式(1)和公式(2)计算V pan和V tiltS36, calculate V pan and V tilt according to the PID parameter groups n{K Pn , K In and K Dn }, Δx, Δy and formula (1) and formula (2);
S37,分别判断V pan和V tilt是否位于预设的死区,如果是,则将位于死区的V pan和/或V tilt置零后执行S38,如果否则直接执行S38; S37, respectively determine whether V pan and V tilt are located in the preset dead zone, if so, set V pan and/or V tilt located in the dead zone to zero and then execute S38, if otherwise, directly execute S38;
S38,根据V pan和V tilt生成移动指令Move,Move中包括V pan和V tiltS38 , generate a move instruction Move according to V pan and V tilt , where Move includes V pan and V tilt .
需要说明的是,中心区域判断(即S33)和死区判断(即S37)均为提高监控效果的可选 步骤,是否执行在本申请实施例中不作具体限定。It should be noted that the central area judgment (i.e. S33) and the dead zone judgment (i.e. S37) are both optional steps to improve the monitoring effect, and whether to perform is not specifically limited in the embodiments of the present application.
虽然调整摄像机330的倍率可以调节监控范围大小,但是考虑到倍率调整速度过快,会导致球机330在变化倍率的时采集的第二图像是模糊不清的,严重影响对目标对象的跟踪,那么,本实施例中倍率调整速度采用预设值的方式确定而不采用PID算法进行计算,以该预设值作为倍率调整速度调整倍率,能够确保摄像机330在倍率调整的过程中采集的第二图像也是清晰的,不会影响对目标对象的跟踪。具体实现时,假设预设值为a(a>0),确定倍率调整速度V zoom的方法可以包括:S41,获取第二图像中目标对象占第二图像的比例;S42,判断该比例和预设的比例阈值1、比例阈值2的大小关系,如果该比例小于比例阈值1,则执行S43,如果该比例大于或等于比例阈值1且小于或等于比例阈值2,则执行S44,如果该比例大于比例阈值2,则执行S45,其中,比例阈值1小于比例阈值2;S43,确定V zoom为a,以控制摄像机330按照a增大摄像机330的倍率;S44,确定V zoom为0,以控制不对摄像机330的倍率进行调整;S45,确定V zoom为-a,以控制摄像机330按照a降低摄像机330的倍率。需要说明的是,摄像机330的倍率越大,监控范围就越小,目标对象在第二图像中所占的比例就越大;反之,摄像机330的倍率越小,监控范围就越大,目标对象在第二图像中所占的比例就越大。 Although adjusting the magnification of the camera 330 can adjust the size of the monitoring range, considering that the magnification adjustment speed is too fast, the second image collected by the dome camera 330 when the magnification is changed will be blurred, which will seriously affect the tracking of the target object. Then, in this embodiment, the magnification adjustment speed is determined by using a preset value instead of using the PID algorithm for calculation, and the preset value is used as the magnification adjustment speed to adjust the magnification, which can ensure that the second data collected by the camera 330 during the magnification adjustment process can be ensured. The image is also sharp and does not affect the tracking of the target object. In specific implementation, assuming that the preset value is a (a>0), the method for determining the magnification adjustment speed V zoom may include: S41, obtaining the proportion of the target object in the second image in the second image; S42, judging the proportion and the preset Set the size relationship between the ratio threshold 1 and the ratio threshold 2, if the ratio is less than the ratio threshold 1, then execute S43, if the ratio is greater than or equal to the ratio threshold 1 and less than or equal to the ratio threshold 2, then execute S44, if the ratio is greater than or equal to the ratio threshold 2, then execute S44 If the scale threshold value is 2, execute S45, wherein the scale threshold value 1 is smaller than the scale threshold value 2; S43, determine V zoom as a, so as to control the camera 330 to increase the magnification of the camera 330 according to a; S44, determine V zoom as 0, so as to control the wrong Adjust the magnification of the camera 330; S45, determine V zoom to be -a, so as to control the camera 330 to reduce the magnification of the camera 330 according to a. It should be noted that, the larger the magnification of the camera 330, the smaller the monitoring range, and the larger the proportion of the target object in the second image; conversely, the smaller the magnification of the camera 330, the larger the monitoring range, and the larger the target object. The larger the proportion in the second image.
其中,处理设备100可以根据目标对象的不同确定作为倍率调整的参考因素,例如,当目标对象是细长的形态(如人物),则,确定以目标对象在第二图像中的高度h作为倍率调整的参考因素;又例如,当目标对象是矮宽的形态(如车辆),则,确定以目标对象在第二图像中的宽度w作为倍率调整的参考因素;又例如,当目标对象是矮宽的形态(如车辆),但是宽度与其他对象的宽度近似相等,则,确定以目标对象在第二图像中的高度h和宽度w共同作为倍率调整的参考因素。The processing device 100 may determine a reference factor for magnification adjustment according to different target objects. For example, when the target object is an elongated shape (such as a person), the height h of the target object in the second image is determined as the magnification. The reference factor for adjustment; for another example, when the target object is a short and wide shape (such as a vehicle), the width w of the target object in the second image is determined as the reference factor for magnification adjustment; for another example, when the target object is short and wide If the shape is wide (such as a vehicle), but the width is approximately equal to the width of other objects, it is determined that the height h and width w of the target object in the second image are taken together as a reference factor for magnification adjustment.
以目标对象是人物,高度h作为倍率调整的参考因素,预设值a=1.5/秒,且预设比例阈值1和比例阈值2,比例阈值1为1/3,比例阈值2位2/3为例,如果在t1时刻,处理设备100确定该人的高度占第二图像1的高度的比例为1/5,那么,由于1/5小于1/3,生成的移动指令Move中包括的倍率调整速度V zoom为1.5/秒;如果在t2时刻,处理设备100确定该人的高度占第二图像2的高度的比例为1/2,那么,由于1/2小于2/3且大于1/3,生成的移动指令Move中包括的倍率调整速度V zoom为0;如果在t3时刻,处理设备100确定该人的高度占第二图像3的高度的比例为5/6,那么,由于5/6大于2/3,生成的移动指令Move中包括的倍率调整速度V zoom为-1.5/秒。 The target object is a person, the height h is used as the reference factor for magnification adjustment, the preset value a=1.5/sec, and the preset scale threshold value 1 and scale threshold value 2, the scale threshold value 1 is 1/3, and the scale threshold value is 2 bits 2/3 For example, if at time t1, the processing device 100 determines that the ratio of the height of the person to the height of the second image 1 is 1/5, then, since 1/5 is less than 1/3, the generated movement instruction Move includes the magnification ratio The adjustment speed V zoom is 1.5/second; if at time t2, the processing device 100 determines that the ratio of the height of the person to the height of the second image 2 is 1/2, then, since 1/2 is less than 2/3 and greater than 1/ 3. The magnification adjustment speed V zoom included in the generated movement instruction Move is 0; if at time t3, the processing device 100 determines that the ratio of the height of the person to the height of the second image 3 is 5/6, then, since 5/ 6 is greater than 2/3, the magnification adjustment speed V zoom included in the generated movement command Move is -1.5/sec.
可见,通过本实施例提供的方法,处理设备100在获取监控系统中枪机200发送的包括待跟踪的目标对象的第一图像时,能够控制球机300中云台340的步进电机341工作,以驱动该球机300转动到枪机200对应的监控区域,这样,球机300中的摄像机即可采集到包括目标对象的第二图像并发送给处理设备100,处理设备100能够基于球机300发来的第二图像,生成对球机300的控制指令,并且周期性的向所述云台340发送控制指令,以控制云台340中的步进电机341工作,实现对目标对象的跟踪。由于该方法考虑到球机300中的摄像机330的转动是通过步进电机341的转动而带动的,步进电机341存在一定的激励响应时延,球机300中摄像机330采集图像的过程是离散的等特点,通过预设发送控制指令的周期,处理设备100周期性向具有可转动、可变倍率的球机300发送控制指令,有效的克服了目前在控制球机300的摄像机330转动时不够平滑稳定的缺点,使得球机300的转动过程不再卡顿,实现对目标对象平滑稳定的跟踪,从而提升球机300的使用体验。It can be seen that with the method provided in this embodiment, the processing device 100 can control the stepping motor 341 of the pan/tilt 340 in the dome camera 300 to work when acquiring the first image including the target object to be tracked sent by the trigger 200 in the monitoring system , in order to drive the dome camera 300 to rotate to the monitoring area corresponding to the bolt 200, so that the camera in the dome camera 300 can collect the second image including the target object and send it to the processing device 100. The processing device 100 can be based on the dome camera The second image sent by 300 generates a control command for the dome camera 300, and periodically sends control commands to the PTZ 340 to control the stepping motor 341 in the PTZ 340 to work, so as to track the target object . Since this method considers that the rotation of the camera 330 in the dome camera 300 is driven by the rotation of the stepper motor 341, the stepper motor 341 has a certain excitation response time delay, and the process of capturing images by the camera 330 in the dome camera 300 is discrete The processing device 100 periodically sends control commands to the dome camera 300 with rotatable and variable magnification by presetting the period for sending control commands, which effectively overcomes the lack of smooth rotation of the camera 330 currently controlling the dome camera 300. The shortcoming of stability makes the rotation process of the dome machine 300 no longer stuck, and realizes smooth and stable tracking of the target object, thereby improving the use experience of the dome machine 300 .
上文中结合图2和图3详细描述了本实施例所提供的球机控制方法,下面将结合图8和 图9,描述根据本实施例所提供的球机控制装置和设备。The ball machine control method provided by this embodiment is described in detail above with reference to FIG. 2 and FIG. 3 , and the ball machine control device and equipment provided according to this embodiment will be described below with reference to FIG. 8 and FIG. 9 .
图8为本实施例提供的一种球机控制装置800,所述球机控制装置800应用于处理设备,所述球机控制装置800包括:确定单元801、发送单元802和跟踪单元803;FIG. 8 provides a ball camera control apparatus 800 provided in this embodiment, the ball camera control apparatus 800 is applied to a processing device, and the ball camera control apparatus 800 includes: a determination unit 801, a transmission unit 802, and a tracking unit 803;
确定单元801,用于确定待跟踪的目标对象;A determination unit 801, used for determining the target object to be tracked;
发送单元802,用于周期性向球机发送控制指令,该控制指令用于控制球机中云台的步进电机以驱动球机中摄像机转动至目标对象所在的监控区域;The sending unit 802 is used to periodically send a control command to the dome camera, the control command is used to control the stepping motor of the pan/tilt in the dome camera to drive the camera in the dome camera to rotate to the monitoring area where the target object is located;
跟踪单元803,用于基于球机中摄像机采集的图像,跟踪目标对象。The tracking unit 803 is used for tracking the target object based on the image collected by the camera in the dome camera.
其中,向球机发送控制指令的周期大于步进电机的激励响应时延。Among them, the period of sending control commands to the dome camera is greater than the excitation response time delay of the stepping motor.
可选地,确定单元801,还用于在周期性向球机发送控制指令之前,根据图像中目标对象的跟踪结果确定所述控制指令,该跟踪结果包括正常状态和异常状态。Optionally, the determining unit 801 is further configured to determine the control instruction according to the tracking result of the target object in the image before periodically sending the control instruction to the dome camera, where the tracking result includes a normal state and an abnormal state.
作为一个示例,当目标对象的跟踪结果为正常状态时,控制指令为第一控制指令,第一控制指令用于指示球机继续跟踪目标对象。As an example, when the tracking result of the target object is in a normal state, the control instruction is a first control instruction, and the first control instruction is used to instruct the dome camera to continue tracking the target object.
可选地,发送单元802,还用于:向球机发送同一周期中最新生成的第一控制指令。Optionally, the sending unit 802 is further configured to: send the newly generated first control instruction in the same cycle to the ball machine.
可选地,确定单元801,还用于按照预设规则确定第一控制指令,预设规则包括根据球机中摄像机的倍率和比例积分微分PID参数组确定第一控制指令。Optionally, the determining unit 801 is further configured to determine the first control instruction according to a preset rule, and the preset rule includes determining the first control instruction according to the magnification of the camera in the dome camera and the proportional-integral-derivative PID parameter group.
可选地,确定单元801,包括:第一确定子单元、第二确定子单元和第三确定子单元。其中,第一确定子单元,用于根据球机中摄像机当前的倍率,确定倍率对应的PID参数组;第二确定子单元,用于根据PID参数组,确定第一调整速度和第二调整速度;第三确定子单元,用于根据第一调整速度和第二调整速度确定第一控制指令。Optionally, the determining unit 801 includes: a first determining subunit, a second determining subunit and a third determining subunit. Among them, the first determination subunit is used to determine the PID parameter group corresponding to the magnification according to the current magnification of the camera in the dome camera; the second determination subunit is used to determine the first adjustment speed and the second adjustment speed according to the PID parameter group ; a third determination sub-unit for determining the first control command according to the first adjustment speed and the second adjustment speed.
可选地,第二确定子单元,还用于根据PID参数和第一方向上的第一偏差,确定第一调整速度,其中,第一偏差为图像的中心点和图像中目标对象所在区域的中心点之间在第一方向上的距离。Optionally, the second determination subunit is further configured to determine the first adjustment speed according to the PID parameter and the first deviation in the first direction, wherein the first deviation is the center point of the image and the area where the target object is located in the image. The distance between the center points in the first direction.
可选地,确定单元801,还包括第一置零子单元,该第一置零子单元,用于在根据PID参数和第一方向上的第一偏差确定第一调整速度之前,如果第一偏差小于预设的第一偏差阈值,则,将第一偏差置零,第一偏差阈值基于图像预设的中心区域确定。Optionally, the determining unit 801 further includes a first zero-setting sub-unit, where the first zero-setting sub-unit is configured to, before determining the first adjustment speed according to the PID parameters and the first deviation in the first direction, if the first If the deviation is smaller than the preset first deviation threshold, the first deviation is set to zero, and the first deviation threshold is determined based on the preset central area of the image.
可选地,确定单元801,还包括第二置零子单元,该第二置零子单元,用于如果第一调整速度位于死区范围内,则,将第一调整速度置零,死区范围根据步进电机的调整精度确定。Optionally, the determining unit 801 further includes a second zero-setting subunit, the second zero-setting subunit is configured to set the first adjustment speed to zero if the first adjustment speed is within the dead zone range, and the dead zone The range is determined according to the adjustment accuracy of the stepper motor.
可选地,预设规则还可以包括根据目标对象在预设方向上占图像的比例确定第一控制指令。Optionally, the preset rule may further include determining the first control instruction according to the proportion of the target object in the image in the preset direction.
可选地,确定单元801,还包括:获取子单元、第四确定子单元和第五确定子单元。其中,获取子单元,用于获取在预设方向上目标对象占图像的比例;第四确定子单元,用于根据比例和预设比例阈值,确定目标倍率调整速度,目标倍率调整速度为预设倍率调整速度或预设倍率调整速度的相反数;第五确定子单元,用于根据目标倍率调整速度确定第一控制指令。Optionally, the determining unit 801 further includes: an acquiring subunit, a fourth determining subunit, and a fifth determining subunit. Among them, the acquisition subunit is used to acquire the proportion of the target object in the image in the preset direction; the fourth determination subunit is used to determine the target magnification adjustment speed according to the proportion and the preset proportion threshold, and the target magnification adjustment speed is preset The magnification adjustment speed or the opposite number of the preset magnification adjustment speed; the fifth determination subunit is used for determining the first control command according to the target magnification adjustment speed.
作为另一个示例,当目标对象的跟踪结果为异常状态时,控制指令为第二控制指令,第二指令用于指示球机在异常状态时执行对球机的控制。As another example, when the tracking result of the target object is in an abnormal state, the control instruction is a second control instruction, and the second instruction is used to instruct the dome camera to control the dome camera in an abnormal state.
可选地,确定单元801,还用于按照预设规则确定第二控制指令,预设规则包括根据异常状态的类型确定第二控制指令,第二控制指令包括下述指令中的至少一个:停止指令、降低倍率指令或返回预置点指令。Optionally, the determining unit 801 is further configured to determine a second control instruction according to a preset rule, the preset rule includes determining a second control instruction according to the type of abnormal state, and the second control instruction includes at least one of the following instructions: stop command, reduce magnification command or return to preset point command.
可选地,发送单元802,还用于向球机发送指令队列中保存的最早生成的第二控制指令。Optionally, the sending unit 802 is further configured to send the earliest generated second control instruction stored in the instruction queue to the ball machine.
在一些可能的实现方式中,异常状态包括第一异常状态、第二异常状态、第三异常状态 和第四异常状态,装置800还包括:第一处理单元~第五处理单元。其中,第一处理单元,用于当球机处于正常状态且采集到的图像中不包括目标对象时,确定球机进入第一异常状态,并指示云台中的步进电机停止工作;第二处理单元,用于当球机处于第一异常状态且在第一预设时间采集的多帧图像中均不包括目标对象时,或者,当球机处于第一异常状态且球机在第一预设时间内采集的图像中包括目标对象,确定球机进入第二异常状态,并指示摄像机降低倍率,以扩大监控范围;第三处理单元,用于当球机处于第二异常状态且在第二预设时间采集的多帧图像中均不包括目标对象时,确定球机进入第三异常状态,并指示步进电机驱动摄像机返回预置点,退出对目标对象的跟踪;第四处理单元,用于当球机处于第二异常状态且采集到的图像中包括目标对象时,确定球机进入第四异常状态,并指示云台中的步进电机停止工作;第五处理单元,用于当球机处于第四异常状态且球机在第三预设时间内采集的多帧图像中均包括目标对象,或者,当球机处于第一异常状态且球机在第一预设时间内采集的图像中包括目标对象,确定球机进入正常状态。In some possible implementations, the abnormal state includes a first abnormal state, a second abnormal state, a third abnormal state and a fourth abnormal state, and the apparatus 800 further includes: a first processing unit to a fifth processing unit. Among them, the first processing unit is used to determine that the dome camera has entered the first abnormal state when the dome camera is in a normal state and the collected image does not include the target object, and instruct the stepper motor in the gimbal to stop working; the second process The unit is used when the dome camera is in the first abnormal state and the multi-frame images collected at the first preset time do not include the target object, or when the dome camera is in the first abnormal state and the dome camera is in the first preset time The images collected within the time include the target object, determine that the dome camera has entered the second abnormal state, and instruct the camera to reduce the magnification to expand the monitoring range; the third processing unit is used for when the dome camera is in the second abnormal state and in the second preset state. When the target object is not included in the multi-frame images collected at the time, it is determined that the dome camera enters the third abnormal state, and the stepper motor is instructed to drive the camera to return to the preset point and exit the tracking of the target object; the fourth processing unit is used for When the dome camera is in the second abnormal state and the collected image includes the target object, it is determined that the dome camera enters the fourth abnormal state, and the stepping motor in the gimbal is instructed to stop working; the fifth processing unit is used for when the dome camera is in the fourth abnormal state. The fourth abnormal state and the multi-frame images collected by the dome camera within the third preset time all include the target object, or, when the dome camera is in the first abnormal state and the images collected by the dome camera within the first preset time include the target object. The target object, confirm that the dome camera enters the normal state.
其中,发送单元802,用于当向球机发送控制指令的一个周期内,球机从正常状态变为第一异常状态时,向云台发送第一停止指令;或者,发送单元802,用于当向球机发送控制指令的一个周期内,球机从第一异常状态变为正常状态时,如果还有待发送的第二停止指令,则,向云台发送第二停止指令;如果没有待发送的第二停止指令,则,向云台发送第一移动指令;或者,发送单元802,用于当向球机发送控制指令的一个周期内,球机从第一异常状态变为第二异常状态时,如果还有待发送的第三停止指令,则,向云台发送第三停止指令;如果没有待发送的第三停止指令,则,向云台发送第一降低倍率指令;或者,发送单元802,用于当向球机发送控制指令的一个周期内,球机从第二异常状态变为第三异常状态时,如果还有待发送的第二降低倍率指令,则,向云台发送第二降低倍率指令;如果没有待发送的第二降低倍率指令,则,向云台发送第一返回预置点指令;或者,发送单元802,用于当向球机发送控制指令的一个周期内,球机从第二异常状态变为第四异常状态时,如果还有待发送的第三降低倍率指令,则,向云台发送第三降低倍率指令;如果没有待发送的第三降低倍率指令,则,向云台发送第四停止指令;或者,发送单元802,用于当向球机发送控制指令的一个周期内,球机从第四异常状态变为正常状态时,如果还有待发送的第五停止指令,则,向云台发送第五停止指令;如果没有待发送的第五停止指令,则,向云台发送最新生成的移动指令;或者,发送单元802,用于当向球机发送控制指令的一个周期内,球机从第四异常状态变为第二异常状态时,如果还有待发送的第六停止指令,则,向云台发送第六停止指令;如果没有待发送的第六停止指令,则,向云台发送第四降低倍率指令。Wherein, the sending unit 802 is used to send the first stop instruction to the PTZ when the dome machine changes from the normal state to the first abnormal state within one cycle of sending the control command to the dome machine; or, the sending unit 802 is used to When the dome camera changes from the first abnormal state to the normal state within one cycle of sending the control command to the dome camera, if there is a second stop command to be sent, it will send the second stop command to the PTZ; if there is no second stop command to be sent If the second stop command is given, then send the first movement command to the PTZ; or, the sending unit 802 is used to change the dome machine from the first abnormal state to the second abnormal state within one cycle of sending the control command to the dome machine When there is still a third stop command to be sent, send a third stop command to the PTZ; if there is no third stop command to be sent, send a first lower magnification command to the PTZ; or, the sending unit 802 , used to send the second reduction ratio command to the PTZ when the dome camera changes from the second abnormal state to the third abnormal state within one cycle of sending the control command to the dome camera, if there is still a second reduction ratio command to be sent. magnification command; if there is no second magnification reduction command to be sent, send the first return preset point command to the pan/tilt; When changing from the second abnormal state to the fourth abnormal state, if there is still a third command to reduce the magnification to be sent, send the third command to reduce the magnification to the PTZ; if there is no third command to reduce the magnification to be sent, send the command to The PTZ sends the fourth stop command; or, the sending unit 802 is used for when the dome machine changes from the fourth abnormal state to the normal state within one cycle of sending the control command to the dome machine, if there is still a fifth stop command to be sent , then, send the fifth stop instruction to the PTZ; if there is no fifth stop instruction to be sent, then send the newly generated movement instruction to the PTZ; or, the sending unit 802 is used to send the control instruction to the ball machine In one cycle, when the dome camera changes from the fourth abnormal state to the second abnormal state, if there is a sixth stop command to be sent, it will send the sixth stop command to the PTZ; if there is no sixth stop command to be sent, Then, send the fourth reduction magnification command to the PTZ.
在一些可能的实现方式中,该装置800还可以包括:第六处理单元。该第六处理单元,用于当球机已经获取到目标对象的关键信息时,确定球机进入第五异常状态,并指示步进电机驱动摄像机返回预置点,退出对目标对象的跟踪。作为一个示例,该发送单元802,可以包括:第一发送子单元和第二发送子单元。其中,第一发送子单元,用于在第一时刻,向云台发送第一指令队列中的第一控制指令;第二发送子单元,用于在第二时刻,向云台发送第二指令队列中的第二控制指令。其中,第一时刻到第二时刻所经历的时间为球机发送控制指令的一个周期,在第一时刻发送的控制指令为第一控制指令,在第二时刻发送的控制指令为第二控制指令;如果截止第一时刻生成的所有控制指令中仅包括移动指令,则,第一指令队列中仅包括的第一控制指令,第一控制指令为第一时刻之前最新生成的移动指令;如果截止第一时刻生成的所有控制指令中包括停止指令、降低倍率指令或返回预置点指令中的至少一个,则,第一指令队列中按照生成顺序依次包括截止第一时刻生成的所有停止指令、降低倍 率指令或返回预置点指令,第一指令队列不包括移动指令,第一控制指令为第一指令队列中生成时刻距离第一时刻的时间最长的指令。In some possible implementations, the apparatus 800 may further include: a sixth processing unit. The sixth processing unit is used for determining that the dome camera has entered the fifth abnormal state when the dome camera has acquired the key information of the target object, and instructing the stepper motor to drive the camera to return to the preset point and exit the tracking of the target object. As an example, the sending unit 802 may include: a first sending subunit and a second sending subunit. The first sending subunit is used to send the first control command in the first command queue to the PTZ at the first moment; the second sending subunit is used to send the second command to the PTZ at the second moment The second control instruction in the queue. Among them, the time from the first time to the second time is one cycle of the ball machine sending the control command, the control command sent at the first time is the first control command, and the control command sent at the second time is the second control command ; If all the control instructions generated at the first moment only include movement instructions, then, the first control instructions only included in the first instruction queue, the first control instructions are the latest generated movement instructions before the first moment; All the control commands generated at a moment include at least one of a stop command, a command to reduce the magnification, or a command to return to a preset point, then the first command queue includes all stop commands, a command to reduce the magnification, and all the stop commands, the magnification decrease, and the commands generated by the first moment in sequence according to the generation sequence. An instruction or a return to a preset point instruction, the first instruction queue does not include a move instruction, and the first control instruction is an instruction in the first instruction queue whose generation time is the longest from the first time.
作为一个示例,如果第一控制指令为第一移动指令,在第一时刻和第二时刻之间,该装置800还可以包括:第一队列更新单元~第三队列更新单元。其中,第一队列更新单元,用于在第三时刻,生成第五停止指令,并将第五停止指令覆盖第一指令队列中的第一移动指令,获得更新后的第一指令队列,更新后的第一指令队列包括第一停止指令;第二队列更新单元,用于在第四时刻,生成第二移动指令,根据更新后的第一指令队列将第二移动指令丢弃;第三队列更新单元,用于在第五时刻,生成第二返回预置点指令,并将第二返回预置点指令添加到更新后的第一指令队列的第五停止指令之后,获得第二指令队列,第二指令队列包括第五停止指令和第二返回预置点指令。该示例下,第二发送子单元,用于向云台发送第五停止指令,以控制云台中的步进电机停止工作。该示例下,发送单元802,还用于在第二时刻之后的第六时刻,向云台发送第二返回预置点指令,以控制云台中的步进电机驱动球机返回预置点,其中,第二时刻到第六时刻所经历的时间为一个周期。As an example, if the first control instruction is the first movement instruction, between the first moment and the second moment, the apparatus 800 may further include: a first queue updating unit to a third queue updating unit. The first queue updating unit is configured to generate a fifth stop instruction at the third moment, and overlay the fifth stop instruction over the first movement instruction in the first instruction queue to obtain the updated first instruction queue, and after the update The first instruction queue includes a first stop instruction; a second queue updating unit is used to generate a second moving instruction at the fourth moment, and discard the second moving instruction according to the updated first instruction queue; the third queue updating unit , used to generate a second return preset point instruction at the fifth moment, and add the second return preset point instruction to the updated fifth stop instruction of the first instruction queue to obtain the second instruction queue, the second instruction The instruction queue includes a fifth stop instruction and a second return to the preset point instruction. In this example, the second sending subunit is configured to send a fifth stop instruction to the PTZ, so as to control the stepping motor in the PTZ to stop working. In this example, the sending unit 802 is further configured to send the second return preset point instruction to the gimbal at the sixth time after the second time, so as to control the stepping motor in the gimbal to drive the dome camera to return to the preset point, wherein , the time from the second moment to the sixth moment is one cycle.
应理解的是,本申请实施例的装置800可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现图3所示的球机控制方法时,装置800及其各个单元也可以为软件模块。It should be understood that the apparatus 800 in this embodiment of the present application may be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), and the PLD may be a complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof. When the ball machine control method shown in FIG. 3 can also be implemented by software, the device 800 and its respective units can also be software modules.
根据本实施例的球机控制装置800可对应于执行本实施例中描述的方法,并且球机控制装置800中的各个单元的上述和其它操作和/或功能分别为了实现图3中的方法的相应流程,为了简洁,在此不再赘述。The dome machine control device 800 according to this embodiment may correspond to executing the method described in this embodiment, and the above-mentioned and other operations and/or functions of each unit in the dome machine control device 800 are respectively for the purpose of realizing the method in FIG. 3 . For the sake of brevity, the corresponding process is not repeated here.
图9为本实施例提供的一种球机控制设备900的示意图,如图所示,所述球机控制设备900包括处理器901、存储器902、通信接口903和内存单元904。其中,处理器901、存储器902、通信接口903、内存单元904通过总线905进行通信,也可以通过无线传输等其他手段实现通信。该存储器902用于存储指令,该处理器901用于执行该存储器902存储的指令。该存储器902存储程序代码,且处理器901可以调用存储器902中存储的程序代码执行以下操作:FIG. 9 is a schematic diagram of a ball machine control device 900 provided in this embodiment. As shown in the figure, the ball machine control device 900 includes a processor 901 , a memory 902 , a communication interface 903 and a memory unit 904 . The processor 901, the memory 902, the communication interface 903, and the memory unit 904 communicate through the bus 905, and can also communicate through other means such as wireless transmission. The memory 902 is used for storing instructions, and the processor 901 is used for executing the instructions stored in the memory 902 . The memory 902 stores program codes, and the processor 901 can call the program codes stored in the memory 902 to perform the following operations:
确定待跟踪的目标对象;Determine the target object to be tracked;
周期性向球机发送控制指令,所述控制指令用于控制所述球机中云台的步进电机以驱动所述球机中摄像机转动至所述目标对象所在的监控区域;Periodically send control commands to the dome camera, where the control commands are used to control the stepping motor of the pan/tilt in the dome camera to drive the camera in the dome camera to rotate to the monitoring area where the target object is located;
基于所述球机中摄像机采集的图像跟踪所述目标对象。The target object is tracked based on images collected by a camera in the dome camera.
应理解,在本申请实施例中,该处理器901可以是CPU,该处理器901还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。It should be understood that in this embodiment of the present application, the processor 901 may be a CPU, and the processor 901 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like.
该存储器902可以包括只读存储器和随机存取存储器,并向处理器901提供指令和数据。存储器902还可以包括非易失性随机存取存储器。例如,存储器902还可以存储设备类型的信息。The memory 902 , which may include read-only memory and random access memory, provides instructions and data to the processor 901 . Memory 902 may also include non-volatile random access memory. For example, memory 902 may also store device type information.
该存储器902可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读 存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The memory 902 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), Double data rate synchronous dynamic random access memory (double data date SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct Memory bus random access memory (direct rambus RAM, DR RAM).
该总线905除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线905。In addition to the data bus, the bus 905 may also include a power bus, a control bus, a status signal bus, and the like. However, for the sake of clarity, the various buses are labeled as bus 905 in the figure.
应理解,根据本申请实施例的球机控制设备900可对应于本申请实施例中的球机控制装置800,并可以对应于执行根据本申请实施例中图3所示方法中的相应主体,并且球机控制设备900中的各个模块的上述和其它操作和/或功能分别为了实现图3中的各个方法的相应流程,为了简洁,在此不再赘述。It should be understood that the ball machine control device 900 according to the embodiment of the present application may correspond to the ball machine control device 800 in the embodiment of the present application, and may correspond to the corresponding subject in executing the method shown in FIG. 3 according to the embodiment of the present application, In addition, the above and other operations and/or functions of each module in the ball machine control device 900 are to implement the corresponding flow of each method in FIG. 3 , and are not repeated here for brevity.
作为另一种可能的实施例,本申请还提供一种监控系统,该监控系统包括第一设备、第二设备和处理设备,处理设备分别和所述第一设备、所述第二设备通信。其中,第一设备,用于获取固定监控范围内的图像,并将包括目标对象的第一图像发送给处理设备;处理设备,用于执行上述如图3所示的方法的各个操作步骤,向第二设备发送控制指令,实现对第二设备的控制,为了简洁在此不再赘述;第二设备,用于基于处理设备发送的控制指令,完成对目标对象的跟踪。As another possible embodiment, the present application further provides a monitoring system, where the monitoring system includes a first device, a second device, and a processing device, and the processing device communicates with the first device and the second device respectively. Wherein, the first device is used to acquire an image within a fixed monitoring range, and send the first image including the target object to the processing device; the processing device is used to execute each operation step of the above-mentioned method as shown in FIG. The second device sends a control instruction to control the second device, which is not repeated here for brevity; the second device is used to complete the tracking of the target object based on the control instruction sent by the processing device.
其中,第二设备为球机。第一设备可以是枪机。具体结构可以参加图1。Wherein, the second device is a ball machine. The first device may be a bolt action. The specific structure can be found in Figure 1.
作为一个示例,该监控系统还可以包括中心设备,处理设备,还用于获取目标对象的关键信息,并将关键信息发送给所述中心设备;中心设备,用于对关键信息进行分析和处理。As an example, the monitoring system may further include a central device and a processing device, which are further used to acquire key information of the target object and send the key information to the central device; the central device is used to analyze and process the key information.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media. The semiconductor medium may be a solid state drive (SSD).
以上所述,仅为本申请的具体实施方式。熟悉本技术领域的技术人员根据本申请提供的具体实施方式,可想到变化或替换,都应涵盖在本申请的保护范围之内。The above descriptions are merely specific embodiments of the present application. Those skilled in the art can think of changes or substitutions based on the specific embodiments provided in the present application, which should all fall within the protection scope of the present application.

Claims (20)

  1. 一种球机控制方法,其特征在于,包括:A ball machine control method, comprising:
    确定待跟踪的目标对象;Determine the target object to be tracked;
    周期性向球机发送控制指令,所述控制指令用于控制所述球机中云台的步进电机以驱动所述球机中摄像机转动至所述目标对象所在的监控区域;Periodically send control commands to the dome camera, where the control commands are used to control the stepping motor of the pan/tilt in the dome camera to drive the camera in the dome camera to rotate to the monitoring area where the target object is located;
    基于所述球机中摄像机采集的图像跟踪所述目标对象。The target object is tracked based on images collected by a camera in the dome camera.
  2. 根据权利要求1所述的方法,其特征在于,向所述球机发送所述控制指令的周期大于所述步进电机的激励响应时延。The method according to claim 1, wherein the period of sending the control command to the dome camera is greater than the excitation response delay of the stepper motor.
  3. 根据权利要求1或2述方法,其特征在于,在所述周期性向球机发送控制指令之前,所述方法还包括:The method according to claim 1 or 2, wherein before the periodic sending of control instructions to the ball machine, the method further comprises:
    根据所述图像中目标对象的跟踪结果确定所述控制指令,所述跟踪结果包括正常状态和异常状态。The control instruction is determined according to the tracking result of the target object in the image, and the tracking result includes a normal state and an abnormal state.
  4. 根据权利要求3所述方法,其特征在于,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    当所述目标对象的跟踪结果为正常状态时,所述控制指令为第一控制指令,所述第一控制指令用于指示所述球机继续跟踪所述目标对象。When the tracking result of the target object is in a normal state, the control instruction is a first control instruction, and the first control instruction is used to instruct the dome camera to continue tracking the target object.
  5. 根据权利要求4所述方法,其特征在于,所述周期性向所述球机发送控制指令,包括:The method according to claim 4, wherein the periodically sending a control command to the ball machine comprises:
    向所述球机发送同一周期中最新生成的第一控制指令。Send the newly generated first control instruction in the same cycle to the ball machine.
  6. 根据权利要求4或5所述的方法,其特征在于,所述根据所述图像中目标对象的跟踪结果确定所述控制指令,包括:The method according to claim 4 or 5, wherein the determining the control instruction according to the tracking result of the target object in the image comprises:
    按照预设规则确定所述第一控制指令,所述预设规则包括根据所述球机中摄像机的倍率和比例积分微分PID参数组确定所述第一控制指令。The first control instruction is determined according to a preset rule, and the preset rule includes determining the first control instruction according to the magnification of the camera in the dome camera and the proportional-integral-derivative PID parameter group.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述球机中摄像机的倍率和比例积分微分PID参数组确定所述第一控制指令,包括:The method according to claim 6, wherein the determining the first control command according to the magnification of the camera in the dome camera and the proportional-integral-derivative PID parameter group comprises:
    根据所述球机中摄像机当前的倍率,确定所述倍率对应的所述PID参数组;According to the current magnification of the camera in the dome camera, determine the PID parameter group corresponding to the magnification;
    根据所述PID参数组,确定第一调整速度和第二调整速度;According to the PID parameter group, determine the first adjustment speed and the second adjustment speed;
    根据所述第一调整速度和所述第二调整速度确定所述第一控制指令。The first control command is determined according to the first adjustment speed and the second adjustment speed.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述PID参数组确定第一调整速度,包括:The method according to claim 7, wherein the determining the first adjustment speed according to the PID parameter group comprises:
    根据所述PID参数和第一方向上的第一偏差,确定所述第一调整速度,其中,所述第一偏差为所述图像的中心点和所述图像中所述目标对象所在区域的中心点之间在所述第一方向上的距离。The first adjustment speed is determined according to the PID parameters and the first deviation in the first direction, wherein the first deviation is the center point of the image and the center of the area where the target object is located in the image The distance between points in the first direction.
  9. 根据权利要求8所述的方法,其特征在于,在所述根据所述PID参数和第一方向上的第一偏差确定所述第一调整速度之前,所述方法还包括:The method according to claim 8, wherein before the determining the first adjustment speed according to the PID parameter and the first deviation in the first direction, the method further comprises:
    如果所述第一偏差小于预设的第一偏差阈值,则,将所述第一偏差置零,所述第一偏差阈值基于所述图像预设的中心区域确定。If the first deviation is smaller than a preset first deviation threshold, the first deviation is set to zero, and the first deviation threshold is determined based on a preset central area of the image.
  10. 根据权利要求7-9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 7-9, wherein the method further comprises:
    如果所述第一调整速度位于死区范围内,则,将所述第一调整速度置零,所述死区范围根据所述步进电机的调整精度确定。If the first adjustment speed is within the dead zone range, the first adjustment speed is set to zero, and the dead zone range is determined according to the adjustment precision of the stepper motor.
  11. 根据权利要求6-10任一项所述的方法,其特征在于,所述预设规则还包括根据所述目标对象在预设方向上占所述图像的比例确定所述第一控制指令。The method according to any one of claims 6-10, wherein the preset rule further comprises determining the first control instruction according to the proportion of the target object in the image in a preset direction.
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述目标对象在预设方向上占 所述图像的比例确定所述第一控制指令,包括:The method according to claim 11, wherein, determining the first control instruction according to the proportion of the target object in the image in a preset direction, comprising:
    获取在所述预设方向上所述目标对象占所述图像的比例;obtaining the proportion of the target object in the image in the preset direction;
    根据所述比例和预设比例阈值,确定目标倍率调整速度,所述目标倍率调整速度为预设倍率调整速度或所述预设倍率调整速度的相反数;determining a target magnification adjustment speed according to the ratio and a preset ratio threshold, and the target magnification adjustment speed is a preset magnification adjustment speed or an opposite number of the preset magnification adjustment speed;
    根据所述目标倍率调整速度确定所述第一控制指令。The first control command is determined according to the target magnification adjustment speed.
  13. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    当所述目标对象的跟踪结果为异常状态时,所述控制指令为第二控制指令,所述第二指令用于指示所述球机在所述异常状态时执行对所述球机的控制。When the tracking result of the target object is in an abnormal state, the control instruction is a second control instruction, and the second instruction is used to instruct the dome camera to control the dome camera in the abnormal state.
  14. 根据权利要求13所述的方法,其特征在于,所述根据所述图像中目标对象的跟踪结果确定所述控制指令,包括:The method according to claim 13, wherein the determining the control instruction according to the tracking result of the target object in the image comprises:
    按照预设规则确定所述第二控制指令,所述预设规则包括根据所述异常状态的类型确定所述第二控制指令,所述第二控制指令包括下述指令中的至少一个:停止指令、降低倍率指令或返回预置点指令。The second control instruction is determined according to a preset rule, the preset rule includes determining the second control instruction according to the type of the abnormal state, and the second control instruction includes at least one of the following instructions: a stop instruction , reduce the magnification command or return to the preset point command.
  15. 根据权利要求14所述方法,其特征在于,所述周期性向所述球机发送控制指令,包括:The method according to claim 14, wherein the periodically sending a control command to the ball machine comprises:
    向所述球机发送指令队列中保存的最早生成的第二控制指令。Send the earliest generated second control instruction stored in the instruction queue to the ball machine.
  16. 一种球机控制装置,其特征在于,包括:A ball machine control device, characterized in that it includes:
    确定单元,用于确定待跟踪的目标对象;a determination unit for determining the target object to be tracked;
    发送单元,用于周期性向球机发送控制指令,所述控制指令用于控制所述球机中云台的步进电机以驱动所述球机中摄像机转动至所述目标对象所在的监控区域;The sending unit is used to periodically send control instructions to the dome camera, and the control instructions are used to control the stepping motor of the pan/tilt in the dome camera to drive the camera in the dome camera to rotate to the monitoring area where the target object is located;
    跟踪单元,用于基于所述球机中摄像机采集的图像跟踪所述目标对象。A tracking unit, configured to track the target object based on the image collected by the camera in the dome camera.
  17. 根据权利要求16所述的装置,其特征在于,向所述球机发送所述控制指令的周期大于所述步进电机的激励响应时延。The device according to claim 16, wherein the period of sending the control command to the dome camera is greater than the excitation response delay of the stepping motor.
  18. 根据权利要求16或17所述装置,其特征在于,The device according to claim 16 or 17, characterized in that:
    所述确定单元,还用于在所述周期性向球机发送控制指令之前,根据所述图像中目标对象的跟踪结果确定所述控制指令,所述跟踪结果包括正常状态和异常状态。The determining unit is further configured to determine the control instruction according to the tracking result of the target object in the image before the periodic sending of the control instruction to the dome camera, where the tracking result includes a normal state and an abnormal state.
  19. 根据权利要求16至18任一项所述装置,其特征在于,所述发送单元,还用于:The device according to any one of claims 16 to 18, wherein the sending unit is further configured to:
    向所述球机发送同一周期中最新生成的控制指令。Send the newly generated control command in the same cycle to the ball machine.
  20. 一种球机控制的设备,其特征在于,包括处理器和存储器;所述存储器,用于存储计算机指令;所述处理器,用于根据所述计算机指令执行如上述权利要求1-15任一项所述的方法操作步骤。A device controlled by a ball machine, characterized in that it includes a processor and a memory; the memory is used to store computer instructions; the processor is used to execute any one of claims 1-15 according to the computer instructions The operation steps of the method described in the item.
PCT/CN2021/099895 2020-07-31 2021-06-12 Dome camera control method, apparatus, and device WO2022022118A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010760555.1A CN114071069A (en) 2020-07-31 2020-07-31 Ball machine control method, device and equipment
CN202010760555.1 2020-07-31

Publications (1)

Publication Number Publication Date
WO2022022118A1 true WO2022022118A1 (en) 2022-02-03

Family

ID=80037112

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/099895 WO2022022118A1 (en) 2020-07-31 2021-06-12 Dome camera control method, apparatus, and device

Country Status (2)

Country Link
CN (1) CN114071069A (en)
WO (1) WO2022022118A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115396590A (en) * 2022-07-05 2022-11-25 浙江大华技术股份有限公司 Gun and ball linkage equipment control method and device, terminal equipment and storage medium
CN115760910A (en) * 2022-10-20 2023-03-07 浙江大华技术股份有限公司 Target tracking method and device of gun and ball linkage equipment, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000083246A (en) * 1998-09-04 2000-03-21 Canon Inc Camera control system, camera control method, and recording medium stored with program to execute processing thereof
CN104184932A (en) * 2013-05-20 2014-12-03 浙江大华技术股份有限公司 Spherical camera control method and device thereof
CN105955311A (en) * 2016-05-11 2016-09-21 阔地教育科技有限公司 Tracking control method, tracking control device and tracking control system
CN106408551A (en) * 2016-05-31 2017-02-15 北京格灵深瞳信息技术有限公司 Monitoring device controlling method and device
CN107016367A (en) * 2017-04-06 2017-08-04 北京精英智通科技股份有限公司 A kind of tracking and controlling method and tracking control system
CN111385474A (en) * 2020-03-09 2020-07-07 浙江大华技术股份有限公司 Target object tracking method and device, storage medium and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000083246A (en) * 1998-09-04 2000-03-21 Canon Inc Camera control system, camera control method, and recording medium stored with program to execute processing thereof
CN104184932A (en) * 2013-05-20 2014-12-03 浙江大华技术股份有限公司 Spherical camera control method and device thereof
CN105955311A (en) * 2016-05-11 2016-09-21 阔地教育科技有限公司 Tracking control method, tracking control device and tracking control system
CN106408551A (en) * 2016-05-31 2017-02-15 北京格灵深瞳信息技术有限公司 Monitoring device controlling method and device
CN107016367A (en) * 2017-04-06 2017-08-04 北京精英智通科技股份有限公司 A kind of tracking and controlling method and tracking control system
CN111385474A (en) * 2020-03-09 2020-07-07 浙江大华技术股份有限公司 Target object tracking method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN114071069A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
WO2022022118A1 (en) Dome camera control method, apparatus, and device
US8218011B2 (en) Object tracking system, method and smart node using active camera handoff
CN110163885B (en) Target tracking method and device
JP6786378B2 (en) Information processing equipment, information processing methods and programs
US20160189501A1 (en) Security monitoring system and corresponding alarm triggering method
US10740887B2 (en) Method and system for automated video image focus change detection and classification
JP2006081125A (en) Imaging system and imaging method
CN111340857B (en) Tracking control method and device for camera
WO2014026586A1 (en) Method and system for movement detection and service server
CN103929592A (en) All-dimensional intelligent monitoring equipment and method
CN112104842B (en) Image acquisition equipment correction method, device, equipment and medium
WO2016125946A1 (en) Panorama image monitoring system using plurality of high-resolution cameras, and method therefor
US20050007479A1 (en) Multiple object processing in wide-angle video camera
CN106657775A (en) Tracking monitoring method, apparatus and system
CN111314609A (en) Method and device for controlling pan-tilt tracking camera shooting
KR101290782B1 (en) System and method for Multiple PTZ Camera Control Based on Intelligent Multi-Object Tracking Algorithm
CN115174861A (en) Method and device for automatically tracking moving target by pan-tilt camera
CN105245845A (en) Method for controlling camera to follow and shoot automatically based on gathering trend in match field
WO2024002022A1 (en) Photographing composition method and apparatus, and computer device and storage medium
KR20150019230A (en) Method and apparatus for tracking object using multiple camera
KR20210108691A (en) apparatus and method for multi-channel image back-up based on event, and network surveillance camera system including the same
JP2018107587A (en) Monitoring system
CN116017136A (en) Shooting equipment control method and device, storage medium and electronic device
US20170019585A1 (en) Camera clustering and tracking system
WO2021197259A1 (en) Method and apparatus for determining picture switching, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21849476

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21849476

Country of ref document: EP

Kind code of ref document: A1