Laser spot positioning method, distance measuring method, medium and equipment applied to security monitoring

文档序号:1886956 发布日期:2021-11-26 浏览:14次 中文

阅读说明:本技术 应用于安防监控的激光光斑定位方法、测距方法、介质及设备 (Laser spot positioning method, distance measuring method, medium and equipment applied to security monitoring ) 是由 杨伟亮 陈志强 陈利军 于 2021-08-31 设计创作,主要内容包括:本发明公开了一种应用于安防监控的激光光斑定位方法,包括:通过调整安装距离使激光光斑落在视频画面中心,确定激光设备的物理位置并固定这个物理位置,获取第一激光光斑图像;通过校准激光设备使激光光斑偏离视频画面中心,获取校准距离及第二激光光斑图像;根据所述第一激光光斑图像和第二激光光斑图像确定像素偏离值;通过安装距离和激光测距距离D3确定待测激光光斑的水平像素补偿系数k-(x)和垂直方向补偿系数,进而得到1倍倍率下待测激光光斑在视频画面上的光斑坐标,将所述光斑坐标转换为待测激光光斑对应的摄像机在1倍倍率下的水平方向角和垂直方向角;再根据所述水平方向角和垂直方向角,获取在任意倍率下待测激光光斑在视频画面上的光斑坐标。本发明实现了在现有视频安防监控上准确获取激光光斑在视频画面中的位置信息,提升了激光光斑的定位精度,提高了对激光光斑定位的自动化程度。(The invention discloses a laser spot positioning method applied to security monitoring, which comprises the following steps: the method comprises the steps of enabling a laser spot to fall on the center of a video picture by adjusting the installation distance, determining the physical position of laser equipment, fixing the physical position, and obtaining a first laser spot image; enabling the laser spot to deviate from the center of the video picture through the calibration laser equipment, and acquiring a calibration distance and a second laser spot image; determining a pixel deviation value according to the first laser spot image and the second laser spot image; determining the horizontal pixel compensation coefficient k of the laser spot to be measured through the installation distance and the laser ranging distance D3 x And compensating the coefficient in the vertical direction to obtain the spot coordinates of the laser spot to be detected on the video picture under 1-time magnification, and converting the spot coordinates into the camera corresponding to the laser spot to be detectedA horizontal direction angle and a vertical direction angle at 1 time magnification; and acquiring the spot coordinates of the laser spot to be detected on the video picture under any multiplying power according to the horizontal direction angle and the vertical direction angle. The invention realizes the accurate acquisition of the position information of the laser spot in the video picture on the existing video security monitoring, improves the positioning precision of the laser spot and improves the automation degree of the laser spot positioning.)

1. A laser spot positioning method applied to security monitoring is characterized by comprising the following steps:

acquiring a mounting distance and a first laser spot image, wherein the first laser spot image is an image of a video picture center over against a laser spot acquired when the mounting position of the laser equipment is adjusted according to the mounting distance under the magnification of 1 time;

acquiring a calibration distance and a second laser spot image, wherein the second laser spot image is an image of a laser spot deviating from the center of a video frame acquired when laser equipment is calibrated according to the calibration distance after the installation position is fixed;

acquiring a pixel deviation value according to the installation distance, the first laser spot image, the calibration distance and the second laser spot image, wherein the pixel deviation value represents a pixel difference value of the laser spot relative to the center of the video picture;

acquiring a laser ranging distance of a laser device generating a laser spot to be measured under any multiplying power;

acquiring a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under 1 time of multiplying power according to the installation distance, the laser ranging distance and the pixel deviation value;

and acquiring the spot coordinates of the laser spot to be detected on the video picture under any multiplying power according to the horizontal direction angle and the vertical direction angle.

2. The laser spot positioning method applied to security monitoring of claim 1, wherein the obtaining of the horizontal direction angle and the vertical direction angle of the camera corresponding to the laser spot to be detected at 1-fold magnification according to the installation distance, the laser ranging distance, and the pixel deviation value comprises:

acquiring a spot coordinate of the laser spot to be detected under 1-time magnification according to the installation distance, the laser ranging distance and the pixel deviation value;

and converting the spot coordinates of the laser spot to be detected under the magnification of 1 time into a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under the magnification of 1 time.

3. The laser spot positioning method applied to security monitoring of claim 2, wherein the obtaining of the spot coordinates of the laser spot to be detected under 1-time magnification according to the installation distance, the laser ranging distance, and the pixel deviation value comprises:

according to the installation distance D1Laser ranging distance D3Calculating the horizontal pixel compensation coefficient k of the laser spot to be detectedxAnd a vertical direction compensation coefficient kyWhereinkx=nkyN represents the aspect ratio of the video picture;

according to the coordinates (X) of the video picture center0,Y0) Horizontal pixel compensation coefficient kxVertical pixel compensation coefficient kyAnd obtaining the spot coordinates (X) of the laser spot to be detected under 1 time magnification by the pixel deviation values (delta X, delta y)1,Y1) Wherein X is1=X0+△x*kx,Y1=Y0+△y*ky

4. The laser spot positioning method applied to security monitoring of claim 3, wherein the step of converting the spot coordinates of the laser spot to be detected at 1-time magnification into the horizontal direction angle and the vertical direction angle of the camera corresponding to the laser spot to be detected at 1-time magnification comprises:

acquiring horizontal field angle H and vertical field angle V of the camera, and coordinates (X) of the center of the video image0,Y0) And the corresponding physical included angle (P, T) of the camera and the spot coordinate (X) of the laser spot to be measured under 1 time of multiplying power1,Y1)。

According to the horizontal field angle H and the vertical field angle V of the camera and the coordinate (X) of the center of the video picture0,Y0) And the corresponding physical included angle (P, T) of the camera is used for measuring the spot coordinate (X) of the laser spot to be measured under 1 time of multiplying power1,Y1) Component X of the transverse axis1Converted into a horizontal direction angle P1 and a vertical axis component Y1Conversion to the vertical direction angle T1;

wherein the content of the first and second substances,

5. the laser spot positioning method applied to security monitoring of claim 4, wherein the obtaining of the spot coordinates of the laser spot to be detected on the video image at any magnification according to the horizontal direction angle and the vertical direction angle comprises:

acquiring horizontal field angle H and vertical field angle V of the camera, and coordinates (X) of the center of the video image0,Y0) And the corresponding physical included angle (P, T) of the camera, and the horizontal direction angle P1 and the vertical direction angle T1 of the camera under 1 time magnification;

according to the horizontal field angle H of the camera and the coordinate (X) of the center of the video picture0,Y0) And the corresponding physical included angle (P, T) of the camera, namely the horizontal direction angle P1 of the camera under 1-time magnification is converted into the horizontal axis component X of the spot coordinate of the laser spot to be detected on the video picture under any magnification2Wherein, when X0>X2When the temperature of the water is higher than the set temperature,when X is present0<X2When the temperature of the water is higher than the set temperature,

according to the vertical field angle V of the camera and the coordinate (X) of the center of the video picture0,Y0) And the corresponding physical included angles (P, T) of the cameras, namely the vertical direction angle T1 of the camera under 1-time magnification is converted into the longitudinal axis component Y of the spot coordinate of the laser spot to be detected on the video picture under any magnification2Wherein when Y is0>Y2When the temperature of the water is higher than the set temperature,when Y is0<Y2When the temperature of the water is higher than the set temperature,

6. the laser spot positioning method applied to security monitoring of any one of claims 1 to 5, wherein the installation distance is greater than 3.5 meters.

7. A laser spot ranging method applied to security monitoring is characterized by comprising the following steps:

respectively acquiring laser ranging distances of a first laser spot to be measured and a second laser spot to be measured at any multiplying power, and a horizontal direction angle and a vertical direction angle of a camera at 1 multiplying power, wherein the horizontal direction angle and the vertical direction angle of the camera at 1 multiplying power corresponding to the first laser spot to be measured and the second laser spot to be measured are respectively obtained by the laser spot positioning method applied to security monitoring as claimed in any one of claims 1 to 6;

and calculating the distance between the first to-be-detected laser spot and the second to-be-detected laser spot according to the laser ranging distance between the first to-be-detected laser spot and the second to-be-detected laser spot under any multiplying power, and the horizontal direction angle and the vertical direction angle of the camera under 1 multiplying power.

8. The laser spot ranging method applied to security monitoring of claim 7, wherein the calculating of the distance between the first to-be-measured laser spot and the second to-be-measured laser spot according to the laser ranging distance between the first to-be-measured laser spot and the second to-be-measured laser spot at any magnification and the horizontal direction angle and the vertical direction angle of the camera at 1 magnification comprises:

respectively calculating the difference delta P ═ P between the horizontal direction angles of the cameras corresponding to the first laser spot to be detected and the second laser spot to be detected under the condition of 1 time of multiplying power2-P1The difference between | and the vertical angle Δ T | T2-T1|;

Calculating the horizontal distance L between the first laser spot to be detected and the second laser spot to be detected according to the laser ranging distance between the first laser spot to be detected and the second laser spot to be detected under any multiplying power and the difference between the horizontal direction anglesxWherein

Calculating the vertical distance L between the first laser spot to be detected and the second laser spot to be detected according to the laser ranging distance between the first laser spot to be detected and the second laser spot to be detected under any multiplying power and the difference of the vertical direction anglesyWherein

According to the horizontal distance LxAnd a vertical distance LyObtaining the distance between the first laser spot to be detected and the second laser spot to be detected;

wherein L is1Showing the laser ranging distance, P, of the first laser spot to be measured at any magnification1Represents the horizontal direction angle L of the camera corresponding to the first laser spot to be measured under 1 time of multiplying power2Represents the laser ranging distance, P, of the second laser spot to be measured under any multiplying power2Represents the horizontal direction angle T of the camera corresponding to the second laser spot to be measured under 1 time of multiplying power1The vertical direction angle T of the camera corresponding to the first laser spot to be measured under 1 time of multiplying power2And the vertical direction angle of the camera corresponding to the second laser spot to be detected under 1-time magnification is shown.

9. A computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the laser spot location method for security monitoring according to any one of claims 1 to 6 or the laser spot ranging method for security monitoring according to any one of claims 7 to 8.

10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements the laser spot location method for security monitoring of any one of claims 1 to 6 or the laser spot ranging method for security monitoring of any one of claims 7 to 8.

Technical Field

The invention relates to the field of video security monitoring, in particular to a laser spot positioning method, a distance measuring method, a medium and equipment applied to security monitoring.

Background

With the development of security industry, the technology of monitoring equipment is more mature, and the technical requirements of users on the monitoring equipment are also more improved. However, the existing security monitoring products do not integrate the laser ranging function, the position information of the laser spot in the video picture cannot be accurately acquired, and the positioning accuracy of the laser spot is low. If the distance from the monitoring equipment to the monitored object needs to be measured, an external tool needs to be used, the distance needs to be manually measured on the monitoring equipment installation site, the automation degree is low, the working efficiency is low, meanwhile, the measuring precision cannot be guaranteed, and the side length and the height of the object cannot be measured.

Disclosure of Invention

The embodiment of the invention provides a laser spot positioning method, a distance measuring method, a medium and equipment applied to security monitoring, and aims to solve the problems that the position information of a laser spot in a video picture cannot be accurately acquired in the conventional video security monitoring, the automation degree is low, the monitoring efficiency is low, and the precision cannot be guaranteed.

A laser spot positioning method applied to security monitoring comprises the following steps:

acquiring a mounting distance and a first laser spot image, wherein the first laser spot image is an image of a video picture center over against a laser spot acquired when the mounting position of the laser equipment is adjusted according to the mounting distance under the magnification of 1 time;

acquiring a calibration distance and a second laser spot image, wherein the second laser spot image is an image of a laser spot deviating from the center of a video frame acquired when laser equipment is calibrated according to the calibration distance after the installation position is fixed;

acquiring a pixel deviation value according to the installation distance, the first laser spot image, the calibration distance and the second laser spot image, wherein the pixel deviation value represents a pixel difference value of the laser spot relative to the center of the video picture;

acquiring a laser ranging distance of a laser device generating a laser spot to be measured under any multiplying power;

acquiring a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under 1 time of multiplying power according to the installation distance, the laser ranging distance and the pixel deviation value;

and acquiring the spot coordinates of the laser spot to be detected on the video picture under any multiplying power according to the horizontal direction angle and the vertical direction angle.

Optionally, the obtaining, according to the installation distance, the laser ranging distance, and the pixel deviation value, a horizontal direction angle and a vertical direction angle of the camera corresponding to the laser spot to be measured at 1-time magnification includes:

acquiring a spot coordinate of the laser spot to be detected under 1-time magnification according to the installation distance, the laser ranging distance and the pixel deviation value;

and converting the spot coordinates of the laser spot to be detected under the magnification of 1 time into a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under the magnification of 1 time.

Optionally, the obtaining, according to the installation distance, the laser ranging distance, and the pixel deviation value, the spot coordinate of the laser spot to be measured at a magnification of 1 time includes:

according to the installation distance D1Laser ranging distance D3Calculating the horizontal pixel compensation coefficient k of the laser spot to be detectedxAnd a vertical direction compensation coefficient kyWhereinkx=nkyN represents the aspect ratio of the video picture;

according to the coordinates (X) of the video picture center0,Y0) Horizontal pixel compensation coefficient kxVertical pixel compensation coefficient kyAnd obtaining a spot coordinate (X) of the laser spot to be detected under 1 time magnification by the pixel deviation value (delta X, delta y)1,Y1) Wherein,X1=X0+Δx*kx,Y1=Y0+Δy*ky

Optionally, the converting the spot coordinates of the laser spot to be detected under 1-time magnification into a horizontal direction angle and a vertical direction angle of the camera corresponding to the laser spot to be detected under 1-time magnification includes:

acquiring horizontal field angle H and vertical field angle V of the camera, and coordinates (X) of the center of the video image0,Y0) And the corresponding physical included angle (P, T) of the camera and the spot coordinate (X) of the laser spot to be measured under 1 time of multiplying power1,Y1)。

According to the horizontal field angle H and the vertical field angle V of the camera and the coordinate (X) of the center of the video picture0,Y0) And the corresponding physical included angle (P, T) of the camera is used for measuring the spot coordinate (X) of the laser spot to be measured under 1 time of multiplying power1,Y1) Component X of the transverse axis1Converted into a horizontal direction angle P1 and a vertical axis component Y1Conversion to the vertical direction angle T1;

wherein the content of the first and second substances,

optionally, the obtaining, according to the horizontal direction angle and the vertical direction angle, spot coordinates of the laser spot to be detected on the video image at any magnification includes:

acquiring horizontal field angle H and vertical field angle V of the camera, and coordinates (X) of the center of the video image0,Y0) And the corresponding physical included angle (P, T) of the camera, and the horizontal direction angle P1 and the vertical direction angle T1 of the camera under 1 time magnification;

according to the horizontal field angle H of the camera and the coordinate (X) of the center of the video picture0,Y0) And the corresponding physical included angle (P, T) of the camera, namely the horizontal direction angle P1 of the camera under 1-time magnification is converted into the horizontal axis component X of the spot coordinate of the laser spot to be detected on the video picture under any magnification2Wherein, when X0>X2When the temperature of the water is higher than the set temperature,when X is present0<X2When the temperature of the water is higher than the set temperature,

according to the vertical field angle V of the camera and the coordinate (X) of the center of the video picture0,Y0) And the corresponding physical included angles (P, T) of the cameras, namely the vertical direction angle T1 of the camera under 1-time magnification is converted into the longitudinal axis component Y of the spot coordinate of the laser spot to be detected on the video picture under any magnification2Wherein when Y is0>Y2When the temperature of the water is higher than the set temperature,when Y is0<Y2When the temperature of the water is higher than the set temperature,

optionally, the mounting distance is greater than 3.5 meters.

A laser spot ranging method applied to security monitoring comprises the following steps:

respectively obtaining laser ranging distances of a first laser spot to be measured and a second laser spot to be measured at any multiplying power, and a horizontal direction angle and a vertical direction angle of a camera at 1 multiplying power, wherein the horizontal direction angle and the vertical direction angle of the camera at 1 multiplying power corresponding to the first laser spot to be measured and the second laser spot to be measured are respectively obtained by the laser spot positioning method applied to security monitoring;

and calculating the distance between the first to-be-detected laser spot and the second to-be-detected laser spot according to the laser ranging distance between the first to-be-detected laser spot and the second to-be-detected laser spot under any multiplying power, and the horizontal direction angle and the vertical direction angle of the camera under 1 multiplying power.

Optionally, the calculating the distance between the first to-be-measured laser spot and the second to-be-measured laser spot according to the laser ranging distance between the first to-be-measured laser spot and the second to-be-measured laser spot at any magnification, and the horizontal direction angle and the vertical direction angle of the camera at 1-time magnification includes:

respectively calculating the difference delta P between the horizontal direction angles of the cameras corresponding to the first laser spot to be detected and the second laser spot to be detected under the condition of 1 time of multiplying power2-P1The difference between | and the vertical direction angle Δ T | T2-T1|;

Calculating the horizontal distance L between the first laser spot to be detected and the second laser spot to be detected according to the laser ranging distance between the first laser spot to be detected and the second laser spot to be detected under any multiplying power and the difference between the horizontal direction anglesxWherein

Calculating the vertical distance L between the first laser spot to be detected and the second laser spot to be detected according to the laser ranging distance between the first laser spot to be detected and the second laser spot to be detected under any multiplying power and the difference of the vertical direction anglesyWherein

According to the horizontal distance LxAnd a vertical distance LyObtaining the distance between the first laser spot to be detected and the second laser spot to be detected;

wherein L is1Showing the laser ranging distance, P, of the first laser spot to be measured at any magnification1Represents the horizontal direction angle L of the camera corresponding to the first laser spot to be measured under 1 time of multiplying power2Represents the laser ranging distance, P, of the second laser spot to be measured under any multiplying power2Represents the horizontal direction angle T of the camera corresponding to the second laser spot to be measured under 1 time of multiplying power1The vertical direction angle T of the camera corresponding to the first laser spot to be measured under 1 time of multiplying power2And the vertical direction angle of the camera corresponding to the second laser spot to be detected under 1-time magnification is shown.

A computer readable storage medium storing a computer program which, when executed by a processor, implements a laser spot positioning method for security monitoring or a laser spot ranging method for security monitoring as described above.

A computer device comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein when the processor executes the computer program, the laser spot positioning method applied to security monitoring or the laser spot distance measuring method applied to security monitoring is realized.

The method comprises the steps of obtaining a mounting distance and a first laser spot image, wherein the first laser spot image is an image of a video picture center over which a laser spot is directly aligned, which is obtained when the mounting position of laser equipment is adjusted according to the mounting distance under 1-time magnification; acquiring a calibration distance and a second laser spot image, wherein the second laser spot image is an image of a laser spot deviating from the center of a video frame acquired when laser equipment is calibrated according to the calibration distance after the installation position is fixed; acquiring a pixel deviation value according to the installation distance, the first laser spot image, the calibration distance and the second laser spot image, wherein the pixel deviation value represents a pixel difference value of the laser spot relative to the center of the video picture; acquiring a laser ranging distance of a laser device generating a laser spot to be measured under any multiplying power; acquiring a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under 1 time of multiplying power according to the installation distance, the laser ranging distance and the pixel deviation value; acquiring the spot coordinates of the laser spot to be detected on the video picture under any multiplying power according to the horizontal direction angle and the vertical direction angle; therefore, the position information of the laser spot in the video picture can be accurately acquired on the existing video security monitoring, the positioning precision of the laser spot is improved, and the automation degree of laser spot positioning is improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.

Fig. 1 is a flowchart of a laser spot positioning method applied to security monitoring according to an embodiment of the present invention;

FIG. 2(a) is a schematic diagram of the installation distance D1 and the calibration distance D2 according to an embodiment of the present invention; FIG. 2(b) is a schematic diagram of a first laser spot image provided in accordance with one embodiment of the present invention, and FIG. 2(c) is a schematic diagram of a second laser spot image provided in accordance with one embodiment of the present invention;

FIG. 3 is a schematic diagram of laser ranging distance D3 and installation distance D1 according to an embodiment of the present invention;

fig. 4 is a flowchart of step S105 in the laser spot positioning method for security monitoring according to an embodiment of the present invention;

FIG. 5 is a schematic view of a video frame according to an embodiment of the present invention;

fig. 6 is a flowchart of step S106 in the laser spot positioning method applied to security monitoring according to an embodiment of the present invention;

fig. 7 is a flowchart of a laser spot distance measuring method applied to security monitoring according to an embodiment of the present invention;

FIG. 8 is a schematic diagram of a computer device according to an embodiment of the invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The embodiment provides a laser spot positioning method applied to security monitoring, which is used for enabling a laser spot to fall on a video picture by adjusting the installation distance D1The surface center is used for determining the physical position of the laser equipment and fixing the physical position to acquire a first laser spot image; enabling the laser spot to deviate from the center of the video picture through the calibration laser equipment, and obtaining a calibration distance D2 and a second laser spot image; determining a pixel deviation value (Deltax, Deltay) according to the first laser spot image and the second laser spot image; determining a horizontal pixel compensation coefficient k of the laser spot to be measured through the installation distance D1 and the laser ranging distance D3xAnd a vertical direction compensation coefficient kyFurther obtaining the spot coordinate (X) of the laser spot to be measured on the video picture under 1 time magnification1,Y1) The coordinates (X) of the light spot are measured1,Y1) Converting the laser spot to be detected into a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under 1-time magnification; acquiring the spot coordinates of the laser spot to be detected on the video picture under any multiplying power according to the horizontal direction angle and the vertical direction angle; therefore, the position information of the laser spot in the video picture can be accurately acquired on the existing video security monitoring, the positioning precision of the laser spot is improved, and the automation degree of laser spot positioning is improved.

As shown in fig. 1, the laser spot positioning method applied to security monitoring provided in this embodiment is described in detail below, and includes:

in step S101, an installation distance and a first laser spot image are acquired, where the first laser spot image is an image in which a laser spot acquired when the installation position of the laser device is adjusted according to the installation distance at a magnification of 1 time is aligned with the center of a video screen.

Under the magnification of 1 time of the camera, the installation distance D1 is selected according to the embodiment of the invention, and the installation distance D1 is a distance for adjusting the installation position of the laser device so that the laser spot can be directly opposite to the center of a video picture. The farther the installation distance D1 is, the better is, the more preferably the installation distance D1 is, the more preferably the installation distance D is greater than 3.5 m, because the measurement blind area of the laser device is 3.5 m, and if the installation distance D is less than 3.5 m, the laser device cannot measure the distance.

Under the magnification of 1 time, under the installation distance D1, the structural positions of the laser device and the camera are manually adjusted, so that the laser spot is directly opposite to the center of the video picture, and then the physical positions of the camera and the laser device are fixed, and a fixed physical included angle theta is formed at the moment, as shown in figure 2 (a). And capturing a first laser spot image after installation. And in the first laser spot image, the laser spot is over against the center of the video picture. Assuming that the video picture has an aspect ratio of 16:9, a width of 1920 pixels, and a height of 1080 pixels, the center of the video picture is (960,540).

In step S102, a calibration distance and a second laser spot image are obtained, where the second laser spot image is an image of a laser spot that deviates from a center of a video frame and is obtained when the laser device is calibrated according to the calibration distance after the installation position is fixed.

Here, the calibration distance D2 is a distance for calibrating the laser apparatus for the second time, and the calibration distance D2 is smaller than the mounting distance D1. The calibration does not need to change the installation position of the laser equipment, only the pan-tilt head of the camera is rotated, and a calibration distance D2 is measured at the moment. And capturing a second laser spot image after the calibration is finished, wherein the laser spot in the second laser spot image deviates from the center of the video picture.

For convenience of understanding, fig. 2(b) is a schematic diagram of a first laser spot image provided by the embodiment of the present invention, and fig. 2(c) is a schematic diagram of a second laser spot image provided by the embodiment of the present invention.

In step S103, a pixel deviation value is obtained according to the installation distance, the first laser spot image, the calibration distance, and the second laser spot image, where the pixel deviation value represents a pixel difference value of the laser spot relative to the center of the video frame.

Here, in the embodiment of the present invention, a picture analysis tool, such as a drawing tool of windows, is used to compare the first laser spot image and the second laser spot image to obtain how many pixels the second laser spot image deviates from the laser spot of the first laser spot image, so as to obtain a pixel deviation value. The pixel deviation value is composed of a horizontal axis component Δ x and a vertical axis component Δ y.

In step S104, a laser ranging distance at which the laser device generates a laser spot to be measured at any magnification is obtained.

If a point in a video frame needs to be located, for example, an end point of an object, the embodiment of the present invention rotates the pan-tilt of the camera, so that the laser device irradiates the end point to generate a laser spot to be measured on the video frame, and records the laser ranging distance D3 of the laser spot to be measured.

For easy understanding, fig. 3 is a schematic diagram of a laser ranging distance D3 and a mounting distance D1 according to an embodiment of the present invention.

In step S105, a horizontal direction angle and a vertical direction angle of the camera corresponding to the laser spot to be measured at a magnification of 1 time are obtained according to the installation distance, the laser ranging distance, and the pixel deviation value.

Optionally, after the laser ranging distance is acquired at any magnification, in the embodiment of the present invention, the spot coordinate of the laser spot to be measured at 1-fold magnification is first calculated, and then the calculated spot coordinate at 1-fold magnification is converted into the horizontal direction angle and the vertical direction angle of the camera corresponding to the laser spot to be measured at 1-fold magnification. As shown in fig. 4, the step S105 further includes:

in step S401, a spot coordinate of the laser spot to be measured at a magnification of 1 time is obtained according to the installation distance, the laser ranging distance, and the pixel deviation value.

Before calculating the spot coordinates of the laser spot to be measured under the magnification of 1 time, the pixel deviation value needs to be corrected. The step S401 further includes:

in step S501, according to the installation distance D1Laser ranging distance D3Calculating the horizontal pixel compensation coefficient k of the laser spot to be detectedxAnd a vertical direction compensation coefficient kyWhereinkx=nkyAnd n represents the aspect ratio of the video picture.

Specifically, as shown in fig. 3, since the included angle θ is fixed, according to the theorem of similar triangles, there are:thereby obtaining a compensation coefficient in the vertical directionThen, according to the width-height ratio of the video image, the horizontal direction compensation coefficient k is obtainedx=nky. Illustratively, the horizontal direction compensation coefficient is set to be equal to or greater than 16:9 when the aspect ratio of the video picture is 16:9

In step S502, according to the coordinates (X) of the center of the video picture0,Y0) Horizontal pixel compensation coefficient kxVertical pixel compensation coefficient kyAnd obtaining the spot coordinates (X) of the laser spot to be detected under 1 time magnification by the pixel deviation values (delta X, delta y)1,Y1) Wherein X is1=X0+△x*kx,Y1=Y0+△y*ky

Here, the coordinates (X) of the center of the video picture0,Y0) Can be obtained according to the size of the video picture. The horizontal pixel compensation coefficient kxFor correcting the horizontal-axis component Deltax in the pixel deviation value (Deltax, Deltay), the vertical-direction compensation coefficient kyFor correcting the longitudinal component deltay in said pixel deviation values (deltax, deltay). Therefore, the spot coordinate (X) of the laser spot to be measured under 1 time magnification1,Y1) Transverse axis component X of1=X0+△x*kxLongitudinal axis component Y1=Y0+△y*ky

In step S402, the spot coordinates of the laser spot to be measured at 1-time magnification are converted into a horizontal direction angle and a vertical direction angle of the camera corresponding to the laser spot to be measured at 1-time magnification.

The horizontal direction angle and the vertical direction angle of the camera are only related to the position of a tripod head of the camera, and have no relation with the multiplying power. As long as the camera pan-tilt is not moved, the horizontal direction angle and the vertical direction angle at any magnification are consistent with the horizontal direction angle and the vertical direction angle at 1 magnification. According to the embodiment of the invention, the horizontal direction angle and the vertical direction angle of the camera corresponding to the laser spot to be detected under the magnification of 1 time are obtained, so that the position of the laser spot to be detected in a video image under any magnification, namely the spot coordinate, can be conveniently calculated.

Optionally, the step S402 further includes:

in step S601, the horizontal field angle H and the vertical field angle V of the camera, and the coordinates (X) of the center of the video screen are acquired0,Y0) And the corresponding physical included angle (P, T) of the camera and the spot coordinate (X) of the laser spot to be measured under 1 time of multiplying power1,Y1)。

In step S602, coordinates (X) of the center of the video screen are calculated from the horizontal field angle H and the vertical field angle V of the video camera0,Y0) And the corresponding physical included angle (P, T) of the camera is used for measuring the spot coordinate (X) of the laser spot to be measured under 1 time of multiplying power1,Y1) Component X of the transverse axis1Converted into a horizontal direction angle P1 and a vertical axis component Y1Which translates to a vertical direction angle T1.

Wherein the content of the first and second substances,

for easy understanding, fig. 5 is a schematic view of a video frame according to an embodiment of the present invention, wherein a point Q is a video frame origin (0, 0); point O is the center of the video frame and corresponds to the coordinate (X)0,Y0) And (960,540) and the physical included angle of the camera is (P, T), H is the horizontal angle of view of the camera, and V is the vertical angle of view of the camera. The point A is a laser spot to be measured, and the spot coordinate of the point A under 1 time magnification is (X)1,Y1) The horizontal direction angle P1 and the vertical direction angle T1 of the camera corresponding to the laser spot to be measured under 1-time magnification are required, as shown in fig. 5, OE is 960, and OC is 540. OB |960-X1|,AB=|540-Y1L. Approximately, from the proportional relationship between the pixel size, the field angle and the physical angle of the camera, we can obtain:

to obtain

Similarly, according to the proportional relationship between the pixel size, the field angle and the physical angle of the camera, it can be obtained that:

to obtain

It should be noted that:

the origin is Q (0,0), if the coordinates of point A are to the right of the center O (960,540) of the video screen, so X1>960,Y1> 540, in which case OB ═ X1-960,AB=Y1-540. But if point a is to the left of the video picture center O (960,540), then there is X1<960,Y1< 540. When so, OB is 960-X1,AB=540-Y1. So that OB is |960-X1|,AB=|540-Y1|。

In step S106, spot coordinates of the laser spot to be measured on the video image at any magnification are acquired according to the horizontal direction angle and the vertical direction angle.

The laser ranging distance in the step S104 is obtained at any magnification, and after the horizontal direction angle P1 and the vertical direction angle T1 of the camera at 1-time magnification are obtained, the horizontal direction angle P1 and the vertical direction angle T1 of the camera at 1-time magnification need to be converted to obtain the position of the laser spot to be measured at any magnification in the video picture.

As shown in fig. 6, the step S106 further includes:

in step S601, the horizontal field angle H and the vertical field angle V of the camera, and the coordinates of the center of the video screen are acquired(X0,Y0) And the corresponding physical included angle (P, T) of the camera, and the horizontal direction angle P1 and the vertical direction angle T1 of the camera under the magnification of 1 times.

In step S602, the coordinates (X) of the center of the video screen are determined based on the horizontal field angle H of the camera0,Y0) And the corresponding physical included angle (P, T) of the camera, namely the horizontal direction angle P1 of the camera under 1-time magnification is converted into the horizontal axis component X of the spot coordinate of the laser spot to be detected on the video picture under any magnification2Wherein, when X0>X2When the temperature of the water is higher than the set temperature,when X is present0<X2When the temperature of the water is higher than the set temperature,

in step S603, the coordinates (X) of the center of the video screen are determined based on the vertical field angle V of the camera0,Y0) And the corresponding physical included angles (P, T) of the cameras, namely the vertical direction angle T1 of the camera under 1-time magnification is converted into the longitudinal axis component Y of the spot coordinate of the laser spot to be detected on the video picture under any magnification2Wherein when Y is0>Y2When the temperature of the water is higher than the set temperature,when Y is0<Y2When the temperature of the water is higher than the set temperature,

for ease of understanding, the video frame diagram provided in fig. 5 is still adopted, wherein the point Q is the origin of the video frame; point O is the center of the video picture and the corresponding spot coordinate (X)0,Y0) And (960,540) and the physical included angle of the camera is (P, T), H is the horizontal angle of view of the camera, and V is the vertical angle of view of the camera. The point A is a laser spot to be detected, and knowing that the horizontal direction angle P1 and the vertical direction angle T1 of the camera corresponding to the laser spot to be detected under the condition of 1-time magnification, the camera needs to be at any positionLight spot coordinate (X) of laser light spot to be detected in video image under magnification2,Y2) As shown in fig. 5, OE 960 and OC 540 are known. OB |960-X2|,AB=|540-Y2L. Approximately, from the proportional relationship between the pixel size, the field angle and the physical angle of the camera, we can obtain:

can obtain

When 960>X2Then there isWhen 960<X2Then there is

Similarly, according to the proportional relationship between the pixel size, the field angle and the physical angle of the camera, it can be obtained that:

to obtain

When 540>Y2Then there isWhen 540<Y2Then there is

So as to obtain the coordinate information (X) of the laser spot to be measured on the video picture under any multiplying power2,Y2) Thereby realizing the accurate acquisition of the position information of the laser spot in the video picture on the prior video security monitoringAnd the positioning precision and the automation degree of the laser facula are improved.

Optionally, the embodiment of the invention further provides a laser spot distance measurement method applied to security monitoring. As shown in fig. 7, the method includes:

in step S701, laser ranging distances of the first to-be-measured laser spot and the second to-be-measured laser spot at any magnification, and a horizontal direction angle and a vertical direction angle of the camera at 1-fold magnification are respectively obtained.

Here, the laser ranging distance, the horizontal direction angle, and the vertical direction angle are obtained by the above-mentioned method for positioning the laser spot applied to security monitoring, and for details, reference is made to the above description of the embodiments, and details are not repeated here.

In step S702, the distance between the first to-be-detected laser spot and the second to-be-detected laser spot is calculated according to the laser ranging distance between the first to-be-detected laser spot and the second to-be-detected laser spot at any magnification, and the horizontal direction angle and the vertical direction angle of the camera at 1-fold magnification.

Alternatively, if L is used1Showing the laser ranging distance, P, of the first laser spot to be measured at any magnification1Represents the horizontal direction angle L of the camera corresponding to the first laser spot to be measured under 1 time of multiplying power2The laser ranging distance and P of the second laser spot to be measured under any multiplying power2Represents the horizontal direction angle T of the camera corresponding to the second laser spot to be measured under 1 time of multiplying power1The vertical direction angle T of the camera corresponding to the first laser spot to be measured under 1 time of multiplying power2The vertical direction angle of the camera corresponding to the second laser spot to be measured under 1-time magnification is represented, and the step S902 further includes:

respectively calculating the difference delta P ═ P between the horizontal direction angles of the cameras corresponding to the first laser spot to be detected and the second laser spot to be detected under the condition of 1 time of multiplying power2-P1The difference between | and the vertical direction angle Δ T | T2-T1|;

According to the first laser spot to be detected and the second laser spot to be detected under any multiplying powerCalculating the horizontal distance L between the first laser spot to be measured and the second laser spot to be measured according to the laser ranging distance and the difference between the horizontal direction anglesxWherein

Calculating the vertical distance L between the first laser spot to be detected and the second laser spot to be detected according to the laser ranging distance between the first laser spot to be detected and the second laser spot to be detected under any multiplying power and the difference of the vertical direction anglesyWherein

According to the horizontal distance LxAnd a vertical distance LyAnd obtaining the distance between the first laser spot to be detected and the second laser spot to be detected.

In practical application, the first laser spot to be measured can be an end point a of an object in a video picture, the second laser spot to be measured can be another end point B of the object, the distance between the end point a and the end point B, such as height or length information of the object, can be measured by the above distance measuring method applied to the laser spots for security monitoring, and the accuracy of distance measurement is effectively improved; and all the measured data can be visually fed back to the user in a video mode, so that an automatic distance measurement mode based on laser equipment on security monitoring is realized, and the distance measurement efficiency is greatly improved.

It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

In an embodiment, a laser spot positioning device applied to security monitoring is provided, and the laser spot positioning device applied to security monitoring corresponds to the laser spot positioning method applied to security monitoring in the above embodiments one to one.

In an embodiment, a laser spot distance measuring device applied to security monitoring is provided, and the laser spot distance measuring device applied to security monitoring corresponds to the laser spot distance measuring method applied to security monitoring in the above embodiment one to one.

For specific limitations of the laser spot positioning device applied to security monitoring or the laser spot distance measuring device applied to security monitoring, reference may be made to the above limitations of the laser spot positioning method applied to security monitoring or the laser spot distance measuring method applied to security monitoring, which is not described herein again. The various modules in the above-described apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a laser spot positioning method applied to security monitoring or a laser spot ranging method applied to security monitoring.

In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:

acquiring a mounting distance and a first laser spot image, wherein the first laser spot image is an image of a video picture center over against a laser spot acquired when the mounting position of the laser equipment is adjusted according to the mounting distance under the magnification of 1 time;

acquiring a calibration distance and a second laser spot image, wherein the second laser spot image is an image of a laser spot deviating from the center of a video frame acquired when laser equipment is calibrated according to the calibration distance after the installation position is fixed;

acquiring a pixel deviation value according to the installation distance, the first laser spot image, the calibration distance and the second laser spot image, wherein the pixel deviation value represents a pixel difference value of the laser spot relative to the center of the video picture;

acquiring a laser ranging distance of a laser device generating a laser spot to be measured under any multiplying power;

acquiring a horizontal direction angle and a vertical direction angle of a camera corresponding to the laser spot to be detected under 1 time of multiplying power according to the installation distance, the laser ranging distance and the pixel deviation value;

and acquiring the spot coordinates of the laser spot to be detected on the video picture under any multiplying power according to the horizontal direction angle and the vertical direction angle. Alternatively, the first and second electrodes may be,

the processor, when executing the computer program, implements the steps of:

respectively obtaining laser ranging distances of a first laser spot to be measured and a second laser spot to be measured at any multiplying power, and a horizontal direction angle and a vertical direction angle of a camera at 1 multiplying power, wherein the horizontal direction angle and the vertical direction angle of the camera at 1 multiplying power corresponding to the first laser spot to be measured and the second laser spot to be measured are respectively obtained by the laser spot positioning method applied to security monitoring;

and calculating the distance between the first to-be-detected laser spot and the second to-be-detected laser spot according to the laser ranging distance between the first to-be-detected laser spot and the second to-be-detected laser spot under any multiplying power, and the horizontal direction angle and the vertical direction angle of the camera under 1 multiplying power.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.

The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种检测桥梁与支座脱空时主梁倾斜度的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!