CN108632569A - Video frequency monitoring method and device based on the linkage of rifle ball - Google Patents
Video frequency monitoring method and device based on the linkage of rifle ball Download PDFInfo
- Publication number
- CN108632569A CN108632569A CN201710167181.0A CN201710167181A CN108632569A CN 108632569 A CN108632569 A CN 108632569A CN 201710167181 A CN201710167181 A CN 201710167181A CN 108632569 A CN108632569 A CN 108632569A
- Authority
- CN
- China
- Prior art keywords
- spherical
- ipc
- coordinate system
- point
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/18—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
- H04N7/181—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30232—Surveillance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30244—Camera pose
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Closed-Circuit Television Systems (AREA)
Abstract
Description
技术领域technical field
本申请涉及视频分析领域,特别涉及一种基于枪球联动的视频监控方法及装置。The present application relates to the field of video analysis, in particular to a video monitoring method and device based on gun-ball linkage.
背景技术Background technique
视频监控是指通过网络摄像机(Internet Protocol Camera,IPC)将采集到的视频画面发送给客户端,以供客户端对该视频画面进行查看。目前IPC主要分为枪型IPC和球型IPC,由于枪型IPC主要用于采集大范围的视频画面,而球型IPC主要用于采集小范围高精度的视频画面,因此对于大范围内移动的目标对象的视频监控,为了既可以整体监控到该目标对象的移动情况,又可以对该目标对象的细节进行监控,通常需要采用枪球联动的视频监控方法,也即服务器同时将枪型IPC采集的视频画面和服务器为该枪型IPC配置的球型IPC采集的视频画面发送给客户端,实现对目标对象基于枪球联动的视频监控。Video monitoring refers to sending the collected video images to the client through an Internet Protocol Camera (IPC), so that the client can view the video images. At present, IPCs are mainly divided into gun-type IPCs and ball-type IPCs. Since gun-type IPCs are mainly used to collect large-scale video images, while spherical-type IPCs are mainly used to collect small-scale and high-precision video images, the For the video monitoring of the target object, in order to not only monitor the movement of the target object as a whole, but also monitor the details of the target object, it is usually necessary to adopt the video monitoring method of gun-ball linkage, that is, the server simultaneously collects the gun-type IPC The video screen and the video screen collected by the ball-type IPC configured by the server for the gun-type IPC are sent to the client to realize the video monitoring of the target object based on the gun-ball linkage.
目前,当基于枪球联动进行视频监控时,服务器预先将枪型IPC采集的视频画面均匀划分成m行n列的网格,之后,服务器可以基于枪型IPC采集的视频画面,从该m行n列的网格中确定目标对象当前所处的网格,并控制球型IPC采集该网格内的视频画面。在目标对象没有位于该网格的中心时,球型IPC采集的视频画面的中心将不是该目标对象,导致通过球型IPC对该目标对象进行视频监控的效果不佳,因此,服务器还需要预先从该网格中确定4个标定点,并确定将球型IPC采集的视频画面的中心点从该网格的中心点移动到该4个标定点时该球型IPC需要转动的偏移量,得到该4个标定点的偏移量。之后,当服务器检测到目标对象在该网格内从一个位置移动到另一个位置时,从该4个标定点中选择与该目标对象移动后的位置相对比较近的3个标定点,基于该3个标定点的偏移量,确定将球型IPC采集的视频画面的中心点从该网格的中心点移动到该另一位置时球型IPC需要转动的偏移量,并控制球型IPC按照该偏移量进行转动,从而保证目标对象位于球型IPC采集的视频画面的中心,以实现在该目标对象的位置变化后,通过球型IPC对该目标对象进行实时监控。Currently, when performing video surveillance based on gun-ball linkage, the server pre-evenly divides the video images collected by the gun-type IPC into a grid of m rows and n columns. Determine the current grid of the target object in the n-column grid, and control the spherical IPC to collect video images in the grid. When the target object is not located at the center of the grid, the center of the video picture collected by the spherical IPC will not be the target object, resulting in poor video monitoring of the target object through the spherical IPC. Therefore, the server also needs to Determine 4 calibration points from the grid, and determine the offset that the spherical IPC needs to rotate when the center point of the video picture collected by the spherical IPC is moved from the center point of the grid to the 4 calibration points, Get the offset of the 4 calibration points. Afterwards, when the server detects that the target object moves from one position to another within the grid, it selects 3 calibration points that are relatively close to the position after the target object moves from the 4 calibration points, based on the The offset of the 3 calibration points determines the offset that the spherical IPC needs to rotate when the center point of the video picture collected by the spherical IPC is moved from the center point of the grid to the other position, and controls the spherical IPC Rotate according to the offset, so as to ensure that the target object is located at the center of the video image collected by the spherical IPC, so as to realize real-time monitoring of the target object through the spherical IPC after the position of the target object changes.
由于上述方法是通过理论运算来确定球型IPC需要转动的偏移量,但是实际应用中,随着球型IPC的使用时间的增加,球型IPC的转带将出现老化等问题,导致球型IPC按照理论偏移量进行偏移时,会出现与实际偏移量存在误差的情况。因此,按照上述方法进行视频监控时,目标对象可能并没有位于球型IPC采集的视频画面的中心,从而降低了通过球型IPC对目标对象的细节进行监控的效果。Since the above method is to determine the offset that the spherical IPC needs to rotate through theoretical calculations, but in practical applications, with the increase in the use time of the spherical IPC, problems such as aging of the spherical IPC’s belt will occur, resulting in spherical IPC When the IPC is offset according to the theoretical offset, there will be an error with the actual offset. Therefore, when performing video monitoring according to the above method, the target object may not be located at the center of the video image collected by the spherical IPC, thereby reducing the effect of monitoring the details of the target object through the spherical IPC.
发明内容Contents of the invention
为了解决现有技术中球型IPC由于老化等问题导致球型IPC按照理论偏移量偏移之后出现目标对象可能没有位于球型IPC采集的视频画面的中心的现象,本申请提供了一种基于枪球联动的视频监控方法及装置。所述技术方案如下:In order to solve the phenomenon in the prior art that the spherical IPC is shifted according to the theoretical offset due to problems such as aging, the target object may not be located in the center of the video picture collected by the spherical IPC, the application provides a method based on A video surveillance method and device for gun-ball linkage. Described technical scheme is as follows:
第一方面,提供了一种基于枪球联动的视频监控方法,所述方法包括:In the first aspect, a video surveillance method based on gun-ball linkage is provided, the method comprising:
获取目标对象在第一视频画面中所占的区域的中心点的特征信息,所述第一视频画面为枪型网络摄像机IPC采集的视频画面,所述特征信息包括所述中心点的像素值分别与多个邻域像素点的像素值之间的像素差值,所述多个邻域像素点为所述第一视频画面中处于所述中心点的邻域内的像素点;Acquire the feature information of the center point of the area occupied by the target object in the first video picture, the first video picture is a video picture collected by the gun-type network camera IPC, and the feature information includes the pixel values of the center point respectively The pixel difference between the pixel value and the pixel value of a plurality of neighboring pixel points, the plurality of neighboring pixel points are the pixel points in the neighborhood of the central point in the first video picture;
在第二视频画面包括的像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点,所述第二视频画面是为所述枪型IPC配置的球型IPC当前采集的视频画面;Searching for pixel points whose feature information matches the feature information of the center point of the area occupied by the target object in the first video picture among the pixels included in the second video picture, the second video picture is for the first video picture The video screen currently collected by the spherical IPC configured with the gun-type IPC;
根据查找到的像素点在所述球型IPC的球面坐标系中对应的经度和纬度,确定所述球型IPC的第一转动角度,所述第一转动角度为将所述第二视频画面的中心点转动至所述目标对象在所述第二视频画面中所占的区域的中心点时所述球型IPC需要转动的角度;According to the longitude and latitude corresponding to the pixel points found in the spherical coordinate system of the spherical IPC, the first rotation angle of the spherical IPC is determined, and the first rotation angle is the rotation angle of the second video picture The angle at which the spherical IPC needs to be rotated when the center point is rotated to the center point of the area occupied by the target object in the second video frame;
向所述球型IPC发送第一转动请求,所述第一转动请求携带所述第一转动角度,所述第一转动请求用于指示所述球型IPC根据所述第一转动角度进行转动。sending a first rotation request to the spherical IPC, the first rotation request carrying the first rotation angle, and the first rotation request is used to instruct the spherical IPC to rotate according to the first rotation angle.
在本发明实施例中,直接在第二视频画面中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,并控制球型IPC将第二视频画面的中心转动至目标对象在第二视频画面中所占区域的中心点也即查找到的像素点,以实现将目标对象在第二视频画面中所占区域的中心点置于第二视频画面的中心,避免出现因为球型IPC老化问题导致目标对象可能没有位于球型IPC采集的视频画面的中心的情况,从而提高通过球型IPC对目标对象的细节进行监控的效果。In the embodiment of the present invention, the pixel point whose feature information matches the feature information of the center point of the area occupied by the target object in the first video picture is directly searched in the second video picture, and the spherical IPC is controlled to convert the second video picture The center of the picture is rotated to the center point of the area occupied by the target object in the second video picture, that is, the found pixel point, so as to place the center point of the area occupied by the target object in the second video picture on the second video picture The center of the spherical IPC avoids the situation that the target object may not be located in the center of the video picture collected by the spherical IPC due to the aging problem of the spherical IPC, thereby improving the effect of monitoring the details of the target object through the spherical IPC.
可选地,所述在第二视频画面包括的像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点,包括:Optionally, the searching pixel points included in the second video frame whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame includes:
在所述第二视频画面中,以所述第二视频画面的中心点为中心确定面积为预设面积的第一目标区域,所述预设面积为根据所述球型IPC的老化程度确定的;In the second video frame, the center point of the second video frame is used as the center to determine the first target area whose area is a preset area, and the preset area is determined according to the aging degree of the spherical IPC ;
从所述第一目标区域包括的所有像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Finding, from all the pixels included in the first target area, the pixel points whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame.
进一步地,为了提高在第二视频画面中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点的效率,可以在第二视频画面中确定第一目标区域,仅在该第一目标区域中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Further, in order to improve the efficiency of searching for pixels whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame in the second video frame, the first video frame can be determined in the second video frame. The target area is to search only the pixel points whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame in the first target area.
可选地,所述从所述第一目标区域包括的所有像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点,包括:Optionally, searching for pixels whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame from all the pixels included in the first target area, include:
获取所述第一目标区域包括的所有像素点的特征信息;Obtain feature information of all pixels included in the first target area;
对于所述第一目标区域包括的所有像素点中的每个像素点,对所述像素点的特征信息包括的像素差值进行平均运算和极差运算,得到第一平均值和第一极差值,并将所述第一平均值和所述第一极差值之间的乘积确定为所述像素点的特征值;For each pixel in all the pixels included in the first target area, an average operation and a range operation are performed on the pixel difference values included in the feature information of the pixel points to obtain a first average value and a first range difference value, and determine the product between the first average value and the first range value as the feature value of the pixel point;
对所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息包括的像素差值进行平均运算和极差运算,得到第二平均值和第二极差值,并将所述第二平均值和所述第二极差值之间的乘积确定为目标特征值;performing an average operation and a range operation on the pixel difference values included in the feature information of the center point of the area occupied by the target object in the first video frame to obtain a second average value and a second range value, and The product between the second average value and the second range value is determined as a target feature value;
从所述第一目标区域包括的所有像素点的特征值中,选择与所述目标特征值之间的差值最小的特征值,并将选择的特征值对应的像素点确定为特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点。From the eigenvalues of all pixels included in the first target area, select the eigenvalue with the smallest difference with the target eigenvalue, and determine the pixel corresponding to the selected eigenvalue as the feature information and the set The pixel points that match the feature information of the center point of the area occupied by the target object in the first video frame.
在本发明实施例中,确定第一目标区域中特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,可以通过确定第一目标区域中所有像素点的特征值,并从第一目标区域包括的所有像素点的特征值中查找与目标特征值之间的差值最小的特征值来实现。In the embodiment of the present invention, to determine the pixel points whose feature information in the first target area matches the feature information of the center point of the area occupied by the target object in the first video frame can be determined by determining all the pixel points in the first target area eigenvalues, and from the eigenvalues of all pixels included in the first target area, find the eigenvalue with the smallest difference with the target eigenvalue.
可选地,所述在第二视频画面包括的像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点,包括:Optionally, the searching pixel points included in the second video frame whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame includes:
按照预设规则将所述第二视频画面进行多次缩小,得到多个第三视频画面;reducing the second video frame multiple times according to preset rules to obtain multiple third video frames;
对于所述多个第三视频画面中的每个第三视频画面,在所述第三视频画面中,以所述第三视频画面的中心点为中心确定面积为预设面积的第二目标区域,所述预设面积为根据所述球型IPC的老化程度确定的;For each third video frame in the plurality of third video frames, in the third video frame, a second target area whose area is a preset area is determined centering on the center point of the third video frame , the preset area is determined according to the aging degree of the spherical IPC;
从得到的多个第二目标区域包括的所有像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Searching for a pixel point whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame from all the pixels included in the obtained plurality of second target areas.
进一步地,为了避免在当前第二视频画面中查找不到特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,可以将第二视频画面多次进行缩小,得到多个第三视频画面,在该多个第三视频画面中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Further, in order to avoid finding no pixel in the current second video frame whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame, the second video frame can be processed multiple times. Zoom out to obtain a plurality of third video frames, and search for pixels whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame in the multiple third video frames.
可选地,所述从得到的多个第二目标区域包括的所有像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点,包括:Optionally, searching for pixels whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame from all the pixels included in the obtained plurality of second target areas points, including:
对于所述多个第二目标区域中的每个第二目标区域,获取所述第二目标区域包括的所有像素点的特征信息;For each second target area in the plurality of second target areas, acquiring feature information of all pixels included in the second target area;
对于所述第二目标区域包括的所有像素点中的每个像素点,对所述像素点的特征信息包括的像素差值进行平均运算和极差运算,得到第三平均值和第三极差值,并将所述第三平均值和所述第三极差值之间的乘积确定为所述像素点的特征值;For each pixel point in all the pixels included in the second target area, the pixel difference value included in the feature information of the pixel point is subjected to an average operation and a range operation to obtain a third average value and a third range difference value, and determine the product between the third average value and the third extreme difference value as the feature value of the pixel point;
对所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息包括的像素差值进行平均运算和极差运算,得到第二平均值和第二极差值,并将所述第二平均值和所述第二极差值之间的乘积确定为目标特征值;performing an average operation and a range operation on the pixel difference values included in the feature information of the center point of the area occupied by the target object in the first video frame to obtain a second average value and a second range value, and The product between the second average value and the second range value is determined as a target feature value;
对于所述多个第二目标区域中的每个第二目标区域,从所述第二目标区域包括的所有像素点的特征值中,选择与所述目标特征值之间的差值最小的特征值,并将选择的特征值对应的像素点确定为目标像素点;For each second target area in the plurality of second target areas, from the feature values of all pixels included in the second target area, select the feature with the smallest difference from the target feature value value, and determine the pixel corresponding to the selected feature value as the target pixel;
从得到的多个目标像素点的特征值中选择与所述目标特征值之间的差值最小的特征值,并将选择的特征值对应的目标像素点确定为特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Select the eigenvalue with the smallest difference between the obtained eigenvalues of the plurality of target pixel points and the target eigenvalue, and determine the target pixel corresponding to the selected eigenvalue as the feature information and the target object in the A pixel point that is matched with feature information of a central point of the area occupied by the first video frame.
在该多个第三视频画面中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,可以通过在该多个第三视频画面确定多个第二目标区域,并在该多个第二目标区域包括的所有像素点的特征值中查找与目标特征值之间的差值最小的特征值来实现。In the plurality of third video frames, a pixel point whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame can be determined by determining a plurality of third video frames in the plurality of third video frames. Two target areas, and find the feature value with the smallest difference between the target feature value and the target feature value among the feature values of all the pixel points included in the plurality of second target areas.
可选地,所述在第二视频画面包括的像素点中查找特征信息与所述目标对象在所述第一视频画面中所占的区域的中心点的特征信息匹配的像素点之前,还包括:Optionally, before searching the pixel points included in the second video frame whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame, further includes :
确定所述目标对象在所述第一视频画面中所占的区域的中心点在所述枪型IPC的平面坐标系中对应的坐标;Determine the coordinates corresponding to the center point of the area occupied by the target object in the first video frame in the plane coordinate system of the gun-type IPC;
根据确定出的坐标和预设坐标转换模型,确定所述目标对象在所述第一视频画面中所占的区域的中心点在所述球面坐标系中对应的经度和纬度,所述预设坐标转换模型用于将所述平面坐标系中的点的坐标转换至所述球面坐标系中;According to the determined coordinates and the preset coordinate transformation model, determine the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system, the preset coordinates The transformation model is used to transform the coordinates of the points in the plane coordinate system into the spherical coordinate system;
根据确定出的经度和纬度,确定所述球型IPC的第二转动角度;Determine a second rotation angle of the spherical IPC according to the determined longitude and latitude;
向所述球型IPC发送第二转动请求,所述第二转动请求携带所述第二转动角度;sending a second rotation request to the spherical IPC, the second rotation request carrying the second rotation angle;
接收所述球型IPC采集的第二视频画面,所述第二视频画面为所述球型IPC在接收到第二转动请求时根据所述第二转动角度转动之后采集的视频画面。receiving a second video frame collected by the spherical IPC, where the second video frame is a video frame collected after the spherical IPC rotates according to the second rotation angle when receiving a second rotation request.
在本发明实施例中,当在第一视频画面中检测到待监控的目标对象时,可以根据该目标对象在第一视频画面中所占的区域的中心点在平面坐标系中对应的坐标和预设坐标转换模型,确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度,并根据确定出的经度和纬度,控制球型IPC进行转动,以使目标对象在第二视频画面中所占的区域的中心点位于第二视频画面的中心。In the embodiment of the present invention, when the target object to be monitored is detected in the first video frame, the corresponding coordinates and Preset the coordinate conversion model, determine the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system, and control the spherical IPC to rotate according to the determined longitude and latitude, so as to The center point of the area occupied by the target object in the second video frame is located at the center of the second video frame.
可选地,所述根据确定出的坐标和预设坐标转换模型,确定所述目标对象在所述第一视频画面中所占的区域的中心点在所述球面坐标系中对应的经度和纬度,包括:Optionally, according to the determined coordinates and the preset coordinate transformation model, determine the corresponding longitude and latitude of the center point of the area occupied by the target object in the first video frame in the spherical coordinate system ,include:
根据确定出的坐标,确定所述目标对象在所述第一视频画面中所占的区域的中心点与垂直交点之间的距离x1、所述目标对象在所述第一视频画面中所占的区域的中心点与所述球面坐标系的原点之间的距离x2、以及所述目标对象在所述第一视频画面中所占的区域的中心点与至少四个标定点中的任意一个标定点之间的距离x3,所述垂直交点为经过所述球面坐标系的原点且与所述平面坐标系垂直的直线相交于所述平面坐标系的交点,所述至少四个标定点为从所述第一视频画面中随机选择的标定点;According to the determined coordinates, determine the distance x 1 between the center point of the area occupied by the target object in the first video frame and the vertical intersection point, and the area occupied by the target object in the first video frame The distance x 2 between the center point of the region and the origin of the spherical coordinate system, and the center point of the region occupied by the target object in the first video frame and any one of at least four calibration points The distance x 3 between the calibration points, the vertical intersection point is the intersection point of a straight line passing through the origin of the spherical coordinate system and perpendicular to the plane coordinate system intersects the plane coordinate system, and the at least four calibration points are Marking points randomly selected from the first video frame;
根据所述x1、x2、x3,按照如下预设坐标转换模型,确定所述目标对象在所述第一视频画面中所占的区域的中心点在所述球面坐标系中对应的经度和纬度;According to the x 1 , x 2 , x 3 , according to the following preset coordinate transformation model, determine the longitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system and latitude;
其中,θ分别为所述目标对象在所述第一视频画面中所占的区域的中心点在所述球面坐标系中对应的经度和纬度,和θ1分别为所述垂直交点在所述球面坐标系中的经度和纬度,和θ3分别为所述至少四个标定点中的所述任意一个标定点在所述球面坐标系中的经度和纬度。in, θ are respectively the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system, and θ1 are respectively the longitude and latitude of the said perpendicular intersection point in said spherical coordinate system, and θ3 are respectively the longitude and latitude of any one of the at least four calibration points in the spherical coordinate system.
在本发明实施例中,根据该目标对象在第一视频画面中所占的区域的中心点在平面坐标系中对应的坐标和预设坐标转换模型,确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度,需要先确定预设坐标转换模型中的待定参数x1、x2、x3。In the embodiment of the present invention, according to the coordinates corresponding to the center point of the area occupied by the target object in the first video frame in the plane coordinate system and the preset coordinate transformation model, the occupied area of the target object in the first video frame is determined. The longitude and latitude corresponding to the center point of the region in the spherical coordinate system need to determine the undetermined parameters x 1 , x 2 , and x 3 in the preset coordinate transformation model.
可选地,所述根据确定出的坐标和预设坐标转换模型,确定所述目标对象在所述第一视频画面中所占的区域的中心点在所述球面坐标系中对应的经度和纬度之前,还包括:Optionally, according to the determined coordinates and the preset coordinate transformation model, determine the corresponding longitude and latitude of the center point of the area occupied by the target object in the first video frame in the spherical coordinate system Previously, also included:
在所述第一视频画面中随机选择至少四个标定点,所述至少四个标定点中的任意三个标定点不共线;Randomly select at least four calibration points in the first video frame, and any three calibration points in the at least four calibration points are not collinear;
确定所述至少四个标定点中的每个标定点在所述平面坐标系中的坐标以及在所述球面坐标系中的经度和纬度;determining the coordinates of each of the at least four calibration points in the planar coordinate system and the longitude and latitude in the spherical coordinate system;
根据所述至少四个标定点中的每个标定点在所述平面坐标系中的坐标以及在所述球面坐标系中的经度和纬度,确定垂直交点在所述球面坐标系中的位置参数,所述位置参数包括所述垂直交点和所述球面坐标系的原点之间的距离、以及所述垂直交点在所述球面坐标系中的经度和纬度;According to the coordinates of each of the at least four calibration points in the plane coordinate system and the longitude and latitude in the spherical coordinate system, determine the position parameter of the vertical intersection point in the spherical coordinate system, The location parameters include the distance between the vertical intersection point and the origin of the spherical coordinate system, and the longitude and latitude of the vertical intersection point in the spherical coordinate system;
根据所述垂直交点在所述球面坐标系中的位置参数和所述至少四个标定点中的任一个标定点在所述球面坐标系中的经度和纬度,建立所述预设坐标转换模型。The preset coordinate transformation model is established according to the position parameter of the vertical intersection point in the spherical coordinate system and the longitude and latitude of any one of the at least four calibration points in the spherical coordinate system.
在本发明实施例中,建立预设坐标转换模型可以通过第一视频画面中的至少四个标定点中的每个标定点在平面坐标系中的坐标和至少四个标定点中的每个标定点在球面坐标系中的经度和纬度来实现。In the embodiment of the present invention, the establishment of the preset coordinate transformation model may be based on the coordinates of each of the at least four marking points in the first video frame in the plane coordinate system and the coordinates of each of the at least four marking points in the first video frame. The longitude and latitude of the fixed point in the spherical coordinate system are implemented.
可选地,所述确定所述至少四个标定点中的每个标定点在所述球面坐标系中的经度和纬度,包括:Optionally, the determining the longitude and latitude of each of the at least four calibration points in the spherical coordinate system includes:
针对所述至少四个标定点中的每个标定点,控制所述球型IPC采集的视频画面的中心点从所述球面坐标系的经度和纬度均为零的位置转动至所述标定点;For each calibration point in the at least four calibration points, control the center point of the video picture collected by the spherical IPC to rotate to the calibration point from a position where the longitude and latitude of the spherical coordinate system are zero;
确定所述球型IPC在水平方向上的转动角度和所述球型IPC在垂直方向上的转动角度;Determine the rotation angle of the spherical IPC in the horizontal direction and the rotation angle of the spherical IPC in the vertical direction;
将所述球型IPC在水平方向上的转动角度确定为所述标定点在所述球面坐标系中的经度,将所述球型IPC在垂直方向上的转动角度确定为所述标定点在所述球面坐标系中的纬度。The rotation angle of the spherical IPC in the horizontal direction is determined as the longitude of the calibration point in the spherical coordinate system, and the rotation angle of the spherical IPC in the vertical direction is determined as the calibration point in the Latitude in the spherical coordinate system described above.
在本发明实施例中,确定至少四个标定点中的每个标定点在球面坐标系中的经度和纬度,也即确定当球型IPC采集的视频画面的中心点从球面坐标系的经度和纬度均为零的位置转动至标定点时,球型IPC在水平方向上的转动角度和球型IPC在垂直方向上的转动角度。In an embodiment of the present invention, determine the longitude and latitude of each of the at least four calibration points in the spherical coordinate system, that is, determine the longitude and latitude of the center point of the video picture collected by the spherical IPC from the spherical coordinate system When the latitude is zero and the position is rotated to the calibration point, the rotation angle of the spherical IPC in the horizontal direction and the rotation angle of the spherical IPC in the vertical direction.
第二方面,提供了一种基于枪球联动的视频监控装置,所述基于枪球联动的视频监控装置具有实现上述第一方面中基于枪球联动的视频监控方法行为的功能。该基于枪球联动的视频监控装置包括至少一个模块,该至少一个模块用于实现上述第一方面所提供的基于枪球联动的视频监控方法。In the second aspect, a video monitoring device based on the gun-ball linkage is provided, and the video monitoring device based on the gun-ball linkage has the function of realizing the behavior of the video monitoring method based on the gun-ball linkage in the first aspect. The video monitoring device based on gun-ball linkage includes at least one module, and the at least one module is used to realize the video monitoring method based on gun-ball linkage provided in the first aspect.
第三方面,提供了一种基于枪球联动的视频监控装置,所述基于枪球联动的视频监控装置的结构中包括处理器和存储器,所述存储器用于存储支持基于枪球联动的视频监控装置执行上述第一方面所提供的基于枪球联动的视频监控方法的程序,以及存储用于实现上述第一方面所提供的基于枪球联动的视频监控方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。In the third aspect, a video surveillance device based on gunball linkage is provided. The structure of the video surveillance device based on gunball linkage includes a processor and a memory, and the memory is used to store and support video surveillance based on gunball linkage. The device executes the program of the video surveillance method based on the gun-ball linkage provided in the first aspect, and stores the data involved in realizing the video surveillance method based on the gun-ball linkage provided in the first aspect. The processor is configured to execute programs stored in the memory.
第四方面,提供了一种计算机存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的基于枪球联动视频监控方法。In a fourth aspect, a computer storage medium is provided, and instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer executes the gun-ball-based video surveillance method described in the first aspect.
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的基于枪球联动的视频监控方法。In the fifth aspect, a computer program product containing instructions is provided, and when it is run on a computer, it causes the computer to execute the gun-ball linkage-based video surveillance method described in the first aspect above.
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above-mentioned second aspect, third aspect, fourth aspect and fifth aspect are similar to those obtained by the corresponding technical means in the first aspect, and will not be repeated here.
本发明实施例提供的技术方案带来的有益效果是:获取目标对象在第一视频画面中所占的区域的中心点的特征信息,由于每个像素点的特征信息具有唯一性,因此,可以在球型IPC采集的第二视频画面中查找特征信息与获取的特征信息匹配的像素点,该查找到的像素点可以代表目标对象在第二视频画面中所占的区域的中心点;然后根据该查找到的像素点在球型IPC的球面坐标系中对应的经度和纬度,确定球型IPC的第一转动角度,由于该第一转动角度为将第二视频画面的中心点转动至目标对象在第二视频画面中所占的区域的中心点时球型IPC需要转动的角度,因此,当球型IPC接收到第一转动请求并根据第一转动角度转动之后,球型IPC采集的视频画面中心点将为目标对象在第二视频画面中所占的区域的中心点,避免出现因为球型IPC老化问题导致目标对象可能没有位于球型IPC采集的视频画面的中心的情况,从而提高通过球型IPC对目标对象的细节进行监控的效果。The beneficial effect brought by the technical solution provided by the embodiment of the present invention is: to obtain the feature information of the center point of the area occupied by the target object in the first video frame, since the feature information of each pixel point is unique, it can In the second video frame collected by the spherical IPC, search for a pixel point where the feature information matches the acquired feature information, and the pixel point found can represent the center point of the area occupied by the target object in the second video frame; then according to The longitude and latitude corresponding to the pixel points found in the spherical coordinate system of the spherical IPC determine the first rotation angle of the spherical IPC, because the first rotation angle is to rotate the center point of the second video picture to the target object At the center point of the area occupied by the second video picture, the spherical IPC needs to rotate the angle. Therefore, when the spherical IPC receives the first rotation request and rotates according to the first rotation angle, the video picture collected by the spherical IPC The center point will be the center point of the area occupied by the target object in the second video frame, avoiding the situation that the target object may not be located in the center of the video frame collected by the spherical IPC due to the aging problem of the spherical IPC, thereby improving the speed of passing through the spherical IPC. The effect of the type IPC on monitoring the details of the target object.
附图说明Description of drawings
图1是本发明实施例提供的一种基于枪球联动的视频监控系统示意图;Fig. 1 is a schematic diagram of a video monitoring system based on gun-ball linkage provided by an embodiment of the present invention;
图2是本发明实施例提供的一种IPC的结构示意图;Fig. 2 is a schematic structural diagram of an IPC provided by an embodiment of the present invention;
图3A是本发明实施例提供的一种基于枪球联动的视频监控方法流程图;Fig. 3A is a flow chart of a video monitoring method based on gun-ball linkage provided by an embodiment of the present invention;
图3B是本发明实施例提供的一种中心点的邻域内的像素点分布示意图;Fig. 3B is a schematic diagram of pixel point distribution in the neighborhood of a central point provided by an embodiment of the present invention;
图3C是本发明实施例提供的一种平面坐标系和球面坐标系的示意图;Fig. 3C is a schematic diagram of a plane coordinate system and a spherical coordinate system provided by an embodiment of the present invention;
图3D是本发明实施例提供的一种几何模型示意图;Fig. 3D is a schematic diagram of a geometric model provided by an embodiment of the present invention;
图3E是本发明实施例提供的另一种几何模型示意图;Fig. 3E is a schematic diagram of another geometric model provided by an embodiment of the present invention;
图4A是本发明实施例提供的一种基于枪球联动的视频监控装置框图;Fig. 4A is a block diagram of a video surveillance device based on gun-ball linkage provided by an embodiment of the present invention;
图4B是本发明实施例提供的一种查找模块框图;Fig. 4B is a block diagram of a search module provided by an embodiment of the present invention;
图4C是本发明实施例提供的另一种查找模块框图;FIG. 4C is a block diagram of another search module provided by an embodiment of the present invention;
图4D是本发明实施例提供的另一种基于枪球联动的视频监控装置框图;Fig. 4D is a block diagram of another video surveillance device based on gun-ball linkage provided by an embodiment of the present invention;
图4E是本发明实施例提供的一种第三确定模块框图;Fig. 4E is a block diagram of a third determination module provided by an embodiment of the present invention;
图4F是本发明实施例提供的另一种基于枪球联动的视频监控装置框图;Fig. 4F is a block diagram of another video monitoring device based on gun-ball linkage provided by an embodiment of the present invention;
图4G是本发明实施例提供的一种第五确定模块框图。Fig. 4G is a block diagram of a fifth determining module provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合附图对本申请实施方式作进一步地详细描述。The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
在对本发明实施例进行详细的解释说明之前,先对本发明实施例的应用场景予以介绍。对于基于单枪型IPC的视频监控,也即仅通过一个枪型IPC实现的视频监控,当监控范围内存在待监控的目标对象时,通过枪型IPC可以检测到该目标对象。为了确定该目标对象的细节,需将该枪型IPC采集的视频画面进行变倍放大,在变倍放大后的视频画面中确定该目标对象的细节。但是由于枪型IPC用于采集大范围内的视频画面,导致枪型IPC采集的视频画面的分辨率不高,所以,在进行变倍放大之后的视频画面中确定目标对象的细节的效果并不理想。因此,对于大范围内移动的目标对象的视频监控,为了既可以整体监控到该目标对象的移动情况,又可以对该目标对象的细节进行监控,通常采用基于枪球联动的视频监控方法,也即通过枪型IPC检测是否存在待监控的目标对象,当通过枪型IPC检测出待监控的目标对象时,通过球型IPC的动态转动对该目标对象的细节进行监控。例如,对于小区监控的场景,当监控范围内存在陌生人入侵时,通过枪型IPC可以检测到该陌生人,此时控制球型IPC进行动态转动以使球型IPC转动之后采集的视频画面中包括该陌生人。由于球型IPC采集的视频画面为变倍放大后的视频画面,因此可以通过球型IPC采集的视频画面确定该陌生人的细节,如脸部特写,以提高小区监控的安全程度。而本发明实施例提供的基于枪球联动的视频监控方法应用于当通过枪型IPC检测出待监控的目标对象时,通过球型IPC的动态转动对该目标对象的细节进行监控的场景。Before explaining and describing the embodiments of the present invention in detail, the application scenarios of the embodiments of the present invention are firstly introduced. For video surveillance based on a single gun-type IPC, that is, video surveillance realized by only one gun-type IPC, when there is a target object to be monitored within the monitoring range, the target object can be detected by the gun-type IPC. In order to determine the details of the target object, it is necessary to zoom in on the video picture collected by the gun-type IPC, and determine the details of the target object in the zoomed-in video picture. However, because the gun-type IPC is used to collect video images in a large area, the resolution of the video images collected by the gun-type IPC is not high, so the effect of determining the details of the target object in the video image after zooming in is not very effective. ideal. Therefore, for the video surveillance of a moving target object in a wide range, in order to monitor the movement of the target object as a whole, and to monitor the details of the target object, a video surveillance method based on gun-ball linkage is usually used, and also That is, the gun-type IPC is used to detect whether there is a target object to be monitored. When the gun-type IPC detects the target object to be monitored, the details of the target object are monitored through the dynamic rotation of the spherical IPC. For example, for the scene of community monitoring, when there is a stranger intruding in the monitoring area, the stranger can be detected by the gun-type IPC. including the stranger. Since the video picture collected by the spherical IPC is zoomed in, the details of the stranger, such as a close-up of the face, can be determined through the video picture collected by the spherical IPC, so as to improve the security of community monitoring. However, the video monitoring method based on the gun-ball linkage provided by the embodiment of the present invention is applied to the scene where the details of the target object are monitored through the dynamic rotation of the ball-type IPC when the target object to be monitored is detected by the gun-type IPC.
图1是本发明实施例提供的一种基于枪球联动的视频监控系统100,如图1所示,该基于枪球联动的视频监控系统100包括服务器101、客户端102,以及IPC 103。IPC 103用于采集待监控的视频画面并将采集的视频画面发送给服务器101。当服务器101接收到IPC103采集的视频画面时,服务器101将接收到的视频画面发送给客户端102。当客户端102接收到服务器101发送的视频画面时,显示接收到的视频画面,以便于用户根据客户端102显示的视频画面进行视频监控。另外,当服务器101接收到IPC 103采集的视频画面并确定IPC103采集的视频画面有待调整时,服务器101还可以控制IPC 103进行动态转动,并接收IPC103进行动态转动之后采集的视频画面。FIG. 1 is a video surveillance system 100 based on gunball linkage provided by an embodiment of the present invention. As shown in FIG. 1 , the video surveillance system 100 based on gunball linkage includes a server 101 , a client 102 , and an IPC 103 . The IPC 103 is used to collect video images to be monitored and send the collected video images to the server 101 . When the server 101 receives the video frame collected by the IPC 103 , the server 101 sends the received video frame to the client 102 . When the client 102 receives the video image sent by the server 101 , it displays the received video image, so that the user can monitor the video according to the video image displayed by the client 102 . In addition, when the server 101 receives the video frame collected by the IPC 103 and determines that the video frame collected by the IPC 103 needs to be adjusted, the server 101 can also control the IPC 103 to dynamically rotate and receive the video frame collected by the IPC 103 after the dynamic rotation.
其中,服务器101和IPC1 03之间可以通过无线网络或者有线网络的方式进行通信,服务器101和客户端102之间也可以通过无线网络或者有线网络的方式进行通信。另外,该基于枪球联动的视频监控系统可以包括多个IPC 103,也即该基于枪球联动的视频监控系统可以部署多个IPC,在图1仅以3个IPC 103为例进行说明。Wherein, the communication between the server 101 and the IPC1 03 may be performed through a wireless network or a wired network, and the communication between the server 101 and the client 102 may also be performed through a wireless network or a wired network. In addition, the video surveillance system based on gun-ball linkage may include multiple IPCs 103 , that is, the video surveillance system based on gun-ball linkage may deploy multiple IPCs. In FIG. 1 , only three IPCs 103 are taken as an example for illustration.
需要说明的是,如图1所示,IPC 103包括一个枪型IPC 1031和一个球型IPC 1032,以实现本发明实施例提供的基于枪球联动的视频监控方法。也即服务器为每个枪型IPC配置有对应的球型IPC,具体地,当用户确定已安装IPC 103中的枪型IPC 1031和球型IPC1032时,通过客户端102向服务器101发送配置请求,该配置请求携带IPC 103中的枪型IPC1031的标识和球型IPC 1032的标识。当服务器101接收到该配置请求时,将IPC 103中的枪型IPC1031的标识和球型IPC 1032的标识存储在枪型IPC和球型IPC的对应关系中,以实现为IPC103中的枪型IPC 1031配置球型IPC 1032。It should be noted that, as shown in FIG. 1 , the IPC 103 includes a gun-type IPC 1031 and a ball-type IPC 1032 to implement the video surveillance method based on gun-ball linkage provided by the embodiment of the present invention. That is to say, the server configures a corresponding spherical IPC for each gun-type IPC. Specifically, when the user determines that the gun-type IPC 1031 and the spherical IPC 1032 in the installed IPC 103 are installed, the client 102 sends a configuration request to the server 101, The configuration request carries the identifier of the gun-type IPC 1031 and the identifier of the ball-type IPC 1032 in the IPC 103 . When the server 101 receives the configuration request, the identifier of the gun-type IPC 1031 in the IPC 103 and the identifier of the ball-type IPC 1032 are stored in the corresponding relationship between the gun-type IPC and the ball-type IPC, so as to realize the gun-type IPC in the IPC 103 1031 configures spherical IPC 1032.
其中,枪型IPC 1031的标识用于唯一标识该枪型IPC 1031,球型IPC 1032的标识用于唯一标识该球型IPC 1032。值得注意的是,IPC 103可以包括一个枪型IPC和一个球型IPC,也可以包括一个枪型IPC和多个球型IPC,本发明实施例在此不做具体限定。Wherein, the identifier of the gun-type IPC 1031 is used to uniquely identify the gun-type IPC 1031 , and the identifier of the ball-type IPC 1032 is used to uniquely identify the ball-type IPC 1032 . It should be noted that the IPC 103 may include a gun-type IPC and a ball-type IPC, or may include a gun-type IPC and multiple ball-type IPCs, which is not specifically limited in this embodiment of the present invention.
可选地,图1所示的IPC 103也可以通过无线网络或者有线网络的方式直接与客户端102进行通信,也即IPC 103直接将采集的视频画面发送给客户端102,无需经过服务器101将采集的视频画面发送给客户端102,此时IPC 103还用于执行当IPC 103采集的视频画面有待调整时,自动进行动态转动并重新采集视频画面的操作,也即当IPC 103通过无线网络或者有线网络的方式直接与客户端102进行通信时,本发明实施例提供的方法还可以应用于IPC 103中。特别地,在本发明实施例中,以图1所示的基于枪球联动的视频监控系统为例进行说明。Optionally, the IPC 103 shown in FIG. 1 can also directly communicate with the client 102 through a wireless network or a wired network, that is, the IPC 103 directly sends the captured video images to the client 102 without going through the server 101. The collected video images are sent to the client 102. At this time, the IPC 103 is also used to perform the operation of automatically dynamically rotating and re-collecting the video images when the video images collected by the IPC 103 need to be adjusted. When communicating directly with the client 102 in a wired network, the method provided by the embodiment of the present invention can also be applied to the IPC 103 . In particular, in the embodiment of the present invention, the video surveillance system based on gun-ball linkage shown in FIG. 1 is taken as an example for illustration.
图2是本发明实施例提供的一种IPC的结构示意图,该IPC可以为图1所示的IPC103包括的枪型IPC 1031或球型IPC 1032。参见图2,该IPC包括:视频采集器201、发射机202和接收机203。FIG. 2 is a schematic structural diagram of an IPC provided by an embodiment of the present invention. The IPC may be a gun-type IPC 1031 or a ball-type IPC 1032 included in the IPC 103 shown in FIG. 1 . Referring to FIG. 2 , the IPC includes: a video collector 201 , a transmitter 202 and a receiver 203 .
其中,视频采集器201用于采集视频画面,发射机202可以用于发送数据和/或信令等。接收机203可以用于接收数据和/或信令等。Wherein, the video collector 201 is used to collect video images, and the transmitter 202 can be used to send data and/or signaling. The receiver 203 may be used to receive data and/or signaling and the like.
可选地,该IPC还包括存储器和处理器。其中,存储器可以用于存储一个或多个软件程序和/或模块。存储器可以是只读存储器(Read-only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电可擦可编程只读存储器(Electrically ErasableProgrammable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、磁盘存储介质,或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由集成电路存取的任何其它介质,但不限于此。处理器可以是一个通用中央处理器(Central Processing Unit,CPU)、微处理器、特定应用集成电路(Application-Specific Integrated Circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。特别地,当IPC直接与客户端通过无线网络或者有线网络的方式通信时,该IPC包括的处理器可以通过运行存储在存储器内的软件程序和/或模块,以及调用存储在存储器内的数据实现本发明实施例提供的基于枪球联动的视频监控方法。Optionally, the IPC also includes a memory and a processor. Among them, the memory can be used to store one or more software programs and/or modules. The memory can be read-only memory (Read-only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), CD-ROM ( Compact Disc Read-Only Memory, CD-ROM), disk storage medium, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by integrated circuits, but is not limited thereto . The processor can be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, a specific application integrated circuit (Application-Specific Integrated Circuit, ASIC), or one or more integrated circuits used to control the program execution of the application program. circuit. In particular, when the IPC directly communicates with the client through a wireless network or a wired network, the processor included in the IPC can be implemented by running software programs and/or modules stored in the memory, and calling data stored in the memory. The embodiment of the present invention provides a video monitoring method based on gun-ball linkage.
图3A是本发明实施例提供的一种基于枪球联动的视频监控方法,该方法应用于上述图1所示的基于枪球联动的视频监控系统中。如图3A所示,该基于枪球联动的视频监控方法包括以下步骤。FIG. 3A is a video surveillance method based on gun-ball linkage provided by an embodiment of the present invention, which is applied to the video surveillance system based on gun-ball linkage shown in FIG. 1 above. As shown in Fig. 3A, the video monitoring method based on gun-ball linkage includes the following steps.
步骤301:枪型IPC采集第一视频画面,并向服务器发送该第一视频画面,球型IPC采集第二视频画面,并向服务器发送该第二视频画面。Step 301: The gun-type IPC collects a first video frame, and sends the first video frame to the server, and the ball-type IPC collects a second video frame, and sends the second video frame to the server.
如图1所示,在服务器为枪型IPC配置球型IPC之后,枪型IPC和球型IPC开始采集视频画面,并将采集的视频画面发送给服务器。为了后续便于说明,将枪型IPC采集的视频画面称为第一视频画面,将球型IPC采集的视频画面称为第二视频画面,也即,第一视频画面为枪型IPC采集的视频画面,第二视频画面为服务器对枪型IPC配置的球型IPC当前采集的视频画面。当服务器接收到枪型IPC采集的第一视频画面和球型IPC采集的第二视频画面时,将第一视频画面和第二视频画面发送给客户端。客户端接收服务器发送的第一视频画面和第二视频画面,以便于用户通过客户端对枪型IPC采集的第一视频画面和球型IPC采集的第二视频画面进行查看。As shown in Figure 1, after the server configures the ball IPC for the gun IPC, the gun IPC and the ball IPC start to collect video images and send the collected video images to the server. For the convenience of subsequent description, the video frame collected by the gun-type IPC is called the first video frame, and the video frame collected by the spherical IPC is called the second video frame, that is, the first video frame is the video frame collected by the gun-type IPC , the second video frame is the video frame currently collected by the server on the ball-type IPC configured with the gun-type IPC. When the server receives the first video frame collected by the gun-type IPC and the second video frame collected by the spherical IPC, it sends the first video frame and the second video frame to the client. The client receives the first video frame and the second video frame sent by the server, so that the user can view the first video frame collected by the gun-type IPC and the second video frame collected by the ball-type IPC through the client.
需要说明的是,球型IPC采集的第二视频画面仅为枪型IPC采集的视频画面的部分画面,致使当前第二视频画面中可能没有包括该目标对象或者该目标对象可能没有处于第二视频画面的中心,此时为了提高对该目标对象进行视频监控的效果,服务器需要先确定第一视频画面中的待监控的目标对象,然后通过步骤302至步骤305控制球型IPC重新采集视频画面,以使目标对象处于第二视频画面的中心。其中,服务器确定第一视频画面中的待监控的目标对象可以为:服务器实时检测第一视频画面中是否存在待监控的目标对象,当检测到第一视频画面中存在待监控的目标对象时,确定第一视频画面中的目标对象。当然,服务器确定第一视频画面中的待监控的目标对象也可以为:当用户通过客户端在第一视频画面上查看到待监控的目标对象时,通过客户端向服务器发送监控请求,该监控请求携带目标对象在第一视频画面中的位置,当服务器接收到该监控请求时,根据目标对象在第一视频画面中的位置,确定第一视频画面中的目标对象。It should be noted that the second video frame collected by the spherical IPC is only a part of the video frame collected by the gun-type IPC, so that the target object may not be included in the current second video frame or the target object may not be in the second video frame. At the center of the picture, in order to improve the effect of video surveillance on the target object, the server needs to first determine the target object to be monitored in the first video picture, and then control the spherical IPC to recapture the video picture through steps 302 to 305. so that the target object is at the center of the second video frame. Wherein, the server determines the target object to be monitored in the first video frame may be: the server detects in real time whether there is a target object to be monitored in the first video frame, and when it is detected that there is a target object to be monitored in the first video frame, A target object in the first video frame is determined. Of course, the server may also determine the target object to be monitored in the first video picture: when the user views the target object to be monitored on the first video picture through the client, the client sends a monitoring request to the server, and the monitoring The request carries the position of the target object in the first video frame, and when the server receives the monitoring request, it determines the target object in the first video frame according to the position of the target object in the first video frame.
步骤302:获取目标对象在第一视频画面中所占的区域的中心点的特征信息,该特征信息包括该中心点的像素值分别与多个邻域像素点的像素值之间的像素差值,该多个邻域像素点为第一视频画面中处于该中心点的邻域内的像素点。Step 302: Obtain the feature information of the center point of the area occupied by the target object in the first video frame, the feature information includes the pixel difference between the pixel value of the center point and the pixel values of multiple neighboring pixel points , the plurality of neighborhood pixels are pixels in the neighborhood of the center point in the first video frame.
当服务器在第一视频画面中检测到待监控的目标对象时,为了实现通过球型IPC对该目标对象的细节进行监控,服务器需控制球型IPC将目标对象在第二视频画面中所占区域的中心点转动至该第二视频画面的中心点,也即,服务器需要先在第二视频画面中查找目标对象在第二视频画面中所占区域的中心点。由于目标对象在第二视频画面中所占区域的中心点的特征信息和目标对象在第一视频画面中所占区域的中心点的特征信息相同,因此服务器在第一视频画面中检测到待监控的目标对象时,需先获取目标对象在第一视频画面中所占区域的中心点的特征信息。When the server detects the target object to be monitored in the first video frame, in order to monitor the details of the target object through the spherical IPC, the server needs to control the spherical IPC to capture the area occupied by the target object in the second video frame The center point of the second video frame is rotated to the center point of the second video frame, that is, the server needs to first search for the center point of the area occupied by the target object in the second video frame in the second video frame. Since the feature information of the center point of the area occupied by the target object in the second video frame is the same as the feature information of the center point of the area occupied by the target object in the first video frame, the server detects in the first video frame When the target object is selected, the feature information of the center point of the area occupied by the target object in the first video frame needs to be obtained first.
其中,特征信息包括目标对象在第一视频画面中所占的区域的中心点的像素值分别与多个邻域像素点的像素值之间的像素差值。也即,服务器在确定目标对象在第一视频画面中所占的区域的中心点的像素值之后,获取该中心点的邻域内的像素点中每个像素点的像素值,针对该邻域内的每个像素点,确定该像素点的像素值和该中心点的像素值之间的差值,以得到多个像素差值,该多个像素差值即为该中心点的特征信息,也即该中心点的特征信息为一组数据。另外,服务器可以通过光流方式获取该中心点的像素值和该中心点的邻域内的每个像素点的像素值,本发明实施例在此不做详细阐述。如图3B所示,P点为目标对象在第一视频画面中所占区域的中心点,P1至P8为P点的邻域内的像素点,G1为P点的像素值和P1点的像素值之间的差值、G2为P点的像素值和P2点的像素值之间的差值,…,以此类推,G8为P点的像素值和P8点的像素值之间的差值,因此P点的特征信息可以表示为一个数组(G1,G2,G3,G4,G5,G6,G7,G8)。Wherein, the feature information includes the pixel difference between the pixel value of the center point of the area occupied by the target object in the first video frame and the pixel values of multiple neighboring pixel points respectively. That is, after determining the pixel value of the center point of the area occupied by the target object in the first video frame, the server obtains the pixel value of each pixel point in the neighborhood of the center point, and for the For each pixel point, determine the difference between the pixel value of the pixel point and the pixel value of the center point to obtain multiple pixel difference values, and the multiple pixel difference values are the feature information of the center point, that is, The feature information of the central point is a set of data. In addition, the server may acquire the pixel value of the central point and the pixel value of each pixel in the neighborhood of the central point through optical flow, which will not be described in detail in this embodiment of the present invention. As shown in Figure 3B, point P is the center point of the area occupied by the target object in the first video frame, P 1 to P 8 are the pixels in the neighborhood of point P, G 1 is the pixel value of point P and P 1 The difference between the pixel values of point, G 2 is the difference between the pixel value of point P and the pixel value of point P 2 , ..., and so on, G 8 is the pixel value of point P and the pixel value of point P 8 The difference between pixel values, so the feature information of point P can be expressed as an array (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ).
另外,在本发明实施例中,为了便于服务器对比两个像素点之间的特征信息之间的差异,针对某个像素点的特征信息,将该像素点的特征信息经过统计处理,得到一个可以代表该像素点的特征信息的值,为了便于说明,将代表该像素点的特征信息的值称为该像素点的特征值。在一种可能的实现方式中,由于平均值可以指示一组数据的平均大小,而极差值可以指示一组数据的离散程度,因此,可以将像素点的特征信息的平均值和极差值之间的乘积确定为该像素点的特征值。例如,针对上述P点的特征信息(G1,G2,G3,G4,G5,G6,G7,G8),P点的特征值可以表示为其中,px为P点的特征值,Gmax为P点的特征信息(G1,G2,G3,G4,G5,G6,G7,G8)中的最大值,Gmin为P点的特征信息(G1,G2,G3,G4,G5,G6,G7,G8)中的最小值,为将P点的特征信息(G1,G2,G3,G4,G5,G6,G7,G8)中的八个数据相加。In addition, in the embodiment of the present invention, in order to facilitate the server to compare the difference between the feature information of two pixels, for the feature information of a certain pixel, the feature information of the pixel is statistically processed to obtain a The value representing the feature information of the pixel point is referred to as the feature value of the pixel point for convenience of description. In a possible implementation, since the average value can indicate the average size of a set of data, and the range value can indicate the degree of dispersion of a set of data, the average value and range value of the feature information of the pixel can be The product between is determined as the feature value of the pixel. For example, for the feature information of point P above (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ), the feature value of point P can be expressed as Among them, p x is the eigenvalue of point P, G max is the maximum value among the feature information (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ) of point P, and G min is the minimum value among the feature information (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ) of point P, It is to add eight pieces of data in the feature information (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ) of point P.
值得注意的是,当服务器在第一视频画面中确定待监控的目标对象时,此时球型IPC采集的视频画面中可能包括该目标对象,也可能不包括该目标对象。当球型IPC采集的视频画面中包括目标对象时,服务器直接根据步骤303至步骤305控制球型IPC将该目标对象在第二视频画面所占区域的中心点转动至第二视频画面的中心点。当球型IPC采集的视频画面不包括该目标对象时,服务器需要先控制球型IPC采集包括该目标对象的视频画面,然后再通过步骤303至步骤305控制球型IPC将该目标对象在第二视频画面所占区域的中心点转动至第二视频画面的中心点。It should be noted that when the server determines the target object to be monitored in the first video frame, the video frame captured by the spherical IPC may or may not include the target object. When the video frame collected by the spherical IPC includes the target object, the server directly controls the spherical IPC according to steps 303 to 305 to rotate the target object from the center point of the area occupied by the second video frame to the center point of the second video frame . When the video frame collected by the spherical IPC does not include the target object, the server needs to first control the spherical IPC to collect the video frame that includes the target object, and then control the spherical IPC to place the target object in the second frame through steps 303 to 305. The center point of the area occupied by the video frame is rotated to the center point of the second video frame.
具体地,服务器控制球型IPC采集包括该目标对象的视频画面的实现方式可以为:服务器确定目标对象在第一视频画面中所占的区域的中心点在枪型IPC的平面坐标系中对应的坐标;根据确定出的坐标和预设坐标转换模型,服务器确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度;根据确定出的经度和纬度,确定球型IPC的第二转动角度;服务器向球型IPC发送第二转动请求,该第二转动请求携带第二转动角度;当球型IPC接收到该第二转动请求时,根据第二转动角度进行转动,并采集转动之后的视频画面,向服务器发送转动之后采集的视频画面;当服务器接收到球型IPC采集的视频画面时,确定接收球型IPC采集的第二视频画面,也即第二视频画面为球型IPC在接收到第二转动请求时根据第二转动角度转动之后采集的视频画面。Specifically, the way in which the server controls the spherical IPC to collect the video frame that includes the target object may be as follows: the server determines that the center point of the area occupied by the target object in the first video frame corresponds to Coordinates; according to the determined coordinates and the preset coordinate conversion model, the server determines the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system; according to the determined longitude and latitude, Determine the second rotation angle of the spherical IPC; the server sends a second rotation request to the spherical IPC, and the second rotation request carries a second rotation angle; when the spherical IPC receives the second rotation request, according to the second rotation angle Carry out rotation, and collect the video picture after the rotation, send the video picture that gathers after the rotation to server; The video picture is a video picture collected after the spherical IPC rotates according to the second rotation angle when receiving the second rotation request.
其中,枪型IPC的平面坐标系为服务器预先根据枪型IPC采集的第一视频画面确定的平面坐标系,该平面坐标系的原点为预先设置的原点,也即对于第一视频画面中的任一点在该平面坐标系中都有对应的坐标。球面坐标系为服务器预先根据球型IPC在全视角范围内采集的所有视频画面确定的球面坐标系,该球面坐标系中预先设置有经度和纬度均为0的位置,也即对于球型IPC采集的第二视频画面,该第二视频画面中的任一点在该球面坐标系中均有对应的经度和纬度。由于球面坐标系为服务器预先根据球型IPC在全视角范围内采集的所有视频画面确定的球面坐标系,所以第一视频画面中的任一点在该球面坐标系中均有对应点,也即第一视频画面中的任一点在该球面坐标系中均有对应的经度和纬度。Wherein, the plane coordinate system of the gun-type IPC is the plane coordinate system determined by the server in advance according to the first video picture collected by the gun-type IPC, and the origin of the plane coordinate system is the preset origin, that is, for any first video picture A point has a corresponding coordinate in the plane coordinate system. The spherical coordinate system is the spherical coordinate system determined by the server in advance according to all video images collected by the spherical IPC within the full viewing angle. The spherical coordinate system is preset with a position where both longitude and latitude are 0, that is, for spherical IPC acquisition Any point in the second video frame has a corresponding longitude and latitude in the spherical coordinate system. Since the spherical coordinate system is the spherical coordinate system determined by the server in advance according to all video frames collected by the spherical IPC within the full viewing angle, any point in the first video frame has a corresponding point in the spherical coordinate system, that is, the first Any point in a video frame has a corresponding longitude and latitude in the spherical coordinate system.
因此,当服务器确定出目标对象在第一视频画面中所占的区域的中心点时,可以确定该中心点在球面坐标系中对应的经度和纬度,并根据当前第二视频画面中心点的经度和纬度,确定当前第二视频画面的中心点的经度和该中心点在球面坐标系中对应的经度之间的差值,得到第一角度,并将该第一角度确定为第二转动角度在水平方向上的角度。同时服务器确定当前第二视频画面的中心点的纬度和该中心点在球面坐标系中对应的纬度之间的差值,得到第二角度,并将该第二角度确定为第二转动角度在垂直方向上的角度,当服务器确定第二转动角度在水平方向上的角度和第二转动角度在垂直方向上的角度时,也即确定出第二转动角度。Therefore, when the server determines the center point of the area occupied by the target object in the first video frame, it can determine the corresponding longitude and latitude of the center point in the spherical coordinate system, and according to the longitude of the center point of the current second video frame and latitude, determine the difference between the longitude of the center point of the current second video frame and the corresponding longitude of the center point in the spherical coordinate system, obtain the first angle, and determine the first angle as the second rotation angle in The angle in the horizontal direction. At the same time, the server determines the difference between the latitude of the center point of the current second video frame and the latitude corresponding to the center point in the spherical coordinate system to obtain the second angle, and determines the second angle as the second rotation angle in the vertical The angle in the direction, when the server determines the angle of the second rotation angle in the horizontal direction and the angle of the second rotation angle in the vertical direction, that is, determines the second rotation angle.
值得注意的是,当球型IPC根据第二转动角度进行转动之后,可能由于球形IPC的老化问题,仍存在目标对象在第二视频画面所占的区域的中心点不在第二视频画面的中心点的情况,此时,服务器仍需通过步骤303至步骤305控制球型IPC将该目标对象在第二视频画面所占区域的中心点转动至第二视频画面的中心点。It is worth noting that after the spherical IPC rotates according to the second rotation angle, the center point of the area occupied by the target object in the second video frame may not be in the center point of the second video frame due to the aging problem of the spherical IPC. In this case, at this time, the server still needs to control the spherical IPC to rotate the center point of the target object in the area occupied by the second video frame to the center point of the second video frame through steps 303 to 305.
另外,预设坐标转换模型用于将平面坐标系中的点的坐标转换至球面坐标系中,也即服务器根据预设坐标转换模型可以确定第一视频画面中的任一点在该球面坐标系中对应的经度和纬度。且预设坐标转换模型为服务器预先建立的坐标转换模型,具体地,服务器建立预设坐标转换模型可以通过以下几个步骤实现:In addition, the preset coordinate transformation model is used to transform the coordinates of points in the plane coordinate system into the spherical coordinate system, that is, the server can determine that any point in the first video frame is in the spherical coordinate system according to the preset coordinate transformation model corresponding longitude and latitude. And the preset coordinate transformation model is a coordinate transformation model pre-established by the server. Specifically, the establishment of the preset coordinate transformation model by the server can be realized through the following steps:
(1)、服务器确定至少四个标定点中的每个标定点在平面坐标系中的坐标以及在球面坐标系中的经度和纬度。(1) The server determines the coordinates of each of the at least four calibration points in the plane coordinate system and the longitude and latitude in the spherical coordinate system.
其中,该至少四个标定点为服务器在第一视频画面中随机选择的至少四个标定点。值得注意的是,由于该至少四个标定点用于指示该平面坐标系,因此,该至少四个标定点中的任意三个标定点不共线,同时为了提高该预设坐标转换模型的精度,该至少四个标定点在第一视频画面中的相对位置较为分散。可选地,该至少四个标定点也可以为用户通过客户端在第一视频画面中选择的标定点,也即,当客户端在第一视频画面中确定用户选择的四个标定点时,向服务器发送标定请求,该标定请求携带该至少四个标定点在平面坐标系中的坐标,当服务器接收到客户端发送的标定请求时,确定该至少四个标定点在平面坐标系中的坐标。Wherein, the at least four marking points are at least four marking points randomly selected by the server in the first video frame. It is worth noting that since the at least four calibration points are used to indicate the plane coordinate system, any three calibration points in the at least four calibration points are not collinear, and at the same time in order to improve the accuracy of the preset coordinate transformation model , the relative positions of the at least four marking points in the first video frame are scattered. Optionally, the at least four marking points may also be marking points selected by the user in the first video frame through the client, that is, when the client determines the four marking points selected by the user in the first video frame, Send a calibration request to the server, the calibration request carries the coordinates of the at least four calibration points in the plane coordinate system, and when the server receives the calibration request sent by the client, determine the coordinates of the at least four calibration points in the plane coordinate system .
特别地,服务器确定该至少四个标定点在球面坐标系中的经度和纬度的实现方式可以为:针对至少四个标定点中的每个标定点,服务器控制球型IPC将采集的视频画面的中心点从球面坐标系的经度和纬度均为零的位置转动至标定点;服务器确定球型IPC在水平方向上的转动角度和球型IPC在垂直方向上的转动角度;然后将球型IPC在水平方向上的转动角度确定为该标定点在球面坐标系中的经度,将球型IPC在垂直方向上的转动角度确定为该标定点在球面坐标系中的纬度。In particular, the implementation of the server determining the longitude and latitude of the at least four calibration points in the spherical coordinate system may be: for each calibration point in the at least four calibration points, the server controls the video frame to be collected by the spherical IPC The center point rotates from the position where the longitude and latitude of the spherical coordinate system are zero to the calibration point; the server determines the rotation angle of the spherical IPC in the horizontal direction and the rotation angle of the spherical IPC in the vertical direction; then the spherical IPC is in the The rotation angle in the horizontal direction is determined as the longitude of the calibration point in the spherical coordinate system, and the rotation angle of the spherical IPC in the vertical direction is determined as the latitude of the calibration point in the spherical coordinate system.
如图3C所示,平面T为上述平面坐标系代表的平面,球O代表上述球面坐标系的空间,O’为经过球面坐标系的原点O且与平面坐标系T垂直的直线相交于平面坐标系T的交点,A、B、C和D为服务器在平面坐标系T中随机选择的四个标定点。由于A、B、C和D为服务器在平面坐标系T中随机选择的四个标定点,服务器可以直接确定A、B、C和D在平面坐标系中的坐标分别为(xA,yA)、(xB,yB)、(xC,yC)和(xD,yD),同时服务器按照上述确定该至少四个标定点在球面坐标系中的经度和纬度的方法,确定出A、B、C和D在球面面坐标系中的经度和纬度分别为和 As shown in Figure 3C, the plane T is the plane represented by the above-mentioned plane coordinate system, the ball O represents the space of the above-mentioned spherical coordinate system, and O' is a straight line passing through the origin O of the spherical coordinate system and perpendicular to the plane coordinate system T that intersects the plane coordinate system A, B, C and D are the four calibration points randomly selected by the server in the plane coordinate system T. Since A, B, C and D are four calibration points randomly selected by the server in the plane coordinate system T, the server can directly determine the coordinates of A, B, C and D in the plane coordinate system as (x A , y A ), (x B , y B ), (x C , y C ) and (x D , y D ), and at the same time, the server determines the longitude and latitude of the at least four calibration points in the spherical coordinate system according to the above method, The longitude and latitude of A, B, C and D in the spherical surface coordinate system are respectively and
(2)、服务器根据该至少四个标定点中的每个标定点在平面坐标系中的坐标以及在球面坐标系中的经度和纬度,确定垂直交点在球面坐标系中的位置参数,该位置参数包括垂直交点和球面坐标系的原点之间的距离、以及垂直交点在球面坐标系中的经度和纬度,其中,垂直交点为经过球面坐标系的原点且与平面坐标系垂直的直线相交于平面坐标系的交点。(2), the server determines the position parameter of the vertical intersection point in the spherical coordinate system according to the coordinates of each of the at least four calibration points in the plane coordinate system and the longitude and latitude in the spherical coordinate system, the position The parameters include the distance between the vertical intersection point and the origin of the spherical coordinate system, and the longitude and latitude of the vertical intersection point in the spherical coordinate system. The intersection point of the coordinate system.
具体地,如图3C所示,从该四个标定点中选择A、B和C三个标定点,该三个标定点和垂直交点O’以及球面坐标系的原点构成如图3D所示的几何模型。根据A、B和C在平面坐标系中的坐标,可以按照下述公式(1)确定A和B之间的距离AB,B和C之间的距离BC,A和C之间的距离AC。Specifically, as shown in Figure 3C, three calibration points A, B, and C are selected from the four calibration points, and the three calibration points and the vertical intersection O' and the origin of the spherical coordinate system form a graph as shown in Figure 3D geometry model. According to the coordinates of A, B and C in the plane coordinate system, the distance AB between A and B, the distance BC between B and C, and the distance AC between A and C can be determined according to the following formula (1).
在球面坐标系中,当确定出A、B和C在球面坐标系中的经度和纬度分别为 和时,可以根据下述公式(2)确定出A、B和C三点在球面坐标系中的空间坐标。In the spherical coordinate system, when the longitude and latitude of A, B and C in the spherical coordinate system are determined as and , the spatial coordinates of the three points A, B and C in the spherical coordinate system can be determined according to the following formula (2).
其中,θ,分别为球面坐标系中的点在球面坐标系中的经度和纬度,(x,y,z)为该点在球面坐标系中的空间坐标,r为该点到原点之间的距离。特别地,当r为1时,(x,y,z)为该点和原点形成的向量的单位向量。Among them, θ, are the longitude and latitude of a point in the spherical coordinate system, (x, y, z) are the spatial coordinates of the point in the spherical coordinate system, and r is the distance from the point to the origin. In particular, when r is 1, (x, y, z) is the unit vector of the vector formed by the point and the origin.
根据上述公式(2)确定向量的单位向量为向量的单位向量为向量的单位向量为且向量和向量之间的夹角∠AOB也即向量和向量之间的夹角,向量和向量之间的夹角∠BOC也即向量和向量之间的夹角,向量和向量之间的夹角∠AOC也即向量和向量之间的夹角。Determine the vector according to the above formula (2) the unit vector of for vector the unit vector of for vector the unit vector of for and the vector and vector The angle between ∠AOB is also the vector and vector Angle between, vector and vector The angle between ∠BOC is also the vector and vector Angle between, vector and vector The angle between ∠AOC is also the vector and vector angle between.
同时,服务器可以按照下述公式(3)分别确定A'B'、B'C'和A'C'的长度。Meanwhile, the server may respectively determine the lengths of A'B', B'C' and A'C' according to the following formula (3).
由三角余弦定理可知,由于OA'和OB'的长度为1,将根据公式(3)确定的A'B'的值代入,即可确定∠AOB。按照同样的方法可以确定∠BOC和∠AOC。From the trigonometric cosine theorem, we know that Since the lengths of OA' and OB' are 1, the value of A'B' determined according to formula (3) is substituted to determine ∠AOB. In the same way, ∠BOC and ∠AOC can be determined.
假设AB=m,AC=n,BC=l,∠AOB=α,∠BOC=β,∠AOC=γ,OA=x,OB=y,OC=z,则根据三角余弦定理可以确定下述公式(4)。Suppose AB=m, AC=n, BC=l, ∠AOB=α, ∠BOC=β, ∠AOC=γ, OA=x, OB=y, OC=z, then the following formula can be determined according to the trigonometric cosine theorem (4).
由于上述公式(4)中,m、n、l、cosα、cosβ和cosγ为已经确定的数据,因此可以通过上述公式(4)确定OA、OB和OC的长度。需要说明的是,在根据上述公式(4)求解OA、OB和OC的长度的过程中,可能得到一组解,此时利用另一个标定点D按照上述方法确定出关于OA、OB和OD的长度的一组解,取这两组解中的公共解,即可确定出OA、OB的唯一解。同样也可以确定OC的唯一解。Since m, n, l, cosα, cosβ, and cosγ in the above formula (4) are determined data, the lengths of OA, OB, and OC can be determined through the above formula (4). It should be noted that in the process of solving the lengths of OA, OB and OC according to the above formula (4), a set of solutions may be obtained. At this time, another calibration point D is used to determine the lengths of OA, OB and OD according to the above method. A set of solutions of length, taking the common solution in these two sets of solutions, can determine the unique solution of OA and OB. Similarly, a unique solution to OC can also be determined.
至此,对于球面坐标系中的三菱锥OABC,由于A、B和C的各自的经度和纬度已知,且OA、OB和OC的长度也已确定,因此根据公式(2)可以确定A、B和C三点在球面坐标系中的空间坐标,也即在球面坐标系中三菱锥OABC的空间位置是确定的,因此可以根据空间向量几何确定三菱锥OABC中的垂直交点O’的空间坐标,也即确定OO’的长度和O’在球面坐标系中的经度和纬度,也即确定垂直交点的位置参数。So far, for the three-sided cone OABC in the spherical coordinate system, since the longitude and latitude of A, B and C are known, and the lengths of OA, OB and OC have also been determined, A and B can be determined according to formula (2) The spatial coordinates of the three points and C in the spherical coordinate system, that is, the spatial position of the three-pointed pyramid OABC in the spherical coordinate system is determined, so the spatial coordinates of the vertical intersection point O' in the three-pointed pyramid OABC can be determined according to the space vector geometry, That is to determine the length of OO' and the longitude and latitude of O' in the spherical coordinate system, that is to determine the position parameters of the vertical intersection point.
(3)根据垂直交点在球面坐标系中的位置参数和至少四个标定点中的任一个标定点在球面坐标系中的经度和纬度,建立预设坐标转换模型。(3) Establishing a preset coordinate conversion model according to the position parameter of the vertical intersection point in the spherical coordinate system and the longitude and latitude of any one of the at least four calibration points in the spherical coordinate system.
假如该至少四个标定点中的任一个标定点为图3C或图3D所示的A点,对于平面坐标系中的任一点X,该任一点X、垂直交点O’以及任一个标定点A可以构建如图3E所示的几何模型,如图3E所示,X点在平面坐标系中的坐标为已知的坐标,因此可以直接确定O’X和XA的长度,由于三角形OO’X为直角三角形,在OO’和O’X已知的前提下,可以直接确定OX的长度,此时三角形OO’X和三角形OAX的所有边长都已确定,因此可以根据三角形余弦定理,通过下述公式(5)确定∠AOX和∠O'OX。If any one of the at least four calibration points is point A shown in Figure 3C or Figure 3D, for any point X in the plane coordinate system, the any point X, the vertical intersection O' and any one of the calibration points A A geometric model as shown in Figure 3E can be constructed. As shown in Figure 3E, the coordinates of point X in the plane coordinate system are known coordinates, so the lengths of O'X and XA can be directly determined, because the triangle OO'X is For a right triangle, on the premise that OO' and O'X are known, the length of OX can be directly determined. At this time, all side lengths of triangle OO'X and triangle OAX have been determined. Therefore, according to the triangle cosine theorem, the following Equation (5) determines ∠AOX and ∠O'OX.
假设X和O’在球面坐标系中的经度和纬度分别为和因此,可以确定向量的单位向量为向量的单位向量为向量的单位向量为且向量和向量之间的夹角∠AOX也即向量和向量之间的夹角,向量和向量之间的夹角∠O'OX也即向量和向量之间的夹角。Assume that the longitude and latitude of X and O' in the spherical coordinate system are and Therefore, it is possible to determine the vector the unit vector of for vector the unit vector of for vector the unit vector of for and the vector and vector The angle between ∠AOX is also the vector and vector Angle between, vector and vector The angle between ∠O'OX is also the vector and vector angle between.
同时,服务器可以按照下述公式(6)确定长度A’X’的长度和O”X’的长度。At the same time, the server can determine the length of A'X' and the length of O"X' according to the following formula (6).
上述公式(6)可以简写为 The above formula (6) can be abbreviated as
又因为,O”X’的长度和A’X’的长度可以根据三角余弦定理求出,如下述公式(7):And because, the length of O "X' and the length of A'X' can be obtained according to the trigonometric cosine theorem, as following formula (7):
将公式(5)代入公式(7)可以得到变换后的公式(7)如下:Substituting formula (5) into formula (7), the transformed formula (7) can be obtained as follows:
在变换后的公式(7)中,由于X为平面坐标系中的任一点,也即OX、O’X、AX为待定参数,因此,变换后的公式(7)可以简写为:O”X'2=f1(XO',OX),A'X'2=f1(OX,AX)。In the transformed formula (7), since X is any point in the plane coordinate system, that is, OX, O'X, and AX are undetermined parameters, the transformed formula (7) can be abbreviated as: O"X ' 2 =f 1 (XO',OX), A'X' 2 =f 1 (OX,AX).
由简写后的公式(6)和简写后的公式(7)可以得到下述公式(8):From the abbreviated formula (6) and the abbreviated formula (7), the following formula (8) can be obtained:
在公式(8)中,对于平面坐标系中的任一点X,当确定X在平面坐标系的坐标时,即可得到公式(8)中的三个待定参数OX、O’X、AX,由于公式(8)中的垂直交点O’的经度和纬度以及四个标定点中的任一个标定点A的经度和纬度为已经确定的参数,因此根据公式(8)即可确定出任一点X在球面坐标系中的经度和纬度 In formula (8), for any point X in the plane coordinate system, when the coordinates of X in the plane coordinate system are determined, the three undetermined parameters OX, O'X, AX in formula (8) can be obtained, because Longitude and latitude of the perpendicular intersection point O' in formula (8) And the longitude and latitude of any one of the four calibration points A is a determined parameter, so the longitude and latitude of any point X in the spherical coordinate system can be determined according to formula (8)
因此,为了确定目标对象在第一视频画面中所占的区域的中心点的球面坐标系中对应的经度和纬度,服务器可以根据公式(8)建立如下预设坐标转换模型Therefore, in order to determine the corresponding longitude and latitude in the spherical coordinate system of the center point of the area occupied by the target object in the first video frame, the server can establish the following preset coordinate conversion model according to formula (8)
其中,x1为目标对象在第一视频画面中所占的区域的中心点与垂直交点之间的距离,x2为目标对象在第一视频画面中所占的区域的中心点与球面坐标系的原点之间的距离,x3为目标对象在第一视频画面中所占的区域的中心点与至少四个标定点中的任意一个标定点之间的距离,θ分别为目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度,和θ1分别为垂直交点在球面坐标系中的经度和纬度,和θ3分别为至少四个标定点中的任意一个标定点在球面坐标系中的经度和纬度。Wherein, x1 is the distance between the center point of the area occupied by the target object in the first video frame and the vertical intersection point, and x2 is the center point of the area occupied by the target object in the first video frame and the spherical coordinate system The distance between the origins, x 3 is the distance between the center point of the area occupied by the target object in the first video frame and any one of the at least four marking points, θ are respectively the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system, and θ1 are the longitude and latitude of the vertical intersection point in the spherical coordinate system, and θ 3 are respectively the longitude and latitude of any one of the at least four calibration points in the spherical coordinate system.
由上述预设坐标转换模型可知,根据确定出的坐标和预设坐标转换模型,确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度的实现方式可以为:根据确定出的坐标,确定目标对象在第一视频画面中所占的区域的中心点与垂直交点之间的距离x1、目标对象在第一视频画面中所占的区域的中心点与球面坐标系的原点之间的距离x2、以及目标对象在第一视频画面中所占的区域的中心点与至少四个标定点中的任意一个标定点之间的距离x3,垂直交点为经过球面坐标系的原点且与平面坐标系垂直的直线相交于平面坐标系的交点,至少四个标定点为从第一视频画面中随机选择的标定点;根据x1、x2、x3,按照上述预设坐标转换模型,确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度。It can be known from the above-mentioned preset coordinate conversion model that according to the determined coordinates and the preset coordinate conversion model, the implementation method of determining the corresponding longitude and latitude of the center point of the area occupied by the target object in the first video frame in the spherical coordinate system It may be: according to the determined coordinates, determine the distance x 1 between the center point of the area occupied by the target object in the first video frame and the vertical intersection point, and the center point of the area occupied by the target object in the first video frame The distance x 2 between the origin of the spherical coordinate system and the distance x 3 between the center point of the area occupied by the target object in the first video frame and any one of the at least four marked points, the vertical intersection point is the intersection of a straight line passing through the origin of the spherical coordinate system and perpendicular to the plane coordinate system and intersecting the plane coordinate system, at least four calibration points are randomly selected calibration points from the first video frame; according to x 1 , x 2 , x 3 , according to the above preset coordinate conversion model, determine the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system.
步骤303:服务器在第二视频画面包括的像素点中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Step 303: The server searches the pixels included in the second video frame for pixels whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame.
具体地,步骤303可以通过以下两种可能的实现方式实现:Specifically, step 303 may be implemented through the following two possible implementation manners:
第一种可能的实现方式,在第二视频画面中,以第二视频画面的中心点为中心确定面积为预设面积的第一目标区域,该预设面积为根据球型IPC的老化程度确定的,从第一目标区域包括的所有像素点中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。In the first possible implementation, in the second video frame, the center point of the second video frame is used as the center to determine the first target area with a preset area, and the preset area is determined according to the aging degree of the spherical IPC , from all the pixels included in the first target area, search for the pixel whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame.
为了提高在第二视频画面中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点的效率,在第二视频画面中,可以仅在第一目标区域包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。其中,预设面积为服务器根据球型IPC的老化程度确定的预设面积,也即在服务器中存储有球型IPC的老化程度和预设面积之间的对应关系,当服务器确定该球型IPC的老化程度时,便可根据球型IPC的老化程度和预设面积之间的对应关系,确定第一目标区域的预设面积。另外,老化程度为服务器根据该球型IPC的出厂使用时间确定,也即对于每个球型IPC,服务器中存储有该球型IPC的出厂时间,根据该球型IPC的出厂时间,可以确定该球型IPC的出厂使用时间;服务器根据出厂使用时间和老化程度之间的对应关系,即可确定该球型IPC的老化程度。需要注意的是,在本发明实施例中,第一目标区域的形状可以为矩形,也可以为圆形,本发明实施例在此不做具体限定。In order to improve the efficiency of searching for pixels whose feature information matches the feature information of the center point of the area occupied by the target object in the first video picture in the second video picture, in the second video picture, only the first video picture can be A pixel point whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame is searched for among all the pixels included in the target area. Wherein, the preset area is the preset area determined by the server according to the aging degree of the spherical IPC, that is, the corresponding relationship between the aging degree of the spherical IPC and the preset area is stored in the server, when the server determines that the spherical IPC The predetermined area of the first target area can be determined according to the corresponding relationship between the aging degree of the spherical IPC and the predetermined area. In addition, the aging degree is determined by the server according to the delivery time of the spherical IPC, that is, for each spherical IPC, the server stores the delivery time of the spherical IPC, and according to the delivery time of the spherical IPC, it can be determined. The factory use time of the spherical IPC; the server can determine the aging degree of the spherical IPC according to the correspondence between the factory use time and the aging degree. It should be noted that, in this embodiment of the present invention, the shape of the first target area may be a rectangle or a circle, which is not specifically limited in this embodiment of the present invention.
特别地,从第一目标区域包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点的实现方式可以为:获取第一目标区域包括的所有像素点的特征信息;对于第一目标区域包括的所有像素点中的每个像素点,对该像素点的特征信息包括的像素差值进行平均运算和极差运算,得到第一平均值和第一极差值,并将第一平均值和第一极差值之间的乘积确定为像素点的特征值;对目标对象在第一视频画面中所占的区域的中心点的特征信息包括的像素差值进行平均运算和极差运算,得到第二平均值和第二极差值,并将第二平均值和第二极差值之间的乘积确定为目标特征值;从第一目标区域包括的所有像素点的特征值中,选择与目标特征值之间的差值最小的特征值,并将选择的特征值对应的像素点确定为特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。In particular, from all the pixels included in the first target area, the implementation method of finding the pixel whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame may be: obtain the first The feature information of all pixels included in the target area; for each pixel in all the pixels included in the first target area, the pixel difference included in the feature information of the pixel is averaged and ranged to obtain the first An average value and the first extreme difference value, and the product between the first average value and the first extreme difference value is determined as the feature value of the pixel point; To the center point of the area occupied by the target object in the first video picture The pixel difference value included in the feature information is averaged and ranged to obtain the second average value and the second range value, and the product between the second average value and the second range value is determined as the target feature value; From the eigenvalues of all pixels included in the first target area, select the eigenvalue with the smallest difference with the target eigenvalue, and determine the pixel corresponding to the selected eigenvalue as the feature information and the target object in the first A pixel point matched with feature information of the center point of the area occupied by the video frame.
例如,该第一目标区域包括50个像素点,服务器通过光流方式获取该50个像素点的特征信息分别为P1(G1,G2,G3,G4,G5,G6,G7,G8)、P2(G1,G2,G3,G4,G5,G6,G7,G8)、…、P50(G1,G2,G3,G4,G5,G6,G7,G8),针对这50个像素点中每个像素点的特征信息,根据公式确定该像素点的特征值,得到50个像素点的特征值p1、p2、…、p50;对于目标对象在第一视频画面中所占的区域的中心点的特征信息,同样按照公式确定目标对象在第一视频画面中所占的区域的中心点的特征值p,并将p确定为目标特征值;从50个像素点的特征值p1、p2、…、p50中选择和目标特征值p最接近也即差值最小的特征值,假如选择的特征值为p30,则特征值p30对应的像素点为特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。For example, the first target area includes 50 pixels, and the feature information of the 50 pixels acquired by the server through optical flow is P1(G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ), P2 (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ),…, P50 (G 1 , G 2 , G 3 , G 4 , G 5 , G 6 , G 7 , G 8 ), for the feature information of each pixel in these 50 pixels, according to the formula Determine the feature value of the pixel, and obtain the feature values p 1 , p 2 , ..., p 50 of 50 pixel points; for the feature information of the center point of the area occupied by the target object in the first video frame, also according to the formula Determine the feature value p of the center point of the area occupied by the target object in the first video frame, and determine p as the target feature value; select from the feature values p 1 , p 2 , ..., p 50 of 50 pixel points The feature value closest to the target feature value p, that is, the feature value with the smallest difference. If the selected feature value is p 30 , the pixel corresponding to the feature value p 30 is the area occupied by the feature information and the target object in the first video frame The feature information of the center point matches the pixel point.
可选地,目标对象在第二视频画面中所占的区域的中心点可能没有位于第一目标区域内,也即,此时在第一目标区域中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,该查找到的像素点可能不是目标对象在第二视频画面中所占的区域的中心点,因此,服务器还需将当前第二视频画面进行缩小,在缩小后的视频画面中重新查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。具体地,服务器可以按照预设规则将第二视频画面进行多次缩小,得到多个第三视频画面;对于多个第三视频画面中的每个第三视频画面,在第三视频画面中,以第三视频画面的中心点为中心确定面积为预设面积的第二目标区域,从而得到多个第二目标区域;从多个第二目标区域包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Optionally, the center point of the area occupied by the target object in the second video frame may not be located in the first target area, that is, at this time, the feature information searched in the first target area is the same as that of the target object in the first video frame. The pixel point that matches the feature information of the center point of the area occupied by the target object may not be the center point of the area occupied by the target object in the second video frame. Therefore, the server also needs to send the current second video The picture is reduced, and the pixel points whose feature information matches the feature information of the center point of the area occupied by the target object in the first video picture are searched again in the reduced video picture. Specifically, the server may shrink the second video frame multiple times according to preset rules to obtain multiple third video frames; for each third video frame in the multiple third video frames, in the third video frame, Taking the center point of the third video frame as the center to determine the second target area with the area as the preset area, thereby obtaining a plurality of second target areas; searching for feature information and the target from all pixels included in the plurality of second target areas A pixel point that matches the feature information of the center point of the area occupied by the object in the first video frame.
其中,服务器从多个第二目标区域包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点的实现过程可以为:对于多个第二目标区域中的每个第二目标区域,获取第二目标区域包括的所有像素点的特征信息;对于第二目标区域包括的所有像素点中的每个像素点,对该像素点的特征信息包括的像素差值进行平均运算和极差运算,得到第三平均值和第三极差值,并将第三平均值和第三极差值之间的乘积确定为该像素点的特征值;对目标对象在第一视频画面中所占的区域的中心点的特征信息包括的像素差值进行平均运算和极差运算,得到第二平均值和第二极差值,并将第二平均值和第二极差值之间的乘积确定为目标特征值;对于多个第二目标区域中的每个第二目标区域,从第二目标区域包括的所有像素点的特征值中,选择与目标特征值之间的差值最小的特征值,并将选择的特征值对应的像素点确定为目标像素点,从而得到多个目标像素点;从多个目标像素点的特征值中选择与目标特征值之间的差值最小的特征值,并将选择的特征值对应的目标像素点确定为特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Wherein, the implementation process of the server searching for the pixel point whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame from all the pixels included in the plurality of second target areas may be: for For each second target area in the plurality of second target areas, the feature information of all the pixels included in the second target area is obtained; for each pixel in all the pixels included in the second target area, for the pixel The pixel difference value included in the feature information is averaged and ranged to obtain the third average value and the third range value, and the product between the third average value and the third range value is determined as the pixel value Feature value; the pixel difference value included in the feature information of the center point of the area occupied by the target object in the first video frame is averaged and ranged to obtain the second average value and the second range value, and the second The product between the two mean values and the second extreme difference value is determined as the target feature value; for each second target area in a plurality of second target areas, from the feature values of all pixels included in the second target area, Select the eigenvalue with the smallest difference with the target eigenvalue, and determine the pixel point corresponding to the selected eigenvalue as the target pixel point, so as to obtain multiple target pixel points; select from the eigenvalues of multiple target pixel points The feature value with the minimum difference between the target feature value, and the target pixel point corresponding to the selected feature value is determined as the feature information matching the feature information of the center point of the area occupied by the target object in the first video frame pixel.
需要说明的是,第二目标区域的面积也为预设面积,该预设面积为根据球型IPC的老化程度确定的。其中,服务器根据球型IPC的老化程度确定第二目标区域的预设面积和服务器根据球型IPC的老化程度确定第一目标区域的预设面积的实现方式相同,在此不做详细阐述。另外,第二目标区域的形状可以为矩形,也可以为圆形,本发明实施例在此不做具体限定。特别地,第二目标区域的面积和形状可以与第一目标区域的面积和形状相同。It should be noted that the area of the second target area is also a preset area, which is determined according to the aging degree of the spherical IPC. Wherein, the server determines the preset area of the second target area according to the aging degree of the spherical IPC in the same manner as the server determines the preset area of the first target area according to the aging degree of the spherical IPC, and will not be described in detail here. In addition, the shape of the second target area may be a rectangle or a circle, which is not specifically limited in this embodiment of the present invention. In particular, the area and shape of the second target area may be the same as those of the first target area.
另外,按照预设规则将第二视频画面进行多次缩小,得到多个第三视频画面的实现过程可以为:将当前第二视频画面按照预设规则进行缩小,得到第一个第三视频画面;将该第一个第三视频画面继续按照预设规则进行缩小,得到第二个第三视频画面;将该第二个第三视频画面继续按照预设规则进行缩小,得到第三个第三视频画面…,以此类推,得到多个第三视频画面。也即是,按照预设规则对第二视频画面每进行一次缩小,就可以得到一个第三视频画面。其中,预设规则可以为每次在当前的视频画面的像素行列中分别减少一个像素点,也即每次在当前视频画面的每行像素点和每列像素点中均减少一个像素点。In addition, the implementation process of reducing the second video frame multiple times according to preset rules to obtain multiple third video frames may be as follows: reducing the current second video frame according to preset rules to obtain the first third video frame ;Continue to shrink the first third video frame according to the preset rules to obtain the second third video frame; continue to shrink the second third video frame according to the preset rules to obtain the third third video frame; Video frames..., and so on, to obtain a plurality of third video frames. That is, each time the second video frame is reduced according to the preset rule, a third video frame can be obtained. Wherein, the preset rule may be to reduce one pixel point in the pixel row and column of the current video frame each time, that is, reduce one pixel point in each row of pixels and each column pixel point of the current video frame each time.
另外需要说明的是,当服务器按照预设规则将第二视频画面进行多次缩小时,服务器进行视频画面缩小的次数可以为预设次数,该预设次数可以为5、10或15等。特别地,服务器可以将第二视频画面进行多次缩小,直至缩小后的视频画面的缩放比例和第一视频画面的缩放比例一致。In addition, it should be noted that when the server reduces the second video frame multiple times according to preset rules, the number of times the server reduces the video frame may be a preset number of times, and the preset number of times may be 5, 10, or 15. In particular, the server may reduce the second video frame multiple times until the scaling ratio of the reduced video frame is consistent with the scaling ratio of the first video frame.
例如,服务器将当前第二视频画面中的像素行列分别减少一个像素点,得到第一个第三视频画面;将该第一个第三视频画面中的像素行列分别继续减少一个像素点,得到第二个第三视频画面;…;依次类推,直至缩小后的视频画面和第一视频画面的缩放比例一致,此时得到20个第三视频画面;在该20个第三视频画面中按照上述方法确定20个第二目标区域;对于该20个第二目标区域中的每个第二目标区域,在该第二目标区域包括的所有像素点中,服务器确定目标像素点,该目标像素点的特征值和目标特征值之间的差值最小;当服务器对该20个第二目标区域均执行完上述操作时,得到20个目标像素点;然后从该20个目标像素点中,选择特征值与目标特征值差值最小的目标像素点,并将选择的目标像素点确定特征信息为与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。For example, the server reduces the rows and columns of pixels in the current second video frame by one pixel respectively to obtain the first third video frame; the server continues to reduce the rows and columns of pixels in the first third video frame by one pixel respectively to obtain the first third video frame Two third video frames; ...; and so on, until the reduced video frame is consistent with the scaling ratio of the first video frame, at this moment, 20 third video frames are obtained; in the 20 third video frames, according to the above-mentioned method Determine 20 second target areas; for each second target area in the 20 second target areas, among all the pixels included in the second target area, the server determines the target pixels, and the features of the target pixels The difference between the value and the target feature value is the smallest; when the server has performed the above operations on the 20 second target areas, 20 target pixels are obtained; then from the 20 target pixels, select the feature value and Target the target pixel with the smallest feature value difference, and determine the feature information of the selected target pixel as the pixel that matches the feature information of the center point of the area occupied by the target object in the first video frame.
第二种可能的实现方式,在第二视频画面包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。In a second possible implementation manner, all pixels included in the second video frame are searched for a pixel whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame.
当然服务器也可以不在第二视频画面中确定第一目标区域,直接在该第二视频画面包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,其中,服务器在第二视频画面包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点的实现方式和服务器在第一目标区域包括的所有像素点中查找特征信息与该目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点的实现方式基本相同,在此不做详细阐述。Of course, the server may not determine the first target area in the second video frame, and directly search for the relationship between the feature information and the center point of the area occupied by the target object in the first video frame in all the pixels included in the second video frame. Pixels matching feature information, wherein the server searches all pixels included in the second video frame for a pixel whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame The method is basically the same as the realization method that the server searches all the pixels included in the first target area for the pixel whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame, and is not described here. Do elaborate.
步骤304:服务器根据查找到的像素点在球型IPC的球面坐标系中对应的经度和纬度,确定球型IPC的第一转动角度,该第一转动角度为将第二视频画面的中心点转动至目标对象在第二视频画面中所占的区域的中心点时球型IPC需要转动的角度。Step 304: The server determines the first rotation angle of the spherical IPC according to the longitude and latitude corresponding to the searched pixel points in the spherical coordinate system of the spherical IPC, and the first rotation angle is to rotate the center point of the second video picture The angle at which the spherical IPC needs to rotate to the center point of the area occupied by the target object in the second video frame.
需要说明的是,由于查找到的像素点为球型IPC采集的视频画面中的像素点,且该查找到的像素点为特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点,因此,该查找到的像素点可以代表目标对象在第二视频画面中所占的区域的中心点,因此第一转动角度也为将第二视频画面的中心点转动至该查找到的像素点时球型IPC需要转动的角度。It should be noted that since the searched pixel point is the pixel point in the video frame collected by the spherical IPC, and the searched pixel point is the center point of the feature information and the area occupied by the target object in the first video frame The pixel points matched by the feature information of the target object, therefore, the found pixel points can represent the center point of the area occupied by the target object in the second video frame, so the first rotation angle is also to rotate the center point of the second video frame The angle at which the spherical IPC needs to rotate when reaching the found pixel.
因此,服务器确定球型IPC的第一转动角度可以为:服务器确定该查找到的像素点在球面坐标系中对应的经度和纬度;根据当前球型IPC采集的视频画面的中心点的经度和纬度,确定当前球型IPC采集的视频画面的中心点的经度和查找到的像素点在球面坐标系中对应的经度之间的差值,得到第三角度,并将该第三角度确定为第一转动角度在水平方向上的角度;同时服务器确定当前球型IPC采集的视频画面的中心点的纬度和查找到的像素点在球面坐标系中对应的纬度之间的差值,得到第四角度,并将该第四角度确定为第一转动角度在垂直方向上的角度,当服务器确定第一转动角度在水平方向上的角度和第一转动角度在垂直方向上的角度时,也即确定出第一转动角度。Therefore, the server determines that the first rotation angle of the spherical IPC can be: the server determines the corresponding longitude and latitude of the pixel point found in the spherical coordinate system; according to the longitude and latitude of the center point of the video picture collected by the current spherical IPC , determine the difference between the longitude of the center point of the video frame collected by the current spherical IPC and the corresponding longitude of the found pixel point in the spherical coordinate system, obtain the third angle, and determine the third angle as the first The rotation angle is the angle in the horizontal direction; at the same time, the server determines the difference between the latitude of the center point of the video picture collected by the current spherical IPC and the corresponding latitude of the found pixel point in the spherical coordinate system to obtain the fourth angle, And the fourth angle is determined as the angle of the first rotation angle in the vertical direction. When the server determines the angle of the first rotation angle in the horizontal direction and the angle of the first rotation angle in the vertical direction, it also determines the first rotation angle. A rotation angle.
步骤305:服务器向球型IPC发送第一转动请求,该第一转动请求携带第一转动角度,且该第一转动请求用于指示球型IPC根据第一转动角度进行转动。Step 305: the server sends a first rotation request to the spherical IPC, the first rotation request carries a first rotation angle, and the first rotation request is used to instruct the spherical IPC to rotate according to the first rotation angle.
当球型IPC接收服务器发送的第一转动请求时,根据该第一转动请求中携带的第一转动角度进行转动,并在转动之后重新采集视频画面,同时向服务器发送根据第一转动角度转动之后采集的视频画面;当服务器接收到球型IPC在根据第一转动角度转动之后采集的视频画面时,向客户端发送接收到的视频画面,以使用户通过客户端可以查看到球型IPC在根据第一转动角度转动之后采集的视频画面。需要说明的是,由于第一转动角度为将第二视频画面的中心点转动至目标对象在第二视频画面中所占的区域的中心点时球型IPC需要转动的角度,因此在球型IPC在根据第一转动角度转动之后采集的视频画面中,目标对象在该视频画面中所占的区域的中心点为该视频画面的中心点。When the spherical IPC receives the first rotation request sent by the server, it rotates according to the first rotation angle carried in the first rotation request, and recaptures the video picture after the rotation, and at the same time sends to the server The collected video picture; when the server receives the video picture collected after the spherical IPC rotates according to the first rotation angle, it sends the received video picture to the client, so that the user can view the spherical IPC through the client. A video frame collected after the first rotation angle is rotated. It should be noted that since the first rotation angle is the angle that the spherical IPC needs to rotate when the center point of the second video frame is rotated to the center point of the area occupied by the target object in the second video frame, the spherical IPC In the video frame collected after being rotated according to the first rotation angle, the center point of the area occupied by the target object in the video frame is the center point of the video frame.
在本发明实施例中,当服务器在枪型IPC采集的第一视频画面中确定出待监控的目标对象时,获取目标对象在第一视频画面中所占的区域的中心点的特征信息,由于每个像素点的特征信息具有唯一性,因此,可以在球型IPC采集的第二视频画面中查找特征信息与获取的特征信息匹配的像素点,该查找到的像素点可以代表目标对象在第二视频画面中所占的区域的中心点。然后根据该查找到的像素点在球型IPC的球面坐标系中对应的经度和纬度,确定球型IPC的第一转动角度,由于该第一转动角度为将第二视频画面的中心点转动至目标对象在第二视频画面中所占的区域的中心点时球型IPC需要转动的角度,因此,当球型IPC接收到第一转动请求并根据第一转动角度转动之后,球型IPC采集的视频画面中心点将为目标对象在第二视频画面中所占的区域的中心点,避免出现因为球型IPC老化问题导致目标对象可能没有位于球型IPC采集的视频画面的中心的情况,从而提高通过球型IPC对目标对象的细节进行监控的效果。另外,服务器还预先建立了预设坐标转换模型,该预设坐标转换模型用于指示枪型IPC采集的视频画面的平面坐标系中的点在球型IPC采集的视频画面的球面坐标系中的位置,也即对于枪型IPC采集的视频画面中任一点,服务器均可通过该预设坐标转换模型确定该任一点在球面坐标系中经度和纬度,并根据该任一点的经度和纬度,控制球型IPC进行转动以实现对该任一点的视频监控。In the embodiment of the present invention, when the server determines the target object to be monitored in the first video frame collected by the gun-type IPC, the feature information of the center point of the area occupied by the target object in the first video frame is acquired, because The feature information of each pixel point is unique, therefore, the pixel point whose feature information matches the acquired feature information can be found in the second video frame collected by the spherical IPC, and the found pixel point can represent the target object at the second The center point of the area occupied by the second video frame. Then according to the longitude and latitude corresponding to the pixel point found in the spherical IPC in the spherical coordinate system of the spherical IPC, determine the first rotation angle of the spherical IPC, because the first rotation angle is to rotate the center point of the second video picture to When the center point of the area occupied by the target object in the second video frame, the spherical IPC needs to rotate the angle, therefore, when the spherical IPC receives the first rotation request and rotates according to the first rotation angle, the spherical IPC collected The center point of the video picture will be the center point of the area occupied by the target object in the second video picture, avoiding the situation that the target object may not be located in the center of the video picture collected by the spherical IPC due to the aging problem of the spherical IPC, thereby improving The effect of monitoring the details of the target object through the spherical IPC. In addition, the server also pre-establishes a preset coordinate transformation model, which is used to indicate that the point in the plane coordinate system of the video picture collected by the gun-type IPC is in the spherical coordinate system of the video picture collected by the spherical IPC. Position, that is, for any point in the video screen collected by the gun-type IPC, the server can determine the longitude and latitude of any point in the spherical coordinate system through the preset coordinate transformation model, and according to the longitude and latitude of any point, control The spherical IPC rotates to enable video monitoring of any point.
图4A是本发明实施例提供的一种基于枪球联动的视频监控装置400,该基于枪球联动的视频监控装置可以由软件、硬件或者两者的结合实现成为服务器的部分或者全部。需要说明的是,当图1所示的IPC通过无线网络或者有线网络的方式直接与客户端进行通信时,该基于枪球联动的视频监控装置也可以由软件、硬件或者两者的结合实现成为IPC的部分或者全部,该IPC该可以为图2所示的IPC。参见图4A,该装置包括获取模块401、查找模块402、第一确定模块403和第一发送模块404。Fig. 4A is a video monitoring device 400 based on gun-ball linkage provided by an embodiment of the present invention. The video monitoring device based on gun-ball linkage can be implemented as part or all of a server by software, hardware or a combination of the two. It should be noted that when the IPC shown in Figure 1 communicates directly with the client through a wireless network or a wired network, the video monitoring device based on gun-ball linkage can also be realized by software, hardware or a combination of both. Part or all of the IPC, the IPC may be the IPC shown in FIG. 2 . Referring to FIG. 4A , the device includes an acquiring module 401 , a searching module 402 , a first determining module 403 and a first sending module 404 .
获取模块401,用于执行图3A实施例中的步骤302;An acquisition module 401, configured to execute step 302 in the embodiment of FIG. 3A;
查找模块402,用于执行图3A实施例中的步骤303,其中,第二视频画面是为枪型IPC配置的球型IPC当前采集的视频画面;The search module 402 is configured to execute step 303 in the embodiment of FIG. 3A , wherein the second video frame is a video frame currently collected by a ball-type IPC configured for a gun-type IPC;
第一确定模块403,用于执行图3A实施例中的步骤304;The first determining module 403 is configured to execute step 304 in the embodiment of FIG. 3A;
第一发送模块404,用于执行图3A实施例中的步骤305。The first sending module 404 is configured to execute step 305 in the embodiment of FIG. 3A .
可选地,参见图4B,该查找模块402包括第一确定单元4021和第一查找单元4022:Optionally, referring to FIG. 4B, the search module 402 includes a first determination unit 4021 and a first search unit 4022:
第一确定单元4021,用于在第二视频画面中,以第二视频画面的中心点为中心确定面积为预设面积的第一目标区域,该预设面积为根据球型IPC的老化程度确定的;The first determining unit 4021 is used to determine, in the second video frame, a first target area with a preset area centered on the center point of the second video frame, and the preset area is determined according to the aging degree of the spherical IPC of;
第一查找单元4022,用于从第一目标区域包括的所有像素点中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。The first searching unit 4022 is configured to search, from all the pixels included in the first target area, the pixel points whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame.
可选地,第一查找单元4021具体用于:Optionally, the first search unit 4021 is specifically configured to:
获取第一目标区域包括的所有像素点的特征信息;Obtain feature information of all pixels included in the first target area;
对于第一目标区域包括的所有像素点中的每个像素点,对该像素点的特征信息包括的像素差值进行平均运算和极差运算,得到第一平均值和第一极差值,并将该第一平均值和该第一极差值之间的乘积确定为该像素点的特征值;For each pixel point in all the pixels included in the first target area, the pixel difference value included in the feature information of the pixel point is averaged and the range operation is performed to obtain the first average value and the first range value, and Determine the product between the first average value and the first range value as the feature value of the pixel point;
对目标对象在第一视频画面中所占的区域的中心点的特征信息包括的像素差值进行平均运算和极差运算,得到第二平均值和第二极差值,并将该第二平均值和该第二极差值之间的乘积确定为目标特征值;Perform an average operation and a range operation on the pixel difference value included in the feature information of the center point of the area occupied by the target object in the first video frame to obtain a second average value and a second range value, and divide the second average value The product between the value and the second range value is determined as the target feature value;
从第一目标区域包括的所有像素点的特征值中,选择与目标特征值之间的差值最小的特征值,并将选择的特征值对应的像素点确定为特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。From the eigenvalues of all pixels included in the first target area, select the eigenvalue with the smallest difference with the target eigenvalue, and determine the pixel corresponding to the selected eigenvalue as the feature information and the target object in the first A pixel point matched with feature information of the center point of the area occupied by the video frame.
可选地,参见图4C,查找模块402包括缩小单元4023、第二确定单元4024和第二查找单元4025:Optionally, referring to FIG. 4C, the search module 402 includes a reduction unit 4023, a second determination unit 4024, and a second search unit 4025:
缩小单元4023,用于按照预设规则将第二视频画面进行多次缩小,得到多个第三视频画面;A reduction unit 4023, configured to reduce the second video frame multiple times according to preset rules to obtain multiple third video frames;
第二确定单元4024,用于对于该多个第三视频画面中的每个第三视频画面,在该第三视频画面中,以该第三视频画面的中心点为中心确定面积为预设面积的第二目标区域,该预设面积为根据球型IPC的老化程度确定的;The second determination unit 4024 is configured to, for each third video frame in the plurality of third video frames, in the third video frame, determine an area centered on the center point of the third video frame as the preset area The second target area, the preset area is determined according to the aging degree of the spherical IPC;
第二查找单元4025,用于从得到的多个第二目标区域包括的所有像素点中查找特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。The second search unit 4025 is configured to search for a pixel point whose feature information matches the feature information of the center point of the area occupied by the target object in the first video frame from all the pixels included in the obtained plurality of second target areas.
可选地,第二查找单元4025具体用于:Optionally, the second search unit 4025 is specifically configured to:
对于多个第二目标区域中的每个第二目标区域,获取该第二目标区域包括的所有像素点的特征信息;For each second target area in the plurality of second target areas, acquiring feature information of all pixels included in the second target area;
对于该第二目标区域包括的所有像素点中的每个像素点,对该像素点的特征信息包括的像素差值进行平均运算和极差运算,得到第三平均值和第三极差值,并将该第三平均值和该第三极差值之间的乘积确定为该像素点的特征值;For each pixel in all the pixels included in the second target area, an average operation and a range operation are performed on the pixel difference included in the feature information of the pixel to obtain a third average value and a third range value, and determining the product between the third average value and the third extreme difference as the feature value of the pixel point;
对目标对象在第一视频画面中所占的区域的中心点的特征信息包括的像素差值进行平均运算和极差运算,得到第二平均值和第二极差值,并将该第二平均值和该第二极差值之间的乘积确定为目标特征值;Perform an average operation and a range operation on the pixel difference value included in the feature information of the center point of the area occupied by the target object in the first video frame to obtain a second average value and a second range value, and divide the second average value The product between the value and the second range value is determined as the target feature value;
对于多个第二目标区域中的每个第二目标区域,从第二目标区域包括的所有像素点的特征值中,选择与目标特征值之间的差值最小的特征值,并将选择的特征值对应的像素点确定为目标像素点;For each of the plurality of second target areas, from the feature values of all pixels included in the second target area, select the feature value with the smallest difference between the target feature value and the selected The pixel point corresponding to the feature value is determined as the target pixel point;
从得到的多个目标像素点的特征值中选择与目标特征值之间的差值最小的特征值,并将选择的特征值对应的目标像素点确定为特征信息与目标对象在第一视频画面中所占的区域的中心点的特征信息匹配的像素点。Select the eigenvalue with the minimum difference between the target eigenvalues from the eigenvalues of the multiple target pixels obtained, and determine the target pixel corresponding to the selected eigenvalues as the feature information and the target object in the first video frame The pixel points that match the feature information of the center point of the area occupied by .
可选地,参见图4D,该装置400还包括第二确定模块第二确定模块405、第三确定模块406、第四确定模块407、第二发送模块408和接收模块409:Optionally, referring to FIG. 4D, the apparatus 400 further includes a second determination module, a second determination module 405, a third determination module 406, a fourth determination module 407, a second sending module 408, and a receiving module 409:
第二确定模块405,用于确定目标对象在第一视频画面中所占的区域的中心点在枪型IPC的平面坐标系中对应的坐标;The second determination module 405 is used to determine the coordinates corresponding to the center point of the area occupied by the target object in the first video frame in the plane coordinate system of the gun-type IPC;
第三确定模块406,用于根据确定出的坐标和预设坐标转换模型,确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度,该预设坐标转换模型用于将平面坐标系中的点的坐标转换至球面坐标系中;The third determining module 406 is configured to determine the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system according to the determined coordinates and the preset coordinate transformation model, the preset The coordinate transformation model is used to convert the coordinates of points in the plane coordinate system to the spherical coordinate system;
第四确定模块407,用于根据确定出的经度和纬度,确定球型IPC的第二转动角度;The fourth determination module 407 is used to determine the second rotation angle of the spherical IPC according to the determined longitude and latitude;
第二发送模块408,用于向球型IPC发送第二转动请求,该第二转动请求携带第二转动角度;The second sending module 408 is configured to send a second rotation request to the spherical IPC, where the second rotation request carries a second rotation angle;
接收模块409,用于接收球型IPC采集的第二视频画面,该第二视频画面为球型IPC在接收到第二转动请求时根据第二转动角度转动之后采集的视频画面。The receiving module 409 is configured to receive a second video frame collected by the spherical IPC, where the second video frame is a video frame collected after the spherical IPC rotates according to the second rotation angle when receiving the second rotation request.
可选地,参见图4E,第三确定模块406包括第三确定单元4061和第四确定单元4062:Optionally, referring to FIG. 4E, the third determining module 406 includes a third determining unit 4061 and a fourth determining unit 4062:
第三确定单元4061,用于根据确定出的坐标,确定目标对象在第一视频画面中所占的区域的中心点与垂直交点之间的距离x1、目标对象在第一视频画面中所占的区域的中心点与球面坐标系的原点之间的距离x2、以及目标对象在第一视频画面中所占的区域的中心点与至少四个标定点中的任意一个标定点之间的距离x3,垂直交点为经过球面坐标系的原点且与平面坐标系垂直的直线相交于平面坐标系的交点,至少四个标定点为从第一视频画面中随机选择的标定点;The third determining unit 4061 is configured to determine the distance x 1 between the center point of the area occupied by the target object in the first video frame and the vertical intersection point, and the area occupied by the target object in the first video frame according to the determined coordinates The distance x 2 between the center point of the area and the origin of the spherical coordinate system, and the distance between the center point of the area occupied by the target object in the first video frame and any one of the at least four marking points x 3 , the vertical intersection point is the intersection point where a straight line passing through the origin of the spherical coordinate system and perpendicular to the plane coordinate system intersects the plane coordinate system, and at least four calibration points are randomly selected calibration points from the first video frame;
第四确定单元4062,用于根据x1、x2、x3,按照如下预设坐标转换模型,确定目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度;The fourth determining unit 4062 is configured to determine the longitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system according to x 1 , x 2 , and x 3 according to the following preset coordinate transformation model and latitude;
其中,θ分别为目标对象在第一视频画面中所占的区域的中心点在球面坐标系中对应的经度和纬度,和θ1分别为垂直交点在球面坐标系中的经度和纬度,和θ3分别为该至少四个标定点中的任意一个标定点在球面坐标系中的经度和纬度。in, θ are respectively the longitude and latitude corresponding to the center point of the area occupied by the target object in the first video frame in the spherical coordinate system, and θ1 are the longitude and latitude of the vertical intersection point in the spherical coordinate system, respectively, and θ 3 are respectively the longitude and latitude of any one of the at least four calibration points in the spherical coordinate system.
可选地,参见图4F,该装置400还包括:Optionally, referring to FIG. 4F, the device 400 further includes:
选择模块410,用于在第一视频画面中随机选择至少四个标定点,至少四个标定点中的任意三个标定点不共线;The selection module 410 is used to randomly select at least four calibration points in the first video frame, and any three calibration points in the at least four calibration points are not collinear;
第五确定模块411,用于确定至少四个标定点中的每个标定点在平面坐标系中的坐标以及在球面坐标系中的经度和纬度;The fifth determination module 411 is used to determine the coordinates of each of the at least four calibration points in the plane coordinate system and the longitude and latitude in the spherical coordinate system;
第六确定模块412,用于根据至少四个标定点中的每个标定点在平面坐标系中的坐标以及在球面坐标系中的经度和纬度,确定垂直交点在球面坐标系中的位置参数,该位置参数包括垂直交点和球面坐标系的原点之间的距离、以及垂直交点在球面坐标系中的经度和纬度;The sixth determination module 412 is used to determine the position parameter of the vertical intersection point in the spherical coordinate system according to the coordinates of each of the at least four calibration points in the plane coordinate system and the longitude and latitude in the spherical coordinate system, The position parameter includes the distance between the vertical intersection point and the origin of the spherical coordinate system, and the longitude and latitude of the vertical intersection point in the spherical coordinate system;
建立模块413,用于根据垂直交点在球面坐标系中的位置参数和至少四个标定点中的任一个标定点在球面坐标系中的经度和纬度,建立该预设坐标转换模型。The establishing module 413 is configured to establish the preset coordinate conversion model according to the position parameter of the vertical intersection point in the spherical coordinate system and the longitude and latitude of any one of the at least four calibration points in the spherical coordinate system.
可选地,参见图4G,该第五确定模块411包括控制单元4111、第五确定单元4112和第六确定单元4113:Optionally, referring to FIG. 4G, the fifth determination module 411 includes a control unit 4111, a fifth determination unit 4112, and a sixth determination unit 4113:
控制单元4111,用于针对至少四个标定点中的每个标定点,控制球型IPC采集的视频画面的中心点从球面坐标系的经度和纬度均为零的位置转动至该标定点;The control unit 4111 is used to control the center point of the video picture captured by the spherical IPC to rotate from a position where the longitude and latitude of the spherical coordinate system are zero to the calibration point for each of the at least four calibration points;
第五确定单元4112,用于确定球型IPC在水平方向上的转动角度和球型IPC在垂直方向上的转动角度;The fifth determining unit 4112 is used to determine the rotation angle of the spherical IPC in the horizontal direction and the rotation angle of the spherical IPC in the vertical direction;
第六确定单元4113,用于将球型IPC在水平方向上的转动角度确定为该标定点在球面坐标系中的经度,将球型IPC在垂直方向上的转动角度确定为该标定点在球面坐标系中的纬度。The sixth determination unit 4113 is used to determine the rotation angle of the spherical IPC in the horizontal direction as the longitude of the calibration point in the spherical coordinate system, and determine the rotation angle of the spherical IPC in the vertical direction as the longitude of the calibration point on the spherical surface. The latitude in the coordinate system.
在本发明实施例中,当服务器在枪型IPC采集的第一视频画面中确定出待监控的目标对象时,获取目标对象在第一视频画面中所占的区域的中心点的特征信息,由于每个像素点的特征信息具有唯一性,因此,可以在球型IPC采集的第二视频画面中查找特征信息与获取的特征信息匹配的像素点,该查找到的像素点可以代表目标对象在第二视频画面中所占的区域的中心点。然后根据该查找到的像素点在球型IPC的球面坐标系中对应的经度和纬度,确定球型IPC的第一转动角度,由于该第一转动角度为将第二视频画面的中心点转动至目标对象在第二视频画面中所占的区域的中心点时球型IPC需要转动的角度,因此,当球型IPC接收到第一转动请求并根据第一转动角度转动之后,球型IPC采集的视频画面中心点将为目标对象在第二视频画面中所占的区域的中心点,避免出现因为球型IPC老化问题导致目标对象可能没有位于球型IPC采集的视频画面的中心的情况,从而提高通过球型IPC对目标对象的细节进行监控的效果。另外,服务器还预先建立了预设坐标转换模型,该预设坐标转换模型用于指示枪型IPC采集的视频画面的平面坐标系中的点在球型IPC采集的视频画面的球面坐标系中的位置,也即对于枪型IPC采集的视频画面中任一点,服务器均可通过该预设坐标转换模型确定该任一点在球面坐标系中经度和纬度,并根据该任一点的经度和纬度,控制球型IPC进行转动以实现对该任一点的视频监控。In the embodiment of the present invention, when the server determines the target object to be monitored in the first video frame collected by the gun-type IPC, the feature information of the center point of the area occupied by the target object in the first video frame is acquired, because The feature information of each pixel point is unique, therefore, the pixel point whose feature information matches the acquired feature information can be found in the second video frame collected by the spherical IPC, and the found pixel point can represent the target object at the second The center point of the area occupied by the second video frame. Then according to the longitude and latitude corresponding to the pixel point found in the spherical IPC in the spherical coordinate system of the spherical IPC, determine the first rotation angle of the spherical IPC, because the first rotation angle is to rotate the center point of the second video picture to When the center point of the area occupied by the target object in the second video frame, the spherical IPC needs to rotate the angle, therefore, when the spherical IPC receives the first rotation request and rotates according to the first rotation angle, the spherical IPC collected The center point of the video picture will be the center point of the area occupied by the target object in the second video picture, avoiding the situation that the target object may not be located in the center of the video picture collected by the spherical IPC due to the aging problem of the spherical IPC, thereby improving The effect of monitoring the details of the target object through the spherical IPC. In addition, the server also pre-establishes a preset coordinate transformation model, which is used to indicate that the point in the plane coordinate system of the video picture collected by the gun-type IPC is in the spherical coordinate system of the video picture collected by the spherical IPC. Position, that is, for any point in the video screen collected by the gun-type IPC, the server can determine the longitude and latitude of any point in the spherical coordinate system through the preset coordinate transformation model, and according to the longitude and latitude of any point, control The spherical IPC rotates to enable video monitoring of any point.
需要说明的是:上述实施例提供的基于枪球联动的视频监控装置在进行视频监控时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的基于枪球联动的视频监控装置与图3A实施例提供的基于枪球联动的视频监控方法属于同一构思,其具体实现过程详见图3A实施例,这里不再赘述。It should be noted that when the video monitoring device based on gun-ball linkage provided by the above-mentioned embodiment performs video monitoring, it only uses the division of the above-mentioned functional modules as an example. In practical applications, the above-mentioned functions can be assigned by different The functional modules are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the video monitoring device based on the gun-ball linkage provided in the above embodiment and the video monitoring method based on the gun-ball linkage provided in the embodiment of FIG. 3A belong to the same concept. The specific implementation process is shown in the embodiment of FIG.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(Digital Versatile Disc,DVD))、或者半导体介质(例如:固态硬盘(Solid State Disk,SSD))等。In the above embodiments, all or part may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the procedures or functions according to the embodiments of the present invention will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center via wired (eg coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (eg infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: Digital Versatile Disc (Digital Versatile Disc, DVD)), or a semiconductor medium (for example: Solid State Disk (Solid State Disk, SSD) )Wait.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above-mentioned embodiments provided by the application are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection scope of the application. Inside.
Claims (18)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710167181.0A CN108632569B (en) | 2017-03-20 | 2017-03-20 | Video monitoring method and device based on gun and ball linkage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710167181.0A CN108632569B (en) | 2017-03-20 | 2017-03-20 | Video monitoring method and device based on gun and ball linkage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108632569A true CN108632569A (en) | 2018-10-09 |
CN108632569B CN108632569B (en) | 2020-09-29 |
Family
ID=63687749
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710167181.0A Active CN108632569B (en) | 2017-03-20 | 2017-03-20 | Video monitoring method and device based on gun and ball linkage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108632569B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111565299A (en) * | 2020-05-06 | 2020-08-21 | 苏州新舟锐视信息技术科技有限公司 | Method for capturing targets through linkage of multiple vehicle-mounted guns and one dome camera |
CN112330726A (en) * | 2020-10-27 | 2021-02-05 | 天津天瞳威势电子科技有限公司 | Image processing method and device |
CN114637342A (en) * | 2022-03-17 | 2022-06-17 | 重庆紫光华山智安科技有限公司 | Holder control method and device, monitoring equipment and readable storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103607569A (en) * | 2013-11-22 | 2014-02-26 | 广东威创视讯科技股份有限公司 | Method and system for tracking monitored target in process of video monitoring |
CN103747207A (en) * | 2013-12-11 | 2014-04-23 | 深圳先进技术研究院 | Positioning and tracking method based on video monitor network |
CN104125433A (en) * | 2014-07-30 | 2014-10-29 | 西安冉科信息技术有限公司 | Moving object video surveillance method based on multi-PTZ (pan-tilt-zoom)-camera linkage structure |
CN104185078A (en) * | 2013-05-20 | 2014-12-03 | 华为技术有限公司 | Video monitoring processing method, device and system thereof |
CN104184995A (en) * | 2014-08-26 | 2014-12-03 | 天津市亚安科技股份有限公司 | Method and system for achieving real-time linkage monitoring of networking video monitoring system |
CN104537659A (en) * | 2014-12-23 | 2015-04-22 | 金鹏电子信息机器有限公司 | Automatic two-camera calibration method and system |
CN105338248A (en) * | 2015-11-20 | 2016-02-17 | 成都因纳伟盛科技股份有限公司 | Intelligent multi-target active tracking monitoring method and system |
CN105635657A (en) * | 2014-11-03 | 2016-06-01 | 航天信息股份有限公司 | Camera holder omnibearing interaction method and device based on face detection |
CN106408551A (en) * | 2016-05-31 | 2017-02-15 | 北京格灵深瞳信息技术有限公司 | Monitoring device controlling method and device |
-
2017
- 2017-03-20 CN CN201710167181.0A patent/CN108632569B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104185078A (en) * | 2013-05-20 | 2014-12-03 | 华为技术有限公司 | Video monitoring processing method, device and system thereof |
CN103607569A (en) * | 2013-11-22 | 2014-02-26 | 广东威创视讯科技股份有限公司 | Method and system for tracking monitored target in process of video monitoring |
CN103747207A (en) * | 2013-12-11 | 2014-04-23 | 深圳先进技术研究院 | Positioning and tracking method based on video monitor network |
CN104125433A (en) * | 2014-07-30 | 2014-10-29 | 西安冉科信息技术有限公司 | Moving object video surveillance method based on multi-PTZ (pan-tilt-zoom)-camera linkage structure |
CN104184995A (en) * | 2014-08-26 | 2014-12-03 | 天津市亚安科技股份有限公司 | Method and system for achieving real-time linkage monitoring of networking video monitoring system |
CN105635657A (en) * | 2014-11-03 | 2016-06-01 | 航天信息股份有限公司 | Camera holder omnibearing interaction method and device based on face detection |
CN104537659A (en) * | 2014-12-23 | 2015-04-22 | 金鹏电子信息机器有限公司 | Automatic two-camera calibration method and system |
CN105338248A (en) * | 2015-11-20 | 2016-02-17 | 成都因纳伟盛科技股份有限公司 | Intelligent multi-target active tracking monitoring method and system |
CN106408551A (en) * | 2016-05-31 | 2017-02-15 | 北京格灵深瞳信息技术有限公司 | Monitoring device controlling method and device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111565299A (en) * | 2020-05-06 | 2020-08-21 | 苏州新舟锐视信息技术科技有限公司 | Method for capturing targets through linkage of multiple vehicle-mounted guns and one dome camera |
CN112330726A (en) * | 2020-10-27 | 2021-02-05 | 天津天瞳威势电子科技有限公司 | Image processing method and device |
CN112330726B (en) * | 2020-10-27 | 2022-09-09 | 天津天瞳威势电子科技有限公司 | Image processing method and device |
CN114637342A (en) * | 2022-03-17 | 2022-06-17 | 重庆紫光华山智安科技有限公司 | Holder control method and device, monitoring equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108632569B (en) | 2020-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10165179B2 (en) | Method, system, and computer program product for gamifying the process of obtaining panoramic images | |
CN103491339B (en) | Video acquiring method, equipment and system | |
US9325861B1 (en) | Method, system, and computer program product for providing a target user interface for capturing panoramic images | |
CN110831030A (en) | Method for acquiring signal coverage effect diagram and network equipment | |
Guan et al. | DeepMix: mobility-aware, lightweight, and hybrid 3D object detection for headsets | |
WO2014082407A1 (en) | Method and system for displaying video monitoring image | |
US20240259544A1 (en) | Information processing apparatus, information processing method, and program | |
WO2018103233A1 (en) | Virtual reality-based viewing method, device, and system | |
CN109165606B (en) | Vehicle information acquisition method and device and storage medium | |
CN111220129A (en) | Focusing measurement method with rotating holder and terminal | |
CN110139040B (en) | Pan-tilt camera positioning method and device, pan-tilt camera, equipment and medium | |
CN108632569B (en) | Video monitoring method and device based on gun and ball linkage | |
EP4220547A1 (en) | Method and apparatus for determining heat data of global region, and storage medium | |
WO2020051713A1 (en) | Camera control system and method of controlling a set of cameras | |
WO2023087894A1 (en) | Region adjustment method and apparatus, and camera and storage medium | |
CN105191278A (en) | Method for correcting image from wide-angle lens and device therefor | |
CN114785961B (en) | Patrol route generation method, device and medium based on holder camera | |
KR20220036209A (en) | Apparatus and method for providing service related to target location based on uwb | |
CN114422644B (en) | Device control method, device, user device and computer readable storage medium | |
JP2017017674A (en) | Vertical axis calibration device, method, and program | |
CN113674356B (en) | Camera screening method and related device | |
US11776157B2 (en) | Panoramic image based jump position determination method and apparatus and non-transitory computer-readable medium | |
CN112422886B (en) | Visual domain three-dimensional control display system | |
KR102498870B1 (en) | Camera system and method for processing image thereof | |
CN117095066B (en) | Method and device for marking PTZ camera screen |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |