WO2024051330A1 - 摄像机控制方法及相关装置 - Google Patents

摄像机控制方法及相关装置 Download PDF

Info

Publication number
WO2024051330A1
WO2024051330A1 PCT/CN2023/105331 CN2023105331W WO2024051330A1 WO 2024051330 A1 WO2024051330 A1 WO 2024051330A1 CN 2023105331 W CN2023105331 W CN 2023105331W WO 2024051330 A1 WO2024051330 A1 WO 2024051330A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
video image
motor speed
target object
target
Prior art date
Application number
PCT/CN2023/105331
Other languages
English (en)
French (fr)
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 WO2024051330A1 publication Critical patent/WO2024051330A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • 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

Definitions

  • the present application relates to the field of video surveillance technology, and in particular to a camera control method and related devices.
  • pan/tilt/zoom (PTZ) cameras are usually used to capture target objects.
  • the PTZ camera includes three independent pan/tilt motors. By adjusting the speed of these three pan/tilt motors, the PTZ camera can be controlled to rotate horizontally, vertically, and zoom respectively, allowing the PTZ camera to capture target objects in a wide range for a long time.
  • a PTZ camera collects video images and determines the imaging position and imaging size of the target object in the video image, and then determines the position deviation between the imaging position of the target object and the preset position, and the imaging size of the target object and the preset position. Let the size deviation between sizes. Based on the position deviation and the size deviation, the proportional-integral-derivative (PID) algorithm is used to determine the rotation speed of the pan/tilt motor, thereby controlling the PTZ camera.
  • PID proportional-integral-derivative
  • This application provides a camera control method and related devices, which can solve the problem of poor performance of the related technology PTZ camera in photographing target objects.
  • the technical solutions are as follows:
  • a camera control method is provided.
  • the imaging data of the target object in the target video image is determined.
  • the imaging data includes imaging size and imaging position.
  • the target video image is a frame of image collected by the camera, and the target object is the object being photographed by the camera.
  • the first motor speed is determined based on the imaging position of the target object and the imaging position of the control dead zone in the target video image.
  • the control dead zone refers to the area where the rotation speed of the gimbal motor is zero.
  • the gain factor is determined. According to the gain factor, the first motor speed is adjusted to obtain the second motor speed.
  • the pan/tilt motor is controlled based on the rotation speed of the second motor to control the camera.
  • the first motor speed is adjusted according to the gain factor to obtain the second motor speed, and then the pan/tilt motor is controlled by the second motor speed, so that the camera can capture the target object in a wide range for a long time. That is, the rotation speed of the pan/tilt motor included in the camera is obtained by adjusting the rotation speed of the first motor according to the gain factor, and is not directly determined based on the position deviation and size deviation. Since the gain factor is determined based on the imaging size and imaging position of the target object, as well as the optical magnification and pitch angle of the camera, for different scenarios, the method of this application can fully combine the factors that affect the camera's shooting of the target object in different scenarios. Many factors can be used to accurately determine the rotation speed of the gimbal motor suitable for different scenes, so that the camera can stably and successfully shoot target objects in different scenes, thereby improving the performance of the camera in shooting target objects.
  • the controller determines a position error between the target object and the control dead zone based on the imaging position of the target object and the imaging position of the control dead zone.
  • the position error includes a horizontal position error and a vertical position error. Based on the position error, the first motor is determined Rotating speed.
  • the rotation speed of the camera pan/tilt motor is 0. That is to say, when the target object is in the control dead zone, the rotation speed of the camera pan/tilt motor is 0. At this time, the camera cannot perform horizontal rotation, vertical rotation, zoom, etc.
  • the controller Before the controller determines the first motor speed based on the imaging position of the target object and the imaging position of the control dead zone in the target video image, it also needs to determine the imaging position of the control dead zone in the target video image.
  • the imaging position of the control dead zone in the target video image is fixed. That is, different optical magnifications correspond to the same control dead zone size.
  • the controller uses the center position of the target video image as the center position of the control dead zone, and based on the default size and The center position of the control dead zone determines the position of each boundary of the control dead zone, and then the two adjacent boundaries of the control dead zone are connected to each other to obtain the control dead zone in the target video image, thereby determining the control dead zone in the target video image.
  • the imaging position of the dead zone is fixed. That is, different optical magnifications correspond to the same control dead zone size.
  • the imaging position of the control dead zone in the target video image mentioned above is fixed.
  • the optical magnification of the camera increases, the field of view of the camera gradually decreases.
  • the target object oscillates repeatedly in the target video image when the optical magnification is large.
  • the controller determines the size of the control dead zone based on the optical magnification of the camera, where the size of the control dead zone is positively correlated with the optical magnification of the camera, and then determines the control dead zone in the target video image based on the size of the control dead zone. imaging position.
  • the controller determines the gain factor based on the imaging data of the target object and the operating parameters of the camera.
  • the controller Based on the stored fuzzy rules, the controller performs fuzzy control on the imaging data of the target object and the working parameters of the camera to obtain the gain factor.
  • the controller performs fuzzy control on the imaging data of the target object and the working parameters of the camera based on the stored fuzzy rules according to the following steps (1)-(4) to obtain the gain factor.
  • the controller fuzzifies each data in the imaging data and the working parameters respectively to obtain the membership degree of each data belonging to its corresponding fuzzy level.
  • the controller determines the target fuzzy rule from the stored fuzzy rules based on the membership degree of each data belonging to the corresponding fuzzy level.
  • the controller Based on the membership degree of each data belonging to the corresponding fuzzy level, the controller performs fuzzy logic reasoning on the target fuzzy rule to obtain the membership degree of the gain factor belonging to its corresponding fuzzy level.
  • the controller defuzzifies the membership degree of the gain factor belonging to its corresponding fuzzy level to obtain the gain factor.
  • the controller adjusts the first motor speed according to the gain factor to obtain the second motor speed.
  • the controller controls the pan/tilt motor based on the rotation speed of the second motor to control the camera.
  • the controller controls the pan/tilt motor based on the second motor speed to control the camera.
  • the controller controls the gimbal motor based on the second motor speed to control the camera. The detailed implementation process is different, so the following two situations will be introduced separately.
  • the target object when the target object is located in the edge deceleration zone of the target video image and the movement direction of the target object is toward the center of the target video image, the target object is determined based on the imaging position of the target object and the center position of the target video image. The distance between the geometric center of the target object and the geometric center of the target video image. Based on the distance between the geometric center of the target object and the geometric center of the target video image, the edge damping coefficient is determined, and the second motor speed is adjusted according to the edge damping coefficient. , to obtain the third motor speed, and control the pan/tilt motor according to the third motor speed to control the camera.
  • the rotation speed of the camera's gimbal motor should not be too high, so as to avoid blurring of the video image captured by the camera due to excessive rotation speed of the gimbal motor.
  • the second motor speed is adjusted through the edge damping coefficient. This is used to reduce the rotation speed of the gimbal motor, thereby improving the camera's success rate in shooting target objects located in the edge area of the target video image.
  • the reference motor speed refers to the motor speed used when controlling the gimbal motor through the reference video image.
  • the reference video image is a frame of image located before the target video image.
  • the second motor rotation speed is adjusted to obtain the fourth motor rotation speed, according to Four motor speed controls the gimbal motor to control the camera.
  • the reference video image is the frame image located before the target video image and closest to the target video image. That is, the reference video image is a frame of image located before the target video image and adjacent to the target video image. Alternatively, the reference video image is located in the target view A frame of image before the target video image, and the number of image frames separated from the target video image is less than the frame number threshold.
  • the frame number threshold is set in advance, and the frame number threshold can be adjusted according to different needs.
  • each image frame that is located in front of the target video image and is separated from the target video image by less than the frame number threshold is not much different from the target video image. Therefore, it can be placed in front of the target video image and is separated from the target video image.
  • An image in which the number of image frames between video images is less than the frame number threshold is determined as a reference video image.
  • the controller performs time sequence oscillation detection on the second motor speed and the reference motor speed. If the direction of the second motor speed is different from the reference motor speed, and the absolute value of the difference between the second motor speed and the reference motor speed is greater than the speed threshold. In this case, it indicates that compared with the reference video image, the direction of the second motor speed of the target video image is different from the direction of the reference motor speed, and the difference between the second motor speed and the reference motor speed is larger. In this way, when the controller controls the pan/tilt motor according to the second motor speed, the target object oscillates in the target video image, causing the camera to be unable to stably capture the target object. At this time, the controller adjusts the second motor speed to obtain the fourth motor speed, and then controls the pan/tilt motor according to the fourth motor speed, thereby further weakening the oscillation of the camera and ensuring that the camera can stably capture the target object.
  • the controller controlling the gimbal motor based on the second motor speed is only an example.
  • the controller determines the second motor speed according to the above steps, it can directly control the pan/tilt motor according to the second motor speed to control the camera.
  • a camera control device In a second aspect, a camera control device is provided.
  • the camera control device has the function of realizing the behavior of the camera control method in the first aspect.
  • the camera control device includes at least one module, and the at least one module is used to implement the camera control method provided in the first aspect.
  • a computer device in a third aspect, includes a processor and a memory, and the memory is used to store a computer program for executing the camera control method provided in the first aspect.
  • the processor is configured to execute a computer program stored in the memory to implement the camera control method described in the first aspect.
  • the computer device may further include a communication bus used to establish a connection between the processor and the memory.
  • a computer-readable storage medium is provided. Instructions are stored in the storage medium. When the instructions are run on a computer, they cause the computer to execute the steps of the camera control method described in the first aspect.
  • a computer program product containing instructions is provided, which when the instructions are run on a computer, causes the computer to execute the steps of the camera control method described in the first aspect.
  • a computer program is provided, which when the computer program is run on a computer, causes the computer to execute the steps of the camera control method described in the first aspect.
  • Figure 1 is a flow chart of a camera control method provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of determining the position error between a target object and a control dead zone provided by an embodiment of the present application
  • Figure 3 is a schematic diagram of dead zone control under different optical magnifications provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of a controller determining target fuzzy rules provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of a target video image including an edge deceleration area and a central acceleration area provided by an embodiment of the present application;
  • Figure 6 is a schematic diagram of a motor speed timing oscillation detection provided by an embodiment of the present application.
  • Figure 7 is an application schematic diagram of a camera control method provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of a camera control process provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a camera control device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • Fuzzy control refers to an intelligent control method based on fuzzy rules, fuzzy levels and fuzzy logical reasoning. This method first formulates fuzzy rules based on the experience of operators or experts, and then fuzzifies the data to obtain the membership degree of the data belonging to its own corresponding fuzzy level. Finally, based on the membership degree of the data belonging to its own corresponding fuzzy level, the fuzzy rules are Carry out fuzzy logic reasoning to get the final result.
  • the camera control method provided by the embodiments of this application can be applied to a variety of scenarios, such as traffic scenarios, airport or port monitoring scenarios, park boundary monitoring scenarios, and monitoring scenarios such as power stations, scenic spots, parks, entrances and exits.
  • the camera control method provided in the embodiments of the present application is used to adjust the optical magnification of the camera and amplify the video image so that the camera can clearly The appearance and license plate of the vehicle can be captured accurately, thereby improving the success rate of capturing this behavior.
  • the operator in order to see the detailed characteristics of a moving target object, the operator can mark the target object in the video image. Then, the camera is controlled through the camera control method provided by the embodiment of the present application, so that the camera can capture the target object for a long time.
  • the operator can also set the duration for the camera to capture the target object. After the duration is reached, adjust the rotation speed of the pan/tilt motor included in the camera, thereby controlling the video image collected by the camera to be the initial video image.
  • the camera control method provided in the embodiment of this application is combined with the intelligent behavior analysis method.
  • the camera is controlled to capture the target object in a wide range for a long time.
  • alarm information can also be generated and reported to the management center.
  • operators can set target areas and control cameras to capture target objects located in the target areas.
  • the camera is controlled to give priority to the target object closest to the camera, or the camera is controlled to give priority to the target object moving the fastest.
  • the camera includes an imager, a controller and a pan/tilt motor.
  • the imager is used to collect video images
  • the controller is used to determine the imaging data of the target object in the video image, and adaptively adjust it based on the imaging data of the target object and the working parameters of the camera.
  • the rotation speed of the gimbal motor causes the camera to rotate horizontally, vertically, and zoom, allowing the camera to capture target objects in a wide range for a long time.
  • the execution subject of the camera control method provided by the embodiment of the present application is the above-mentioned controller.
  • Figure 1 is a flow chart of a camera control method provided by an embodiment of the present application. Please refer to Figure 1. The method includes the following steps.
  • Step 101 The controller determines the imaging data of the target object in the target video image.
  • the imaging data includes the imaging size and imaging position.
  • the target video image is a frame of image collected by the camera, and the target object is the object being photographed by the camera.
  • the controller determines the imaging size and imaging position of the target object in the target video image through an image detection algorithm. In other embodiments, the controller performs image processing on the target video image to obtain the target shooting frame, and the target object is located within the target shooting frame. Then, the size of the target shooting frame is determined as the imaging size of the target object, and the position of the target shooting frame is determined as the imaging position of the target object.
  • the camera includes an imager and a controller.
  • the controller can determine the target through the target video image collected by the imager. Imaging data of target objects in video images. That is, after the imager collects the target video image, it sends the target video image to the controller. After receiving the target video image sent by the imager, the controller performs image detection on the target video image to obtain imaging data of the target object in the target video image.
  • the controller can also determine the imaging data of the target object in the target video image through other methods, which is not limited in the embodiments of the present application.
  • Step 102 The controller obtains the working parameters of the camera, which include optical magnification and pitch angle.
  • the pitch angle of the camera is the angle between the camera and the horizontal direction.
  • the working parameters of the camera can also include other parameters, which are not limited in the embodiments of the present application.
  • Step 103 The controller determines the first motor speed based on the imaging position of the target object and the imaging position of the control dead zone in the target video image.
  • the control dead zone refers to the area where the rotation speed of the gimbal motor is zero.
  • the controller determines a position error between the target object and the control dead zone based on the imaging position of the target object and the imaging position of the control dead zone.
  • the position error includes a horizontal position error and a vertical position error. Based on the position error, the first motor is determined Rotating speed.
  • the imaging position of the control dead zone can be determined from the target video image. Therefore, after the controller determines the imaging position of the target object according to the above step 101, it can determine the target object and the control dead zone. position error between.
  • the implementation process of determining the horizontal position error between the target object and the control dead zone includes: determining the horizontal position error between the target object and the control dead zone when the geometric center of the target object is located within the horizontal range indicated by the control dead zone.
  • the horizontal position error is 0.
  • the implementation process of determining the vertical position error between the target object and the control dead zone includes: determining the vertical position between the target object and the control dead zone when the geometric center of the target object is within the vertical range indicated by the control dead zone. The error is 0. In the case where the geometric center of the target object is not located within the vertical range indicated by the control dead zone, determine the vertical distance between the geometric center of the target object and each boundary within the vertical range indicated by the control dead zone, respectively, to obtain Multiple distances, and the smallest distance among the multiple distances is determined as the vertical position error between the target object and the control dead zone.
  • the horizontal range indicated by the control dead zone refers to the range between the straight lines where the two farthest points in the horizontal direction of the control dead zone are located.
  • the vertical range indicated by the control dead zone refers to the range between the straight lines between the two farthest points in the vertical direction of the control dead zone.
  • FIG. 2 is a schematic diagram of determining a position error between a target object and a control dead zone according to an embodiment of the present application.
  • the solid line box with thin lines outside represents the target video image
  • the solid line box with thick lines inside represents the control dead zone in the target video image.
  • the control dead zone includes 4 boundaries, and the black dots represent the target object. the geometric center.
  • the vertical position error between the target object and the control dead zone is 0.
  • the geometric center of the target object is not located within the horizontal range indicated by the control dead zone, and the vertical distance D1 between the geometric center of the target object and the first boundary of the control dead zone is the smallest. Therefore, the geometric center of the target object is The vertical distance D1 between the first boundaries of the dead zone is determined as the horizontal position error between the target object and the control dead zone.
  • the controller determines the position error between the target object and the control dead zone according to the above steps, it determines the first motor speed through the PID algorithm based on the position error.
  • the rotation speed of the camera pan/tilt motor is 0. That is to say, when the target object is in the control dead zone, the rotation speed of the camera pan/tilt motor is 0. At this time, the camera cannot perform horizontal rotation, vertical rotation, zoom, etc.
  • the controller Before the controller determines the first motor speed based on the imaging position of the target object and the imaging position of the control dead zone in the target video image, it also needs to determine the imaging position of the control dead zone in the target video image.
  • the imaging position of the control dead zone in the target video image is fixed. That is, different optical magnifications correspond to the same control dead zone size.
  • the controller takes the center position of the target video image as the center position of the control dead zone, and determines the position of each boundary of the control dead zone based on the default size of the control dead zone and the center position of the control dead zone, and then adjusts the control dead zone accordingly.
  • the two adjacent boundaries are connected to each other to obtain the control dead zone in the target video image, thereby determining the imaging position of the control dead zone in the target video image.
  • the implementation process of determining the position of each boundary of the control dead zone based on the default size of the control dead zone and the center position of the control dead zone includes: the controller determines the position of each boundary of the control dead zone based on the default size of the control dead zone and the aspect ratio of the control dead zone, Determine the length of the control dead zone and the width of the control dead zone. Then, a position whose vertical distance from the center position of the control dead zone is half the length is determined as the position of the first boundary of the control dead zone, and a position whose vertical distance is half the length from the center position of the control dead zone.
  • the position of is determined as the position of the second boundary of the control dead zone, and the position whose vertical distance from the center position of the control dead zone is half the width is determined as the position of the third boundary of the control dead zone.
  • the position where the vertical distance between the center positions is half the width is determined as the position of the fourth boundary of the control dead zone.
  • the imaging position of the control dead zone in the target video image mentioned above is fixed.
  • the optical magnification of the camera increases, the field of view of the camera gradually decreases.
  • the target object oscillates repeatedly in the target video image when the optical magnification is large.
  • the controller determines the size of the control dead zone based on the optical magnification of the camera, where the size of the control dead zone is positively correlated with the optical magnification of the camera, and further determines the size of the control dead zone in the target video image based on the size of the control dead zone. Controls the imaging position of the dead zone.
  • the controller determines the size of the control dead zone based on the optical magnification of the camera according to the following formula (1).
  • deadzone represents the size of the control dead zone
  • k 1 represents the first proportional coefficient, which is usually set in advance
  • Z represents the optical magnification of the camera
  • b 1 represents the first offset amount, which is usually also set in advance.
  • the controller determines the size of the control dead zone according to the above formula (1), it takes the center position of the target video image as the center position of the control dead zone, and determines the control dead zone based on the size of the control dead zone and the center position of the control dead zone. The position of each boundary of the area is connected, and then the two adjacent boundaries of the control dead area are connected to each other to obtain the control dead area in the target video image, thereby determining the imaging position of the control dead area in the target video image. That is, after the controller determines the size of the control dead zone, it determines the length and width of the control dead zone according to the aspect ratio of the control dead zone.
  • a position whose vertical distance from the center position of the control dead zone is half the length is determined as the position of the first boundary of the control dead zone, and a position whose vertical distance is half the length from the center position of the control dead zone.
  • the position of is determined as the position of the second boundary of the control dead zone, and the position whose vertical distance from the center position of the control dead zone is half the width is determined as the position of the third boundary of the control dead zone.
  • the position where the vertical distance between the center positions is half the width is determined as the position of the fourth boundary of the control dead zone, and then the two adjacent boundaries of the control dead zone are connected to each other to obtain the control dead zone in the target video image , and then determine the imaging position of the control dead zone in the target video image.
  • the aspect ratio of the control dead zone is set in advance.
  • the aspect ratio of the control dead zone can also be adjusted according to different needs. That is to say, different optical magnifications correspond to different control dead zone sizes, but the ratio between the length and width of the control dead zone under different optical magnifications is fixed.
  • FIG. 3 is a schematic diagram of dead zone control under different optical magnifications provided by an embodiment of the present application.
  • the solid line box with thicker lines in the upper figure represents the control dead zone in the target video image when the optical magnification of the camera is 1x.
  • the solid line box with thicker lines in the figure below represents the control dead zone in the target video image when the optical magnification of the camera is 37 times.
  • the imaging position of the control dead zone in the target video image will also change, resulting in different optical magnifications.
  • the position error between the target object and the control dead zone is different under magnification. In this way, when the target object is in a stationary state and is located at the center of the target video image, it can be avoided that the target object repeatedly oscillates in the target video image due to adjusting the optical magnification of the camera.
  • Step 104 The controller determines the gain factor based on the imaging data of the target object and the operating parameters of the camera.
  • the controller Based on the stored fuzzy rules, the controller performs fuzzy control on the imaging data of the target object and the working parameters of the camera to obtain the gain factor.
  • the fuzzy rules stored in the controller are formulated after analyzing and summarizing the rules of the camera shooting objects in different scenarios and combining the experience of operators or experts. Moreover, fuzzy rules can also be adjusted according to different needs.
  • the fuzzy rules stored by the controller are shown in Table 1. It can be seen from Table 1 that when the blur level corresponding to the imaging size is small and the blur level corresponding to the imaging position is edge, the blur level corresponding to the gain factor is extremely small. When the blur level corresponding to the imaging position is the center, the blur level corresponding to the gain factor is extremely small or small. When the blur level corresponding to the pitch angle is large, the blur level corresponding to the gain factor is maximum.
  • a Divide the blur level corresponding to the imaging size into three levels: small, medium and large.
  • the blur level corresponding to the imaging size is determined to be small; when the ratio between the imaging size and the video image size is within the second ratio range , the blur level corresponding to the imaging size is determined to be medium; when the ratio between the imaging size and the video image size is within the third ratio range, the blur level corresponding to the imaging size is determined to be large.
  • the video image size is the size of the video image obtained by the camera after imaging within the field of view.
  • the upper bound of the first ratio range is greater than the lower bound of the second ratio range, and the upper bound of the second ratio range is greater than the lower bound of the third ratio range, that is, there is an intersection between two adjacent ratio ranges.
  • the first ratio range, the second ratio range and the third ratio range are set in advance.
  • the first ratio range is [0-0.25]
  • the second ratio range is [0.18-0.45]
  • the third ratio range is [0.4-1].
  • the first ratio range, the second ratio range and the third ratio range can also be adjusted according to different needs.
  • the blur level corresponding to the imaging position is divided into three levels: center, moderate, and edge.
  • first numerical range determines the blur level corresponding to the imaging position as the center; when shooting When the ratio between the distance between the geometric center of the object and the geometric center of the video image and the size of the video image in the horizontal direction is within the second numerical range, the blur level corresponding to the imaging position is determined to be moderate; when the object is photographed When the ratio between the distance between the geometric center and the geometric center of the video image and the size of the video image in the horizontal direction is within the third numerical range, the blur level corresponding to the imaging position is determined to be an edge.
  • the upper bound of the first numerical range is greater than the lower bound of the second numerical range
  • the upper bound of the second numerical range is greater than the lower bound of the third numerical range, that is, there is an intersection between two adjacent numerical ranges.
  • the first numerical range, the second numerical range and the third numerical range are set in advance.
  • the first numerical range is [0-0.15]
  • the second numerical range is [0.1-0.3]
  • the third numerical range is [0.2-1].
  • the first numerical range, the second numerical range and the third numerical range can also be adjusted according to different requirements.
  • the blur level corresponding to the optical magnification into three levels: small, medium and large.
  • the blur level corresponding to the optical magnification is determined to be small;
  • the blur level corresponding to the optical magnification is determined to be medium; in the optical
  • the magnification is in the third optical magnification range, it is determined that the blur level corresponding to the optical magnification is large.
  • the upper bound of the first optical magnification range is greater than the lower bound of the second optical magnification range
  • the upper bound of the second optical magnification range is greater than the lower bound of the third optical magnification range, that is, there is an intersection between two adjacent optical magnification ranges.
  • the first optical magnification range, the second optical magnification range and the third optical magnification range are set in advance.
  • the first optical magnification range is [0-3]
  • the second optical magnification range is [2-12]
  • the third optical magnification range is [9-limit value].
  • the first optical magnification range, the second optical magnification range and the third optical magnification range can also be adjusted according to different needs.
  • d Divide the fuzzy level corresponding to the pitch angle into three levels: small, medium and large.
  • the blur level corresponding to the pitch angle is determined to be small; when the pitch angle is in the second pitch angle range, the blur level corresponding to the pitch angle is determined to be medium; in the pitch angle
  • the angle is in the third pitch angle range, it is determined that the blur level corresponding to the pitch angle is large.
  • the upper bound of the first pitch angle range is greater than the lower bound of the second pitch angle range
  • the upper bound of the second pitch angle range is greater than the lower bound of the third pitch angle range, that is, there is an intersection between two adjacent pitch angle ranges.
  • the first pitch angle range, the second pitch angle range and the third pitch angle range are set in advance.
  • the first pitch angle range is [0°-10°]
  • the second pitch angle range is [8°-20°]
  • the third pitch angle range is [18°-limit value].
  • the first pitch angle range, the second pitch angle range and the third pitch angle range can also be adjusted according to different requirements.
  • the upper bound of the first gain factor range is greater than the lower bound of the second gain factor range
  • the upper bound of the second gain factor range is greater than the lower bound of the third gain factor range
  • the upper bound of the third gain factor range is greater than the fourth gain factor range.
  • the lower bound of the fourth gain factor range is greater than the lower bound of the fifth gain factor range, that is, there is an intersection between two adjacent gain factor ranges.
  • the first gain factor range, the second gain factor range, the third gain factor range, the fourth gain factor range and the fifth gain factor range are set in advance. For example, the first gain factor range is [0-0.5], the second gain factor range is [0.3-1], the third gain factor range is [0.5-1.5], and the fourth gain factor range is [1-2.8].
  • the fifth gain factor range is [1.5-limit value].
  • the first gain factor range, the second gain factor range, the third gain factor range, the fourth gain factor range and the fifth gain factor range can also be adjusted according to different requirements.
  • the controller performs fuzzy control on the imaging data of the target object and the operating parameters of the camera based on the stored fuzzy rules according to the following steps (1)-(4) to obtain the gain factor.
  • the controller fuzzifies each data in the imaging data and the working parameters respectively to obtain the membership degree of each data belonging to its corresponding fuzzy level.
  • the data corresponds to multiple blur levels, and each blur level in the multiple blur levels corresponds to a membership function. That is, one fuzzy level corresponds to one membership function. Since the data corresponds to multiple fuzzy levels, the data also corresponds to multiple membership functions. In this way, the controller can fuzzify the data through multiple membership functions corresponding to the data, so as to obtain the membership degree of each fuzzy level of the multiple fuzzy levels corresponding to the data.
  • each membership function in multiple membership functions corresponding to the same data is the same, but the parameters of each membership function in the multiple membership functions are different, thus ensuring that the same data corresponds to multiple membership functions.
  • Membership function The types of membership functions corresponding to different data can be the same, or they can be different. Types of membership functions include triangular membership functions, trapezoidal membership functions, Gaussian membership functions, and bell-shaped membership functions.
  • the controller fuzzifies the imaging size Y through the membership function A to obtain the imaging size Y whose membership degree is small and has a fuzzy level of 0; it fuzzifies the imaging size Y through the membership function B to obtain the imaging size Y.
  • the membership degree belonging to the fuzzy level is 0.4; the imaging size Y is fuzzified through the membership function C, so that the membership degree of the imaging size Y belonging to the fuzzy level is 0.6.
  • the controller determines the target fuzzy rule from the stored fuzzy rules based on the membership degree of each data belonging to the corresponding fuzzy level.
  • the controller determines the membership degree of each data belonging to its corresponding fuzzy level according to the above step (1), it selects a fuzzy level whose membership degree is not 0 from the fuzzy levels corresponding to these data to obtain at least one target fuzzy level. Then, the fuzzy levels corresponding to different data in the at least one target fuzzy level are combined to obtain the fuzzy level combination result, and then a fuzzy rule matching the fuzzy level combination is selected from the stored fuzzy rule library to obtain the target fuzzy level combination. rule.
  • FIG. 4 is a schematic diagram of a controller determining a target fuzzy rule provided by an embodiment of the present application.
  • the membership degree of the imaging size Y belonging to its own corresponding small blur level is 0, the membership degree belonging to the blur level is 0.4, and the membership degree belonging to the large blur level is 0.6.
  • the membership degree of imaging position If the optical magnification is 2 times, the membership degree of the smaller blur level corresponding to itself is 1, the membership degree of the blur level is 0, and the membership degree of the blur level is 0.
  • the membership degree of a pitch angle of 26° belonging to its corresponding small fuzzy level is 0, the membership degree belonging to the fuzzy level is 0.3, and the membership degree belonging to a large fuzzy level is 0.7.
  • the membership degree of the imaging size belonging to its corresponding fuzzy level is medium and the membership degree of the large level is not 0; the membership degree of the imaging position belonging to its corresponding fuzzy level is medium.
  • the membership degree of the medium level and the edge of the level is not 0; the membership degree of the optical magnification belonging to the corresponding fuzzy level is not 0; the membership degree of the pitch angle belongs to the middle level and the large level of the corresponding fuzzy level is not 0.
  • the membership degree of is not 0.
  • the at least one target blur level obtained by the controller includes medium imaging size, large imaging size, moderate imaging position, edge imaging position, small optical magnification, medium pitch angle, and large pitch angle
  • the at least one target blur level is By combining the blur levels corresponding to different data in , the obtained 8 blur level combination results are [medium imaging size, moderate imaging position, small optical magnification, medium pitch angle]; [medium imaging size, moderate imaging position, small optical magnification, Large pitch angle]; [Medium imaging size, edge of imaging position, small optical magnification, medium pitch angle]; [Medium imaging size, edge of imaging position, small optical magnification, large pitch angle]; [Large imaging size, moderate imaging position, Small optical magnification, medium pitch angle]; [Large imaging size, moderate imaging position, small optical magnification, large pitch angle]; [Large imaging size, edge of imaging position, small optical magnification, medium pitch angle]; [Large imaging size, The edge of the imaging position, small optical magnification, and large pitch
  • the obtained target fuzzy rules are the fuzzy rule corresponding to number 5, the fuzzy rule corresponding to number 6, and the fuzzy rule corresponding to number 10. Fuzzy rule corresponding to number 11.
  • the controller Based on the membership degree of each data belonging to the corresponding fuzzy level, the controller performs fuzzy logic reasoning on the target fuzzy rule to obtain the membership degree of the gain factor belonging to its corresponding fuzzy level.
  • the controller determines the target fuzzy rule according to the above steps, based on the membership degree of each data belonging to its corresponding fuzzy level, it performs fuzzy logic reasoning on the target fuzzy rule according to the relevant algorithm to obtain the membership of the gain factor belonging to its corresponding fuzzy level. Spend.
  • the controller defuzzifies the membership degree of the gain factor belonging to its corresponding fuzzy level to obtain the gain factor.
  • the controller uses the center of gravity method to defuzzify the membership degree of the gain factor belonging to its corresponding fuzzy level to obtain the gain factor.
  • the controller can also defuzzify the membership degree of the gain factor belonging to its corresponding fuzzy level through other methods.
  • the maximum membership method, the median method, etc. are not limited in the embodiments of this application.
  • Step 105 The controller adjusts the first motor speed according to the gain factor to obtain the second motor speed.
  • the first motor speed is denoted as ⁇ PID and the gain factor is denoted as ⁇ .
  • represents the second motor speed
  • represents the gain factor
  • ⁇ PID represents the first motor speed
  • Step 106 The controller controls the pan/tilt motor based on the second motor speed to control the camera.
  • the controller controls the pan/tilt motor based on the second motor speed to control the camera.
  • the controller controls the gimbal motor based on the second motor speed to control the camera. The detailed implementation process is different, so the following two situations will be introduced separately.
  • the target object when the target object is located in the edge deceleration zone of the target video image and the movement direction of the target object is toward the center of the target video image, the target object is determined based on the imaging position of the target object and the center position of the target video image. The distance between the geometric center of the target object and the geometric center of the target video image. Based on the distance between the geometric center of the target object and the geometric center of the target video image, the edge damping coefficient is determined, and the second motor speed is adjusted according to the edge damping coefficient. , to obtain the third motor speed, and control the pan/tilt motor according to the third motor speed to control the camera.
  • represents the edge damping coefficient
  • k 2 represents the second proportion coefficient, which is usually set in advance
  • e represents the distance between the geometric center of the target object and the geometric center of the target video image
  • b 2 represents the second offset, which is usually set in advance.
  • the second motor speed is denoted as ⁇
  • the edge damping coefficient is denoted as ⁇ .
  • the controller adjusts the second motor speed according to the edge damping coefficient, and the obtained third motor speed can be expressed by the following formula (4);
  • ⁇ * represents the third motor speed
  • represents the second motor speed
  • represents the edge damping coefficient
  • the target video image includes an edge deceleration area and a center acceleration area.
  • the controller divides the length and width of the target video image into n equal parts, dividing the length 1/n from the first boundary of the target video image, the length 1/n from the second boundary of the target video image, and the length 1/n from the second boundary of the target video image.
  • the area enclosed by the 1/n width of the three boundaries and the 1/n width of the fourth boundary from the target video image is determined as the edge deceleration zone, and the other areas are determined as the central acceleration zone.
  • the rotation speed of the camera's gimbal motor should not be too high, so as to avoid blurring of the video image captured by the camera due to excessive rotation speed of the gimbal motor.
  • FIG. 5 is a schematic diagram of a target video image including an edge deceleration area and a central acceleration area provided by an embodiment of the present application.
  • the length of the target video image is w
  • the width of the target video image is h.
  • the controller divides the length w of the target video image into 4 equal parts, divides the width h of the target video image into 4 equal parts, divides the first boundary w/4 from the target video image, and the second boundary w/4 from the target video image.
  • the area enclosed by the boundary w/4, the third boundary h/4 from the target video image, and the fourth boundary h/4 from the target video image is determined as the edge deceleration zone, and the other areas are determined as the central acceleration zone.
  • the edge damping coefficient is used to adjust the target object.
  • the rotation speed of the second motor is adjusted to reduce the rotation speed of the pan/tilt motor, thereby improving the camera's success rate in shooting the target object located in the edge area of the target video image.
  • the reference motor speed refers to the motor speed used when controlling the gimbal motor through the reference video image.
  • the reference video image is a frame of image located before the target video image.
  • the second motor rotation speed is adjusted to obtain the fourth motor rotation speed, according to Four motor speed controls the gimbal motor to control the camera.
  • the reference video image is the frame image located before the target video image and closest to the target video image. That is, the reference video image is a frame of image located before the target video image and adjacent to the target video image. Alternatively, the reference video image is a frame of image located before the target video image and the number of image frames separated from the target video image is less than a frame number threshold.
  • the frame number threshold is set in advance, and the frame number threshold can be adjusted according to different needs.
  • each image frame that is located in front of the target video image and is separated from the target video image by less than the frame number threshold is not much different from the target video image. Therefore, it can be placed in front of the target video image and is separated from the target video image.
  • An image in which the number of image frames between video images is less than the frame number threshold is determined as a reference video image.
  • the direction of the second motor speed and the direction of the reference motor speed are expressed as positive or negative.
  • the product of the second motor speed and the reference motor speed is less than 0, it indicates that the direction of the second motor speed is consistent with the reference motor speed.
  • the direction of motor speed is different.
  • the direction of the rotation speed of the second motor and the direction of the rotation speed of the reference motor can also be expressed in other ways, which are not limited in the embodiments of the present application.
  • the second motor speed is denoted as ⁇ t
  • the reference motor speed is denoted as ⁇ t-1
  • the rotation speed threshold is denoted as ⁇ .
  • the controller adjusts the second motor speed to obtain the fourth motor speed, and then controls it according to the fourth motor speed Gimbal motor.
  • the implementation process of the controller adjusting the second motor speed to obtain the fourth motor speed includes: averaging the second motor speed and the reference motor speed to obtain the fourth motor speed.
  • the second motor speed is multiplied by a preset attenuation coefficient less than 1 to obtain the fourth motor speed.
  • the controller can also adjust the second motor speed in other ways to obtain the fourth motor speed, which is not limited in the embodiments of the present application.
  • the rotation speed threshold is set in advance.
  • the speed threshold is 15 rpm.
  • the speed threshold can be adjusted according to different needs.
  • FIG. 6 is a schematic diagram of a motor speed timing oscillation detection provided by an embodiment of the present application.
  • the direction of the second motor speed ⁇ t is negative
  • the direction of the reference motor speed ⁇ t-1 is positive
  • the absolute value of the difference between ⁇ t and ⁇ t-1 is greater than the speed threshold.
  • the controller adjusts the second motor speed to obtain the fourth motor speed.
  • the controller performs time sequence oscillation detection on the second motor speed and the reference motor speed.
  • the direction of the second motor speed is different from the reference motor speed, and the difference between the second motor speed and the reference motor speed is When the absolute value of is greater than the speed threshold, It shows that compared with the reference video image, the direction of the second motor speed of the target video image is different from the direction of the reference motor speed, and the difference between the second motor speed and the reference motor speed is larger.
  • the controller controls the pan/tilt motor according to the second motor speed, the target object oscillates in the target video image, causing the camera to be unable to stably capture the target object.
  • the controller adjusts the second motor speed to obtain the fourth motor speed, and then controls the pan/tilt motor according to the fourth motor speed, thereby further weakening the oscillation of the camera and ensuring that the camera can stably capture the target object.
  • the controller controlling the gimbal motor based on the second motor speed is only an example. In other embodiments, after the controller determines the second motor speed according to the above steps 101-105, it can directly control the pan/tilt motor according to the second motor speed to control the camera.
  • FIG. 7 is an application schematic diagram of a camera control method provided by an embodiment of the present application.
  • the initial pitch angle T 1 of the camera is 25°.
  • the controller follows the above steps 101-105. Determine the second motor speed, then directly control the gimbal motor according to the second motor speed, and control the camera's target pitch angle T2 to be 50°, thereby achieving a situation where the camera's pitch angle is larger and the target object moves faster. Next, the target object was successfully photographed.
  • the controller determines the imaging data of the target object in the target video image through the image detection algorithm, and obtains the working parameters of the camera. Then, the first motor speed is determined based on the imaging position of the target object in the imaging data and the imaging position of the control dead zone in the target video image. Based on the stored fuzzy rules, the controller performs fuzzy control on the imaging data of the target object and the working parameters of the camera to obtain the gain factor, and then adjusts the first motor speed according to the gain factor to obtain the second motor speed. Finally, the pan/tilt motor is controlled based on the second motor speed to control the camera.
  • the first motor speed is adjusted according to the gain factor to obtain the second motor speed, and then the pan/tilt motor is controlled by the second motor speed, so that the camera can capture target objects in a wide range for a long time. That is, the rotation speed of the pan/tilt motor included in the camera is obtained by adjusting the rotation speed of the first motor according to the gain factor, and is not directly determined based on the position deviation and size deviation.
  • the method of the embodiment of the present application can fully combine the effects of different scenarios on the camera shooting target Many factors of the object can be accurately determined to determine the rotation speed of the gimbal motor suitable for different scenes, so that the camera can stably and successfully shoot the target object in different scenes, thereby improving the performance of the camera in shooting the target object.
  • the gain factor is obtained by the controller performing fuzzy control on the imaging data of the target object and the working parameters of the camera based on the stored fuzzy rules, and the fuzzy rules are formulated based on the rules of the camera shooting target objects in different scenarios.
  • the camera can be controlled by a very small gimbal motor speed, thereby improving the camera's performance in photographing the target object.
  • the camera can be controlled by a very large gimbal motor speed to This improves the camera's performance in capturing target objects.
  • Figure 9 is a schematic structural diagram of a camera control device provided by an embodiment of the present application.
  • the camera control device can be implemented as part or all of a computer device by software, hardware, or a combination of both.
  • the device includes: a first determination module 901, an acquisition module 902, a second determination module 903, a third determination module 904, an adjustment module 905 and a control module 906.
  • the first determination module 901 is used to determine the imaging data of the target object in the target video image.
  • the imaging data includes the imaging size and imaging position.
  • the target video image is a frame of image collected by the camera, and the target object is the object being photographed by the camera.
  • the acquisition module 902 is used to acquire the working parameters of the camera.
  • the working parameters include optical magnification and pitch angle.
  • optical magnification and pitch angle For the detailed implementation process, refer to the corresponding content in each of the above embodiments, and will not be described again here.
  • the second determination module 903 is configured to determine the first motor speed based on the imaging position of the target object and the imaging position of the control dead zone in the target video image.
  • the control dead zone refers to the area where the rotation speed of the pan/tilt motor is zero.
  • the third determination module 904 is used to determine the gain factor based on the imaging data of the target object and the operating parameters of the camera. For the detailed implementation process, refer to the corresponding content in each of the above embodiments, and will not be described again here.
  • the adjustment module 905 is used to adjust the first motor speed according to the gain factor to obtain the second motor speed.
  • the adjustment module 905 is used to adjust the first motor speed according to the gain factor to obtain the second motor speed.
  • the control module 906 is used to control the pan/tilt motor based on the second motor speed to control the camera.
  • the control module 906 is used to control the pan/tilt motor based on the second motor speed to control the camera.
  • the second determination module 903 is specifically used to:
  • the position error Based on the imaging position of the target object and the imaging position of the control dead zone, determine the position error between the target object and the control dead zone, where the position error includes a horizontal position error and a vertical position error;
  • the first motor speed is determined.
  • the device also includes:
  • the fourth determination module is used to determine the size of the control dead zone based on the optical magnification of the camera, where the size of the control dead zone is positively correlated with the optical magnification of the camera;
  • the fifth determination module is used to determine the imaging position of the control dead zone in the target video image based on the size of the control dead zone.
  • the third determining module 904 includes:
  • the fuzzy control unit is used to perform fuzzy control on the imaging data of the target object and the working parameters of the camera based on the stored fuzzy rules to obtain the gain factor.
  • the fuzzy control unit is specifically used for:
  • Each data in the imaging data and working parameters is fuzzified separately to obtain the membership degree of each data belonging to its corresponding fuzzy level;
  • the target fuzzy rule is determined from the stored fuzzy rules
  • fuzzy logic reasoning is performed on the target fuzzy rule to obtain the membership degree of the gain factor belonging to its corresponding fuzzy level;
  • the membership degree of the gain factor belonging to its corresponding fuzzy level is defuzzified to obtain the gain factor.
  • control module 906 is specifically used to:
  • the target object When the target object is located in the edge deceleration zone of the target video image and the movement direction of the target object is toward the center of the target video image, based on the imaging position of the target object and the center position of the target video image, determine the geometric center of the target object and the target The distance between the geometric centers of video images;
  • control module 906 is specifically used to:
  • the reference motor speed refers to the motor speed used when controlling the gimbal motor through the reference video image.
  • the reference video image is a frame of image located before the target video image;
  • the second motor speed is adjusted to obtain the fourth motor. Rotating speed;
  • the first motor speed is adjusted according to the gain factor to obtain the second motor speed, and then the pan/tilt motor is controlled by the second motor speed, so that the camera can capture target objects in a wide range for a long time. That is, the rotation speed of the pan/tilt motor included in the camera is obtained by adjusting the rotation speed of the first motor according to the gain factor, and is not directly determined based on the position deviation and size deviation.
  • the method of the embodiment of the present application can fully combine the effects of different scenarios on the camera shooting target Many factors of the object can be accurately determined to determine the rotation speed of the gimbal motor suitable for different scenes, so that the camera can stably and successfully shoot the target object in different scenes, thereby improving the performance of the camera in shooting the target object.
  • the gain factor is obtained by the controller performing fuzzy control on the imaging data of the target object and the working parameters of the camera based on the stored fuzzy rules, and the fuzzy rules are formulated based on the rules of the camera shooting target objects in different scenarios.
  • the camera can be controlled by a very small gimbal motor speed, thereby improving the camera's performance in photographing the target object.
  • the camera's pitch angle is large and the target object moves quickly from a position far away from the camera to a position close to the camera, the camera cannot In the scene where the target object cannot be captured, the camera can be controlled by a large gimbal motor speed to improve the performance of the camera in capturing the target object.
  • the camera control device provided in the above embodiment performs camera control
  • only the division of the above functional modules is used as an example.
  • the above function allocation can be completed by different functional modules as needed. That is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the camera control device provided by the above embodiments and the camera control method embodiments belong to the same concept. Please refer to the method embodiments for the specific implementation process, which will not be described again here.
  • FIG 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
  • the computer device includes at least one processor 1001, a communication bus 1002, a memory 1003, and at least one communication interface 1004.
  • the processor 1001 may be a general central processing unit (CPU), a network processor (NP), a microprocessor, or one or more integrated circuits used to implement the solution of the present application, such as , application-specific integrated circuit (ASIC), programmable logic device (PLD) or a combination thereof.
  • the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL), or any combination thereof.
  • Communication bus 1002 is used to transfer information between the above-mentioned components.
  • the communication bus 1002 can be divided into an address bus, a data bus, a control bus, etc. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the memory 1003 can be a read-only memory (ROM), a random access memory (RAM), or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory). , EEPROM), optical disc (including compact disc read-only memory (CD-ROM), compressed disc, laser disc, digital versatile disc, Blu-ray disc, etc.), disk storage media or other magnetic storage devices, or can Any other medium used to carry or store desired program code in the form of instructions or data structures and capable of being accessed by a computer, without limitation.
  • the memory 1003 may exist independently and be connected to the processor 1001 through the communication bus 1002.
  • the memory 1003 may also be integrated with the processor 1001.
  • the Communication interface 1004 uses any transceiver-like device for communicating with other devices or communication networks.
  • the communication interface 1004 includes a wired communication interface and may also include a wireless communication interface.
  • the wired communication interface may be an Ethernet interface, for example.
  • the Ethernet interface can be an optical interface, an electrical interface, or a combination thereof.
  • the wireless communication interface may be a wireless local area networks (WLAN) interface, a cellular network communication interface, or a combination thereof.
  • WLAN wireless local area networks
  • the processor 1001 may include one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 10 .
  • a computer device may include multiple processors, such as processor 1001 and processor 1005 as shown in Figure 10 . Each of these processors can be a single-core processor or a multi-core processor.
  • a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).
  • the computer device may also include an output device 1006 and an input device 1007.
  • Output device 1006 communicates with processor 1001 and can display information in a variety of ways.
  • the output device 1006 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. wait.
  • the input device 1007 communicates with the processor 1001 and can receive user input in a variety of ways.
  • the input device 1007 may be a mouse, a keyboard, a touch screen device, a sensing device, or the like.
  • the memory 1003 is used to store the program code 1010 for executing the solution of the present application, and the processor 1001 can execute the program code 1010 stored in the memory 1003.
  • the program code 1010 may include one or more software modules, and the computer device may implement the camera control method provided in the embodiment of FIG. 1 above through the processor 1001 and the program code 1010 in the memory 1003 .
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in a computing In a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website, computer, server or data center through a wired (for example: coaxial Cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means to transmit to another website, computer, server or data center.
  • 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 or data center integrated with one or more available media.
  • the available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as digital versatile discs (DVD)) or semiconductor media (such as solid state disks (SSD)) wait.
  • the computer-readable storage media mentioned in the embodiments of this application may be non-volatile storage media, in other words, may be non-transitory storage media.
  • embodiments of the present application also provide a computer-readable storage medium, which stores instructions. When the instructions are run on a computer, they cause the computer to execute the steps of the above camera control method.
  • Embodiments of the present application also provide a computer program product containing instructions. When the instructions are run on a computer, they cause the computer to execute the steps of the above camera control method.
  • a computer program is provided, which when the computer program is run on the computer, causes the computer to execute the steps of the above camera control method.
  • the information including but not limited to user equipment information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • Signals are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
  • the imaging data and working parameters involved in the embodiments of this application were obtained with full authorization.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

本申请公开了一种摄像机控制方法及相关装置,属于视频监控技术领域。方法包括:确定目标视频图像中目标对象的成像数据,获取摄像机的工作参数,基于目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速,基于目标对象的成像数据和摄像机的工作参数确定增益因子,按照增益因子对第一电机转速进行调节,以得到第二电机转速,基于第二电机转速控制云台电机以控制摄像机。由于增益因子是基于目标对象的成像尺寸和成像位置,以及摄像机的光学倍率和俯仰角确定的,所以对于不同的场景来说,通过本申请实施例的方法能够充分结合不同场景下影响摄像机拍摄目标对象的众多因素,从而准确地确定出适用于不同场景的云台电机的转速。

Description

摄像机控制方法及相关装置
本申请要求于2022年9月7日提交中国国家知识产权局、申请号202211100201.X、申请名称为“摄像机控制方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频监控技术领域,特别涉及一种摄像机控制方法及相关装置。
背景技术
在视频监控领域中,通常利用水平/垂直/变焦(pan/tilt/zoom,PTZ)摄像机拍摄目标对象。PTZ摄像机包括3个相互独立的云台电机,通过调节这3个云台电机的转速,从而分别控制PTZ摄像机水平旋转、垂直旋转、变焦,使得PTZ摄像机能够长时间大范围拍摄目标对象。
在相关技术中,PTZ摄像机采集视频图像,并确定视频图像中目标对象的成像位置和成像尺寸,进而确定目标对象的成像位置与预设位置之间的位置偏差,以及目标对象的成像尺寸与预设尺寸之间的尺寸偏差。基于该位置偏差和该尺寸偏差通过比例-积分-微分(proportional-integral-derivative,PID)算法确定云台电机的转速,从而控制PTZ摄像机。
然而,由于影响PTZ摄像机能否长时间大范围拍摄目标对象的因素众多,仅仅基于位置偏差和尺寸偏差控制PTZ摄像机,导致PTZ摄像机拍摄目标对象的性能较差。
发明内容
本申请提供了一种摄像机控制方法及相关装置,可以解决相关技术PTZ摄像机拍摄目标对象的性能较差的问题。所述技术方案如下:
第一方面,提供了一种摄像机控制方法。在该方法中,确定目标视频图像中目标对象的成像数据,成像数据包括成像尺寸和成像位置,目标视频图像为摄像机采集的一帧图像,目标对象为摄像机正在拍摄的对象。获取摄像机的工作参数,该工作参数包括光学倍率和俯仰角。基于目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速,控制死区是指云台电机的转速为零的区域。基于目标对象的成像数据和摄像机的工作参数,确定增益因子。按照增益因子,对第一电机转速进行调节,以得到第二电机转速。基于第二电机转速控制云台电机,以控制摄像机。
按照增益因子对第一电机转速进行调节,以得到第二电机转速,进而通过第二电机转速控制云台电机,使得摄像机能够长时间大范围拍摄目标对象。即,摄像机包括的云台电机的转速是按照增益因子对第一电机转速进行调节得到的,并不是直接基于位置偏差和尺寸偏差确定的。由于增益因子是基于目标对象的成像尺寸和成像位置,以及摄像机的光学倍率和俯仰角确定的,所以对于不同的场景来说,通过本申请的方法能够充分结合不同场景下影响摄像机拍摄目标对象的众多因素,从而准确地确定出适用于不同场景的云台电机的转速,使得摄像机在不同的场景下均能够稳定且成功的拍摄目标对象,以此来提高摄像机拍摄目标对象的性能。
控制器基于目标对象的成像位置和控制死区的成像位置,确定目标对象与控制死区之间的位置误差,该位置误差包括水平位置误差和垂直位置误差,基于该位置误差,确定第一电机转速。
需要说明的是,当目标对象在控制死区内时,摄像机云台电机的转速为0。也即是,在目标对象位于控制死区内,摄像机云台电机的转速为0,此时摄像机无法进行水平旋转、垂直旋转、变焦等。
在控制器基于目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速之前,还需要确定目标视频图像中控制死区的成像位置。
可选地,目标视频图像中控制死区的成像位置是固定不变的。也即是,不同的光学倍率对应相同的控制死区尺寸。控制器将目标视频图像的中心位置作为控制死区的中心位置,并基于控制死区的默认尺寸和 控制死区的中心位置分别确定控制死区的每个边界的位置,进而将控制死区相邻的两个边界相互连接,以得到目标视频图像中的控制死区,从而确定目标视频图像中控制死区的成像位置。
需要说明的是,上述所提及的目标视频图像中控制死区的成像位置是固定不变的,在调节摄像机的光学倍率时,随着摄像机光学倍率的增大,摄像机的视野逐渐减小,导致光学倍率较大的情况下,目标对象在目标视频图像中反复振荡。
因此,为了避免在目标对象处于静止状态且位于目标视频图像的中心位置的情况下,由于调节摄像机的光学倍率,导致目标对象在目标视频图像中反复振荡。可选地,控制器基于摄像机的光学倍率确定控制死区的尺寸,其中,控制死区的尺寸与摄像机的光学倍率呈正相关关系,进而基于控制死区的尺寸,确定目标视频图像中控制死区的成像位置。
由于不同的光学倍率对应不同的控制死区尺寸,所以,在调节摄像机的光学倍率时,目标视频图像中控制死区的成像位置也会发生变化,从而导致不同的光学倍率下目标对象与控制死区之间的位置误差不同。这样,在目标对象处于静止状态且位于目标视频图像的中心位置的情况下,能够避免由于调节摄像机的光学倍率,导致目标对象在目标视频图像中反复振荡。
控制器基于目标对象的成像数据和摄像机的工作参数,确定增益因子。
控制器基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制,以得到增益因子。
可选地,控制器按照如下步骤(1)-(4),基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制,以得到增益因子。
(1)控制器对该成像数据和该工作参数中的每个数据分别进行模糊化,以得到每个数据属于各自对应的模糊等级的隶属度。
(2)控制器基于每个数据属于各自对应的模糊等级的隶属度,从存储的模糊规则中确定目标模糊规则。
(3)控制器基于每个数据属于各自对应的模糊等级的隶属度,对目标模糊规则进行模糊逻辑推理,以得到增益因子属于自身对应的模糊等级的隶属度。
(4)控制器对增益因子属于自身对应的模糊等级的隶属度进行反模糊化,以得到增益因子。
控制器按照增益因子,对第一电机转速进行调节,以得到第二电机转速。
控制器基于第二电机转速控制云台电机,以控制摄像机。
控制器按照上述方法确定出第二电机转速之后,基于第二电机转速控制云台电机,以控制摄像机。在不同的情况下,控制器基于第二电机转速控制云台电机,以控制摄像机的详细实现过程有所不同,因此接下来将分为以下两种情况分别进行介绍。
第一种情况,在目标对象位于目标视频图像的边缘减速区内且目标对象的运动方向朝向目标视频图像的中心的情况下,基于目标对象的成像位置和目标视频图像的中心位置,确定目标对象的几何中心与目标视频图像的几何中心之间的距离,基于目标对象的几何中心与目标视频图像的几何中心之间的距离,确定边缘阻尼系数,按照边缘阻尼系数,对第二电机转速进行调节,以得到第三电机转速,按照第三电机转速控制云台电机,以控制摄像机。
需要说明的是,当目标对象位于目标视频图像的边缘减速区时,摄像机云台电机的转速不宜过大,从而能够避免因云台电机的转速过快导致摄像机拍摄到的视频图像出现模糊。
在目标对象位于目标视频图像的边缘减速区内且目标对象的运动方向朝向目标视频图像的中心的情况下,为了保证摄像机能够继续拍摄到目标对象,通过边缘阻尼系数对第二电机转速进行调节,以此来减小云台电机的转速,从而提升摄像机对位于目标视频图像边缘区域的目标对象的拍摄成功率。
第二种情况,获取参考电机转速,参考电机转速是指通过参考视频图像对云台电机进行控制时所采用的电机转速,参考视频图像为位于目标视频图像之前的一帧图像,在第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速的差值的绝对值大于转速阈值的情况下,对第二电机转速进行调节,以得到第四电机转速,按照第四电机转速控制云台电机,以控制摄像机。
其中,参考视频图像为位于目标视频图像之前,且距离目标视频图像最近的一帧图像。也即是,参考视频图像为位于目标视频图像之前且与目标视频图像相邻的一帧图像。或者,参考视频图像为位于目标视 频图像之前,且与目标视频图像间隔的图像帧数小于帧数阈值的一帧图像。帧数阈值是事先设置的,而且,帧数阈值还能够按照不同的需求来调整。
通常情况下,位于目标视频图像之前,且与目标视频图像间隔的图像帧数小于帧数阈值的每帧图像与目标视频图像的相差不大,所以,能够将位于目标视频图像之前,且与目标视频图像间隔的图像帧数小于帧数阈值的一帧图像确定为参考视频图像。
控制器对第二电机转速和参考电机转速进行时序振荡检测,在第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速的差值的绝对值大于转速阈值的情况下,表明与参考视频图像相比目标视频图像的第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速之间的差值较大。这样,在控制器按照第二电机转速控制云台电机时,使得目标对象在目标视频图像中振荡,导致摄像机无法稳定地拍摄目标对象。此时,控制器对第二电机转速进行调节,以得到第四电机转速,进而按照第四电机转速控制云台电机,从而能够进一步减弱摄像机的振荡,保障摄像机能够稳定地拍摄目标对象。
需要说明的是,在上述两种情况中,控制器基于第二电机转速控制云台电机仅为一种示例。可选地,控制器按照上述步骤确定出第二电机转速之后,能够直接按照第二电机转速控制云台电机,以控制摄像机。
第二方面,提供了一种摄像机控制装置,所述摄像机控制装置具有实现上述第一方面中摄像机控制方法行为的功能。所述摄像机控制装置包括至少一个模块,该至少一个模块用于实现上述第一方面所提供的摄像机控制方法。
第三方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器用于存储执行上述第一方面所提供的摄像机控制方法的计算机程序。所述处理器被配置为用于执行所述存储器中存储的计算机程序,以实现上述第一方面所述的摄像机控制方法。
可选地,所述计算机设备还可以包括通信总线,该通信总线用于该处理器与存储器之间建立连接。
第四方面,提供了一种计算机可读存储介质,所述存储介质内存储有指令,当所述指令在计算机上运行时,使得计算机执行上述第一方面所述的摄像机控制方法的步骤。
第五方面,提供了一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使得计算机执行上述第一方面所述的摄像机控制方法的步骤。或者说,提供了一种计算机程序,当所述计算机程序在计算机上运行时,使得计算机执行上述第一方面所述的摄像机控制方法的步骤。
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
附图说明
图1是本申请实施例提供的一种摄像机控制方法的流程图;
图2是本申请实施例提供的一种确定目标对象与控制死区之间的位置误差的示意图;
图3是本申请实施例提供的一种不同光学倍率下控制死区的示意图;
图4是本申请实施例提供的一种控制器确定目标模糊规则的示意图;
图5是本申请实施例提供的一种目标视频图像包括边缘减速区和中心加速区的示意图;
图6是本申请实施例提供的一种电机转速时序振荡检测的示意图;
图7是本申请实施例提供的一种摄像机控制方法的应用示意图;
图8是本申请实施例提供的一种摄像机控制流程的示意图;
图9是本申请实施例提供的一种摄像机控制装置的结构示意图;
图10是本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在对本申请实施例提供的摄像机控制方法进行详细地解释说明之前,先对本申请实施例涉及的术语和业务场景进行介绍。
为了便于理解,首先对本申请实施例涉及的术语进行解释。
模糊控制:是指以模糊规则、模糊等级和模糊逻辑推理为基础的一种智能控制方法。该方法首先根据操作人员或专家的经验制定模糊规则,然后将数据进行模糊化,以得到数据属于自身对应的模糊等级的隶属度,最后基于数据属于自身对应的模糊等级的隶属度,对模糊规则进行模糊逻辑推理,从而得到最终的结果。
其次对本申请实施例涉及的业务场景进行介绍。
本申请实施例提供的摄像机控制方法能够应用于多种场景,比如交通场景、机场或港口监控场景、园区边界监控场景,以及电站、景区、公园、出入口等监控场景。
例如,在交通场景中,车辆存在逆行、压线、不按规定车道行驶等行为的情况下,通过本申请实施例提供的摄像机控制方法来调节摄像机的光学倍率,放大视频图像,使得摄像机能够清晰地拍摄到车辆的外观和车牌,从而提高这种行为的抓拍成功率。
例如,在机场或港口监控场景中,为了看清处于移动状态的目标对象的细节特征,操作人员可以在视频图像中标记目标对象。然后,通过本申请实施例提供的摄像机控制方法来控制摄像机,使得摄像机能够长时间拍摄目标对象。当然,在实际应用中,操作人员还能够设置摄像机拍摄目标对象的时长,在该时长到达之后,调节摄像机包括的云台电机的转速,从而控制摄像机采集的视频图像为初始视频图像。
例如,在园区边界监控场景中,通常情况下,处于移动状态的目标对象比较少,为了保障园区安全,避免外来人员入侵园区,将本申请实施例提供的摄像机控制方法与智能行为分析方法相结合,在检测到目标对象存在入侵、徘徊、越线等行为时,控制摄像机长时间大范围拍摄目标对象。此外,在检测到目标对象存在入侵、徘徊、越线等行为时,还能够生成告警信息并上报至管理中心。
例如,在电站、景区、公园、出入口等监控场景中,操作人员能够设置目标区域,并控制摄像机拍摄位于目标区域中的目标对象。在检测到目标区域中存在多个目标对象时,控制摄像机优先拍摄离摄像机最近的目标对象,或者控制摄像机优先拍摄移动速度最快的目标对象。
摄像机包括成像器、控制器和云台电机,其中,成像器用于采集视频图像,控制器用于确定视频图像中目标对象的成像数据,并基于目标对象的成像数据和摄像机的工作参数自适应地调节云台电机的转速,使得云台电机带动摄像机水平旋转、垂直旋转、变焦,从而实现摄像机长时间大范围拍摄目标对象。本申请实施例提供的摄像机控制方法的执行主体为上述所提及的控制器。
本领域技术人员应能理解上述业务场景和摄像机仅为举例,其他现有的或今后可能出现的业务场景和摄像机如可适用于本申请实施例,也应包含在本申请实施例保护范围以内,并在此以引用方式包含于此。
需要说明的是,本申请实施例描述的业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
接下来对本申请实施例提供的摄像机控制方法进行详细地解释说明。
图1是本申请实施例提供的一种摄像机控制方法的流程图,请参考图1,该方法包括如下步骤。
步骤101:控制器确定目标视频图像中目标对象的成像数据,该成像数据包括成像尺寸和成像位置,目标视频图像为摄像机采集的一帧图像,目标对象为摄像机正在拍摄的对象。
在一些实施例中,控制器通过图像检测算法确定目标视频图像中目标对象的成像尺寸和成像位置。在另一些实施例中,控制器对目标视频图像进行图像处理以得到目标拍摄框,目标对象位于目标拍摄框内。然后,将目标拍摄框的尺寸确定为目标对象的成像尺寸,将目标拍摄框的位置确定为目标对象的成像位置。
基于上文描述,摄像机包括成像器和控制器,控制器能够通过成像器采集到的目标视频图像确定目标 视频图像中目标对象的成像数据。也即是,成像器采集到目标视频图像之后,将目标视频图像发送给控制器。控制器接收到成像器发送的目标视频图像之后,对目标视频图像进行图像检测,以得到目标视频图像中目标对象的成像数据。
当然,在实际应用中,控制器还能够通过其他的方式确定目标视频图像中目标对象的成像数据,本申请实施例对此不做限定。
步骤102:控制器获取摄像机的工作参数,该工作参数包括光学倍率和俯仰角。
摄像机的俯仰角为摄像机与水平方向之间的夹角。当然,在实际应用中,摄像机的工作参数还能够包括其他的参数,本申请实施例对此不做限定。
步骤103:控制器基于目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速,控制死区是指云台电机的转速为零的区域。
控制器基于目标对象的成像位置和控制死区的成像位置,确定目标对象与控制死区之间的位置误差,该位置误差包括水平位置误差和垂直位置误差,基于该位置误差,确定第一电机转速。
由于目标视频图像中存在控制死区,从目标视频图像中能够确定出控制死区的成像位置,所以,控制器按照上述步骤101确定出目标对象的成像位置之后,能够确定目标对象与控制死区之间的位置误差。
其中,确定目标对象与控制死区之间的水平位置误差的实现过程包括:在目标对象的几何中心位于控制死区所指示的水平范围内的情况下,确定目标对象与控制死区之间的水平位置误差为0。在目标对象的几何中心不位于控制死区所指示的水平范围内的情况下,分别确定目标对象的几何中心与控制死区所指示的水平范围内的每个边界之间的垂直距离,以得到多个距离,并将该多个距离中最小的距离确定为目标对象与控制死区之间的水平位置误差。
确定目标对象与控制死区之间的垂直位置误差的实现过程包括:在目标对象的几何中心位于控制死区所指示的垂直范围内的情况下,确定目标对象与控制死区之间的垂直位置误差为0。在目标对象的几何中心不位于控制死区所指示的垂直范围内的情况下,分别确定目标对象的几何中心与控制死区所指示的垂直范围内的每个边界之间的垂直距离,以得到多个距离,并将该多个距离中最小的距离确定为目标对象与控制死区之间的垂直位置误差。
其中,控制死区所指示的水平范围是指控制死区在水平方向上距离最远的两个点所在的直线之间的范围。同理,控制死区所指示的垂直范围是指控制死区在垂直方向上距离最远的两个点所在的直线之间的范围。
示例地,请参考图2,图2是本申请实施例提供的一种确定目标对象与控制死区之间的位置误差的示意图。在图2中,外面线条较细的实线框代表目标视频图像,里面线条较粗的实线框代表目标视频图像中的控制死区,控制死区包括4个边界,黑色圆点代表目标对象的几何中心。从图2可以看出,由于目标对象的几何中心位于控制死区所指示的垂直范围内,所以,目标对象与控制死区之间的垂直位置误差为0。但是目标对象的几何中心不位于控制死区所指示的水平范围内,且目标对象的几何中心与控制死区的第一边界之间的垂直距离D1最小,因此,将目标对象的几何中心与控制死区的第一边界之间的垂直距离D1确定为目标对象与控制死区之间的水平位置误差。
控制器按照上述步骤确定出目标对象与控制死区之间的位置误差之后,基于位置误差通过PID算法确定第一电机转速。
需要说明的是,当目标对象在控制死区内时,摄像机云台电机的转速为0。也即是,在目标对象位于控制死区内,摄像机云台电机的转速为0,此时摄像机无法进行水平旋转、垂直旋转、变焦等。
在控制器基于目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速之前,还需要确定目标视频图像中控制死区的成像位置。
在一些实施例中,目标视频图像中控制死区的成像位置是固定不变的。也即是,不同的光学倍率对应相同的控制死区尺寸。控制器将目标视频图像的中心位置作为控制死区的中心位置,并基于控制死区的默认尺寸和控制死区的中心位置分别确定控制死区的每个边界的位置,进而将控制死区相邻的两个边界相互连接,以得到目标视频图像中的控制死区,从而确定目标视频图像中控制死区的成像位置。
其中,基于控制死区的默认尺寸和控制死区的中心位置分别确定控制死区的每个边界的位置的实现过程包括:控制器按照控制死区的默认尺寸和控制死区的长宽比,确定控制死区的长度和控制死区的宽度。 然后,将与控制死区的中心位置之间的垂直距离为长度的一半的位置确定为控制死区的第一边界的位置,将与控制死区的中心位置之间的垂直距离为长度的一半的位置确定为控制死区的第二边界的位置,将与控制死区的中心位置之间的垂直距离为宽度的一半的位置确定为控制死区的第三边界的位置,将与控制死区的中心位置之间的垂直距离为宽度的一半的位置确定为控制死区的第四边界的位置。
需要说明的是,上述所提及的目标视频图像中控制死区的成像位置是固定不变的,在调节摄像机的光学倍率时,随着摄像机光学倍率的增大,摄像机的视野逐渐减小,导致光学倍率较大的情况下,目标对象在目标视频图像中反复振荡。
因此,为了避免在目标对象处于静止状态且位于目标视频图像的中心位置的情况下,由于调节摄像机的光学倍率,导致目标对象在目标视频图像中反复振荡。在另一些实施例中,控制器基于摄像机的光学倍率确定控制死区的尺寸,其中,控制死区的尺寸与摄像机的光学倍率呈正相关关系,进而基于控制死区的尺寸,确定目标视频图像中控制死区的成像位置。
作为一种示例,控制器按照如下公式(1)基于摄像机的光学倍率确定控制死区的尺寸。
deadzone=k1×Z+b1(1)
其中,在上述公式(1)中,deadzone代表控制死区的尺寸,k1代表第一比例系数,通常是事先设置的,Z代表摄像机的光学倍率,b1代表第一偏置量,通常也是事先设置的。
控制器按照上述公式(1)确定出控制死区的尺寸之后,将目标视频图像的中心位置作为控制死区的中心位置,并基于控制死区的尺寸和控制死区的中心位置分别确定控制死区的每个边界的位置,进而将控制死区相邻的两个边界相互连接,以得到目标视频图像中的控制死区,从而确定目标视频图像中控制死区的成像位置。也即是,控制器确定出控制死区的尺寸之后,按照控制死区的长宽比,确定控制死区的长度和控制死区的宽度。然后,将与控制死区的中心位置之间的垂直距离为长度的一半的位置确定为控制死区的第一边界的位置,将与控制死区的中心位置之间的垂直距离为长度的一半的位置确定为控制死区的第二边界的位置,将与控制死区的中心位置之间的垂直距离为宽度的一半的位置确定为控制死区的第三边界的位置,将与控制死区的中心位置之间的垂直距离为宽度的一半的位置确定为控制死区的第四边界的位置,进而将控制死区相邻的两个边界相互连接,以得到目标视频图像中的控制死区,进而确定目标视频图像中控制死区的成像位置。
其中,控制死区的长宽比是事先设置的。而且,控制死区的长宽比还能够按照不同的需求来调整。也即是,不同的光学倍率对应不同的控制死区尺寸,但是不同的光学倍率下控制死区的长度与宽度之间的比值是固定不变的。
示例地,请参考图3,图3是本申请实施例提供的一种不同光学倍率下控制死区的示意图。在图3中,上图中线条较粗的实线框代表摄像机的光学倍率为1倍时,目标视频图像中的控制死区。下图中线条较粗的实线框代表摄像机的光学倍率为37倍时,目标视频图像中的控制死区。
在本申请实施例中,由于不同的光学倍率对应不同的控制死区尺寸,所以,在调节摄像机的光学倍率时,目标视频图像中控制死区的成像位置也会发生变化,从而导致不同的光学倍率下目标对象与控制死区之间的位置误差不同。这样,在目标对象处于静止状态且位于目标视频图像的中心位置的情况下,能够避免由于调节摄像机的光学倍率,导致目标对象在目标视频图像中反复振荡。
步骤104:控制器基于目标对象的成像数据和摄像机的工作参数,确定增益因子。
控制器基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制,以得到增益因子。
其中,控制器存储的模糊规则是在分析和总结摄像机在不同场景下对拍摄对象进行拍摄的规律之后,结合操作人员或专家的经验制定的。而且,模糊规则还能够按照不同的需求来调整。
示例地,控制器存储的模糊规则如表1所示。从表1可以看出,在成像尺寸对应的模糊等级为小,且成像位置对应的模糊等级为边缘的情况下,增益因子对应的模糊等级为极小。在成像位置对应的模糊等级为中心的情况下,增益因子对应的模糊等级为极小或较小。在俯仰角对应的模糊等级为大的情况下,增益因子对应的模糊等级为极大。
表1

需要说明的是,表1中每个数据对应的模糊等级是事先通过如下步骤a-e确定的。
a.将成像尺寸对应的模糊等级划分为小、中、大三个等级。在成像尺寸与视频图像尺寸之间的比值位于第一比值范围的情况下,确定该成像尺寸对应的模糊等级为小;在成像尺寸与视频图像尺寸之间的比值位于第二比值范围的情况下,确定该成像尺寸对应的模糊等级为中;在成像尺寸与视频图像尺寸之间的比值位于第三比值范围的情况下,确定该成像尺寸对应的模糊等级为大。
其中,视频图像尺寸为摄像机在视野范围内成像后得到的视频图像的尺寸。
第一比值范围的上界大于第二比值范围的下界,第二比值范围的上界大于第三比值范围的下界,即相邻两个比值范围之间存在交集。第一比值范围、第二比值范围和第三比值范围是事先设置的。例如,第一比值范围为【0-0.25】,第二比值范围为【0.18-0.45】,第三比值范围为【0.4-1】。而且,第一比值范围、第二比值范围和第三比值范围还能够按照不同的需求来调整。
b.将成像位置对应的模糊等级划分为中心、适中、边缘三个等级。在拍摄对象的几何中心与视频图像的几何中心之间的距离与视频图像在水平方向的尺寸之间的比值位于第一数值范围的情况下,确定该成像位置对应的模糊等级为中心;在拍摄对象的几何中心与视频图像的几何中心之间的距离与视频图像在水平方向的尺寸之间的比值位于第二数值范围的情况下,确定该成像位置对应的模糊等级为适中;在拍摄对象的几何中心与视频图像的几何中心之间的距离与视频图像在水平方向的尺寸之间的比值位于第三数值范围的情况下,确定该成像位置对应的模糊等级为边缘。
其中,第一数值范围的上界大于第二数值范围的下界,第二数值范围的上界大于第三数值范围的下界,即相邻两个数值范围之间存在交集。第一数值范围、第二数值范围和第三数值范围是事先设置的。例如,第一数值范围为【0-0.15】,第二数值范围为【0.1-0.3】,第三数值范围为【0.2-1】。而且,第一数值范围、第二数值范围和第三数值范围还能够按照不同的需求来调整。
c.将光学倍率对应的模糊等级划分为小、中、大三个等级。在光学倍率位于第一光学倍率范围的情况下,确定该光学倍率对应的模糊等级为小;在光学倍率位于第二光学倍率范围的情况下,确定该光学倍率对应的模糊等级为中;在光学倍率位于第三光学倍率范围的情况下,确定该光学倍率对应的模糊等级为大。
其中,第一光学倍率范围的上界大于第二光学倍率范围的下界,第二光学倍率范围的上界大于第三光学倍率范围的下界,即相邻两个光学倍率范围之间存在交集。第一光学倍率范围、第二光学倍率范围和第三光学倍率范围是事先设置的。例如,第一光学倍率范围为【0-3】,第二光学倍率范围为【2-12】,第三光学倍率范围为【9-极限值】。而且,第一光学倍率范围、第二光学倍率范围和第三光学倍率范围还能够按照不同的需求来调整。
d.将俯仰角对应的模糊等级划分为小、中、大三个等级。在俯仰角位于第一俯仰角范围的情况下,确定该俯仰角对应的模糊等级为小;在俯仰角位于第二俯仰角范围的情况下,确定该俯仰角对应的模糊等级为中;在俯仰角位于第三俯仰角范围的情况下,确定该俯仰角对应的模糊等级为大。
其中,第一俯仰角范围的上界大于第二俯仰角范围的下界,第二俯仰角范围的上界大于第三俯仰角范围的下界,即相邻两个俯仰角范围之间存在交集。第一俯仰角范围、第二俯仰角范围和第三俯仰角范围是 事先设置的。例如,第一俯仰角范围为【0°-10°】,第二俯仰角范围为【8°-20°】,第三俯仰角范围为【18°-极限值】。而且,第一俯仰角范围、第二俯仰角范围和第三俯仰角范围还能够按照不同的需求来调整。
e.将增益因子对应的模糊等级划分为极小、较小、中等、较大、极大五个等级。在增益因子位于第一增益因子范围的情况下,确定该增益因子对应的模糊等级为极小;在增益因子位于第二增益因子范围的情况下,确定该增益因子对应的模糊等级为较小;在增益因子位于第三增益因子范围的情况下,确定该增益因子对应的模糊等级为中等;在增益因子位于第四增益因子范围的情况下,确定该增益因子对应的模糊等级为较大;在增益因子位于第五增益因子范围的情况下,确定该增益因子对应的模糊等级为极大。
其中,第一增益因子范围的上界大于第二增益因子范围的下界,第二增益因子范围的上界大于第三增益因子范围的下界,第三增益因子范围的上界大于第四增益因子范围的下界,第四增益因子范围的上界大于第五增益因子范围的下界,即相邻两个增益因子范围之间存在交集。第一增益因子范围、第二增益因子范围、第三增益因子范围、第四增益因子范围和第五增益因子范围是事先设置的。例如,第一增益因子范围为【0-0.5】,第二增益因子范围为【0.3-1】,第三增益因子范围为【0.5-1.5】,第四增益因子范围为【1-2.8】,第五增益因子范围为【1.5-极限值】。而且,第一增益因子范围、第二增益因子范围、第三增益因子范围、第四增益因子范围和第五增益因子范围还能够按照不同的需求来调整。
在一些实施例中,控制器按照如下步骤(1)-(4),基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制,以得到增益因子。
(1)控制器对该成像数据和该工作参数中的每个数据分别进行模糊化,以得到每个数据属于各自对应的模糊等级的隶属度。
对于该成像数据和该工作参数中的任一数据来说,该数据对应多个模糊等级,该多个模糊等级中的每个模糊等级均对应一个隶属度函数。即,一个模糊等级对应一个隶属度函数,由于该数据对应多个模糊等级,所以该数据也对应多个隶属度函数。这样,控制器能够通过该数据对应的多个隶属度函数分别对该数据进行模糊化,以得到该数据属于自身对应的多个模糊等级中每个模糊等级的隶属度。
需要说明的是,同一数据属于自身对应的多个模糊等级中每个模糊等级的隶属度之和为1。
其中,同一数据对应的多个隶属度函数中每个隶属度函数的类型是相同的,但该多个隶属度函数中每个隶属度函数的参数是不相同的,从而保证同一数据对应多个隶属度函数。不同的数据对应的隶属度函数的类型可以是相同的,或者也可以是不相同的。隶属度函数的类型包括三角形隶属度函数、梯形隶属度函数、高斯型隶属度函数,以及钟型隶属度函数等。
假设,该数据为成像尺寸Y。由于成像尺寸对应的3个模糊等级分别为小、中、大,且模糊等级小对应的隶属度函数为A,模糊等级中对应的隶属度函数为B,模糊等级大对应的隶属度函数为C。所以,控制器通过隶属度函数A对成像尺寸Y进行模糊化,以得到成像尺寸Y属于模糊等级小的隶属度为0;通过隶属度函数B对成像尺寸Y进行模糊化,以得到成像尺寸Y属于模糊等级中的隶属度为0.4;通过隶属度函数C对成像尺寸Y进行模糊化,以得到成像尺寸Y属于模糊等级大的隶属度为0.6。
(2)控制器基于每个数据属于各自对应的模糊等级的隶属度,从存储的模糊规则中确定目标模糊规则。
控制器按照上述步骤(1)确定出每个数据属于各自对应的模糊等级的隶属度之后,从这些数据对应的模糊等级中选择隶属度不为0的模糊等级,以得到至少一个目标模糊等级。然后,将该至少一个目标模糊等级中不同数据对应的模糊等级进行组合,以得到模糊等级组合结果,进而从存储的模糊规则库中选择与该模糊等级组合相匹配的模糊规则,以得到目标模糊规则。
示例地,请参考图4,图4是本申请实施例提供的一种控制器确定目标模糊规则的示意图。在图4中,成像尺寸Y属于自身对应的模糊等级小的隶属度为0,属于模糊等级中的隶属度为0.4,属于模糊等级大的隶属度为0.6。成像位置X属于自身对应的模糊等级中心的隶属度为0,属于模糊等级适中的隶属度为0.2,属于模糊等级边缘的隶属度为0.8。光学倍率2倍属于自身对应的模糊等级小的隶属度为1,属于模糊等级中的隶属度为0,属于模糊等级大的隶属度为0。俯仰角26°属于自身对应的模糊等级小的隶属度为0,属于模糊等级中的隶属度为0.3,属于模糊等级大的隶属度为0.7。也即是,成像尺寸属于自身对应的模糊等级的隶属度中等级中和等级大的隶属度不为0;成像位置属于自身对应的模糊等级的隶属度中等 级适中和等级边缘的隶属度不为0;光学倍率属于自身对应的模糊等级的隶属度中等级小的隶属度不为0;俯仰角属于自身对应的模糊等级的隶属度中等级中和等级大的隶属度不为0。此时,控制器得到的该至少一个目标模糊等级包括成像尺寸中、成像尺寸大、成像位置适中、成像位置边缘、光学倍率小、俯仰角中和俯仰角大,进而将该至少一个目标模糊等级中不同数据对应的模糊等级进行组合,得到的8种模糊等级组合结果为【成像尺寸中、成像位置适中、光学倍率小、俯仰角中】;【成像尺寸中、成像位置适中、光学倍率小、俯仰角大】;【成像尺寸中、成像位置边缘、光学倍率小、俯仰角中】;【成像尺寸中、成像位置边缘、光学倍率小、俯仰角大】;【成像尺寸大、成像位置适中、光学倍率小、俯仰角中】;【成像尺寸大、成像位置适中、光学倍率小、俯仰角大】;【成像尺寸大、成像位置边缘、光学倍率小、俯仰角中】;【成像尺寸大、成像位置边缘、光学倍率小、俯仰角大】。
然后,从存储的模糊规则库中选择与该8种模糊等级组合结果相匹配的模糊规则,得到的目标模糊规则为编号5对应的模糊规则、编号6对应的模糊规则、编号10对应的模糊规则和编号11对应的模糊规则。
(3)控制器基于每个数据属于各自对应的模糊等级的隶属度,对目标模糊规则进行模糊逻辑推理,以得到增益因子属于自身对应的模糊等级的隶属度。
控制器按照上述步骤确定出目标模糊规则之后,基于每个数据属于各自对应的模糊等级的隶属度,按照相关算法对目标模糊规则进行模糊逻辑推理,以得到增益因子属于自身对应的模糊等级的隶属度。
(4)控制器对增益因子属于自身对应的模糊等级的隶属度进行反模糊化,以得到增益因子。
控制器通过重心法对增益因子属于自身对应的模糊等级的隶属度进行反模糊化,以得到增益因子。当然,在实际应用中,控制器还能够通过其他的方法对增益因子属于自身对应的模糊等级的隶属度进行反模糊化。例如,最大隶属度法、中位数法等,本申请实施例对此不做限定。
步骤105:控制器按照增益因子,对第一电机转速进行调节,以得到第二电机转速。
示例地,将第一电机转速记为ωPID,将增益因子记为θ。此时,控制器按照增益因子对第一电机转速进行调节,得到的第二电机转速能够通过如下公式(2)表示;
ω=θ×ωPID    (2)
其中,在上述公式(2)中,ω代表第二电机转速,θ代表增益因子,ωPID代表第一电机转速。
步骤106:控制器基于第二电机转速控制云台电机,以控制摄像机。
控制器按照上述方法确定出第二电机转速之后,基于第二电机转速控制云台电机,以控制摄像机。在不同的情况下,控制器基于第二电机转速控制云台电机,以控制摄像机的详细实现过程有所不同,因此接下来将分为以下两种情况分别进行介绍。
第一种情况,在目标对象位于目标视频图像的边缘减速区内且目标对象的运动方向朝向目标视频图像的中心的情况下,基于目标对象的成像位置和目标视频图像的中心位置,确定目标对象的几何中心与目标视频图像的几何中心之间的距离,基于目标对象的几何中心与目标视频图像的几何中心之间的距离,确定边缘阻尼系数,按照边缘阻尼系数,对第二电机转速进行调节,以得到第三电机转速,按照第三电机转速控制云台电机,以控制摄像机。
在一些实施例中,控制器确定出目标对象的成像位置之后,还能够按照相关算法确定目标对象的运动方向。这样,在目标对象位于目标视频图像的边缘减速区内且目标对象的运动方向朝向目标视频图像的中心的情况下,控制器能够确定目标对象的几何中心与目标视频图像的几何中心之间的距离。然后,控制器按照如下公式(3)基于目标对象的几何中心与目标视频图像的几何中心之间的距离,确定边缘阻尼系数。
μ=k2×|e|+b2    (3)
其中,在上述公式(3)中,μ代表边缘阻尼系数,k2代表第二比例系数,通常是事先设置的,e代表目标对象的几何中心与目标视频图像的几何中心之间的距离,b2代表第二偏置量,通常也是事先设置的。
示例地,将第二电机转速记为ω,将边缘阻尼系数记为μ。此时,控制器按照边缘阻尼系数对第二电机转速进行调节,得到的第三电机转速能够通过如下公式(4)表示;
其中,在上述公式(4)中,ω*代表第三电机转速,ω代表第二电机转速,μ代表边缘阻尼系数。
可选地,目标视频图像包括边缘减速区和中心加速区。控制器将目标视频图像的长度和宽度平均分为n等分,将距离目标视频图像的第一边界1/n长度、距离目标视频图像的第二边界1/n长度、距离目标视频图像的第三边界1/n宽度、距离目标视频图像的第四边界1/n宽度所围成的区域确定为边缘减速区,将其他的区域确定为中心加速区。
需要说明的是,当目标对象位于目标视频图像的边缘减速区时,摄像机云台电机的转速不宜过大,从而能够避免因云台电机的转速过快导致摄像机拍摄到的视频图像出现模糊。
示例地,请参考图5,图5是本申请实施例提供的一种目标视频图像包括边缘减速区和中心加速区的示意图。在图5中,目标视频图像的长度为w,目标视频图像的宽度为h。控制器将目标视频图像的长度w平均分为4等分,将目标视频图像的宽度h平均分为4等分,将距离目标视频图像的第一边界w/4、距离目标视频图像的第二边界w/4、距离目标视频图像的第三边界h/4、距离目标视频图像的第四边界h/4所围成的区域确定为边缘减速区,将其他的区域确定为中心加速区。
在本申请实施例中,在目标对象位于目标视频图像的边缘减速区内且目标对象的运动方向朝向目标视频图像的中心的情况下,为了保证摄像机能够继续拍摄到目标对象,通过边缘阻尼系数对第二电机转速进行调节,以此来减小云台电机的转速,从而提升摄像机对位于目标视频图像边缘区域的目标对象的拍摄成功率。
第二种情况,获取参考电机转速,参考电机转速是指通过参考视频图像对云台电机进行控制时所采用的电机转速,参考视频图像为位于目标视频图像之前的一帧图像,在第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速的差值的绝对值大于转速阈值的情况下,对第二电机转速进行调节,以得到第四电机转速,按照第四电机转速控制云台电机,以控制摄像机。
其中,参考视频图像为位于目标视频图像之前,且距离目标视频图像最近的一帧图像。也即是,参考视频图像为位于目标视频图像之前且与目标视频图像相邻的一帧图像。或者,参考视频图像为位于目标视频图像之前,且与目标视频图像间隔的图像帧数小于帧数阈值的一帧图像。帧数阈值是事先设置的,而且,帧数阈值还能够按照不同的需求来调整。
通常情况下,位于目标视频图像之前,且与目标视频图像间隔的图像帧数小于帧数阈值的每帧图像与目标视频图像的相差不大,所以,能够将位于目标视频图像之前,且与目标视频图像间隔的图像帧数小于帧数阈值的一帧图像确定为参考视频图像。
可选地,通过正或负来表示第二电机转速的方向,以及参考电机转速的方向,在第二电机转速与参考电机转速的乘积小于0的情况下,表明第二电机转速的方向与参考电机转速的方向不同。当然,在实际应用中,还能够通过其他的方式来表示第二电机转速的方向,以及参考电机转速的方向,本申请实施例对此不做限定。
示例地,将第二电机转速记为ωt,将参考电机转速记为ωt-1,将转速阈值记为φ。在ωt-1·ωt<0且|ωt-1t|>φ的情况下,控制器对第二电机转速进行调节,以得到第四电机转速,进而按照第四电机转速控制云台电机。
其中,控制器对第二电机转速进行调节,以得到第四电机转速的实现过程包括:将第二电机转速与参考电机转速取平均,以得到第四电机转速。或者,将第二电机转速与事先设置的小于1的衰减系数相乘,以得到第四电机转速。当然,在实际应用中,控制器还能够通过其他的方式对第二电机转速进行调节,以得到第四电机转速,本申请实施例对此不做限定。
其中,转速阈值是事先设置的。例如,转速阈值为15转/秒。而且,转速阈值还能够按照不同的需求来调整。
示例地,请参考图6,图6是本申请实施例提供的一种电机转速时序振荡检测的示意图。在图6中,第二电机转速ωt的方向为负,参考电机转速ωt-1的方向为正,且ωt与ωt-1的差值的绝对值大于转速阈值。此时,控制器对第二电机转速进行调节,以得到第四电机转速。
在本申请实施例中,控制器对第二电机转速和参考电机转速进行时序振荡检测,在第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速的差值的绝对值大于转速阈值的情况下, 表明与参考视频图像相比目标视频图像的第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速之间的差值较大。这样,在控制器按照第二电机转速控制云台电机时,使得目标对象在目标视频图像中振荡,导致摄像机无法稳定地拍摄目标对象。此时,控制器对第二电机转速进行调节,以得到第四电机转速,进而按照第四电机转速控制云台电机,从而能够进一步减弱摄像机的振荡,保障摄像机能够稳定地拍摄目标对象。
需要说明的是,在上述两种情况中,控制器基于第二电机转速控制云台电机仅为一种示例。在另一些实施例中,控制器按照上述步骤101-105确定出第二电机转速之后,能够直接按照第二电机转速控制云台电机,以控制摄像机。
示例地,请参考图7,图7是本申请实施例提供的一种摄像机控制方法的应用示意图。在图7中,摄像机的初始俯仰角T1为25°,在目标对象按照20千米/小时的速度,从远离摄像机的位置快速移动至靠近摄像机的位置时,控制器按照上述步骤101-105确定第二电机转速,进而直接按照第二电机转速控制云台电机,控制摄像机的目标俯仰角T2为50°,从而实现在摄像机的俯仰角较大,且目标对象的移动速度较快的情况下,成功地拍摄到目标对象。
接下来以图8为例,对本申请实施例提供的摄像机控制流程进行详细地解释说明。在图8中,控制器通过图像检测算法确定目标视频图像中目标对象的成像数据,并获取摄像机的工作参数。然后,基于成像数据中目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速。控制器基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制,以得到增益因子,进而按照增益因子,对第一电机转速进行调节,以得到第二电机转速。最后,基于第二电机转速控制云台电机,以控制摄像机。
在本申请实施例中,按照增益因子对第一电机转速进行调节,以得到第二电机转速,进而通过第二电机转速控制云台电机,使得摄像机能够长时间大范围拍摄目标对象。即,摄像机包括的云台电机的转速是按照增益因子对第一电机转速进行调节得到的,并不是直接基于位置偏差和尺寸偏差确定的。由于增益因子是基于目标对象的成像尺寸和成像位置,以及摄像机的光学倍率和俯仰角确定的,所以对于不同的场景来说,通过本申请实施例的方法能够充分结合不同场景下影响摄像机拍摄目标对象的众多因素,从而准确地确定出适用于不同场景的云台电机的转速,使得摄像机在不同的场景下均能够稳定且成功的拍摄目标对象,以此来提高摄像机拍摄目标对象的性能。此外,由于增益因子是控制器基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制得到的,且模糊规则是基于不同场景下摄像机拍摄目标对象的规律制定的。这样,针对目标对象的成像尺寸较小,且目标对象的成像位置为目标视频图像的边缘的场景,能够通过极小的云台电机转速控制摄像机,以此来提高摄像机拍摄目标对象的性能。或者,针对由于摄像机的俯仰角较大,导致目标对象从远离摄像机的位置快速移动至靠近摄像机的位置时,摄像机无法拍摄到目标对象的场景,能够通过极大的云台电机转速控制摄像机,以此来提高摄像机拍摄目标对象的性能。
图9是本申请实施例提供的一种摄像机控制装置的结构示意图,该摄像机控制装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部。参见图9,该装置包括:第一确定模块901、获取模块902、第二确定模块903、第三确定模块904、调节模块905和控制模块906。
第一确定模块901,用于确定目标视频图像中目标对象的成像数据,该成像数据包括成像尺寸和成像位置,目标视频图像为摄像机采集的一帧图像,目标对象为摄像机正在拍摄的对象。详细实现过程参考上述各个实施例中对应的内容,此处不再赘述。
获取模块902,用于获取摄像机的工作参数,工作参数包括光学倍率和俯仰角。详细实现过程参考上述各个实施例中对应的内容,此处不再赘述。
第二确定模块903,用于基于目标对象的成像位置和目标视频图像中控制死区的成像位置,确定第一电机转速,控制死区是指云台电机的转速为零的区域。详细实现过程参考上述各个实施例中对应的内容,此处不再赘述。
第三确定模块904,用于基于目标对象的成像数据和摄像机的工作参数,确定增益因子。详细实现过程参考上述各个实施例中对应的内容,此处不再赘述。
调节模块905,用于按照增益因子,对第一电机转速进行调节,以得到第二电机转速。详细实现过程参考上述各个实施例中对应的内容,此处不再赘述。
控制模块906,用于基于第二电机转速控制云台电机,以控制摄像机。详细实现过程参考上述各个实施例中对应的内容,此处不再赘述。
可选地,第二确定模块903具体用于:
基于目标对象的成像位置和控制死区的成像位置,确定目标对象与控制死区之间的位置误差,该位置误差包括水平位置误差和垂直位置误差;
基于该位置误差,确定第一电机转速。
可选地,该装置还包括:
第四确定模块,用于基于摄像机的光学倍率确定控制死区的尺寸,其中,控制死区的尺寸与摄像机的光学倍率呈正相关关系;
第五确定模块,用于基于控制死区的尺寸,确定目标视频图像中控制死区的成像位置。
可选地,第三确定模块904包括:
模糊控制单元,用于基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制,以得到增益因子。
可选地,模糊控制单元具体用于:
对成像数据和工作参数中的每个数据分别进行模糊化,以得到每个数据属于各自对应的模糊等级的隶属度;
基于每个数据属于各自对应的模糊等级的隶属度,从存储的模糊规则中确定目标模糊规则;
基于每个数据属于各自对应的模糊等级的隶属度,对目标模糊规则进行模糊逻辑推理,以得到增益因子属于自身对应的模糊等级的隶属度;
对增益因子属于自身对应的模糊等级的隶属度进行反模糊化,以得到增益因子。
可选地,控制模块906具体用于:
在目标对象位于目标视频图像的边缘减速区内且目标对象的运动方向朝向目标视频图像的中心的情况下,基于目标对象的成像位置和目标视频图像的中心位置,确定目标对象的几何中心与目标视频图像的几何中心之间的距离;
基于目标对象的几何中心与目标视频图像的几何中心之间的距离,确定边缘阻尼系数;
按照边缘阻尼系数,对第二电机转速进行调节,以得到第三电机转速;
按照第三电机转速控制云台电机,以控制摄像机。
可选地,控制模块906具体用于:
获取参考电机转速,参考电机转速是指通过参考视频图像对云台电机进行控制时所采用的电机转速,参考视频图像为位于目标视频图像之前的一帧图像;
在第二电机转速的方向与参考电机转速的方向不同,且第二电机转速与参考电机转速的差值的绝对值大于转速阈值的情况下,对第二电机转速进行调节,以得到第四电机转速;
按照第四电机转速控制云台电机,以控制摄像机。
在本申请实施例中,按照增益因子对第一电机转速进行调节,以得到第二电机转速,进而通过第二电机转速控制云台电机,使得摄像机能够长时间大范围拍摄目标对象。即,摄像机包括的云台电机的转速是按照增益因子对第一电机转速进行调节得到的,并不是直接基于位置偏差和尺寸偏差确定的。由于增益因子是基于目标对象的成像尺寸和成像位置,以及摄像机的光学倍率和俯仰角确定的,所以对于不同的场景来说,通过本申请实施例的方法能够充分结合不同场景下影响摄像机拍摄目标对象的众多因素,从而准确地确定出适用于不同场景的云台电机的转速,使得摄像机在不同的场景下均能够稳定且成功的拍摄目标对象,以此来提高摄像机拍摄目标对象的性能。此外,由于增益因子是控制器基于存储的模糊规则,对目标对象的成像数据和摄像机的工作参数进行模糊控制得到的,且模糊规则是基于不同场景下摄像机拍摄目标对象的规律制定的。这样,针对目标对象的成像尺寸较小,且目标对象的成像位置为目标视频图像的边缘的场景,能够通过极小的云台电机转速控制摄像机,以此来提高摄像机拍摄目标对象的性能。或者,针对由于摄像机的俯仰角较大,导致目标对象从远离摄像机的位置快速移动至靠近摄像机的位置时,摄像机无 法拍摄到目标对象的场景,能够通过极大的云台电机转速控制摄像机,以此来提高摄像机拍摄目标对象的性能。
需要说明的是:上述实施例提供的摄像机控制装置在进行摄像机控制时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的摄像机控制装置与摄像机控制方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
请参考图10,图10是根据本申请实施例示出的一种计算机设备的结构示意图,该计算机设备包括至少一个处理器1001、通信总线1002、存储器1003以及至少一个通信接口1004。
处理器1001可以是一个通用中央处理器(central processing unit,CPU)、网络处理器(network processor,NP)、微处理器、或者可以是一个或多个用于实现本申请方案的集成电路,例如,专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。
通信总线1002用于在上述组件之间传送信息。通信总线1002可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器1003可以是只读存储器(read-only memory,ROM),也可以是随机存取存储器(random access memory,RAM),也可以是电可擦可编程只读存储器(electrically erasable programmable read-only Memory,EEPROM)、光盘(包括只读光盘(compact disc read-only memory,CD-ROM)、压缩光盘、激光盘、数字通用光盘、蓝光光盘等)、磁盘存储介质或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器1003可以是独立存在,并通过通信总线1002与处理器1001相连接。存储器1003也可以和处理器1001集成在一起。
通信接口1004使用任何收发器一类的装置,用于与其它设备或通信网络通信。通信接口1004包括有线通信接口,还可以包括无线通信接口。其中,有线通信接口例如可以为以太网接口。以太网接口可以是光接口、电接口或其组合。无线通信接口可以为无线局域网(wireless local area networks,WLAN)接口、蜂窝网络通信接口或其组合等。
在具体实现中,作为一种实施例,处理器1001可以包括一个或多个CPU,如图10中所示的CPU0和CPU1。
在具体实现中,作为一种实施例,计算机设备可以包括多个处理器,如图10中所示的处理器1001和处理器1005。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,计算机设备还可以包括输出设备1006和输入设备1007。输出设备1006和处理器1001通信,可以以多种方式来显示信息。例如,输出设备1006可以是液晶显示器(l iquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备1007和处理器1001通信,可以以多种方式接收用户的输入。例如,输入设备1007可以是鼠标、键盘、触摸屏设备或传感设备等。
在一些实施例中,存储器1003用于存储执行本申请方案的程序代码1010,处理器1001可以执行存储器1003中存储的程序代码1010。该程序代码1010中可以包括一个或多个软件模块,该计算机设备可以通过处理器1001以及存储器1003中的程序代码1010,来实现上文图1实施例提供的摄像机控制方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算 机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(digital subscriber line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(digital versatile disc,DVD))或半导体介质(例如:固态硬盘(solid state disk,SSD))等。值得注意的是,本申请实施例提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。
也即是,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有指令,当该指令在计算机上运行时,使得计算机执行上述摄像机控制方法的步骤。
本申请实施例还提供了一种包含指令的计算机程序产品,当该指令在计算机上运行时,使得计算机执行上述摄像机控制方法的步骤。或者说,提供了一种计算机程序,当计算机程序在计算机上运行时,使得计算机执行上述摄像机控制方法的步骤。
应当理解的是,本文提及的“多个”是指两个或两个以上。在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请实施例的技术方案,在本申请实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
需要说明的是,本申请实施例所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请实施例中涉及到的成像数据和工作参数都是在充分授权的情况下获取的。
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种摄像机控制方法,其特征在于,所述摄像机包括云台电机,所述方法包括:
    确定目标视频图像中目标对象的成像数据,所述成像数据包括成像尺寸和成像位置,所述目标视频图像为所述摄像机采集的一帧图像,所述目标对象为所述摄像机正在拍摄的对象;
    获取所述摄像机的工作参数,所述工作参数包括光学倍率和俯仰角;
    基于所述目标对象的成像位置和所述目标视频图像中控制死区的成像位置,确定第一电机转速,所述控制死区是指所述云台电机的转速为零的区域;
    基于所述目标对象的成像数据和所述摄像机的工作参数,确定增益因子;
    按照所述增益因子,对所述第一电机转速进行调节,以得到第二电机转速;
    基于所述第二电机转速控制所述云台电机,以控制所述摄像机。
  2. 如权利要求1所述的方法,其特征在于,所述基于所述目标对象的成像位置和所述目标视频图像中控制死区的成像位置,确定第一电机转速,包括:
    基于所述目标对象的成像位置和所述控制死区的成像位置,确定所述目标对象与所述控制死区之间的位置误差,所述位置误差包括水平位置误差和垂直位置误差;
    基于所述位置误差,确定所述第一电机转速。
  3. 如权利要求1或2所述的方法,其特征在于,所述基于所述目标对象的成像位置和所述目标视频图像中控制死区的成像位置,确定第一电机转速之前,所述方法还包括:
    基于所述摄像机的光学倍率确定所述控制死区的尺寸,其中,所述控制死区的尺寸与所述摄像机的光学倍率呈正相关关系;
    基于所述控制死区的尺寸,确定所述目标视频图像中所述控制死区的成像位置。
  4. 如权利要求1-3任一所述的方法,其特征在于,所述基于所述目标对象的成像数据和所述摄像机的工作参数,确定增益因子,包括:
    基于存储的模糊规则,对所述目标对象的成像数据和所述摄像机的工作参数进行模糊控制,以得到所述增益因子。
  5. 如权利要求4所述的方法,其特征在于,所述基于存储的模糊规则,对所述目标对象的成像数据和所述摄像机的工作参数进行模糊控制,以得到所述增益因子,包括:
    对所述成像数据和所述工作参数中的每个数据分别进行模糊化,以得到所述每个数据属于各自对应的模糊等级的隶属度;
    基于所述每个数据属于各自对应的模糊等级的隶属度,从所述存储的模糊规则中确定目标模糊规则;
    基于所述每个数据属于各自对应的模糊等级的隶属度,对所述目标模糊规则进行模糊逻辑推理,以得到所述增益因子属于自身对应的模糊等级的隶属度;
    对所述增益因子属于自身对应的模糊等级的隶属度进行反模糊化,以得到所述增益因子。
  6. 如权利要求1-5任一所述的方法,其特征在于,所述基于所述第二电机转速控制所述云台电机,以控制所述摄像机,包括:
    在所述目标对象位于所述目标视频图像的边缘减速区内且所述目标对象的运动方向朝向所述目标视频图像的中心的情况下,基于所述目标对象的成像位置和所述目标视频图像的中心位置,确定所述目标对象的几何中心与所述目标视频图像的几何中心之间的距离;
    基于所述目标对象的几何中心与所述目标视频图像的几何中心之间的距离,确定边缘阻尼系数;
    按照所述边缘阻尼系数,对所述第二电机转速进行调节,以得到第三电机转速;
    按照所述第三电机转速控制所述云台电机,以控制所述摄像机。
  7. 如权利要求1-5任一所述的方法,其特征在于,所述基于所述第二电机转速控制所述云台电机,以控制所述摄像机,包括:
    获取参考电机转速,所述参考电机转速是指通过参考视频图像对所述云台电机进行控制时所采用的电机转速,所述参考视频图像为位于所述目标视频图像之前的一帧图像;
    在所述第二电机转速的方向与所述参考电机转速的方向不同,且所述第二电机转速与所述参考电机转 速的差值的绝对值大于转速阈值的情况下,对所述第二电机转速进行调节,以得到第四电机转速;
    按照所述第四电机转速控制所述云台电机,以控制所述摄像机。
  8. 一种摄像机控制装置,其特征在于,所述摄像机包括云台电机,所述装置包括:
    第一确定模块,用于确定目标视频图像中目标对象的成像数据,所述成像数据包括成像尺寸和成像位置,所述目标视频图像为所述摄像机采集的一帧图像,所述目标对象为所述摄像机正在拍摄的对象;
    获取模块,用于获取所述摄像机的工作参数,所述工作参数包括光学倍率和俯仰角;
    第二确定模块,用于基于所述目标对象的成像位置和所述目标视频图像中控制死区的成像位置,确定第一电机转速,所述控制死区是指所述云台电机的转速为零的区域;
    第三确定模块,用于基于所述目标对象的成像数据和所述摄像机的工作参数,确定增益因子;
    调节模块,用于按照所述增益因子,对所述第一电机转速进行调节,以得到第二电机转速;
    控制模块,用于基于所述第二电机转速控制所述云台电机,以控制所述摄像机。
  9. 如权利要求8所述的装置,其特征在于,所述第二确定模块具体用于:
    基于所述目标对象的成像位置和所述控制死区的成像位置,确定所述目标对象与所述控制死区之间的位置误差,所述位置误差包括水平位置误差和垂直位置误差;
    基于所述位置误差,确定所述第一电机转速。
  10. 如权利要求8或9所述的装置,其特征在于,所述装置还包括:
    第四确定模块,用于基于所述摄像机的光学倍率确定所述控制死区的尺寸,其中,所述控制死区的尺寸与所述摄像机的光学倍率呈正相关关系;
    第五确定模块,用于基于所述控制死区的尺寸,确定所述目标视频图像中所述控制死区的成像位置。
  11. 如权利要求8-10任一所述的装置,其特征在于,所述第三确定模块包括:
    模糊控制单元,用于基于存储的模糊规则,对所述目标对象的成像数据和所述摄像机的工作参数进行模糊控制,以得到所述增益因子。
  12. 如权利要求11所述的装置,其特征在于,所述模糊控制单元具体用于:
    对所述成像数据和所述工作参数中的每个数据分别进行模糊化,以得到所述每个数据属于各自对应的模糊等级的隶属度;
    基于所述每个数据属于各自对应的模糊等级的隶属度,从所述存储的模糊规则中确定目标模糊规则;
    基于所述每个数据属于各自对应的模糊等级的隶属度,对所述目标模糊规则进行模糊逻辑推理,以得到所述增益因子属于自身对应的模糊等级的隶属度;
    对所述增益因子属于自身对应的模糊等级的隶属度进行反模糊化,以得到所述增益因子。
  13. 如权利要求8-12任一所述的装置,其特征在于,所述控制模块具体用于:
    在所述目标对象位于所述目标视频图像的边缘减速区内且所述目标对象的运动方向朝向所述目标视频图像的中心的情况下,基于所述目标对象的成像位置和所述目标视频图像的中心位置,确定所述目标对象的几何中心与所述目标视频图像的几何中心之间的距离;
    基于所述目标对象的几何中心与所述目标视频图像的几何中心之间的距离,确定边缘阻尼系数;
    按照所述边缘阻尼系数,对所述第二电机转速进行调节,以得到第三电机转速;
    按照所述第三电机转速控制所述云台电机,以控制所述摄像机。
  14. 如权利要求8-12任一所述的装置,其特征在于,所述控制模块具体用于:
    获取参考电机转速,所述参考电机转速是指通过参考视频图像对所述云台电机进行控制时所采用的电机转速,所述参考视频图像为位于所述目标视频图像之前的一帧图像;
    在所述第二电机转速的方向与所述参考电机转速的方向不同,且所述第二电机转速与所述参考电机转速的差值的绝对值大于转速阈值的情况下,对所述第二电机转速进行调节,以得到第四电机转速;
    按照所述第四电机转速控制所述云台电机,以控制所述摄像机。
  15. 一种计算机设备,其特征在于,所述计算机设备包括存储器和处理器,所述存储器用于存储计算机程序,所述处理器被配置为用于执行所述存储器中存储的计算机程序,以实现权利要求1-7任一项所述方法的步骤。
  16. 一种计算机可读存储介质,其特征在于,所述存储介质内存储有指令,当所述指令在所述计算机上运行时,使得所述计算机执行权利要求1-7任一所述的方法的步骤。
  17. 一种计算机程序,其特征在于,所述计算机程序包括指令,当所述指令在所述计算机上运行时,使得所述计算机执行权利要求1-7任一项所述方法的步骤。
PCT/CN2023/105331 2022-09-07 2023-06-30 摄像机控制方法及相关装置 WO2024051330A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211100201.X 2022-09-07
CN202211100201.XA CN117714883A (zh) 2022-09-07 2022-09-07 摄像机控制方法及相关装置

Publications (1)

Publication Number Publication Date
WO2024051330A1 true WO2024051330A1 (zh) 2024-03-14

Family

ID=90148525

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/105331 WO2024051330A1 (zh) 2022-09-07 2023-06-30 摄像机控制方法及相关装置

Country Status (2)

Country Link
CN (1) CN117714883A (zh)
WO (1) WO2024051330A1 (zh)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5623705A (en) * 1994-03-18 1997-04-22 Nikon Corporation Apparatus for inspecting blur correction camera, blur correction camera, and method of inspecting blur correction camera
US20040044279A1 (en) * 2002-05-17 2004-03-04 Lewin Jonathan S. System and method for adjusting image parameters based on device tracking
CN101720027A (zh) * 2009-11-27 2010-06-02 西安电子科技大学 可变焦阵列摄像机协同获取不同分辨率多目标视频方法
CN108965687A (zh) * 2017-05-22 2018-12-07 阿里巴巴集团控股有限公司 拍摄方向识别方法、服务器及监控方法、系统及摄像设备
CN112616019A (zh) * 2020-12-16 2021-04-06 重庆紫光华山智安科技有限公司 目标跟踪方法、装置、云台及存储介质
CN112639652A (zh) * 2020-05-07 2021-04-09 深圳市大疆创新科技有限公司 目标跟踪方法和装置、可移动平台以及成像平台
WO2022057800A1 (zh) * 2020-09-16 2022-03-24 华为技术有限公司 云台摄像机、云台摄像机的追踪控制方法、装置及设备
WO2022134490A1 (zh) * 2020-12-23 2022-06-30 广东科凯达智能机器人有限公司 一种云台目标转换控制方法、装置、设备及存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5623705A (en) * 1994-03-18 1997-04-22 Nikon Corporation Apparatus for inspecting blur correction camera, blur correction camera, and method of inspecting blur correction camera
US20040044279A1 (en) * 2002-05-17 2004-03-04 Lewin Jonathan S. System and method for adjusting image parameters based on device tracking
CN101720027A (zh) * 2009-11-27 2010-06-02 西安电子科技大学 可变焦阵列摄像机协同获取不同分辨率多目标视频方法
CN108965687A (zh) * 2017-05-22 2018-12-07 阿里巴巴集团控股有限公司 拍摄方向识别方法、服务器及监控方法、系统及摄像设备
CN112639652A (zh) * 2020-05-07 2021-04-09 深圳市大疆创新科技有限公司 目标跟踪方法和装置、可移动平台以及成像平台
WO2022057800A1 (zh) * 2020-09-16 2022-03-24 华为技术有限公司 云台摄像机、云台摄像机的追踪控制方法、装置及设备
CN112616019A (zh) * 2020-12-16 2021-04-06 重庆紫光华山智安科技有限公司 目标跟踪方法、装置、云台及存储介质
WO2022134490A1 (zh) * 2020-12-23 2022-06-30 广东科凯达智能机器人有限公司 一种云台目标转换控制方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN117714883A (zh) 2024-03-15

Similar Documents

Publication Publication Date Title
CN109829351B (zh) 车道信息的检测方法、装置及计算机可读存储介质
CN104601892A (zh) 一种终端、图像拍摄方法及装置
US10277888B2 (en) Depth triggered event feature
EP3979065A1 (en) Screen projection method and system
WO2019184604A1 (zh) 一种检测目标图像的方法及装置
US11233946B2 (en) Systems and methods for 3-dimensional (3D) positioning of imaging device
CN105740792A (zh) 目标检测方法和装置
WO2024051330A1 (zh) 摄像机控制方法及相关装置
WO2022143053A1 (zh) 自动聚焦方法、装置、电子设备及介质
CN112514366A (zh) 图像处理方法、图像处理装置和图像处理系统
TW202240462A (zh) 用於圖像同步的方法、裝置、電子設備和計算機儲存媒體
WO2022257505A1 (zh) 目标跟踪方法、系统、设备及存储介质
CN108664847B (zh) 一种对象识别方法、设备和系统
US20230412786A1 (en) Matching segments of video for virtual display of a space
WO2023088040A1 (zh) 摄像头控制方法及装置
JP7146416B2 (ja) 情報処理装置、情報処理システム、情報処理方法、及びプログラム
WO2022142172A1 (zh) 一种检测近场物体的方法、装置、介质和电子设备
CN111161211B (zh) 一种图像检测方法及装置
US20220292833A1 (en) Method and monitoring camera for handling video streams
CN115829911A (zh) 检测系统的成像一致性的方法、装置和计算机存储介质
WO2021008500A1 (zh) 图像处理方法和装置
CN115144843A (zh) 一种物体位置的融合方法及装置
CN114092904A (zh) 车道线检测方法、装置、电子设备及存储介质
CN114245023B (zh) 一种聚焦处理方法及装置、摄像装置和存储介质
EP4332889A1 (en) Method and apparatus for testing imaging consistency of system, and computer 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: 23862031

Country of ref document: EP

Kind code of ref document: A1