技术领域technical field
本发明属于安全防范监控领域,涉及一种控制不同球机输出相同转速的预配置方法及系统。The invention belongs to the field of security monitoring and relates to a pre-configuration method and system for controlling different ball machines to output the same rotational speed.
背景技术Background technique
球机(即球型摄像机)是监控领域中最普遍的监控前端设备之一,球机包括云台和摄像机,其通过云台的转动控制摄像机的监控方向,并通过控制球机的变倍级数来控制摄像机的转速(这里指角速度),变倍级数越高,摄像机的转速越慢。云台作为控制摄像机转动方向的重要部件,其转动速度是衡量云台档次高低的重要指标。Dome camera (that is, dome camera) is one of the most common monitoring front-end equipment in the monitoring field. The dome camera includes a pan-tilt and a camera. The rotation speed of the camera is controlled by the number (here refers to the angular velocity), the higher the zoom level, the slower the rotation speed of the camera. The pan/tilt is an important part to control the rotation direction of the camera, and its rotation speed is an important indicator to measure the level of the pan/tilt.
在一个大型监控系统中,往往会使用到各个品牌的摄像机,但各个厂商球机所采用的零固件、工艺、软件各不不同,会导致各个球机的转速参数也不同。然而,即使是同一个品牌厂家,不同款型的摄像机在转速上也存在差异。因此,在对不同球机来回控制切换时,球机的操控效果非常不好,用户无法使用同一个速度参数控制各个球机以相同的转速运动,不同球机转速适配的问题亟待解决。In a large-scale surveillance system, cameras of various brands are often used, but the firmware, process, and software used by the dome cameras of each manufacturer are different, which will lead to different speed parameters of each dome camera. However, even for the same brand manufacturer, there are differences in the rotation speed of different models of cameras. Therefore, when switching back and forth between different ball machines, the control effect of the ball machines is very bad. Users cannot use the same speed parameter to control each ball machine to move at the same speed. The problem of speed adaptation of different ball machines needs to be solved urgently.
目前大多数监控平台的云台转动速度都是可调整的,在控制不同球机时,可手动调节云台的转动速得到需要的云台转速,但对应同一个速度控制参数,不同球机的真实转速是不同的。为了使得不同球机能够以相同的速度转动,在切换球机时,需要手动去配置各个球机的速度控制参数,这对非固定速度的控制比较困难,如专业云台控制键盘。专业云台控制键盘的转速是根据键盘遥杆摆动幅度设定的,对于转速较慢的球机,方向控制时遥杆摆动幅度要大,对于转速较快的球机,方向控制时遥杆摆动幅度要小,用户需要不断调整遥杆的幅度来控制球机的转速,以此来获取一个较好的控制效果。这种对键盘操作的变化,需要用户不断熟悉,才能较好的控制,不仅牺牲用户使用体验,使用上也非常不方便。At present, the rotation speed of the pan/tilt on most monitoring platforms is adjustable. When controlling different speed domes, the speed of the pan/tilt can be manually adjusted to obtain the desired speed of the pan/tilt. True RPM is different. In order to make different ball machines rotate at the same speed, when switching ball machines, it is necessary to manually configure the speed control parameters of each ball machine, which is difficult to control non-fixed speeds, such as professional pan-tilt control keyboards. The rotation speed of the professional pan/tilt control keyboard is set according to the swing range of the keyboard joystick. For speed ball machines with slow speed, the swing range of the joystick should be larger during direction control. For speed ball machines, the joystick swing should be larger during direction control. The range should be small, and the user needs to constantly adjust the range of the joystick to control the speed of the ball machine, so as to obtain a better control effect. This change to the keyboard operation requires the user to be familiar with it in order to better control it, which not only sacrifices the user experience, but is also very inconvenient to use.
发明内容Contents of the invention
本发明的目的在于克服现有技术的不足,提供一种控制不同球机输出相同转速的预配置方法及系统。The purpose of the present invention is to overcome the deficiencies of the prior art and provide a pre-configuration method and system for controlling different dome machines to output the same rotational speed.
本发明的目的是这样实现的:一种控制不同球机输出相同转速的预配置方法,包括如下步骤:The purpose of the present invention is achieved in this way: a pre-configuration method for controlling different dome machines to output the same rotational speed, comprising the following steps:
预设云台转速级别对应的预期转速范围;The expected speed range corresponding to the preset gimbal speed level;
控制系统发送不同的速度控制参数给球机,预转该球机中的云台,获取该云台的实际转速,当云台实际转速在预期转速范围内,将该实际转速对应的速度控制参数和预期转速范围一一对应地保存到该球机控制模块中,实现球机输出预期转速的速度控制参数的预配置;The control system sends different speed control parameters to the dome camera, pre-rotates the pan/tilt in the dome machine, and obtains the actual speed of the pan/tilt. When the actual speed of the pan/tilt is within the expected speed range, the speed control parameter corresponding to the actual speed One-to-one correspondence with the expected speed range is stored in the dome machine control module to realize the pre-configuration of the speed control parameters of the dome machine outputting the expected speed;
控制系统发送相同的速度控制参数给各球机,各球机控制模块匹配预期转速范围对应的各球机速度控制参数并发送给相应的球机,控制各球机输出相同的转速。The control system sends the same speed control parameters to each dome machine, and each dome machine control module matches the speed control parameters of each dome machine corresponding to the expected speed range and sends them to the corresponding dome machine to control each dome machine to output the same speed.
进一步地,所述速度控制参数为云台转速级别。Further, the speed control parameter is the rotation speed level of the pan/tilt.
进一步地,一一对应地保存云台实际转速对应的速度控制参数和预期转速范围包括如下步骤:Further, saving the speed control parameters and the expected speed range corresponding to the actual speed of the pan/tilt in one-to-one correspondence includes the following steps:
步骤Ⅰ,获取当前球机的云台转速级别范围值1~M,M为正整数,且M≤N,N为系统预设云台转速级别的最大值;Step Ⅰ. Obtain the range value of the pan/tilt speed level of the current dome camera from 1 to M, where M is a positive integer, and M≤N, and N is the maximum value of the system's preset pan/tilt speed level;
步骤Ⅱ,控制系统配置当前球机的云台转速级别为Ni,Ni为正整数,1≤Ni≤M,云台转速级别为Ni时,球机的预期转速范围是PNi~PNiNi,PNiNi>PNi,控制系统计算得到当前球机的云台适配转速级别M1并发送至当前球机:Step Ⅱ, the control system configures that the speed level of the current dome camera is Ni, Ni is a positive integer, 1≤Ni≤M, when the speed level of the dome machine is Ni, the expected speed range of the dome machine is PNi ~PNiNi , PNiNi >PNi , the control system calculates the gimbal adaptation speed level M1 of the current ball machine and sends it to the current ball machine:
M1=Ni×(M/N);M1=Ni×(M/N);
步骤Ⅲ,通过转动当前球机的云台获得当前球机的角速度Q1;Step Ⅲ, obtain the angular velocity Q1 of the current speed dome by turning the gimbal of the current speed dome;
步骤Ⅳ,将角速度Q1与预期转速范围进行比对,当PNi≤Q1≤PNiNi时,控制系统将转速级别M1保存到当前球机的控制模块中;反之,进入步骤Ⅴ;Step Ⅳ, compare the angular velocity Q1 with the expected speed range, when PNi ≤ Q1 ≤ PNiNi , the control system saves the speed level M1 to the control module of the current dome machine; otherwise, enter step Ⅴ;
步骤Ⅴ,控制系统第n次计算当前球机的云台适配转速级别Mn,n为正整数且n≥2,Mn的计算公式为:Step Ⅴ, the control system calculates the pan/tilt adaptation speed level Mn of the current speed dome for the nth time, n is a positive integer and n≥2, and the calculation formula of Mn is:
Mn=Mn-1+((PNi+PNiNi)/2-Qn-1)×(M1/Q1+M2/Q2+….+Mn-1/Qn-1)/n-1,Mn=Mn-1+((PNi +PNiNi )/2-Qn-1)×(M1/Q1+M2/Q2+...+Mn-1/Qn-1)/n-1,
式中,Mn、Mn-1、…、M2、M1分别表示控制系统第n次、第n-1次、…、第2次、第1次计算当前球机云台适配转速级别,Qn-1、…、Q2、Q1分别表示控制系统第n-1次、…、第2次、第1次计算当前球机的角速度,重复步骤Ⅲ和步骤Ⅳ。In the formula, Mn, Mn-1, ..., M2, M1 respectively represent the nth, n-1th, ..., second, and first calculations of the control system for the current dome pan/tilt adaptation speed level, Qn- 1, ..., Q2, Q1 represent the control system calculates the angular velocity of the current speed dome for the n-1, ..., 2, and 1 time respectively, and repeats steps Ⅲ and Ⅳ.
进一步地,所述步骤Ⅲ采用图像匹配算法计算球机的角速度Q1。Further, the step III uses an image matching algorithm to calculate the angular velocity Q1 of the dome camera.
进一步地,所述图像匹配算法的具体步骤为:Further, the specific steps of the image matching algorithm are:
a.采集当前球机云台转动前的初始图像,将图像缩小到8×8的尺寸,总共64个像素,同时,简化图像色彩,将缩小后图像转为64级灰度,将第i行第j列的像素灰度值记为Sij,获得一个8×8的矩阵列表S,S=Sij,i、j均为正整数,1≤i≤8,1≤j≤8;a. Collect the initial image of the current speed dome pan/tilt, reduce the image to 8×8 size, a total of 64 pixels, at the same time, simplify the image color, convert the reduced image to 64-level grayscale, and convert the i-th row The gray value of the pixel in the jth column is denoted as Sij , and an 8×8 matrix list S is obtained, S=Sij , i and j are both positive integers, 1≤i≤8, 1≤j≤8;
b.计算简化色彩后的图像像素灰度的平均灰度值V1;b. Calculate the average gray value V1 of the image pixel gray after simplifying the color;
c.建立一个8×8的特征矩阵S1,S1=S1ij,S1ij表示特征矩阵的第i行第j列的值,将图像像素灰度值Sij与平均灰度值V1进行比较,Sij≥V1时,S1ij=1;反之,S1ij=0;c. Establish an 8×8 feature matrix S1, S1=S1ij , S1ij represents the value of the i-th row and j-column of the feature matrix, compare the image pixel gray value Sij with the average gray value V1, S Whenij ≥ V1, S1ij = 1; otherwise, S1ij = 0;
d.转动当前球机的云台并采集图像,记录采集到每帧图像时云台的转动时间t’,并对采集的图像重复步骤a-c,得到当前图像的特征矩阵S’=S’ij,S’ij表示特征矩阵的第i行第j列的值;d. Rotate the pan/tilt of the current dome camera and collect images, record the rotation time t' of the pan/tilt when each frame of image is captured, and repeat steps ac for the collected images to obtain the feature matrix S'=S'ij of the current image, S'ij represents the value of the i-th row and j-column of the feature matrix;
e.将当前球机采集的图像的特征矩阵S’和云台转动前初始图像的矩阵S1的每个元素数值一一对应进行对比,统计出矩阵数值相同时的数量St;e. Compare the feature matrix S' of the image collected by the current dome camera with the value of each element of the matrix S1 of the initial image before the pan/tilt rotates, and count the number St when the matrix values are the same;
f.对当前球机的云台转动k圈获取的每帧图片均进行步骤a-e的处理,得到St最大的图像即为球机转动k圈时的图像,球机的角速度Q1:f. Perform steps a-e on each frame of picture acquired by the pan/tilt of the current dome machine rotating k circles, and the image with the largest St is the image when the dome machine rotates k circles. The angular velocity Q1 of the dome machine is:
Q1=k×π/t;Q1=k×π/t;
式中,t为St最大时的图像对应的云台转动时间,k为正整数且k≥1。In the formula, t is the pan-tilt rotation time corresponding to the image when St is the largest, k is a positive integer and k≥1.
进一步地,所述步骤Ⅲ获得当前球机的角速度Q1步骤为:Further, the step III to obtain the current angular velocity Q1 of the dome camera is as follows:
云台转动前,获取云台的水平偏移角度L1,转动一定时间T后,云台停止,再次获取云台的水平偏移角度L2,得到当前球机的转动角速度Q1:Before the gimbal rotates, obtain the horizontal offset angle L1 of the gimbal. After rotating for a certain time T, the gimbal stops, and obtain the horizontal offset angle L2 of the gimbal again to obtain the current rotation angular velocity Q1 of the speed dome:
Q1=(L2-L1)/T。Q1=(L2-L1)/T.
进一步地,所述水平偏移角度由角度传感器检测,角度传感器将该水平位移角度发送至控制系统。Further, the horizontal displacement angle is detected by an angle sensor, and the angle sensor sends the horizontal displacement angle to the control system.
利用本发明的方法,本发明另外提供了一种控制不同球机输出相同转速的预配置系统,包括控制系统、多个球机和多个球机控制模块,所述球机与所述球机控制模块一一对应,其特征在于,所述控制系统预设云台转速级别对应的预期转速范围,并发送相同的云台转速级别给不同的球机,各球机控制模块分别匹配预期转速范围对应的各球机的云台转速级别并发送给相应的球机,控制各球机输出相同的转速;Utilizing the method of the present invention, the present invention additionally provides a preconfigured system for controlling different dome machines to output the same rotational speed, including a control system, a plurality of dome machines and a plurality of dome machine control modules, the dome machine and the dome machine One-to-one correspondence between control modules, characterized in that the control system presets the expected speed range corresponding to the speed level of the pan/tilt, and sends the same speed level of the pan/tilt to different ball machines, and each ball machine control module matches the expected speed range Corresponding PTZ speed level of each dome machine is sent to the corresponding dome machine to control each dome machine to output the same speed;
所述球机的控制模块包括:The control module of the dome machine includes:
预转球机云台获取云台实际转速的云台预转模块;Pre-rotate the dome camera gimbal to obtain the gimbal pre-rotation module for the actual speed of the gimbal;
将云台实际转速与预期转速范围作比较,获取实际转速在预期转速范围内对应的云台转速级别的比较模块;Comparing the actual rotational speed of the pan/tilt with the expected rotational speed range, and obtaining the comparison module of the pan/tilt rotational speed level corresponding to the actual rotational speed within the expected rotational speed range;
用于将实际转速对应的云台转速级别和预期转速范围一一对应地存储的参数存储模块。A parameter storage module for storing the pan/tilt speed level corresponding to the actual speed and the expected speed range in one-to-one correspondence.
本发明的有益效果:本发明通过对监控系统中的各个球机进行参数预配置,使得在实际应用中,当监控系统的控制系统发送同一个速度控制参数时,匹配预配置得到的各球机的实际速度控制参数并以该实际速度控制参数来控制该球机,控制各球机以同样的转速运动,使得云台切换时监控系统采集的图像画面变化较为平缓,以此获得较好的用户体验。尤其是在使用专业键盘控制球机时,用户能够得到较好的控制体验。Beneficial effects of the present invention: the present invention preconfigures the parameters of each dome machine in the monitoring system, so that in practical applications, when the control system of the monitoring system sends the same speed control parameter, each dome machine obtained by matching the preconfiguration The actual speed control parameters of the actual speed control parameters are used to control the dome camera, and control each dome machine to move at the same speed, so that the image screen collected by the monitoring system changes more smoothly when the pan/tilt is switched, so as to obtain better user experience. experience. Especially when using a professional keyboard to control the dome camera, the user can get a better control experience.
通过迭代的方式对各球机云台实际转速在预期转速范围内对应的速度控制参数并保存,实现球机的参数预配置,计算简单,方便在实际应用中对各球机预配置的参数进行调用。另外,根据图像匹配算法计算球机转动的角速度,能提高系统的运行速度和精度,对球机的转动角速度进行准确的控制。此外,还可以通过获取球机中云台的水平偏移角度的变化来计算球机的转动角速度,进一步简化计算方式。By iterative method, the speed control parameters corresponding to the actual rotation speed of each dome camera pan/tilt within the expected speed range are saved and the parameter preconfiguration of the dome machine is realized. The calculation is simple and it is convenient to carry out the preconfigured parameters of each dome machine in practical applications. transfer. In addition, calculating the rotational angular velocity of the dome camera according to the image matching algorithm can improve the operating speed and precision of the system, and accurately control the rotational angular velocity of the dome camera. In addition, the rotation angular velocity of the dome machine can be calculated by obtaining the change of the horizontal offset angle of the pan/tilt in the dome machine, which further simplifies the calculation method.
附图说明Description of drawings
图1为本发明实施例监控系统的结构示意图;Fig. 1 is the structural representation of the monitoring system of the embodiment of the present invention;
图2为本发明实施例云台预配置的示意图。Fig. 2 is a schematic diagram of the pre-configuration of the pan/tilt according to the embodiment of the present invention.
具体实施方式detailed description
下面结合附图并通过具体实施例对本发明作进一步详述,以下实施例只是描述性的,不是限定性的,不能以此限定本发明的保护范围。The present invention will be further described in detail below in conjunction with the accompanying drawings and through specific embodiments. The following embodiments are only descriptive, not restrictive, and cannot limit the protection scope of the present invention.
本发明的一种控制不同球机输出相同转速的预配置系统,参见图1,本实施例包括多个球机和多个球机控制模块,球机与球机控制模块一一对应,多个球机控制模块通过一个控制系统控制。球机包括摄像机和控制摄像机转动的云台,云台可选择固定云台或电动云台,云台通过水平驱动电机的驱动实现水平方向的转动,通过垂直驱动电机的驱动实现垂直方向的转动,进而带动摄像机朝着不同的方向转动。通常,球机转速(本实施方式中转速为角速度)指的是球机在1级变倍下的转速,且球机的变倍级数越高,球机的转速越慢。为了方便对对比,本实施例在对多个球机进行转速适配预配置前,所有球机均位于1级变倍下。A pre-configuration system of the present invention that controls different ball machines to output the same rotational speed, see Figure 1, this embodiment includes multiple ball machines and multiple ball machine control modules, the ball machines correspond to the ball machine control modules one by one, and multiple The speed dome control module is controlled by a control system. The dome camera includes a camera and a pan/tilt that controls the rotation of the camera. The pan/tilt can choose a fixed pan/tilt or an electric pan/tilt. The pan/tilt realizes horizontal rotation through the drive of the horizontal drive motor, and realizes vertical rotation through the drive of the vertical drive motor. Then drive the camera to rotate in different directions. Generally, the rotational speed of the speed dome (in this embodiment, the rotational speed is angular velocity) refers to the rotational speed of the speed dome at 1-stage zoom, and the higher the zoom level of the speed dome, the slower the speed of the speed dome. For the convenience of comparison, in this embodiment, before the speed adaptation and preconfiguration of multiple speed dome machines, all speed dome machines are under the 1-level zoom.
球机控制模块包括云台预转模块、比较模块和参数存储模块。其中,云台预转模块用于预转球机云台获取云台实际转速,比较模块将云台实际转速与预期转速范围作比较,获取实际转速在预期转速范围内对应的云台速度控制参数,在本实施例中,云台的速度控制参数为云台转速级别,参数存储模块用于将实际转速对应的云台转速级别和预期转速范围一一对应地存储的。The speed dome control module includes a pan/tilt prerotation module, a comparison module and a parameter storage module. Among them, the pan/tilt pre-rotation module is used to pre-rotate the ball machine pan/tilt to obtain the actual speed of the pan/tilt, and the comparison module compares the actual speed of the pan/tilt with the expected speed range, and obtains the speed control parameters of the pan/tilt corresponding to the actual speed within the expected speed range , in this embodiment, the speed control parameter of the pan/tilt is the rotational speed level of the pan/tilt, and the parameter storage module is used to store the rotational speed level of the pan/tilt corresponding to the actual rotational speed and the expected rotational speed range in a one-to-one correspondence.
在监控系统中,控制系统发送一个相同的云台转速级别给多个球机时,如果不对监控系统中的各个球机进行预配置,各个球机可能输出不同的转速,用户体验差,为了解决当控制系统发送同一个云台转速级别给多个球机时,多个球机转速相同的问题,本发明的一种控制不同球机输出相同转速的预配置方法,具体包括:In the monitoring system, when the control system sends the same speed level of the pan/tilt to multiple speed domes, if the speed domes in the monitoring system are not pre-configured, each speed dome may output different speeds, and the user experience is poor. In order to solve When the control system sends the same speed level of the pan/tilt to multiple ball machines, the speed of the multiple ball machines is the same. The present invention provides a pre-configuration method for controlling different speed ball machines to output the same speed, which specifically includes:
步骤一,预设云台转速级别对应的预期转速范围,如表1所示:Step 1, preset the expected speed range corresponding to the speed level of the gimbal, as shown in Table 1:
表1Table 1
表1中,Ni、N均为正整数,N表示预设系统云台转速级别的最大值,1≤Ni≤N,P1,P11;P2,P22;…;PNi,PNiNi;…;PN,PNN均为正数,且P11>P1,P22>P2,…,PNiNi>PNi,…,PNN>PN。当控制系统设定一个统一的云台转速级别Ni发送给球机1到球机n,球机1到球机n输出转速的预期转速范围为:PNi~PNiNi。In Table 1, Ni and N are both positive integers, N represents the maximum value of the preset system pan/tilt speed level, 1≤Ni≤N, P1 , P11 ; P2 , P22 ;...; PNi , PNiNi ;...; PN , PNN are both positive numbers, and P11 >P1 , P22 >P2 , ..., PNiNi >PNi , ..., PNN >PN . When the control system sets a unified pan/tilt speed level Ni and sends it to dome machine 1 to dome machine n, the expected speed range of the output speed of dome machine 1 to dome machine n is: PNi ~ PNiNi .
步骤二,控制系统发送不同的云台转速级别给球机,预转该球机中的云台,获取该云台的实际转速,当云台实际转速在预期转速范围内,将该实际转速对应的云台转速级别和预期转速范围一一对应地保存到该球机控制模块中,实现球机输出预期转速的速度控制参数的预配置。Step 2: The control system sends different speed levels of the pan/tilt to the ball machine, pre-rotates the pan/tilt in the ball machine, and obtains the actual speed of the pan/tilt. When the actual speed of the pan/tilt is within the expected speed range, the actual speed corresponds to The speed level of the pan/tilt and the expected speed range are stored in the dome machine control module in one-to-one correspondence, so as to realize the pre-configuration of the speed control parameters of the dome machine outputting the expected speed.
参见图2,此步骤中通过预转获得云台实际转速的过程为:See Figure 2, the process of obtaining the actual speed of the gimbal through pre-rotation in this step is:
步骤Ⅰ,获取当前球机云台的转速级别范围值1~M,M为正整数,且M≤N。当前实施例中的球机云台转速级别是1~256。Step Ⅰ, obtain the speed level range value of the current speed dome gimbal from 1 to M, where M is a positive integer, and M≤N. In the current embodiment, the rotation speed level of the dome camera gimbal is 1-256.
步骤Ⅱ,控制系统配置当前球机的云台转速级别为Ni,Ni为正整数,且Ni≤M。控制系统通过计算得到当前球机的云台适配转速级别M1并发送至该球机,云台适配的转速级别M1的计算公式为:Step II, the control system configures the speed level of the pan/tilt of the current dome camera as Ni, where Ni is a positive integer, and Ni≤M. The control system obtains the speed level M1 of the pan/tilt adaptation speed of the current dome camera through calculation and sends it to the speed dome machine. The calculation formula of the speed level M1 of the pan/tilt adaptation is:
M1=Ni×(M/N)。M1=Ni×(M/N).
当计算获得的M1不是整数时,通过四舍五入的方式对M1进行取整。When the calculated M1 is not an integer, M1 is rounded up.
步骤Ⅲ,通过云台预转获取当前球机的转动角速度Q1。Step Ⅲ, obtain the current rotation angular velocity Q1 of the speed dome through the pre-rotation of the gimbal.
本实施例采用图像匹配算法获取当前球机的云台在水平方向上转动k圈,k为正整数且k≥1,即云台转动k×360°时的球机转动角速度Q1,其中,图像匹配算法采用感知哈希算法或特征区域匹配算法,当前实施例采用感知哈希算法来计算各球机的角速度Q1,具体步骤为:In this embodiment, the image matching algorithm is used to obtain the pan-tilt of the current dome machine rotating k circles in the horizontal direction, k is a positive integer and k≥1, that is, the rotational angular velocity Q1 of the dome machine when the pan-tilt rotates k×360°, wherein, the image The matching algorithm adopts the perceptual hash algorithm or the feature area matching algorithm. The current embodiment uses the perceptual hash algorithm to calculate the angular velocity Q1 of each ball machine. The specific steps are:
a.采集当前球机云台转动前的初始图像,将图像缩小到8×8的尺寸,总共64个像素,这样做是为了摒弃不同尺寸、比例的图像带来的图像差异,方便后续计算。同时,简化图像色彩,将缩小后图像转为64级灰度,即所有像素点总共只有64种颜色。将第i行第j列的像素灰度值记为Sij,获得一个8×8的矩阵列表S,S=Sij,i,j均为正整数,1≤i≤8,1≤j≤8。a. Collect the initial image before the dome gimbal rotates, and reduce the image to a size of 8×8, with a total of 64 pixels. This is done to eliminate the image differences caused by images of different sizes and ratios, and to facilitate subsequent calculations. At the same time, the image color is simplified, and the reduced image is converted to 64-level grayscale, that is, there are only 64 colors in total for all pixels. Record the pixel gray value of row i and column j as Sij , and obtain an 8×8 matrix list S, S=Sij , i, j are both positive integers, 1≤i≤8, 1≤j≤ 8.
b.计算简化色彩后的图像像素灰度的平均灰度值V1。b. Calculate the average gray value V1 of the image pixel gray after simplifying the color.
c.建立一个8×8的特征矩阵S1,S1=S1ij,S1ij表示特征矩阵的第i行第j列的值,i,j均为正整数,1≤i≤8,1≤j≤8。将简化色彩后的图像像素灰度值Sij与平均灰度值V1进行比较,Sij≥V1时,S1ij=1;反之,S1ij=0,获取一个8×8的特征矩阵S1。c. Establish an 8×8 feature matrix S1, S1=S1ij , S1ij represents the value of the i-th row and j-column of the feature matrix, i, j are positive integers, 1≤i≤8, 1≤j≤ 8. Compare the image pixel gray value Sij after color simplification with the average gray value V1, when Sij ≥ V1, S1ij =1; otherwise, S1ij =0, and obtain an 8×8 feature matrix S1.
d.转动当前球机的云台并采集图像,记录采集到每帧图像时云台的转动时间t’,并对采集的图像重复步骤a-c,得到当前图像的特征矩阵S’=S’ij,S’ij表示特征矩阵的第i行第j列的值,i,j均为正整数,1≤i≤8,1≤j≤8。d. Rotate the pan/tilt of the current dome camera and collect images, record the rotation time t' of the pan/tilt when each frame of image is captured, and repeat steps ac for the collected images to obtain the feature matrix S'=S'ij of the current image, S'ij represents the value of row i and column j of the feature matrix, i and j are both positive integers, 1≤i≤8, 1≤j≤8.
e.将当前球机采集的图像的特征矩阵S’和云台转动前初始图像的矩阵S1的每个元素数值一一对应进行对比,统计出矩阵数值相同时的数量St。e. Compare the feature matrix S' of the image currently collected by the dome camera with the value of each element of the matrix S1 of the initial image before the pan/tilt rotates, and count the number St when the matrix values are the same.
f.对当前球机的云台转动k圈获取的每帧图片均进行步骤a-e的处理,得到St最大的图像即为球机转动k圈时的图像,球机输出角速度Q1:f. Perform steps a-e on each frame of picture acquired by the pan/tilt of the current dome machine rotating k circles, and the image with the largest St is the image when the dome machine rotates k circles, and the dome machine outputs angular velocity Q1:
Q1=k×π/t;Q1=k×π/t;
式中,t为St最大时的图像对应的云台转动时间。In the formula, t is the pan-tilt rotation time corresponding to the image when St is the largest.
在本实施例中,当前球机的云台在水平方向上转动360°,采集多帧图像,进行处理计算出球机转动角速度Q1。In this embodiment, the pan/tilt of the current dome camera rotates 360° in the horizontal direction, collects multiple frames of images, and performs processing to calculate the rotational angular velocity Q1 of the dome camera.
本发明对步骤Ⅲ的获取球机转动角速度还提供了另一种方式,在云台水平驱动电机的转动轴上安装用于检测云台转动角度的角度传感器,角度传感器可根据需要选择现有的常规角度传感器类型。具体地,本实施例中角度传感器选择高精度倾角传感器SCA100T。The present invention also provides another method for obtaining the rotational angular velocity of the dome camera in step III. An angle sensor for detecting the rotational angle of the pan-tilt is installed on the rotating shaft of the pan-tilt horizontal drive motor. The angle sensor can be selected from an existing one as required. General angle sensor type. Specifically, the high-precision inclination sensor SCA100T is selected as the angle sensor in this embodiment.
云台转动前,利用角度传感器检测云台的水平偏移角度L1,转动一定时间T后,云台停止,再次检测云台的水平偏移角度L2,得到角速度Q1,角度传感器将检测的水平偏移角度L1和水平偏移角度L2均发送至控制系统,由控制系统计算获得球机的转动角速度Q1:Before the gimbal rotates, use the angle sensor to detect the horizontal deflection angle L1 of the gimbal. After rotating for a certain time T, the gimbal stops and detect the horizontal deflection angle L2 of the gimbal again to obtain the angular velocity Q1. The angle sensor will detect the horizontal deflection angle Both the shift angle L1 and the horizontal offset angle L2 are sent to the control system, and the control system calculates the rotation angular velocity Q1 of the ball machine:
Q1=(L2-L1)/T。Q1=(L2-L1)/T.
当然,也可以检测云台转动前和停止时的垂直偏移角度来计算球机的转动角速度。Of course, it is also possible to detect the vertical deflection angle before the pan/tilt rotates and when it stops to calculate the rotational angular velocity of the dome camera.
步骤Ⅳ,将角速度Q1与预期转速范围PNi~PNiNi进行比对,若匹配,即PNi≤Q1≤PNiNi,则配置成功,,控制系统将转速级别M1保存到当前球机的球机控制模块中。反之,若不匹配,则进行一轮校准,进入步骤Ⅴ;Step Ⅳ, compare the angular velocity Q1 with the expected rotational speed range PNi ~PNiNi , if they match, that is, PNi ≤ Q1 ≤ PNiNi , then the configuration is successful, and the control system will save the rotational speed level M1 to the dome machine of the current dome machine in the control module. On the contrary, if they do not match, perform a round of calibration and enter step Ⅴ;
步骤Ⅴ,控制系统第n次计算云台适配转速级别Mn,n为正整数且n≥2,Mn的计算公式为:Step Ⅴ, the control system calculates the pan/tilt adaptation speed level Mn for the nth time, n is a positive integer and n≥2, the calculation formula of Mn is:
Mn=Mn-1+((PNi+PNiNi)/2-Qn-1)×(M1/Q1+M2/Q2+….+Mn-1/Qn-1)/n-1,Mn=Mn-1+((PNi +PNiNi )/2-Qn-1)×(M1/Q1+M2/Q2+...+Mn-1/Qn-1)/n-1,
式中,Mn、Mn-1、…、M2、M1分别表示控制系统第n次、第n-1次、…、第2次、第1次计算当前球机云台适配转速级别,Qn-1、…、Q2、Q1分别表示控制系统第n-1次、…、第2次、第1次计算当前球机的角速度。当计算获得的Mn不是整数时,通过四舍五入的方式对Mn进行取整。In the formula, Mn, Mn-1, ..., M2, M1 respectively represent the nth, n-1th, ..., second, and first calculations of the control system for the current dome pan/tilt adaptation speed level, Qn- 1, ..., Q2, and Q1 represent the angular velocity of the current dome camera calculated by the control system for the n-1, ..., 2, and 1 time respectively. When the calculated Mn is not an integer, Mn is rounded up.
重复步骤Ⅲ和步骤Ⅳ,直至第n次计算得到的球机角速度Qn满足条件:PNi≤Qn≤PNiNi,控制系统将转速级别Mn保存到当前球机的球机控制模块中,当前球机的转速可达到系统配置转速级别Ni的预期转速PNi~PNiNi内。Repeat steps Ⅲ and Ⅳ until the angular velocity Qn of the dome machine calculated for the nth time satisfies the condition: PNi ≤ Qn ≤ PNiNi , the control system saves the speed level Mn to the dome machine control module of the current dome machine, and the current dome machine The rotation speed can reach within the expected rotation speed PNi ~PNiNi of the system configuration speed level Ni.
通过上述迭代的方式控制不同球机输出相同的转动速度,对于不同速度参数的球机A和B,当控制系统设置的速度级别固定时,控制系统通过迭代计算分别获得球机A和球机B的转动角速度在预期转动角速度范围内时对应的云台适配转速级别,并将计算获得的对应的云台适配转速级别发送至球机A和球机B,控制球机A时,球机A实际转速是在预期转动角速度范围内,切换到球机B控制时,球机B实际转速同样是在预期转动角速度范围内,使得云台切换时监控系统采集的图像画面变化较为平缓,以此获得较好的用户体验。Through the above iterative method, different ball machines are controlled to output the same rotation speed. For ball machines A and B with different speed parameters, when the speed level set by the control system is fixed, the control system obtains ball machine A and ball machine B respectively through iterative calculation. When the rotational angular velocity is within the expected rotational angular velocity range, the corresponding pan/tilt adaptation speed level will be calculated, and the corresponding pan/tilt adaptation speed level will be sent to dome machine A and dome machine B. When controlling dome machine A, the dome machine will The actual speed of A is within the range of the expected rotational angular velocity. When switching to control of dome machine B, the actual rotational speed of dome machine B is also within the expected rotational angular speed range, so that the image screen collected by the monitoring system changes relatively smoothly when the pan/tilt is switched. Get a better user experience.
步骤三,控制系统发送相同的云台转速级别给各球机,各球机控制模块匹配预期转速范围对应的各球机云台转速级别并发送给相应的球机,控制各球机输出相同的转速。Step 3: The control system sends the same pan/tilt speed level to each dome machine, and the control module of each dome machine matches the pan/tilt speed level of each dome machine corresponding to the expected speed range and sends it to the corresponding dome machine to control each dome machine to output the same speed. Rotating speed.
本发明使得当控制系统发送的转速等级固定时,通过各个球机的球机控制模块匹配经预配置保存于该球机控制模块中的速度控制参数,并将该速度控制参数发送给对应的球机,控制球机在预期转速范围内转动,获得较好的用户控制体验。The invention makes it possible to match the speed control parameters pre-configured and stored in the dome machine control module through the dome machine control module of each dome machine when the rotational speed level sent by the control system is fixed, and send the speed control parameter to the corresponding dome machine machine, control the dome machine to rotate within the expected speed range, and obtain a better user control experience.
以上所述,仅是本发明的较佳实施例,并非对本发明作任何限制,凡是根据本发明技术实质对以上实施例所作的任何简单修改、变更以及等效结构变化,均仍属于本发明技术方案的保护范围。The above are only preferred embodiments of the present invention, and do not limit the present invention in any way. All simple modifications, changes and equivalent structural changes made to the above embodiments according to the technical essence of the present invention still belong to the technical aspects of the present invention. protection scope of the program.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510750724.2ACN105388923B (en) | 2015-11-06 | 2015-11-06 | A kind of method for pre-configuration and system controlling different ball machine output same rotational speeds |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510750724.2ACN105388923B (en) | 2015-11-06 | 2015-11-06 | A kind of method for pre-configuration and system controlling different ball machine output same rotational speeds |
| Publication Number | Publication Date |
|---|---|
| CN105388923Atrue CN105388923A (en) | 2016-03-09 |
| CN105388923B CN105388923B (en) | 2018-07-13 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510750724.2AActiveCN105388923B (en) | 2015-11-06 | 2015-11-06 | A kind of method for pre-configuration and system controlling different ball machine output same rotational speeds |
| Country | Link |
|---|---|
| CN (1) | CN105388923B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5896131A (en)* | 1981-12-04 | 1983-06-08 | Hitachi Ltd | Gas turbine speed control method |
| JP2002202819A (en)* | 2000-12-28 | 2002-07-19 | Sanken Electric Co Ltd | Position controller |
| CN1554193A (en)* | 2001-07-25 | 2004-12-08 | �����J��ʷ����ɭ | Camera control device and method |
| CN1972383A (en)* | 2005-11-25 | 2007-05-30 | 中兴通讯股份有限公司 | Method for flexible control of rotary speed of cam through terminal device |
| CN101404725A (en)* | 2008-11-24 | 2009-04-08 | 深圳华为通信技术有限公司 | Camera, camera set, its control method, apparatus and system |
| CN102082908A (en)* | 2010-11-23 | 2011-06-01 | 天津市亚安科技电子有限公司 | Method for adaptively adjusting tripod head rotating speed according to camera zoom |
| CN102143324A (en)* | 2011-04-07 | 2011-08-03 | 天津市亚安科技电子有限公司 | Method for automatically and smoothly tracking target by cradle head |
| CN103533246A (en)* | 2013-10-22 | 2014-01-22 | 上海安奎拉信息技术有限公司 | A control method for automatic tracking spherical camera |
| CN103856762A (en)* | 2014-01-26 | 2014-06-11 | 孙培梁 | Multi-camera intelligent selection and video priority judgment system and selection method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5896131A (en)* | 1981-12-04 | 1983-06-08 | Hitachi Ltd | Gas turbine speed control method |
| JP2002202819A (en)* | 2000-12-28 | 2002-07-19 | Sanken Electric Co Ltd | Position controller |
| CN1554193A (en)* | 2001-07-25 | 2004-12-08 | �����J��ʷ����ɭ | Camera control device and method |
| CN1972383A (en)* | 2005-11-25 | 2007-05-30 | 中兴通讯股份有限公司 | Method for flexible control of rotary speed of cam through terminal device |
| CN101404725A (en)* | 2008-11-24 | 2009-04-08 | 深圳华为通信技术有限公司 | Camera, camera set, its control method, apparatus and system |
| CN102082908A (en)* | 2010-11-23 | 2011-06-01 | 天津市亚安科技电子有限公司 | Method for adaptively adjusting tripod head rotating speed according to camera zoom |
| CN102143324A (en)* | 2011-04-07 | 2011-08-03 | 天津市亚安科技电子有限公司 | Method for automatically and smoothly tracking target by cradle head |
| CN103533246A (en)* | 2013-10-22 | 2014-01-22 | 上海安奎拉信息技术有限公司 | A control method for automatic tracking spherical camera |
| CN103856762A (en)* | 2014-01-26 | 2014-06-11 | 孙培梁 | Multi-camera intelligent selection and video priority judgment system and selection method |
| Publication number | Publication date |
|---|---|
| CN105388923B (en) | 2018-07-13 |
| Publication | Publication Date | Title |
|---|---|---|
| CN101918893B (en) | Method and apparatus with depth map generation | |
| CN103096096B (en) | Digital photographing apparatus | |
| US9215374B2 (en) | Image processing apparatus, image processing method, and imaging apparatus that corrects tilt of an image based on an operation input | |
| CN103780837B (en) | A kind of motion detection and the method and its device of positioning shooting | |
| CN105912293B (en) | Intelligent terminal equipment | |
| JP2004304265A (en) | Image processing system, projector, program, information storage medium, and image processing method | |
| CN112866627B (en) | Three-dimensional video monitoring method and related equipment | |
| CN111815715B (en) | Calibration method and device of zoom pan-tilt camera and storage medium | |
| CN110800309B (en) | Image processing method, image processing apparatus, electronic apparatus, and storage medium | |
| US10182184B2 (en) | Image processing apparatus and image processing method | |
| CN105388923A (en) | Pre-configuration method and system for controlling different dome cameras to output same rotating speed | |
| KR102052597B1 (en) | Terminal for driving inner camera | |
| JP7143649B2 (en) | Image processing device, image processing system, image processing method, and program | |
| CN110636157B (en) | A tracking method of handheld gimbal based on embedded face recognition technology in floating window | |
| CN208126415U (en) | Photographic device based on face recognition technology | |
| CN101873434A (en) | Image capturing device and related method | |
| US8411148B2 (en) | Auto iris lens calibration device and method | |
| CN115995217A (en) | Display terminal backlight compensation method and system, electronic equipment and chip thereof | |
| EP4137930A1 (en) | Image display method and apparatus, terminal device, storage medium, and program product | |
| CN110798607A (en) | Shooting state adjusting method and device | |
| US11284004B2 (en) | Imaging device for detecting horizontal direction of photographing angle | |
| WO2020133175A1 (en) | Tracking objects using sensor rotation | |
| JP7284246B2 (en) | Imaging device | |
| JP2004088545A (en) | Backlight correction control device and backlight correction control method | |
| WO2017104228A1 (en) | Signal processing method and image capturing device |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |