CN112669392B - Map positioning method and system applied to indoor video monitoring system - Google Patents
Map positioning method and system applied to indoor video monitoring system Download PDFInfo
- Publication number
- CN112669392B CN112669392B CN202011626031.XA CN202011626031A CN112669392B CN 112669392 B CN112669392 B CN 112669392B CN 202011626031 A CN202011626031 A CN 202011626031A CN 112669392 B CN112669392 B CN 112669392B
- Authority
- CN
- China
- Prior art keywords
- video monitoring
- map
- indoor
- plane
- dimensional
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Closed-Circuit Television Systems (AREA)
Abstract
The present disclosure provides a map positioning method and system applied to an indoor video monitoring system, including: an indoor three-dimensional map is constructed through a visual SLAM technology, and a corresponding relation between the constructed indoor three-dimensional map and an indoor plane structure chart is established; calculating the position and the posture of a video monitoring camera by using a repositioning principle in a visual SLAM technology so as to calculate a homography matrix from a video monitoring picture to a plane structure chart; and converting the target identified and extracted from the video monitoring picture into a plane structure diagram through the space transformation of the homography matrix, and realizing the display and the marking of the target in the plane structure diagram. The method and the device can realize automatic calculation of the position relation between the video monitoring image and the plane structure chart without manual measurement, so that the target in the video monitoring image is marked at the corresponding position in the plane structure chart. Even if the angle of the video monitoring camera is adjusted in the subsequent use process, the map positioning function can be automatically realized.
Description
Technical Field
The disclosure belongs to the technical field of video monitoring, and particularly relates to a map positioning method and system applied to an indoor video monitoring system.
Background
The indoor video monitoring system with the positioning function can display or mark a specific target appearing in video monitoring in an indoor plane structure diagram. In order to mark the target in the video monitoring image in the planar structure diagram, a corresponding relationship between the video monitoring image and the planar structure diagram needs to be established. The method comprises the steps of setting a plurality of map points in space, collecting pixel coordinates of the map points in a video monitoring image, correspondingly measuring the positions of the map points in an actual scene, then corresponding to the positions in a plane structure diagram, and calculating the corresponding relation between the video monitoring image and the plane structure diagram through the map point data, thereby marking the identified and extracted specific target in the video monitoring image at the corresponding position in the plane structure diagram. Usually, this measurement process is performed manually, and in a multi-camera video surveillance system, the process is complicated and time-consuming. If the user adjusts the shooting angle of the camera during the use of the video surveillance system later, the complicated process needs to be performed again.
Disclosure of Invention
The present disclosure is directed to at least one of the technical problems in the prior art, and provides a map positioning method and system for an indoor video surveillance system.
In one aspect of the present disclosure, a map positioning method applied to an indoor video monitoring system is provided, where the method includes:
step S110, constructing an indoor three-dimensional map through a visual SLAM technology:
an indoor three-dimensional map of a video monitoring system control site is constructed through a visual SLAM technology, the indoor three-dimensional map is in a three-dimensional dense point cloud form, an SLAM coordinate system is taken as a world coordinate system, and a key frame image generated in the SLAM process is stored;
step S120, establishing a corresponding relation between the constructed indoor three-dimensional map and an indoor plane structure diagram:
carrying out plane fitting on the ground in the indoor three-dimensional map, taking the plane as a reference plane, projecting the indoor three-dimensional map to the reference plane to form a two-dimensional plane map, respectively finding a plurality of corresponding points corresponding to the same position in the two-dimensional plane map and the plane structure map, and solving the corresponding relation from the two-dimensional plane map to the plane structure map according to the plurality of corresponding points;
step S130, calibrating internal parameters of the video monitoring camera:
calibrating internal parameters of the video monitoring camera in normal work to obtain first calibration parameters, setting the image size of the video monitoring camera to be the same as the image size of a sensor of a visual SLAM, and calibrating the internal parameters of the video monitoring camera with the image size to obtain second calibration parameters;
step S140, calculating external parameters of the video monitoring camera by using the repositioning principle of the visual SLAM technology:
by utilizing the principle of visual SLAM technology relocation, carrying out similarity comparison on a video monitoring image and the stored key frame image sequence, calculating the position and the posture of the video monitoring image under a world coordinate system, namely the external parameters of the video monitoring camera under the current shooting angle, marking the position of the video monitoring camera in the two-dimensional plane map, and converting the position into the plane structure map according to the corresponding relation;
step S150, calculating a homography matrix from the video monitoring picture to the plane structure diagram:
constructing a computer virtual scene, importing the indoor three-dimensional map, setting a display view angle of a virtual camera, setting parameters of the virtual camera as first calibration parameters and external parameters of the video monitoring camera, and enabling the scene in the indoor three-dimensional map displayed at the view angle to correspond to the scene in the picture of the video monitoring camera; randomly selecting some points, called measuring points, from the three-dimensional dense point cloud displayed under the display view angle in the virtual scene to obtain pixel coordinates of the measuring points in the video monitoring picture; projecting the measuring points in the two-dimensional plane graph, and performing spatial transformation on the corresponding relation from the two-dimensional plane graph to the plane structure graph to obtain coordinates of the measuring points in the plane structure graph; the pixel coordinates in the video monitoring picture correspond to the coordinates in the plane structure chart one by one, and the homography matrix from the video monitoring picture to the plane structure chart is calculated;
step S160, in the using process of the video monitoring system, the pixel coordinates of the target on the ground, which are identified and extracted from the video monitoring picture, are converted into the coordinates in the plane structure diagram through the spatial transformation of the homography matrix, so as to realize the marking at the coordinates in the plane structure diagram.
In some optional embodiments, when the shooting angle of view of the video monitoring camera changes, the method further comprises:
recalculating the homography matrix by using the steps S140 and S150, and marking the target in the video monitoring picture in the plane structure diagram by using the step S160.
In some optional embodiments, if the house has no plan structure view, step S140 further includes:
and drawing the plane structure diagram according to the proportional relation of the two-dimensional plane diagram by referring to a real indoor scene.
In some optional embodiments, in step S110, the indoor three-dimensional map is constructed by the ORB-SLAM2 algorithm using Kinect v2 as a visual sensor.
In some optional embodiments, in step S120, the number of the plurality of corresponding points is not less than four; the number of the randomly selected points is not less than four.
In some optional embodiments, in step S150, a random consistent sampling technique is used to calculate the homography matrix from the video surveillance picture to the planar structure picture.
In another aspect of the present disclosure, a map positioning system applied to an indoor video monitoring system is provided, the system including:
the map building module is used for building an indoor three-dimensional map through a visual SLAM technology, and specifically comprises the following steps:
an indoor three-dimensional map of a video monitoring system distribution control place is constructed through a visual SLAM technology, the indoor three-dimensional map is in a three-dimensional dense point cloud form, an SLAM coordinate system is used as a world coordinate system, and a key frame image generated in the SLAM process is stored;
the map mapping module is used for establishing a corresponding relation between the constructed indoor three-dimensional map and the indoor plane structure diagram, and specifically comprises the following steps:
performing plane fitting on the ground in the indoor three-dimensional map, taking the plane as a reference plane, projecting the indoor three-dimensional map to the reference plane to form a two-dimensional plane map, respectively finding a plurality of corresponding points corresponding to the same position in the two-dimensional plane map and the plane structure map, and solving the corresponding relation from the two-dimensional plane map to the plane structure map according to the plurality of corresponding points;
the first calibration module is used for calibrating internal parameters of the video monitoring camera, and specifically comprises the following steps:
calibrating internal parameters of the video monitoring camera in normal work to obtain first calibration parameters, setting the image size of the video monitoring camera to be the same as the image size of a sensor of a visual SLAM, and calibrating the internal parameters of the video monitoring camera with the image size to obtain second calibration parameters;
the second calibration module is used for calculating external parameters of the video monitoring camera by using a repositioning principle of a visual SLAM technology, and specifically comprises the following steps:
by utilizing the principle of visual SLAM technology relocation, similarity comparison is carried out on a video monitoring image and the stored key frame image sequence, the position and the posture of the video monitoring image under a world coordinate system are calculated, namely the external parameters of the video monitoring camera under the current shooting angle are marked in the two-dimensional plane graph, and the video monitoring image is converted into the plane structure graph according to the corresponding relation;
the spatial transformation module is used for calculating a homography matrix from a video monitoring picture to the plane structure chart, and specifically comprises the following steps:
constructing a computer virtual scene, importing the indoor three-dimensional map, setting a display view angle of a virtual camera, setting parameters of the virtual camera as first calibration parameters and external parameters of the video monitoring camera, and enabling the scene in the indoor three-dimensional map displayed at the view angle to correspond to the scene in the picture of the video monitoring camera; randomly selecting some points from the three-dimensional dense point cloud displayed under the display visual angle in the virtual scene to obtain the pixel coordinates of the measuring points in the video monitoring picture; projecting the measuring points in the two-dimensional plane graph, and performing spatial transformation on the corresponding relation from the two-dimensional plane graph to the plane structure graph to obtain coordinates of the measuring points in the plane structure graph; pixel coordinates in the video monitoring picture correspond to coordinates in the plane structure chart one by one, and a homography matrix from the video monitoring picture to the plane structure chart is calculated by adopting a random consistency sampling technology;
the target positioning module is used for identifying and extracting pixel coordinates of a target on the ground from the video monitoring picture in the use process of the video monitoring system, and converting the pixel coordinates into coordinates in the plane structure diagram through the spatial transformation of the homography matrix so as to realize the marking of the coordinates in the plane structure diagram;
and the display and interaction module is used for displaying data such as a map, a measuring point and the like and enabling an operator to interact with the system through input equipment.
In some optional embodiments, when the shooting angle of view of the video surveillance camera changes, the spatial transformation module is further configured to recalculate the homography matrix, and the object location module is further configured to mark the object in the video surveillance picture in the planar structure view again.
In another aspect of the present disclosure, an electronic device is provided, including:
one or more processors;
a storage unit for storing one or more programs which, when executed by the one or more processors, enable the one or more processors to implement the method according to the preceding description.
In another aspect of the disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the method according to the preamble.
The map positioning method and the map positioning system applied to the indoor video monitoring system can realize automatic calibration of the position of the video monitoring camera in an indoor plane structure chart. The position relation between the video monitoring image and the plane structure chart can be automatically calculated without manual measurement, and in the use process in the future, if the shooting angle of the video monitoring camera needs to be changed, the position relation between the video monitoring image and the building plane chart can still be automatically determined, so that the target in the video monitoring image is marked at the corresponding position in the plane structure chart.
Drawings
FIG. 1 is a block diagram of an electronic device according to an embodiment of the disclosure;
fig. 2 is a flowchart of a map positioning method applied to an indoor video surveillance system according to another embodiment of the present disclosure;
fig. 3 is a flowchart of a map positioning method applied to an indoor video surveillance system according to another embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a map positioning system applied to an indoor video surveillance system according to another embodiment of the present disclosure.
Detailed Description
For a better understanding of the technical aspects of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
First, an example electronic device for implementing a map positioning method and system applied to an indoor video monitoring system according to an embodiment of the present disclosure is described with reference to fig. 1.
As shown in FIG. 1, electronic device 200 includes one or more processors 210, one or more memory devices 220, one or more input devices 230, one or more output devices 240, and the like, interconnected by a bus system 250 and/or other form of connection mechanism. It should be noted that the components and structures of the electronic device shown in fig. 1 are exemplary only, and not limiting, and the electronic device may have other components and structures as desired.
The processor 210 may be a Central Processing Unit (CPU), or may be made up of multiple processing cores, or other forms of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 200 to perform desired functions.
Storage 220 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, etc. On which one or more computer program instructions may be stored that a processor may execute to implement the client functionality (implemented by the processor) in the embodiments of the disclosure described below and/or other desired functionality. Various applications and various data, such as various data used and/or generated by the applications, may also be stored in the computer-readable storage medium.
The input device 230 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
The output device 240 may output various information (e.g., images or sounds) to an outside (e.g., a user), and may include one or more of a display, a speaker, and the like.
Next, a map positioning method applied to an indoor video surveillance system according to another embodiment of the present disclosure will be described with reference to fig. 2 and 3.
As shown in fig. 2 and 3, a map positioning method S100 applied to an indoor video surveillance system includes:
and S110, constructing an indoor three-dimensional map through a visual SLAM technology.
Specifically, in this step, the indoor three-dimensional map of the video monitoring system deployment and control site may be constructed by a visual SLAM technique, and the indoor three-dimensional map is in the form of a three-dimensional dense point cloud. And saving the key frame image generated in the SLAM process by using the SLAM coordinate system as a world coordinate system. The vision sensor may employ a depth camera (RGB-D camera). In order to facilitate subsequent automatic calculation of the position and the posture of the video monitoring camera, in the SLAM process, the depth camera collects the video at different angles nearby the video monitoring camera.
As a specific example, in this step, a Kinect v2 may be used as a vision sensor to map the room by the ORB-SLAM2 algorithm.
And S120, establishing a corresponding relation between the constructed indoor three-dimensional map and the indoor plane structure chart.
Specifically, in this step, a plane fitting is performed on the ground in the indoor three-dimensional map, with this plane as a reference plane. And projecting the indoor three-dimensional map to the reference plane to form a two-dimensional plane map, wherein the ground in the three-dimensional map is not directly selected as the two-dimensional plane map used in the subsequent step because the ground cannot directly correspond to a real indoor structure at the ground of the three-dimensional map due to the shielding effect of an object near an upper wall of the ground when the visual SLAM is carried out in a non-empty room. And observing the two-dimensional plane graph and the plane structure graph of the house, and respectively finding out more than four corresponding points corresponding to the same position in the two-dimensional plane graph and the plane structure graph. And according to the plurality of corresponding points, solving the corresponding relation from the two-dimensional plane graph to the plane structure graph, thereby aligning the two graphs. If the house does not have a plane structure diagram, the plane structure diagram can be drawn according to the proportional relation of the two-dimensional plane diagram by referring to a real indoor scene without surveying and mapping. The plan view map serves as a map for displaying and marking specific objects in which the video surveillance appears.
And S130, calibrating internal parameters of the video monitoring camera.
Specifically, in this step, the video surveillance camera during normal operation is calibrated for internal parameters to obtain a first calibration parameter M in1 (ii) a Setting the image size of the video monitoring camera to be the same as that of a sensor of the visual SLAM, and carrying out internal reference on the video monitoring camera with the image sizeNumber calibration to obtain a second calibration parameter M in2 This step can be implemented by adopting Zhangyingyou camera calibration algorithm.
And S140, calculating external parameters of the video monitoring camera by using a repositioning principle of a visual SLAM technology.
By utilizing the principle of visual SLAM technology relocation, similarity comparison is carried out on a video monitoring image and the stored key frame image sequence, and the position and the posture of the video monitoring image in a world coordinate system are calculated, namely the external parameter M of the video monitoring camera at the current shooting angle ex . And marking the position of the video monitoring camera in the two-dimensional plane graph, and converting the position into the plane structure graph according to the corresponding relation.
Specifically, a bag of words model (BoW) may be used to compare similarity of images and find matching relationships through feature point matching.
If the video monitoring system comprises a plurality of video monitoring cameras, the positions of the video monitoring cameras are calibrated according to the steps, external parameters of each video monitoring camera are obtained according to the method, and the positions of the external parameters are respectively marked in the plane structure chart.
And S150, calculating a homography matrix from the video monitoring picture to the plane structure chart.
Specifically, in this step, a computer virtual scene is constructed, the indoor three-dimensional map is imported, the display view angle of the virtual camera is set, and the parameter of the virtual camera is set as the first calibration parameter M of the video surveillance camera in1 And an external parameter M ex If so, the scene in the indoor three-dimensional map displayed at the visual angle corresponds to the scene in the video monitoring camera picture;
randomly selecting some points (in principle, more than 4 points, and tens of points are randomly selected in order to eliminate the interference of abnormal points possibly existing in the point cloud as much as possible) from the three-dimensional dense point cloud displayed under the display view angle in the virtual scene, wherein the points are called measuring points, so as to obtain the pixel coordinates of the measuring points in the video monitoring picture;
projecting the measuring points in the two-dimensional plane graph, and carrying out spatial transformation on the corresponding relation from the two-dimensional plane graph to the plane structure graph to obtain the coordinates of the measuring points in the plane structure graph;
and pixel coordinates in the video monitoring picture correspond to coordinates in the plane structure picture one by one, and a homography matrix from the video monitoring picture to the plane structure picture is calculated by adopting a random consistency sampling technology.
Specifically, in this step, 50 points P may be randomly selected from the three-dimensional dense point cloud displayed at the viewing angle in the virtual scene, and the pixel coordinates of these points in the video monitoring picture may be obtained C p is the same as the above. Projecting the points on the two-dimensional plane graph, and performing spatial transformation from the corresponding relation between the two-dimensional plane graph and the plane structure graph to obtain the coordinates of the points in the plane structure graph M p is the same as the formula (I). The pixel coordinates in the video monitoring picture correspond to the coordinates in the plane structure chart one by one, and a homography matrix H from the video monitoring picture to the plane structure chart is calculated by adopting a random consensus sampling (RANSAC) method to ensure that H meets the requirement of H M p=H C p。
And S160, in the use process of the video monitoring system, converting the pixel coordinates of the target on the ground, which are identified and extracted from the video monitoring picture, into the coordinates in the plane structure diagram through the spatial transformation of the homography matrix, so as to realize the marking at the coordinates in the plane structure diagram.
Specifically, in this step, during the use of the video surveillance system, the pixel coordinates of the object at the ground surface are identified and extracted from the video surveillance picture C p obj By spatial transformation of said homography matrix M p obj =H C p obj Coordinates which can be converted into plan view maps M p obj And marking at the coordinate in the plane structure diagram.
The map positioning method applied to the indoor video monitoring system can realize automatic calibration of the position of the video monitoring camera in the indoor plane structure chart. The position relation between the video monitoring image and the plane structure chart can be automatically calculated without manual measurement, so that the target in the video monitoring image is marked at the corresponding position in the plane structure chart.
In some optional embodiments, in step S110, the indoor three-dimensional map is constructed by the ORB-SLAM2 algorithm using Kinect v2 as a visual sensor.
In some optional embodiments, when a shooting angle of view of the video monitoring camera changes, the method further includes:
recalculating the homography matrix by using the steps S140 and S150, and marking the target in the video monitoring picture in the plane structure diagram by using the step S160.
When the map positioning method disclosed by the invention is actually applied, the method can be integrated into indoor video monitoring system software, and the function of marking a specific target in a video monitoring picture in an indoor structure chart can be achieved through installation, control and debugging of technicians. In the future, the buyer adjusts the shooting angle of the video surveillance camera, and the buyer can execute the steps S140 and S150 in the video surveillance system software by himself, i.e. the function of marking the specific target in the video surveillance picture in the indoor structure picture can be realized again. This process does not require a technician to go to the gate again for debugging. The invention simplifies the use and operation process of the video monitoring system and saves the labor and time cost.
In another aspect of the present disclosure, as shown in fig. 4, a map positioning system 100 applied to an indoor video monitoring system is provided, and the system 100 can be applied to the methods described above, and specific reference can be made to the related descriptions, which are not repeated herein. The system 100 includes:
the map building module 110 is configured to build an indoor three-dimensional map by using a visual SLAM technique, and specifically includes:
an indoor three-dimensional map of a video monitoring system control site is constructed through a visual SLAM technology, the indoor three-dimensional map is in a three-dimensional dense point cloud form, an SLAM coordinate system is taken as a world coordinate system, and a key frame image generated in the SLAM process is stored;
the map mapping module 120 is configured to establish a corresponding relationship between the constructed indoor three-dimensional map and the indoor plane structure diagram, and specifically includes:
carrying out plane fitting on the ground in the indoor three-dimensional map, taking the plane as a reference plane, projecting the indoor three-dimensional map to the reference plane to form a two-dimensional plane map, respectively finding a plurality of corresponding points corresponding to the same position in the two-dimensional plane map and the plane structure map, and solving the corresponding relation from the two-dimensional plane map to the plane structure map according to the plurality of corresponding points;
the first calibration module 130 is configured to calibrate internal parameters of the video surveillance camera, and specifically includes:
calibrating internal parameters of the video monitoring camera in normal work to obtain a first calibration parameter, setting the image size of the video monitoring camera to be the same as that of a sensor of a visual SLAM, and calibrating the internal parameters of the video monitoring camera with the image size to obtain a second calibration parameter;
the second calibration module 140 is configured to calculate external parameters of the video surveillance camera according to a relocation principle of the visual SLAM technology, and specifically includes:
by utilizing the principle of visual SLAM technology relocation, carrying out similarity comparison on a video monitoring image and the stored key frame image sequence, calculating the position and the posture of the video monitoring image under a world coordinate system, namely the external parameters of the video monitoring camera under the current shooting angle, marking the position of the video monitoring camera in the two-dimensional plane map, and converting the position into the plane structure map according to the corresponding relation;
the spatial transform module 150 is configured to calculate a homography matrix from the video monitoring picture to the planar structure diagram, and specifically includes:
constructing a computer virtual scene, importing the indoor three-dimensional map, setting a display view angle of a virtual camera, setting parameters of the virtual camera as a first calibration parameter and external parameters of the video monitoring camera, and enabling a scene in the indoor three-dimensional map displayed at the view angle to correspond to a scene in a picture of the video monitoring camera; randomly selecting some points from the three-dimensional dense point cloud displayed under the display visual angle in the virtual scene to obtain the pixel coordinates of the measuring points in the video monitoring picture; projecting the measuring points in the two-dimensional plane graph, and carrying out spatial transformation on the corresponding relation from the two-dimensional plane graph to the plane structure graph to obtain the coordinates of the measuring points in the plane structure graph; pixel coordinates in the video monitoring picture correspond to coordinates in the plane structure chart one by one, and a homography matrix from the video monitoring picture to the plane structure chart is calculated by adopting a random consistency sampling technology;
and the target positioning module 160 is configured to, during use of the video monitoring system, convert pixel coordinates of a target on the ground, which are identified and extracted from the video monitoring picture, into coordinates in the plane structure diagram through spatial transformation of the homography matrix, so as to implement marking at the coordinates in the plane structure diagram.
And the display and interaction module 170 is used for displaying data such as maps and measuring points and the like and for enabling an operator to interact with the system through an input device.
The map positioning system applied to the indoor video monitoring system can realize automatic calibration of the position of the video monitoring camera in an indoor plane structure chart. The position relation between the video monitoring image and the plane structure chart can be automatically calculated without manual measurement, so that the target in the video monitoring image is marked at the corresponding position in the plane structure chart.
In some optional embodiments, when the shooting angle of view of the video surveillance camera changes, the spatial transformation module 150 is further configured to recalculate the homography matrix, and the object location module 160 is further configured to mark the object in the video surveillance picture in the planar structure view again.
In another aspect of the present disclosure, an electronic device is provided, including:
one or more processors;
a storage unit configured to store one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method according to the above.
In another aspect of the disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, is adapted to carry out the method according to the above.
The computer readable medium may be included in the apparatus, device, system, or may exist separately.
The computer readable storage medium may be any tangible medium that can contain or store a program, and may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, more specific examples of which include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, an optical fiber, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
The computer readable storage medium may also include a propagated data signal with computer readable program code embodied therein, for example, in a non-transitory form, such as in a carrier wave or in a carrier wave, wherein the carrier wave is any suitable carrier wave or carrier wave for carrying the program code.
It is to be understood that the above embodiments are merely exemplary embodiments that are employed to illustrate the principles of the present disclosure, and that the present disclosure is not limited thereto. It will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the disclosure, and these are to be considered as the scope of the disclosure.
Claims (10)
1. A map positioning method applied to an indoor video monitoring system is characterized by comprising the following steps:
step S110, constructing an indoor three-dimensional map through a visual SLAM technology:
an indoor three-dimensional map of a video monitoring system control site is constructed through a visual SLAM technology, the indoor three-dimensional map is in a three-dimensional dense point cloud form, an SLAM coordinate system is taken as a world coordinate system, and a key frame image generated in the SLAM process is stored;
step S120, establishing a corresponding relation between the constructed indoor three-dimensional map and an indoor plane structure diagram:
carrying out plane fitting on the ground in the indoor three-dimensional map, taking the plane as a reference plane, projecting the indoor three-dimensional map to the reference plane to form a two-dimensional plane map, respectively finding a plurality of corresponding points corresponding to the same position in the two-dimensional plane map and the plane structure map, and solving the corresponding relation from the two-dimensional plane map to the plane structure map according to the plurality of corresponding points;
step S130, calibrating internal parameters of the video monitoring camera:
calibrating internal parameters of the video monitoring camera in normal work to obtain a first calibration parameter, setting the image size of the video monitoring camera to be the same as that of a sensor of a visual SLAM, and calibrating the internal parameters of the video monitoring camera with the image size to obtain a second calibration parameter;
step S140, calculating external parameters of the video monitoring camera by using the repositioning principle of the visual SLAM technology:
by utilizing the principle of visual SLAM technology relocation, carrying out similarity comparison on a video monitoring image and the stored key frame image sequence, calculating the position and the posture of the video monitoring image under a world coordinate system, namely the external parameters of the video monitoring camera under the current shooting angle, marking the position of the video monitoring camera in the two-dimensional plane map, and converting the position into the plane structure map according to the corresponding relation;
step S150, calculating a homography matrix from the video monitoring picture to the plane structure diagram:
constructing a computer virtual scene, importing the indoor three-dimensional map, setting a display view angle of a virtual camera, setting parameters of the virtual camera as a first calibration parameter and external parameters of the video monitoring camera, and enabling a scene in the indoor three-dimensional map displayed at the view angle to correspond to a scene in a picture of the video monitoring camera; randomly selecting some points, called measuring points, from the three-dimensional dense point cloud displayed under the display view angle in the virtual scene to obtain pixel coordinates of the measuring points in the video monitoring picture; projecting the measuring points in the two-dimensional plane graph, and performing spatial transformation on the corresponding relation from the two-dimensional plane graph to the plane structure graph to obtain coordinates of the measuring points in the plane structure graph; the pixel coordinates in the video monitoring picture correspond to the coordinates in the plane structure chart one by one, and the homography matrix from the video monitoring picture to the plane structure chart is calculated;
step S160, in the using process of the video monitoring system, the pixel coordinates of the target on the ground, which are identified and extracted from the video monitoring picture, are converted into the coordinates in the plane structure diagram through the spatial transformation of the homography matrix, so as to realize the marking at the coordinates in the plane structure diagram.
2. The method of claim 1, wherein when a shooting perspective of the video surveillance camera changes, the method further comprises:
recalculating the homography matrix by using the steps S140 and S150, and marking the target in the video monitoring picture in the plane structure diagram by using the step S160.
3. The method of claim 1, wherein if the building does not have the floor plan structure, step S140 further comprises:
and drawing the plane structure diagram according to the proportional relation of the two-dimensional plane diagram by referring to a real indoor scene.
4. The method according to any one of claims 1 to 3, wherein in step S150, a random consistency sampling technique is used to calculate the homography matrix from the video surveillance picture to the planar structure graph.
5. The method according to any one of claims 1 to 3, wherein in step S120, the number of the plurality of corresponding points is not less than four; in step S150, the number of the randomly selected points is not less than four.
6. The method as claimed in any one of claims 1 to 3, wherein the indoor three-dimensional map is constructed by an ORB-SLAM2 algorithm using Kinect v2 as a vision sensor in step S110.
7. A map positioning system for use in an indoor video surveillance system, the system comprising:
the map building module is used for building an indoor three-dimensional map through a visual SLAM technology, and specifically comprises the following steps:
an indoor three-dimensional map of a video monitoring system control site is constructed through a visual SLAM technology, the indoor three-dimensional map is in a three-dimensional dense point cloud form, an SLAM coordinate system is taken as a world coordinate system, and a key frame image generated in the SLAM process is stored;
the map mapping module is used for establishing a corresponding relation between the constructed indoor three-dimensional map and an indoor plane structure diagram, and specifically comprises the following steps:
carrying out plane fitting on the ground in the indoor three-dimensional map, taking the plane as a reference plane, projecting the indoor three-dimensional map to the reference plane to form a two-dimensional plane map, respectively finding a plurality of corresponding points corresponding to the same position in the two-dimensional plane map and the plane structure map, and solving the corresponding relation from the two-dimensional plane map to the plane structure map according to the plurality of corresponding points;
the first calibration module is used for calibrating internal parameters of the video monitoring camera, and specifically comprises the following steps:
calibrating internal parameters of the video monitoring camera in normal work to obtain first calibration parameters, setting the image size of the video monitoring camera to be the same as the image size of a sensor of a visual SLAM, and calibrating the internal parameters of the video monitoring camera with the image size to obtain second calibration parameters;
the second calibration module is used for calculating external parameters of the video monitoring camera by using a repositioning principle of a visual SLAM technology, and specifically comprises the following steps:
by utilizing the principle of visual SLAM technology relocation, similarity comparison is carried out on a video monitoring image and the stored key frame image sequence, the position and the posture of the video monitoring image under a world coordinate system are calculated, namely the external parameters of the video monitoring camera under the current shooting angle are marked in the two-dimensional plane graph, and the video monitoring image is converted into the plane structure graph according to the corresponding relation;
the spatial transformation module is used for calculating a homography matrix from a video monitoring picture to the plane structure diagram, and specifically comprises the following steps:
constructing a computer virtual scene, importing the indoor three-dimensional map, setting a display view angle of a virtual camera, setting parameters of the virtual camera as first calibration parameters and external parameters of the video monitoring camera, and enabling the scene in the indoor three-dimensional map displayed at the view angle to correspond to the scene in the picture of the video monitoring camera; randomly selecting some points from the three-dimensional dense point cloud displayed under the display visual angle in the virtual scene to obtain the pixel coordinates of the measuring points in the video monitoring picture; projecting the measuring points in the two-dimensional plane graph, and performing spatial transformation on the corresponding relation from the two-dimensional plane graph to the plane structure graph to obtain coordinates of the measuring points in the plane structure graph; pixel coordinates in the video monitoring picture correspond to coordinates in the plane structure chart one by one, and a homography matrix from the video monitoring picture to the plane structure chart is calculated by adopting a random consistency sampling technology;
the target positioning module is used for identifying and extracting pixel coordinates of a target on the ground from the video monitoring picture in the use process of the video monitoring system, and converting the pixel coordinates into coordinates in the plane structure diagram through the spatial transformation of the homography matrix so as to realize the marking of the coordinates in the plane structure diagram;
and the display and interaction module is used for displaying data such as a map, a measuring point and the like and enabling an operator to interact with the system through input equipment.
8. The system of claim 7, wherein the spatial transformation module is further configured to recalculate the homography matrix when a shooting angle of view of the video surveillance camera changes, and wherein the object location module is further configured to mark the object in the video surveillance picture in the planar structure view.
9. An electronic device, comprising:
one or more processors;
a storage unit to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, is able to carry out a method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011626031.XA CN112669392B (en) | 2020-12-31 | 2020-12-31 | Map positioning method and system applied to indoor video monitoring system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011626031.XA CN112669392B (en) | 2020-12-31 | 2020-12-31 | Map positioning method and system applied to indoor video monitoring system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112669392A CN112669392A (en) | 2021-04-16 |
CN112669392B true CN112669392B (en) | 2022-11-25 |
Family
ID=75412437
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011626031.XA Active CN112669392B (en) | 2020-12-31 | 2020-12-31 | Map positioning method and system applied to indoor video monitoring system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112669392B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113421307B (en) * | 2021-06-22 | 2022-11-22 | 恒睿(重庆)人工智能技术研究院有限公司 | Target positioning method and device, computer equipment and storage medium |
CN115797445A (en) * | 2023-02-06 | 2023-03-14 | 成都智元汇信息技术股份有限公司 | Indoor personnel positioning method and device based on image recognition and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103226838A (en) * | 2013-04-10 | 2013-07-31 | 福州林景行信息技术有限公司 | Real-time spatial positioning method for mobile monitoring target in geographical scene |
CN111192299A (en) * | 2019-12-20 | 2020-05-22 | 中冶天工集团有限公司 | Personnel track positioning method based on comprehensive pipe gallery video monitoring system |
-
2020
- 2020-12-31 CN CN202011626031.XA patent/CN112669392B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103226838A (en) * | 2013-04-10 | 2013-07-31 | 福州林景行信息技术有限公司 | Real-time spatial positioning method for mobile monitoring target in geographical scene |
CN111192299A (en) * | 2019-12-20 | 2020-05-22 | 中冶天工集团有限公司 | Personnel track positioning method based on comprehensive pipe gallery video monitoring system |
Non-Patent Citations (2)
Title |
---|
基于ORB-SLAM的室内机器人定位和三维稠密地图构建;侯荣波等;《计算机应用》;20170510(第05期);全文 * |
基于立体视觉的多摄像位空间定位***研究;许洁;《单片机与嵌入式***应用》;20200101(第01期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112669392A (en) | 2021-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5538667B2 (en) | Position / orientation measuring apparatus and control method thereof | |
CN106679651B (en) | Sound localization method, device and electronic equipment | |
JP6057298B2 (en) | Rapid 3D modeling | |
WO2017114508A1 (en) | Method and device for three-dimensional reconstruction-based interactive calibration in three-dimensional surveillance system | |
CN108805936B (en) | Camera external parameter calibration method and device and electronic equipment | |
US9129435B2 (en) | Method for creating 3-D models by stitching multiple partial 3-D models | |
CN113240769B (en) | Spatial link relation identification method and device and storage medium | |
US20150116691A1 (en) | Indoor surveying apparatus and method | |
CN111735439B (en) | Map construction method, map construction device and computer-readable storage medium | |
WO2016042926A1 (en) | Image processing device, image processing method, and program | |
JP6310149B2 (en) | Image generation apparatus, image generation system, and image generation method | |
JP2014529727A (en) | Automatic scene calibration | |
JP2004334819A (en) | Stereo calibration device and stereo image monitoring device using same | |
CN112669392B (en) | Map positioning method and system applied to indoor video monitoring system | |
KR20180060818A (en) | Industrial infrastructure management platform building system based on virtual reality | |
JP2015088819A (en) | Imaging simulation device | |
JP2023546739A (en) | Methods, apparatus, and systems for generating three-dimensional models of scenes | |
CN113763478B (en) | Unmanned vehicle camera calibration method, device, equipment, storage medium and system | |
JP2018010599A (en) | Information processor, panoramic image display method, panoramic image display program | |
CN113793392A (en) | Camera parameter calibration method and device | |
JP6928217B1 (en) | Measurement processing equipment, methods and programs | |
CN113496503B (en) | Point cloud data generation and real-time display method, device, equipment and medium | |
CN111161350A (en) | Position information and position relation determining method, position information acquiring device | |
KR102500488B1 (en) | Method for measuring Real length in 3D tour and 3D tour system therefor | |
CN114640800B (en) | Camera arrangement method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |