Monitoring device control method and device
Technical Field
The present disclosure relates to monitoring technologies, and in particular, to a method and an apparatus for controlling a monitoring apparatus.
Background
In recent years, the concept of the gun and ball linkage system has started to gradually increase in temperature. The gun and ball linkage means that a target is tracked by a ball machine according to manual selection or automatic detection of a monitored target in a wide-angle range of a gun camera. The bolt is one of monitoring CCD (Charge-Coupled Device) cameras, is mainly distinguished from the appearance and a lens mounting interface, and is cuboid (a wide-angle camera is adopted). The ball machine is called a ball camera, is widely applied to monitoring of open areas, can be used in different occasions, is internally provided with an integrated camera (comprising a zoom lens), a tripod head structure and a decoder, and is called an integrated ball camera (mostly adopting a long-focus camera) by adopting an integrated front-end imaging device of a spherical shield.
The control scheme of the existing gun-ball linkage system mainly comprises two types: the method comprises the steps of firstly, manually controlling the dome camera to rotate randomly and recording the rotating angle of the dome camera to determine the corresponding relation between the sight center of the dome camera at each position and the sight line of the gun camera, further determining an expression of the rotating angle of the dome camera relative to the image coordinate of the gun camera by a fitting method, and controlling the rotation of the dome camera based on the expression of the rotating angle of the dome camera relative to the image coordinate of the gun camera; and secondly, deriving an expression of the rotation angle of the dome camera relative to the coordinate of the dome camera target in the image of the gun camera according to a shooting geometry law and a coordinate transformation equation on the basis of approximately estimating the field depth range, and controlling gun-ball linkage based on the expression of the rotation angle of the dome camera relative to the coordinate of the image of the gun camera.
The existing first scheme consumes a large amount of manpower, and has high fitting difficulty for a nonlinear system; the second existing scheme has high requirements on installation accuracy.
Disclosure of Invention
The embodiment of the application provides a method and a device for controlling a monitoring device, which are used for overcoming the defects of the existing calibration scheme of a gun and ball linkage system.
The embodiment of the application provides a method for controlling a monitoring device, which comprises the following steps:
determining a monitoring target in a gun camera monitoring image;
driving the ball machine to rotate according to the first control parameter; the first control parameter is determined according to a preset gun and ball linkage control algorithm;
determining an error of the first control parameter; the error is determined according to the corresponding relation between the reference position and the actual position; or, the first adjustment angle of the dome camera determined according to the first control parameter and the second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera are determined; the reference position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined according to the preset gun and ball linkage control algorithm after the dome camera is driven to rotate according to a first control parameter; the actual position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined based on feature point matching after the dome camera is driven to rotate according to the first parameter;
fitting and calibrating the preset gun and ball linkage control algorithm according to the error to obtain a corrected gun and ball linkage control algorithm; determining a second control parameter according to the corrected gun and ball linkage control algorithm and the determined monitoring target in the gun bolt monitoring image;
and controlling the dome camera to rotate according to the second control parameter so as to enable the monitoring target to be located at a preset position in the monitoring image of the dome camera.
The embodiment of the application provides a device controlled by a monitoring device, which comprises:
the determining unit is used for determining a monitoring target in the gun camera monitoring image;
the driving unit is used for driving the ball machine to rotate according to the first control parameter; the first control parameter is determined according to a preset gun and ball linkage control algorithm;
the determination unit is further configured to determine an error of the first control parameter; the error is determined according to the corresponding relation between the reference position and the actual position; or, the first adjustment angle of the dome camera determined according to the first control parameter and the second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera are determined; the reference position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined according to the preset gun and ball linkage control algorithm after the dome camera is driven to rotate according to a first control parameter; the actual position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined based on feature point matching after the dome camera is driven to rotate according to the first parameter;
the calibration unit is used for carrying out fitting calibration on the preset gun and ball linkage control algorithm according to the error to obtain a corrected gun and ball linkage control algorithm;
the determining unit is further used for determining a second control parameter according to the corrected gun and ball linkage control algorithm and the determined monitoring target in the gun camera monitoring image;
and the control unit is used for controlling the dome camera to rotate according to the second control parameter so as to enable the monitoring target to be located at a preset position in the monitoring image of the dome camera.
The beneficial effect of this application is as follows:
the embodiment of the application provides a method and a device for controlling a monitoring device, which are used for determining a monitoring target in a bolt machine monitoring image; driving the ball machine to rotate according to the first control parameter; the first control parameter is determined according to a preset gun and ball linkage control algorithm; determining an error of the first control parameter; the error is determined according to the corresponding relation between the reference position and the actual position; or, the first adjustment angle of the dome camera determined according to the first control parameter and the second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera are determined; the reference position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined according to the preset gun and ball linkage control algorithm after the dome camera is driven to rotate according to a first control parameter; the actual position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined based on feature point matching after the dome camera is driven to rotate according to the first parameter; fitting and calibrating the preset gun and ball linkage control algorithm according to the error to obtain a corrected gun and ball linkage control algorithm; determining a second control parameter according to the corrected gun and ball linkage control algorithm and the determined monitoring target in the gun bolt monitoring image; and controlling the dome camera to rotate according to the second control parameter so as to enable the monitoring target to be located at a preset position in the monitoring image of the dome camera, and enable the monitoring target to be located at a preset position in the monitoring image of the dome camera. The control method based on the corresponding relation of the reference position and the corresponding relation of the actual position through error fitting not only can effectively save labor cost, but also can accurately control gun-ball linkage, and effectively guarantees the accuracy of the ball machine in tracking the monitored target.
Drawings
Specific embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart illustrating a method for monitoring device control according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for controlling a monitoring device according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a device controlled by a monitoring device in an embodiment of the present application.
Detailed Description
In order to make the technical solutions and advantages of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and not an exhaustive list of all embodiments. And the embodiments and features of the embodiments in the present specification may be combined with each other without conflict.
In the process of realizing the application, the inventor finds that the scheme of manually controlling and recording the rotation angle of the dome camera to realize the control of the monitoring device consumes manpower, and when the mechanical structure is complex, the rotation angle of the dome camera is not in a linear relation with the image coordinate of the gun camera, and the correct calibration relation of the gun-ball linkage system cannot be obtained through the scheme.
According to the scheme of carrying out gun-ball linkage control based on the expression of the rotation angle of the ball machine relative to the image coordinates of the gun camera, the coordinates of pixel points of the gun camera are given in actual control due to the parallax problem caused by the fact that the depth of field position and the center distance of the camera are not zero and the installation error of the machine, three-dimensional voxels corresponding to the pixel points cannot accurately fall on the sight center of the ball machine after the ball machine rotates, and the error is large.
In order to solve the above problems, an embodiment of the present application provides a method and an apparatus for controlling a monitoring apparatus, where after a position S of a monitored target in a bolt machine monitoring image is determined, a ball machine is driven to rotate according to an existing gun-ball linkage control algorithm, a position M of the monitored target in a ball machine monitoring image is determined according to a corresponding relationship of the actual position, a position S 'in the bolt machine monitoring image corresponding to a preset position of the ball machine monitoring image is determined, and an error of the existing gun-ball linkage control algorithm is obtained according to the position S and the position S'; or determining a position M of a monitoring target in the monitoring image of the dome camera after the dome camera is driven to rotate according to the first control parameter, and determining the error according to the position M and a preset position N in the monitoring image of the dome camera; or, a first adjustment angle of the dome camera determined according to the first control parameter is set to be theta, a second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera is set to be theta ', and the error of the existing gun-ball linkage control algorithm is determined according to the first adjustment angle theta and the second adjustment angle theta'.
And performing error fitting correction on the existing gun-ball linkage control algorithm according to one or more groups of errors to obtain a calibrated control algorithm, and controlling the ball machine to rotate according to the calibrated control algorithm, so that gun-ball linkage is accurately controlled, and the tracking accuracy of the ball machine on the monitored target is effectively guaranteed.
The scheme in the embodiment of the application can be applied to a gun and ball linkage system to realize accurate monitoring device control.
Example one
Fig. 1 is a schematic flowchart of a method for controlling a monitoring device according to an embodiment of the present application, and as shown in fig. 1, the method for controlling the monitoring device may include the following steps:
step 101: determining a monitoring target in a gun camera monitoring image;
step 102: driving the ball machine to rotate according to the first control parameter; the first control parameter is determined according to a preset gun and ball linkage control algorithm;
step 103: determining an error of the first control parameter; the error is determined according to the corresponding relation between the reference position and the actual position; or, the first adjustment angle of the dome camera determined according to the first control parameter and the second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera are determined; the reference position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined according to the preset gun and ball linkage control algorithm after the dome camera is driven to rotate according to a first control parameter; the actual position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined based on feature point matching after the dome camera is driven to rotate according to the first parameter;
specifically, the step of positioning the monitoring target at the preset position in the monitoring image of the dome camera means that the monitoring image of the dome camera includes the monitoring target, and specifically, the step of positioning the monitoring target at the preset position in the monitoring image of the dome camera may be the center of the monitoring image of the dome camera, or may be a specific position in the monitoring image of the dome camera, for example, the lower left corner, the upper right corner, etc., and those skilled in the art may set the monitoring target according to actual needs, and no specific limitation is made here. In consideration of the fact that in practical applications, when a monitoring target is tracked by a dome camera, it is preferable that the monitoring target is located at the center of a monitoring image of the dome camera, so the following description will be given by taking an example that the monitoring target is located at the center of the monitoring image of the dome camera.
Step 104: fitting and calibrating the preset gun and ball linkage control algorithm according to the error to obtain a corrected gun and ball linkage control algorithm;
in specific implementation, when fitting calibration of the gun and ball linkage control algorithm is performed, a large number of monitoring targets can be collected in a gun bolt monitoring image, the step 101 to the step 103 are executed based on the large number of monitoring targets to determine errors of the existing gun and ball linkage control algorithm, and fitting calibration of gun and ball linkage control parameters (functions) is performed through the step 104. In order to obtain a better gun and ball linkage control algorithm fitting calibration effect, a monitoring target can be sampled equidistantly on a gun camera monitoring image.
The steps 101 to 104 may not be executed each time, for example, the calibration process controlled by the monitoring device may be executed only once or multiple times in the first execution, so as to calibrate the gun and ball linkage control parameters for controlling the rotation of the ball machine, and the calibrated gun and ball linkage control parameters may be directly used to control the rotation of the ball machine.
Step 105: determining a second control parameter according to the corrected gun and ball linkage control algorithm and the determined monitoring target in the gun bolt monitoring image;
step 106: and controlling the dome camera to rotate according to the second control parameter so as to enable the monitoring target to be located at a preset position in the monitoring image of the dome camera.
In a specific implementation, the error is determined according to a correspondence between the reference position and the actual position, and specifically includes:
determining the position S of the monitoring target in the gun camera monitoring image; after the ball machine is driven to rotate according to the first control parameter, determining a position S' in the gun camera monitoring image corresponding to a preset position in the ball machine monitoring image according to the actual position corresponding relation; determining the error according to the position S and the position S'; or,
and determining a position M of a monitoring target in the monitoring image of the dome camera after the dome camera is driven to rotate according to the first control parameter, and determining the error according to the position M and a preset position in the monitoring image of the dome camera.
Specifically, a plurality of monitoring targets D can be extracted or sampled from the gun camera monitoring imageiFor each monitoring target, the following processing flow is carried out:
the specific implementation of determining the error of the existing gun and ball linkage control algorithm can be carried out from two dimensions of position or angle:
when determining the error of the existing gun and ball linkage control algorithm from the position dimension, the following two schemes can be specifically adopted:
the first scheme for determining the error of the existing gun and ball linkage control algorithm from the position relation dimensionality of the gun camera monitoring image and the ball machine monitoring image can comprise the following steps:
(1) determining the position S of a monitored target in a bolt machine monitoring imagei;
(2) After the ball machine is driven to rotate according to the existing gun-ball linkage control algorithm, the position M of the monitored target in the monitoring image of the ball machine is determinedi(ii) a According to the actual position corresponding relation, determining the position S in the gun camera monitoring image corresponding to the central position of the dome camera monitoring imagei’;
(3) According to position SiAnd position Si' obtaining the error of the existing gun-ball linkage control algorithmi=Si-Si’。
The second scheme for determining the error of the existing gun and ball linkage control algorithm from the position relation dimensionality of the gun camera monitoring image and the ball machine monitoring image can comprise the following steps:
(1) determining the position S of a monitored target in a bolt machine monitoring imagei;
(2) Determining the position M of the monitoring target in the monitoring image of the dome camera after the dome camera is driven to rotate according to the first control parameteri;
(3) According to the position MiAnd a preset position N in the dome camera monitoring imageiDetermining the error'i=Mi-Ni。
The scheme for determining the error of the existing gun-ball linkage control algorithm from the dimension of the driving rotation angle of the ball machine can comprise the following steps:
(1) the first adjusting angle of the dome camera determined according to the position of the monitored target in the gun camera monitoring image and the first control parameter is thetaiAnd driving the ball machine to rotate to the corresponding position;
(2) determining that a second adjustment angle corresponding to the position where the monitoring target is actually located in the monitoring image of the dome camera is theta'i;
(3) According to the first adjustment angle thetaiAnd a second adjustment angle of theta'iDetermining error sigma of existing gun and ball linkage control algorithmi=θi-θ′i. In one embodiment, the first adjustment angle θiAnd a second modulation angle theta'iThe angle may comprise one dimension or multiple dimensions, for example, may comprise a horizontal angle and/or a pitch angle.
In a specific implementation, the existing gun and ball linkage control algorithm error determination scheme may be implemented alternatively or in combination according to actual needs, and is not limited specifically here.
For each monitored target DiAnd obtaining a corresponding error after processing, and performing error fitting correction on the existing gun and ball linkage control algorithm according to one or more determined errors (the data volume required by specific calibration can be determined according to the actual gun and ball linkage system control precision requirement, and is not specifically limited here) to obtain the calibrated gun and ball linkage control algorithm, so that the gun and ball linkage system is accurately controlled according to the calibrated gun and ball linkage control algorithm.
Specifically, a monitoring target D is setiThe position coordinate in the gun camera monitoring image is [ x ]i,yi]Then, according to the monitored object DiThe position coordinates in the gun camera monitoring image and the calibrated gun-ball linkage control algorithm can determine the rotating angle of the ball machine
The control correction function obtained after calibration by adopting the first scheme of determining the error of the existing gun-ball linkage control algorithm from the position relation dimensionality of the gun camera monitoring image and the dome camera monitoring image is as follows: [ x'i,y′i]T=gpos([xi,yi]T) Wherein, [ x'i,y′i]TCoordinates (coordinates corresponding to the center of the monitored target or non-center part of the monitored target, which are not specifically limited) of the monitored target in the gun bolt monitoring image, which is input as a gun and ball linkage control algorithm after correction, gpos() The control correction function obtained after calibration is carried out by adopting the first scheme for determining the error of the existing gun-ball linkage control algorithm, so that when a ball machine is expected to look at the coordinate [ x ] in the gun machine monitoring imagei,yi]TWhen monitoring the target, only g is neededpos([xi,yi]T) As control signal for gun-ball linkage according to [ x ]i,yi]And control the correction function gpos() Determining the position coordinate of the ball machine in the gun camera monitoring image as [ x ]i,yi]Will [ x'i,y′i]TDetermining an angle signal (for example, the angle signal may include a horizontal rotation angle and a pitching rotation angle) which needs to drive the dome camera to rotate as a second control parameter for controlling the dome camera to rotate according to the coordinates of the monitoring target in the gun camera monitoring image (for example, the coordinates may include a horizontal angle and a pitching angle) input as the corrected gun and ball linkage control algorithm and the current position state (for example, may include a horizontal angle and a pitching angle) of the monitoring target in the gun camera monitoring image, and controlling the dome camera to rotate according to the determined second control parameter to realize that the dome camera has [ x ] coordinate of the position in the gun camera monitoring imagei,yi]Tracking of the monitored target.
Scheme for determining error of existing gun-ball linkage control algorithm by using dimension of driving rotation angle of ball machineThe control function obtained after calibration is: theta'i=gθ([xi,yi]T) Wherein, theta'iG, actual rotation angle (which may comprise horizontal rotation angle and/or pitching rotation angle) for enabling the monitoring target to be located at a preset position in the monitoring image of the dome cameraθThe control function obtained after calibration is carried out by adopting the second scheme for determining the error of the existing gun-ball linkage control algorithm, so that when a user wants the ball machine to look at the position coordinate [ x ] positioned in the gun machine monitoring imagei,yi]According to the existing gun-ball linkage algorithm, theta is obtained during monitoring of the targetiOnly need to mix gθ([xi,yi]T) And controlling the rotation of the ball making machine by using a second control parameter for controlling the linkage of the gun ball.
The embodiment of the application provides a monitoring device control method, which comprises the steps of determining a monitoring target in a gun camera monitoring image, driving a ball machine to rotate according to a first control parameter so as to enable the monitoring target to be located at a preset position in the ball machine monitoring image, wherein the first control parameter is determined according to an existing gun and ball linkage control algorithm, determining an error of the first control parameter, and the error is determined according to a corresponding relation between a reference position and an actual position; or, the first adjustment angle of the dome camera determined according to the first control parameter and the second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera are determined; the reference position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined according to the preset gun and ball linkage control algorithm after the dome camera is driven to rotate according to the first control parameter; the actual position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined based on feature point matching after the dome camera is driven to rotate according to the first parameter; fitting and calibrating the preset gun and ball linkage control algorithm according to the error to obtain a corrected gun and ball linkage control algorithm; determining a second control parameter according to the corrected gun and ball linkage control algorithm and a monitoring target in the gun camera monitoring image; and controlling the dome camera to rotate according to the second control parameter so as to enable the monitoring target to be located at a preset position in the monitoring image of the dome camera. The control method based on the actual position corresponding relation through error fitting not only can effectively save labor cost, but also can accurately control gun-ball linkage, and effectively guarantees the accuracy of the ball machine in tracking the monitored target.
In an implementation, the actual position corresponding relationship may be determined before step 103, and specifically determining the actual position corresponding relationship may specifically include:
acquiring characteristic points in the gunlock monitoring image and the dome camera monitoring image;
matching the characteristic points in the gunlock monitoring image and the dome camera monitoring image;
and determining the corresponding relation of the actual positions according to the positions of the matched characteristic point pairs.
In a specific implementation, the feature points in the gun camera monitoring image and the dome camera monitoring image may be obtained by performing feature point detection through a Scale-invariant feature transform (SIFT) algorithm, a FAST (Features from accessed Segment test), an ORB (Oriented FAST and Rotated BRIEF) algorithm, a brif (Binary Robust element Features, feature point-based object or image matching) algorithm, and a Speeded Robust Features (Speeded Up Robust Features-based) algorithm.
Theoretically, SIFT, FAST, ORB, BRIEF, and SURF are only used to teach those skilled in the art how to implement the present application, but do not mean that only SIFT, FAST, ORB, BRIEF, and SURF can be used, and the corresponding way can be determined according to practical needs.
Feature point matching refers to finding out correctly matched feature points in two images needing to be registered. The characteristic point matching principle is that each characteristic point is described by using local image characteristics, namely multidimensional descriptors, then a descriptor is taken out from each group (one group of each descriptor in the gun-ball picture) to compare the distance between the descriptors, and the best matching combination, namely the bit matching output result.
Specifically, the process of matching the feature points may be performed in two steps, specifically as follows:
1. and (4) coarse granularity matching. Namely, the distance between the feature point descriptor in the gun camera monitoring image and the feature point descriptor in the dome camera monitoring image is calculated, and the optimal single shot set in the set with the determined distance smaller than the threshold value is the coarse-grained matching result.
2. And (5) fine granularity matching. The matching of fine grit refers to going on the basis of coarse grain matching, considers the uniformity in space, and to rifle ball linked system, because the depth of field is greater than the center distance of rifle bolt and ball machine far away, the geometric relation between rifle bolt and the ball machine can satisfy affine antipodal geometry approximately, promptly:
in a specific implementation, the actual position corresponding relationship may be represented as a matrix H, where the matrix H satisfies:
wherein,andrespectively, the homogeneous pixel coordinates of the feature points in the monitoring images of the gun camera and the dome camera, H is a homography matrix H ∈ R3 × 3。
Since the matrix H is a 3 rd order matrix, at least four pairs of data of pairs of characteristic points are required to determine the matrix H, and the matrix H may be determined based on more data of pairs of characteristic points for accuracy of calculation.
In theory, as long as other technologies capable of determining the actual position corresponding relationship are available, the scheme for determining the actual position corresponding relationship based on the matched feature point pairs is only used for teaching a person skilled in the art how to implement the present application specifically, but does not mean that only the scheme for determining the actual position corresponding relationship based on the matched feature point pairs can be used, and the implementation process may be combined with practical needs to determine a corresponding manner.
In an implementation, before determining the positions of the matched feature point pairs in the gun camera and the dome camera monitoring image, the method may further include:
and removing the characteristic point pairs which are matched incorrectly from the matched characteristic point pairs.
Specifically, a RANdom SAmple Consensus (RANdom SAmple Consensus) algorithm may be used to remove feature point pairs that do not conform to the homography pattern from the matched feature point pairs, so as to ensure that the correct relationship between the positions of the rifle bolt and the monitoring image of the ball machine is obtained.
And after the matching of the characteristic points of the gunlock and the dome camera is finished, determining the corresponding relation of the actual positions according to the position of each pair of matched characteristic points.
Specifically, determining the actual position corresponding relationship according to the position of the matched feature point pair may specifically include:
determining the positions of the matched feature point pairs in the images monitored by the gun camera and the dome camera;
and determining the corresponding relation of the actual positions according to the positions of the matched characteristic points in the images monitored by the gunlock and the dome camera.
Specifically, before the feature points in the gun camera monitoring image and the dome camera monitoring image are obtained, the method may further include:
reducing the scale of the ball machine monitoring image to be the same as that of the gun camera monitoring image; or,
and rotating the gun camera monitoring image or the ball machine monitoring image so as to enable the gun camera monitoring image and the ball machine monitoring image to keep the same visual angle.
In a specific implementation, since the scale of the monitoring image of the dome camera (telephoto camera) is generally larger than that of the gun camera, before the feature points in the monitoring image of the dome camera are acquired, the scale of the monitoring image of the dome camera can be reduced to be the same as that of the monitoring image of the gun camera, and the reduction coefficients are as follows:
ratio of scale of the dome camera monitoring image to the gun camera monitoring image/ratio of range of viewing angles of the dome camera and the gun camera.
Or, in order to further improve the matching success rate, in the case that the angle difference in the horizontal direction of the two-camera monitoring picture is known, before the feature point is calculated, the gun camera monitoring image or the ball machine monitoring image may be rotated, so that the gun camera monitoring image and the ball machine monitoring image maintain the same viewing angle.
In specific implementation, if the feature points are directly obtained from the monitoring image of the whole rifle bolt, the feature point pairs with matching errors are added, so that interference data is caused, and in order to avoid the feature point pairs with matching errors, the feature points can be obtained from the monitoring image area with the current monitoring target as the center and with the visual field range twice as large as that of the ball machine. That is, the obtaining of the feature points in the gun camera monitoring image and the dome camera monitoring image may specifically include:
the characteristic points are acquired from a gun camera with the position of a monitored target as the center and the visual field range slightly larger than the monitoring image area of the dome camera (for example, the monitoring image area which is one to three times of the visual field range of the dome camera).
In operation, at step 101: before determining the feature points in the bolt face monitoring image, the method may further include:
and carrying out initialization calibration on the gunlock and the ball machine.
In specific implementation, the initializing calibration of the bolt machine and the ball machine may specifically include:
determining a first position corresponding to the sight center point of the dome camera in the gun camera monitoring image;
determining the position offset of the first position and the initial position of the sight line of the gun camera monitoring image according to the first position and the initial position of the sight line of the gun camera monitoring image;
driving the ball machine to rotate to reduce the position offset;
and when the position deviation is determined to be smaller than the threshold value, finishing the initialization calibration of the gunlock and the dome camera.
In specific implementation, the gun and ball linkage system can be calibrated in a parallel state, and subsequent calibration work is carried out on the basis of parallel state calibration.
For a gun and ball linkage system, the corresponding motor rotation state when the gun camera and the ball camera achieve the monitoring sight line parallel can be used as the reference state of motor control.
In order to make the monitoring sight lines of the gun camera and the ball camera parallel, the direct distance of the voxels corresponding to the sight line centers of the gun camera and the ball camera should be approximately equal to the center distance of the gun camera and the ball camera theoretically. However, this requires that the two voxels are marked separately in the three-dimensional scene, which is not easy to implement in practical operation. If the depth of field is far greater than the distance between the centers of the gun camera and the dome camera, that is, the depth of field can be regarded as infinite, then when the centers of the monitoring images of the gun camera and the dome camera see the same voxel, the monitoring sight lines of the gun camera and the dome camera can be regarded as parallel.
A voxel is an abbreviation of a volume element, and a volume containing a voxel can be represented by a volume rendering or by extracting a polygon isosurface of a given threshold contour. The voxel is the minimum unit of digital data on three-dimensional space segmentation, and is used in the fields of three-dimensional imaging, scientific data, medical images and the like. Conceptually, the smallest unit of a two-dimensional space, the pixel, is used on image data of a two-dimensional computer image. Some real three-dimensional displays use voxels to describe their resolution, for example: a display of 512 x 512 voxels may be displayed. Like pixels, voxels do not themselves contain data of locations in space (i.e. their coordinates), but can be extrapolated from their location relative to other voxels, i.e. their location in the data structure that constitutes a single volumetric image.
In the specific implementation, the line-of-sight initialization calibration of the bolt and the dome camera is performed, and the parallel state calibration in the initialization calibration is described as an example. The rotation of the ball machine can be manually adjusted to enable the monitoring sight line of the ball machine to be approximately parallel to the monitoring sight line of the gun camera, then the deviation between the position of a voxel corresponding to the monitoring sight line center of the ball machine in a gun camera monitoring image and the position of the monitoring sight line center of the gun camera is determined, the ball machine is controlled to move in the opposite direction of the position deviation according to a gradient descent algorithm, then the current position deviation is determined, then the ball machine is controlled to move in the opposite direction of the position deviation, and the steps are repeated until the position deviation is smaller than a preset threshold value (the threshold value can be determined by technicians in the field according to actual conditions, and is not specifically limited), and then the calibration of the parallel state of the sight lines of the gun camera and.
Example two
The implementation of the method for controlling the monitoring device is explained in the first embodiment, and the implementation of the method for controlling the monitoring device is described with reference to specific scenarios.
For example, the monitoring device is a gun and ball linkage system, which is installed in a certain shopping mall to perform monitoring tasks. In this application scenario, the method for implementing the monitoring device control provided by the present application may be as follows:
step 201: and determining a monitoring target in the gun bolt monitoring image through a manual selection mode or an automatic detection and identification mode.
Specifically, the monitored target may be one or more persons or objects, and while determining the monitored target, a corresponding pixel coordinate (position) range of each monitored target in the bolt machine monitoring image may be determined, a pixel point within the pixel coordinate range may be selected as a monitored target center point, and a pixel coordinate of a monitored target center point (hereinafter referred to as a monitored target point for short, which may be arbitrarily selected within the pixel coordinate range, preferably, a geometric center point of the monitored target graph) in the bolt machine monitoring image is set as [ x ] xi,yi]T。
Step 202: pixel coordinate [ x ] of monitoring target point in gun bolt monitoring imagei,yi]TAnd inputting the parameters into an existing gun and ball linkage control algorithm to obtain a first control parameter for driving the ball machine to rotate.
Specifically, an existing gun and ball linkage control algorithm is set to be f ([ x ]i,yi]T) It can be seen that the first control parameter is: z1=f([xi,yi]T)。
Step 203: an error of the first control parameter is determined.
Specifically, the error of the first control parameter (which may include the error of the first embodiment)i、′iAnd/or sigmai) The determination of (b) can be accomplished using any of the schemes described above for determining the error of an existing gun and ball linkage control algorithm, or can be combinedAnd (3) performing the treatment, wherein the treatment is not particularly limited.
Step 204: fitting and calibrating the existing gun and ball linkage control algorithm according to the error to obtain a calibrated gun and ball linkage control algorithm f' ([ x)i,yi]T)。
Specifically, a description will be given taking, as an example, a first solution of determining an error of an existing gun and ball linkage control algorithm from a dimension of a positional relationship between a gun camera monitor image and a ball camera monitor image. F' ([ x ]) when calibrating the existing gun-ball linkage control algorithmi,yi]T) May be based on a calibrated control correction function [ x'i,y′i]T=gpos([xi,yi]T) To be determined. In particular, according to [ x ]i,yi]And control the correction function gpos([xi,yi]T) Determining the position coordinate of the ball machine in the gun camera monitoring image as [ x ]i,yi]The method includes the steps of (1) determining a coordinate [ x ' in a gun camera monitoring image corresponding to a preset position (for example, a center position in the ball camera monitoring image) of the ball camera monitoring image according to the actual position corresponding relation when the monitoring target is tracked, wherein the monitoring target is located in a position coordinate in the ball camera monitoring image, and determining the coordinate [ x ' in the gun camera monitoring image corresponding to the preset position (for example, the center position in the ball camera monitoring image) of 'i,y′i]TFurther, according to the formula [ x'i,y′i]TAnd determining an angle signal (for example, the angle signal may include a horizontal rotation angle and a pitching rotation angle) which is required to drive the ball machine to rotate according to the existing gun-ball linkage control algorithm and the current position state (for example, the horizontal angle and the pitching angle) of the ball machine as a second control parameter for controlling the ball machine to rotate.
Similarly, the existing gun and ball linkage control algorithm can be calibrated by adopting a scheme of determining the error of the existing gun and ball linkage control algorithm from the position relation dimension of the gun camera monitoring image and the dome camera monitoring image.
When adopted, isWhen the existing gun-ball linkage control algorithm is calibrated according to the scheme for determining the error of the existing gun-ball linkage control algorithm from the dimension of the driving rotation angle of the dome camera, the control function obtained after calibration can be: theta'i=gθ([xi,yi]T) As f' ([ x ]i,yi]T)。
Step 205: according to a calibrated gun-ball linkage control algorithm f' ([ x ]i,yi]T) And the pixel coordinate of the monitored target in the gun bolt monitoring image is [ x ]i,yi]TAnd controlling the ball machine to rotate so as to enable the monitoring target to be located at a preset position in the monitoring image of the ball machine.
Specifically, in the first embodiment, how to control the rotation angle of the ball machine according to the gun and ball linkage control algorithm has been described in detail, and details are not repeated here.
During fitting calibration of the gun and ball linkage control algorithm, a large number of people or objects can be collected in the gun bolt monitoring image to serve as monitoring targets, and step 202, step 203 and step 204 are executed to perform fitting calibration of gun and ball linkage control parameters (functions) based on the large number of monitoring targets.
When the error of the gun-ball linkage control parameter (function) after fitting calibration is smaller than a certain threshold value, fitting calibration can be considered to be completed, and the ball machine can be controlled to rotate directly according to the calibrated gun-ball linkage control parameter (function) without executing the step 202, the step 203 and the step 204. Of course, in order to obtain higher tracking accuracy of the ball machine, the gun-ball linkage control parameters (functions) can be calibrated in real time.
Based on the same application concept, the embodiment of the application also provides a device controlled by the monitoring device, and as the principle of solving the problems of the device is similar to the method for controlling the monitoring device, the implementation of the device can refer to the implementation of the method, and repeated parts are not described again.
Fig. 3 is a schematic structural diagram of a device controlled by a monitoring device in an embodiment of the present application, and as shown in fig. 3, the device controlled by the monitoring device may include:
a determining unit 301, configured to determine a monitoring target in the bolt face monitoring image;
the driving unit 302 is used for driving the ball machine to rotate according to the first control parameter; the first control parameter is determined according to a preset gun and ball linkage control algorithm;
the determining unit 301 is further configured to determine an error of the first control parameter; the error is determined according to the corresponding relation between the reference position and the actual position; or, the first adjustment angle of the dome camera determined according to the first control parameter and the second adjustment angle corresponding to the position of the monitoring target in the monitoring image of the dome camera are determined; the reference position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined according to the preset gun and ball linkage control algorithm after the dome camera is driven to rotate according to a first control parameter; the actual position corresponding relation is the position relation between the gunlock monitoring image and the dome camera monitoring image determined based on feature point matching after the dome camera is driven to rotate according to the first parameter;
the calibration unit 303 is configured to perform fitting calibration on the preset gun and ball linkage control algorithm according to the error to obtain a corrected gun and ball linkage control algorithm;
the determining unit 301 is further configured to determine a second control parameter according to the modified gun and ball linkage control algorithm and the determined monitoring target in the bolt machine monitoring image;
and the control unit 304 is configured to control the dome camera to rotate according to the second control parameter, so that the monitoring target is located at a preset position in the monitoring image of the dome camera.
In an implementation, the calibration unit may be further configured to perform initial calibration on the bolt and the ball machine before determining the feature points in the bolt monitoring image.
In implementation, the calibration unit may be specifically configured to determine a first position of the sight center point of the dome camera in the bolt face monitoring image; determining the position offset of the first position and the initial position of the sight line of the gun camera monitoring image according to the first position and the initial position of the sight line of the gun camera monitoring image; driving the ball machine to rotate to reduce the position offset; and when the position deviation is determined to be smaller than the threshold value, finishing the initialization calibration of the gunlock and the dome camera.
In an implementation, the determining unit may be specifically configured to determine a position S of the monitoring target in the bolt face monitoring image; after the ball machine is driven to rotate according to the first control parameter, determining a position S' in the gun camera monitoring image corresponding to a preset position in the ball machine monitoring image according to the actual position corresponding relation; determining the error according to the position S and the position S'; or,
and determining a position M of a monitoring target in the monitoring image of the dome camera after the dome camera is driven to rotate according to the first control parameter, and determining the error according to the position M and a preset position in the monitoring image of the dome camera.
In implementation, the determining unit may be specifically configured to acquire feature points in the gun camera monitoring image and the dome camera monitoring image; matching the characteristic points in the gunlock monitoring image and the dome camera monitoring image; and determining the corresponding relation of the actual positions according to the positions of the matched characteristic point pairs.
In an implementation, the apparatus controlled by the monitoring apparatus may further include:
the scale/rotation unit is used for reducing the scale of the dome camera monitoring image to be the same as the scale of the gun camera monitoring image before acquiring the characteristic points in the gun camera monitoring image and the dome camera monitoring image; or,
and rotating the gun camera monitoring image or the ball machine monitoring image so as to enable the gun camera monitoring image and the ball machine monitoring image to keep the same visual angle.
In an implementation, the determining unit may be specifically configured to acquire the feature point from an area in which the position of the monitoring target is located in the gun camera monitoring image and the visual field range is one to three times that of the dome camera.
In an implementation, the determining unit may be specifically configured to determine positions of the matched feature point pairs in the images of the gun camera and the ball machine monitor; and determining the corresponding relation of the actual positions according to the positions of the matched characteristic points in the images monitored by the gunlock and the dome camera.
In implementation, the actual position corresponding relationship may be represented as a matrix H, where the matrix H satisfies:
wherein,andrespectively, the homogeneous pixel coordinates of the feature points in the monitoring images of the gun camera and the dome camera, H is a homography matrix H ∈ R3 × 3。
In an implementation, the apparatus controlled by the monitoring apparatus may further include:
and the characteristic point removing unit is used for removing the characteristic point pairs which are matched incorrectly from the matched characteristic point pairs before determining the positions of the matched characteristic point pairs in the images of the gunlock and the ball machine monitoring image.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.