WO2023087894A1 - 区域调整方法和装置、摄像头和存储介质 - Google Patents

区域调整方法和装置、摄像头和存储介质 Download PDF

Info

Publication number
WO2023087894A1
WO2023087894A1 PCT/CN2022/120062 CN2022120062W WO2023087894A1 WO 2023087894 A1 WO2023087894 A1 WO 2023087894A1 CN 2022120062 W CN2022120062 W CN 2022120062W WO 2023087894 A1 WO2023087894 A1 WO 2023087894A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
world coordinate
preset area
coordinate data
coordinate system
Prior art date
Application number
PCT/CN2022/120062
Other languages
English (en)
French (fr)
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 WO2023087894A1 publication Critical patent/WO2023087894A1/zh

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/633Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
    • H04N23/635Region indicators; Field of view indicators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet

Definitions

  • the present disclosure relates to the technical field of data processing, and in particular to an area adjustment method and device, a camera and a storage medium.
  • the camera in the security system can monitor the security area around the clock by collecting and recording video.
  • the existing security system also allows users to plan area A in the video screen as a restricted area through the web page, and focus on monitoring the restricted area.
  • the disclosure provides an area adjustment method and device, a camera and a storage medium to solve the deficiencies of related technologies.
  • a region adjustment method comprising:
  • the preset area is a preset area in the preview image before the camera rotates.
  • obtaining the conversion relationship between the pixel coordinate system and the world coordinate system corresponding to the camera according to the variation of the rotation angle includes:
  • the method also includes:
  • the world coordinate data of the preset area is acquired, so as to acquire the pixel coordinate data according to the world coordinate data.
  • obtain the world coordinate data of the preset area including:
  • the world coordinate data of the preset area is acquired based on the at least one specified point.
  • acquiring world coordinate data of the preset area based on the at least one designated point includes:
  • a world coordinate system is established with the projection of the camera on the horizontal plane as the origin, and the world coordinate data corresponding to each pixel in the preset area is obtained to obtain the world coordinate data of the preset area.
  • acquiring world coordinate data of the preset area based on the at least one designated point includes:
  • the world coordinate data of the preset area is calculated according to the pixel coordinate data of the preset area and the conversion relationship.
  • obtain the world coordinate data of the preset area including:
  • the specified parameters include at least one of the following: pitch angle, focal length, size and height of the photosensitive device;
  • the world coordinate data of the preset area is calculated according to the current data, the pixel coordinate data and the conversion relationship.
  • obtain the world coordinate data of the preset area including:
  • the method also includes:
  • an area update device comprising:
  • the rotation angle variation acquisition module is used to obtain the rotation angle variation of the camera after detecting that the camera rotates;
  • Transformation relationship acquisition module used to obtain the transformation relationship between the pixel coordinate system and the world coordinate system corresponding to the camera according to the amount of variation of the rotation angle;
  • the pixel coordinate determination module is used to determine the pixel coordinate data of the preset area in the current image according to the world coordinate data of the preset area and the conversion relationship; the preset area is in the preview image before the camera rotates pre-defined area.
  • a camera including:
  • memory for storing a computer program executable by said processor
  • the processor is configured to execute the computer program in the memory, so as to realize the above-mentioned method.
  • a security system including at least one camera and a server; the camera is used to collect images and send them to the server; the server includes:
  • memory for storing a computer program executable by said processor
  • the processor is configured to execute the computer program in the memory, so as to realize the above-mentioned method
  • a computer-readable storage medium is provided, and when an executable computer program in the storage medium is executed by a processor, the above method can be implemented.
  • the rotation angle variation of the camera can be obtained after the rotation of the camera is detected; then, the pixel coordinate system corresponding to the camera can be obtained according to the rotation angle variation.
  • the conversion relationship of the world coordinate system afterward, determine the pixel coordinate data of the preset area in the current image according to the world coordinate data of the preset area and the conversion relationship; the preset area is previewed before the camera rotates A predetermined area in the image.
  • the preset area in the preview image in this embodiment will not change with the rotation of the camera, so that in the subsequent process of identifying objects in the preset area, the problems of false recognition and false alarm will not occur, which is conducive to improving Recognition efficiency further improves user experience.
  • Fig. 1 is a flow chart showing a method for area adjustment according to an exemplary embodiment.
  • Fig. 2 is a schematic diagram showing the effect of rotating around the xyz axis according to an exemplary embodiment; wherein (a) is a schematic diagram of the effect of rotating around the x-axis, (b) is a schematic diagram of the effect of rotating around the y-axis, and (c) is It is a schematic diagram of the effect of rotating around the z axis.
  • Fig. 3 is a schematic diagram showing the effect of an imaging relationship in a camera coordinate system according to an exemplary embodiment.
  • Fig. 4 is a schematic diagram showing a conversion relationship between a pixel coordinate system and an image coordinate system according to an exemplary embodiment.
  • Fig. 5 is a schematic diagram showing an effect of setting a preset area according to an exemplary embodiment.
  • Fig. 6 is a schematic diagram showing the effect of a preset area after the camera is rotated according to an exemplary embodiment.
  • Fig. 7 is a flow chart of acquiring world coordinate data according to an exemplary embodiment.
  • Fig. 8 is another flow chart for acquiring world coordinate data according to an exemplary embodiment.
  • Fig. 9 is a schematic diagram showing another geometric relationship for acquiring world coordinate data according to an exemplary embodiment.
  • Fig. 10 is a schematic diagram showing another geometric relationship for acquiring world coordinate data according to an exemplary embodiment.
  • Fig. 11 is a schematic diagram showing another geometric relationship for acquiring world coordinate data according to an exemplary embodiment.
  • Fig. 12 is a schematic diagram showing another geometric relationship for acquiring world coordinate data according to an exemplary embodiment.
  • Fig. 13 is a block diagram of an area adjustment device according to an exemplary embodiment.
  • Fig. 14 is a block diagram of a server according to an exemplary embodiment.
  • the embodiment of the present disclosure provides an area adjustment method, which can be applied to a security system.
  • the security system includes at least one camera and at least one configuration terminal.
  • the security system includes at least one camera, a server and at least one configuration terminal.
  • the configuration terminal can be used as a web page configuration terminal to configure any camera accordingly, for example, to set the preset area involved in the subsequent embodiments.
  • the server can be used to obtain images (that is, pictures or videos) collected by the camera and distribute them to each configuration terminal for display. Of course, it can also distribute the collected images to each configuration terminal for display when the camera is configured with processing resources.
  • both the camera and the server in the present disclosure implement an area adjustment method, which can be set according to specific scenarios.
  • the solutions of each embodiment are described by taking the camera only collecting images and uploading the images to the server and the server executing a region adjustment method as an example.
  • Fig. 1 is a flow chart showing a method for area adjustment according to an exemplary embodiment.
  • an area adjustment method includes steps 11 to 13 .
  • step 11 after the rotation of the camera is detected, the change amount of the rotation angle of the camera is acquired.
  • the server can communicate with any camera in the security system.
  • the communication methods include wired or wireless methods. Examples of wireless methods include, but are not limited to, Bluetooth, WiFi, and Zigbee.
  • the server may obtain images collected by the camera and/or obtain specified parameters of the camera via the above-mentioned communication means.
  • the specified parameters may include at least one of the following: pitch angle, focal length, size and height of the photosensitive device, etc., which may be configured according to specific scenarios, and are not limited here.
  • the configuration terminal can send an angle adjustment request to the server.
  • the above-mentioned adjustment request may include an angle adjustment relative amount, and the angle adjustment relative amount refers to an offset from the current angle of the camera to the target angle; the above-mentioned adjustment request may also include at least one angle adjustment request, and each angle adjustment request may make the server Adjust the angle according to the set step.
  • the server may respond to the angle adjustment request and send a control instruction to the camera to adjust the camera to a target angle.
  • the server can determine that the angle adjustment to the camera has been completed this time, that is, it is determined that the camera has rotated.
  • the server in response to detecting that the camera has rotated, may acquire angle data from the configuration data to obtain the change in rotation angle before and after adjustment.
  • the server may count the number of received angle adjustment requests, and calculate the product of the number and the set step size (that is, the angle change amount corresponding to each angle adjustment request) to obtain the rotation angle change amount.
  • the server may send a control command to the camera, otherwise no more control command will be sent.
  • an angle parameter acquisition request may be sent to the camera.
  • the camera After the camera receives the request for acquiring the angle head parameters, it may return the amount of change in the rotation angle corresponding to the angle adjustment.
  • the camera can also return other angle data, such as the angle before adjustment, the angle after adjustment, etc., which can be set according to specific scenarios, and the corresponding solutions fall within the protection scope of the present disclosure.
  • step 12 the conversion relationship between the pixel coordinate system and the world coordinate system corresponding to the camera is obtained according to the change amount of the rotation angle.
  • the conversion relationship between the pixel coordinate system corresponding to the camera and the world coordinate system may be stored in the server in advance.
  • the pixel coordinate system refers to the coordinate system formed by taking the vertex of the image as the coordinate origin, the direction of the image width as the X axis, and the direction of the image height as the Y axis; and each coordinate data in the image coordinate system is a pixel located at Coordinates on the entire image, in pixels.
  • the world coordinate system refers to the absolute coordinate system of the objective three-dimensional world, which is used to describe the position of the camera and the object to be photographed; in one example, the projection of the horizontal plane where the camera is located is used as the coordinate origin, the horizontal plane is used as the XOY plane and the direction perpendicular to the horizontal plane is used as Z The axis direction establishes the world coordinate system.
  • the conversion relationship between the pixel coordinate system and the world coordinate system can be obtained based on the following methods:
  • the camera coordinate system refers to the coordinate system established with the optical center as the coordinate origin, the Xc axis and the Yc axis parallel to the image X axis and Y axis respectively, and the Zc axis parallel to the optical axis.
  • the conversion between the camera coordinate system and the world coordinate system can be realized through rigid body transformation. In three-dimensional space, when the object does not deform, the motion of rotating and/or translating the object is called rigid body transformation. Since both the world coordinate system and the camera coordinate system belong to the right-handed coordinate system, they will not be deformed during the rigid body transformation process.
  • the conversion formula is shown in formula (1):
  • Xc represents the camera coordinate system
  • W represents the world coordinate system
  • R represents the rotation matrix between the two coordinate systems
  • T represents the translation matrix between the two coordinate systems.
  • the rotation matrix R is a 3*3 matrix, also known as the Euler rotation matrix, which means that the world coordinate system can rotate in the three directions of Xc, Yc and Zc of the camera coordinate system.
  • the Euler rotation matrix can be split into rotations around the three coordinate axes of Xc, Yc, and Zc.
  • the conversion formulas are shown in formula (2), formula (3) and formula (4):
  • R is the product of the parameter matrices (i.e. various intermediate matrices) in formula (2), formula (3) and formula (4), which is controlled by ⁇ ( ⁇ 1, ⁇ 2 and ⁇ 3) in three directions, so has three degrees of freedom.
  • the image coordinate system refers to the coordinate system established by taking the intersection of the principal optical axis and the image plane as the coordinate origin, and parallel to the width and height directions of the image as the X axis and the Y axis respectively; and, each coordinate data in the image coordinate system is the image in The coordinates on the camera sensor.
  • the imaging relationship in the camera coordinate system is established based on the pinhole model, and the effect is shown in Figure 3.
  • fy is the focal length of the camera on the Y axis
  • ie OP is the focal length of the camera on the X axis.
  • the pixel coordinate system refers to the coordinate system formed by taking the vertex of the image as the coordinate origin, the direction of the image width as the X axis, and the direction of the image height as the Y axis; and each coordinate data in the pixel coordinate system is a certain The coordinates of pixels located on the entire image, in pixels.
  • the pixel coordinate system and the image coordinate system are shown in Figure 4. Referring to Fig. 4, the conversion relationship between the pixel coordinate system and the image coordinate system can be shown in formula (6):
  • u and v are the coordinates in the image coordinate system
  • dx and dy represent the actual size of the pixel on the photosensitive device, which connect the pixel coordinate system and the real physical coordinate system
  • u0 and v0 are the center coordinates of the image pixel plane
  • x and y are the coordinates in the pixel coordinate system.
  • the pixel coordinate system is obtained by default after the image coordinate data is obtained. data.
  • step 4 the situation of camera rotation is introduced.
  • the conversion relationship between the pixel coordinate system and the world coordinate system can be obtained, as shown in formula (8):
  • X'Y'Z' respectively represent the translation distance of the camera, and it is a positive value when moving along the negative direction of the corresponding coordinate axis.
  • the server can obtain the conversion relationship between the pixel coordinate system and the world coordinate system, namely formula (7) and formula (8). It can be understood that a skilled person may select formula (7) or formula (8) according to a specific scenario, and corresponding solutions fall within the protection scope of the present disclosure. Subsequent embodiments use formula (7) as an example to describe the solutions of each embodiment, but this does not constitute a limitation to the present disclosure.
  • the above variation of the rotation angle can be substituted into the above formula (7), so as to obtain the updated conversion relationship between the pixel coordinate system and the world coordinate system. It is understandable that when updating the transformation relationship between the pixel coordinate system and the world coordinate system, the change of the focal length of the camera is not considered; if the focal length changes, it can be substituted into the above (7) by combining the amount of rotation angle change and the synchronization of the focal length, and the updated The conversion relationship between the pixel coordinate system and the world coordinate system. Both of the above two schemes for updating the conversion relationship fall within the protection scope of the present disclosure.
  • step 13 determine the pixel coordinate data of the preset area in the current image according to the world coordinate data of the preset area and the conversion relationship; the preset area is preset in the preview image before the camera rotates defined area.
  • the world coordinate data of the preset area can be stored in the server.
  • the aforementioned preset area is the area preset in the preview image before the camera rotates, that is, the area that the user pays special attention to in the preview image, for example, the restricted area A1A2A3A4 shown in FIG. 5 .
  • FIG. 5 illustrates a scene of a preset area.
  • the number of preset areas can be set according to a specific scene, for example, 5, which is not limited here.
  • the server can obtain the preset area in the pixel coordinate system after the above-mentioned preset area is set.
  • the pixel coordinate data below.
  • the display effect of the preset area on the preview image is always as shown in FIG. 5 .
  • the pixel coordinate data is used to set the preset area, when the camera rotates, the content corresponding to the pixel coordinate data changes, and the position of the corresponding preset area also changes synchronously, as shown in Figure 6. Comparing the preset areas in FIG. 5 and FIG.
  • the preset area shifts from the green belt shown in FIG. 5 to the edge of the road shown in FIG. 6 , while the preset area A1A2A3A4 moves to the middle of the road. That is to say, the preset area tracks the rotation of the camera while the position changes.
  • the world coordinate data of the preset area will be The data is converted into world coordinate data, that is, the preset area is transformed into the world coordinate system to make it fixed. Therefore, in this embodiment, the world coordinate data of the preset area can be acquired in the following manner.
  • the server may obtain at least one designated point in the preview image, and obtain the world coordinate data of the preset area based on the at least one designated point.
  • the specified point can include the origin of the world coordinate system or the first specified point in the preview image.
  • the server may establish a world coordinate system with the projection of the camera on the horizontal plane as the origin, in which the plane of the X-axis and the Y-axis is parallel to the horizontal plane, and the Z-axis is perpendicular to the horizontal plane.
  • the server can display each pixel in the preset area on the preview image in turn, and instruct the surveyor to measure the world coordinate data of the preset area on the spot, and the surveyor will configure the terminal to transfer the pixel points of each pixel.
  • the world coordinate data is uploaded to the server, so that the server can obtain the world coordinate data corresponding to each pixel in the preset area, that is, the server can obtain the world coordinate data of the preset area.
  • the server may acquire world coordinate data corresponding to a first number (for example, 10, adjustable) of specified points in the preview image.
  • the server may determine the conversion relationship between the world coordinate system and the pixel coordinate system corresponding to the camera according to the pixel coordinate data and world coordinate data of the first number of specified points.
  • the transformation relationship in step 72 is the inverse transformation of the transformation relationship between the pixel coordinate system and the world coordinate system, which can be calculated according to the inverse matrix in the mathematical method, and will not be repeated here.
  • the server may calculate the world coordinate data of the preset area according to the pixel coordinate data of the preset area and the above conversion relationship. In this way, in this example, it is only necessary to measure the world coordinate data of a limited number of specified points to determine the world coordinate data of all points in the preset area, which can reduce the measurement workload and improve the efficiency of obtaining world coordinate data.
  • the server can obtain the current data of the specified parameters of the camera and the pixel coordinate data of the preset area; the specified parameters include at least one of the following: pitch angle, focal length, photosensitive device The size and (in world coordinates) height of .
  • step 82 based on the preset conversion relationship between the pixel coordinate system and the world coordinate system, the server can calculate the world coordinate data of the preset area according to the current data, the pixel coordinate data and the conversion relationship.
  • the server can obtain the pitch angle, focal length, size and height of the photosensitive device of the camera.
  • the X-axis and Y-axis are located on the ground plane, the Z-axis is perpendicular to the ground plane, the Y-axis direction can represent the visual direction, and the X-axis is positively pointing to the paper.
  • the camera is installed at C on the OZ axis, at a height h from the ground level.
  • the optical axis CP of the camera is located on the YOZ plane, and the optical axis is pitched at an angle ⁇ .
  • a point A at a distance f (focal distance) from point C is defined as the center of the image plane AP.
  • the angle between the two dotted lines in the figure is defined as the longitudinal viewing angle of the camera, defined as 2 ⁇ .
  • the server can calculate the world coordinate data of point b in the image according to the camera angle/height and focal length information. If point b is an image point in the preset area, then the world coordinate data corresponding to each pixel in the preset area can be obtained. In this way, in this embodiment, only part of the installation data of the camera needs to be obtained to calculate the world coordinate data, without manual measurement, and the efficiency of obtaining the world coordinate data is improved.
  • the server may use the origin of the world coordinate system as a reference point to obtain 3D point cloud data of the area where the camera is located.
  • the 3D point cloud data can be obtained by laser radar, depth camera and other equipment.
  • the server may acquire world coordinate data corresponding to each pixel in the preset area based on the above-mentioned 3D point cloud data. It is understandable that since the point cloud data is collected with the origin of the world coordinate system, that is, the projection point of the camera, the distance in the point cloud data is the world coordinate data. Assuming that the coordinate origin of the world coordinate system changes, then the world coordinate data of the preset area can be calculated by referring to the examples shown in FIG. 9 to FIG. 11 .
  • this embodiment only shows the above-mentioned several schemes for obtaining the world coordinate data of the preset area.
  • the above-mentioned schemes can be used alone or in combination if there is no conflict.
  • the combined scheme Also fall within the protection scope of the present disclosure.
  • the server can determine that the preset area is currently Pixel coordinate data in the image.
  • the server may send it to the web page configuration terminal, so that the web page configuration end updates the pixel coordinate data of the preset area.
  • the above-mentioned web page configuration terminal may be a security application program installed in the server, or a security application program installed in the configuration terminal, or a configuration terminal, and may be set according to specific scenarios.
  • the display device or configuration terminal of the security system can display the above-mentioned preset area in the current image, and according to the adjustment of the current preview image, the "border" of the preset area can follow the presentation, and the display effect can be Area A1'A2'A3'A4' as shown in FIG. 6 .
  • the preset area may move out of the current image in whole or in part. Take the partial removal as an example. At this time, the part that has not been removed can be displayed in the current image, and the effect is as shown in A1'A2'B1B2 in Figure 6.
  • B1 and B2 are the points where the preset area intersects with the edge of the current image
  • the area B1B2A4'A3' is the moving part of the current image.
  • the area B1B2A4'A3' that is moved out of the display area can also be displayed in the form of a dotted line, or when the preset area is completely moved out of the display area A1A2A3A4 of the area, so as to facilitate the user to determine the location of the preset area.
  • the camera can automatically rotate, and directly rotate to the current image to display the effect of the preset area.
  • the pixel coordinate data of the preset area can be automatically updated to achieve the effect of updating the pixel coordinate data of the preset area following the rotation of the camera, thereby eliminating the need to manually correct the preset area, which is conducive to improving the accuracy of the recognition result.
  • the rotation angle variation of the camera can be obtained after the rotation of the camera is detected; then, the pixel coordinate system and the world coordinate system corresponding to the camera can be obtained according to the rotation angle variation. conversion relationship; afterward, determine the pixel coordinate data of the preset area in the current image according to the world coordinate data of the preset area and the conversion relationship; the preset area is preset in the preview image before the camera rotates defined area.
  • the preset area in the preview image in this embodiment will not change with the rotation of the camera, so that in the subsequent process of identifying objects in the preset area, the problems of false recognition and false alarm will not occur, which is conducive to improving Recognition efficiency further improves user experience.
  • an embodiment of the present disclosure also provides an area update device, see FIG. 13 , the device includes:
  • the rotation angle acquisition module 131 is used to obtain the variation of the rotation angle of the camera when the rotation of the camera is detected;
  • a conversion relationship acquisition module 132 configured to acquire the conversion relationship between the pixel coordinate system and the world coordinate system corresponding to the camera according to the amount of change in the rotation angle;
  • the pixel coordinate determination module 133 is used to determine the pixel coordinate data of the preset area in the current image according to the world coordinate data of the preset area and the conversion relationship; the preset area is the preview image before the camera rotates in the pre-set area.
  • the conversion relationship acquisition module includes:
  • a camera coordinate system acquisition unit configured to acquire a camera coordinate system corresponding to the camera according to the amount of change in the rotation angle
  • a conversion relationship acquiring unit configured to acquire the conversion relationship between the world coordinate system and the pixel coordinate system corresponding to the camera according to the camera coordinate system.
  • the device further includes a world coordinate acquisition module, and the world coordinate acquisition module includes:
  • the world coordinate acquisition unit is configured to establish a world coordinate system with the projection of the camera on the horizontal plane as the origin, acquire world coordinate data corresponding to each pixel in the preset area, and obtain world coordinate data of the preset area.
  • the device further includes a world coordinate acquisition module, and the world coordinate acquisition module includes:
  • a coordinate data acquisition unit configured to acquire world coordinate data corresponding to the first specified point in the preview image
  • a conversion relationship acquisition unit configured to determine the conversion relationship between the pixel coordinate system corresponding to the camera and the world coordinate system according to the pixel coordinate data and world coordinate data of the first number of specified points;
  • a world coordinate acquiring unit configured to calculate the world coordinate data of the preset area according to the pixel coordinate data of the preset area and the conversion relationship.
  • the device further includes a world coordinate acquisition module, and the world coordinate acquisition module includes:
  • a pixel coordinate acquisition unit configured to acquire current data of specified parameters of the camera and pixel coordinate data of the preset area;
  • the specified parameters include at least one of the following: pitch angle, focal length, size and height of the photosensitive device;
  • a world coordinate acquiring unit configured to calculate the world coordinates of the preset area based on the current data, the pixel coordinate data and the conversion relationship based on the conversion relationship between the preset pixel coordinate system and the world coordinate system data.
  • the device further includes a world coordinate acquisition module, and the world coordinate acquisition module includes:
  • the point cloud data acquisition unit is used to obtain the three-dimensional point cloud data of the area where the camera is located with the origin of the world coordinate system as a reference point;
  • a world coordinate acquisition unit configured to acquire world coordinate data corresponding to each pixel in the preset area based on the three-dimensional point cloud data.
  • the device also includes:
  • the pixel coordinate configuration module is used to send the pixel coordinate data of the preset area in the current image to the web page configuration terminal, so that the web page configuration terminal can update the pixel coordinate data of the preset area.
  • a camera comprising:
  • memory for storing a computer program executable by said processor
  • the processor is configured to execute the computer program in the memory, so as to realize the methods as described in FIGS. 1 to 12 .
  • a security system including at least one camera and a server.
  • the camera is used to collect images and send them to the server; referring to Figure 12, the server includes:
  • memory 122 for storing computer programs executable by said processor
  • the processor is configured to execute the computer program in the memory, so as to realize the methods as described in FIGS. 1 to 12 .
  • a computer-readable storage medium such as a memory including an executable computer program.
  • the above-mentioned executable computer program can be executed by a processor to implement the method of the embodiment shown in FIG. 1 .
  • the readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

本公开是关于一种区域调整方法和装置、摄像头和存储介质。该方法包括:当检测到摄像头转动后,获取所述摄像头的转动角度变化量;根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。本实施例中预览图像中的预设区域不会随着摄像头的转动而改变,从而在后续识别预设区域内对象的过程中并不会发生误识别且误报警的问题,有利于提升识别效率,进一步提升使用体验。

Description

区域调整方法和装置、摄像头和存储介质 技术领域
本公开涉及数据处理技术领域,尤其涉及一种区域调整方法和装置、摄像头和存储介质。
背景技术
随着安防技术的迅速发展,在很多重点区域会布置安防系统。安防系统中的摄像头可以通过采集、录制视频的方式对安防区域进行全天候监控。并且,现有的安防系统还允许用户通过网页端在视频画面中规划出区域A作为禁区,并对禁区进行重点监控。
发明内容
本公开提供一种区域调整方法和装置、摄像头和存储介质,以解决相关技术的不足。
根据本公开实施例的第一方面,提供一种区域调整方法,所述方法包括:
当检测到摄像头转动后,获取所述摄像头的转动角度变化量;
根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;
根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。
可选地,根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系,包括:
根据所述转动角度变化量获取所述摄像头对应的相机坐标系;
根据所述相机坐标系统获取世界坐标系与所述摄像头对应的像素坐标系的转换关系。
可选地,所述方法还包括:
获取预设区域的世界坐标数据,以根据所述世界坐标数据获取所述像素坐标数据。
可选地,获取预设区域的世界坐标数据,包括:
获取预览图像中的至少一个指定点;
基于所述至少一个指定点获取预设区域的世界坐标数据。
可选地,当所述指定点为世界坐标系的原点时,基于所述至少一个指定点获取预设区域的世界坐标数据,包括:
以所述摄像头在水平面的投影为原点建立世界坐标系,获取所述预设区域内各像素点对应的世界坐标数据,得到预设区域的世界坐标数据。
可选地,当所述指定点为世界坐标系的原点时,基于所述至少一个指定点获取预设区域的世界坐标数据,包括:
获取预览图像中第一数量个指定点对应的世界坐标数据;
根据所述第一数量个指定点的像素坐标数据和世界坐标数据确定所述摄像头对应的像素坐标系和所述世界坐标系的转换关系;
根据所述预设区域的像素坐标数据和所述转换关系计算所述预设区域的世界坐标数据。
可选地,获取预设区域的世界坐标数据,包括:
获取所述摄像头的指定参数的当前数据以及所述预设区域的像素坐标数据;所述指定参数包括以下至少一种:俯仰角、焦距、感光器件的尺寸和高度;
基于预设的像素坐标系和世界坐标系之间的转换关系,根据所述当前数据、所述像素坐标数据和所述转换关系计算出所述预设区域的世界坐标数据。
可选地,获取预设区域的世界坐标数据,包括:
以世界坐标系的原点为参考点,获取所述摄像头所在区域的三维点云数据;
基于所述三维点云数据获取所述预设区域内各像素点对应的世界坐标数据。
可选地,所述方法还包括:
将所述预设区域在当前图像中的像素坐标数据发送到网页配置端,以使所述网页配置端更新所述预设区域的像素坐标数据。
根据本公开实施例的第二方面,提供一种区域更新装置,所述装置包括:
转动角度变化量获取模块,用于当检测到摄像头转动后,获取所述摄像头的转动角度变化量;
转换关系获取模块,用于根据所述转动角度变化量获取所述摄像头对应的像素坐标 系和世界坐标系的转换关系;
像素坐标确定模块,用于根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。
根据本公开实施例的第三方面,提供一种摄像头,包括:
处理器;
用于存储所述处理器可执行的计算机程序的存储器;
其中,所述处理器被配置为执行所述存储器中的计算机程序,以实现如上述的方法。
根据本公开实施例的第四方面,提供一种安防系统,包括至少一个摄像头和服务器;所述摄像头用于采集图像并发送给服务器;所述服务器包括:
处理器;
用于存储所述处理器可执行的计算机程序的存储器;
其中,所述处理器被配置为执行所述存储器中的计算机程序,以实现如上述的方法
根据本公开实施例的第五方面,提供一种计算机可读存储介质,当所述存储介质中的可执行的计算机程序由处理器执行时,能够实现如上述的方法。
本公开的实施例提供的技术方案可以包括以下有益效果:
由上述实施例可知,本公开实施例提供的方案中可以在检测到摄像头转动后获取所述摄像头的转动角度变化量;然后,根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;之后,根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。这样,本实施例中预览图像中的预设区域不会随着摄像头的转动而改变,从而在后续识别预设区域内对象的过程中并不会发生误识别且误报警的问题,有利于提升识别效率,进一步提升使用体验。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1是根据一示例性实施例示出的一种区域调整方法的流程图。
图2是根据一示例性实施例示出的围绕xyz轴旋转的效果示意图;其中(a)图是围绕x轴旋转的效果示意图,(b)图是围绕y轴旋转的效果示意图,(c)图是围绕z轴旋转的效果示意图。
图3是根据一示例性实施例示出的一种相机坐标系下成像关系的效果示意图。
图4是根据一示例性实施例示出的一种像素坐标系和图像坐标系的转换关系的示意图。
图5是根据一示例性实施例示出的一种设置预设区域的效果示意图。
图6是根据一示例性实施例示出的摄像头转动后预设区域的效果示意图。
图7是根据一示例性实施例示出的一种获取世界坐标数据的流程图。
图8是根据一示例性实施例示出的另一种获取世界坐标数据的流程图。
图9是根据一示例性实施例示出的又一种获取世界坐标数据的几何关系示意图。
图10是根据一示例性实施例示出的又一种获取世界坐标数据的几何关系示意图。
图11是根据一示例性实施例示出的又一种获取世界坐标数据的几何关系示意图。
图12是根据一示例性实施例示出的又一种获取世界坐标数据的几何关系示意图。
图13是根据一示例性实施例示出的一种区域调整装置的框图。
图14是根据一示例性实施例示出的一种服务器的框图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性所描述的实施例并不代表与本公开相一致的所有实施例。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置例子。需要说明的是,在不冲突的情况 下,下述的实施例及实施方式中的特征可以相互组合。
实际应用中,预览区域内设置禁区等区域时,用户经常会调整摄像头的朝向来监控不同区域的安全情况。当转动摄像头的朝向时,上述禁区会随之同步变化即禁区的覆盖范围从区域A变为区域B。此时,摄像头可以将区域B的目标对象识别出来报警。然而,区域B并不是预期监控的区域A,从而造成误报警,降低使用体验。
为解决上述技术问题,本公开实施例提供了一种区域调整方法,可以应用于安防系统。在一示例中,该安防系统包括至少一个摄像头和至少一个配置终端。在另一示例中,该安防系统包括至少一个摄像头、服务器和至少一个配置终端。其中,配置终端可以作为网页配置端对任一个摄像头进行相应的配置,例如设定后续实施例中所涉及的预设区域。服务器可以用于获取摄像头采集的图像(即图片或者视频)并分发到各个配置终端进行显示,当然在摄像头配置处理资源的情况下其也可将所采集的图像分发到各个配置终端进行显示。也就是说,本公开中摄像头和服务器均执行一种区域调整方法,可以根据具体场景进行设置。后续实施例中以摄像头仅采集图像并将图像上传到服务器以及服务器执行一种区域调整方法为例描述各实施例的方案。
图1是根据一示例性实施例示出的一种区域调整方法的流程图。参见图1,一种区域调整方法,包括步骤11~步骤13。
在步骤11中,当检测到摄像头转动后,获取所述摄像头的转动角度变化量。
本实施例中,服务器可以与安防系统中的任一个摄像头通信,通信方式包括有线方式或者无线方式,以无线方式为例包括但不限于蓝牙方式、WiFi方式、Zigbee方式等。服务器可以经由上述通信方式获取摄像头所采集的图像和/或获取摄像头的指定参数。其中,指定参数可以包括以下至少一种:俯仰角、焦距、感光器件的尺寸和高度等,可以根据具体场景进行配置,在此不作限定。
本实施例中,当用户要调整摄像头角度的需求时,可以通过配置终端进行角度配置(如在网页端填写调整的角度),还可以通过按压按键或者拨动调整角度杆来调整角度。此时配置终端可以向服务器发送角度调整请求。上述调整请求可以包括角度调整相对量,该角度调整相对量是指摄像头从当前角度调整到目标角度的偏移量;上述调整请求也可以包括至少一个角度调整请求,每个角度调整请求可以使服务器按照设定步长调整角度。服务器在接收到角度调整请求时可以响应于上述角度调整请求,向摄像头发送控制指令以将摄像头调整到目标角度。当距离最后一个调整请求设定时长(如2-2秒)后,服务 器可以确定已经完成此次对摄像头的角度调整,即确定摄像头已转动。
本实施例中,响应于检测到摄像头已经转到,服务器可以从配置数据内获取角度数据得到调整前后的转动角度变化量。或者服务器可以统计已接收的角度调整请求的个数,并计算上述个数和设定步长(即每个角度调整请求对应的角度变化量)的乘积,得到转动角度变化量。
在一实施例中,当接收到角度调整请求后,服务器可以向摄像头发送控制指令,否则不再发送控制指令。当检测到发送完最后一个控制指令后(即设定时长内未再接收到角度调整请求),可以向摄像头发送角度参数获取请求。摄像头在接收到上述角度头参数获取请求后,可以返回本次角度调整对应的转动角度变化量。实际应用中,摄像头还可以返回其他角度数据,例如调整前的角度,调整后的角度等等,可以根据具体场景进行设置,相应方案落入本公开的保护范围。
在步骤12中,根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系。
本实施例中,服务器内可以预先存储摄像头对应的像素坐标系和世界坐标系的转换关系。其中,像素坐标系是指以图像的顶点为坐标原点,图像宽度所在方向为X轴,图像高度所在方向为Y轴所形成的坐标系;并且图像坐标系内每个坐标数据是某一像素位于整张图像上的坐标,单位以像素计。世界坐标系是指客观三维世界的绝对坐标系,用于描述摄像头和被拍摄物体的位置;一示例中,以摄像头所在水平面的投影作为坐标原点,水平面作为XOY平面且垂直于水平面的方向作为Z轴方向建立世界坐标系。
本实施例中,像素坐标系和世界坐标系的转换关系可以基于以下方式获取:
1,获取世界坐标系和相机坐标系的转换关系。
相机坐标系是指以光心为坐标原点、Xc轴和Yc轴分别平行于图像X轴和Y轴且Zc轴平行于光轴所建立的坐标系。相机坐标系与世界坐标系的转换可以通过刚体变换实现。在三维空间中,当物体不发生形变时,对一个该物体作旋转和/或平移的运动,称之为刚体变换。由于世界坐标系和相机坐标系均属于右手坐标系,因此在刚体变换过程中其不会发生形变,转换公式见式(1):
X c=RW+T              (1)
其中,Xc表示相机坐标系;W表示世界坐标系;R表示两个坐标系之间的旋转矩阵;T表示两个坐标系之间的平移矩阵。
旋转矩阵R是一个3*3的矩阵,也称为欧拉旋转矩阵,即表示世界坐标系在相机坐标系的Xc、Yc和Zc三个方向上均可以旋转。参见图2,欧拉旋转矩阵可以拆分为绕Xc、Yc和Zc三个坐标轴的旋转,转换公式见式(2)、式(3)和式(4):
Figure PCTCN2022120062-appb-000001
Figure PCTCN2022120062-appb-000002
Figure PCTCN2022120062-appb-000003
因此,R为式(2)、式(3)和式(4)三者中参数矩阵(即各式中间矩阵)之乘积,其由三个方向的θ(θ1、θ2和θ3)控制,故具有三个自由度。
2,获取相机坐标系和图像坐标系的转换关系。
图像坐标系是指以主光轴和图像平面交点为坐标原点,分别平行于图像的宽度和高度方向为X轴和Y轴所建立的坐标系;并且,图像坐标系中各坐标数据为图像在相机感光元件上的坐标。
本步骤中,依据针孔模型建立相机坐标系下的成像关系,效果如图3所示。参见图3,三角形OPN与三角形OAB为相似三角形,根据相似三角形几何关系可知:NP/OP=AB/OA,可以得到图像坐标系和相机坐标系的转换关系,转换公式如式(5):
Figure PCTCN2022120062-appb-000004
式(5)中,fy为相机在Y轴的焦距即OP,fx为相机在X轴的焦距。
3,获取像素坐标系和图像坐标系的转换关系。
本步骤中,像素坐标系是指以图像的顶点为坐标原点,图像宽度所在方向为X轴, 图像高度所在方向为Y轴所形成的坐标系;并且像素坐标系内每个坐标数据是某一像素位于整张图像上的坐标,单位以像素计。其中像素坐标系和图像坐标系如图4所示。参见图4,像素坐标系和图像坐标系的转换关系可以如式(6)所示:
Figure PCTCN2022120062-appb-000005
式(6)中,u和v是图像坐标系下的坐标,dx和dy表示感光器件上像素的实际大小,是连接像素坐标系和真实物理坐标系的,u0和v0是图像像素平面中心坐标,x和y是像素坐标系下的坐标。
4,基于第1步~第3步的转换关系获取像素坐标系和世界坐标系的转换关系,如式(7)所示:
Figure PCTCN2022120062-appb-000006
其中,Z C=c 1*s 2*X W+c 1*c 2*Y W-s 1*Z W
式(7)中,c 1=cosα,s 1=sinα,
Figure PCTCN2022120062-appb-000007
c 2=cosθ 3,s 2=sinθ 3
需要说明的是,考虑图像坐标系和像素坐标系仅在于坐标原点不同,两者转换关系如式(6)所示,因此本公开各实施例中在获取到图像坐标数据后默认获得像素坐标系数据。
5,步骤4中介绍了摄像头转动的情形,当摄像头可以移动时,可以得到像素坐标系和世界坐标系的转换关系,如式(8)所示:
Figure PCTCN2022120062-appb-000008
式(8)中,X’Y’Z’分别表示摄像头的平移距离,且沿相应坐标轴的负方向移动时为正值。
可见,经过上述第1步~第5步,服务器可以获得像素坐标系和世界坐标系的转换关系即式(7)和式(8)。可理解的是,技术人员可以根据具体场景选择式(7)或式(8), 相应方案落入本公开的保护范围。后续实施例以式(7)为例描述各实施例的方案,但不构成对本公开的限定。
本实施例中,服务器在获取到步骤11中的转动角度变化量之后可以将上述转动角度变化量代入上式(7),从而得到更新后的像素坐标系和世界坐标系的转换关系。可理解的是,更新像素坐标系和世界坐标系的转换关系时,未考虑摄像头的焦距的变化;如果焦距发生变化时,可以结合转动角度变化量和焦距同步代入上述(7),得到更新后的像素坐标系和世界坐标系的转换关系。上述两个更新转换关系的方案均落入本公开的保护范围。
在步骤13中,根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。
本实施例中,服务器内可以存储预设区域的世界坐标数据。上述预设区域为摄像头转动前在预览图像中预先设定的区域,即用户在预览图像中特别关注的区域,例如图5所示的禁区A1A2A3A4。需要说明的是,图5中示例出了一个预设区域的场景,实际应用中,预设区域的数量可以根据具体场景进行设置,例如5个,在此不作限定。
可理解的是,考虑到实际应用场景,用户是在配置终端上选择预览图像上的像素点来设置上述预设区域,即服务器在上述预设区域设置完成后可以获得预设区域在像素坐标系下的像素坐标数据。当摄像头角度不变时,预设区域在预览图像上的显示效果始终如图5所示。但是,正因为设置预设区域使用的是像素坐标数据,那么摄像头转动时,像素坐标数据对应的内容发生变化,相应的预设区域的位置也同步发生变化,效果如图6所示。对比图5和图6中的预设区域发现,预设区域从图5中所示例的绿化带偏移到图6中所示例的马路边缘,而预设区域A1A2A3A4则移动到马路中间。也就是说,预设区域跟踪摄像头的转动而位置发生了变化。
为避免预设区域不再跟随摄像头转动而发生变化,结合世界坐标系是绝对坐标系,在不同场景下各物体的世界坐标数据不会发生变化,本公开实施例中将预设区域的像素坐标数据转换为世界坐标数据,即将预设区域转换到世界坐标系统下,以使其固定不变。因此,本实施例中可以通过以下方式获取预设区域的世界坐标数据。
本实施例中,服务器可以根据获取预览图像中的至少一个指定点,并基于至少一个指定点获取预设区域的世界坐标数据。其中指定点可以包括世界坐标系的原点或者 预览图像中的第一数据个指定点。
在一示例中,服务器可以以摄像头在水平面的投影为原点建立世界坐标系,该世界坐标系中X轴和Y轴所在平面与水平面平行,并且Z轴垂直在水平面。当确定了预设区域后,服务器可以依次在预览图像上显示预设区域内的各个像素点,并指示测量人员实地测量预设区域的世界坐标数据,由测量人员通过配置终端将各个像素点的世界坐标数据上传到服务器,这样服务器可以获得预设区域内各像素点对应的世界坐标数据,即服务器可以得到预设区域的世界坐标数据。
在另一示例中,参见图7,在步骤71中,服务器可以获取预览图像中第一数量(例如10个,可调整)指定点对应的世界坐标数据。在步骤72中,服务器可以根据第一数量个指定点的像素坐标数据和世界坐标数据确定摄像头对应的世界坐标系和像素坐标系的转换关系。其中步骤72中的转换关系即是像素坐标系和世界坐标系的转换关系的逆变换,可以根据数学方式中逆矩阵计算得到,在此不作赘述。在步骤73中,服务器可以根据预设区域的像素坐标数据和上述转换关系计算预设区域的世界坐标数据。这样,本示例中仅需要测量有限个指定点的世界坐标数据即可确定出预设区域内所有点的世界坐标数据,可以减少测量工作量,提升获取世界坐标数据的效率。
在又一示例中,参见图8,在步骤81中,服务器可以获取摄像头的指定参数的当前数据以及预设区域的像素坐标数据;上述指定参数包括以下至少一种:俯仰角、焦距、感光器件的尺寸和(在世界坐标系下)高度。
在步骤82中,基于预设的像素坐标系和世界坐标系之间的转换关系,服务器可以根据当前数据、像素坐标数据和转换关系计算出预设区域的世界坐标数据。
参见图9、图10和图11,服务器可以获取摄像头的俯仰角、焦距、感光器件的尺寸和高度。X轴Y轴位于地平面,Z轴垂直于地平面,Y轴方向可以表示视觉方向,X轴正向指向纸面。摄像头安装在位于OZ轴的C处,离地平面高度h。摄像头光轴CP位于YOZ平面,光轴俯仰角θ。沿光轴CP,离C点f(焦距)的点A定义为图像平面AP中心。图中两虚线的夹角定义为相机的纵向视角,定义2α。
XOY平面上任意点Q(x,y),其Y轴对应点为B,该点B对应像点b。并且,依据几何关系:∠CBO=θ-∠BCP,而tan(∠BCP)=t/f,注意:t是图像坐标系下的坐标(有量纲),f是焦距。那么,Q点的世界坐标数据中y坐标可用式(9)计算:
y=h*ctan(∠CBO)=h*ctan(θ-∠BCP)=h*[1+tan(θ)*t/f]/[tan(θ)–t/f];  (9)
参见图10,XOY平面上线段BQ的像的bq,根据几何关系可得式(10)、式(11)和式(12):
Figure PCTCN2022120062-appb-000009
Figure PCTCN2022120062-appb-000010
Figure PCTCN2022120062-appb-000011
这样,服务器可以根据摄像头角度/高度和焦距信息计算出图像中b点的世界坐标数据。如果b点为预设区域的像点,那么可以获得预设区域内各像素对应的世界坐标数据。这样,本实施例中仅需要获取摄像头的部分安装数据即可计算出世界坐标数据,无需人工测量,提升获取世界坐标数据的效率。
在又一示例中,参见图12,在步骤121中,服务器可以以世界坐标系的原点为参考点,获取摄像头所在区域的三维点云数据。其中三维点云数据可以采用激光雷达、深度摄像头等设备获取。在步骤122中,服务器可以基于上述三维点云数据获取预设区域内各像素点对应的世界坐标数据。可理解的是,由于以世界坐标系的原点即摄像头的投影点来采集点云数据,那么点云数据中距离即是世界坐标数据。假设世界坐标系的坐标原点发生变化,那么可以参见图9~图11所示例的内容来计算出预设区域的世界坐标数据。
需要说明的是,本实施例中仅示出了上述几种获取预设区域的世界坐标数据的方案,上述几种方案可以单独使用,在不冲突的情况下也可以组合使用,组合后的方案同样落入本公开的保护范围。
本实施例中,在获得预设区域的世界坐标数据以及像素坐标系和世界坐标系的转换关系后,服务器可以根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据。
在一实施例中,服务器在获取到预设区域在当前图像中的像素坐标数据之后,可以发送给网页配置端,以使网页配置端更新预设区域的像素坐标数据。上述网页配置端可以是安装在服务器内的安防应用程序,也可以是安装在配置终端的安防应用程序,还可以是配置终端,可以根据具体场景进行设置。这样,在后续显示过程中,安防系统的显示设备或者配置终端可以在当前图像中显示上述预设区域,并且根据当前的预览图 像的调整,预设区域的“边框”能够跟随呈现,显示效果可以如图6所示的区域A1’A2’A3’A4’。考虑到在转动摄像头后,预设区域可能全部或者部分移出当前图像。以部分移出为例,此时可以在当前图像中显示未移出的部分,效果如图6中A1’A2’B1B2。其中B1和B2为预设区域与当前图像边缘相交的点,区域B1B2A4’A3’为移动当前图像的部分。实际应用中,当前的预览图像中除了显示上述预设区域A1’A2’B1B2外,还可以采用虚线表示的方式来显示出移出显示区域的区域B1B2A4’A3’,或者当预设区域全部移出显示区域的A1A2A3A4,从而方便用户确定预设区域的位置。进一步地,当用户点击上述预设区域时,摄像头可以自动转动,直接转动到当前图像显示预设区域的效果。
这样,本实施例中可以自动更新预设区域的像素坐标数据,达到跟随摄像头转动而更新预设区域的像素坐标数据的效果,从而无需手动纠正预设区域,有利于提高识别结果的准确率。
至此,本公开实施例提供的方案中可以在检测到摄像头转动后获取所述摄像头的转动角度变化量;然后,根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;之后,根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。这样,本实施例中预览图像中的预设区域不会随着摄像头的转动而改变,从而在后续识别预设区域内对象的过程中并不会发生误识别且误报警的问题,有利于提升识别效率,进一步提升使用体验。
在本公开实施例提供的一种区域更新方法的基础上,本公开实施例还提供了一种区域更新装置,参见图13,所述装置包括:
转动角度获取模块131,用于当检测到摄像头转动后,获取所述摄像头的转动角度变化量;
转换关系获取模块132,用于根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;
像素坐标确定模块133,用于根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。
在一实施例中,所述转换关系获取模块包括:
相机坐标系获取单元,用于根据所述转动角度变化量获取所述摄像头对应的相 机坐标系;
转换关系获取单元,用于根据所述相机坐标系统获取世界坐标系与所述摄像头对应的像素坐标系的转换关系。
在一实施例中,所述装置还包括世界坐标获取模块,所述世界坐标获取模块包括:
世界坐标获取单元,用于以所述摄像头在水平面的投影为原点建立世界坐标系,获取所述预设区域内各像素点对应的世界坐标数据,得到预设区域的世界坐标数据。
在一实施例中,所述装置还包括世界坐标获取模块,所述世界坐标获取模块包括:
坐标数据获取单元,用于获取预览图像中第一数量个指定点对应的世界坐标数据;
转换关系获取单元,用于根据所述第一数量个指定点的像素坐标数据和世界坐标数据确定所述摄像头对应的像素坐标系和所述世界坐标系的转换关系;
世界坐标获取单元,用于根据所述预设区域的像素坐标数据和所述转换关系计算所述预设区域的世界坐标数据。
在一实施例中,所述装置还包括世界坐标获取模块,所述世界坐标获取模块包括:
像素坐标获取单元,用于获取所述摄像头的指定参数的当前数据以及所述预设区域的像素坐标数据;所述指定参数包括以下至少一种:俯仰角、焦距、感光器件的尺寸和高度;
世界坐标获取单元,用于基于预设的像素坐标系和世界坐标系之间的转换关系,根据所述当前数据、所述像素坐标数据和所述转换关系计算出所述预设区域的世界坐标数据。
在一实施例中,所述装置还包括世界坐标获取模块,所述世界坐标获取模块包括:
点云数据获取单元,用于以世界坐标系的原点为参考点,获取所述摄像头所在区域的三维点云数据;
世界坐标获取单元,用于基于所述三维点云数据获取所述预设区域内各像素点 对应的世界坐标数据。
在一实施例中,所述装置还包括:
像素坐标配置模块,用于将所述预设区域在当前图像中的像素坐标数据发送到网页配置端,以使所述网页配置端更新所述预设区域的像素坐标数据。
需要说明的是,本实施例中示出的装置与方法实施例的内容相匹配,可以参考上述方法实施例的内容,在此不再赘述。
在示例性实施例中,还提供了一种摄像头,包括:
处理器;
用于存储所述处理器可执行的计算机程序的存储器;
其中,所述处理器被配置为执行所述存储器中的计算机程序,以实现如图1~图12所述的方法。
在示例性实施例中,还提供了一种安防系统,包括至少一个摄像头和服务器。所述摄像头用于采集图像并发送给服务器;参见图12,所述服务器包括:
处理器121;
用于存储所述处理器可执行的计算机程序的存储器122;
其中,所述处理器被配置为执行所述存储器中的计算机程序,以实现如图1~图12所述的方法。
在示例性实施例中,还提供了一种计算机可读存储介质,例如包括可执行的计算机程序的存储器,上述可执行的计算机程序可由处理器执行,以实现如图1所示实施例的方法。其中,可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本公开旨在涵盖任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构, 并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (13)

  1. 一种区域调整方法,其特征在于,所述方法包括:
    当检测到摄像头转动后,获取所述摄像头的转动角度变化量;
    根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;
    根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。
  2. 根据权利要求1所述的方法,其特征在于,根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系,包括:
    根据所述转动角度变化量获取所述摄像头对应的相机坐标系;
    根据所述相机坐标系统获取世界坐标系与所述摄像头对应的像素坐标系的转换关系。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取预设区域的世界坐标数据,以根据所述世界坐标数据获取所述像素坐标数据。
  4. 根据权利要求3所述的方法,其特征在于,获取预设区域的世界坐标数据,包括:
    获取预览图像中的至少一个指定点;
    基于所述至少一个指定点获取预设区域的世界坐标数据。
  5. 根据权利要求4所述的方法,其特征在于,当所述指定点为世界坐标系的原点时,基于所述至少一个指定点获取预设区域的世界坐标数据,包括:
    以所述摄像头在水平面的投影为原点建立世界坐标系,获取所述预设区域内各像素点对应的世界坐标数据,得到预设区域的世界坐标数据。
  6. 根据权利要求4所述的方法,其特征在于,当所述指定点为预览图像中的第一数量个指定点时,基于所述至少一个指定点获取预设区域的世界坐标数据,包括:
    获取预览图像中第一数量个指定点对应的世界坐标数据;
    根据所述第一数量个指定点的像素坐标数据和世界坐标数据确定所述摄像头对应的像素坐标系和所述世界坐标系的转换关系;
    根据所述预设区域的像素坐标数据和所述转换关系计算所述预设区域的世界坐标数据。
  7. 根据权利要求3所述的方法,其特征在于,获取预设区域的世界坐标数据,包括:
    获取所述摄像头的指定参数的当前数据以及所述预设区域的像素坐标数据;所述指定参数包括以下至少一种:俯仰角、焦距、感光器件的尺寸和高度;
    基于预设的像素坐标系和世界坐标系之间的转换关系,根据所述当前数据、所述像素坐标数据和所述转换关系计算出所述预设区域的世界坐标数据。
  8. 根据权利要求3所述的方法,其特征在于,获取预设区域的世界坐标数据,包括:
    以世界坐标系的原点为参考点,获取所述摄像头所在区域的三维点云数据;
    基于所述三维点云数据获取所述预设区域内各像素点对应的世界坐标数据。
  9. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    将所述预设区域在当前图像中的像素坐标数据发送到网页配置端,以使所述网页配置端更新所述预设区域的像素坐标数据。
  10. 一种区域更新装置,其特征在于,所述装置包括:
    转动角度获取模块,用于当检测到摄像头转动后,获取所述摄像头的转动角度变化量;
    转换关系获取模块,用于根据所述转动角度变化量获取所述摄像头对应的像素坐标系和世界坐标系的转换关系;
    像素坐标确定模块,用于根据预设区域的世界坐标数据和所述转换关系确定所述预设区域在当前图像中的像素坐标数据;所述预设区域为所述摄像头转动前在预览图像中预先设定的区域。
  11. 一种摄像头,其特征在于,包括:
    处理器;
    用于存储所述处理器可执行的计算机程序的存储器;
    其中,所述处理器被配置为执行所述存储器中的计算机程序,以实现如权利要求1~9任一项所述的方法。
  12. 一种安防系统,其特征在于,包括至少一个摄像头和服务器;所述摄像头用于采集图像并发送给服务器;所述服务器包括:
    处理器;
    用于存储所述处理器可执行的计算机程序的存储器;
    其中,所述处理器被配置为执行所述存储器中的计算机程序,以实现如权利要求1~9任一项所述的方法。
  13. 一种计算机可读存储介质,其特征在于,当所述存储介质中的可执行的计算机 程序由处理器执行时,能够实现如权利要求1~9任一项所述的方法。
PCT/CN2022/120062 2021-11-18 2022-09-21 区域调整方法和装置、摄像头和存储介质 WO2023087894A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111372000.0 2021-11-18
CN202111372000.0A CN113923420B (zh) 2021-11-18 2021-11-18 区域调整方法和装置、摄像头和存储介质

Publications (1)

Publication Number Publication Date
WO2023087894A1 true WO2023087894A1 (zh) 2023-05-25

Family

ID=79247616

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/120062 WO2023087894A1 (zh) 2021-11-18 2022-09-21 区域调整方法和装置、摄像头和存储介质

Country Status (2)

Country Link
CN (1) CN113923420B (zh)
WO (1) WO2023087894A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117291986A (zh) * 2023-11-24 2023-12-26 深圳市华意达智能电子技术有限公司 一种基于多重摄像拟合的社区安防识别定位系统

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923420B (zh) * 2021-11-18 2024-05-28 京东方科技集团股份有限公司 区域调整方法和装置、摄像头和存储介质
CN114608555A (zh) * 2022-02-28 2022-06-10 珠海云洲智能科技股份有限公司 目标定位方法、系统及存储介质
CN115631248B (zh) * 2022-11-02 2024-01-23 江苏泽景汽车电子股份有限公司 虚像参数获取方法、装置、电子设备及存储介质
CN115994854B (zh) * 2023-03-22 2023-06-23 智洋创新科技股份有限公司 一种标志物点云和图像配准的方法和系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001264037A (ja) * 2000-03-22 2001-09-26 Nippon Telegr & Teleph Corp <Ntt> カメラキャリブレーション方法及び装置及びカメラキャリブレーションプログラムを格納した記憶媒体
CN109118545A (zh) * 2018-07-26 2019-01-01 深圳市易尚展示股份有限公司 基于旋转轴和双目摄像头的三维成像系统标定方法及系统
CN111461994A (zh) * 2020-03-30 2020-07-28 苏州科达科技股份有限公司 一种坐标转换矩阵的获取及监控画面中目标定位方法
WO2020239093A1 (zh) * 2019-05-31 2020-12-03 深圳市道通智能航空技术有限公司 一种相机标定方法、装置和电子设备
CN112232279A (zh) * 2020-11-04 2021-01-15 杭州海康威视数字技术股份有限公司 一种人员间距检测方法和装置
CN112818990A (zh) * 2021-01-29 2021-05-18 中国人民解放军军事科学院国防科技创新研究院 目标检测框的生成方法、图像数据自动标注方法及系统
CN113923420A (zh) * 2021-11-18 2022-01-11 京东方科技集团股份有限公司 区域调整方法和装置、摄像头和存储介质

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20160146567A (ko) * 2015-06-12 2016-12-21 신동한 가변적으로 빠르게 움직이는 객체를 검출하는 방법 및 장치
CN106815868B (zh) * 2015-11-30 2019-07-16 深圳佑驾创新科技有限公司 摄像头实时标定方法、系统和装置
CN105550670B (zh) * 2016-01-27 2019-07-12 兰州理工大学 一种目标物体动态跟踪与测量定位方法
US11345040B2 (en) * 2017-07-25 2022-05-31 Mbl Limited Systems and methods for operating a robotic system and executing robotic interactions
CN107798918B (zh) * 2017-11-28 2021-07-16 公安部道路交通安全研究中心 一种交通事故现场安全防护监测方法和装置
CN108627092A (zh) * 2018-04-17 2018-10-09 南京阿凡达机器人科技有限公司 一种包裹体积的测量方法、系统、储存介质及移动终端
CN111199560B (zh) * 2019-12-31 2024-03-19 海能达通信股份有限公司 一种视频监控的定位方法及视频监控系统
CN113329181B (zh) * 2021-06-08 2022-06-14 厦门四信通信科技有限公司 一种摄像头的角度切换方法、装置、设备和存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001264037A (ja) * 2000-03-22 2001-09-26 Nippon Telegr & Teleph Corp <Ntt> カメラキャリブレーション方法及び装置及びカメラキャリブレーションプログラムを格納した記憶媒体
CN109118545A (zh) * 2018-07-26 2019-01-01 深圳市易尚展示股份有限公司 基于旋转轴和双目摄像头的三维成像系统标定方法及系统
WO2020239093A1 (zh) * 2019-05-31 2020-12-03 深圳市道通智能航空技术有限公司 一种相机标定方法、装置和电子设备
CN111461994A (zh) * 2020-03-30 2020-07-28 苏州科达科技股份有限公司 一种坐标转换矩阵的获取及监控画面中目标定位方法
CN112232279A (zh) * 2020-11-04 2021-01-15 杭州海康威视数字技术股份有限公司 一种人员间距检测方法和装置
CN112818990A (zh) * 2021-01-29 2021-05-18 中国人民解放军军事科学院国防科技创新研究院 目标检测框的生成方法、图像数据自动标注方法及系统
CN113923420A (zh) * 2021-11-18 2022-01-11 京东方科技集团股份有限公司 区域调整方法和装置、摄像头和存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117291986A (zh) * 2023-11-24 2023-12-26 深圳市华意达智能电子技术有限公司 一种基于多重摄像拟合的社区安防识别定位系统
CN117291986B (zh) * 2023-11-24 2024-02-09 深圳市华意达智能电子技术有限公司 一种基于多重摄像拟合的社区安防识别定位系统

Also Published As

Publication number Publication date
CN113923420B (zh) 2024-05-28
CN113923420A (zh) 2022-01-11

Similar Documents

Publication Publication Date Title
WO2023087894A1 (zh) 区域调整方法和装置、摄像头和存储介质
US10165179B2 (en) Method, system, and computer program product for gamifying the process of obtaining panoramic images
WO2021227359A1 (zh) 一种无人机投影方法、装置、设备及存储介质
US20200154049A1 (en) Digital 3d/360 degree camera system
US9325861B1 (en) Method, system, and computer program product for providing a target user interface for capturing panoramic images
JP5740884B2 (ja) 繰り返し撮影用arナビゲーション及び差異抽出のシステム、方法及びプログラム
CN108932051B (zh) 增强现实图像处理方法、装置及存储介质
US8854359B2 (en) Image processing apparatus, image processing method, storage medium, and image processing system
JP4600515B2 (ja) 情報提示装置及び情報提示方法、撮像装置、並びにコンピュータ・プログラム
WO2014082407A1 (zh) 一种视频监控图像的显示方法及系统
EP3934243A1 (en) Ultra-short-focus alignment method and apparatus for picture and screen, ultra-short-focus projector, and storage medium
CN111461994A (zh) 一种坐标转换矩阵的获取及监控画面中目标定位方法
US20010010546A1 (en) Virtual reality camera
WO2021035891A1 (zh) 基于增强现实技术的投影方法及投影设备
US20190371000A1 (en) Information processing apparatus, information processing method, and storage medium
CN110602376B (zh) 抓拍方法及装置、摄像机
JP7192526B2 (ja) 画像処理装置、画像処理方法及びプログラム
CN110796690B (zh) 图像匹配方法和图像匹配装置
CN111325790A (zh) 目标追踪方法、设备及系统
JP2004165790A (ja) カメラ制御システム
JP7439398B2 (ja) 情報処理装置、プログラム及び情報処理システム
JP2001136431A (ja) カメラ制御装置及びカメラ制御方法及び記憶媒体
JP2008154188A (ja) 画像伝送システム及び画像伝送方法
US20240087157A1 (en) Image processing method, recording medium, image processing apparatus, and image processing system
CN118101906A (zh) 一种基于智能感知的图像处理方法、装置、设备及介质

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: 22894432

Country of ref document: EP

Kind code of ref document: A1