CN117676340A - Camera panoramic stitching method and system based on ONVIF protocol - Google Patents
Camera panoramic stitching method and system based on ONVIF protocol Download PDFInfo
- Publication number
- CN117676340A CN117676340A CN202410128951.0A CN202410128951A CN117676340A CN 117676340 A CN117676340 A CN 117676340A CN 202410128951 A CN202410128951 A CN 202410128951A CN 117676340 A CN117676340 A CN 117676340A
- Authority
- CN
- China
- Prior art keywords
- camera
- grid
- parameters
- pixel
- frame picture
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000004590 computer program Methods 0.000 claims description 15
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000007781 pre-processing Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000011835 investigation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Abstract
The application is applicable to the technical field of image stitching, and provides a camera panoramic stitching method and system based on an ONVIF protocol, wherein the method comprises the following steps: acquiring a current frame picture shot by a camera in real time and shooting parameters of the camera; obtaining the position information of the frame picture according to the current frame picture; dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid; based on ONVIF protocol, obtaining the rotation parameters and pitching parameters of the camera according to the central pixel coordinates of the grid; and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture. Compared with the existing panoramic picture, the method has the advantages that the obtained panoramic picture is simpler, the occupied performance of the program is lower, the process does not need to interact data with a server, the universality is higher, and the existing old equipment can be utilized.
Description
Technical Field
The application belongs to the technical field of image stitching, and particularly relates to a camera panoramic stitching method and system based on ONVIF protocol.
Background
In the protection area monitoring field, the high-definition zoom camera is widely applied to the protection area monitoring field and the animal monitoring field, has great significance to the protection area safety and the biodiversity monitoring, and the wide application of the high-definition zoom camera also enables the wetland protection area staff to achieve the effects of checking the condition and investigation on the spot by controlling the high-definition zoom camera under the condition that the staff does not need to go to the field.
In the prior art, panoramic stitching is realized through a multi-view matrix panoramic camera, and a plurality of distributed cameras are used for shooting and identifying the same target and finally stitching pictures.
But the mounted position of camera is higher, and the shooting scope is limited, need control the coordinated motion between a plurality of cameras, and staff's operation volume is great, and the camera is expensive and the commonality is relatively poor.
Disclosure of Invention
An aim of the embodiment of the application is to provide a camera panorama splicing method based on an ONVIF protocol, which aims at solving the problems that the installation position of a camera is higher, the shooting range is limited, the coordinated movement among a plurality of cameras needs to be controlled, the operation amount of staff is larger, the camera is expensive, the universality is poor and the like.
The embodiment of the application is realized in such a way that a camera panorama stitching method based on an ONVIF protocol comprises the following steps:
acquiring a current frame picture shot by a camera in real time and shooting parameters of the camera, wherein the shooting parameters comprise: magnification, horizontal wide angle range, vertical wide angle range;
obtaining position information of the frame picture according to the current frame picture, wherein the position information comprises pixel width, height and center pixel coordinates of the frame picture;
dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
based on ONVIF protocol, obtaining the rotation parameters and pitching parameters of the camera according to the central pixel coordinates of the grid;
and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
Another object of an embodiment of the present application is to provide a camera panorama stitching system based on the ONVIF protocol, the system including:
the information acquisition module is used for acquiring a current frame picture shot by the camera in real time and shooting parameters of the camera; the shooting parameters include: magnification, horizontal wide angle range, vertical wide angle range;
the preprocessing module is used for obtaining the position information of the frame picture according to the current frame picture; dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
the operation control module is used for obtaining the rotation parameters and the pitching parameters of the camera according to the central pixel coordinates of the grid based on an ONVIF protocol; and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
Another object of an embodiment of the present application is to provide a computer device, including a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the steps of the camera panorama stitching method based on the ONVIF protocol.
Another object of an embodiment of the present application is to provide a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor causes the processor to execute the steps of the method for panoramic stitching a camera based on the ONVIF protocol.
According to the panoramic stitching method of the camera based on the ONVIF protocol, the frame images are divided into the grid layouts, the panoramic images can be shot by the camera based on the ONVIF protocol according to PTZ information, the panoramic images of all angles are combined into one 360-degree panoramic image, the pressure of patrol caused by insufficient personnel equipment is greatly relieved, the whole tracking process is simpler, the program occupation performance is lower, data interaction with a server is not needed in the process, universality is high, the panoramic stitching method can be completed only by a high-definition camera with a basic function, users in a protection area can be helped to count the quantity change trend of targets regularly, and decision support is provided for management of the protection area.
Drawings
Fig. 1 is a flowchart of a camera panorama stitching method based on the ONVIF protocol according to an embodiment of the present application;
fig. 2 is a flowchart of acquiring a current frame picture taken by a camera in real time according to an embodiment of the present application;
FIG. 3 is a flowchart of calculating center pixel coordinates of each grid provided in an embodiment of the present application;
fig. 4 is a flowchart of obtaining the rotation parameter and the pitch parameter of the camera according to the center pixel coordinates of the grid based on the ONVIF protocol provided in the embodiment of the present application;
fig. 5 is a flowchart of a panoramic image of a week provided in an embodiment of the present application;
fig. 6 is a structural block diagram of a camera panorama stitching system based on the ONVIF protocol according to an embodiment of the present application;
FIG. 7 is a block diagram of the internal architecture of a computer device in one embodiment;
fig. 8 is an exemplary diagram of a camera view area provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another element. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
As shown in fig. 1, in one embodiment, a method for panoramic stitching a camera based on the ONVIF protocol is provided, which specifically includes the following steps:
step S102, acquiring a current frame picture shot by a camera in real time and shooting parameters of the camera;
in this embodiment, the image acquired by the camera is real-time, and when a panoramic image needs to be acquired, the current frame image is processed, and the shooting parameters of the camera include: magnification, horizontal wide angle range, vertical wide angle range, horizontal shooting range and vertical shooting range, exemplary, the camera shooting parameter of this application: magnification factor 40 times, focal length 300mm; horizontal wide-angle range (59.0 ° to 1.5 °), vertical wide-angle range (34.2 ° to 0.9 °), horizontal shooting range (-180 ° to 180 °), vertical shooting range (-90 ° to 90 °).
Step S104, according to the current frame picture, obtaining the position information of the frame picture.
In this embodiment, the position information includes pixel width, height and center pixel coordinates of the frame image, coordinate axes are established in the visible area of the camera, accuracy of the camera is determined by the pixel width and height of the frame image, and the center pixel coordinates are used to determine the position of the current camera and determine conditions for movement of the subsequent camera.
And S106, dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid.
In this embodiment, according to the camera multiple in the shooting parameters of the camera, the width and height of the current frame image in the position information may be divided into multiple grids according to the relationship between the camera multiple and the size of the frame image, or may be a fixed number of grids, where, by way of example, the camera multiple is [1, 40], the size of the frame image is [0,1], and zero represents the maximum value of scaling, one represents the grid layout of 40×40, the center pixel coordinate of the grid well reflects the position of the partial region of the image, and thus, all the grid images shot by the camera well constitute the panoramic image.
And step S108, obtaining the rotation parameters and the pitching parameters of the camera according to the central pixel coordinates of the grid based on the ONVIF protocol.
In this embodiment, as shown in fig. 8, in order to convert the center pixel coordinate of the grid obtained by the current frame of picture into the ONVIF parameter PTZ value (Pan, tilt, zoom) of the corresponding network camera, the following method is used: obtaining equipment information of a currently used network high-definition camera according to inquiry official network information; according to ONVIF protocol principle PTZ, pan and Tilt value set is [ -1,1], and Zoom value set is [0,1]; the PTZ value of the current angle is obtained by calling an ONVIF standard interface 'get_ptz', three parameter values to be rotated in the PTZ are obtained by formula calculation, and the camera is controlled to rotate to the calculated PTZ position by the ONVIF protocol, so that the whole process of one frame can be completed.
Step S110, obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
In this embodiment, the panoramic picture is a combination of grid pictures in the horizontal wide angle range of the current camera, and an exemplary 40×40 Zhang Gaoqing large picture of the current picture can be obtained, and the 59 ° panoramic picture under a super-large high-definition large scene can be obtained by arranging and splicing again according to a matrix of 40×40.
In one embodiment, as shown in fig. 2, step S102 may specifically include the following steps:
step S202, connecting a camera, and starting an ONVIF protocol;
step S204, according to the ONVIF protocol, the current frame picture shot by the camera in real time and the shooting parameters of the camera are obtained.
In this embodiment, the camera may be a network camera including an ONVIF protocol, and the image acquisition method of the network camera is various, which is not specifically limited in this application, and in this application, by way of example, a real-time frame image of the current network camera is acquired by a getsnappbooturi method in the ONVIF protocol, and specifically, by way of device discovery, a device service address is obtained; calling a GetCapabilties interface by using the equipment service address to obtain a media service address; calling a GetProfiles interface by using a media service address to obtain media configuration information of a primary and secondary code stream, wherein the media configuration information comprises Profile Token; calling a GetSnapshot URI interface by using a Profile Token to obtain a URI address of the primary and secondary code image snapshot; and acquiring the picture by using a GET mode of HTTP according to the URI address.
In one embodiment, as shown in fig. 3, step S106 may specifically include the following steps:
step S302, determining the maximum multiple of a camera;
step S304, determining the maximum grid number according to the maximum multiple;
step S306, calculating the center pixel coordinates of each grid according to the coordinate calculation formula.
In the embodiment, determining the maximum multiple of the camera; determining the maximum grid number according to the maximum multiple; according to a coordinate calculation formula, calculating the central Pixel coordinate of each grid, wherein the current multiple of the camera is 40, the maximum grid number is 40 x 40, the grid central point Pixel coordinate is represented by n (pixel_x, pixel_y), and the calculation formula is as follows:
Pixel_x = (n/Z) × 1.5 × (SIZE_w /Z)
Pixel_y = (n/Z) × 1.5 × (SIZE_h / Z)
wherein, pixel_x is the abscissa of the grid, pixel_y is the ordinate of the grid, n is the grid number, Z is the camera multiple, size_w is the width of the frame picture, and size_h is the height of the frame picture.
In one embodiment, as shown in fig. 4, step S108 may specifically include the following steps:
step S402, determining a value set of rotation parameters and a value set of pitching parameters based on ONVIF protocol;
step S404, obtaining the current zoom value of the camera;
step S406, according to a first formula, based on the current zoom value of the camera and the photographing parameter of the camera, obtaining a photographing angle of each pixel in horizontal rotation and a photographing angle of each pixel in vertical pitching;
step S408, according to a second formula, based on the horizontal rotation per-pixel shooting angle, the vertical pitching per-pixel shooting angle and the shooting parameters, obtaining a rotation value of horizontal per-pixel offset and a pitching value of vertical per-pixel offset;
step S410, obtaining a horizontal offset pixel and a vertical offset pixel according to the central pixel coordinates of each grid;
step S412, multiplying the rotation value of the horizontal per-pixel offset with the horizontal offset pixel to obtain a horizontal rotation value to be offset, and multiplying the pitch value of the vertical per-pixel offset with the vertical offset pixel to obtain a vertical pitch value to be offset;
step S414, adding the horizontal rotation value to be offset to the current rotation value of the camera to obtain a camera rotation parameter, and adding the vertical pitch value to be offset to the current pitch value of the camera to obtain a camera pitch parameter.
In this embodiment, the device information of the camera may be obtained from the network information of the camera device, and exemplary information includes: horizontal wide-angle range (59.0 ° to 1.5 °), vertical wide-angle range (34.2 ° to 0.9 °), horizontal shooting range (-180 ° to 180 °), vertical shooting range (-90 ° to 90 °);
the value set of translation (Pan) and Tilt (Tilt) in PTZ (Pan, tilt, zoom) according to ONVIF protocol principle is [ -1,1]Scaling (Zoom) to a value set of [0,1]The method comprises the steps of carrying out a first treatment on the surface of the PTZ values of the current camera angle are obtained by calling ONVIF canonical interface get_ptz, respectively current Zoom (Zoom now ) Current translation (Pan now ) And the current Tilt (Tilt now ). According to the current scaling value, through a first formula, the corresponding horizontal rotation per-pixel shooting angle (per_angle_x) and vertical pitching per-pixel shooting angle (per_angle_y) under the current scaling value can be calculated; the first formula is as follows:
per_angle_x = ((1 - now_z) * (max_angle_x - min_angle_x)) + min_angle_x
per_angle_y = ((1 - now_z) * (max_angle_y - min_angle_y)) + min_angle_y
in the formula: non_z is the current scaling value; max_angle_x is the horizontal wide-angle maximum angle, which is 59.0 ° in this example, and max_angle_y is the vertical wide-angle maximum angle; min_angle_x is the horizontal wide angle minimum angle, which is 1.5 ° in this example, and min_angle_y is the vertical wide angle minimum angle.
According to the camera horizontal shooting range of 360 degrees and the vertical shooting range of 180 degrees, the rotation value (ptz_per_px_x) of the horizontal per-pixel offset and the pitch value (ptz_per_px_y) of the vertical per-pixel offset under the current scaling value can be calculated by using a second formula through the acquired horizontal rotation per-pixel shooting angle and vertical pitch per-pixel shooting angle, and the second formula is as follows:
ptz_per_px_x = 2 / (frame_width * ( 360 / per_angle_x ))
ptz_per_px_y = 2 / (frame_height * ( 180 / per_angle_y ))
in the formula: frame_width is the width of the current frame picture and frame_height is the height.
According to the pixel coordinates of the center point of the current frame picture and the center point of the grid, calculating to obtain a horizontal offset pixel (relative_x) and a vertical offset pixel (relative_y) of the center point of each grid relative to the center point of the current frame picture; multiplying the rotation value of each horizontal pixel offset by the horizontal offset pixel to obtain a horizontal rotation value to be offset, and multiplying the pitch value of each vertical pixel offset by the vertical offset pixel to obtain a vertical pitch value to be offset; through the calculation of the process, the rotation value and the pitching value of the camera, which need to be turned, are obtained, and the camera can shoot panoramic pictures in the current horizontal wide-angle range.
In one embodiment, as shown in fig. 5, step S110 may specifically include the following steps:
step S502, horizontally rotating the camera for one circle according to the frame picture width pixel value;
step S504, obtaining panoramic pictures shot by the camera during each rotation;
and step S506, splicing the panoramic pictures to obtain a panoramic picture of a circle.
In this embodiment, in order to achieve a 360 ° panoramic effect, the camera is further controlled to rotate the width pixel of the current frame of picture in one direction, so that 59 ° panoramic pictures under different angles can be obtained by repeating steps S104-S110, all the steps can be set to be automatically repeated every hour, regular periodic data can be obtained, and the statistical capability of each sample point in the protection area is greatly improved.
As shown in fig. 6, a camera panorama stitching system based on the ONVIF protocol is improved, the system includes:
the information obtaining module 610 is configured to obtain a current frame picture that is photographed by the camera in real time and photographing parameters of the camera; the shooting parameters include: magnification, horizontal wide angle range, vertical wide angle range;
a preprocessing module 620, configured to obtain location information of the frame picture according to the current frame picture; dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
the operation control module 630 obtains the rotation parameter and the pitching parameter of the camera according to the central pixel coordinates of the grid based on the ONVIF protocol; and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
In this embodiment, the specific working method flow and the technical effects of each module of the automatic camera tracking system based on the ONVIF protocol are described in the foregoing, and are not described in detail herein.
FIG. 7 illustrates an internal block diagram of a computer device in one embodiment. As shown in fig. 7, the computer device includes a processor, a memory, a network interface, an input device, and a display screen connected by a system bus. The memory includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and may also store a computer program that, when executed by the processor, causes the processor to implement a camera panorama stitching method based on the ONVIF protocol. The internal memory may also store a computer program that, when executed by the processor, causes the processor to perform the ONVIF protocol-based camera panorama stitching method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a camera panorama stitching system based on the ONVIF protocol provided herein may be implemented in the form of a computer program that may be run on a computer device as shown in fig. 7. The memory of the computer device may store various program modules that make up the one ONVIF protocol-based camera panorama stitching system, such as the information acquisition module 610, the preprocessing module 620, and the operation control module 630 shown in fig. 6. The computer program formed by the program modules enables the processor to execute the steps in the method for splicing the panoramic camera based on the ONVIF protocol according to the various embodiments of the application described in the specification.
In one embodiment, a computer device is presented, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a current frame picture shot by a camera in real time and shooting parameters of the camera, wherein the shooting parameters comprise: magnification, horizontal wide angle range, vertical wide angle range;
obtaining position information of the frame picture according to the current frame picture, wherein the position information comprises pixel width, height and center pixel coordinates of the frame picture;
dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
based on ONVIF protocol, obtaining the rotation parameters and pitching parameters of the camera according to the central pixel coordinates of the grid;
and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which when executed by a processor causes the processor to perform the steps of:
acquiring a current frame picture shot by a camera in real time and shooting parameters of the camera, wherein the shooting parameters comprise: magnification, horizontal wide angle range, vertical wide angle range;
obtaining position information of the frame picture according to the current frame picture, wherein the position information comprises pixel width, height and center pixel coordinates of the frame picture;
dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
based on ONVIF protocol, obtaining the rotation parameters and pitching parameters of the camera according to the central pixel coordinates of the grid;
and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
It should be understood that, although the steps in the flowcharts of the embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in various embodiments may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.
Claims (9)
1. The panoramic camera splicing method based on the ONVIF protocol is characterized by comprising the following steps of:
acquiring a current frame picture shot by a camera in real time and shooting parameters of the camera, wherein the shooting parameters comprise: magnification, horizontal wide angle range, vertical wide angle range;
obtaining position information of the frame picture according to the current frame picture, wherein the position information comprises pixel width, height and center pixel coordinates of the frame picture;
dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
based on ONVIF protocol, obtaining the rotation parameters and pitching parameters of the camera according to the central pixel coordinates of the grid;
and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
2. The method for panoramic stitching camera based on the ONVIF protocol according to claim 1, wherein the step of obtaining the current frame picture and the camera shooting parameters of the camera shot in real time comprises the following steps:
connecting a camera, and starting an ONVIF protocol;
and acquiring a current frame picture shot by the camera in real time and shooting parameters of the camera according to the ONVIF protocol.
3. The method for panoramic stitching camera based on the ONVIF protocol according to claim 1, wherein the steps of dividing the frame picture into grids and calculating the center pixel coordinates of each grid include:
determining the maximum multiple of the camera;
determining the maximum grid number according to the maximum multiple;
and calculating the central pixel coordinates of each grid according to a coordinate calculation formula.
4. The method for panoramic stitching a camera based on the ONVIF protocol according to claim 3, wherein the coordinate calculation formula is:
Pixel_x = (n/Z) × 1.5 × (SIZE_w /Z)
Pixel_y = (n/Z) × 1.5 × (SIZE_h / Z)
wherein, pixel_x is the abscissa of the grid, pixel_y is the ordinate of the grid, n is the grid number, Z is the camera multiple, size_w is the width of the frame picture, and size_h is the height of the frame picture.
5. The method for splicing the panoramic camera based on the ONVIF protocol according to claim 1, wherein the method for obtaining the rotation parameter and the pitching parameter of the camera based on the ONVIF protocol according to the central pixel coordinates of the grid comprises the following steps:
determining a value set of rotation parameters and a value set of pitching parameters based on an ONVIF protocol;
acquiring a current zoom value of a camera;
according to a first formula, based on the current zoom value of the camera and the photographing parameters of the camera, obtaining a horizontal rotation photographing angle per pixel and a vertical pitching photographing angle per pixel;
according to a second formula, based on the shooting angle per pixel of the horizontal rotation, the shooting angle per pixel of the vertical pitching and the shooting parameters, a rotation value per pixel of the horizontal deviation and a pitching value per pixel of the vertical deviation are obtained;
obtaining horizontal offset pixels and vertical offset pixels according to the central pixel coordinates of each grid;
multiplying the rotation value of each horizontal pixel offset by the horizontal offset pixel to obtain a horizontal rotation value to be offset, and multiplying the pitch value of each vertical pixel offset by the vertical offset pixel to obtain a vertical pitch value to be offset;
and adding the horizontal rotation value to be offset and the current rotation value of the camera to obtain a camera rotation parameter, and adding the vertical pitching value to be offset and the current pitching value of the camera to obtain a camera pitching parameter.
6. The method for panoramic stitching a camera based on the ONVIF protocol according to claim 1, wherein the combining the pictures of the grid to obtain a panoramic picture further comprises the following steps:
according to the frame picture width pixel value, horizontally rotating the camera for one circle;
acquiring panoramic pictures shot by the camera during each rotation;
and splicing the panoramic pictures to obtain a week panoramic picture.
7. A camera panorama stitching system based on the ONVIF protocol, the system comprising:
the information acquisition module is used for acquiring a current frame picture shot by the camera in real time and shooting parameters of the camera; the shooting parameters include: magnification, horizontal wide angle range, vertical wide angle range;
the preprocessing module is used for obtaining the position information of the frame picture according to the current frame picture; dividing the frame picture into grids according to the shooting parameters of the camera and the position information, and calculating the central pixel coordinates of each grid;
the operation control module is used for obtaining the rotation parameters and the pitching parameters of the camera according to the central pixel coordinates of the grid based on an ONVIF protocol; and obtaining a picture of the grid according to the rotation parameters and the pitching parameters of the camera, and combining the pictures of the grid to obtain a panoramic picture.
8. A computer device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of a method of ONVIF protocol based camera panorama stitching as claimed in any one of claims 1 to 6.
9. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when executed by a processor, the computer program causes the processor to perform the steps of a camera panorama stitching method based on the ONVIF protocol according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410128951.0A CN117676340A (en) | 2024-01-31 | 2024-01-31 | Camera panoramic stitching method and system based on ONVIF protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410128951.0A CN117676340A (en) | 2024-01-31 | 2024-01-31 | Camera panoramic stitching method and system based on ONVIF protocol |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117676340A true CN117676340A (en) | 2024-03-08 |
Family
ID=90079219
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410128951.0A Pending CN117676340A (en) | 2024-01-31 | 2024-01-31 | Camera panoramic stitching method and system based on ONVIF protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117676340A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140293002A1 (en) * | 2011-11-07 | 2014-10-02 | Sony Computer Entertainment Inc. | Image generation apparatus and image generation method |
CN105704430A (en) * | 2014-10-21 | 2016-06-22 | 群晖科技股份有限公司 | Method and apparatus for managing a monitoring system |
CN109672826A (en) * | 2019-02-26 | 2019-04-23 | 成都第二记忆科技有限公司 | Device and method for the video that pans |
US20210004933A1 (en) * | 2019-07-01 | 2021-01-07 | Geomagical Labs, Inc. | Method and system for image generation |
US20220044356A1 (en) * | 2019-12-17 | 2022-02-10 | Dalian University Of Technology | Large-field-angle image real-time stitching method based on calibration |
-
2024
- 2024-01-31 CN CN202410128951.0A patent/CN117676340A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140293002A1 (en) * | 2011-11-07 | 2014-10-02 | Sony Computer Entertainment Inc. | Image generation apparatus and image generation method |
CN105704430A (en) * | 2014-10-21 | 2016-06-22 | 群晖科技股份有限公司 | Method and apparatus for managing a monitoring system |
CN109672826A (en) * | 2019-02-26 | 2019-04-23 | 成都第二记忆科技有限公司 | Device and method for the video that pans |
US20210004933A1 (en) * | 2019-07-01 | 2021-01-07 | Geomagical Labs, Inc. | Method and system for image generation |
US20220044356A1 (en) * | 2019-12-17 | 2022-02-10 | Dalian University Of Technology | Large-field-angle image real-time stitching method based on calibration |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103780830B (en) | Linkage type photographing system and control method of multiple cameras thereof | |
CN1979335B (en) | Camera system, camera control apparatus, and panorama image making method | |
CN109005334B (en) | Imaging method, device, terminal and storage medium | |
TWI530180B (en) | Linking-up photographing system and control method for cameras thereof | |
US8289420B2 (en) | Image processing device, camera device, image processing method, and program | |
CN111563552A (en) | Image fusion method and related equipment and device | |
CN113194263A (en) | Gun and ball linkage control method and device, computer equipment and storage medium | |
CN110689476A (en) | Panoramic image splicing method and device, readable storage medium and electronic equipment | |
CN111476163A (en) | High-altitude parabolic monitoring method and device and computer storage medium | |
US8942513B2 (en) | De-warping processing method for digital images | |
CN110248089B (en) | Image transmission method, system and terminal equipment | |
CN117676340A (en) | Camera panoramic stitching method and system based on ONVIF protocol | |
JP6612724B2 (en) | Video surveillance system and surveillance video display method | |
CN113079369A (en) | Method and device for determining image pickup equipment, storage medium and electronic device | |
CN115174878B (en) | Projection picture correction method, apparatus and storage medium | |
CN114782555B (en) | Map mapping method, apparatus, and storage medium | |
CN116017136A (en) | Shooting equipment control method and device, storage medium and electronic device | |
CN114245006B (en) | Processing method, device and system | |
CN112822442B (en) | Heat map generation method and device and electronic equipment | |
CN112819738A (en) | Infrared image fusion method and device, computer equipment and storage medium | |
EP2438572A1 (en) | Generating images with different fields of view | |
CN117177069B (en) | Camera automatic tracking method and system based on ONVIF protocol | |
CN115086517A (en) | Image acquisition method and device, electronic equipment and storage medium | |
CN112437253B (en) | Video splicing method, device, system, computer equipment and storage medium | |
CN111539964B (en) | Plant canopy surface area acquisition method and device based on depth image, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |