WO2020048509A1 - Inter-frame area mapping method and apparatus, and multi-camera observing system - Google Patents

Inter-frame area mapping method and apparatus, and multi-camera observing system Download PDF

Info

Publication number
WO2020048509A1
WO2020048509A1 PCT/CN2019/104535 CN2019104535W WO2020048509A1 WO 2020048509 A1 WO2020048509 A1 WO 2020048509A1 CN 2019104535 W CN2019104535 W CN 2019104535W WO 2020048509 A1 WO2020048509 A1 WO 2020048509A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
picture
target
coordinate conversion
conversion relationship
Prior art date
Application number
PCT/CN2019/104535
Other languages
French (fr)
Chinese (zh)
Inventor
童鸿翔
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2020048509A1 publication Critical patent/WO2020048509A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Definitions

  • the present application relates to the technical field of intelligent video surveillance, and in particular, to a method, a device, and a multi-camera observation system for mapping regions between pictures.
  • the multi-camera observation system can shoot the same subject from multiple shooting angles.
  • the multi-camera observation system can include a dome camera. By changing the azimuth of the dome camera, the dome camera can be aligned with different shooting angles.
  • One subject is taken to achieve the effect of using a single dome to shoot the same subject from multiple angles; in addition, a multi-camera observation system can also include multiple cameras, and each camera can face the same from different shooting angles The subject shoots.
  • the purpose of the embodiments of the present invention is to provide a method, device and multi-camera observation system for region mapping between pictures, so that when a target region is given in one shooting frame, an area corresponding to the target region is effectively determined in another frame.
  • Specific technical solutions are as follows:
  • an embodiment of the present application provides a method for mapping regions between pictures, where the method includes:
  • an area corresponding to the target area is determined in the second picture.
  • an embodiment of the present application adopts a device for mapping regions between pictures, where the device includes:
  • a first area determination module configured to determine a target area specified in a first picture to be area-mapped
  • a transformation relationship determining module configured to determine a target coordinate transformation relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs;
  • a second region determining module is configured to determine a region corresponding to the target region in the second screen based on the target region and the target coordinate conversion relationship.
  • an embodiment of the present invention provides that the system includes a controller and at least one camera, where the at least one camera includes a camera to which a first picture to be area mapped belongs and a camera to which a second picture to be area mapped belongs;
  • the camera to which the first picture belongs is used to collect the first picture to be mapped in the area to be mapped;
  • the camera to which the second picture belongs is used to collect the second picture to be mapped in the area to be mapped;
  • the controller is configured to determine a target area specified in the first picture; determine a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture belongs; based on the target area and the target The coordinate conversion relationship determines a region corresponding to the target region in the second screen.
  • an embodiment of the present invention provides an electronic device.
  • the electronic device is a controller in a multi-camera observation system.
  • the electronic device includes a processor, a communication interface, a memory, and a communication bus.
  • the processor, Communication interface, the memory communicates with each other through the communication bus;
  • the processor is configured to implement the steps of any method for mapping between regions of a screen provided by the first aspect when the program stored in the memory is executed.
  • an embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the foregoing first aspect provides Steps of any inter-screen region mapping method.
  • the target coordinate conversion relationship between the camera to which the first picture to be area mapped belongs and the camera to which the second picture to be area mapped belongs and further, when the After the target area is determined in one picture, the area corresponding to the target area can be determined in the second picture to be area mapped according to the target coordinate conversion relationship and the target area, so that when the target area is given in one picture, , Effectively determine the area corresponding to the target area in another picture.
  • the solution provided by the embodiment of the present invention can be adapted to different types of cameras, and has a good adaptability.
  • the area corresponding to the target area is determined according to the target coordinate conversion relationship.
  • the camera to which a picture belongs and the camera to which the second picture to be mapped belongs are determined. Therefore, the operation of determining the area corresponding to the target area is simple and does not require additional information.
  • FIG. 1 is a schematic diagram of field angle information of the ball machine
  • FIG. 2 is a schematic diagram of a dome camera image changing with changes in the azimuth and magnification of the dome camera according to an embodiment of the present application;
  • FIG. 3 is a picture with distortion collected by a fisheye camera
  • FIG. 5 is a schematic flowchart of a method for mapping regions between pictures according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for determining a first coordinate conversion relationship according to an embodiment of the present application
  • FIG. 7 is a schematic diagram of a dome camera
  • FIG. 8 is a schematic structural diagram of a device for mapping between regions of an image provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a multi-camera observation system according to an embodiment of the present application.
  • Multi-camera observation system An observation system with one or more cameras or devices that can perform two-dimensional imaging and reflect the target position of the shooting object. These cameras or devices may include: fisheye cameras, guns, Dome, radar, etc. Among them, the traditional gun-ball linkage, fish-ball linkage, multi-gun multi-ball linkage, and radar dome linkage can all be considered as a subclass of the multi-camera observation system, that is, all can be considered as a multi-camera observation system.
  • Gun machine a type of monitoring CCD (Charge Coupled Device) camera, which is characterized by stable imaging. Specifically, in the embodiment of the present application, after the gun is installed, the shooting angle is fixed, and further, the three-dimensional space corresponding to the captured image is fixed. It can be understood that, for a point with a fixed position in the three-dimensional space, the coordinates of the corresponding point in the picture collected by the same gun machine are fixed.
  • CCD Charge Coupled Device
  • Dome camera a camera used to observe the details of the target.
  • the dome camera refers to a dome camera having PTZ (pan / tilt / zoom) direction and zoom information, and may also be referred to as a PTZ camera.
  • P refers to pan, which represents the azimuth angle in the horizontal direction
  • T refers to tilt, which represents the azimuth angle in the vertical direction, and determines the range of the field of view of the dome camera is Z, which is the zoom factor.
  • P and T can be collectively referred to as the azimuth of the ball machine, which is expressed by the PT value.
  • the PT value can be expressed as (P, T), where P refers to pan and represents the horizontal azimuth; T refers to tilt and represents the vertical azimuth. It can be understood that the larger the zoom and the larger the magnification, the more pixels the same target will occupy in the picture captured by the PTZ camera, but the smaller the overall field of view angle of the captured picture.
  • the characteristic of the dome camera is that the azimuth angle can be changed.
  • the range of angle that the dome camera can rotate in the horizontal direction is (0,180) degrees or (0,360) degrees.
  • the angle range that can be rotated in the straight direction is (-90,90) degrees.
  • the shooting angle of the dome camera will change. It is understandable that for a fixed point in three-dimensional space, the images collected when the same dome camera is at different azimuth angles The coordinates of the corresponding points are different.
  • the coordinates of the center point of the picture currently collected by the dome camera can be characterized by the current azimuth of the dome camera, that is, the coordinates of the center point of the picture collected by the dome camera can be expressed as the PT value when the dome camera collects the picture.
  • the azimuth and zoom factor of the dome camera can be collectively referred to as the field of view information of the dome camera.
  • the field of view information of the dome camera is different, the shooting angle and the field of view of the screen are also different.
  • the manufacturer of the dome will give a field of view information table of the dome, for example, as shown in Table 1, it is a field of view information table of a certain dome.
  • the same dome camera can shoot the same subject from different shooting angles, and according to the different magnification, the same subject is The size of the area occupied in different pictures is also different.
  • the target area 201 is located on the right side of the screen captured by the dome camera, and it is marked; then the dome camera rotates to change its azimuth.
  • FIG. 2b it is clear that the target The position of the area 201 has changed, and is located on the left side of the screen collected by the dome camera. Then, the dome camera is zoomed.
  • FIG. 2c it is clear that the position and size of the target area 201 have changed.
  • a fisheye camera is a camera with a fisheye lens.
  • the so-called fisheye lens is a lens with a very short focal length and a viewing angle close to or greater than 180 degrees.
  • the fisheye lens has a very large deformation, so that except for the scene in the center of the picture, other scenes that should be horizontal or vertical have changed accordingly. This deformation can be Call it distortion.
  • FIG. 3 a picture acquired by a certain fisheye camera.
  • the images collected by the fisheye camera can be corrected for distortion, and the images collected by the fisheye camera after distortion correction can be regarded as the images collected by the gun.
  • the stable Zhang Zhengyou calibration method can be used to correct the distortion of the picture collected by the fisheye camera. Specifically:
  • the camera's internal parameters can be uniformly expressed by the following formula:
  • (cx, cy) is the reference point (usually the center point of the screen), fx, fy is the focal length of the camera, and its unit is pixel.
  • the parameters (fx, fy, cx, cy) will be scaled (multiplied or divided) by the same scale.
  • the internal parameters of the camera do not depend on the view angle of the scene corresponding to the camera.
  • the focal length of the camera is fixed, the calculated internal parameters of the camera are also fixed and can be reused.
  • the guns mentioned in the embodiments of the present application include not only cameras with a camera type of guns, but also fisheye cameras that correct the distortion of the captured images, as well as radar and thermal imaging cameras.
  • the method for mapping regions between pictures can be applied to a controller of a multi-camera observation system.
  • the controller may be various electronic devices such as a tablet computer, a notebook computer, and a desktop computer, and this embodiment is not specifically limited.
  • FIG. 5 is a schematic flowchart of an inter-screen region mapping method according to an embodiment of the present application. As shown in FIG. 5, the inter-screen region mapping method may include the following steps:
  • S501 Determine a target area specified in a first picture to be area-mapped
  • the so-called inter-screen region mapping is that when a target region is given in one screen, the region corresponding to the target region is effectively determined in another screen, so that the screen content of the target region and the determined region can be directed to the same The subject.
  • the area corresponding to the subject can be determined in different pictures collected from multiple shooting angles through the inter-screen area mapping method, and The determined screen area is processed.
  • the different pictures collected from these multiple angles may be referred to as pictures to be area mapped, and the picture used to determine the target area may be referred to as the first picture to be area mapped.
  • the controller may determine the designated target area in the first screen to be mapped based on the target area determination instruction input by the user.
  • the user can mark the target area on the first screen by dragging the mouse, and the controller can use the area surrounded by the path the mouse cursor passes as the target area; for example, if the first screen is displayed on the touch screen, then The user can also mark the target area directly on the touch screen with the hand, and the controller can use the area surrounded by the path that the user's finger travels on the touch screen as the target area; for example, the user can input several screens
  • the coordinates of the pixel points the controller may use the area surrounded by the line of the pixel points corresponding to these coordinates as the target area.
  • the controller may further determine, as a target region, a region corresponding to a specific photographic object in the first screen according to a preset rule.
  • the controller may use the picture corresponding to the face of the subject as the target area in the first picture according to a preset rule.
  • the controller may also determine the target area specified in the first screen mapped by the area to be mapped in other ways.
  • the manners of the target area specified in the mapped first picture all belong to the protection scope of the embodiment of the present application.
  • S502 Determine a target coordinate conversion relationship between a camera to which a first picture belongs and a camera to which a second picture to be mapped belongs.
  • Each frame to be mapped is obtained by a camera.
  • the controller may determine a target between the camera to which the first frame to be mapped belongs and the camera to which the second frame to be mapped belongs. Coordinate conversion relationship.
  • the camera to which the first picture to be area mapped belongs to the camera to which the first picture belongs
  • the camera to which the second picture to be area map belongs to the camera to which the second picture belongs.
  • the camera to which the first picture belongs and the camera to which the second picture belongs may be different in different scenarios.
  • the camera to which the first picture belongs and the camera to which the second picture belongs may be one of the following situations:
  • the camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera;
  • the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
  • the camera to which the first picture belongs is the first dome camera
  • the camera to which the second picture belongs is the second dome camera
  • the azimuth of the first dome camera is fixed
  • the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome, and the first picture is a picture acquired when the azimuth of the dome is the initial azimuth;
  • the camera to which the first picture belongs and the camera to which the second picture belongs are different guns.
  • the camera to which the first picture belongs and the camera to which the second picture belongs may also be other situations, which are all reasonable.
  • the guns mentioned in the above cases include not only cameras with a camera type of guns, but also fish-eye cameras with distortion correction on the captured images, as well as radar and thermal imaging cameras. And other equipment that can provide fixed two-dimensional imaging information.
  • execution order of the above steps S501 and S502 may be to execute step S501 first, then step S502, or execute step S502 first, and then step S501. This is all reasonable.
  • S503 Determine a region corresponding to the target region in the second screen based on the target region and the target coordinate conversion relationship.
  • the controller Before executing the above step S503, the controller may only need to determine the camera to which the first picture belongs, the camera to which the second picture belongs, and the first picture to be mapped to the area, or determine the camera to which the first picture belongs, the camera to which the second picture belongs, The first picture of the area mapping and the second picture of the area mapping are both reasonable.
  • the controller can then A region corresponding to the target region is determined in the mapped second picture.
  • the first screen is only used to indicate the screen used for determining the target region to be mapped when the controller completes the area mapping between screens once
  • the second screen is only used to indicate When the controller completes the inter-screen area mapping, it needs to determine the screen of the area corresponding to the target area in the screen.
  • the second picture can be used by the controller to determine the target when completing the next area mapping between pictures.
  • the area-to-area-mapped picture that is, the second picture can be used as the first picture when the controller completes the next area mapping between pictures, and then the picture of the area corresponding to the target area determined in the second picture can be used as When the controller completes the target area for the next area mapping between pictures, and so on, the area mapping from the first picture to the last picture to be area mapped can be completed.
  • the controller may determine a plurality of groups of cameras to which the first picture belongs and a camera to which the second picture belongs, and when the foregoing step S502 is performed, the controller may determine the cameras to which the plurality of groups of first pictures belong And the target coordinate conversion relationship corresponding to the camera belonging to the first frame and the camera belonging to the second frame in each group of cameras belonging to the second frame, and further, for each group of target coordinate conversion relationships between the camera to which the first frame belongs and the camera to which the second frame belongs, The above step S503 is performed.
  • the controller may execute the above-mentioned steps S502-S503 multiple times to implement area mapping from the first picture in step S501 to the second pictures to be mapped on the plurality of areas to be mapped. That is, the controller may map the target area determined in the first picture to be area-mapped to a plurality of second pictures.
  • the controller may execute the above steps S502-S503 in parallel for each group of cameras to which the first screen belongs and cameras to which the second screen belongs, or may sequentially perform sequentially for each group of cameras to which the first screen belongs and cameras to which the second screen belongs.
  • the controller may perform the foregoing step S503 in various ways, so as to determine an area corresponding to the target area in the second picture to be area-mapped, and implement area mapping between the first picture and the second picture. For example, the controller may determine pixel points corresponding to each pixel point in the target area in the second picture, and these determined pixel points may form an area corresponding to the target area in the second picture.
  • the so-called inter-screen area mapping can also be understood as: if the coordinates of a point in a target area are selected in a picture collected by one camera, it can be determined to correspond to the point in a picture collected by another camera The coordinates of the point. Therefore, optionally, in a specific implementation manner, the above step S503 may include the following steps A1-A2:
  • Step A1 selecting multiple feature points from the target area, where the multiple feature points are multiple pixel points capable of characterizing the target area;
  • the controller may determine a plurality of pixels in the target area that can characterize the target area as feature points according to the shape characteristics of the target area.
  • the controller may use multiple vertices of the target area as feature points.
  • the controller may use the center of the target area and several pixels on the circumference as feature points.
  • the controller may use the points on the edge curve of the target area with obvious changes in curvature as feature points.
  • Step A2 Determine a region corresponding to the target region in the second screen based on the multiple feature points and the target coordinate conversion relationship.
  • the controller can directly determine the area corresponding to the target area in the second picture to be mapped based on the multiple feature points and the target coordinate conversion relationship, thereby realizing the first picture and the second Area mapping between screens.
  • the target coordinate conversion relationship between the camera to which the first picture to be area mapped belongs and the camera to which the second picture to be area mapped belongs and further, when the After the target area is determined in one picture, the area corresponding to the target area can be determined in the second picture to be area mapped according to the target coordinate conversion relationship and the target area, so that when the target area is given in one picture, , Effectively determine the area corresponding to the target area in another picture.
  • the solution provided by the embodiments of the present application can be adapted to different types of cameras, and has a good adaptability.
  • the area corresponding to the target area is determined according to the target coordinate conversion relationship.
  • the camera to which a picture belongs and the camera to which the second picture to be mapped belongs are determined. Therefore, the operation of determining the area corresponding to the target area is simple and does not require additional information.
  • step S502 and step A2 will be specifically described according to the determined camera to which the first picture belongs and the camera to which the second picture belongs.
  • Embodiment 1 The camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera;
  • step S502 determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, may include the following steps B1-B3:
  • Step B1 Determine the coordinate conversion relationship between the gun and the dome camera as the first coordinate conversion relationship.
  • the controller may determine a coordinate conversion relationship between the gun machine and the dome camera, and use the controller as a first coordinate transformation relationship.
  • the following example illustrates the coordinate conversion relationship between the gun machine and the dome camera:
  • the picture collected by the gun machine includes a point A whose coordinates in the picture are (xa, ya).
  • the azimuth of the dome camera is (Pa, Ta).
  • the above coordinates (xa, ya) can be converted into the azimuth angle of the point A corresponding to the dome camera (Pa, Ta).
  • ', Ta' then rotate the dome camera according to the azimuth angle (Pa ', Ta') until the dome angle of the dome camera changes from (Pa, Ta) to (Pa ', Ta').
  • the dome camera collects
  • the center point of the screen is the point A 'corresponding to the above point A.
  • Step B2 Determine the coordinate conversion relationship corresponding to the dome camera as the second coordinate conversion relationship.
  • the coordinate conversion relationship corresponding to the dome camera is the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
  • the controller may determine the coordinate conversion relationship corresponding to the dome camera, and use it as the second coordinate conversion relationship.
  • the following example illustrates the coordinate conversion relationship of the dome camera:
  • the picture collected by the dome camera includes a point B, which is at a non-center point of the picture, and its coordinates in the picture are (xb, yb).
  • the azimuth of the dome is (Pb, Tb).
  • the above coordinates (xb, yb) can be converted into the above point B corresponding to the azimuth of the dome.
  • Step B3 Determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
  • the controller may determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion of the camera to which the first picture belongs and the camera to which the second picture belongs. Relationship, thereby completing step S502 described above.
  • the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship.
  • the camera to which the first picture belongs is a gun machine
  • the camera to which the second picture belongs is a dome camera.
  • the area corresponding to the target area in the determination may include the following steps C1-C4:
  • Step C1 Determine an azimuth corresponding to each feature point based on the first coordinate transformation relationship and the coordinates of the plurality of feature points in the first screen;
  • the controller when the controller selects multiple feature points from the target area, the coordinates of the feature points in the first screen can be obtained. Furthermore, the controller can convert each feature point through the first coordinate transformation relationship determined above. The coordinates of each feature point in the first picture are converted into the azimuth angle corresponding to the feature point, that is, when the center point of the picture collected by the dome camera is the point corresponding to the feature point, the dome camera's azimuth angle.
  • the coordinate of the feature point C in the first picture is (xc, yc). Based on the first coordinate transformation relationship, it can be determined that the azimuth corresponding to the feature point C is (Pc, Tc), and the feature point D is in the first picture.
  • the internal coordinates are (xd, yd), and based on the first coordinate conversion relationship, it can be determined that the azimuth angle corresponding to the feature point D is (Pd, Td).
  • Step C2 selecting a first azimuth angle on which the target device is rotated from the determined azimuth angles, and rotating the target device according to the first azimuth angle to obtain a second picture to be area mapped; wherein the target device belongs to the second picture
  • the camera is the above dome camera;
  • the second picture to be area mapped is determined after the controller executes the above step S502, that is, in this embodiment, the second picture to be area mapped is not The determination is based on any one of the azimuth angles corresponding to the multiple feature points determined by the controller in the above step C1.
  • the controller may select an azimuth angle from the azimuth angles corresponding to the plurality of feature points determined in the above step C1 as the azimuth angle on which the target device is rotated. Further, the selected azimuth angle may be used as the first azimuth angle, and further , Rotating the dome camera according to the first azimuth angle, and using the picture collected by the dome camera after the rotation as the second picture to be area mapped.
  • the coordinate of the feature point C in the first picture is (xc, yc)
  • the azimuth angle corresponding to the feature point C determined by the controller in the above step C1 is (Pc, Tc)
  • the azimuth angle (Pc, Tc) as the first azimuth
  • the picture collected by the dome camera at this time is used as the first Second picture.
  • the controller can obtain the above-mentioned first azimuth in any manner for selecting the azimuth. For example, according to the requirements of the shooting angle of the dome camera, the controller selects and presets the azimuths corresponding to the determined multiple feature points. It is reasonable to set the azimuth with the smallest azimuth error as the first azimuth. For example, it is also possible to randomly select an azimuth as the first azimuth among the determined azimuths corresponding to the plurality of feature points.
  • Step C3 Based on the second coordinate transformation relationship, determine the first target point corresponding to each feature point in the second picture, wherein the first target point corresponding to any feature point is: the corresponding azimuth angle and the feature point Corresponding pixels with the same azimuth;
  • the controller can obtain the azimuth corresponding to each feature point and the azimuth corresponding to the dome camera corresponding to the second picture to be area mapped, according to the above description of the second coordinate conversion relationship,
  • the controller may determine the coordinates of points corresponding to the feature points in the second screen based on the second coordinate conversion relationship.
  • a point corresponding to each feature point can be determined in the second picture, and the determined point can be used as a first target point corresponding to the feature point. It can be understood that the azimuth angle corresponding to the first target point corresponding to any feature point is the same as the azimuth angle corresponding to the point determined by the controller in the above step C1.
  • the coordinates of the feature point C in the first picture are (xc, yc), the azimuth corresponding to the feature point C determined by the controller in the above step C1 is (Pc, Tc), and the feature point D is in the first picture
  • the internal coordinates are (xd, yd), and based on the first coordinate conversion relationship, it can be determined that the azimuth angle corresponding to the feature point D is (Pd, Td).
  • the controller may determine the point D ′ corresponding to the feature point D in the second picture according to the azimuth angle (Pd, Td) corresponding to the feature point D in the second picture.
  • the coordinates are (xd ', yd').
  • Step C4 Use the area determined on the second screen based on the plurality of first target points as the area corresponding to the target area.
  • the controller After determining the first target points corresponding to the respective feature points in the second picture, the controller determines an area in the second picture based on the first target points, and further, may be based on the plurality of first targets. The area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
  • Steps B1 to B3 provided in the step determine the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
  • an area corresponding to the target area may be determined in the second screen based on the multiple feature points and the target coordinate conversion relationship through steps C1-C4 provided in the first embodiment.
  • Embodiment 2 The camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
  • the method of determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs may be the same as steps B1-B3 provided in the first embodiment, and details are not described herein again.
  • the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship.
  • the above step A2 is based on a plurality of feature points and target coordinate conversion relationships in the second picture.
  • the region corresponding to the target region in the determination may include the following steps D1-D3:
  • Step D1 Determine the azimuth corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of the plurality of feature points in the first screen.
  • the second coordinate conversion relationship is the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
  • the controller can obtain the coordinates of the feature points in the first frame. Therefore, after the second coordinate transformation relationship is determined, the controller can determine the coordinates corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of multiple feature points in the first screen based on the second coordinate transformation relationship.
  • the azimuth angle refers to the azimuth angle of the dome camera for each feature point when the center point of the picture collected by the dome camera is the feature point.
  • the controller can determine that the azimuth angle corresponding to the feature point E is (Pe, Te).
  • Step D2 Determine a second target point corresponding to each feature point in the second picture based on the first coordinate conversion relationship and the determined azimuth corresponding to each feature point.
  • the second picture is a picture collected by the dome camera.
  • the first coordinate conversion relationship is a coordinate conversion relationship between a gun machine and a ball machine, that is, for each feature point, the controller
  • the azimuth angle corresponding to the feature point determined in the above step D1 may be converted into the coordinates of the point corresponding to the feature point in the second screen through the first coordinate conversion relationship.
  • a point corresponding to each feature point can be determined in the second picture, and the determined point can be used as a second target point corresponding to the feature point. It can be understood that the azimuth angle corresponding to the second target point corresponding to any feature point is the same as the azimuth angle corresponding to the electrical determined by the controller in the above step D1.
  • the coordinate of the feature point E in the first picture is (xe, ye).
  • the azimuth corresponding to the feature point E determined by the controller is (Pe, Te).
  • the azimuth in the second picture is (Pe ', Te')
  • the controller can determine the feature in the second picture according to the azimuth (Pe, Te) corresponding to the feature point E
  • the coordinates of the point E 'corresponding to the point E are (xe', ye ').
  • Step D3 Use the area determined on the second screen based on the plurality of second target points as the area corresponding to the target area.
  • the controller determines an area in the second picture based on the second target points, and further, the controller can determine the area based on the plurality of second targets.
  • the area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
  • Embodiment 3 the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed;
  • step S502 determining the target coordinate conversion relationship corresponding to the target camera, may include the following steps E1-E3:
  • Step E1 Determine a coordinate conversion relationship between the first dome camera and the second dome camera as the first coordinate transformation relationship
  • the controller may determine a coordinate conversion relationship between the first dome camera and the second dome camera, and use the controller as the first coordinate transformation relationship.
  • the first dome camera can be regarded as a gun machine in the third embodiment.
  • the following example illustrates the coordinate conversion relationship between the first dome camera and the second dome camera:
  • the picture collected by the first dome camera includes a point F, and its coordinates in the picture are ( xf, yf).
  • the azimuth of the dome camera is (Pf, Tf).
  • the above coordinates (xf, yf) can be converted into the above F.
  • the dome camera is rotated according to the azimuth angle (Pf ', Tf') until the azimuth angle of the dome camera changes from (Pf, Tf) to (Pf ', Tf '), at this time, the center point of the picture collected by the dome camera is the point F' corresponding to the above-mentioned F point.
  • Step E2 Determine the coordinate conversion relationship corresponding to the second dome camera as the second coordinate conversion relationship.
  • the coordinate conversion relationship corresponding to the second dome camera is: the conversion relationship between the azimuth of the second dome camera and the coordinates of the center point of the picture collected by the second dome camera.
  • the method of determining the coordinate conversion relationship corresponding to the second dome camera and using it as the second coordinate conversion relationship may be the same as the above step B2, determining the coordinate conversion relationship corresponding to the dome camera and using it as the second The manner of the coordinate conversion relationship is the same, and is not repeated here.
  • Step E3 Determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
  • the controller may determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion of the camera to which the first picture belongs and the camera to which the second picture belongs. Relationship, thereby completing step S502 described above.
  • the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship.
  • the camera to which the first picture belongs is the first dome camera
  • the camera to which the second picture belongs is the second dome camera
  • the azimuth of the first dome camera is fixed.
  • the above step A2 is based on multiple The relationship between the feature points and the target coordinate conversion.
  • the way to determine the area corresponding to the target area in the second picture can be the same as that for the first embodiment described above.
  • the camera to which the first picture belongs is a gun and the camera to which the second picture belongs is a dome
  • the steps C1-C4 provided in the situation are the same, and will not be repeated here.
  • the camera to which the first picture belongs is a gun camera
  • the camera to which the second picture belongs is a dome camera
  • the target device in the above step C2 is a dome camera to which the second picture belongs
  • the camera to which the first picture belongs is the first dome camera
  • the camera to which the second picture belongs is the second dome camera
  • the azimuth of the first dome camera is fixed.
  • the target device in the above step C2 is The second ball machine to which the second screen belongs.
  • Embodiment 4 The camera to which the first picture belongs and the camera to which the second picture belongs are the same dome, and the first picture is a picture acquired when the azimuth of the dome is the initial azimuth;
  • step S502 determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, may include the following steps F1-F2:
  • Step F1 Determine the coordinate conversion relationship corresponding to the dome camera.
  • the coordinate conversion relationship corresponding to the dome camera is: the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera;
  • step F1 the manner in which the controller determines the coordinate conversion relationship corresponding to the dome camera may be the same as the manner in which the coordinate conversion relationship corresponding to the dome camera is determined in step B2, and details are not described herein again.
  • Step F2 Use the coordinate conversion relationship corresponding to the dome camera as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
  • the controller may determine the coordinate conversion relationship corresponding to the dome camera as the target coordinate conversion relationship of the camera to which the first picture belongs and the camera to which the second picture belongs, thereby completing the above step S502.
  • the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship.
  • the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome camera, and the first picture is a picture acquired when the azimuth of the dome camera is the initial azimuth angle.
  • the above step A2, based on the multiple feature points and the target coordinate conversion relationship, to determine the area corresponding to the target area in the second screen, may include the following steps G1-G4:
  • Step G1 Determine the azimuth corresponding to each feature point based on the target coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen;
  • the target coordinate conversion relationship is the coordinate conversion relationship corresponding to the dome camera, that is, the transformation relationship between the azimuth angle of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
  • the controller can obtain the coordinates of the feature points in the first frame.
  • the controller can determine the azimuth corresponding to each feature point based on the target coordinate conversion relationship and the coordinates of multiple feature points in the first screen. That is, for each feature point, when the center point of the picture collected by the dome camera is the feature point, the azimuth angle of the dome camera.
  • the coordinate of the feature point G in the first frame is (xg, yg).
  • the controller can determine that the azimuth angle corresponding to the feature point G is (Pg, Tg), and the feature point H is at The coordinates in the first picture are (xh, yh).
  • the controller can determine that the azimuth corresponding to the feature point H is (Ph, Th).
  • Step G2 Select a second azimuth angle on which the dome camera is based on the determined azimuth angle, and rotate the dome camera according to the second azimuth angle to obtain a second picture to be mapped on the area;
  • the second picture to be area mapped is determined after the controller executes the above step S502, that is, in this embodiment, the second picture to be area mapped is not The determination is based on any one of the azimuth angles corresponding to the multiple feature points determined by the controller in the above step G1.
  • the controller may select an azimuth angle from the azimuth angles corresponding to the plurality of feature points determined in the above step G1 as the azimuth angle on which the ball dome is based. Further, the selected azimuth angle may be used as the second azimuth angle, and further , Rotate the dome camera according to the second azimuth angle, and use the picture collected by the rotated dome camera as the second picture to be area mapped.
  • the coordinate of the feature point G in the first screen is (xg, yg)
  • the azimuth angle corresponding to the feature point G determined by the controller in the above step G1 is (Pg, Tg)
  • the azimuth angle (Pg, Tg) as the first azimuth
  • the picture collected by the dome camera at this time is used as the first Second picture.
  • the controller can obtain the above-mentioned first azimuth in any manner for selecting the azimuth. For example, according to the requirements of the shooting angle of the dome camera, the controller selects and presets the azimuths corresponding to the determined multiple feature points. It is reasonable to set the azimuth with the smallest azimuth error as the second azimuth. For example, one azimuth can be randomly selected as the second azimuth from the determined azimuths corresponding to the plurality of feature points.
  • Step G3 Based on the target coordinate conversion relationship, a third target point corresponding to each feature point is determined in the second screen.
  • the third target point corresponding to any feature point is: the azimuth corresponding to the feature point Pixels with the same angle;
  • the controller can obtain the azimuth corresponding to each feature point and the azimuth corresponding to the dome camera corresponding to the second screen to be area mapped, and then control according to the above description of the target coordinate conversion relationship
  • the device may determine the coordinates of the points corresponding to each feature point in the second screen based on the target coordinate conversion relationship. Furthermore, a point corresponding to each feature point can be determined in the second picture, and the determined point can be used as a third target point corresponding to the feature point. It can be understood that the azimuth angle corresponding to the third target point corresponding to any feature point is the same as the azimuth angle corresponding to the point determined by the controller in the above step G1.
  • the coordinates of the feature point G in the first picture are (xg, yg), the azimuth corresponding to the feature point G determined by the controller in the above step G1 is (Pg, Tg), and the feature point H is in the first picture
  • the internal coordinates are (xh, yh), and based on the first coordinate conversion relationship, it can be determined that the azimuth angle corresponding to the feature point H is (Ph, Th).
  • the above azimuth angle (Pg, Tg) is used as the first azimuth angle, and the dome camera is rotated according to the azimuth angle (Pg, Tg) to obtain a second picture to be area mapped.
  • the controller may determine the corresponding point H ′ of the feature point H in the second picture according to the azimuth angle (Ph, Th) corresponding to the feature point H in the second picture.
  • the coordinates are (xh ', yh').
  • Step G4 Use the area determined on the second screen based on the plurality of third target points as the area corresponding to the target area.
  • the controller determines an area in the second screen based on the third target points, and further, the controller can determine the area based on the third targets.
  • the area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
  • Embodiment 5 The cameras to which the first picture belongs and the camera to which the second picture belongs are different guns;
  • step S502 determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, may include the following steps H1-H2:
  • Step H1 Determine a coordinate conversion relationship between the different guns described above;
  • the controller may determine a coordinate conversion relationship between the different guns, that is, determine a coordinate conversion relationship of the guns corresponding to the different guns.
  • the following example can be used to explain the coordinate conversion relationship between different shots: Assume the first The picture includes a point I, whose coordinates in the first picture are (xi, yi), and the coordinates (xi, yi) can be converted into the first coordinate through the coordinate conversion relationship between different guns. The coordinates (xi ', yi') of the point I 'corresponding to the point I in the two pictures.
  • Step H2 Use the determined coordinate conversion relationship between different guns as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
  • the controller can determine the coordinate conversion relationship between the guns as the target coordinate conversion relationship of the camera to which the first picture belongs and the camera to which the second picture belongs, thereby completing The above step S502.
  • the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship.
  • Step I1 Determine a fourth target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship and the coordinates of the multiple feature points in the first picture;
  • the target coordinate conversion relationship is a coordinate conversion relationship between different guns.
  • the controller when the controller selects multiple feature points from the target area, the controller can obtain the coordinates of the feature points in the first frame. Therefore, after determining the target coordinate conversion relationship, the controller can determine the coordinates of the points corresponding to each feature point in the second screen based on the target coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen. Furthermore, a point corresponding to each feature point can be determined in the second screen, and the determined point can be used as a fourth target point corresponding to the feature point.
  • Step I2 Use the area determined on the second screen based on the fourth target points as the area corresponding to the target area.
  • the controller determines an area in the second screen based on the fourth target points, and further, the controller can determine the area based on the fourth targets.
  • the area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
  • FIG. 6 is a schematic flowchart of a manner for determining a coordinate conversion relationship between the gun machine and the ball machine according to an implementation manner provided in an embodiment of the present application.
  • a planar homography matrix mapping method is adopted in the embodiment of the present application, so that the three-dimensional space of the above-mentioned gun machine and the above-mentioned ball machine may not be considered. Position, and points in three-dimensional space, but can directly establish a mathematical model to establish the coordinate conversion relationship between the gun machine and the ball machine.
  • the manner of determining the coordinate conversion relationship between the gun machine and the ball machine may include the following steps 601-604:
  • S601 Determine the coordinates corresponding to the preset m reference points in the frame collected by the gun machine, and obtain m first coordinates.
  • the reference point is: a point in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs, m ⁇ 4;
  • the controller can obtain m reference points in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs.
  • m ⁇ 4 In order to ensure that the homography matrix can be calculated, m ⁇ 4 must be guaranteed.
  • the reference point may be the four vertices of a photo frame that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs. To the eight vertices of a rectangular box, etc., this is all reasonable.
  • the controller can obtain the m reference points in various ways. For example, after receiving the reference point information sent by the user, the user can select m reference points in the three-dimensional space that can be captured by the camera to which the first screen belongs and the camera to which the second screen belongs, and then pass the information of these reference points through related instructions Send to the controller;
  • the controller may select m reference points in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs according to a preset rule. For example, when the first picture belongs to the camera and the second picture When the three-dimensional space captured by the camera to which the picture belongs includes a certain thing or a certain type of specified object, the controller may select m reference points on the object.
  • the controller may select m reference points on the fire extinguisher.
  • controller can also obtain m reference points in other ways, which is not specifically limited in this embodiment of the present application.
  • the controller After obtaining the m reference points in the three-dimensional space that can be taken by the camera to which the first picture belongs and the camera to which the second picture belongs, the controller can determine the corresponding reference points of the above m reference points in the picture collected by the gun. And use it as the first coordinate, that is, the controller can obtain m first coordinates.
  • the controller may obtain the above-mentioned m first coordinates in multiple manners, which is not specifically limited in this embodiment of the present application.
  • the picture collected by the aforementioned gun is a two-dimensional plane picture, and the points in the picture have two-dimensional plane coordinates, which can be represented by (x, y).
  • the controller can determine The azimuth of the second camera when the center point of the picture collected by the dome camera is the point corresponding to the reference point.
  • each azimuth angle is composed of a horizontal azimuth angle P and a vertical azimuth angle T, expressed as (P, T).
  • execution sequence of the above steps S601 and S602 may be that the controller first executes the above step S601 and then executes the above step S602, or the controller first executes the above device S602 and then the above step S601, or The controller executes the above steps S601 and S602 simultaneously.
  • each first coordinate obtained by the controller is a two-dimensional plane coordinate
  • each azimuth angle obtained by the controller obviously cannot be used as a two-dimensional plane coordinate. Therefore, The controller needs to convert each azimuth obtained in step S602 into a two-dimensional plane coordinate corresponding to the azimuth.
  • the controller can obtain a reference height value h in advance, so that the above azimuth angle can be converted to a two-dimensional plane coordinate by the following formula.
  • T i is the vertical azimuth of the i-th azimuth
  • P i is the horizontal azimuth of the i-th azimuth
  • x i is the x value in the two-dimensional plane coordinates corresponding to the calculated i-th azimuth
  • y i is the y value in the two-dimensional plane coordinate corresponding to the calculated ith azimuth angle, i ⁇ m.
  • the reference height h may take a value of 1.
  • S604 Calculate the homography matrix based on the m first coordinates and the m second coordinates, and use the homography matrix as the coordinate conversion relationship between the gun machine and the ball machine.
  • the controller can calculate a homography matrix based on the m first coordinates and m second coordinates, and use the homography matrix as a gun machine and Coordinate conversion relationship between dome cameras.
  • the m first coordinates are expressed as (x i , y i ), and the m second coordinates are expressed as (u i , v i ), i ⁇ m.
  • the homography matrix can be calculated by the following formula (1) to formula (6), where:
  • H is the homography matrix to be calculated.
  • a x, u (-x i , -y i , -1,0,0,0, u i x i , u i y i , u i ) ⁇
  • v (0,0,0, -x i , -y i , -1, v i x i , v i y i , v i ) ⁇
  • SVD Single Value Decomposition
  • Equation 7 the right singular value and left singular vector of A can be obtained.
  • ⁇ , V are in a corresponding relationship, and the values in ⁇ are sorted from large to small.
  • the right singular vector corresponding to the minimum value in ⁇ is h.
  • the approximate solution of H is the approximate solution of h, as shown in Equation 7 below.
  • h is a 1 * 9 vector, and the value of each element in h corresponds to the value of one element in the homography matrix H.
  • the calculated h is readjusted by the number of rows, columns, and dimensions to obtain the homography matrix H.
  • the camera to which the first picture belongs is the first dome camera
  • the camera to which the second picture belongs is the second dome camera
  • the azimuth of the first dome camera is fixed
  • the first dome camera can be regarded as a gun machine, so that the method for determining the coordinate conversion relationship between the first dome camera and the second dome camera involved in the above third embodiment can be determined with the aforementioned dome camera and dome camera.
  • the coordinate transformation relationship is established in the same way, so it will not be described again.
  • the following describes the determination method of the coordinate conversion relationship corresponding to the ball machine.
  • the uv plane is the imaging plane of the dome camera and is tangent to the lens of the dome camera at point C, and the point C is the center point of the uv plane.
  • the range can be approximated to the imaging plane, and further, the point corresponding to point C in the picture collected by the dome camera is the center point of the picture collected by the dome camera.
  • the imaging plane uv plane of the dome camera does not really exist, but is a hypothetical plane used to determine the coordinate conversion relationship corresponding to the dome camera.
  • the manner of determining the coordinate conversion relationship corresponding to the ball machine may include:
  • Step J1 Obtain the coordinates of the points on the dome camera's imaging point preset in the imaging plane of the dome camera as the first calibration coordinates.
  • the point P can be used as a preset calibration point in the uv plane, and then the controller can obtain the coordinates of the point corresponding to the point P in the screen collected by the dome camera, and place the coordinate at The first calibration coordinates are specified.
  • the first calibration coordinates can be expressed as (xp, yp).
  • the controller can obtain a preset calibration point in various ways.
  • the user selects a point in the imaging plane of the dome camera as a preset calibration point, and selects the selected calibration point.
  • the information of the calibration point is sent to the controller and the like; further, the controller can obtain the coordinates of the point corresponding to the calibration point in the screen collected by the dome camera in various ways.
  • the specific implementation manner of the above step J1 is not limited.
  • Step J2 Determine the optical axis length of the dome camera based on the resolution, magnification, and azimuth when the dome camera collects the picture for determining the first calibration coordinate.
  • the optical axis of the dome camera is the line connecting the origin of the camera coordinate system of the dome camera and the center point of the imaging plane.
  • the resolution, magnification, and azimuth when the dome camera collects the picture for determining the first calibration coordinate may be simply referred to as the current resolution of the dome camera, the current magnification of the dome camera, and the current azimuth of the dome camera.
  • the straight segment OC is the optical axis of the dome camera as shown in FIG. 7.
  • the length of the OC can be calculated by the following formula, that is, the optical axis length of the dome camera in FIG. 7:
  • R is the length of the optical axis of the dome
  • P is the current horizontal azimuth dome current azimuth
  • Z is currently dome current ratio
  • Step J3 Based on the first calibration coordinates and the current resolution of the dome camera, determine the coordinates of the calibration point in the imaging plane of the dome camera as the second calibration coordinates.
  • the above-mentioned second calibration coordinates can be expressed as (U, V). Specifically, the above-mentioned second calibration coordinates can be calculated by the following formula:
  • V yp-height / 2.0
  • width is the resolution in the width direction in the current resolution of the dome camera
  • height is the resolution in the height direction in the current resolution of the dome camera.
  • Step J4 Determine the coordinates of the calibration point in the camera coordinate system of the dome camera as the third calibration coordinates based on the second calibration coordinates and the optical axis length of the dome camera.
  • the third calibration coordinate may be expressed as (x0, y0, z0).
  • the third calibration coordinate may be calculated by the following formula:
  • T is currently azimuth dome current azimuth angle in the vertical direction.
  • Step J5 Based on the third calibration coordinates and the current azimuth angle of the dome camera, determine an angular offset of the calibration point in the horizontal direction and an angular deviation in the vertical direction with respect to the optical axis of the dome camera.
  • the angular offset in the horizontal direction is the horizontal azimuth in the azimuth corresponding to the calibration point, which can be expressed as P_new
  • the angular offset in the vertical direction is the vertical azimuth in the azimuth corresponding to the calibration.
  • the angle can be expressed as T_new, so that the azimuth corresponding to the calibration point can be expressed as (P_new, T_new).
  • the azimuth corresponding to the calibration points can be calculated by the following formula:
  • P_new atan (x0 / y0) + P current ;
  • T_new atan (z0 / (sqrt (x0 * x0 + y0 * y0))) + T Current
  • the mathematical relationship between the coordinates of the corresponding points in the picture collected by the dome camera and the azimuth angles corresponding to the calibration points can be established by explaining the above steps J1-Step J5 and each formula. Further, since the azimuth corresponding to the calibration point is the azimuth of the dome camera when the center point of the picture collected by the dome camera is the point corresponding to the calibration point.
  • the coordinate conversion relationship corresponding to the dome camera can be established through the above steps J1-J5 to obtain
  • the center point of the picture collected by the dome camera is the point corresponding to the pixel point
  • the azimuth angle of the dome camera can also be calculated.
  • the coordinate conversion relationship corresponding to the second dome camera mentioned in the third embodiment is the azimuth of the second dome camera and the center point of the screen collected by the second dome camera. Therefore, the coordinate conversion relationship corresponding to the second dome camera and the coordinate conversion relationship corresponding to the above dome camera are both the coordinate transformation relationship between the azimuth of the dome camera and the center point of the screen collected by the dome camera. Coordinate mapping between different pictures collected when the dome camera is at different azimuth angles can be realized.
  • the determination method of the coordinate conversion relationship corresponding to the second dome camera mentioned in the third embodiment may be the same as the determination method of the coordinate conversion relationship corresponding to the above dome camera, and details are not described herein again.
  • a planar homography matrix mapping method is also used in the embodiments of the present application to determine the coordinate conversion relationship between the guns, so that different guns can be ignored.
  • the position in the three-dimensional space and the point in the three-dimensional space can be established by directly establishing a mathematical model to establish the coordinate conversion relationship between different guns.
  • the method for determining the coordinate conversion relationship between the different guns may include:
  • Step K1 Determine the corresponding coordinates of the preset n target points in the picture collected by the first gun machine, obtain n third coordinates, and determine the corresponding of the preset n target points in the picture collected by the second gun machine. Coordinates to get n fourth coordinates, where n ⁇ 4;
  • the target point is a reference point with the same property as the reference point in step S601. That is, the controller obtains the reference points in the three-dimensional space that can be captured by the first and second guns in advance, and in order to ensure that the homography matrix can be calculated, n ⁇ 4 must be guaranteed.
  • the manner in which the controller obtains the n target points may be the same as the manner in which the controller obtains m reference points in step S601, and details are not described herein again.
  • the controller can determine the positions of each of the n target points in the picture collected by the first gun.
  • the corresponding coordinates are used as the third coordinates, and the coordinates corresponding to each of the above n target points are determined in the picture collected by the second gun machine, and the preset n target points are determined to be collected by the second gun machine
  • the corresponding coordinates in the picture of the image as the fourth coordinate. Therefore, the controller can obtain n third coordinates and n fourth coordinates.
  • n third coordinates and n fourth coordinates in the above step K1 may be the same as the manner in which the controller obtains m first coordinates in the above step S601, and is not repeated here. To repeat.
  • Step K2 Calculate the target homography matrix based on the n third coordinates and n fourth coordinates, and use the target homography matrix as the coordinate conversion relationship between the guns.
  • the controller can calculate a target homography matrix based on the n third coordinates and n fourth coordinates, and use the target homography matrix as Coordinate conversion relationship between guns.
  • the controller executes the above step K2, calculates the target homography matrix based on the n third coordinates and the n fourth coordinates, and uses the target homography matrix as a method of coordinate conversion relationship between the guns.
  • the method is the same as that when the controller executes the above step S604 and calculates the homography matrix based on the m first coordinates and the m second coordinates, and uses the homography matrix as the first coordinate conversion relationship, which is not described herein again.
  • the embodiments of the present application can further perform screen processing on the regions determined in different screens to be mapped, for example, adding AR tags to these regions for labeling, or Privacy masking is performed on these areas, or focused display is performed on these areas.
  • screen processing may also be performed, which is not specifically limited in this embodiment of the present application.
  • the so-called adding an AR tag for labeling may refer to designating a relevant area on a screen captured by one camera, and displaying a region corresponding to the relevant area on a screen captured by another camera.
  • the so-called privacy masking can refer to designating a region in a frame captured by a camera and masking the region, and then, in other frames, the region corresponding to the region is also masked.
  • the method of mapping between regions of the picture provided in the embodiment of the present application can ensure that during the rotation of the dome camera, the relevant area in the picture collected by the dome camera at any shooting angle is performed. Shelter.
  • the embodiment of this application also provides a device for mapping regions between screens.
  • FIG. 8 is a schematic structural diagram of an inter-screen region mapping device according to an embodiment of the present application. As shown in FIG. 8, the inter-screen region mapping device may include the following modules:
  • a first area determination module 810 configured to determine a target area specified in a first picture to be area-mapped
  • a conversion relationship determining module 820 configured to determine a target coordinate conversion relationship between a camera to which a first picture belongs and a camera to which a second picture to be mapped belongs;
  • the second region determining module 830 is configured to determine a region corresponding to the target region in the second picture based on the target region and the target coordinate conversion relationship.
  • the target coordinate conversion relationship between the camera to which the first picture to be area mapped belongs and the camera to which the second picture to be area mapped belongs and further, when the After the target area is determined in one picture, the area corresponding to the target area can be determined in the second picture to be area mapped according to the target coordinate conversion relationship and the target area, so that when the target area is given in one picture, , Effectively determine the area corresponding to the target area in another picture.
  • the solution provided by the embodiments of the present application can be adapted to different types of cameras, and has a good adaptability.
  • the area corresponding to the target area is determined according to the target coordinate conversion relationship.
  • the camera to which a picture belongs and the camera to which the second picture to be mapped belongs are determined. Therefore, the operation of determining the area corresponding to the target area is simple and does not require additional information.
  • the foregoing second area determination module 830 may include:
  • Feature point selection sub-module for selecting multiple feature points from the target area, where the multiple feature points are multiple pixel points capable of characterizing the target area;
  • the second region determining submodule is configured to determine a region corresponding to the target region in the second picture based on a plurality of feature points and a target coordinate conversion relationship.
  • the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a dome camera; or, the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a dome camera;
  • the above conversion relationship determination module 820 may include:
  • a first relationship determining submodule configured to determine a coordinate conversion relationship between a gun machine and a dome camera, as a first coordinate conversion relationship
  • a second relationship determination sub-module is used to determine a coordinate conversion relationship corresponding to the dome camera as a second coordinate conversion relationship, wherein the coordinate conversion relationship corresponding to the dome camera is: the azimuth angle of the dome camera and the center point of the picture collected by the dome camera The transformation relationship of the coordinates;
  • the first target relationship determining submodule is configured to determine the first coordinate conversion relationship and the second coordinate conversion relationship as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
  • the camera to which the first picture belongs is a first dome camera
  • the camera to which the second picture belongs is a second dome camera
  • the azimuth of the first dome camera is fixed; then the above-mentioned conversion relationship determination module 820 may include:
  • a third relationship determining submodule configured to determine a coordinate conversion relationship between the first dome camera and the second dome camera, as a first coordinate transformation relationship
  • a fourth relationship determining sub-module is used to determine a coordinate transformation relationship corresponding to the second dome camera as a second coordinate transformation relationship, wherein the coordinate transformation relationship corresponding to the second dome camera is: the azimuth of the second dome camera and the second dome camera The transformation relationship of the coordinates of the center point of the picture collected by the dome camera;
  • a second target relationship determining sub-module is configured to determine the first coordinate conversion relationship and the second coordinate conversion relationship as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
  • the camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera; or, the camera to which the first picture belongs is a first dome camera, and the camera to which the second picture belongs is a second camera.
  • Dome camera, the azimuth of the first dome camera is fixed; then the above-mentioned second area determination submodule may include:
  • a first azimuth determining unit configured to determine an azimuth corresponding to each feature point based on a first coordinate transformation relationship and coordinates of a plurality of feature points in a first picture
  • a first picture obtaining unit configured to select a first azimuth on which the rotation target device is based from the determined azimuth, and rotate the target device according to the first azimuth to obtain a second picture; wherein when the camera to which the first picture belongs belongs Is a dome camera, when the camera to which the second picture belongs is a dome camera, the target device is a dome camera; when the camera to which the first picture belongs is a dome camera, the camera to which the second picture belongs is a second dome camera, and the azimuth of the first dome camera When fixed, the target device is the second dome camera;
  • a first target point determining unit configured to determine a first target point corresponding to each feature point in the second picture based on a second coordinate transformation relationship, wherein the first target point corresponding to any feature point is: Pixels with the same azimuth as the azimuth corresponding to the feature point;
  • the first region determining unit is configured to use a region determined based on a plurality of first target points in the second picture as a region corresponding to the target region.
  • the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine; then the above-mentioned second area determination submodule may include:
  • a second azimuth angle determining unit configured to determine an azimuth angle corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of multiple feature points in the first picture
  • a second target point determining unit configured to determine a second target point corresponding to each feature point in the second picture based on the first coordinate conversion relationship and the determined azimuth corresponding to each feature point;
  • the second region determining unit is configured to use, as the region corresponding to the target region, a region determined based on the plurality of second target points in the second picture.
  • the inter-screen area mapping device may further include a coordinate conversion relationship determining module for determining a coordinate conversion relationship between a gun and a dome camera, and the coordinate conversion relationship determining module may include:
  • the first coordinate determination submodule is used to determine the preset coordinates corresponding to the m reference points in the picture collected by the gun machine to obtain m first coordinates, where the reference points are: the camera to which the first picture belongs and the second picture Points in the three-dimensional space that can be captured by the camera, m ⁇ 4;
  • the azimuth determination sub-module is used to determine, for each reference point, the azimuth when the dome camera uses the reference point as the center of the screen, and obtain m azimuth angles;
  • a second coordinate determination submodule configured to convert m azimuth angles into m second coordinates
  • the coordinate conversion relationship determination sub-module is configured to calculate a homography matrix based on m first coordinates and m second coordinates, and use the homography matrix as a first coordinate transformation relationship.
  • the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome camera, and the first picture is a picture acquired when the azimuth of the dome camera is the initial azimuth;
  • the determination module 820 may include:
  • a fifth relationship determining sub-module is used to determine a coordinate conversion relationship corresponding to the dome camera, wherein the coordinate conversion relationship corresponding to the dome camera is: a transformation relationship between the azimuth angle of the dome camera and the coordinates of the center point of the screen collected by the dome camera;
  • a third target relationship determining submodule is configured to use the coordinate conversion relationship corresponding to the dome camera as the target coordinate conversion relationship of the camera to which the first picture belongs and the camera to which the second picture to be mapped belongs.
  • the above-mentioned second area determination submodule may include:
  • a third-party position angle determining unit configured to determine an azimuth angle corresponding to each feature point based on a target coordinate conversion relationship and coordinates of multiple feature points in the first screen;
  • a second picture obtaining unit configured to select, from the determined azimuth angles, a second azimuth angle on which the dome camera is based, and rotate the dome camera according to the second azimuth angle to obtain a second picture;
  • a third coordinate point determining unit configured to determine a third target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship, and the third target point corresponding to any feature point is: the corresponding azimuth angle and The feature points correspond to pixels with the same azimuth;
  • the third region determining unit is configured to use, as the region corresponding to the target region, the region determined based on the plurality of third target points in the second picture.
  • the sixth relationship determining sub-module is used to determine the coordinate conversion relationship between different guns
  • a fourth target relationship determination submodule is configured to use the determined coordinate conversion relationship between different guns as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
  • the above-mentioned second area determination submodule may include:
  • a fourth target point determining unit configured to determine a fourth target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship and the coordinates of the multiple feature points in the first picture;
  • the fourth area determining unit is configured to use, as the area corresponding to the target area, the area determined based on the plurality of fourth target points in the second picture.
  • the embodiment of the present application further provides a multi-camera observation system.
  • FIG. 10 is a schematic structural diagram of a multi-camera observation system according to an embodiment of the present application.
  • the system may include a controller 110 and at least one camera 120, where the at least one camera 120 may include a region to be mapped.
  • the camera to which the first picture belongs can be used to collect the first picture to be mapped in the area to be mapped;
  • the camera to which the second picture belongs can be used to collect the second picture to be mapped in the area to be mapped;
  • the controller 110 may be configured to: determine a target area specified in the first frame; determine a target coordinate conversion relationship between a camera to which the first frame belongs and a camera to which the second frame belongs; based on the target area and the target coordinate conversion relationship, in the second frame The area corresponding to the target area is determined in the screen.
  • the foregoing controller 110 may also be used for:
  • Select multiple feature points from the target area determine the area corresponding to the target area in the second screen based on the multiple feature points and the target coordinate conversion relationship; where the multiple feature points are multiple pixel points capable of characterizing the target area .
  • the at least one camera 120 may include a gun machine and a dome camera, and the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera; or A camera 120 may include a shooter and a dome camera, and the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
  • the controller 110 may be configured to: determine a coordinate conversion relationship between a gun and a dome camera as a first coordinate conversion relationship; determine a coordinate conversion relationship corresponding to the dome camera as a second coordinate conversion relationship Determining the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship between the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs;
  • the coordinate conversion relationship corresponding to the dome camera is the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
  • the at least one camera 120 may include a first dome camera and a second dome camera, and the camera to which the first picture belongs is the first dome camera, and the camera to which the second picture belongs is the second dome camera.
  • the controller 110 may be configured to: determine a coordinate conversion relationship between the first dome camera and a second dome camera as the first coordinate transformation relationship; determine a coordinate transformation relationship corresponding to the second dome camera, As the second coordinate conversion relationship; determining the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship of the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs;
  • the coordinate conversion relationship corresponding to the second dome camera is: the conversion relationship between the azimuth of the second dome camera and the coordinates of the center point of the picture collected by the second dome camera.
  • the at least one camera 120 may include a gun machine and a dome camera, and the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera; or A camera 120 may include a first dome camera and a second dome camera, and the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed;
  • the controller 110 is configured to: determine an azimuth angle corresponding to each feature point based on the first coordinate transformation relationship and the coordinates of multiple feature points in the first screen; and select from the determined azimuth angles Rotate the first azimuth on which the target device is based, and rotate the target device according to the first azimuth to obtain a second picture.
  • the target device is a dome camera; when the camera to which the first picture belongs is a first dome camera, and the camera to which the second picture belongs is a second dome camera.
  • the target device is the second dome camera; based on the second coordinate transformation relationship, the first target point corresponding to each feature point is determined in the second picture, where any feature point is
  • the corresponding first target point is: a pixel point whose corresponding azimuth angle is the same as the azimuth angle corresponding to the feature point; and an area determined based on the plurality of first target points in the second picture is used as the area corresponding to the target area.
  • the at least one camera 120 may include a gun machine and a dome camera, and the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
  • the controller 110 may be configured to determine an azimuth corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of multiple feature points in the first screen; based on the first coordinate transformation relationship and The determined azimuth corresponding to each feature point determines the second target point corresponding to each feature point in the second picture; and the area determined based on the plurality of second target points in the second picture is used as the target area corresponding Area.
  • the at least one camera 120 may include a dome camera, and the camera to which the first picture belongs and the camera to which the second picture belongs are dome cameras, and the first picture is the azimuth of the dome camera. The picture collected at the initial azimuth;
  • the controller 110 may be configured to: determine the coordinate conversion relationship corresponding to the dome camera; use the coordinate conversion relationship corresponding to the dome camera as the target of the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs. Coordinate conversion relationship;
  • the controller 110 determines the target coordinate conversion relationship between the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs, it can also be used to: based on the target coordinate conversion relationship and multiple feature points in the The coordinates in the first frame determine the azimuth angle corresponding to each feature point; select the second azimuth angle on which the dome camera is based on the determined azimuth angle, and rotate the dome camera according to the second azimuth angle to obtain the second picture; Based on the target coordinate conversion relationship, a third target point corresponding to each feature point is determined in the second picture; and an area determined based on the plurality of third target points in the second picture is used as a region corresponding to the target area.
  • the coordinate conversion relationship corresponding to the dome camera is: the conversion relationship between the dome camera's azimuth angle and the coordinates of the center point of the screen collected by the dome camera;
  • the third target point corresponding to any feature point is: the corresponding azimuth Pixel points with the same azimuth angle as the feature points.
  • the at least one camera 120 may include: different guns, and the cameras to which the first picture belongs and the cameras to which the second picture belongs are different guns;
  • the controller 110 may be configured to: determine the coordinate conversion relationship between different guns; and use the determined coordinate conversion relationship between the different guns as the camera and the target to which the first screen belongs. The target coordinate conversion relationship of the camera to which the second picture of the area map belongs;
  • the controller 110 determines the target coordinate conversion relationship between the camera to which the first screen belongs and the camera to which the second screen belongs to be mapped, it can also be used to: based on the target coordinate conversion relationship and multiple feature points in the The coordinates in the first picture determine the fourth target point corresponding to each feature point in the second picture; and use the area determined based on the plurality of fourth target points in the second picture as the area corresponding to the target area.
  • controller 110 for a detailed description of each step performed by the controller 110, reference may be made to corresponding content of the foregoing method embodiment, and details are not described herein.
  • An embodiment of the present application further provides an electronic device.
  • the electronic device is a controller in a multi-camera observation system.
  • the electronic device includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904.
  • the processor 901, the communication interface 902, and the memory 903 complete communication with each other through the communication bus 904.
  • the memory 903 is configured to store a computer program
  • the processor 901 is configured to, when executing a program stored in the memory 903, implement any of the method steps in the method for mapping regions between screens provided by the embodiments of the present application.
  • the communication bus mentioned by the controller may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the figure only uses a thick line to represent, but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used for communication between the controller and other devices.
  • the memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located far from the foregoing processor.
  • the aforementioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc .; it may also be a digital signal processor (Digital Signal Processing, DSP), special integration Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP network processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • An embodiment of the present application further provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program is executed by a processor, the method for mapping regions between screens provided by the embodiments of the present application is implemented. In any of the method steps.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

Embodiments of the present application provide an inter-frame area mapping method and apparatus, and a multi-camera observing system. The method comprises: determining a target area designated in a first frame to be subjected to area mapping; determining a target coordinate conversion relationship between a camera to which the first frame belongs and a camera to which a second frame to be subjected to area mapping belongs; and on the basis of the target area and the target coordinate conversion relationship, determining in the second frame an area corresponding to the target area. By applying the method provided by the embodiments of the present application, when a target area is given in a frame, an area corresponding to the target are can be effectively determined in another frame.

Description

一种画面间区域映射方法、装置及多相机观测系统Method and device for mapping regions between pictures and multi-camera observation system
本申请要求于2018年9月6日提交中国专利局、申请号为201811038935.3发明名称为“一种画面间区域映射方法、装置及多相机观测系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 6, 2018, with the application number 201811038935.3 and the invention name "a method, device and multi-camera observation system for inter-screen region mapping". Citations are incorporated in this application.
技术领域Technical field
本申请涉及智能视频监控技术领域,特别是涉及一种画面间区域映射方法、装置及多相机观测系统。The present application relates to the technical field of intelligent video surveillance, and in particular, to a method, a device, and a multi-camera observation system for mapping regions between pictures.
背景技术Background technique
当前,随着信息技术的不断发展,多相机观测系统的应用越来越多,例如,智能家居、消防预警、道路检测等。多相机观测系统可以从多个拍摄角度对同一个拍摄对象进行拍摄,具体的,多相机观测系统可以包括一个球机,通过改变球机的方位角,使得球机可以从不同的拍摄角度对同一个拍摄对象进行拍摄,从而实现利用单个球机从多个角度对同一拍摄对象进行拍摄的效果;另外,多相机观测系统也可以包括多个相机,每个相机可以从不同的拍摄角度对同一个拍摄对象进行拍摄。At present, with the continuous development of information technology, the application of multi-camera observation systems is increasing, for example, smart home, fire warning, road detection, and so on. The multi-camera observation system can shoot the same subject from multiple shooting angles. Specifically, the multi-camera observation system can include a dome camera. By changing the azimuth of the dome camera, the dome camera can be aligned with different shooting angles. One subject is taken to achieve the effect of using a single dome to shoot the same subject from multiple angles; in addition, a multi-camera observation system can also include multiple cameras, and each camera can face the same from different shooting angles The subject shoots.
在实际应用中,很多时候需要对某一拍摄对象在拍摄画面中的区域进行画面处理,例如,遮蔽该区域或者在该区域中添加AR标签等。由于多相机观测系统可以从多个拍摄角度对同一个拍摄对象进行拍摄,因此,需要对多个拍摄画面执行针对拍摄对象所对应的区域的画面处理。进而,由于不同的拍摄画面所对应的拍摄角度不同,因此,不同拍摄画面中同一拍摄对象所对应的区域的坐标也不相同。In practical applications, it is often necessary to perform image processing on an area of a shooting object in a shooting frame, for example, covering the area or adding an AR tag to the area. Since the multi-camera observation system can shoot the same subject from multiple shooting angles, it is necessary to perform picture processing for a region corresponding to the subject on multiple shooting pictures. Furthermore, since the shooting angles corresponding to different shooting pictures are different, the coordinates of the areas corresponding to the same shooting subject in different shooting pictures are also different.
因此,对于多相机观测系统从不同拍摄角度采集到的针对同一拍摄对象的多个拍摄画面,当在一个拍摄画面中给定目标区域时,如何在另一拍摄画面中有效确定与该目标区域对应的区域,是一个亟待解决的问题。Therefore, for multiple shooting frames for the same subject collected by the multi-camera observation system from different shooting angles, when a target area is given in one shooting frame, how to effectively determine the corresponding target area in another shooting frame The region is an urgent problem.
发明内容Summary of the Invention
本发明实施例的目的在于提供一种画面间区域映射方法、装置及多相机观测系统,实现当在一个拍摄画面中给定目标区域时,在另一画面中有效确定与该目标区域对应的区域的目的。具体技术方案如下:The purpose of the embodiments of the present invention is to provide a method, device and multi-camera observation system for region mapping between pictures, so that when a target region is given in one shooting frame, an area corresponding to the target region is effectively determined in another frame. the goal of. Specific technical solutions are as follows:
第一方面,本申请实施例提供了一种画面间区域映射方法,所述方法包括:In a first aspect, an embodiment of the present application provides a method for mapping regions between pictures, where the method includes:
确定在待区域映射的第一画面中所指定的目标区域;Determining the target area specified in the first picture of the area to be mapped;
确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;Determining a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs;
基于所述目标区域和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。Based on the target area and the target coordinate conversion relationship, an area corresponding to the target area is determined in the second picture.
第二方面,本申请实施例通过了一种画面间区域映射装置,所述装置包括:In a second aspect, an embodiment of the present application adopts a device for mapping regions between pictures, where the device includes:
第一区域确定模块,用于确定在待区域映射的第一画面中所指定的目标区域;A first area determination module, configured to determine a target area specified in a first picture to be area-mapped;
转换关系确定模块,用于确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;A transformation relationship determining module, configured to determine a target coordinate transformation relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs;
第二区域确定模块,用于基于所述目标区域和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。A second region determining module is configured to determine a region corresponding to the target region in the second screen based on the target region and the target coordinate conversion relationship.
第三方面,本发明实施例提供了所述系统包括控制器和至少一个相机,其中,所述至少一个相机中包括待区域映射的第一画面所属相机和待区域映射的第二画面所属相机;According to a third aspect, an embodiment of the present invention provides that the system includes a controller and at least one camera, where the at least one camera includes a camera to which a first picture to be area mapped belongs and a camera to which a second picture to be area mapped belongs;
所述第一画面所属相机用于采集待区域映射的第一画面;The camera to which the first picture belongs is used to collect the first picture to be mapped in the area to be mapped;
所述第二画面所属相机用于采集待区域映射的第二画面;The camera to which the second picture belongs is used to collect the second picture to be mapped in the area to be mapped;
所述控制器用于确定在所述第一画面中所指定的目标区域;确定所述第一画面所属相机和所述第二画面所属相机的目标坐标转换关系;基于所述目标区域和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。The controller is configured to determine a target area specified in the first picture; determine a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture belongs; based on the target area and the target The coordinate conversion relationship determines a region corresponding to the target region in the second screen.
第四方面,本发明实施例提供了一种电子设备,所述电子设备为多相机观测系统中的控制器,所述电子设备包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;According to a fourth aspect, an embodiment of the present invention provides an electronic device. The electronic device is a controller in a multi-camera observation system. The electronic device includes a processor, a communication interface, a memory, and a communication bus. The processor, Communication interface, the memory communicates with each other through the communication bus;
存储器,用于存放计算机程序;Memory for storing computer programs;
处理器,用于执行存储器上所存放的程序时,实现上述第一方面提供的任一画面间区域映射方法的步骤。The processor is configured to implement the steps of any method for mapping between regions of a screen provided by the first aspect when the program stored in the memory is executed.
第五方面,本发明实施例提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面提供的任一画面间区域映射方法的步骤。In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the foregoing first aspect provides Steps of any inter-screen region mapping method.
以上可见,在本发明实施例提供的方案中,确定待区域映射的第一画面所属相机和待区域映射的第二画面所属相机之间的目标坐标转换关系,进而,当在待区域映射的第一画面中确定目标区域后,可以根据该目标坐标转换关系和该目标区域,在待区域映射的第二画面中确定与该目标区域对应的区域,以实现当在一个画面中给定目标区域时,在另一画面中有效确定与该目标区域对应的区域。It can be seen from the above that in the solution provided by the embodiment of the present invention, the target coordinate conversion relationship between the camera to which the first picture to be area mapped belongs and the camera to which the second picture to be area mapped belongs, and further, when the After the target area is determined in one picture, the area corresponding to the target area can be determined in the second picture to be area mapped according to the target coordinate conversion relationship and the target area, so that when the target area is given in one picture, , Effectively determine the area corresponding to the target area in another picture.
此外,本发明实施例提供的方案可以针对不同类型的相机,具有较好的适应性,同时,根据目标坐标转换关系确定与目标区域对应的区域,由于目标坐标转换关系是根据待区域映射的第一画面所属相机和待区域映射的第二画面所属相机确定的,因此,确定与目标区域对应的区域的操作简便且不需要依靠额外信息。In addition, the solution provided by the embodiment of the present invention can be adapted to different types of cameras, and has a good adaptability. At the same time, the area corresponding to the target area is determined according to the target coordinate conversion relationship. The camera to which a picture belongs and the camera to which the second picture to be mapped belongs are determined. Therefore, the operation of determining the area corresponding to the target area is simple and does not require additional information.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present application and the technical solutions of the prior art, the following briefly introduces the drawings used in the embodiments and the prior art. Obviously, the drawings in the following description are only the present invention. Some embodiments of the application, for those of ordinary skill in the art, can obtain other drawings according to the drawings without paying creative labor.
图1为球机的视场角信息示意图;FIG. 1 is a schematic diagram of field angle information of the ball machine;
图2为本申请实施例提供的一种球机画面随球机方位角及倍率变化而变化的示意图;FIG. 2 is a schematic diagram of a dome camera image changing with changes in the azimuth and magnification of the dome camera according to an embodiment of the present application; FIG.
图3为鱼眼相机采集到的具有畸变的画面;FIG. 3 is a picture with distortion collected by a fisheye camera;
图4为视场角过大的枪机采集到的具有畸变的画面;4 is a distorted picture collected by a gun with an excessively large field of view;
图5为本申请实施例提供的一种画面间区域映射方法的流程示意图;5 is a schematic flowchart of a method for mapping regions between pictures according to an embodiment of the present application;
图6为本申请实施例提供的一种第一坐标转换关系的确定方式的流程示意图;6 is a schematic flowchart of a method for determining a first coordinate conversion relationship according to an embodiment of the present application;
图7为球机成像示意图;7 is a schematic diagram of a dome camera;
图8为本申请实施例提供的一种画面间区域映射装置的结构示意图;FIG. 8 is a schematic structural diagram of a device for mapping between regions of an image provided by an embodiment of the present application; FIG.
图9为本申请实施例提供的一种电子设备的结构示意图;9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
图10为本申请实施例提供的一种多相机观测系统的结构示意图。FIG. 10 is a schematic structural diagram of a multi-camera observation system according to an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution, and advantages of the present application clearer and clearer, the following describes the present application in detail with reference to the accompanying drawings and examples. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
当前对于多相机观测系统采集到的针对同一拍摄对象的、多个对应于不同角度的画面,当在一个画面中给定目标区域时,如何在另一画面中有效确定与该目标区域对应的区域,是一个亟待解决的问题。为了能够实现当在一个画面中给定目标区域时,在另一画面中有效确定与该目标区域对应的区域,本申请实施例提供了一种画面间区域映射方法、装置及多相机观测系统。Currently, for a plurality of pictures corresponding to different angles, which are collected by a multi-camera observation system, for a same subject, when a target area is given in one picture, how to effectively determine an area corresponding to the target area in another picture Is an urgent problem. In order to be able to realize that when a target area is given in one picture, an area corresponding to the target area is effectively determined in another picture, embodiments of the present application provide a method, a device, and a multi-camera observation system for mapping areas between pictures.
为了方便理解本申请实施例的方案,下面首先对本申请实施例涉及到的相关概念进行简要说明。In order to facilitate understanding of the solutions in the embodiments of the present application, the following first briefly describes related concepts involved in the embodiments of the present application.
(1)多相机观测系统:系统内有一个或者多个可进行二维成像,且反应拍摄对象的目标位置的相机或设备的观测系统,这些相机或设备可以包括:鱼眼相机,枪机,球机,雷达等。其中,传统的枪球联动、鱼球联动、多枪多球联动和雷达球机联动均可以认为是多相机观测系统的子类,即均可以认为是一种多相机观测系统。(1) Multi-camera observation system: An observation system with one or more cameras or devices that can perform two-dimensional imaging and reflect the target position of the shooting object. These cameras or devices may include: fisheye cameras, guns, Dome, radar, etc. Among them, the traditional gun-ball linkage, fish-ball linkage, multi-gun multi-ball linkage, and radar dome linkage can all be considered as a subclass of the multi-camera observation system, that is, all can be considered as a multi-camera observation system.
(2)枪机:监控类CCD(Charge Coupled Device,电荷耦合器件)摄像机中的一种,其特点是成像稳定。具体的,在本申请实施例中,枪机在安装完成之后,其拍摄角度固定,进而,其采集到的画面所对应的三维空间是固定的。可以理解的,对于三维空间中位置固定的一个点而言,其在同一枪机采集到的画面中所对应的点的坐标是固定的。(2) Gun machine: a type of monitoring CCD (Charge Coupled Device) camera, which is characterized by stable imaging. Specifically, in the embodiment of the present application, after the gun is installed, the shooting angle is fixed, and further, the three-dimensional space corresponding to the captured image is fixed. It can be understood that, for a point with a fixed position in the three-dimensional space, the coordinates of the corresponding point in the picture collected by the same gun machine are fixed.
(3)球机:用于观察目标细节特征的摄像机。具体的,在本申请实施例中,球机特指具有PTZ(pan/tilt/zoom)方向以及变倍信息的球机,又可以称为PTZ相机。其中,P指的是pan,代表水平方向方位角;T指的是tilt,代表竖直方向方位角,而决定球机画面视场范围的是Z,即zoom,变倍系数,其中,P和T可以统称为球机的方位角,用PT值表示。如图1所示,其中,PT值的表示形式可以为(P,T),P指的是pan,代表水平方向方位角;T指的是tilt,代 表竖直方向方位角。可以理解的,zoom越大,放大倍率越大,则同一个目标在PTZ相机所采集到的画面中所占据像素值越多,但是所采集到的画面的总体视场角越小。(3) Dome camera: a camera used to observe the details of the target. Specifically, in the embodiment of the present application, the dome camera refers to a dome camera having PTZ (pan / tilt / zoom) direction and zoom information, and may also be referred to as a PTZ camera. Among them, P refers to pan, which represents the azimuth angle in the horizontal direction; T refers to tilt, which represents the azimuth angle in the vertical direction, and determines the range of the field of view of the dome camera is Z, which is the zoom factor. Among them, P and T can be collectively referred to as the azimuth of the ball machine, which is expressed by the PT value. As shown in Figure 1, the PT value can be expressed as (P, T), where P refers to pan and represents the horizontal azimuth; T refers to tilt and represents the vertical azimuth. It can be understood that the larger the zoom and the larger the magnification, the more pixels the same target will occupy in the picture captured by the PTZ camera, but the smaller the overall field of view angle of the captured picture.
在本申请实施例中,球机的特点是方位角可以变化,一般根据球机镜头类型的不同,球机在水平方向上可以旋转的角度范围为(0,180)度或(0,360)度,在竖直方向上可以旋转的角度范围为(-90,90)度。而当球机的方位角改变之后,球机的拍摄角度会发生变化,可以理解的,对于三维空间中位置固定的一个点而言,在同一个球机处于不同方位角时采集到的画面中的所对应的点的坐标不同。通常,可以用球机当前的方位角表征球机当前所采集到的画面中心点的坐标,即球机采集到的画面的中心点的坐标可以表示为球机采集该画面时的PT值。In the embodiment of the present application, the characteristic of the dome camera is that the azimuth angle can be changed. Generally, according to the type of the dome camera, the range of angle that the dome camera can rotate in the horizontal direction is (0,180) degrees or (0,360) degrees. The angle range that can be rotated in the straight direction is (-90,90) degrees. When the azimuth of the dome camera is changed, the shooting angle of the dome camera will change. It is understandable that for a fixed point in three-dimensional space, the images collected when the same dome camera is at different azimuth angles The coordinates of the corresponding points are different. Generally, the coordinates of the center point of the picture currently collected by the dome camera can be characterized by the current azimuth of the dome camera, that is, the coordinates of the center point of the picture collected by the dome camera can be expressed as the PT value when the dome camera collects the picture.
球机的方位角与变倍系数可以统称为球机的视场角信息,显然,当球机的视场角信息不同时,其拍摄角度和画面视场范围也不同。通常,当一个球机在生产完成出厂时,球机的生产厂商会给出该球机的视场角信息表格,例如,如表1所示,为某个球机的视场角信息表格。The azimuth and zoom factor of the dome camera can be collectively referred to as the field of view information of the dome camera. Obviously, when the field of view information of the dome camera is different, the shooting angle and the field of view of the screen are also different. Generally, when a dome is manufactured and shipped, the manufacturer of the dome will give a field of view information table of the dome, for example, as shown in Table 1, it is a field of view information table of a certain dome.
表1Table 1
ZOOMZOOM 11 1.11.1 1.21.2 1.31.3 ...
PANPAN 56.7804956.78049 54.6050154.60501 51.6146851.61468 49.7859849.78598 ...
TILTTILT 33.8185233.81852 32.3798432.37984 30.4324630.43246 29.2565829.25658 ...
由于球机本身可以进行旋转变倍,从而改变球机的方位角和倍率,因此,同一个球机可以从不同的拍摄角度对同一拍摄对象进行拍摄,并且可以根据倍率的不同,同一拍摄对象在不同的画面中所占据的区域大小也不同。Since the dome itself can be rotated and zoomed to change the azimuth and magnification of the dome camera, the same dome camera can shoot the same subject from different shooting angles, and according to the different magnification, the same subject is The size of the area occupied in different pictures is also different.
例如,如图2所示,在图2a中,目标区域201位于球机采集到的画面右侧,并对其进行了标记;之后球机旋转改变其方位角,在图2b中,显然,目标区域201的位置发生了变化,位于球机采集到的画面左侧;再然后,球机进行了变倍,在图2c中,显然,目标区域201的位置和大小均发生了变化。For example, as shown in FIG. 2, in FIG. 2a, the target area 201 is located on the right side of the screen captured by the dome camera, and it is marked; then the dome camera rotates to change its azimuth. In FIG. 2b, it is clear that the target The position of the area 201 has changed, and is located on the left side of the screen collected by the dome camera. Then, the dome camera is zoomed. In FIG. 2c, it is clear that the position and size of the target area 201 have changed.
(3)鱼眼相机:鱼眼相机是指带有鱼眼镜头的相机,所谓鱼眼镜头是一种焦距极短并且视角接近或大于等于180度的镜头。鱼眼镜头作为一种极端的广角镜头,采集到的画面具有非常大的形变,从而使得除了画面中心的景物 保持不变,其他本应水平或垂直的景物都发生了相应的变化,这种形变可以称之为畸变。具体的,如图3所示,为某个鱼眼相机采集得到的画面。(3) Fisheye camera: A fisheye camera is a camera with a fisheye lens. The so-called fisheye lens is a lens with a very short focal length and a viewing angle close to or greater than 180 degrees. As an extreme wide-angle lens, the fisheye lens has a very large deformation, so that except for the scene in the center of the picture, other scenes that should be horizontal or vertical have changed accordingly. This deformation can be Call it distortion. Specifically, as shown in FIG. 3, a picture acquired by a certain fisheye camera.
为了建立相机间准确的坐标转换关系,对于鱼眼相机采集到的画面,可以进行畸变矫正操作,而畸变矫正之后的鱼眼相机采集到的画面则可以视作枪机采集到的画面。In order to establish an accurate coordinate conversion relationship between cameras, the images collected by the fisheye camera can be corrected for distortion, and the images collected by the fisheye camera after distortion correction can be regarded as the images collected by the gun.
具体的,可以采用稳定的张正友标定法对鱼眼相机采集到的画面进行畸变矫正,具体的:Specifically, the stable Zhang Zhengyou calibration method can be used to correct the distortion of the picture collected by the fisheye camera. Specifically:
A、首先采集若干张画面中带有完整清晰标定板的图片;A. First collect several pictures with complete and clear calibration boards in the pictures;
B、利用OpenCV(Open Source Computer Vision Library,开源计算机视觉库)对应函数检测对应的标定板上的角点;B. Use the corresponding function of OpenCV (Open Source Computer Vision Library) to detect the corner points on the corresponding calibration board;
C、根据标定板尺寸确定这些角点对应三维点的三维坐标;C. Determine the three-dimensional coordinates of the three-dimensional points corresponding to the corner points according to the size of the calibration plate;
D、根据相机类型,调用OpenCV对应函数得到相机的内参和畸变参数;D. According to the camera type, call the OpenCV corresponding function to obtain the camera's internal parameters and distortion parameters;
E、根据内参和畸变参数,参考不同的相机类型得到畸变画面与矫正画面的坐标映射表。E. According to internal parameters and distortion parameters, refer to different camera types to obtain the coordinate mapping table of the distorted picture and the corrected picture.
其中,相机的内参可以用下面的公式统一表示:Among them, the camera's internal parameters can be uniformly expressed by the following formula:
Figure PCTCN2019104535-appb-000001
Figure PCTCN2019104535-appb-000001
其中,(cx,cy)是基准点(通常可以为画面的中心点),fx,fy是相机的焦距,其单位为像素。当画面升采样或者降采样时,参数(fx,fy,cx,cy)都将被缩放(乘或者除)同样的尺度。需要说明的是,相机的内参不依赖相机所对应的场景的视图角,当相机的焦距固定时,计算得到的相机的内参也是固定的,可以被重复使用。Among them, (cx, cy) is the reference point (usually the center point of the screen), fx, fy is the focal length of the camera, and its unit is pixel. When the picture is up-sampled or down-sampled, the parameters (fx, fy, cx, cy) will be scaled (multiplied or divided) by the same scale. It should be noted that the internal parameters of the camera do not depend on the view angle of the scene corresponding to the camera. When the focal length of the camera is fixed, the calculated internal parameters of the camera are also fixed and can be reused.
在很多时候,当枪机的视场角过大时,该枪机采集到的画面也会出现畸变,如图4所示。这种情况下,对于视场角过大的枪机采集到的出现畸变的画面,也可以采用上述张正友标定法对这些画面进行畸变矫正。In many cases, when the field of view of the gun is too large, the picture captured by the gun will also be distorted, as shown in Figure 4. In this case, for the distorted pictures collected by the gun with a large viewing angle, the above-mentioned Zhang Zhengyou calibration method can also be used to correct the distortion of these pictures.
需要说明的是,由于要考虑到鱼眼相机近似圆形成像的特点,因此,对于视场角过大的枪机而言,鱼眼相机在畸变矫正过程中的计算方法不同。It should be noted that due to the characteristics of the fisheye camera's approximate circular imaging, the calculation method of the fisheye camera in the distortion correction process is different for a gun with a large field of view.
(4)在本申请实施例中所提到的枪机,不但包括相机类型为枪机的摄像机,还包括对采集到的画面进行畸变矫正后的鱼眼相机,以及雷达、热成像 相机等可以提供固定二维成像信息的设备。(4) The guns mentioned in the embodiments of the present application include not only cameras with a camera type of guns, but also fisheye cameras that correct the distortion of the captured images, as well as radar and thermal imaging cameras. A device that provides fixed two-dimensional imaging information.
下面对本申请实施例提供的一种画面间区域映射方法进行介绍。The following describes an inter-screen region mapping method provided by an embodiment of the present application.
需要说明的是,本申请实施例提供的一种画面间区域映射方法可以应用于多相机观测系统的控制器。具体的,该控制器可以是平板电脑、笔记本电脑、台式电脑等各种电子设备,对此,本申请实施例不做具体限定。It should be noted that the method for mapping regions between pictures provided in the embodiments of the present application can be applied to a controller of a multi-camera observation system. Specifically, the controller may be various electronic devices such as a tablet computer, a notebook computer, and a desktop computer, and this embodiment is not specifically limited.
图5为本申请实施例提供的一种画面间区域映射方法的流程示意图,如图5所示,该画面间区域映射方法可以包括如下步骤:FIG. 5 is a schematic flowchart of an inter-screen region mapping method according to an embodiment of the present application. As shown in FIG. 5, the inter-screen region mapping method may include the following steps:
S501:确定在待区域映射的第一画面中所指定的目标区域;S501: Determine a target area specified in a first picture to be area-mapped;
可以理解的,所谓画面间区域映射是当一个画面中给定目标区域后,在另一画面中有效确定与该目标区域对应的区域,从而使得目标区域和所确定的区域的画面内容可以针对同一拍摄对象。这样,当需要对某一拍摄对象在画面中的区域进行画面处理时,便可以通过画面间区域映射方法在多个拍摄角度采集到的不同的画面中确定该拍摄对象对应的区域,并对所确定的画面区域进行处理。It is understandable that the so-called inter-screen region mapping is that when a target region is given in one screen, the region corresponding to the target region is effectively determined in another screen, so that the screen content of the target region and the determined region can be directed to the same The subject. In this way, when it is necessary to perform image processing on the area of a certain subject in the picture, the area corresponding to the subject can be determined in different pictures collected from multiple shooting angles through the inter-screen area mapping method, and The determined screen area is processed.
在本申请实施例中,可以将这些多个角度采集到的不同的画面称为待区域映射的画面,用来确定目标区域的画面可以称为待区域映射的第一画面。In the embodiment of the present application, the different pictures collected from these multiple angles may be referred to as pictures to be area mapped, and the picture used to determine the target area may be referred to as the first picture to be area mapped.
需要说明的是,在上述步骤S501中,控制器可以根据用户输入的目标区域确定指令在待区域映射的第一画面中确定所指定的目标区域。It should be noted that, in the above step S501, the controller may determine the designated target area in the first screen to be mapped based on the target area determination instruction input by the user.
例如,用户可以通过拖动鼠标在第一画面中标注出目标区域,则控制器便可以将鼠标光标所经过的路径围绕的区域作为目标区域;又例如,如果该第一画面通过触摸屏显示,则用户还可以直接用手在该触摸屏中标注出目标区域,则控制器便可以将用户手指在触摸屏中所经过的路径围绕的区域作为目标区域;再例如,用户可以向控制器输入若干个画面中像素点的坐标,则控制器可以将这些坐标所对应的像素点的连线围绕的区域作为目标区域。For example, the user can mark the target area on the first screen by dragging the mouse, and the controller can use the area surrounded by the path the mouse cursor passes as the target area; for example, if the first screen is displayed on the touch screen, then The user can also mark the target area directly on the touch screen with the hand, and the controller can use the area surrounded by the path that the user's finger travels on the touch screen as the target area; for example, the user can input several screens The coordinates of the pixel points, the controller may use the area surrounded by the line of the pixel points corresponding to these coordinates as the target area.
此外,在上述步骤S501中,控制器还可以按照预设规则在上述第一画面中将特定拍摄对象所对应的区域确定为目标区域。In addition, in step S501, the controller may further determine, as a target region, a region corresponding to a specific photographic object in the first screen according to a preset rule.
例如,当第一画面的拍摄对象为某个人时,控制器可以按照预设规则在第一画面中将拍摄对象的面部所对应的画面作为目标区域。For example, when the subject of the first picture is a person, the controller may use the picture corresponding to the face of the subject as the target area in the first picture according to a preset rule.
当然,在本申请实施例中,在执行上述步骤S501时,除上述说明外,控 制器还可以通过其他方式确定在待区域映射的第一画面中所指定的目标区域,这些能够确定在待区域映射的第一画面中所指定的目标区域的方式均属于本申请实施例的保护范围。Of course, in the embodiment of the present application, when the above step S501 is performed, in addition to the above description, the controller may also determine the target area specified in the first screen mapped by the area to be mapped in other ways. The manners of the target area specified in the mapped first picture all belong to the protection scope of the embodiment of the present application.
S502:确定第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。S502: Determine a target coordinate conversion relationship between a camera to which a first picture belongs and a camera to which a second picture to be mapped belongs.
每个待区域映射的画面均是由相机拍摄得到的,则在本申请实施例中,控制器可以确定待区域映射的第一画面所属相机和待区域映射的第二画面所属相机之间的目标坐标转换关系。Each frame to be mapped is obtained by a camera. In an embodiment of the present application, the controller may determine a target between the camera to which the first frame to be mapped belongs and the camera to which the second frame to be mapped belongs. Coordinate conversion relationship.
为了描述方便,可以将待区域映射的第一画面所属相机简称为第一画面所属相机,将待区域映射的第二画面所属相机简称为第二画面所属相机。For the convenience of description, the camera to which the first picture to be area mapped belongs to the camera to which the first picture belongs, and the camera to which the second picture to be area map belongs to the camera to which the second picture belongs.
在实际应用中,不同的场景下第一画面所属相机和第二画面所属相机可以不同。具体的,第一画面所属相机和第二画面所属相机可以为以下多种情况中的一种:In actual applications, the camera to which the first picture belongs and the camera to which the second picture belongs may be different in different scenarios. Specifically, the camera to which the first picture belongs and the camera to which the second picture belongs may be one of the following situations:
第一种情况,第一画面所属相机为枪机,第二画面所属相机为球机;In the first case, the camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera;
第二种情况,第一画面所属相机为球机,第二画面所属相机为枪机;In the second case, the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
第三种情况,第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定;In the third case, the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed;
第四种情况,第一画面所属相机和第二画面所属相机为同一个球机,且第一画面为该球机的方位角为初始方位角时采集到的画面;In the fourth case, the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome, and the first picture is a picture acquired when the azimuth of the dome is the initial azimuth;
第五种情况,第一画面所属相机和第二画面所属相机为不同的枪机。In the fifth case, the camera to which the first picture belongs and the camera to which the second picture belongs are different guns.
当然,除上述各种情况外,第一画面所属相机和第二画面所属相机还可以为其他情况,这都是合理的。Of course, in addition to the above-mentioned various situations, the camera to which the first picture belongs and the camera to which the second picture belongs may also be other situations, which are all reasonable.
需要再次说明的是,上述各种情况中所提到的枪机,不但包括相机类型为枪机的摄像机,还包括对采集到的画面进行畸变矫正后的鱼眼相机,以及雷达、热成像相机等可以提供固定二维成像信息的设备。It needs to be explained again that the guns mentioned in the above cases include not only cameras with a camera type of guns, but also fish-eye cameras with distortion correction on the captured images, as well as radar and thermal imaging cameras. And other equipment that can provide fixed two-dimensional imaging information.
此外,上述步骤S501和步骤S502的执行顺序可以是先执行步骤S501,再执行步骤S502,也可以是先执行步骤S502,再执行步骤S501。这都是合理的。In addition, the execution order of the above steps S501 and S502 may be to execute step S501 first, then step S502, or execute step S502 first, and then step S501. This is all reasonable.
S503:基于目标区域和目标坐标转换关系,在第二画面中确定与目标区域对应的区域。S503: Determine a region corresponding to the target region in the second screen based on the target region and the target coordinate conversion relationship.
其中,由于在本申请实施例中是基于目标区域和目标坐标转换关系实现画面间坐标映射的,且目标坐标转换关系是建立的相机与相机之间的坐标关系,因此,在本申请实施例中,控制器在执行上述步骤S503之前,可以只需要确定第一画面所属相机、第二画面所属相机及待区域映射的第一画面,也可以确定第一画面所属相机、第二画面所属相机、待区域映射的第一画面和待区域映射的第二画面,这都是合理的。Wherein, in the embodiment of the present application, coordinate mapping between screens is implemented based on the target area and the target coordinate conversion relationship, and the target coordinate conversion relationship is the established coordinate relationship between the camera and the camera. Therefore, in the embodiment of the application, Before executing the above step S503, the controller may only need to determine the camera to which the first picture belongs, the camera to which the second picture belongs, and the first picture to be mapped to the area, or determine the camera to which the first picture belongs, the camera to which the second picture belongs, The first picture of the area mapping and the second picture of the area mapping are both reasonable.
在确定待区域映射的第一画面中所标定的目标区域及第一画面所属相机和第二画面所属相机的目标坐标转换关系后,控制器便可以基于目标区域和目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域。After determining the target area marked in the first picture mapped to the area to be mapped and the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, the controller can then A region corresponding to the target region is determined in the mapped second picture.
需要说明的是,在上述步骤S501-S503中,第一画面仅用来表示控制器在完成一次画面间区域映射时,用于确定目标区域的待区域映射的画面,第二画面仅用来表示控制器在完成该次画面间区域映射时,需要在画面中确定与目标区域对应的区域的画面。It should be noted that, in the above steps S501-S503, the first screen is only used to indicate the screen used for determining the target region to be mapped when the controller completes the area mapping between screens once, and the second screen is only used to indicate When the controller completes the inter-screen area mapping, it needs to determine the screen of the area corresponding to the target area in the screen.
可选的,一种具体实现方式中,当在该第二画面中确定与目标区域对应的区域的画面后,该第二画面可以作为控制器在完成下一次画面间区域映射时用于确定目标区域的待区域映射的画面,即该第二画面可以作为控制器在完成下一次画面间区域映射时的第一画面,则在该第二画面中确定的与目标区域对应的区域的画面可以作为控制器在完成下一次画面间区域映射时的目标区域,以此类推,则可以完成从待区域映射的第一张画面到最后一张画面的区域映射。Optionally, in a specific implementation manner, after a picture of an area corresponding to a target area is determined in the second picture, the second picture can be used by the controller to determine the target when completing the next area mapping between pictures. The area-to-area-mapped picture, that is, the second picture can be used as the first picture when the controller completes the next area mapping between pictures, and then the picture of the area corresponding to the target area determined in the second picture can be used as When the controller completes the target area for the next area mapping between pictures, and so on, the area mapping from the first picture to the last picture to be area mapped can be completed.
可选的,另一种具体实现方式中,控制器可以确定多组第一画面所属相机和第二画面所属相机,则在执行上述步骤S502时,控制器可以确定该多组第一画面所属相机和第二画面所属相机中每组第一画面所属相机和第二画面所属相机所对应的目标坐标转换关系,进而,针对每组第一画面所属相机和第二画面所属相机的目标坐标转换关系,执行上述步骤S503。即控制器可以通过执行多次上述步骤S502-S503,实现从步骤S501中的第一画面分别到多张待区域映射的第二画面的区域映射。也就是说,控制器可以将在待区域映射的第一画面中确定的目标区域映射到多张第二画面中。其中,控制器可以针对每组第一画面所属相机和第二画面所属相机,并行执行上述步骤S502-S503,也可以按照顺序,针对每组第一画面所属相机和第二画面所属相机,依次执行上述步骤S502-S503。Optionally, in another specific implementation manner, the controller may determine a plurality of groups of cameras to which the first picture belongs and a camera to which the second picture belongs, and when the foregoing step S502 is performed, the controller may determine the cameras to which the plurality of groups of first pictures belong And the target coordinate conversion relationship corresponding to the camera belonging to the first frame and the camera belonging to the second frame in each group of cameras belonging to the second frame, and further, for each group of target coordinate conversion relationships between the camera to which the first frame belongs and the camera to which the second frame belongs, The above step S503 is performed. That is, the controller may execute the above-mentioned steps S502-S503 multiple times to implement area mapping from the first picture in step S501 to the second pictures to be mapped on the plurality of areas to be mapped. That is, the controller may map the target area determined in the first picture to be area-mapped to a plurality of second pictures. The controller may execute the above steps S502-S503 in parallel for each group of cameras to which the first screen belongs and cameras to which the second screen belongs, or may sequentially perform sequentially for each group of cameras to which the first screen belongs and cameras to which the second screen belongs. The above steps S502-S503.
在本申请实施例中,控制器可以采用多种方式执行上述步骤S503,从而 在待区域映射的第二画面中确定与目标区域对应的区域,实现第一画面与第二画面间的区域映射。例如,控制器可以在第二画面中确定与目标区域中的每个像素点对应的像素点,则这些所确定的像素点便可以在第二画面中构成与目标区域对应的区域。In the embodiment of the present application, the controller may perform the foregoing step S503 in various ways, so as to determine an area corresponding to the target area in the second picture to be area-mapped, and implement area mapping between the first picture and the second picture. For example, the controller may determine pixel points corresponding to each pixel point in the target area in the second picture, and these determined pixel points may form an area corresponding to the target area in the second picture.
在本申请实施例中,所谓画面间区域映射也可以理解为:在一个相机采集的画面中选定目标区域内的一个点的坐标,则可以在另一个相机采集的画面中确定与该点对应的点的坐标。因此,可选的,一种具体实现方式中,上述步骤S503可以包括如下的步骤A1-A2:In the embodiment of the present application, the so-called inter-screen area mapping can also be understood as: if the coordinates of a point in a target area are selected in a picture collected by one camera, it can be determined to correspond to the point in a picture collected by another camera The coordinates of the point. Therefore, optionally, in a specific implementation manner, the above step S503 may include the following steps A1-A2:
步骤A1:从目标区域中选取多个特征点,其中,多个特征点为能够表征目标区域的多个像素点;Step A1: selecting multiple feature points from the target area, where the multiple feature points are multiple pixel points capable of characterizing the target area;
在确定目标区域后,控制器可以根据目标区域的形状特征,在目标区域中确定多个能够表征目标区域的像素点作为特征点。After determining the target area, the controller may determine a plurality of pixels in the target area that can characterize the target area as feature points according to the shape characteristics of the target area.
例如,当目标区域为多边形时,控制器可以将目标区域的多个顶点作为特征点,当目标区域为圆形时,控制器可以将目标区域的圆心及圆周上的若干个像素点作为特征点,当目标区域为曲线图形时,控制器可以将目标区域的边缘曲线上曲度变化明显的点作为特征点。For example, when the target area is a polygon, the controller may use multiple vertices of the target area as feature points. When the target area is circular, the controller may use the center of the target area and several pixels on the circumference as feature points. When the target area is a curved graphic, the controller may use the points on the edge curve of the target area with obvious changes in curvature as feature points.
步骤A2:基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域。Step A2: Determine a region corresponding to the target region in the second screen based on the multiple feature points and the target coordinate conversion relationship.
则在确定多个特征点后,控制器便可以直接基于多个特征点和目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域,从而实现第一画面与第二画面间的区域映射。After determining multiple feature points, the controller can directly determine the area corresponding to the target area in the second picture to be mapped based on the multiple feature points and the target coordinate conversion relationship, thereby realizing the first picture and the second Area mapping between screens.
以上可见,在本申请实施例提供的方案中,确定待区域映射的第一画面所属相机和待区域映射的第二画面所属相机之间的目标坐标转换关系,进而,当在待区域映射的第一画面中确定目标区域后,可以根据该目标坐标转换关系和该目标区域,在待区域映射的第二画面中确定与该目标区域对应的区域,以实现当在一个画面中给定目标区域时,在另一画面中有效确定与该目标区域对应的区域。It can be seen from the above that in the solution provided by the embodiment of the present application, the target coordinate conversion relationship between the camera to which the first picture to be area mapped belongs and the camera to which the second picture to be area mapped belongs, and further, when the After the target area is determined in one picture, the area corresponding to the target area can be determined in the second picture to be area mapped according to the target coordinate conversion relationship and the target area, so that when the target area is given in one picture, , Effectively determine the area corresponding to the target area in another picture.
此外,本申请实施例提供的方案可以针对不同类型的相机,具有较好的适应性,同时,根据目标坐标转换关系确定与目标区域对应的区域,由于目标坐标转换关系是根据待区域映射的第一画面所属相机和待区域映射的第二画面所属相机确定的,因此,确定与目标区域对应的区域的操作简便且不需 要依靠额外信息。In addition, the solution provided by the embodiments of the present application can be adapted to different types of cameras, and has a good adaptability. At the same time, the area corresponding to the target area is determined according to the target coordinate conversion relationship. The camera to which a picture belongs and the camera to which the second picture to be mapped belongs are determined. Therefore, the operation of determining the area corresponding to the target area is simple and does not require additional information.
下面,当实际应用中第一画面所属相机和第二画面所属相机不同时,根据所确定的第一画面所属相机和第二画面所属相机的不同,对上述步骤S502和步骤A2进行具体说明。In the following, when the camera to which the first picture belongs and the camera to which the second picture belongs are different in actual application, the foregoing step S502 and step A2 will be specifically described according to the determined camera to which the first picture belongs and the camera to which the second picture belongs.
实施例一、第一画面所属相机为枪机,第二画面所属相机为球机;Embodiment 1 The camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera;
上述步骤S502,确定第一画面所属相机和第二画面所属相机的目标坐标转换关系,可以包括如下的步骤B1-B3:The above step S502, determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, may include the following steps B1-B3:
步骤B1:确定枪机和球机之间的坐标转换关系,作为第一坐标转换关系。Step B1: Determine the coordinate conversion relationship between the gun and the dome camera as the first coordinate conversion relationship.
针对本实施例中的枪机和球机,控制器可以确定该枪机和球机之间的坐标转换关系,并将其作为第一坐标转换关系。For the gun machine and the dome camera in this embodiment, the controller may determine a coordinate conversion relationship between the gun machine and the dome camera, and use the controller as a first coordinate transformation relationship.
具体的,通过下面的例子对枪机和球机之间的坐标转换关系进行说明:假设枪机采集的画面中包括一个点A,其在该画面中的坐标为(xa,ya),此时球机的方位角为(Pa,Ta),通过枪机和球机之间的坐标转换关系,便可以将上述坐标(xa,ya)转换为上述A点相对应于球机的方位角(Pa’,Ta’),则按照该方位角(Pa’,Ta’)旋转球机直到球机的方位角由(Pa,Ta)变为(Pa’,Ta’)时,此时,球机采集的画面的中心点为上述点A所对应的点A’。Specifically, the following example illustrates the coordinate conversion relationship between the gun machine and the dome camera: Suppose that the picture collected by the gun machine includes a point A whose coordinates in the picture are (xa, ya). At this time, The azimuth of the dome camera is (Pa, Ta). Through the coordinate conversion relationship between the gun machine and the dome camera, the above coordinates (xa, ya) can be converted into the azimuth angle of the point A corresponding to the dome camera (Pa, Ta). ', Ta'), then rotate the dome camera according to the azimuth angle (Pa ', Ta') until the dome angle of the dome camera changes from (Pa, Ta) to (Pa ', Ta'). At this time, the dome camera collects The center point of the screen is the point A 'corresponding to the above point A.
步骤B2:确定球机对应的坐标转换关系,作为第二坐标转换关系。Step B2: Determine the coordinate conversion relationship corresponding to the dome camera as the second coordinate conversion relationship.
其中,球机对应的坐标转换关系为:球机的方位角与球机采集到的画面中心点的坐标的转换关系。The coordinate conversion relationship corresponding to the dome camera is the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
针对本实施例中的球机,控制器可以确定该球机对应的坐标转换关系,并将其作为第二坐标转换关系。For the dome camera in this embodiment, the controller may determine the coordinate conversion relationship corresponding to the dome camera, and use it as the second coordinate conversion relationship.
具体的,通过下面的例子对球机对应的坐标转换关系进行说明:假设球机采集的画面中包括一个点B,该点B处于该画面的非中心点处,其在该画面中的坐标为(xb,yb),此时球机的方位角为(Pb,Tb),通过球机对应的坐标转换关系,便可以将上述坐标(xb,yb)转为上述点B对应于球机的方位角(Pb’,Tb’),则按照该方位角(Pb’,Tb’)旋转球机直到球机的方位角由(Pb,Tb)变为(Pb’,Tb’)时,此时,球机采集的画面的中心点为上述点B对应的点B’。Specifically, the following example illustrates the coordinate conversion relationship of the dome camera: Suppose that the picture collected by the dome camera includes a point B, which is at a non-center point of the picture, and its coordinates in the picture are (xb, yb). At this time, the azimuth of the dome is (Pb, Tb). Through the coordinate conversion relationship corresponding to the dome, the above coordinates (xb, yb) can be converted into the above point B corresponding to the azimuth of the dome. Angle (Pb ', Tb'), then rotate the dome camera according to the azimuth angle (Pb ', Tb') until the azimuth angle of the dome camera changes from (Pb, Tb) to (Pb ', Tb'), at this time, The center point of the picture collected by the dome camera is the point B ′ corresponding to the above point B.
步骤B3:将第一坐标转换关系和第二坐标转换关系,确定为第一画面所 属相机和第二画面所属相机的目标坐标转换关系。Step B3: Determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
在确定上述第一坐标转换关系和第二坐标转换关系后,控制器便可以将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和第二画面所属相机的目标坐标转换关系,从而完成上述步骤S502。After determining the first coordinate conversion relationship and the second coordinate conversion relationship, the controller may determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion of the camera to which the first picture belongs and the camera to which the second picture belongs. Relationship, thereby completing step S502 described above.
进而,在确定了第一画面所属相机和第二画面所属相机的目标坐标转换关系后,控制器便可以基于该目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域。Furthermore, after determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship. .
可选的,针对上述实施例一中,第一画面所属相机为枪机,第二画面所属相机为球机的情况,上述步骤A2,基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域,可以包括如下的步骤C1-C4:Optionally, in the case of the first embodiment, the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera. In the above step A2, based on the conversion relationship between multiple feature points and target coordinates, The area corresponding to the target area in the determination may include the following steps C1-C4:
步骤C1:基于第一坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;Step C1: Determine an azimuth corresponding to each feature point based on the first coordinate transformation relationship and the coordinates of the plurality of feature points in the first screen;
可以理解的,控制器在从目标区域中选取多个特征点时,便可以获得这些特征点在第一画面内的坐标,进而,控制器便可以通过上述确定的第一坐标转换关系,将每个特征点在第一画面内的坐标转换为该特征点对应的方位角,即当球机采集的画面的中心点为该特征点对应的点时,球机的方位角。It can be understood that when the controller selects multiple feature points from the target area, the coordinates of the feature points in the first screen can be obtained. Furthermore, the controller can convert each feature point through the first coordinate transformation relationship determined above. The coordinates of each feature point in the first picture are converted into the azimuth angle corresponding to the feature point, that is, when the center point of the picture collected by the dome camera is the point corresponding to the feature point, the dome camera's azimuth angle.
例如,特征点C在第一画面内的坐标为(xc,yc),基于第一坐标转换关系便可以确定该特征点C对应的方位角为(Pc,Tc),特征点D在第一画面内的坐标为(xd,yd),基于第一坐标转换关系便可以确定该特征点D对应的方位角为(Pd,Td)。For example, the coordinate of the feature point C in the first picture is (xc, yc). Based on the first coordinate transformation relationship, it can be determined that the azimuth corresponding to the feature point C is (Pc, Tc), and the feature point D is in the first picture. The internal coordinates are (xd, yd), and based on the first coordinate conversion relationship, it can be determined that the azimuth angle corresponding to the feature point D is (Pd, Td).
步骤C2:在所确定的方位角中选取旋转目标设备所依据的第一方位角,并按照第一方位角旋转目标设备,得到待区域映射的第二画面;其中,目标设备为第二画面所属相机,即为上述球机;Step C2: selecting a first azimuth angle on which the target device is rotated from the determined azimuth angles, and rotating the target device according to the first azimuth angle to obtain a second picture to be area mapped; wherein the target device belongs to the second picture The camera is the above dome camera;
需要说明的是,在本实施例中,待区域映射的第二画面是在控制器执行完上述步骤S502后确定的,也就是说,在本实施例中,待区域映射的第二画面是不确定的,而是基于控制器在上述步骤C1中所确定的多个特征点对应的方位角的某一个确定的。It should be noted that, in this embodiment, the second picture to be area mapped is determined after the controller executes the above step S502, that is, in this embodiment, the second picture to be area mapped is not The determination is based on any one of the azimuth angles corresponding to the multiple feature points determined by the controller in the above step C1.
控制器可以在上述步骤C1中所确定的多个特征点对应的方位角中选取一个方位角作为旋转目标设备所依据的方位角,进而,该被选取的方位角可以作为第一方位角,进而,按照该第一方位角旋转球机,并将旋转后的球机采 集的画面作为待区域映射的第二画面。The controller may select an azimuth angle from the azimuth angles corresponding to the plurality of feature points determined in the above step C1 as the azimuth angle on which the target device is rotated. Further, the selected azimuth angle may be used as the first azimuth angle, and further , Rotating the dome camera according to the first azimuth angle, and using the picture collected by the dome camera after the rotation as the second picture to be area mapped.
例如,特征点C在第一画面内的坐标为(xc,yc),控制器在上述步骤C1中确定的该特征点C对应的方位角为(Pc,Tc),将该方位角(Pc,Tc)作为第一方位角,并按照该方位角(Pc,Tc)旋转球机,直到球机的方位角变为(Pc,Tc),得到此时球机采集的画面作为待区域映射的第二画面。For example, the coordinate of the feature point C in the first picture is (xc, yc), and the azimuth angle corresponding to the feature point C determined by the controller in the above step C1 is (Pc, Tc), and the azimuth angle (Pc, Tc) as the first azimuth, and rotate the dome camera according to the azimuth (Pc, Tc) until the dome of the dome camera becomes (Pc, Tc). The picture collected by the dome camera at this time is used as the first Second picture.
可以理解的,控制器可以通过任意用于选取方位角的方式获得上述第一方位角,例如,可以根据球机拍摄角度的需求,在所确定的多个特征点对应的方位角中选取与预设方位角误差最小的方位角作为第一方位角,又例如,也可以在所确定的多个特征点对应的方位角中随机选取一个方位角作为第一方位角,这都是合理的。It can be understood that the controller can obtain the above-mentioned first azimuth in any manner for selecting the azimuth. For example, according to the requirements of the shooting angle of the dome camera, the controller selects and presets the azimuths corresponding to the determined multiple feature points. It is reasonable to set the azimuth with the smallest azimuth error as the first azimuth. For example, it is also possible to randomly select an azimuth as the first azimuth among the determined azimuths corresponding to the plurality of feature points.
步骤C3:基于第二坐标转换关系,在第二画面中确定各个特征点所对应的第一目标点,其中,任一特征点所对应的第一目标点为:所对应方位角与该特征点对应的方位角相同的像素点;Step C3: Based on the second coordinate transformation relationship, determine the first target point corresponding to each feature point in the second picture, wherein the first target point corresponding to any feature point is: the corresponding azimuth angle and the feature point Corresponding pixels with the same azimuth;
在执行完上述步骤C1-C2后,控制器可以获得各个特征点对应的方位角,以及待区域映射的第二画面对应的球机的方位角,则根据上述对第二坐标转换关系的说明,控制器便可以基于上述第二坐标转换关系,确定各个特征点在上述第二画面中所对应的点的坐标。进而,便可以在第二画面中确定各个特征点所对应的点,并将所确定的点作为该特征点所对应的第一目标点。可以理解的,任一特征点所对应的第一目标点所对应的方位角与控制器在上述步骤C1中确定的该点对应的方位角相同。After performing the above steps C1-C2, the controller can obtain the azimuth corresponding to each feature point and the azimuth corresponding to the dome camera corresponding to the second picture to be area mapped, according to the above description of the second coordinate conversion relationship, The controller may determine the coordinates of points corresponding to the feature points in the second screen based on the second coordinate conversion relationship. Furthermore, a point corresponding to each feature point can be determined in the second picture, and the determined point can be used as a first target point corresponding to the feature point. It can be understood that the azimuth angle corresponding to the first target point corresponding to any feature point is the same as the azimuth angle corresponding to the point determined by the controller in the above step C1.
例如,特征点C在第一画面内的坐标为(xc,yc),控制器在上述步骤C1中确定的该特征点C对应的方位角为(Pc,Tc),特征点D在第一画面内的坐标为(xd,yd),基于第一坐标转换关系便可以确定该特征点D对应的方位角为(Pd,Td)。将上述方位角(Pc,Tc)作为第一方位角,并按照该方位角(Pc,Tc)旋转球机,得到待区域映射的第二画面。则根据球机对应的坐标转换关系,控制器可以在该第二画面中,根据特征点D对应的方位角(Pd,Td),确定特征点D在第二画面中所对应的点D’的坐标为(xd’,yd’)。For example, the coordinates of the feature point C in the first picture are (xc, yc), the azimuth corresponding to the feature point C determined by the controller in the above step C1 is (Pc, Tc), and the feature point D is in the first picture The internal coordinates are (xd, yd), and based on the first coordinate conversion relationship, it can be determined that the azimuth angle corresponding to the feature point D is (Pd, Td). Use the azimuth angle (Pc, Tc) as the first azimuth angle, and rotate the dome camera according to the azimuth angle (Pc, Tc) to obtain a second picture to be area mapped. Then according to the coordinate conversion relationship corresponding to the dome camera, the controller may determine the point D ′ corresponding to the feature point D in the second picture according to the azimuth angle (Pd, Td) corresponding to the feature point D in the second picture. The coordinates are (xd ', yd').
步骤C4:将第二画面中基于多个第一目标点所确定出的区域,作为目标区域对应的区域。Step C4: Use the area determined on the second screen based on the plurality of first target points as the area corresponding to the target area.
在上述第二画面中确定各个特征点所对应的第一目标点后,控制器便基于这些第一目标点在上述第二画面中确定一个区域,进而,便可以将该基于 多个第一目标点所确定出的区域作为上述步骤S501中控制器所确定的目标区域对应的区域。After determining the first target points corresponding to the respective feature points in the second picture, the controller determines an area in the second picture based on the first target points, and further, may be based on the plurality of first targets. The area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
需要说明的是,作为本申请实施例提供的一种实施方式,当第一画面所属相机为球机,第二画面所属相机为枪机时,则在这种情况下,可以通过上述实施例一中提供的步骤B1-B3,确定第一画面所属相机和第二画面所属相机的目标坐标转换关系。It should be noted that, as an implementation manner provided in the embodiment of the present application, when the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine, in this case, the first embodiment may be adopted. Steps B1 to B3 provided in the step determine the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
作为本申请实施例提供的另一种实施方式,当第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定时,则在这种情况下,可以通过上述实施例一中提供的步骤C1-C4,基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域。As another implementation manner provided in the embodiment of the present application, when the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed, In this case, an area corresponding to the target area may be determined in the second screen based on the multiple feature points and the target coordinate conversion relationship through steps C1-C4 provided in the first embodiment.
实施例二、第一画面所属相机为球机,第二画面所属相机为枪机;Embodiment 2 The camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
在本实施例中,上述步骤S502,确定第一画面所属相机和第二画面所属相机的目标坐标转换关系的方式可以与上述实施例一中提供的步骤B1-B3相同,在此不再赘述。In this embodiment, the method of determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs may be the same as steps B1-B3 provided in the first embodiment, and details are not described herein again.
进而,在确定了第一画面所属相机和第二画面所属相机的目标坐标转换关系后,控制器便可以基于该目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域。Furthermore, after determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship. .
可选的,针对上述实施例二中,第一画面所属相机为球机,第二画面所属相机为枪机的情况,上述步骤A2,基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域,可以包括如下的步骤D1-D3:Optionally, for the case where the camera to which the first picture belongs is a dome camera and the camera to which the second picture belongs is a gun machine in the second embodiment, the above step A2 is based on a plurality of feature points and target coordinate conversion relationships in the second picture. The region corresponding to the target region in the determination may include the following steps D1-D3:
步骤D1:基于第二坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角。Step D1: Determine the azimuth corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of the plurality of feature points in the first screen.
其中,根据上述实施例一中对第二坐标转换关系的说明,则在本实施例二中,第二坐标转换关系为球机的方位角与球机采集到的画面中心点的坐标的转换关系。此外,控制器在从目标区域中选取多个特征点时,便可以获得这些特征点在第一画面内的坐标。因此,在确定第二坐标转换关系后,根据该第二坐标转换关系,控制器便可以确定基于该第二坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角,即针对每个特征点,当球机采集的画面的中心点为该特征点时,球机的方位角。Wherein, according to the description of the second coordinate conversion relationship in the first embodiment, in the second embodiment, the second coordinate conversion relationship is the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera. . In addition, when the controller selects multiple feature points from the target area, the controller can obtain the coordinates of the feature points in the first frame. Therefore, after the second coordinate transformation relationship is determined, the controller can determine the coordinates corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of multiple feature points in the first screen based on the second coordinate transformation relationship. The azimuth angle refers to the azimuth angle of the dome camera for each feature point when the center point of the picture collected by the dome camera is the feature point.
例如,特征点E在第一画面内的坐标为(xe,ye),基于第二坐标转换关系,控制器便可以确定该特征点E对应的方位角为(Pe,Te)。For example, the coordinate of the feature point E in the first picture is (xe, ye). Based on the second coordinate conversion relationship, the controller can determine that the azimuth angle corresponding to the feature point E is (Pe, Te).
步骤D2:基于第一坐标转换关系和所确定的各个特征点对应的方位角,在第二画面中确定各个特征点所对应的第二目标点。Step D2: Determine a second target point corresponding to each feature point in the second picture based on the first coordinate conversion relationship and the determined azimuth corresponding to each feature point.
其中,可以理解的,第二画面为球机采集到的画面。It can be understood that the second picture is a picture collected by the dome camera.
根据上述实施例一种对第一坐标转换关系的说明,则在本实施例二中,第一坐标转换关系为枪机和球机之间的坐标转换关系,即针对每个特征点,控制器可以通过上述第一坐标转换关系,将在上述步骤D1中确定的、该特征点对应的方位角转化为与该特征点对应的点在该第二画面中的坐标。进而,便可以在第二画面中确定各个特征点所对应的点,并将所确定的点作为该特征点所对应的第二目标点。可以理解的,任一特征点所对应的第二目标点所对应的方位角与控制器在上述步骤D1中确定的该电对应的方位角相同。According to the description of the first coordinate conversion relationship in the foregoing embodiment, in the second embodiment, the first coordinate conversion relationship is a coordinate conversion relationship between a gun machine and a ball machine, that is, for each feature point, the controller The azimuth angle corresponding to the feature point determined in the above step D1 may be converted into the coordinates of the point corresponding to the feature point in the second screen through the first coordinate conversion relationship. Furthermore, a point corresponding to each feature point can be determined in the second picture, and the determined point can be used as a second target point corresponding to the feature point. It can be understood that the azimuth angle corresponding to the second target point corresponding to any feature point is the same as the azimuth angle corresponding to the electrical determined by the controller in the above step D1.
例如,特征点E在第一画面内的坐标为(xe,ye),基于第二坐标转换关系,控制器确定的该特征点E对应的方位角为(Pe,Te),球机采集上述第二画面时的方位角为(Pe’,Te’),则基于第一坐标转换关系,控制器便可以在第二画面中,根据特征点E对应的方位角(Pe,Te),确定该特征点E对应的点E’的坐标为(xe’,ye’)。For example, the coordinate of the feature point E in the first picture is (xe, ye). Based on the second coordinate conversion relationship, the azimuth corresponding to the feature point E determined by the controller is (Pe, Te). The azimuth in the second picture is (Pe ', Te'), based on the first coordinate conversion relationship, the controller can determine the feature in the second picture according to the azimuth (Pe, Te) corresponding to the feature point E The coordinates of the point E 'corresponding to the point E are (xe', ye ').
步骤D3:将第二画面中基于多个第二目标点所确定出的区域,作为目标区域对应的区域。Step D3: Use the area determined on the second screen based on the plurality of second target points as the area corresponding to the target area.
在上述第二画面中确定各个特征点所对应的第二目标点后,控制器便基于这些第二目标点在上述第二画面中确定一个区域,进而,便可以将该基于多个第二目标点所确定出的区域作为上述步骤S501中控制器所确定的目标区域对应的区域。After the second target points corresponding to each feature point are determined in the second picture, the controller determines an area in the second picture based on the second target points, and further, the controller can determine the area based on the plurality of second targets. The area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
实施例三、第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定;Embodiment 3, the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed;
上述步骤S502,确定目标相机所对应的目标坐标转换关系,可以包括如下步骤E1-E3:The above step S502, determining the target coordinate conversion relationship corresponding to the target camera, may include the following steps E1-E3:
步骤E1:确定第一球机和第二球机之间的坐标转换关系,作为第一坐标转换关系;Step E1: Determine a coordinate conversion relationship between the first dome camera and the second dome camera as the first coordinate transformation relationship;
针对该目标相机中所包括的第一球机和第二球机,控制器可以确定该第一球机和第二球机之间的坐标转换关系,并将其作为第一坐标转换关系。For the first dome camera and the second dome camera included in the target camera, the controller may determine a coordinate conversion relationship between the first dome camera and the second dome camera, and use the controller as the first coordinate transformation relationship.
需要说明的是,由于在本实施例三中第一球机的方位角是固定的,因此,在本实施例三中该第一球机可以视作一个枪机。It should be noted that, since the azimuth of the first dome camera is fixed in the third embodiment, the first dome camera can be regarded as a gun machine in the third embodiment.
则具体的,通过下面的例子对第一球机和第二球机之间的坐标转换关系进行说明:假设第一球机采集的画面中包括一个点F,其在该画面中的坐标为(xf,yf),此时球机的方位角为(Pf,Tf),通过第一球机和第二球机之间的坐标转换关系,便可以将上述坐标(xf,yf)转换为上述F点相对应于球机的方位角(Pf’,Tf’),则按照该方位角(Pf’,Tf’)旋转球机直到球机的方位角由(Pf,Tf)变为(Pf’,Tf’)时,此时,球机采集的画面的中心点为上述F点所对应的点F’。Specifically, the following example illustrates the coordinate conversion relationship between the first dome camera and the second dome camera: Suppose that the picture collected by the first dome camera includes a point F, and its coordinates in the picture are ( xf, yf). At this time, the azimuth of the dome camera is (Pf, Tf). Through the coordinate conversion relationship between the first dome camera and the second dome camera, the above coordinates (xf, yf) can be converted into the above F. The point corresponds to the azimuth angle (Pf ', Tf') of the dome camera, then the dome camera is rotated according to the azimuth angle (Pf ', Tf') until the azimuth angle of the dome camera changes from (Pf, Tf) to (Pf ', Tf '), at this time, the center point of the picture collected by the dome camera is the point F' corresponding to the above-mentioned F point.
步骤E2:确定第二球机对应的坐标转换关系,作为第二坐标转换关系。Step E2: Determine the coordinate conversion relationship corresponding to the second dome camera as the second coordinate conversion relationship.
其中,第二球机对应的坐标转换关系为:第二球机的方位角与第二球机采集到的画面中心点的坐标的转换关系。The coordinate conversion relationship corresponding to the second dome camera is: the conversion relationship between the azimuth of the second dome camera and the coordinates of the center point of the picture collected by the second dome camera.
在上述步骤E2中,确定第二球机对应的坐标转换关系,并将其作为第二坐标转换关系的方式可以与上述步骤B2中,确定球机对应的坐标转换关系,并将其作为第二坐标转换关系的方式相同,在此不再赘述。In the above step E2, the method of determining the coordinate conversion relationship corresponding to the second dome camera and using it as the second coordinate conversion relationship may be the same as the above step B2, determining the coordinate conversion relationship corresponding to the dome camera and using it as the second The manner of the coordinate conversion relationship is the same, and is not repeated here.
步骤E3:将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和第二画面所属相机的目标坐标转换关系。Step E3: Determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
在确定上述第一坐标转换关系和第二坐标转换关系后,控制器便可以将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和第二画面所属相机的目标坐标转换关系,从而完成上述步骤S502。After determining the first coordinate conversion relationship and the second coordinate conversion relationship, the controller may determine the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion of the camera to which the first picture belongs and the camera to which the second picture belongs. Relationship, thereby completing step S502 described above.
进而,在确定了第一画面所属相机和第二画面所属相机的目标坐标转换关系后,控制器便可以基于该目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域。Furthermore, after determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship. .
可选的,针对上述实施例三中,第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定的情况,上述步骤A2,基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域的方式可以与针对上述实施例一中,第一画面所属相机为枪机,第二画面所属相机为球机的情况所提供的步骤C1-C4相同,在此不再赘述。Optionally, for the third embodiment, the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed. The above step A2 is based on multiple The relationship between the feature points and the target coordinate conversion. The way to determine the area corresponding to the target area in the second picture can be the same as that for the first embodiment described above. The camera to which the first picture belongs is a gun and the camera to which the second picture belongs is a dome The steps C1-C4 provided in the situation are the same, and will not be repeated here.
其中,需要说明的是,针对上述实施例一中,第一画面所属相机为枪机,第二画面所属相机为球机的情况,上述步骤C2中的目标设备为第二画面所属的球机;而针对上述本实施例三中,第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定的情况,上述步骤C2中的目标设备为第二画面所属的第二球机。It should be noted that, in the first embodiment, the camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera, and the target device in the above step C2 is a dome camera to which the second picture belongs; For the third embodiment described above, the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed. The target device in the above step C2 is The second ball machine to which the second screen belongs.
实施例四、第一画面所属相机和第二画面所属相机为同一个球机,且第一画面为该球机的方位角为初始方位角时采集的画面;Embodiment 4: The camera to which the first picture belongs and the camera to which the second picture belongs are the same dome, and the first picture is a picture acquired when the azimuth of the dome is the initial azimuth;
上述步骤S502,确定第一画面所属相机和第二画面所属相机的目标坐标转换关系,可以包括如下步骤F1-F2:The above step S502, determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, may include the following steps F1-F2:
步骤F1:确定球机对应的坐标转换关系。Step F1: Determine the coordinate conversion relationship corresponding to the dome camera.
其中,球机对应的坐标转换关系为:球机的方位角与球机采集到的画面中心点的坐标的转换关系;The coordinate conversion relationship corresponding to the dome camera is: the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera;
在上述步骤F1中,控制器确定球机对应的坐标转换关系的方式可以与上述步骤B2中,确定球机对应的坐标转换关系的方式相同,在此不再赘述。In the foregoing step F1, the manner in which the controller determines the coordinate conversion relationship corresponding to the dome camera may be the same as the manner in which the coordinate conversion relationship corresponding to the dome camera is determined in step B2, and details are not described herein again.
步骤F2:将球机对应的坐标转换关系作为第一画面所属相机和第二画面所属相机的目标坐标转换关系。Step F2: Use the coordinate conversion relationship corresponding to the dome camera as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
在确定球机对应的坐标转换关系后,控制器便可以将球机对应的坐标转换关系,确定为第一画面所属相机和第二画面所属相机的目标坐标转换关系,从而完成上述步骤S502。After determining the coordinate conversion relationship corresponding to the dome camera, the controller may determine the coordinate conversion relationship corresponding to the dome camera as the target coordinate conversion relationship of the camera to which the first picture belongs and the camera to which the second picture belongs, thereby completing the above step S502.
进而,在确定了第一画面所属相机和第二画面所属相机的目标坐标转换关系后,控制器便可以基于该目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域。Furthermore, after determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship. .
可选的,针对上述实施例四中,第一画面所属相机和第二画面所属相机为同一个球机,且第一画面为该球机的方位角为初始方位角时采集的画面的情况,上述步骤A2,基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域,可以包括如下的步骤G1-G4:Optionally, in the fourth embodiment described above, the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome camera, and the first picture is a picture acquired when the azimuth of the dome camera is the initial azimuth angle. The above step A2, based on the multiple feature points and the target coordinate conversion relationship, to determine the area corresponding to the target area in the second screen, may include the following steps G1-G4:
步骤G1:基于目标坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;Step G1: Determine the azimuth corresponding to each feature point based on the target coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen;
其中,在本实施例四中,目标坐标转换关系为球机对应的坐标转换关系,即球机的方位角与球机采集到的画面中心点的坐标的转换关系。此外,控制器在从目标区域中选取多个特征点时,便可以获得这些特征点在第一画面内的坐标。进而,在确定目标坐标转换关系后,根据该目标坐标转换关系,控制器便可以确定基于该目标坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角,即针对每个特征点,当球机采集的画面的中心点为该特征点时,球机的方位角。Wherein, in the fourth embodiment, the target coordinate conversion relationship is the coordinate conversion relationship corresponding to the dome camera, that is, the transformation relationship between the azimuth angle of the dome camera and the coordinates of the center point of the screen collected by the dome camera. In addition, when the controller selects multiple feature points from the target area, the controller can obtain the coordinates of the feature points in the first frame. Further, after determining the target coordinate conversion relationship, based on the target coordinate conversion relationship, the controller can determine the azimuth corresponding to each feature point based on the target coordinate conversion relationship and the coordinates of multiple feature points in the first screen. That is, for each feature point, when the center point of the picture collected by the dome camera is the feature point, the azimuth angle of the dome camera.
例如,特征点G在第一画面内的坐标为(xg,yg),基于第二坐标转换关系,控制器便可以确定该特征点G对应的方位角为(Pg,Tg),特征点H在第一画面内的坐标为(xh,yh),基于第二坐标转换关系,控制器便可以确定该特征点H对应的方位角为(Ph,Th)。For example, the coordinate of the feature point G in the first frame is (xg, yg). Based on the second coordinate conversion relationship, the controller can determine that the azimuth angle corresponding to the feature point G is (Pg, Tg), and the feature point H is at The coordinates in the first picture are (xh, yh). Based on the second coordinate conversion relationship, the controller can determine that the azimuth corresponding to the feature point H is (Ph, Th).
步骤G2:在所确定的方位角中选取旋转球机所依据的第二方位角,并按照第二方位角旋转球机,得到待区域映射的第二画面;Step G2: Select a second azimuth angle on which the dome camera is based on the determined azimuth angle, and rotate the dome camera according to the second azimuth angle to obtain a second picture to be mapped on the area;
需要说明的是,在本实施例中,待区域映射的第二画面是在控制器执行完上述步骤S502后确定的,也就是说,在本实施例中,待区域映射的第二画面是不确定的,而是基于控制器在上述步骤G1中所确定的多个特征点对应的方位角的某一个确定的。It should be noted that, in this embodiment, the second picture to be area mapped is determined after the controller executes the above step S502, that is, in this embodiment, the second picture to be area mapped is not The determination is based on any one of the azimuth angles corresponding to the multiple feature points determined by the controller in the above step G1.
控制器可以在上述步骤G1中所确定的多个特征点对应的方位角中选取一个方位角作为旋转球机所依据的方位角,进而,该被选取的方位角可以作为第二方位角,进而,按照该第二方位角旋转球机,并将旋转后的球机采集的画面作为待区域映射的第二画面。The controller may select an azimuth angle from the azimuth angles corresponding to the plurality of feature points determined in the above step G1 as the azimuth angle on which the ball dome is based. Further, the selected azimuth angle may be used as the second azimuth angle, and further , Rotate the dome camera according to the second azimuth angle, and use the picture collected by the rotated dome camera as the second picture to be area mapped.
例如,特征点G在第一画面内的坐标为(xg,yg),控制器在上述步骤G1中确定的该特征点G对应的方位角为(Pg,Tg),将该方位角(Pg,Tg)作为第一方位角,并按照该方位角(Pg,Tg)旋转球机,直到球机的方位角变为(Pg,Tg),得到此时球机采集的画面作为待区域映射的第二画面。For example, the coordinate of the feature point G in the first screen is (xg, yg), and the azimuth angle corresponding to the feature point G determined by the controller in the above step G1 is (Pg, Tg), and the azimuth angle (Pg, Tg) as the first azimuth, and rotate the dome camera according to the azimuth (Pg, Tg) until the dome of the dome camera becomes (Pg, Tg). The picture collected by the dome camera at this time is used as the first Second picture.
可以理解的,控制器可以通过任意用于选取方位角的方式获得上述第一方位角,例如,可以根据球机拍摄角度的需求,在所确定的多个特征点对应的方位角中选取与预设方位角误差最小的方位角作为第二方位角,又例如,也可以在所确定的多个特征点对应的方位角中随机选取一个方位角作为第二方位角,这都是合理的。It can be understood that the controller can obtain the above-mentioned first azimuth in any manner for selecting the azimuth. For example, according to the requirements of the shooting angle of the dome camera, the controller selects and presets the azimuths corresponding to the determined multiple feature points. It is reasonable to set the azimuth with the smallest azimuth error as the second azimuth. For example, one azimuth can be randomly selected as the second azimuth from the determined azimuths corresponding to the plurality of feature points.
步骤G3:基于目标坐标转换关系,在第二画面中确定各个特征点所对应 的第三目标点,任一特征点所对应的第三目标点为:所对应方位角与该特征点对应的方位角相同的像素点;Step G3: Based on the target coordinate conversion relationship, a third target point corresponding to each feature point is determined in the second screen. The third target point corresponding to any feature point is: the azimuth corresponding to the feature point Pixels with the same angle;
在执行完上述步骤G1-G2后,控制器可以获得各个特征点对应的方位角,以及待区域映射的第二画面对应的球机的方位角,则根据上述对目标坐标转换关系的说明,控制器便可以基于上述目标坐标转换关系,确定各个特征点在上述第二画面中所对应的点的坐标。进而,便可以在第二画面中确定各个特征点所对应的点,并将所确定的点作为该特征点所对应的第三目标点。可以理解的,任一特征点所对应的第三目标点所对应的方位角与控制器在上述步骤G1中确定的该点对应的方位角相同。After the above steps G1-G2 are performed, the controller can obtain the azimuth corresponding to each feature point and the azimuth corresponding to the dome camera corresponding to the second screen to be area mapped, and then control according to the above description of the target coordinate conversion relationship The device may determine the coordinates of the points corresponding to each feature point in the second screen based on the target coordinate conversion relationship. Furthermore, a point corresponding to each feature point can be determined in the second picture, and the determined point can be used as a third target point corresponding to the feature point. It can be understood that the azimuth angle corresponding to the third target point corresponding to any feature point is the same as the azimuth angle corresponding to the point determined by the controller in the above step G1.
例如,特征点G在第一画面内的坐标为(xg,yg),控制器在上述步骤G1中确定的该特征点G对应的方位角为(Pg,Tg),特征点H在第一画面内的坐标为(xh,yh),基于第一坐标转换关系便可以确定该特征点H对应的方位角为(Ph,Th)。将上述方位角(Pg,Tg)作为第一方位角,并按照该方位角(Pg,Tg)旋转球机,得到待区域映射的第二画面。则根据球机对应的坐标转换关系,控制器可以在该第二画面中,根据特征点H对应的方位角(Ph,Th),确定特征点H在第二画面中所对应的点H’的坐标为(xh’,yh’)。For example, the coordinates of the feature point G in the first picture are (xg, yg), the azimuth corresponding to the feature point G determined by the controller in the above step G1 is (Pg, Tg), and the feature point H is in the first picture The internal coordinates are (xh, yh), and based on the first coordinate conversion relationship, it can be determined that the azimuth angle corresponding to the feature point H is (Ph, Th). The above azimuth angle (Pg, Tg) is used as the first azimuth angle, and the dome camera is rotated according to the azimuth angle (Pg, Tg) to obtain a second picture to be area mapped. Then according to the coordinate conversion relationship corresponding to the dome camera, the controller may determine the corresponding point H ′ of the feature point H in the second picture according to the azimuth angle (Ph, Th) corresponding to the feature point H in the second picture. The coordinates are (xh ', yh').
步骤G4:将第二画面中基于多个第三目标点所确定出的区域,作为目标区域对应的区域。Step G4: Use the area determined on the second screen based on the plurality of third target points as the area corresponding to the target area.
在上述第二画面中确定各个特征点所对应的第三目标点后,控制器便基于这些第三目标点在上述第二画面中确定一个区域,进而,便可以将该基于多个第三目标点所确定出的区域作为上述步骤S501中控制器所确定的目标区域对应的区域。After the third target points corresponding to the feature points are determined in the second picture, the controller determines an area in the second screen based on the third target points, and further, the controller can determine the area based on the third targets. The area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
实施例五、第一画面所属相机和第二画面所属相机为不同的枪机;Embodiment 5: The cameras to which the first picture belongs and the camera to which the second picture belongs are different guns;
上述步骤S502,确定第一画面所属相机和第二画面所属相机的目标坐标转换关系,可以包括如下的步骤H1-H2:The above step S502, determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, may include the following steps H1-H2:
步骤H1:确定上述不同的枪机之间的坐标转换关系;Step H1: Determine a coordinate conversion relationship between the different guns described above;
针对本实施例中的不同枪机,控制器可以确定该不同枪机之间的坐标转换关系,即确定该不同枪机对应的枪机坐标转换关系。For different guns in this embodiment, the controller may determine a coordinate conversion relationship between the different guns, that is, determine a coordinate conversion relationship of the guns corresponding to the different guns.
具体的,假设第一画面所属枪机为第一枪机,第二画面所属相机为第二 枪机,则可以通过下面的例子对不同的枪机之间的坐标转换关系进行说明:假设第一画面中包括一个点I,其在该第一画面中的坐标为(xi,yi),则通过不同的枪机之间的坐标转换关系,便可以将上述坐标(xi,yi)转换为该第二画面中与该点I对应的点I’的坐标(xi’,yi’)。Specifically, assuming that the first shot belongs to the first shot and the second shot belongs to the second shot, the following example can be used to explain the coordinate conversion relationship between different shots: Assume the first The picture includes a point I, whose coordinates in the first picture are (xi, yi), and the coordinates (xi, yi) can be converted into the first coordinate through the coordinate conversion relationship between different guns. The coordinates (xi ', yi') of the point I 'corresponding to the point I in the two pictures.
步骤H2:将所确定的不同的枪机之间的坐标转换关系,作为第一画面所属相机和第二画面所属相机的目标坐标转换关系。Step H2: Use the determined coordinate conversion relationship between different guns as the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs.
在确定上述不同的枪机之间的坐标转换关系后,控制器便可以将枪机之间的坐标转换关系,确定为第一画面所属相机和第二画面所属相机的目标坐标转换关系,从而完成上述步骤S502。After determining the coordinate conversion relationship between the different guns, the controller can determine the coordinate conversion relationship between the guns as the target coordinate conversion relationship of the camera to which the first picture belongs and the camera to which the second picture belongs, thereby completing The above step S502.
进而,在确定了第一画面所属相机和第二画面所属相机的目标坐标转换关系后,控制器便可以基于该目标坐标转换关系,在待区域映射的第二画面中确定与目标区域对应的区域。Furthermore, after determining the target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture belongs, the controller may determine an area corresponding to the target area in the second picture to be area mapped based on the target coordinate conversion relationship. .
可选的,针对上述实施例五中,第一画面所属相机和第二画面所属相机为不同的枪机的情况,上述步骤A2,基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域,可以包括如下的步骤I1-I2:Optionally, for the case where the camera to which the first picture belongs and the camera to which the second picture belongs are different guns in the fifth embodiment, the above step A2 is based on a plurality of feature points and target coordinate conversion relationships in the second picture. Determining the area corresponding to the target area may include the following steps I1-I2:
步骤I1:基于目标坐标转换关系及多个特征点在第一画面内的坐标,在第二画面中确定各个特征点对应的第四目标点;Step I1: Determine a fourth target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship and the coordinates of the multiple feature points in the first picture;
其中,在本实施例五中,目标坐标转换关系为不同的枪机之间的坐标转换关系。此外,控制器在从目标区域中选取多个特征点时,便可以获得这些特征点在第一画面内的坐标。因此,在确定目标坐标转换关系后,控制器便可以基于上述目标坐标转换关系及多个特征点在第一画面内的坐标,在第二画面中确定各个特征点所对应的点的坐标。进而,便可以在第二画面中确定各个特征点所对应的点,并将所确定的点作为该特征点所对应的第四目标点。Among them, in the fifth embodiment, the target coordinate conversion relationship is a coordinate conversion relationship between different guns. In addition, when the controller selects multiple feature points from the target area, the controller can obtain the coordinates of the feature points in the first frame. Therefore, after determining the target coordinate conversion relationship, the controller can determine the coordinates of the points corresponding to each feature point in the second screen based on the target coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen. Furthermore, a point corresponding to each feature point can be determined in the second screen, and the determined point can be used as a fourth target point corresponding to the feature point.
步骤I2:将第二画面中基于多个第四目标点所确定出的区域,作为目标区域对应的区域。Step I2: Use the area determined on the second screen based on the fourth target points as the area corresponding to the target area.
在上述第二画面中确定各个特征点所对应的第三目标点后,控制器便基于这些第四目标点在上述第二画面中确定一个区域,进而,便可以将该基于多个第四目标点所确定出的区域作为上述步骤S501中控制器所确定的目标区域对应的区域。After the third target point corresponding to each feature point is determined in the second screen, the controller determines an area in the second screen based on the fourth target points, and further, the controller can determine the area based on the fourth targets. The area determined by the point is used as the area corresponding to the target area determined by the controller in step S501.
需要说明的是,在上述实施例一至实施例五的具体实施方式中,涉及到了多种坐标转换关系,下面则将对上述所涉及的多种坐标转换关系进行说明。It should be noted that, in the specific implementation manners of the first embodiment to the fifth embodiment, multiple coordinate conversion relationships are involved. The multiple coordinate conversion relationships mentioned above will be described below.
图6为本申请实施例提供的一种实施方式中上述枪机和球机之间的坐标转换关系的确定方式的流程示意图。FIG. 6 is a schematic flowchart of a manner for determining a coordinate conversion relationship between the gun machine and the ball machine according to an implementation manner provided in an embodiment of the present application.
其中,考虑到第一坐标转换关系的确定方式的简便性,在本申请实施例中采用了平面单应性矩阵映射的方法,从而可以并不考虑上述枪机和上述球机在三维空间中的位置,以及三维空间的点,而是可以通过直接建立数学模型,建立枪机和球机之间的坐标转换关系。Among them, considering the simplicity of the determination method of the first coordinate conversion relationship, a planar homography matrix mapping method is adopted in the embodiment of the present application, so that the three-dimensional space of the above-mentioned gun machine and the above-mentioned ball machine may not be considered. Position, and points in three-dimensional space, but can directly establish a mathematical model to establish the coordinate conversion relationship between the gun machine and the ball machine.
具体的,如图6所示,枪机和球机之间的坐标转换关系的确定方式可以包括如下步骤601-604:Specifically, as shown in FIG. 6, the manner of determining the coordinate conversion relationship between the gun machine and the ball machine may include the following steps 601-604:
S601:确定预设的m个参考点在枪机采集的画面中对应的坐标,得到m个第一坐标。S601: Determine the coordinates corresponding to the preset m reference points in the frame collected by the gun machine, and obtain m first coordinates.
其中,参考点为:第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中的点,m≥4;The reference point is: a point in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs, m≥4;
控制器可以预先获得第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中的m个参考点,其中,为了保证能够计算得到单应性矩阵,必须保证m≥4。例如,参考点可以是第一画面所属相机和第二画面所属相机所能拍摄到的一个相框的四个顶点,又例如,参考点可以是第一画面所属相机和第二画面所属相机所能拍摄到的一个矩形盒子的八个顶点等,这都是合理的。The controller can obtain m reference points in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs. In order to ensure that the homography matrix can be calculated, m≥4 must be guaranteed. For example, the reference point may be the four vertices of a photo frame that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs. To the eight vertices of a rectangular box, etc., this is all reasonable.
需要说明的是,控制器可以通过多种方式获得上述m个参考点。例如,接收用户发送的参考点信息,用户可以在第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中选定m个参考点,然后将这些参考点的信息通过相关的指令发送给控制器;It should be noted that the controller can obtain the m reference points in various ways. For example, after receiving the reference point information sent by the user, the user can select m reference points in the three-dimensional space that can be captured by the camera to which the first screen belongs and the camera to which the second screen belongs, and then pass the information of these reference points through related instructions Send to the controller;
又例如,控制器可以根据预设规则在第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中选定m个参考点,示例性的,当第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中包括某个或者某类指定事物时,控制器可以在该事物上选取m个参考点。For another example, the controller may select m reference points in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs according to a preset rule. For example, when the first picture belongs to the camera and the second picture When the three-dimensional space captured by the camera to which the picture belongs includes a certain thing or a certain type of specified object, the controller may select m reference points on the object.
举例而言,第一画面所属相机和第二画面所属相机所能拍摄到的三维空间为一间设置有灭火器的房间,则控制器可以在该灭火器上选取m个参考点。For example, if the three-dimensional space captured by the camera to which the first picture belongs and the camera to which the second picture belongs is a room with a fire extinguisher, the controller may select m reference points on the fire extinguisher.
需要说明的是,控制器还可以通过其他方式获得m个参考点,对此,本申 请实施例不做具体限定。It should be noted that the controller can also obtain m reference points in other ways, which is not specifically limited in this embodiment of the present application.
在获得第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中的m个参考点后,控制器可以在枪机采集的画面中确定上述m个参考点中各个参考点所对应的坐标,并将其作为第一坐标,即控制器可以得到m个第一坐标。After obtaining the m reference points in the three-dimensional space that can be taken by the camera to which the first picture belongs and the camera to which the second picture belongs, the controller can determine the corresponding reference points of the above m reference points in the picture collected by the gun. And use it as the first coordinate, that is, the controller can obtain m first coordinates.
需要说明的是,在上述步骤S601中,控制器可以通过多种方式获得上述m个第一坐标的方式,对此,本申请实施例不做具体限定。It should be noted that, in the above step S601, the controller may obtain the above-mentioned m first coordinates in multiple manners, which is not specifically limited in this embodiment of the present application.
可以理解的,上述枪机采集到的画面为二维平面画面,在该画面中的点具有二维平面坐标,可以通过(x,y)表示。It can be understood that the picture collected by the aforementioned gun is a two-dimensional plane picture, and the points in the picture have two-dimensional plane coordinates, which can be represented by (x, y).
S602:针对每一个参考点,确定球机以该参考点为画面中心时的方位角,得到m个方位角。S602: For each reference point, determine the azimuth angle when the dome camera uses the reference point as the center of the screen, and obtain m azimuth angles.
相对应的,在获得第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中的m个参考点后,针对每一个参考点,通过转动该球机,以使得控制器可以确定球机采集的画面的中心点为该参考点所对应的点时,第二相机的方位角。Correspondingly, after obtaining m reference points in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs, for each reference point, by turning the dome camera, the controller can determine The azimuth of the second camera when the center point of the picture collected by the dome camera is the point corresponding to the reference point.
即在获得第一画面所属相机和第二画面所属相机所能拍摄到的三维空间中的m个参考点后,针对每一个参考点,控制器可以确定第二相机以该参考点为画面中心时的方位角,从而得到m个方位角,每个方位角由一个水平方位角P和一个垂直方位角T组成,表示为(P,T)。That is, after obtaining m reference points in the three-dimensional space that can be captured by the camera to which the first picture belongs and the camera to which the second picture belongs, for each reference point, the controller can determine that the second camera uses the reference point as the center of the picture To obtain m azimuth angles, each azimuth angle is composed of a horizontal azimuth angle P and a vertical azimuth angle T, expressed as (P, T).
需要说明的是,上述步骤S601和步骤S602的执行顺序可以是,控制器先执行上述步骤S601,再执行上述步骤S602,也可以是控制器先执行上述设备S602,再执行上述步骤S601,还可以是控制器同时执行上述步骤S601和S602。It should be noted that the execution sequence of the above steps S601 and S602 may be that the controller first executes the above step S601 and then executes the above step S602, or the controller first executes the above device S602 and then the above step S601, or The controller executes the above steps S601 and S602 simultaneously.
S603:将m个方位角转换为m个第二坐标;S603: Convert m azimuths into m second coordinates;
显然,在上述步骤S601中,控制器获得的每个第一坐标均为一个二维平面坐标,而在上述步骤S602中,控制器获得的每个方位角显然不能作为二维平面坐标,因此,控制器需要将上述步骤S602中获得的每个方位角转换为与该方位角对应的二维平面坐标。Obviously, in step S601, each first coordinate obtained by the controller is a two-dimensional plane coordinate, and in step S602, each azimuth angle obtained by the controller obviously cannot be used as a two-dimensional plane coordinate. Therefore, The controller needs to convert each azimuth obtained in step S602 into a two-dimensional plane coordinate corresponding to the azimuth.
具体的,控制器可以事先获得一个参考高度值h,从而可以通过以下公式实现上述方位角到二维平面坐标的转换。Specifically, the controller can obtain a reference height value h in advance, so that the above azimuth angle can be converted to a two-dimensional plane coordinate by the following formula.
x i=h/tan(T i)*sin(P i) x i = h / tan (T i ) * sin (P i )
y i=h/tan(T i)*cos(P i) y i = h / tan (T i ) * cos (P i )
其中,T i为第i个方位角的垂直方位角,P i为第i个方位角的水平方位角,x i是计算得到的第i个方位角对应的二维平面坐标中的x值,y i为计算得到的第i个方位角对应的二维平面坐标中的y值,i≦m。 Among them, T i is the vertical azimuth of the i-th azimuth, P i is the horizontal azimuth of the i-th azimuth, and x i is the x value in the two-dimensional plane coordinates corresponding to the calculated i-th azimuth, y i is the y value in the two-dimensional plane coordinate corresponding to the calculated ith azimuth angle, i ≦ m.
具体的,该参考高度h可以取值为1。Specifically, the reference height h may take a value of 1.
S604:基于m个第一坐标和m个第二坐标,计算单应性矩阵,并将单应性矩阵作为枪机和球机之间的坐标转换关系。S604: Calculate the homography matrix based on the m first coordinates and the m second coordinates, and use the homography matrix as the coordinate conversion relationship between the gun machine and the ball machine.
在获得上述m个第一坐标和m个第二坐标后,控制器便可以基于该m个第一坐标和m个第二坐标,计算单应性矩阵,并将单应性矩阵作为枪机和球机之间的坐标转换关系。After obtaining the above m first coordinates and m second coordinates, the controller can calculate a homography matrix based on the m first coordinates and m second coordinates, and use the homography matrix as a gun machine and Coordinate conversion relationship between dome cameras.
需要说明的是,在计算过程中,为了便于区分上述第一坐标和第二坐标,上述m个第一坐标表示为(x i,y i),m个第二坐标表示为(u i,v i),i≤m。 It should be noted that in the calculation process, in order to facilitate the distinction between the first and second coordinates, the m first coordinates are expressed as (x i , y i ), and the m second coordinates are expressed as (u i , v i ), i≤m.
可选的,一种具体实现方式中,上述步骤S604中基于m个第一坐标和m个第二坐标,可以通过如下公式(1)至公式(6)计算单应性矩阵,其中:Optionally, in a specific implementation manner, based on m first coordinates and m second coordinates in step S604, the homography matrix can be calculated by the following formula (1) to formula (6), where:
D=H×S   (1)D = H × S (1)
其中,
Figure PCTCN2019104535-appb-000002
其中,H即为所要计算求得的单应性矩阵。
among them,
Figure PCTCN2019104535-appb-000002
Among them, H is the homography matrix to be calculated.
进而,通过上述公式(1),可以得到如下公式(2):Furthermore, through the above formula (1), the following formula (2) can be obtained:
Figure PCTCN2019104535-appb-000003
Figure PCTCN2019104535-appb-000003
为了得到单应性矩阵,则需要求解上述公式(2)转换得到的如下公式(3)所示的方程组,从而可以通过计算h中各元素的数值,得到上述单应性矩阵H中各个元素的值,并进一步得到单应性矩阵H:In order to obtain the homography matrix, it is necessary to solve the equation set shown in the following formula (3) transformed from the above formula (2), so that each element in the homography matrix H can be obtained by calculating the value of each element in h And further obtain the homography matrix H:
h=(H 11,H 12,H 13,H 21,H 22,H 23,H 31,H 32,H 33) Τ   (3) h = (H 11 , H 12 , H 13 , H 21 , H 22 , H 23 , H 31 , H 32 , H 33 ) Τ (3)
根据上述m个第一坐标和m个第二坐标,构建如下所示的两个向量a x,u和a y,v,其中, Based on the above m first coordinates and m second coordinates, construct two vectors a x, u and a y, v as shown below, where
a x,u=(-x i,-y i,-1,0,0,0,u ix i,u iy i,u i) Τ a x, u = (-x i , -y i , -1,0,0,0, u i x i , u i y i , u i ) Τ
a y,v=(0,0,0,-x i,-y i,-1,v ix i,v iy i,v i) Τ a y, v = (0,0,0, -x i , -y i , -1, v i x i , v i y i , v i ) Τ
进而,将向量a x,u和向量a y,v结合,可以得到如公式(4)所示的新的矩阵: Furthermore, by combining the vectors a x, u and the vectors a y, v , a new matrix can be obtained as shown in formula (4):
Figure PCTCN2019104535-appb-000004
Figure PCTCN2019104535-appb-000004
这样,便可以通过求解如下公式(5),得到上述h中各个元素的数值,进而得到上述单应性矩阵H中各个元素的值,进而,得到单应性矩阵H:In this way, the following formula (5) can be solved to obtain the values of each element in h, and then the values of each element in the homography matrix H, and then the homography matrix H:
Ah=0    (5)Ah = 0 (5)
其中,在求解上述公式(5)时,可以通过对上述矩阵A进行SVD(Singular value decomposition,奇异值分解)进行,具体的的SVD过程如下:Wherein, when solving the above formula (5), SVD (Singular Value Decomposition) can be performed on the above matrix A. The specific SVD process is as follows:
由上述公式(6)可以得到A的右奇异值和左奇异向量,将Σ,V以对应的关系,按Σ中的值从大到小排序,Σ中最小值对应的右奇异向量即为h的近似解,其中h的近似解,如下公式7所示。From the above formula (6), the right singular value and left singular vector of A can be obtained. Σ, V are in a corresponding relationship, and the values in Σ are sorted from large to small. The right singular vector corresponding to the minimum value in Σ is h. The approximate solution of H is the approximate solution of h, as shown in Equation 7 below.
[U,Σ,V]=svd(A)    (6)[U, Σ, V] = svd (A) (6)
h=V[[min(∑)],:]   (7)h = V [[min (∑)] ,:] (7)
这样,便可以得到上述h中各个元素的数值,此时h为一个1*9的向量,且 h中每个元素的值分别对应单应性矩阵H中的一个元素的值,则可以通过对计算得到的h进行行数、列数和维数的重新调整,便可以得到单应性矩阵H。In this way, the value of each element in h can be obtained. At this time, h is a 1 * 9 vector, and the value of each element in h corresponds to the value of one element in the homography matrix H. The calculated h is readjusted by the number of rows, columns, and dimensions to obtain the homography matrix H.
需要说明的是,根据上述实施例三的说明,可以理解的,当第一画面所属相机为第一球机、第二画面所属相机为第二球机,且第一球机的方位角固定时,第一球机可以视作枪机,从而上述实施例三中所涉及的第一球机和第二球机之间的坐标转换关系的确定方式,便可以与上述枪机和球机之间的坐标转换关系的建立方式相同,则再次不再赘述。It should be noted that according to the description of the third embodiment, it can be understood that when the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed , The first dome camera can be regarded as a gun machine, so that the method for determining the coordinate conversion relationship between the first dome camera and the second dome camera involved in the above third embodiment can be determined with the aforementioned dome camera and dome camera. The coordinate transformation relationship is established in the same way, so it will not be described again.
下面,对上述球机对应的坐标转换关系的确定方式进行介绍。The following describes the determination method of the coordinate conversion relationship corresponding to the ball machine.
具体的,上述球机对应的坐标转换关系的确定方式,可以根据图7中球机成像的示意图来进行说明。Specifically, the manner of determining the coordinate conversion relationship corresponding to the dome camera described above can be described according to the schematic diagram of the dome camera imaging in FIG. 7.
其中,如图7所示,uv平面为球机的成像平面,并与球机的镜头相切于C点,C点即为uv平面的中心点,则球机的整个镜头所能拍摄到的范围可以近似于该成像平面,进而,C点在球机采集的画面中对应的点即为球机采集的画面的中心点。需要说明的是,在球机采集画面的过程中,球机的成像平面uv平面并不真实存在,而是假设的一个用于确定球机对应的坐标转换关系的平面。Among them, as shown in FIG. 7, the uv plane is the imaging plane of the dome camera and is tangent to the lens of the dome camera at point C, and the point C is the center point of the uv plane. The range can be approximated to the imaging plane, and further, the point corresponding to point C in the picture collected by the dome camera is the center point of the picture collected by the dome camera. It should be noted that during the process of collecting pictures by the dome camera, the imaging plane uv plane of the dome camera does not really exist, but is a hypothetical plane used to determine the coordinate conversion relationship corresponding to the dome camera.
具体的,上述球机对应的坐标转换关系的确定方式可以包括:Specifically, the manner of determining the coordinate conversion relationship corresponding to the ball machine may include:
步骤J1:获得在球机的成像平面中预设的标定点在球机采集的画面中所对的点的坐标,作为第一标定坐标。Step J1: Obtain the coordinates of the points on the dome camera's imaging point preset in the imaging plane of the dome camera as the first calibration coordinates.
如图7所示,可以在uv平面中,将点P作为预设的标定点,进而控制器便可以得到该点P在球机采集的画面中所对应的点的坐标,并将该坐标居委第一标定坐标,具体的,该第一标定坐标可以表示为(xp,yp)。As shown in FIG. 7, the point P can be used as a preset calibration point in the uv plane, and then the controller can obtain the coordinates of the point corresponding to the point P in the screen collected by the dome camera, and place the coordinate at The first calibration coordinates are specified. Specifically, the first calibration coordinates can be expressed as (xp, yp).
需要说明的是,在上述步骤J1中,控制器可以通过多种方式获得预设的标定点,例如,用户在球机的成像平面中选定一个点作为预设的标定点,并将所选择的标定点的信息发送给控制器等;进而,控制器便可以通过多种方式获得该标定点在球机采集的画面中所对应的点的坐标。在本申请实施例中,不对上述步骤J1的具体实现方式进行限定。It should be noted that in the above step J1, the controller can obtain a preset calibration point in various ways. For example, the user selects a point in the imaging plane of the dome camera as a preset calibration point, and selects the selected calibration point. The information of the calibration point is sent to the controller and the like; further, the controller can obtain the coordinates of the point corresponding to the calibration point in the screen collected by the dome camera in various ways. In the embodiment of the present application, the specific implementation manner of the above step J1 is not limited.
步骤J2:基于球机采集上述用于确定第一标定坐标的画面时的分辨率、倍率及方位角,确定球机的光轴长度。Step J2: Determine the optical axis length of the dome camera based on the resolution, magnification, and azimuth when the dome camera collects the picture for determining the first calibration coordinate.
其中,球机的光轴为:球机的相机坐标系原点与成像平面的中心点的连线。为了便于描述,上述球机采集上述用于确定第一标定坐标的画面时的分辨率、倍率及方位角可以简称为球机当前分辨率、球机当前倍率及球机当前方位角。The optical axis of the dome camera is the line connecting the origin of the camera coordinate system of the dome camera and the center point of the imaging plane. For the convenience of description, the resolution, magnification, and azimuth when the dome camera collects the picture for determining the first calibration coordinate may be simply referred to as the current resolution of the dome camera, the current magnification of the dome camera, and the current azimuth of the dome camera.
具体的,如图7所示,直线段OC即为如图7中球机的光轴,则可以通过如下公式计算OC的长度,即图7中球机的光轴长度:Specifically, as shown in FIG. 7, the straight segment OC is the optical axis of the dome camera as shown in FIG. 7. The length of the OC can be calculated by the following formula, that is, the optical axis length of the dome camera in FIG. 7:
R=width/2.0/tan(P 当前/2)/Z 当前 R = width / 2.0 / tan ( P current / 2) / Z Current
其中,R为球机的光轴长度,width为球机当前分辨率中的宽度方向上的分辨率,P 当前为球机当前方位角中的水平方位角,Z 当前为球机当前倍率。 Wherein, R is the length of the optical axis of the dome, width of the resolution in the dome of the current resolution in the width direction, P is the current horizontal azimuth dome current azimuth, Z is currently dome current ratio.
步骤J3:基于上述第一标定坐标及球机当前分辨率,确定上述标定点在上述球机的成像平面中的坐标,作为第二标定坐标。Step J3: Based on the first calibration coordinates and the current resolution of the dome camera, determine the coordinates of the calibration point in the imaging plane of the dome camera as the second calibration coordinates.
其中,上述第二标定坐标可以表示为(U,V),具体的,可以通过以下公式计算上述第二标定坐标:The above-mentioned second calibration coordinates can be expressed as (U, V). Specifically, the above-mentioned second calibration coordinates can be calculated by the following formula:
U=xp-width/2.0U = xp-width / 2.0
V=yp-height/2.0V = yp-height / 2.0
其中,width为球机当前分辨率中的宽度方向上的分辨率,height为球机当前分辨率中的高度方向上的分辨率。Among them, width is the resolution in the width direction in the current resolution of the dome camera, and height is the resolution in the height direction in the current resolution of the dome camera.
步骤J4:基于上述第二标定坐标和球机的光轴长度,确定上述标定点在球机的相机坐标系中的坐标,作为第三标定坐标。Step J4: Determine the coordinates of the calibration point in the camera coordinate system of the dome camera as the third calibration coordinates based on the second calibration coordinates and the optical axis length of the dome camera.
具体的,上述第三标定坐标可以表示为(x0,y0,z0),具体的,可以通过如下公式计算上述第三标定坐标:Specifically, the third calibration coordinate may be expressed as (x0, y0, z0). Specifically, the third calibration coordinate may be calculated by the following formula:
x0=Ux0 = U
y0=R*cosT 当前–V*sinT 当前 y0 = R * cosT current- V * sinT current
z0=R*sinT 当前+V*cosT 当前 z0 = R * sinT current current + V * cosT
其中,T 当前为球机当前方位角中垂直方向的方位角。 Wherein T is currently azimuth dome current azimuth angle in the vertical direction.
步骤J5:基于上述第三标定坐标及球机当前方位角,确定上述标定点相对于球机光轴分别在水平方向上的角度偏移和在垂直方向上的角度偏移。Step J5: Based on the third calibration coordinates and the current azimuth angle of the dome camera, determine an angular offset of the calibration point in the horizontal direction and an angular deviation in the vertical direction with respect to the optical axis of the dome camera.
其中,上述水平方向上的角度偏移为上述标定点所对应的方位角中的水平方位角,可以表示为P_new,上述垂直方向上的角度偏移为上述标定所对应的方位角中的垂直方位角,可以表示为T_new,从而上述标定点对应的方位角可以表示为(P_new,T_new)。具体的,可以通过如下公式计算上述标定点对应的方位角:The angular offset in the horizontal direction is the horizontal azimuth in the azimuth corresponding to the calibration point, which can be expressed as P_new, and the angular offset in the vertical direction is the vertical azimuth in the azimuth corresponding to the calibration. The angle can be expressed as T_new, so that the azimuth corresponding to the calibration point can be expressed as (P_new, T_new). Specifically, the azimuth corresponding to the calibration points can be calculated by the following formula:
P_new=atan(x0/y0)+P 当前P_new = atan (x0 / y0) + P current ;
T_new=atan(z0/(sqrt(x0*x0+y0*y0)))+T 当前 T_new = atan (z0 / (sqrt (x0 * x0 + y0 * y0))) + T Current
显然,通过对上述步骤J1-步骤J5中说明及各个公式,可以建立标定点在球机采集到的画面中对应的点的坐标与标定点对应的方位角之间的数学关系。而进一步的,由于标定点对应的方位角为当球机采集到的画面的中心点为该标定点对应的点时,球机的方位角。Obviously, the mathematical relationship between the coordinates of the corresponding points in the picture collected by the dome camera and the azimuth angles corresponding to the calibration points can be established by explaining the above steps J1-Step J5 and each formula. Further, since the azimuth corresponding to the calibration point is the azimuth of the dome camera when the center point of the picture collected by the dome camera is the point corresponding to the calibration point.
因此,当给定球机采集到的画面中任一个像素点的坐标及球机采集该画面时的方位角时,便可以通过上述步骤J1-J5中建立球机对应的坐标转换关系,进而得到当球机采集到的画面的中心点为该像素点对应的点时,球机的方位角。进而,可以理解的,当给定当球机采集到的画面的中心点为某个像素点对应的点时,球机的方位角以及球机当前采集画面的方位角时,也可以计算得到该像素点在球机当前采集的画面中的坐标。Therefore, given the coordinates of any pixel point in the picture collected by the dome camera and the azimuth angle when the dome camera collected the picture, the coordinate conversion relationship corresponding to the dome camera can be established through the above steps J1-J5 to obtain When the center point of the picture collected by the dome camera is the point corresponding to the pixel point, the azimuth angle of the dome camera. Furthermore, it can be understood that when the center point of the picture collected by the dome camera is a point corresponding to a certain pixel point, the azimuth angle of the dome camera and the azimuth angle of the dome camera's current captured picture can also be calculated. The coordinates of the point in the picture currently captured by the dome camera.
需要说明的是,在本申请实施例中,上述实施例三中所提到的第二球机对应的坐标转换关系为第二球机的方位角与该第二球机采集到的画面中心点的坐标的转换关系,因此,第二球机对应的坐标转换关系与上述球机对应的坐标转换关系均为球机自身的方位角与球机所采集到的画面中心点的坐标转换关系,从而可以实现球机处于不同方位角时所采集的不同画面间的坐标映射。It should be noted that, in the embodiment of the present application, the coordinate conversion relationship corresponding to the second dome camera mentioned in the third embodiment is the azimuth of the second dome camera and the center point of the screen collected by the second dome camera. Therefore, the coordinate conversion relationship corresponding to the second dome camera and the coordinate conversion relationship corresponding to the above dome camera are both the coordinate transformation relationship between the azimuth of the dome camera and the center point of the screen collected by the dome camera. Coordinate mapping between different pictures collected when the dome camera is at different azimuth angles can be realized.
因此,上述实施例三中所提到的第二球机对应的坐标转换关系的确定方式与上述球机对应的坐标转换关系的确定方式可以相同,则在此不再赘述。Therefore, the determination method of the coordinate conversion relationship corresponding to the second dome camera mentioned in the third embodiment may be the same as the determination method of the coordinate conversion relationship corresponding to the above dome camera, and details are not described herein again.
下面,对上述本申请实施例中所提供的不同的枪机之间的坐标转换关系的确定方式进行介绍。与上述第一坐标转换关系的确定方式相同,在本申请实施例中同样采用了平面单应性矩阵映射的方法来确定枪机之间的坐标转换关系,从而可以并不考虑不同的枪机在三维空间中的位置,以及三维空间的 点,而是可以通过直接建立数学模型,建立不同的枪机之间的坐标转换关系。The following describes the determination manner of the coordinate conversion relationship between different guns provided in the foregoing embodiments of the present application. In the same manner as the above-mentioned first coordinate conversion relationship, a planar homography matrix mapping method is also used in the embodiments of the present application to determine the coordinate conversion relationship between the guns, so that different guns can be ignored. The position in the three-dimensional space and the point in the three-dimensional space can be established by directly establishing a mathematical model to establish the coordinate conversion relationship between different guns.
具体的,假设,上述不同的枪机中包括第一枪机和第二枪机,则上述不同的枪机之间的坐标转换关系的确定方式可以包括:Specifically, assuming that the different guns include the first gun and the second gun, the method for determining the coordinate conversion relationship between the different guns may include:
步骤K1:确定预设的n个目标点在第一枪机采集的画面中对应的坐标,得到n个第三坐标,确定预设的n个目标点在第二枪机采集的画面中对应的坐标,得到n个第四坐标,其中,n≥4;Step K1: Determine the corresponding coordinates of the preset n target points in the picture collected by the first gun machine, obtain n third coordinates, and determine the corresponding of the preset n target points in the picture collected by the second gun machine. Coordinates to get n fourth coordinates, where n≥4;
需要说明的是,在上述步骤K1中,目标点与上述步骤S601中的参考点为相同性质的参考点。即控制器预先获得的第一枪机和第二枪机所能拍摄到的三维空间中的参考点,且为了保证能够计算得到单应性矩阵,必须保证n≥4。控制器获得上述n个目标点的方式可以与上述步骤S601中,控制器获得m个参考点的方式相同,在此不再赘述。It should be noted that, in step K1, the target point is a reference point with the same property as the reference point in step S601. That is, the controller obtains the reference points in the three-dimensional space that can be captured by the first and second guns in advance, and in order to ensure that the homography matrix can be calculated, n≥4 must be guaranteed. The manner in which the controller obtains the n target points may be the same as the manner in which the controller obtains m reference points in step S601, and details are not described herein again.
在获得第一枪机和第二枪机所能拍摄到的三维空间中的n个目标点后,控制器便可以在第一枪机采集的画面中确定上述n个目标点中各个目标点所对应的坐标,并将其作为第三坐标,在第二枪机采集的画面中确定上述n个目标点中各个目标点所对应的坐标,确定预设的n个目标点在第二枪机采集的画面中对应的坐标,并将其作为第四坐标。因此,控制器便可以得到n个第三坐标和n个第四坐标。After obtaining the n target points in the three-dimensional space that can be captured by the first and second guns, the controller can determine the positions of each of the n target points in the picture collected by the first gun. The corresponding coordinates are used as the third coordinates, and the coordinates corresponding to each of the above n target points are determined in the picture collected by the second gun machine, and the preset n target points are determined to be collected by the second gun machine The corresponding coordinates in the picture of the image as the fourth coordinate. Therefore, the controller can obtain n third coordinates and n fourth coordinates.
需要说明的是,控制器在上述步骤K1中获得n个第三坐标和n个第四坐标的方式,可以与控制器在上述步骤S601中获得m个第一坐标的方式相同,在此不再赘述。It should be noted that the manner in which the controller obtains n third coordinates and n fourth coordinates in the above step K1 may be the same as the manner in which the controller obtains m first coordinates in the above step S601, and is not repeated here. To repeat.
步骤K2:基于n个第三坐标和n个第四坐标,计算目标单应性矩阵,将目标单应性矩阵作为枪机之间的坐标转换关系。Step K2: Calculate the target homography matrix based on the n third coordinates and n fourth coordinates, and use the target homography matrix as the coordinate conversion relationship between the guns.
在获得上述n个第三坐标和n个第四坐标后,控制器便可以基于该n个第三坐标和n个第四坐标,计算目标单应性矩阵,并将该目标单应性矩阵作为枪机之间的坐标转换关系。After obtaining the n third coordinates and n fourth coordinates, the controller can calculate a target homography matrix based on the n third coordinates and n fourth coordinates, and use the target homography matrix as Coordinate conversion relationship between guns.
需要说明的是,控制器执行上述步骤K2,基于n个第三坐标和n个第四坐标,计算目标单应性矩阵,将目标单应性矩阵作为枪机之间的坐标转换关系的方式,与控制器执行上述步骤S604,基于m个第一坐标和m个第二坐标,计算单应性矩阵,并将单应性矩阵作为第一坐标转换关系的方式相同,在此不再赘述。It should be noted that the controller executes the above step K2, calculates the target homography matrix based on the n third coordinates and the n fourth coordinates, and uses the target homography matrix as a method of coordinate conversion relationship between the guns. The method is the same as that when the controller executes the above step S604 and calculates the homography matrix based on the m first coordinates and the m second coordinates, and uses the homography matrix as the first coordinate conversion relationship, which is not described herein again.
进一步的,在上述画面间区域映射完成的基础上,本申请实施例还可以进一步的对在不同的待映射画面中确定的区域进行画面处理,例如,在这些区域中添加AR标签进行标注,或者对这些区域进行隐私遮蔽,又或者针对这些区域进行着重显示等,当然,还可以进行其他的画面处理,对此,本申请实施例不做具体限定。Further, on the basis of the above-mentioned area mapping between screens, the embodiments of the present application can further perform screen processing on the regions determined in different screens to be mapped, for example, adding AR tags to these regions for labeling, or Privacy masking is performed on these areas, or focused display is performed on these areas. Of course, other screen processing may also be performed, which is not specifically limited in this embodiment of the present application.
具体的,所谓添加AR标签进行标注,可以指在一个相机采集的画面上指定相关区域,在另外的相机采集的画面上能展示该相关区域所对应的区域。Specifically, the so-called adding an AR tag for labeling may refer to designating a relevant area on a screen captured by one camera, and displaying a region corresponding to the relevant area on a screen captured by another camera.
所谓隐私遮蔽,可以指一个相机采集到的一个画面中指定一个区域,并将该区域遮蔽,进而,在另外采集到的画面中同样遮蔽该区域所对应的区域。通常,由于球机的拍摄角度可以变化,采用本申请实施例提供的画面间区域映射方法,可以保证在球机旋转过程中,对球机在任意拍摄角度所采集到的画面中的相关区域进行遮蔽。The so-called privacy masking can refer to designating a region in a frame captured by a camera and masking the region, and then, in other frames, the region corresponding to the region is also masked. Generally, since the shooting angle of the dome camera can be changed, the method of mapping between regions of the picture provided in the embodiment of the present application can ensure that during the rotation of the dome camera, the relevant area in the picture collected by the dome camera at any shooting angle is performed. Shelter.
对应于上述本申请实施例提供的一种画面间区域映射方法,本申请实施例还提供了一种画面间区域映射装置。Corresponding to the method for mapping regions between screens provided in the embodiments of the present application, the embodiment of this application also provides a device for mapping regions between screens.
图8为本申请实施例提供的一种画面间区域映射装置的结构示意图,如图8所示,该画面间区域映射装置可以包括以下模块:FIG. 8 is a schematic structural diagram of an inter-screen region mapping device according to an embodiment of the present application. As shown in FIG. 8, the inter-screen region mapping device may include the following modules:
第一区域确定模块810,用于确定在待区域映射的第一画面中所指定的目标区域;A first area determination module 810, configured to determine a target area specified in a first picture to be area-mapped;
转换关系确定模块820,用于确定第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;A conversion relationship determining module 820, configured to determine a target coordinate conversion relationship between a camera to which a first picture belongs and a camera to which a second picture to be mapped belongs;
第二区域确定模块830,用于基于目标区域和目标坐标转换关系,在第二画面中确定与目标区域对应的区域。The second region determining module 830 is configured to determine a region corresponding to the target region in the second picture based on the target region and the target coordinate conversion relationship.
以上可见,在本申请实施例提供的方案中,确定待区域映射的第一画面所属相机和待区域映射的第二画面所属相机之间的目标坐标转换关系,进而,当在待区域映射的第一画面中确定目标区域后,可以根据该目标坐标转换关系和该目标区域,在待区域映射的第二画面中确定与该目标区域对应的区域,以实现当在一个画面中给定目标区域时,在另一画面中有效确定与该目标区域对应的区域。此外,本申请实施例提供的方案可以针对不同类型的相机,具有较好的适应性,同时,根据目标坐标转换关系确定与目标区域对应的区 域,由于目标坐标转换关系是根据待区域映射的第一画面所属相机和待区域映射的第二画面所属相机确定的,因此,确定与目标区域对应的区域的操作简便且不需要依靠额外信息。It can be seen from the above that in the solution provided by the embodiment of the present application, the target coordinate conversion relationship between the camera to which the first picture to be area mapped belongs and the camera to which the second picture to be area mapped belongs, and further, when the After the target area is determined in one picture, the area corresponding to the target area can be determined in the second picture to be area mapped according to the target coordinate conversion relationship and the target area, so that when the target area is given in one picture, , Effectively determine the area corresponding to the target area in another picture. In addition, the solution provided by the embodiments of the present application can be adapted to different types of cameras, and has a good adaptability. At the same time, the area corresponding to the target area is determined according to the target coordinate conversion relationship. The camera to which a picture belongs and the camera to which the second picture to be mapped belongs are determined. Therefore, the operation of determining the area corresponding to the target area is simple and does not require additional information.
可选的,一种具体实现方式中,上述第二区域确定模块830可以包括:Optionally, in a specific implementation manner, the foregoing second area determination module 830 may include:
特征点选取子模块,用于从目标区域中选取多个特征点,其中,多个特征点为能够表征目标区域的多个像素点;Feature point selection sub-module, for selecting multiple feature points from the target area, where the multiple feature points are multiple pixel points capable of characterizing the target area;
第二区域确定子模块,用于基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域。The second region determining submodule is configured to determine a region corresponding to the target region in the second picture based on a plurality of feature points and a target coordinate conversion relationship.
可选的,一种具体实现方式中,第一画面所属相机为枪机,第二画面所属相机为球机;或,第一画面所属相机为球机,第二画面所属相机为枪机;则上述转换关系确定模块820可以包括:Optionally, in a specific implementation manner, the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a dome camera; or, the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a dome camera; The above conversion relationship determination module 820 may include:
第一关系确定子模块,用于确定枪机和球机之间的坐标转换关系,作为第一坐标转换关系;A first relationship determining submodule, configured to determine a coordinate conversion relationship between a gun machine and a dome camera, as a first coordinate conversion relationship;
第二关系确定子模块,用于确定球机对应的坐标转换关系,作为第二坐标转换关系,其中,球机对应的坐标转换关系为:球机的方位角与球机采集到的画面中心点的坐标的转换关系;A second relationship determination sub-module is used to determine a coordinate conversion relationship corresponding to the dome camera as a second coordinate conversion relationship, wherein the coordinate conversion relationship corresponding to the dome camera is: the azimuth angle of the dome camera and the center point of the picture collected by the dome camera The transformation relationship of the coordinates;
第一目标关系确定子模块,用于将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。The first target relationship determining submodule is configured to determine the first coordinate conversion relationship and the second coordinate conversion relationship as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
可选的,一种具体实现方式中,第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定;则上述转换关系确定模块820可以包括:Optionally, in a specific implementation manner, the camera to which the first picture belongs is a first dome camera, the camera to which the second picture belongs is a second dome camera, and the azimuth of the first dome camera is fixed; then the above-mentioned conversion relationship determination module 820 may include:
第三关系确定子模块,用于确定第一球机和第二球机之间的坐标转换关系,作为第一坐标转换关系;A third relationship determining submodule, configured to determine a coordinate conversion relationship between the first dome camera and the second dome camera, as a first coordinate transformation relationship;
第四关系确定子模块,用于确定第二球机对应的坐标转换关系,作为第二坐标转换关系,其中,第二球机对应的坐标转换关系为:第二球机的方位角与第二球机采集到的画面中心点的坐标的转换关系;A fourth relationship determining sub-module is used to determine a coordinate transformation relationship corresponding to the second dome camera as a second coordinate transformation relationship, wherein the coordinate transformation relationship corresponding to the second dome camera is: the azimuth of the second dome camera and the second dome camera The transformation relationship of the coordinates of the center point of the picture collected by the dome camera;
第二目标关系确定子模块,用于将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标 转换关系。A second target relationship determining sub-module is configured to determine the first coordinate conversion relationship and the second coordinate conversion relationship as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
可选的,一种具体实现方式中,第一画面所属相机为枪机,第二画面所属相机为球机;或,第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定;则上述第二区域确定子模块可以包括:Optionally, in a specific implementation manner, the camera to which the first picture belongs is a gun camera, and the camera to which the second picture belongs is a dome camera; or, the camera to which the first picture belongs is a first dome camera, and the camera to which the second picture belongs is a second camera. Dome camera, the azimuth of the first dome camera is fixed; then the above-mentioned second area determination submodule may include:
第一方位角确定单元,用于基于第一坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;A first azimuth determining unit, configured to determine an azimuth corresponding to each feature point based on a first coordinate transformation relationship and coordinates of a plurality of feature points in a first picture;
第一画面获得单元,用于在所确定的方位角中选取旋转目标设备所依据的第一方位角,并按照第一方位角旋转目标设备,得到第二画面;其中,当第一画面所属相机为枪机,第二画面所属相机为球机时,目标设备为球机;当第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定时,目标设备为第二球机;A first picture obtaining unit, configured to select a first azimuth on which the rotation target device is based from the determined azimuth, and rotate the target device according to the first azimuth to obtain a second picture; wherein when the camera to which the first picture belongs belongs Is a dome camera, when the camera to which the second picture belongs is a dome camera, the target device is a dome camera; when the camera to which the first picture belongs is a dome camera, the camera to which the second picture belongs is a second dome camera, and the azimuth of the first dome camera When fixed, the target device is the second dome camera;
第一目标点确定单元,用于基于第二坐标转换关系,在第二画面中确定各个特征点所对应的第一目标点,其中,任一特征点所对应的第一目标点为:所对应方位角与该特征点对应的方位角相同的像素点;A first target point determining unit, configured to determine a first target point corresponding to each feature point in the second picture based on a second coordinate transformation relationship, wherein the first target point corresponding to any feature point is: Pixels with the same azimuth as the azimuth corresponding to the feature point;
第一区域确定单元,用于将第二画面中基于多个第一目标点所确定出的区域,作为目标区域对应的区域。The first region determining unit is configured to use a region determined based on a plurality of first target points in the second picture as a region corresponding to the target region.
可选的,一种具体实现方式中,第一画面所属相机为球机,第二画面所属相机为枪机;则上述第二区域确定子模块可以包括:Optionally, in a specific implementation manner, the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine; then the above-mentioned second area determination submodule may include:
第二方位角确定单元,用于基于第二坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;A second azimuth angle determining unit, configured to determine an azimuth angle corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of multiple feature points in the first picture;
第二目标点确定单元,用于基于第一坐标转换关系和所确定的各个特征点对应的方位角,在第二画面中确定各个特征点所对应的第二目标点;A second target point determining unit, configured to determine a second target point corresponding to each feature point in the second picture based on the first coordinate conversion relationship and the determined azimuth corresponding to each feature point;
第二区域确定单元,用于将第二画面中基于多个第二目标点所确定出的区域,作为目标区域对应的区域。The second region determining unit is configured to use, as the region corresponding to the target region, a region determined based on the plurality of second target points in the second picture.
可选的,一种具体实现方式在,上述画面间区域映射装置还可以包括坐标转换关系确定模块,用于确定枪机和球机之间的坐标转换关系,该坐标转换关系确定模块可以包括:Optionally, a specific implementation manner is that the inter-screen area mapping device may further include a coordinate conversion relationship determining module for determining a coordinate conversion relationship between a gun and a dome camera, and the coordinate conversion relationship determining module may include:
第一坐标确定子模块,用于确定预设的m个参考点在枪机采集的画面中对应的坐标,得到m个第一坐标,其中,参考点为:第一画面所属相机和第二画 面所属相机所能拍摄到的三维空间中的点,m≥4;The first coordinate determination submodule is used to determine the preset coordinates corresponding to the m reference points in the picture collected by the gun machine to obtain m first coordinates, where the reference points are: the camera to which the first picture belongs and the second picture Points in the three-dimensional space that can be captured by the camera, m≥4;
方位角确定子模块,用于针对每一个参考点,确定球机以该参考点为画面中心时的方位角,得到m个方位角;The azimuth determination sub-module is used to determine, for each reference point, the azimuth when the dome camera uses the reference point as the center of the screen, and obtain m azimuth angles;
第二坐标确定子模块,用于将m个方位角转换为m个第二坐标;A second coordinate determination submodule, configured to convert m azimuth angles into m second coordinates;
坐标转换关系确定子模块,用于基于m个第一坐标和m个第二坐标,计算单应性矩阵,并将单应性矩阵作为第一坐标转换关系。The coordinate conversion relationship determination sub-module is configured to calculate a homography matrix based on m first coordinates and m second coordinates, and use the homography matrix as a first coordinate transformation relationship.
可选的,一种具体实现方式中,第一画面所属相机和第二画面所属相机为同一个球机,且第一画面为球机的方位角为初始方位角时采集的画面;则转换关系确定模块820可以包括:Optionally, in a specific implementation manner, the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome camera, and the first picture is a picture acquired when the azimuth of the dome camera is the initial azimuth; The determination module 820 may include:
第五关系确定子模块,用于确定球机对应的坐标转换关系,其中,球机对应的坐标转换关系为:球机的方位角与球机采集到的画面中心点的坐标的转换关系;A fifth relationship determining sub-module is used to determine a coordinate conversion relationship corresponding to the dome camera, wherein the coordinate conversion relationship corresponding to the dome camera is: a transformation relationship between the azimuth angle of the dome camera and the coordinates of the center point of the screen collected by the dome camera;
第三目标关系确定子模块,用于将球机对应的坐标转换关系作为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。A third target relationship determining submodule is configured to use the coordinate conversion relationship corresponding to the dome camera as the target coordinate conversion relationship of the camera to which the first picture belongs and the camera to which the second picture to be mapped belongs.
进而,在本实现方式中,上述第二区域确定子模块可以包括:Furthermore, in this implementation manner, the above-mentioned second area determination submodule may include:
第三方位角确定单元,用于基于目标坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;A third-party position angle determining unit, configured to determine an azimuth angle corresponding to each feature point based on a target coordinate conversion relationship and coordinates of multiple feature points in the first screen;
第二画面获得单元,用于在所确定的方位角中选取旋转球机所依据的第二方位角,并按照第二方位角旋转球机,得到第二画面;A second picture obtaining unit, configured to select, from the determined azimuth angles, a second azimuth angle on which the dome camera is based, and rotate the dome camera according to the second azimuth angle to obtain a second picture;
第三坐标点确定单元,用于基于目标坐标转换关系,在第二画面中确定各个特征点所对应的第三目标点,任一特征点所对应的第三目标点为:所对应方位角与该特征点对应的方位角相同的像素点;A third coordinate point determining unit, configured to determine a third target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship, and the third target point corresponding to any feature point is: the corresponding azimuth angle and The feature points correspond to pixels with the same azimuth;
第三区域确定单元,用于将第二画面中基于多个第三目标点所确定出的区域,作为目标区域对应的区域。The third region determining unit is configured to use, as the region corresponding to the target region, the region determined based on the plurality of third target points in the second picture.
可选的,一种具体实现方式中,第一画面所属相机和第二画面所属相机为不同的枪机;则上述转换关系确定模块820可以包括:Optionally, in a specific implementation manner, the camera to which the first picture belongs and the camera to which the second picture belongs are different guns; the conversion relationship determining module 820 may include:
第六关系确定子模块,用于确定不同的枪机之间的坐标转换关系;The sixth relationship determining sub-module is used to determine the coordinate conversion relationship between different guns;
第四目标关系确定子模块,用于将所确定的不同的枪机之间的坐标转换 关系,作为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。A fourth target relationship determination submodule is configured to use the determined coordinate conversion relationship between different guns as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
进而,在本实现方式中,上述第二区域确定子模块可以包括:Furthermore, in this implementation manner, the above-mentioned second area determination submodule may include:
第四目标点确定单元,用于基于目标坐标转换关系及多个特征点在第一画面内的坐标,在第二画面中确定各个特征点对应的第四目标点;A fourth target point determining unit, configured to determine a fourth target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship and the coordinates of the multiple feature points in the first picture;
第四区域确定单元,用于将第二画面中基于多个第四目标点所确定出的区域,作为目标区域对应的区域。The fourth area determining unit is configured to use, as the area corresponding to the target area, the area determined based on the plurality of fourth target points in the second picture.
对应于上述本申请实施例提供的一种画面间区域映射方法,本申请实施例还提供了一种多相机观测系统。Corresponding to the foregoing method for mapping regions between pictures provided by the embodiment of the present application, the embodiment of the present application further provides a multi-camera observation system.
图10为本申请实施例提供的一种多相机观测系统的结构示意图,如图10所示,该系统可以包括控制器110和至少一个相机120,其中,至少一个相机120中可以包括待区域映射的第一画面所属相机和待区域映射的第二画面所属相机;FIG. 10 is a schematic structural diagram of a multi-camera observation system according to an embodiment of the present application. As shown in FIG. 10, the system may include a controller 110 and at least one camera 120, where the at least one camera 120 may include a region to be mapped. The camera to which the first picture belongs and the camera to which the second picture to be mapped belongs;
则第一画面所属相机可以用于采集待区域映射的第一画面;The camera to which the first picture belongs can be used to collect the first picture to be mapped in the area to be mapped;
则第二画面所属相机可以用于采集待区域映射的第二画面;The camera to which the second picture belongs can be used to collect the second picture to be mapped in the area to be mapped;
上述控制器110可以用于:确定在第一画面中所指定的目标区域;确定第一画面所属相机和第二画面所属相机的目标坐标转换关系;基于目标区域和目标坐标转换关系,在第二画面中确定与目标区域对应的区域。The controller 110 may be configured to: determine a target area specified in the first frame; determine a target coordinate conversion relationship between a camera to which the first frame belongs and a camera to which the second frame belongs; based on the target area and the target coordinate conversion relationship, in the second frame The area corresponding to the target area is determined in the screen.
可选的,一种具体实现方式中,上述控制器110还可以用于:Optionally, in a specific implementation manner, the foregoing controller 110 may also be used for:
从目标区域中选取多个特征点;基于多个特征点和目标坐标转换关系,在第二画面中确定与目标区域对应的区域;其中,多个特征点为能够表征目标区域的多个像素点。Select multiple feature points from the target area; determine the area corresponding to the target area in the second screen based on the multiple feature points and the target coordinate conversion relationship; where the multiple feature points are multiple pixel points capable of characterizing the target area .
可选的,一种具体实现方式中,上述至少一个相机120中可以包括一个枪机和一个球机,且第一画面所属相机为枪机,第二画面所属相机为球机;或,上述至少一个相机120中可以包括一个枪机和一个球机,且第一画面所属相机为球机,第二画面所属相机为枪机;Optionally, in a specific implementation manner, the at least one camera 120 may include a gun machine and a dome camera, and the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera; or A camera 120 may include a shooter and a dome camera, and the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
则在本实现方式中,上述控制器110可以用于:确定枪机和球机之间的坐标转换关系,作为第一坐标转换关系;确定球机对应的坐标转换关系,作为 第二坐标转换关系;将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;Then, in this implementation manner, the controller 110 may be configured to: determine a coordinate conversion relationship between a gun and a dome camera as a first coordinate conversion relationship; determine a coordinate conversion relationship corresponding to the dome camera as a second coordinate conversion relationship Determining the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship between the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs;
其中,球机对应的坐标转换关系为:球机的方位角与球机采集到的画面中心点的坐标的转换关系。The coordinate conversion relationship corresponding to the dome camera is the conversion relationship between the azimuth of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
可选的,一种具体实现方式中,上述至少一个相机120中可以包括第一球机和第二球机,且第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定;Optionally, in a specific implementation manner, the at least one camera 120 may include a first dome camera and a second dome camera, and the camera to which the first picture belongs is the first dome camera, and the camera to which the second picture belongs is the second dome camera. Machine, the azimuth of the first ball machine is fixed;
则在本实现方式中,上述控制器110可以用于:确定第一球机和第二球机之间的坐标转换关系,作为第一坐标转换关系;确定第二球机对应的坐标转换关系,作为第二坐标转换关系;将第一坐标转换关系和第二坐标转换关系,确定为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;Then, in this implementation manner, the controller 110 may be configured to: determine a coordinate conversion relationship between the first dome camera and a second dome camera as the first coordinate transformation relationship; determine a coordinate transformation relationship corresponding to the second dome camera, As the second coordinate conversion relationship; determining the first coordinate conversion relationship and the second coordinate conversion relationship as the target coordinate conversion relationship of the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs;
其中,第二球机对应的坐标转换关系为:第二球机的方位角与第二球机采集到的画面中心点的坐标的转换关系。The coordinate conversion relationship corresponding to the second dome camera is: the conversion relationship between the azimuth of the second dome camera and the coordinates of the center point of the picture collected by the second dome camera.
可选的,一种具体实现方式中,上述至少一个相机120中可以包括一个枪机和一个球机,且第一画面所属相机为枪机,第二画面所属相机为球机;或,上述至少一个相机120中可以包括第一球机和第二球机,且第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定;Optionally, in a specific implementation manner, the at least one camera 120 may include a gun machine and a dome camera, and the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera; or A camera 120 may include a first dome camera and a second dome camera, and the camera to which the first picture belongs is the first dome camera, the camera to which the second picture belongs is the second dome camera, and the azimuth of the first dome camera is fixed;
则在本实现方式中,上述控制器110用于:基于第一坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;在所确定的方位角中选取旋转目标设备所依据的第一方位角,并按照第一方位角旋转目标设备,得到第二画面。In this implementation manner, the controller 110 is configured to: determine an azimuth angle corresponding to each feature point based on the first coordinate transformation relationship and the coordinates of multiple feature points in the first screen; and select from the determined azimuth angles Rotate the first azimuth on which the target device is based, and rotate the target device according to the first azimuth to obtain a second picture.
其中,当第一画面所属相机为枪机,第二画面所属相机为球机时,目标设备为球机;当第一画面所属相机为第一球机,第二画面所属相机为第二球机,第一球机的方位角固定时,目标设备为第二球机;基于第二坐标转换关系,在第二画面中确定各个特征点所对应的第一目标点,其中,任一特征点所对应的第一目标点为:所对应方位角与该特征点对应的方位角相同的像素点;将第二画面中基于多个第一目标点所确定出的区域,作为目标区域对应的区域。Wherein, when the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a dome camera, the target device is a dome camera; when the camera to which the first picture belongs is a first dome camera, and the camera to which the second picture belongs is a second dome camera. When the azimuth of the first dome camera is fixed, the target device is the second dome camera; based on the second coordinate transformation relationship, the first target point corresponding to each feature point is determined in the second picture, where any feature point is The corresponding first target point is: a pixel point whose corresponding azimuth angle is the same as the azimuth angle corresponding to the feature point; and an area determined based on the plurality of first target points in the second picture is used as the area corresponding to the target area.
可选的,一种具体实现方式中,上述至少一个相机120中可以包括一个枪机和一个球机,且第一画面所属相机为球机,第二画面所属相机为枪机;Optionally, in a specific implementation manner, the at least one camera 120 may include a gun machine and a dome camera, and the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
则在本实现方式中,上述控制器110可以用于:基于第二坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;基于第一坐标转换关系和所确定的各个特征点对应的方位角,在第二画面中确定各个特征点所对应的第二目标点;将第二画面中基于多个第二目标点所确定出的区域,作为目标区域对应的区域。In this implementation manner, the controller 110 may be configured to determine an azimuth corresponding to each feature point based on the second coordinate transformation relationship and the coordinates of multiple feature points in the first screen; based on the first coordinate transformation relationship and The determined azimuth corresponding to each feature point determines the second target point corresponding to each feature point in the second picture; and the area determined based on the plurality of second target points in the second picture is used as the target area corresponding Area.
可选的,一种具体实现方式中,上述至少一个相机120中可以包括:一个球机,且第一画面所属相机和第二画面所属相机为球机,且第一画面为球机的方位角为初始方位角时采集的画面;Optionally, in a specific implementation manner, the at least one camera 120 may include a dome camera, and the camera to which the first picture belongs and the camera to which the second picture belongs are dome cameras, and the first picture is the azimuth of the dome camera. The picture collected at the initial azimuth;
则在本实现方式中,上述控制器110可以用于:确定球机对应的坐标转换关系;将球机对应的坐标转换关系作为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;In this implementation manner, the controller 110 may be configured to: determine the coordinate conversion relationship corresponding to the dome camera; use the coordinate conversion relationship corresponding to the dome camera as the target of the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs. Coordinate conversion relationship;
在本实现方式中,上述控制器110在确定第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系后,还可以用于:基于目标坐标转换关系和多个特征点在第一画面内的坐标,确定各个特征点对应的方位角;在所确定的方位角中选取旋转球机所依据的第二方位角,并按照第二方位角旋转球机,得到第二画面;基于目标坐标转换关系,在第二画面中确定各个特征点所对应的第三目标点;将第二画面中基于多个第三目标点所确定出的区域,作为目标区域对应的区域。In this implementation manner, after the controller 110 determines the target coordinate conversion relationship between the camera to which the first screen belongs and the camera to which the second screen to be mapped belongs, it can also be used to: based on the target coordinate conversion relationship and multiple feature points in the The coordinates in the first frame determine the azimuth angle corresponding to each feature point; select the second azimuth angle on which the dome camera is based on the determined azimuth angle, and rotate the dome camera according to the second azimuth angle to obtain the second picture; Based on the target coordinate conversion relationship, a third target point corresponding to each feature point is determined in the second picture; and an area determined based on the plurality of third target points in the second picture is used as a region corresponding to the target area.
其中,其中,球机对应的坐标转换关系为:球机的方位角与球机采集到的画面中心点的坐标的转换关系;任一特征点所对应的第三目标点为:所对应方位角与该特征点对应的方位角相同的像素点。Among them, the coordinate conversion relationship corresponding to the dome camera is: the conversion relationship between the dome camera's azimuth angle and the coordinates of the center point of the screen collected by the dome camera; the third target point corresponding to any feature point is: the corresponding azimuth Pixel points with the same azimuth angle as the feature points.
可选的,一种具体实现方式中,上述至少一个相机120中可以包括:不同的枪机,且第一画面所属相机和第二画面所属相机为不同的枪机;Optionally, in a specific implementation manner, the at least one camera 120 may include: different guns, and the cameras to which the first picture belongs and the cameras to which the second picture belongs are different guns;
则在本实现方式中,上述控制器110可以用于:确定不同的枪机之间的坐标转换关系;将所确定的不同的枪机之间的坐标转换关系,作为第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;In this implementation manner, the controller 110 may be configured to: determine the coordinate conversion relationship between different guns; and use the determined coordinate conversion relationship between the different guns as the camera and the target to which the first screen belongs. The target coordinate conversion relationship of the camera to which the second picture of the area map belongs;
在本实现方式中,上述控制器110在确定第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系后,还可以用于:基于目标坐标转换关系及多个特征点在第一画面内的坐标,在第二画面中确定各个特征点对应的第四目标点;将第二画面中基于多个第四目标点所确定出的区域,作为目标区域对应的区域。In this implementation manner, after the controller 110 determines the target coordinate conversion relationship between the camera to which the first screen belongs and the camera to which the second screen belongs to be mapped, it can also be used to: based on the target coordinate conversion relationship and multiple feature points in the The coordinates in the first picture determine the fourth target point corresponding to each feature point in the second picture; and use the area determined based on the plurality of fourth target points in the second picture as the area corresponding to the target area.
需要说明的是,关于上述控制器110执行的各个步骤的详细介绍,可以参见上述方法实施例的相应内容,在此不做赘述。It should be noted that, for a detailed description of each step performed by the controller 110, reference may be made to corresponding content of the foregoing method embodiment, and details are not described herein.
本申请实施例还提供了一种电子设备,该电子设备为多相机观测系统中的控制器,如图9所示,该电子设备包括处理器901、通信接口902、存储器903和通信总线904,其中,处理器901,通信接口902,存储器903通过通信总线904完成相互间的通信,An embodiment of the present application further provides an electronic device. The electronic device is a controller in a multi-camera observation system. As shown in FIG. 9, the electronic device includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904. Among them, the processor 901, the communication interface 902, and the memory 903 complete communication with each other through the communication bus 904.
存储器903,用于存放计算机程序;The memory 903 is configured to store a computer program;
处理器901,用于执行存储器903上所存放的程序时,实现上述本申请实施例提供的一种画面间区域映射方法中的任一方法步骤。The processor 901 is configured to, when executing a program stored in the memory 903, implement any of the method steps in the method for mapping regions between screens provided by the embodiments of the present application.
上述控制器提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned by the controller may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, the figure only uses a thick line to represent, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述控制器与其他设备之间的通信。The communication interface is used for communication between the controller and other devices.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the foregoing processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The aforementioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc .; it may also be a digital signal processor (Digital Signal Processing, DSP), special integration Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储极致内存储有计算机程序,该计算机程序被处理器执行时实现上述本申请实施例提供的一种画面间区域映射方法中的任一方法步骤。An embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method for mapping regions between screens provided by the embodiments of the present application is implemented. In any of the method steps.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、 “包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is any such actual relationship or order among them. Moreover, the terms "including," "including," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also those that are not explicitly listed Or other elements inherent to such a process, method, article, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article, or equipment including the elements.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例、系统实施例、控制器实施例、计算机可读存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiment, the system embodiment, the controller embodiment, and the computer-readable storage medium embodiment are basically similar to the method embodiment, so the description is relatively simple. For the related parts, refer to the method embodiment Just explain.
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above are only preferred embodiments of this application, and are not intended to limit this application. Any modification, equivalent replacement, or improvement made within the spirit and principles of this application shall be included in this application Within the scope of protection.

Claims (20)

  1. 一种画面间区域映射方法,其特征在于,所述方法包括:A method for mapping regions between pictures is characterized in that the method includes:
    确定在待区域映射的第一画面中所指定的目标区域;Determining the target area specified in the first picture of the area to be mapped;
    确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;Determining a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs;
    基于所述目标区域和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。Based on the target area and the target coordinate conversion relationship, an area corresponding to the target area is determined in the second picture.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述目标区域和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域的步骤,包括:The method according to claim 1, wherein the step of determining an area corresponding to the target area in the second screen based on the target area and the target coordinate conversion relationship comprises:
    从所述目标区域中选取多个特征点,其中,所述多个特征点为能够表征所述目标区域的多个像素点;Selecting multiple feature points from the target area, where the multiple feature points are multiple pixel points capable of characterizing the target area;
    基于所述多个特征点和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。Based on the plurality of feature points and the target coordinate conversion relationship, a region corresponding to the target region is determined in the second picture.
  3. 根据权利要求2所述的方法,其特征在于,所述第一画面所属相机为枪机,所述第二画面所属相机为球机;或,所述第一画面所属相机为球机,所述第二画面所属相机为枪机;The method according to claim 2, wherein the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera; or, the camera to which the first picture belongs is a dome camera, and The camera to which the second picture belongs is a gun;
    所述确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系的步骤,包括:The step of determining a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs to includes:
    确定所述枪机和所述球机之间的坐标转换关系,作为第一坐标转换关系;Determining a coordinate conversion relationship between the gun machine and the ball machine as a first coordinate conversion relationship;
    确定所述球机对应的坐标转换关系,作为第二坐标转换关系,其中,所述球机对应的坐标转换关系为:所述球机的方位角与所述球机采集到的画面中心点的坐标的转换关系;Determine the coordinate conversion relationship corresponding to the dome camera as the second coordinate conversion relationship, wherein the coordinate conversion relationship corresponding to the dome camera is: the azimuth of the dome camera and the center point of the picture collected by the dome camera Coordinate conversion relationship;
    将所述第一坐标转换关系和所述第二坐标转换关系,确定为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。The first coordinate conversion relationship and the second coordinate conversion relationship are determined as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
  4. 根据权利要求2所述的方法,其特征在于,所述第一画面所属相机为第一球机,所述第二画面所属相机为第二球机,所述第一球机的方位角固定;The method according to claim 2, wherein the camera to which the first picture belongs is a first dome camera, the camera to which the second picture belongs is a second dome camera, and the azimuth of the first dome camera is fixed;
    所述确定所述第一画面所属相机和待区域映射的第二画面所属相机的目 标坐标转换关系的步骤,包括:The step of determining a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs includes:
    确定所述第一球机和所述第二球机之间的坐标转换关系,作为第一坐标转换关系;Determining a coordinate transformation relationship between the first dome camera and the second dome camera as a first coordinate transformation relationship;
    确定所述第二球机对应的坐标转换关系,作为第二坐标转换关系,其中,所述第二球机对应的坐标转换关系为:所述第二球机的方位角与所述第二球机采集到的画面中心点的坐标的转换关系;Determining a coordinate conversion relationship corresponding to the second ball machine as a second coordinate conversion relationship, wherein the coordinate conversion relationship corresponding to the second ball machine is: an azimuth of the second ball machine and the second ball The conversion relationship of the coordinates of the center point of the screen collected by the camera;
    将所述第一坐标转换关系和所述第二坐标转换关系,确定为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。The first coordinate conversion relationship and the second coordinate conversion relationship are determined as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
  5. 根据权利要求3或4所述的方法,其特征在于,所述第一画面所属相机为枪机,所述第二画面所属相机为球机;或,所述第一画面所属相机为第一球机,所述第二画面所属相机为第二球机,所述第一球机的方位角固定;The method according to claim 3 or 4, wherein the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is a dome camera; or the camera to which the first picture belongs is a first ball Camera, the camera to which the second picture belongs is a second dome camera, and the azimuth of the first dome camera is fixed;
    所述基于所述多个特征点和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域的步骤,包括:The step of determining an area corresponding to the target area in the second screen based on the plurality of feature points and the target coordinate conversion relationship includes:
    基于所述第一坐标转换关系和所述多个特征点在所述第一画面内的坐标,确定各个特征点对应的方位角;Determining an azimuth corresponding to each feature point based on the first coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen;
    在所确定的方位角中选取旋转目标设备所依据的第一方位角,并按照所述第一方位角旋转所述目标设备,得到所述第二画面;其中,当所述第一画面所属相机为枪机,所述第二画面所属相机为球机时,所述目标设备为所述球机;当所述第一画面所属相机为第一球机,所述第二画面所属相机为第二球机,所述第一球机的方位角固定时,所述目标设备为所述第二球机;Selecting the first azimuth angle on which the target device is rotated from the determined azimuth angle, and rotating the target device according to the first azimuth angle to obtain the second picture; wherein when the camera to which the first picture belongs belongs Is a dome camera, when the camera to which the second picture belongs is a dome camera, the target device is the dome camera; when the camera to which the first picture belongs is a first dome camera, and the camera to which the second picture belongs is a second camera A dome camera, when the azimuth of the first dome camera is fixed, the target device is the second dome camera;
    基于所述第二坐标转换关系,在所述第二画面中确定各个特征点所对应的第一目标点,其中,任一特征点所对应的第一目标点为:所对应方位角与该特征点对应的方位角相同的像素点;Based on the second coordinate conversion relationship, a first target point corresponding to each feature point is determined in the second picture, wherein the first target point corresponding to any feature point is: the corresponding azimuth angle and the feature Pixels corresponding to the same azimuth angle;
    将所述第二画面中基于所述多个第一目标点所确定出的区域,作为所述目标区域对应的区域。The area determined in the second picture based on the plurality of first target points is used as an area corresponding to the target area.
  6. 根据权利要求3所述的方法,其特征在于,所述第一画面所属相机为球机,所述第二画面所属相机为枪机;The method according to claim 3, wherein the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
    所述基于所述多个特征点和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域的步骤,包括:The step of determining an area corresponding to the target area in the second screen based on the plurality of feature points and the target coordinate conversion relationship includes:
    基于所述第二坐标转换关系和所述多个特征点在所述第一画面内的坐标,确定各个特征点对应的方位角;Determining an azimuth corresponding to each feature point based on the second coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen;
    基于所述第一坐标转换关系和所确定的各个特征点对应的方位角,在所述第二画面中确定各个特征点所对应的第二目标点;Determining a second target point corresponding to each feature point in the second picture based on the first coordinate transformation relationship and the determined azimuth angle corresponding to each feature point;
    将所述第二画面中基于所述多个第二目标点所确定出的区域,作为所述目标区域对应的区域。The area determined in the second picture based on the plurality of second target points is used as an area corresponding to the target area.
  7. 根据权利要求3所述的方法,其特征在于,通过以下方式确定所述枪机和所述球机之间的坐标转换关系,所述方式包括:The method according to claim 3, wherein the coordinate conversion relationship between the gun machine and the ball machine is determined in the following ways, and the modes include:
    确定预设的m个参考点在所述枪机采集的画面中对应的坐标,得到m个第一坐标,其中,所述参考点为:所述第一画面所属相机和所述第二画面所属相机所能拍摄到的三维空间中的点,m≥4;Determine the preset coordinates corresponding to the m reference points in the picture collected by the gun machine, and obtain m first coordinates, where the reference points are: the camera to which the first picture belongs and the second picture to which the first picture belongs Points in the three-dimensional space that can be captured by the camera, m≥4;
    针对每一个参考点,确定所述球机以该参考点为画面中心时的方位角,得到m个方位角;For each reference point, determine the azimuth angle when the dome camera uses the reference point as the center of the screen, and obtain m azimuth angles;
    将所述m个方位角转换为m个第二坐标;Converting the m azimuth angles into m second coordinates;
    基于所述m个第一坐标和所述m个第二坐标,计算单应性矩阵,并将所述单应性矩阵作为所述枪机和所述球机之间的坐标转换关系。Based on the m first coordinates and the m second coordinates, a homography matrix is calculated, and the homography matrix is used as a coordinate conversion relationship between the gun machine and the ball machine.
  8. 根据权利要求2所述的方法,其特征在于,所述第一画面所属相机和所述第二画面所属相机为同一个球机,且所述第一画面为所述球机的方位角为初始方位角时采集的画面;The method according to claim 2, wherein the camera to which the first picture belongs and the camera to which the second picture belongs are the same dome camera, and the azimuth of the first picture is the dome camera as an initial Picture collected at azimuth;
    所述确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系的步骤,包括:The step of determining a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs to includes:
    确定所述球机对应的坐标转换关系,其中,所述球机对应的坐标转换关系为:所述球机的方位角与所述球机采集到的画面中心点的坐标的转换关系;Determining a coordinate conversion relationship corresponding to the dome camera, wherein the coordinate conversion relationship corresponding to the dome camera is: a transformation relationship between an azimuth angle of the dome camera and coordinates of a center point of a screen collected by the dome camera;
    将所述球机对应的坐标转换关系作为所述第一画面所属相机和待区域映射的第二画面所属相机所对应的目标坐标转换关系。The coordinate conversion relationship corresponding to the dome camera is used as the target coordinate conversion relationship corresponding to the camera to which the first picture belongs and the camera to which the second picture to be mapped belongs.
  9. 根据权利要求8所述的方法,其特征在于,所述基于所述多个特征点和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域的步骤,包括:The method according to claim 8, wherein the step of determining a region corresponding to the target region in the second screen based on the plurality of feature points and the target coordinate conversion relationship includes: :
    基于所述目标坐标转换关系和所述多个特征点在所述第一画面内的坐标, 确定各个特征点对应的方位角;Determining an azimuth corresponding to each feature point based on the target coordinate conversion relationship and the coordinates of the plurality of feature points in the first picture;
    在所确定的方位角中选取旋转所述球机所依据的第二方位角,并按照所述第二方位角旋转所述球机,得到所述第二画面;Selecting a second azimuth angle on which the dome camera is rotated from the determined azimuth angle, and rotating the dome camera according to the second azimuth angle to obtain the second picture;
    基于所述目标坐标转换关系,在所述第二画面中确定各个特征点所对应的第三目标点,任一特征点所对应的第三目标点为:所对应方位角与该特征点对应的方位角相同的像素点;Based on the target coordinate conversion relationship, a third target point corresponding to each feature point is determined in the second picture, and the third target point corresponding to any feature point is: a corresponding azimuth angle corresponding to the feature point Pixels with the same azimuth;
    将所述第二画面中基于所述多个第三目标点所确定出的区域,作为所述目标区域对应的区域。The area determined in the second picture based on the plurality of third target points is used as an area corresponding to the target area.
  10. 根据权利要求2所述的方法,其特征在于,所述第一画面所属相机和所述第二画面所属相机为不同的枪机;The method according to claim 2, wherein the camera to which the first picture belongs and the camera to which the second picture belongs are different guns;
    所述确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系的步骤,包括:The step of determining a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs to includes:
    确定所述不同的枪机之间的坐标转换关系;Determining a coordinate conversion relationship between the different guns;
    将所确定的不同的枪机之间的坐标转换关系,作为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系。The determined coordinate conversion relationship between different guns is used as a target coordinate conversion relationship between the camera to which the first picture belongs and the camera to which the second picture to be mapped belongs.
  11. 根据权利要求10所述的方法,其特征在于,所述基于所述多个特征点和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域的步骤,包括:The method according to claim 10, wherein the step of determining an area corresponding to the target area in the second screen based on the plurality of feature points and the target coordinate conversion relationship comprises: :
    基于所述目标坐标转换关系及所述多个特征点在所述第一画面内的坐标,在所述第二画面中确定各个特征点对应的第四目标点;Determining a fourth target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship and coordinates of the plurality of feature points in the first picture;
    将所述第二画面中基于所述多个第四目标点所确定出的区域,作为所述目标区域对应的区域。And use an area determined in the second picture based on the plurality of fourth target points as an area corresponding to the target area.
  12. 一种画面间区域映射装置,其特征在于,所述装置包括:A device for mapping regions between pictures is characterized in that the device includes:
    第一区域确定模块,用于确定在待区域映射的第一画面中所指定的目标区域;A first area determination module, configured to determine a target area specified in a first picture to be area-mapped;
    转换关系确定模块,用于确定所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;A transformation relationship determining module, configured to determine a target coordinate transformation relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs;
    第二区域确定模块,用于基于所述目标区域和所述目标坐标转换关系, 在所述第二画面中确定与所述目标区域对应的区域。A second region determining module is configured to determine a region corresponding to the target region in the second screen based on the target region and the target coordinate conversion relationship.
  13. 一种多相机观测系统,其特征在于,所述系统包括控制器和至少一个相机,其中,所述至少一个相机中包括待区域映射的第一画面所属相机和待区域映射的第二画面所属相机;A multi-camera observation system, characterized in that the system includes a controller and at least one camera, wherein the at least one camera includes a camera to which a first picture to be area mapped belongs and a camera to which a second picture to be area mapped belongs. ;
    所述第一画面所属相机用于采集待区域映射的第一画面;The camera to which the first picture belongs is used to collect the first picture to be mapped in the area to be mapped;
    所述第二画面所属相机用于采集待区域映射的第二画面;The camera to which the second picture belongs is used to collect the second picture to be mapped in the area to be mapped;
    所述控制器用于确定在所述第一画面中所指定的目标区域;确定所述第一画面所属相机和所述第二画面所属相机的目标坐标转换关系;基于所述目标区域和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。The controller is configured to determine a target area specified in the first picture; determine a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture belongs; based on the target area and the target The coordinate conversion relationship determines a region corresponding to the target region in the second screen.
  14. 根据权利要求13所述的系统,其特征在于,所述控制器还用于:The system according to claim 13, wherein the controller is further configured to:
    从所述目标区域中选取多个特征点,其中,所述多个特征点为能够表征所述目标区域的多个像素点;Selecting multiple feature points from the target area, where the multiple feature points are multiple pixel points capable of characterizing the target area;
    基于所述多个特征点和所述目标坐标转换关系,在所述第二画面中确定与所述目标区域对应的区域。Based on the plurality of feature points and the target coordinate conversion relationship, a region corresponding to the target region is determined in the second picture.
  15. 根据权利要求14所述的系统,其特征在于,所述至少一个相机中包括一个枪机和一个球机,且所述第一画面所属相机为枪机,所述第二画面所属相机为球机;或,所述至少一个相机中包括一个枪机和一个球机,且所述第一画面所属相机为球机,所述第二画面所属相机为枪机;The system according to claim 14, wherein the at least one camera includes a gun machine and a dome camera, and the camera to which the first picture belongs is a gun machine and the camera to which the second picture belongs is a dome Or, the at least one camera includes a gun camera and a dome camera, and the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine;
    所述控制器用于确定所述枪机和所述球机之间的坐标转换关系,作为第一坐标转换关系;确定所述球机对应的坐标转换关系,作为第二坐标转换关系;将所述第一坐标转换关系和所述第二坐标转换关系,确定为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;The controller is configured to determine a coordinate transformation relationship between the gun machine and the dome camera as a first coordinate transformation relationship; determine a coordinate transformation relationship corresponding to the dome camera as a second coordinate transformation relationship; The first coordinate conversion relationship and the second coordinate conversion relationship are determined as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs.
    其中,所述球机对应的坐标转换关系为:所述球机的方位角与所述球机采集到的画面中心点的坐标的转换关系。The coordinate conversion relationship corresponding to the dome camera is a conversion relationship between the azimuth angle of the dome camera and the coordinates of the center point of the screen collected by the dome camera.
  16. 根据权利要求14所述的系统,其特征在于,所述至少一个相机中包括第一球机和第二球机,且所述第一画面所属相机为第一球机,所述第二画面所属相机为第二球机,所述第一球机的方位角固定;The system according to claim 14, wherein the at least one camera includes a first dome camera and a second dome camera, and the camera to which the first picture belongs is the first dome camera, and the second picture belongs to The camera is a second dome camera, and the azimuth of the first dome camera is fixed;
    所述控制器用于:确定所述第一球机和所述第二球机之间的坐标转换关 系,作为第一坐标转换关系;确定所述第二球机对应的坐标转换关系,作为第二坐标转换关系,将所述第一坐标转换关系和所述第二坐标转换关系,确定为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;The controller is configured to determine a coordinate transformation relationship between the first dome camera and the second dome camera as a first coordinate transformation relationship; determine a coordinate transformation relationship corresponding to the second dome camera as a second A coordinate conversion relationship, determining the first coordinate conversion relationship and the second coordinate conversion relationship as a target coordinate conversion relationship between a camera to which the first picture belongs and a camera to which the second picture to be mapped belongs;
    其中,所述第二球机对应的坐标转换关系为:所述第二球机的方位角与所述第二球机采集到的画面中心点的坐标的转换关系。The coordinate conversion relationship corresponding to the second dome camera is a conversion relationship between the azimuth of the second dome camera and the coordinates of the center point of the screen collected by the second dome camera.
  17. 根据权利要求15或16所述的系统,其特征在于,所述至少一个相机中包括一个枪机和一个球机,且所述第一画面所属相机为枪机,所述第二画面所属相机为球机;或,所述至少一个相机中包括第一球机和第二球机,且所述第一画面所属相机为第一球机,所述第二画面所属相机为第二球机,所述第一球机的方位角固定;The system according to claim 15 or 16, wherein the at least one camera includes a gun machine and a dome camera, and the camera to which the first picture belongs is a gun machine, and the camera to which the second picture belongs is Dome camera; or, the at least one camera includes a first dome camera and a second dome camera, and the camera to which the first picture belongs is a first dome camera, and the camera to which the second picture belongs is a second dome camera, so The first azimuth angle is fixed;
    所述控制器用于:基于所述第一坐标转换关系和所述多个特征点在所述第一画面内的坐标,确定各个特征点对应的方位角;在所确定的方位角中选取旋转目标设备所依据的第一方位角,并按照所述第一方位角旋转所述目标设备,得到所述第二画面;基于所述第二坐标转换关系,在所述第二画面中确定各个特征点所对应的第一目标点;将所述第二画面中基于所述多个第一目标点所确定出的区域,作为所述目标区域对应的区域;The controller is configured to determine an azimuth corresponding to each feature point based on the first coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen; and select a rotation target from the determined azimuth angle. A first azimuth on which the device is based, and rotating the target device according to the first azimuth to obtain the second picture; and determining each feature point in the second picture based on the second coordinate conversion relationship A corresponding first target point; and an area determined in the second picture based on the plurality of first target points as an area corresponding to the target area;
    其中,当所述第一画面所属相机为枪机,所述第二画面所属相机为球机时,所述目标设备为所述球机;当所述第一画面所属相机为第一球机,所述第二画面所属相机为第二球机,所述第一球机的方位角固定时,所述目标设备为所述第二球机;任一特征点所对应的第一目标点为:所对应方位角与该特征点对应的方位角相同的像素点。Wherein, when the camera to which the first picture belongs is a gun camera and the camera to which the second picture belongs is a dome camera, the target device is the dome camera; when the camera to which the first picture belongs is a first dome camera, The camera to which the second picture belongs is a second dome camera, and when the azimuth of the first dome camera is fixed, the target device is the second dome camera; the first target point corresponding to any feature point is: Pixel points corresponding to the same azimuth angle as the feature point.
  18. 根据权利要求15所述的系统,其特征在于,所述至少一个相机中包括一个枪机和一个球机,且所述第一画面所属相机为球机,所述第二画面所属相机为枪机;The system according to claim 15, wherein the at least one camera comprises a gun machine and a dome camera, and the camera to which the first picture belongs is a dome camera, and the camera to which the second picture belongs is a gun machine. ;
    所述控制器用于:基于所述第二坐标转换关系和所述多个特征点在所述第一画面内的坐标,确定各个特征点对应的方位角;基于所述第一坐标转换关系和所确定的各个特征点对应的方位角,在所述第二画面中确定各个特征点所对应的第二目标点;将所述第二画面中基于所述多个第二目标点所确定出的区域,作为所述目标区域对应的区域。The controller is configured to determine an azimuth angle corresponding to each feature point based on the second coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen; based on the first coordinate conversion relationship and all positions Determine the azimuth corresponding to each feature point, determine a second target point corresponding to each feature point in the second picture; and determine an area determined in the second picture based on the plurality of second target points As the area corresponding to the target area.
  19. 根据权利要求14所述的系统,其特征在于,所述至少一个相机中包 括:一个球机,且所述第一画面所属相机和所述第二画面所属相机为所述球机,且所述第一画面为所述球机的方位角为初始方位角时采集的画面;The system according to claim 14, wherein the at least one camera comprises: a dome camera, and the camera to which the first picture belongs and the camera to which the second picture belongs is the dome camera, and the The first picture is a picture collected when the azimuth of the dome camera is the initial azimuth;
    所述控制器用于:确定所述球机对应的坐标转换关系,将所述球机对应的坐标转换关系作为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;The controller is configured to determine the coordinate transformation relationship corresponding to the dome camera, and use the coordinate transformation relationship corresponding to the dome camera as the target coordinate transformation relationship of the camera to which the first picture belongs and the camera to which the second picture to be mapped belongs. ;
    所述控制器还用于:基于所述目标坐标转换关系和所述多个特征点在所述第一画面内的坐标,确定各个特征点对应的方位角;在所确定的方位角中选取旋转所述球机所依据的第二方位角,并按照所述第二方位角旋转所述球机,得到所述第二画面;基于所述目标坐标转换关系,在所述第二画面中确定各个特征点所对应的第三目标点;将所述第二画面中基于所述多个第三目标点所确定出的区域,作为所述目标区域对应的区域;The controller is further configured to determine an azimuth angle corresponding to each feature point based on the target coordinate conversion relationship and the coordinates of the plurality of feature points in the first screen; and select rotation from the determined azimuth angle. A second azimuth angle on which the dome camera is based, and rotating the dome camera according to the second azimuth angle to obtain the second picture; and based on the target coordinate conversion relationship, determine each in the second picture A third target point corresponding to the feature point; and an area determined in the second picture based on the plurality of third target points as an area corresponding to the target area;
    其中,所述球机对应的坐标转换关系为:所述球机的方位角与所述球机采集到的画面中心点的坐标的转换关系;任一特征点所对应的第三目标点为:所对应方位角与该特征点对应的方位角相同的像素点。The coordinate conversion relationship corresponding to the dome camera is: the conversion relationship between the azimuth angle of the dome camera and the coordinates of the center point of the screen collected by the dome camera; the third target point corresponding to any feature point is: Pixel points corresponding to the same azimuth angle as the feature point.
  20. 根据权利要求14所述的系统,其特征在于,所述至少一个相机包括:不同的枪机,且所述第一画面所属相机和所述第二画面所属相机为不同的枪机;The system according to claim 14, wherein the at least one camera comprises: different guns, and the camera to which the first picture belongs and the camera to which the second picture belongs are different guns;
    所述控制器用于:确定所述不同的枪机之间的坐标转换关系;将所确定的不同的枪机之间的坐标转换关系,作为所述第一画面所属相机和待区域映射的第二画面所属相机的目标坐标转换关系;The controller is configured to determine a coordinate conversion relationship between the different guns; and use the determined coordinate conversion relationship between the different guns as a second mapping between the camera to which the first screen belongs and the area to be mapped. The target coordinate conversion relationship of the camera to which the picture belongs;
    所述控制器还用于:基于所述目标坐标转换关系及所述多个特征点在所述第一画面内的坐标,在所述第二画面中确定各个特征点对应的第四目标点;将所述第二画面中基于所述多个第四目标点所确定出的区域,作为所述目标区域对应的区域。The controller is further configured to determine a fourth target point corresponding to each feature point in the second picture based on the target coordinate conversion relationship and coordinates of the plurality of feature points in the first picture; And use an area determined in the second picture based on the plurality of fourth target points as an area corresponding to the target area.
PCT/CN2019/104535 2018-09-06 2019-09-05 Inter-frame area mapping method and apparatus, and multi-camera observing system WO2020048509A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811038935.3A CN110881117A (en) 2018-09-06 2018-09-06 Inter-picture area mapping method and device and multi-camera observation system
CN201811038935.3 2018-09-06

Publications (1)

Publication Number Publication Date
WO2020048509A1 true WO2020048509A1 (en) 2020-03-12

Family

ID=69721599

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104535 WO2020048509A1 (en) 2018-09-06 2019-09-05 Inter-frame area mapping method and apparatus, and multi-camera observing system

Country Status (2)

Country Link
CN (1) CN110881117A (en)
WO (1) WO2020048509A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110279652A1 (en) * 2010-05-14 2011-11-17 Honda Research Institute Europe Gmbh Two-stage correlation method for correspondence search
CN104463899A (en) * 2014-12-31 2015-03-25 北京格灵深瞳信息技术有限公司 Target object detecting and monitoring method and device
CN105160663A (en) * 2015-08-24 2015-12-16 深圳奥比中光科技有限公司 Method and system for acquiring depth image
CN106023080A (en) * 2016-05-19 2016-10-12 沈祥明 Seamless splicing processing system for vehicle-mounted panoramic image
CN106683071A (en) * 2015-11-06 2017-05-17 杭州海康威视数字技术股份有限公司 Image splicing method and image splicing device
CN106875444A (en) * 2017-01-19 2017-06-20 浙江大华技术股份有限公司 A kind of object localization method and device
CN107330917A (en) * 2017-06-23 2017-11-07 歌尔股份有限公司 The track up method and tracking equipment of mobile target

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10210427B2 (en) * 2014-07-09 2019-02-19 Slyce Acquisition Inc. Systems, methods, and devices for image matching and object recognition in images
CN108111818B (en) * 2017-12-25 2019-05-03 北京航空航天大学 Moving target actively perceive method and apparatus based on multiple-camera collaboration

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110279652A1 (en) * 2010-05-14 2011-11-17 Honda Research Institute Europe Gmbh Two-stage correlation method for correspondence search
CN104463899A (en) * 2014-12-31 2015-03-25 北京格灵深瞳信息技术有限公司 Target object detecting and monitoring method and device
CN105160663A (en) * 2015-08-24 2015-12-16 深圳奥比中光科技有限公司 Method and system for acquiring depth image
CN106683071A (en) * 2015-11-06 2017-05-17 杭州海康威视数字技术股份有限公司 Image splicing method and image splicing device
CN106023080A (en) * 2016-05-19 2016-10-12 沈祥明 Seamless splicing processing system for vehicle-mounted panoramic image
CN106875444A (en) * 2017-01-19 2017-06-20 浙江大华技术股份有限公司 A kind of object localization method and device
CN107330917A (en) * 2017-06-23 2017-11-07 歌尔股份有限公司 The track up method and tracking equipment of mobile target

Also Published As

Publication number Publication date
CN110881117A (en) 2020-03-13

Similar Documents

Publication Publication Date Title
CN111750820B (en) Image positioning method and system
KR101521008B1 (en) Correction method of distortion image obtained by using fisheye lens and image display system implementing thereof
EP3451649B1 (en) Method and apparatus for generating indoor panoramic video
TWI530180B (en) Linking-up photographing system and control method for cameras thereof
CN112399033B (en) Camera assembly and monitoring camera
US11380016B2 (en) Fisheye camera calibration system, method and electronic device
CN110136207B (en) Fisheye camera calibration system, fisheye camera calibration method, fisheye camera calibration device, electronic equipment and storage medium
CN104994367A (en) Image correcting method and camera
EP4220547A1 (en) Method and apparatus for determining heat data of global region, and storage medium
WO2019232793A1 (en) Two-camera calibration method, electronic device and computer-readable storage medium
CN110807803A (en) Camera positioning method, device, equipment and storage medium
CN114640833A (en) Projection picture adjusting method and device, electronic equipment and storage medium
CN115375779A (en) Method and system for marking AR (augmented reality) real scene of camera
CN113114975B (en) Image splicing method and device, electronic equipment and storage medium
US20190121217A1 (en) Information processing device, information processing method, and program
CN113259642B (en) Film visual angle adjusting method and system
WO2020048509A1 (en) Inter-frame area mapping method and apparatus, and multi-camera observing system
CN115174878B (en) Projection picture correction method, apparatus and storage medium
JP2001005956A (en) Wide field camera device
WO2022206728A1 (en) Real-time framing method, panoramic camera, and computer readable storage medium
CN111353945A (en) Fisheye image correction method, fisheye image correction device and storage medium
WO2021208630A1 (en) Calibration method, calibration apparatus and electronic device using same
JP2005275789A (en) Three-dimensional structure extraction method
CN113674356A (en) Camera screening method and related device
CN115278184B (en) Projection picture correction method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19857490

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19857490

Country of ref document: EP

Kind code of ref document: A1