Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a method and an apparatus for locating geographic coordinates of a target object based on video monitoring, which are used to solve the technical problem that automatic identification, location, and early warning of the target object cannot be achieved in the prior art.
In one aspect, the method for locating the geographic coordinates of the target object based on video monitoring comprises the following steps:
acquiring the position information of a camera relative to the ground;
the method comprises the steps that a camera acquires a video picture image in real time, and pixel coordinates of a target object are calculated for the currently acquired image;
calculating the vertical azimuth angle and the horizontal azimuth angle of the target object relative to the camera;
and calculating the geographic coordinates of the target object according to the position information of the camera and the vertical azimuth angle and the horizontal azimuth angle.
Further, the method comprises the following steps:
and carrying out spatial analysis on the geographic coordinate of the target object and the farmland data, if the target object operates on the farmland or the basic farmland, indicating that the current target object possibly has illegal behaviors of destroying the farmland, and setting the geographic coordinate of the current target object as an early warning point.
Further, if the early warning points calculated for multiple times are in the same area, the early warning points are judged to be repeated.
Further, the position information of the camera relative to the ground is
Wherein
Being the coordinates of the ground plane on which the camera is located,
for the elevation of the camera from the ground, the camera being vertically oriented at an azimuth angle of
Horizontal azimuth angle of the camera is
(ii) a The specific process of calculating the geographic coordinates of the target object is as follows:
calculating the horizontal distance of the target object from the camera
,
;
Calculating geographic coordinates of a target object
Wherein
。
Further, the vertical azimuth angle of the camera
Horizontal azimuth angle of the camera
(ii) a Wherein
The vertical azimuth angle of the current central ray of the camera,
half the current vertical viewing angle of the camera, H is half the image height,
is the half angle of the current horizontal view angle of the camera, W is half the picture width,
is the pixel coordinates of the target object in the image.
In another aspect, the video surveillance-based target object geographic coordinate locating device comprises:
a position information acquisition unit for acquiring position information of the camera relative to the ground;
the pixel coordinate calculation unit is used for acquiring a video picture image in real time by the camera and calculating the pixel coordinate of the target object for the currently acquired image;
an angle calculation unit for calculating a vertical azimuth angle and a horizontal azimuth angle of the target object with respect to the camera;
and the geographic coordinate calculation unit is used for calculating the geographic coordinate of the target object according to the position information of the camera and the vertical azimuth angle and the horizontal azimuth angle.
Further, the apparatus further comprises:
and the early warning unit is used for carrying out spatial analysis on the geographic coordinate of the target object and the cultivated land data, if the target object operates on cultivated land or basic farmland, the current target object possibly has illegal behaviors of destroying the cultivated land, and the geographic coordinate of the current target object is set as an early warning point.
Further, the early warning unit is further configured to determine that the early warning point is a repeated early warning point if the early warning points calculated for multiple times are in the same area.
Further, the position information of the camera relative to the ground is
Wherein
Being the coordinates of the ground plane on which the camera is located,
for the elevation of the camera from the ground, the camera being vertically oriented at an azimuth angle of
Horizontal azimuth angle of the camera is
(ii) a The geographic coordinate calculation unit includes:
a distance calculation module for calculating the horizontal distance of the target object from the camera
,
;
A geographic coordinate calculation module for calculating geographic coordinates of the target object
Wherein
。
Further, the vertical azimuth angle of the camera
Horizontal azimuth angle of the camera
(ii) a Wherein
The vertical azimuth angle of the current central ray of the camera,
half the current vertical viewing angle of the camera, H is half the image height,
is the half angle of the current horizontal view angle of the camera, W is half the picture width,
is the pixel coordinates of the target object in the image.
The invention has the beneficial effects that: the invention constructs a geographic coordinate calculation model for monitoring a target object, because the position and the posture of a monitoring camera can be fixed, the geodetic plane coordinate and the elevation of the camera can be accurately measured when the camera is installed, the posture of the camera is leveled, and the geographic coordinate of the target object can be directly calculated according to the vertical azimuth angle, the horizontal azimuth angle and the half angle of the visual field angle of the camera, so that the problem that the camera is limited by field calibration is avoided, the operation cost is reduced, the precision loss caused by uncertain factors of field calibration is avoided, and the calculation efficiency and precision are improved; then, by combining the target intelligent identification technology, the problems of monitoring, identification, positioning, early warning and the like of the current natural resource monitoring can be effectively solved, and the labor cost of land law enforcement work is greatly reduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
The first embodiment is as follows:
fig. 1 shows a flow of a method for locating geographic coordinates of a target object based on video surveillance according to an embodiment of the present invention, and only the portions related to the embodiment of the present invention are shown for convenience of description.
As shown in fig. 1, the method for locating geographic coordinates of a target object based on video surveillance provided by this embodiment includes the following steps:
and step S1, acquiring the position information of the camera relative to the ground.
It is first necessary to level the camera. The camera is arranged on the iron tower or the video pole, the bubble is centered by using the level pipe, and the camera is ensured to be parallel to the ground level surface.
After the camera is installed and leveled, the position information, namely the position coordinates, of the camera relative to the ground is obtained. For example, the measurement can be performed by an RTK (Real-time kinematic) device, which is a satellite navigation technology and is widely applied in the measurement industry, and the specific measurement method is not described herein. Position coordinates are set as
Wherein
Being the coordinates of the ground plane on which the camera is located,
the elevation of the camera from the ground.
Step S2, the camera acquires a video picture image in real time, and calculates the pixel coordinates of the target object for the currently acquired image.
The camera can acquire a video stream in real time, the video is composed of continuous picture images, and the images can be acquired at fixed time. For the currently acquired image, a target object is firstly identified from the image, the target object is generally mechanical equipment such as an excavator, a bulldozer and the like, and the specific identification method can be used for identifying through an artificial intelligence deep learning algorithm. The deep learning mainly comprises the steps of learning a sample picture to generate a classifier, and then inputting a current image into the classifier to automatically identify whether the current image has a target object. Deep learning is also a common identification method at present, and the specific process is not repeated in this step.
Fig. 2 shows an image obtained by a camera, in which an excavator is present, and the identification algorithm can identify whether the excavator is present in the image and the position of the excavator in the image. In the step, the pixel coordinates of the excavator in the image are calculated
. In this embodiment, after the target object is identified, the coordinates of the central pixel of the identification frame may be regarded as the pixel coordinates of the target object in this step. Other ways may be used, such as identifying the middle point of the bottom edge of the frameThe pixel coordinates of the positions are regarded as the pixel coordinates of the target object. The present embodiment includes but is not limited to these ways.
A schematic view of the camera shot as shown in fig. 3. In the figure, the position of the upper end of the main shaft,
is a camera hole of the camera and is provided with a camera,
is composed of
In the projection on the ground plane, the pixel coordinates of the target object are marked P, and the
mark 100 is the monitoring range of the camera to the ground.
Step S3, calculating the vertical azimuth angle and the horizontal azimuth angle of the target object relative to the camera.
As shown in fig. 4, M and N are boundary points where the vertical field of view of the camera intersects with the upper and lower sides of the monitoring range, respectively. The minimum angle and the maximum angle of the current vertical visual field are respectively
And
。
in the formula (I), the compound is shown in the specification,
for the ground ray between the ray OM and the camera under the vertical view
The angle of,
for rays ON in vertical field of view and ground rays in camera distance
The angle of,
the vertical azimuth angle of the current central ray of the camera,
at half angle of the current vertical viewing angle, i.e.
Half of that.
As shown in FIG. 5, in the camera imaging, the camera hole is at the center of the formed image
The position in the image is
,
Is the position in the image at the time of imaging of the target object P,
and
respectively, the boundary points of the imaging range of the vertical visual field of the camera on the image. According to the pixel
Coordinates of (2)
Can deduce
And
the specific process of the included angle is as follows:
triangle shape
Calculating a triangle base angle according to triangle corners and theorem as an isosceles triangle:
calculating the length of the triangle waist according to the cosine function:
where H is half the image height.
Calculating pixels according to the cosine theorem
Distance to the camera hole
:
Due to the fact that
,
Thus, therefore, it is
。
Finally, according to the cosine theorem, calculating
And
angle of (2)
:
Wherein H is half of the height of the image,
the half angle of the current vertical viewing angle of the camera,
is the y coordinate of the target object P in the image.
So that the vertical azimuth angle of the camera can be calculated
To do so
,
Thus finally obtaining
。
The horizontal azimuth calculation principle is consistent with the vertical azimuth principle, and the following can be obtained:
。
wherein W is half the image width,
the half angle of the current horizontal viewing angle of the camera,
is the x-coordinate of the target object P in the image.
And step S4, calculating the geographic coordinates of the target object according to the position information of the camera and the vertical azimuth angle and the horizontal azimuth angle.
Firstly, the horizontal distance between the target object P and the camera is calculated
,
;
The elevation of the camera from the ground is used, so that the distance L from the target object to the ground projection point of the camera can be calculated according to the vertical azimuth angle. Then is provided with
As the center of circle, make a circle with L as the radius, and then use
And (4) extracting rays of a horizontal azimuth angle, wherein the intersection point is the geographic coordinate of the target object. Therefore, it can be seen that:
geographical coordinates of a target object
Wherein
。
The geodetic coordinates of the location of the camera.
And step S5, monitoring and early warning.
And carrying out spatial analysis on the geographic coordinate of the target object and the farmland data, if the target object operates on the farmland or the basic farmland, indicating that the current target object possibly has illegal behaviors of destroying the farmland, and setting the geographic coordinate of the current target object as an early warning point. Particularly, if the early warning points calculated for multiple times are in the same area, the early warning points are judged to be repeated, and the area is more an area needing to be patrolled. These early warning points may be displayed in a map interface according to geographic coordinates, such as the early warning interface example shown in fig. 6.
Under the monitoring of an iron tower camera and a video pole, the geographical coordinates of a target object are calculated through the ground plane coordinates, the elevation, the vertical azimuth angle, the horizontal azimuth angle, the vertical visual field angle and the horizontal visual field angle of the camera, so that the problems of target positioning and automatic early warning in natural resource monitoring are solved, the full-automatic target identification, positioning and early warning are realized, and the labor cost of the natural resource monitoring is reduced.
Example two:
fig. 7 shows the structure of the target object geographic coordinate positioning apparatus based on video surveillance provided by the embodiment of the present invention, and only the parts related to the embodiment of the present invention are shown for convenience of illustration.
The video monitoring-based target object geographic coordinate positioning device provided by the embodiment comprises:
a position information acquisition unit 1 for acquiring position information of a camera relative to the earth;
the pixel coordinate calculation unit 2 is used for acquiring a video picture image in real time by the camera and calculating the pixel coordinate of a target object for the currently acquired image;
an angle calculation unit 3 for calculating a vertical azimuth angle and a horizontal azimuth angle of the target object with respect to the camera;
and the geographic coordinate calculation unit 4 is used for calculating the geographic coordinate of the target object according to the position information of the camera and the vertical azimuth angle and the horizontal azimuth angle.
As a preferred structure, the apparatus further comprises:
and the early warning unit 5 is used for carrying out spatial analysis on the geographical coordinates of the target object and the cultivated land data, if the target object operates on cultivated land or basic farmland, the current geographical coordinates of the target object are set as early warning points, and illegal behaviors of destroying the cultivated land are indicated. The early warning unit is also used for judging as a repeated early warning point if the early warning points calculated for multiple times are in the same area.
The functional units 1 to 5 correspondingly implement steps S1 to S5 in the first embodiment, and detailed implementation procedures thereof are not described again.
In the above configuration, the position information of the camera with respect to the ground is
Wherein
Being the coordinates of the ground plane on which the camera is located,
for the elevation of the camera from the ground, the camera being vertically oriented at an azimuth angle of
Horizontal azimuth angle of the camera is
(ii) a The geographic coordinate calculation unit includes:
a distance calculation module for calculating the horizontal distance of the target object from the camera
,
;
A geographic coordinate calculation module for calculating geographic coordinates of the target object
Wherein
。
Vertical azimuth angle of the camera
Horizontal azimuth angle of the camera
(ii) a Wherein
The vertical azimuth angle of the current central ray of the camera,
half the current vertical viewing angle of the camera, H is half the image height,
is the half angle of the current horizontal view angle of the camera, W is half the picture width,
is the pixel coordinates of the target object in the image.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.