CN115514897A - Method and device for processing image - Google Patents

Method and device for processing image Download PDF

Info

Publication number
CN115514897A
CN115514897A CN202211458944.4A CN202211458944A CN115514897A CN 115514897 A CN115514897 A CN 115514897A CN 202211458944 A CN202211458944 A CN 202211458944A CN 115514897 A CN115514897 A CN 115514897A
Authority
CN
China
Prior art keywords
shooting
parameters
set area
image
calculating
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.)
Granted
Application number
CN202211458944.4A
Other languages
Chinese (zh)
Other versions
CN115514897B (en
Inventor
朱文旗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhongke Mijing Smart Ecological Technology Co ltd
Original Assignee
Beijing Zhongke Mijing Smart Ecological Technology Co ltd
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 Beijing Zhongke Mijing Smart Ecological Technology Co ltd filed Critical Beijing Zhongke Mijing Smart Ecological Technology Co ltd
Priority to CN202211458944.4A priority Critical patent/CN115514897B/en
Publication of CN115514897A publication Critical patent/CN115514897A/en
Application granted granted Critical
Publication of CN115514897B publication Critical patent/CN115514897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)

Abstract

The invention provides a method and a device for processing an image, and belongs to the technical field of image processing. The method comprises the following steps: the method comprises the steps that a moving path and moving parameters of shooting equipment for shooting a set area to be monitored are calculated, and the shooting equipment is driven to rotate to multiple shooting positions to shoot the set area, so that multiple local images are obtained; and further splicing the local images to obtain a panoramic image of a set area. The embodiment of the invention can monitor the whole range of the set area, and overcomes the problem that the fixed-point image acquisition image is incomplete; by calculating the moving path and the moving parameters of the shooting equipment for shooting, the problem that the image quality is influenced by factors such as scene shaking is solved, and the image processing efficiency is improved; and through the comprehensive monitoring of the set area, the accuracy of the panoramic image containing data is improved to a greater extent.

Description

Method and device for processing image
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for processing an image.
Background
In many scenes, it is usually necessary to capture an image of a set detection area by using a monitoring shooting device so as to monitor the set area by using image acquisition.
At present, the existing method for acquiring a panoramic image of a set area mainly uses a single monitoring shooting device to collect local images at fixed points, or randomly collects a plurality of local images to generate a panoramic image; the existing fixed-point image acquisition can not cover the whole monitoring area, so that the whole image acquisition can not be carried out on the whole area, and the monitoring area can not be displayed by a panoramic image.
Disclosure of Invention
In view of the above, embodiments of the present invention provide an image processing method and apparatus, capable of driving a shooting device to rotate to multiple shooting positions to perform shooting on a set area by calculating a moving path and a moving parameter of the shooting device for performing shooting on the set area to be monitored, so as to obtain multiple partial images; and further splicing the local images to obtain a panoramic image of a set area. The embodiment of the invention can monitor the whole range of the set area, and overcomes the problem that the fixed-point image acquisition image is incomplete; by calculating the moving path and the moving parameters of the shooting equipment for shooting, the problem that the image quality is influenced by factors such as scene shaking is solved, and the efficiency of processing the image is improved; and through the comprehensive monitoring of the set area, the accuracy of the panoramic image containing data is improved to a greater extent.
To achieve the above object, according to one aspect of the present invention, there is provided a method comprising:
acquiring a plurality of range parameters of a monitored set region; the set area is provided with rotatable shooting equipment for monitoring; calculating a moving path and a moving parameter of the photographing apparatus for performing photographing based on a plurality of the range parameters and an initial photographing parameter of the photographing apparatus; driving the shooting equipment to rotate to a plurality of shooting positions to shoot the set area according to the moving path and the moving parameters to obtain a plurality of local images; and splicing the local images to obtain a panoramic image of the set area.
Optionally, the determining initial shooting parameters of the shooting device includes: determining a plurality of initial shooting positions based on a plurality of range parameters of the set area, driving the shooting device to respectively rotate to the plurality of initial shooting positions, and determining initial shooting parameters of the shooting device corresponding to the initial shooting positions; the initial shooting parameters comprise one or more of shooting angle parameters, focal length parameters and photosensitive element parameters corresponding to a plurality of initial shooting positions.
Optionally, the calculating a moving path and a moving parameter of the photographing apparatus to perform photographing based on the plurality of range parameters and the initial photographing parameter of the photographing apparatus includes: calculating a panoramic range of the set area based on a plurality of range parameters; calculating the number of rows and columns of the local images shot by the shooting equipment to be moved when the local images shot by the shooting equipment cover the panoramic range based on the initial shooting parameters of the shooting equipment; determining the moving path based on the number of rows and the number of columns; and calculating a movement parameter of the photographing apparatus at each photographing position.
Optionally, the calculating the movement parameter of the shooting device at each shooting position includes: for each shooting position, performing: and acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of moving parameters of the shooting device at the shooting position according to the number of rows or columns.
Optionally, the movement parameters include: a horizontal movement inclination angle or a vertical movement inclination angle; acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of rows or columns, wherein the method comprises the following steps: acquiring a plurality of edge vertical field angles and a plurality of edge horizontal field angles contained in photosensitive element parameters of the shooting equipment; for each shooting position, performing: and calculating a horizontal movement inclination angle or a vertical movement inclination angle of the shooting device at the current shooting position based on the plurality of edge vertical field angles and the plurality of edge horizontal field angles in combination with the number of rows or columns corresponding to the shooting position of the shooting device.
Optionally, the movement parameters further include corresponding focal length variation parameters; acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of rows or columns, wherein the method comprises the following steps: acquiring a plurality of edge focal length parameters of the shooting equipment; for each shooting position, performing: and calculating the focal length change parameter of the shooting device at the current shooting position based on the difference value of the edge focal length parameters and the number of lines of the shooting device at the current shooting position.
Optionally, the stitching the plurality of local images to obtain the panoramic image of the set area includes: and acquiring the number of lines and columns corresponding to the shooting position of each local image, and splicing each local image to the corresponding number of lines and columns in the panoramic image in sequence by utilizing the sequence corresponding to the plurality of shooting positions so as to process to obtain the panoramic image in the set area.
Optionally, the stitching the plurality of local images to obtain a panoramic image of the set area further includes: and correcting each local image by using a vignetting effect model, and performing splicing processing on the plurality of local images based on the corrected local images to obtain a panoramic image of the set area.
According to another aspect of the present invention, there is provided an apparatus for processing an image, the apparatus including: the device comprises a shooting parameter calculating module, a local image obtaining module and a local image splicing module; wherein,
the shooting parameter calculating module is used for acquiring a plurality of range parameters of the monitored set area; the set area is provided with rotatable shooting equipment for monitoring; calculating a moving path and moving parameters of the photographing apparatus to perform photographing based on a plurality of the range parameters and initial photographing parameters of the photographing apparatus
The local image acquisition module is used for driving the shooting equipment to execute shooting at a plurality of shooting positions in the set area according to the moving path and the moving parameters to obtain a plurality of local images;
and the local image splicing module is used for splicing the plurality of local images to obtain a panoramic image of the set area.
Optionally, the apparatus for processing an image, configured to determine initial shooting parameters of the shooting device, includes: determining a plurality of initial shooting positions based on a plurality of range parameters of the set area, driving the shooting device to respectively rotate to the plurality of initial shooting positions, and determining initial shooting parameters of the shooting device corresponding to the initial shooting positions; the initial shooting parameters comprise one or more of shooting angle parameters, focal length parameters and photosensitive element parameters corresponding to a plurality of initial shooting positions.
Optionally, the apparatus for processing an image, configured to calculate a moving path and a moving parameter of the shooting device for performing shooting based on a plurality of the range parameters and an initial shooting parameter of the shooting device, includes: calculating a panoramic range of the set area based on a plurality of range parameters; calculating the number of rows and columns of the local images shot by the shooting equipment to be moved when the local images shot by the shooting equipment cover the panoramic range based on the initial shooting parameters of the shooting equipment; determining the moving path based on the number of rows and the number of columns; and calculating a movement parameter of the photographing apparatus at each photographing position.
Optionally, the apparatus for processing an image, configured to calculate a movement parameter of the shooting device at each shooting position, includes: for each shooting position, performing: and acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of moving parameters of the shooting device at the shooting position according to the number of rows or columns.
Optionally, the movement parameters of the apparatus for processing images include: a horizontal movement inclination angle or a vertical movement inclination angle; acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of rows or columns, wherein the method comprises the following steps: acquiring a plurality of edge vertical field angles and a plurality of edge horizontal field angles contained in photosensitive element parameters of the shooting equipment; for each shooting position, performing: and calculating a horizontal movement inclination angle or a vertical movement inclination angle of the shooting device at the current shooting position based on the plurality of edge vertical field angles and the plurality of edge horizontal field angles in combination with the number of rows or columns corresponding to the shooting position of the shooting device.
Optionally, the movement parameters of the apparatus for processing images further include corresponding focal length variation parameters; acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of rows or columns, wherein the method comprises the following steps: acquiring a plurality of edge focal length parameters of the shooting equipment; for each shooting position, performing: and calculating the focal length change parameter of the shooting device at the current shooting position based on the difference value of the edge focal length parameters and the number of lines of the shooting device at the current shooting position.
Optionally, the apparatus for processing an image is configured to perform stitching processing on the multiple local images to obtain a panoramic image of the set area, and includes: and acquiring the number of rows and the number of columns corresponding to the shooting position of each local image, and sequentially splicing each local image to the corresponding number of rows and the corresponding number of columns in the panoramic image by utilizing the sequence corresponding to the plurality of shooting positions so as to process and obtain the panoramic image of the set area.
Optionally, the apparatus for processing an image is configured to perform stitching processing on the plurality of local images to obtain a panoramic image of the set area, and further includes: and correcting each local image by using a vignetting effect model, and performing splicing processing on the plurality of local images based on the corrected local images to obtain a panoramic image of the set area.
According to another aspect of the present invention, there is provided an electronic apparatus including:
a processor; and
a memory for storing a program, wherein the program is stored in the memory,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the above-described method of processing an image.
According to another aspect of the present invention, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the above-described method of processing an image.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps that a moving path and moving parameters of shooting equipment for shooting a monitored set area can be calculated, the shooting equipment is driven to rotate to a plurality of shooting positions to shoot the monitored set area, and a plurality of local images are obtained; and further splicing the local images to obtain a panoramic image of a set area. The embodiment of the invention can monitor the whole range of the set area, and overcomes the problem that the fixed-point image acquisition image is incomplete; by calculating the moving path and the moving parameters of the shooting equipment for shooting, the problem that the image quality is influenced by factors such as scene shaking is solved, and the efficiency of processing the image is improved; and through the comprehensive monitoring of the set area, the accuracy of the panoramic image containing data is improved to a greater extent.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart illustrating a method of processing an image according to an exemplary embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of another method for processing an image provided by an exemplary embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for processing an image according to an exemplary embodiment of the present invention;
FIG. 4 illustrates a block diagram of an exemplary electronic device that can be used to implement an embodiment of the invention.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and the embodiments of the present invention are illustrative only and are not intended to limit the scope of the present invention.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description. It should be noted that the terms "first", "second", and the like in the present invention are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in the present invention are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present invention are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
As shown in fig. 1, an embodiment of the present invention provides a method of processing an image, which may include the steps of:
step S101: acquiring a plurality of range parameters of a monitored set region; the set area is provided with rotatable shooting equipment for monitoring; based on a plurality of the range parameters and initial shooting parameters of the shooting device, a moving path and moving parameters of the shooting device for executing shooting are calculated.
Specifically, in the embodiment of the present invention, the set area is the monitored area, and the purpose and size of the set area are set according to the application scenario, and the present invention does not limit the size of the area and the geographical form of the set area.
Further, rotatable shooting equipment is arranged for the monitored set area, and the rotatable shooting equipment is a rotatable camera, a rotatable image head, a movable camera and the like; in one embodiment of the present invention, a rotatable photographing apparatus may be provided at a fixed position, and a main body rotatably representing the photographing apparatus at the fixed position may be moved by driving in upward, downward, left, and right directions at a certain distance so that the photographing apparatus can photograph images of respective partial ranges of a set area; or the lens of the shooting device can be driven to move at a certain distance in the upward, downward, left and right directions, so that the shooting device can shoot images of all local ranges of the set area; in another embodiment of the present invention, the rotatable capture device may be secured to a motion device (e.g., a slide rail, etc.) such that the rotatable device rotates at any one or more positions of the motion device to capture the partial images.
It is understood that different angles of shooting can be performed for the detected set area through rotation of the camera or the lens to obtain local images with different set areas. That is, the set area is provided with a rotatable photographing device for monitoring. The image shot by the shooting device can play a role in monitoring the set area and obtaining data of the set area.
Further, a moving path and a moving parameter of the photographing apparatus to perform photographing are calculated based on a plurality of the range parameters and an initial photographing parameter of the photographing apparatus. Wherein the range parameter may be a plurality of reference points indicating a range of the setting region; for example, setting a plurality of reference points of the region boundary or a plurality of reference points corresponding to the edge angles; preferably, in one embodiment of the present invention, the range parameter is a reference point corresponding to 4 edge angles of the setting region.
Further, determining a plurality of initial shooting positions based on a plurality of range parameters of the set area; for example: taking the reference points corresponding to the four edge angles as initial shooting positions; thereby determining initial parameters of the photographing device; specifically, the shooting equipment is driven to turn to four edge angles respectively at a certain position where the shooting equipment is located, and when the shooting equipment turns to each edge angle, parameters of the shooting equipment at that time are obtained and serve as initial shooting parameters, and the initial shooting parameters are one or more of shooting angle parameters, focal length parameters and photosensitive element parameters. It is understood that four different sets of initial photographing parameters can be acquired for the four edge angles. Namely, determining initial shooting parameters of the shooting device includes: determining a plurality of initial shooting positions based on a plurality of range parameters of the set area, driving the shooting device to respectively rotate to the plurality of initial shooting positions, and determining initial shooting parameters of the shooting device corresponding to the initial shooting positions; the initial shooting parameters comprise one or more of shooting angle parameters, focal length parameters and photosensitive element parameters corresponding to a plurality of initial shooting positions. For example: aiming at a certain edge angle of a set area, obtaining corresponding initial shooting parameters as follows: shooting angle parameters (horizontal tilt angle parameters, vertical tilt angle parameters, and the like), and focal length parameters of the lens; further, the initial photographing parameters also include lens sensitive element parameters (e.g., height and width of the lens sensitive element, etc.).
In an embodiment of the invention, the horizontal inclination angle parameter, the vertical inclination angle parameter and the focal length parameter of the four edge angles can be respectively stored, the photosensitive element parameter is obtained through a control program of the shooting equipment and is stored, and the interactive control of the control program and the shooting equipment is reduced and the operation efficiency of processing images is improved through the storage of the initial shooting parameter.
Further, calculating a moving path and moving parameters of the shooting device to execute shooting; wherein the moving path refers to a direction and a distance in which the photographing apparatus (e.g., a lens of the photographing apparatus) moves, and in one embodiment of the present invention, in a case where the photographing apparatus is fixed at one position, the moving path may be a distance in which the photographing apparatus or the photographing lens performs multi-directional rotation based on one fixed position; in another embodiment of the present invention, the photographing apparatus may be mounted on a moving device (e.g., a sliding rail or other device that can move the photographing apparatus, and the moving path may be a distance that the photographing apparatus or the photographing lens rotates in multiple directions at a certain position, and the specific shape and the specific position of the photographing apparatus are not limited in the present application.
Further, a photographing method of driving the photographing apparatus is: the method comprises the steps of controlling and monitoring a camera lens to be aligned with the upper right edge angle of a set area, shooting and storing a local image after the camera is static, then driving a shooting device to perform horizontal moving scanning, determining the horizontal unit inclination angle of each movement by the moving parameters of the lens, shooting and storing the local image after the camera is static, vertically moving downwards to scan when the camera scans to the edge of the whole area, determining the vertical unit inclination angle of each movement by the moving parameters of the lens, reversely performing horizontal scanning after the camera is static, and repeating the steps to enable the moving track of the shooting device to be S-shaped until the whole area is completely scanned. It follows that the number of rows (i.e., horizontal reverse movement), the number of columns (vertical direction) that the device needs to move can be photographed based on the set area; that is, the calculating of the moving path and the moving parameter of the photographing apparatus to perform photographing based on the plurality of range parameters and the initial photographing parameter of the photographing apparatus includes: calculating a panoramic range of the set area based on a plurality of range parameters; calculating the number of rows and columns of the local images shot by the shooting equipment to be moved when the local images shot by the shooting equipment cover the panoramic range based on the initial shooting parameters of the shooting equipment; determining the moving path based on the number of rows and the number of columns; and calculating a movement parameter of the photographing apparatus at each photographing position.
The following describes the method for calculating the number of rows, columns, and shift parameters:
the formula for calculating the number of rows is shown in equation (1):
Figure 767228DEST_PATH_IMAGE001
wherein r represents the number of lines, of photosensitive elements of the lens
Figure 573510DEST_PATH_IMAGE002
Is a vertical field angle of the upper edge angle of the lens-photographed panoramic image,
Figure 216981DEST_PATH_IMAGE003
is a vertical field angle of a lower edge angle of the lens-photographed panorama,
Figure 817727DEST_PATH_IMAGE004
is a vertical tilt angle parameter of the upper edge angle of the lens,
Figure 812228DEST_PATH_IMAGE005
Is a vertical tilt parameter of the lower edge angle of the lens; the number of lines scanned by the lens of the shooting device in order to cover the entire setting area can be calculated through the formula (1).
The formula for calculating the number of columns is shown in formula (2):
Figure 156621DEST_PATH_IMAGE006
wherein, c represents the number of columns,
Figure 920178DEST_PATH_IMAGE007
is the horizontal tilt parameter of the left edge angle of the lens,
Figure 691825DEST_PATH_IMAGE008
is the right side of the lensHorizontal tilt angle parameters of the rim angle;
Figure 908042DEST_PATH_IMAGE009
a horizontal field angle which is an upper edge angle of the lens shot panorama; the number of columns scanned by the lens of the shooting device to cover the whole setting area can be calculated by the formula (2).
Further, the calculating the movement parameter of the photographing apparatus at each photographing position includes: for each shooting position, performing: and acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of moving parameters of the shooting device at the shooting position according to the number of rows or columns.
The movement parameters include: a horizontal movement tilt angle or a vertical movement tilt angle.
The formula for calculating the horizontal movement inclination angle of the lens is shown in formula (3):
Figure 56127DEST_PATH_IMAGE010
wherein,
Figure 674190DEST_PATH_IMAGE011
representing the inclination of the vertical movement,
Figure 882318DEST_PATH_IMAGE012
a vertical angle of view representing an upper edge angle of the lens-shot panorama (i.e. an edge vertical angle of view),
Figure 585831DEST_PATH_IMAGE013
a horizontal tilt angle parameter representing a current photographing position,
Figure 6449DEST_PATH_IMAGE014
representing the current shooting position in the lens scan
Figure 744597DEST_PATH_IMAGE016
And (6) rows.
The formula for calculating the vertical movement tilt angle of the lens is shown in formula (4):
Figure 123626DEST_PATH_IMAGE017
wherein,
Figure 314436DEST_PATH_IMAGE018
representing the inclination of the horizontal movement,
Figure 804323DEST_PATH_IMAGE019
a vertical field angle representing an upper edge angle of the shot panorama,
Figure 131399DEST_PATH_IMAGE020
is a horizontal angle of view (i.e. an edge horizontal angle of view) of an upper edge angle of the lens-shot panorama,
Figure 415750DEST_PATH_IMAGE021
representing the current shooting position in the lens scaniAnd (6) rows.
Namely, the movement parameters include: a horizontal movement tilt angle or a vertical movement tilt angle. Acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of rows or columns, wherein the method comprises the following steps: acquiring a plurality of edge vertical field angles and a plurality of edge horizontal field angles contained in photosensitive element parameters of the shooting equipment; for each shooting position, performing: and calculating a horizontal movement inclination angle or a vertical movement inclination angle of the shooting device at the current shooting position based on the plurality of edge vertical field angles and the plurality of edge horizontal field angles in combination with the number of rows or columns corresponding to the shooting position of the shooting device.
Further, the movement parameters further include corresponding focal length variation parameters.
The formula for calculating the focal length variation parameter is shown in formula (5):
Figure 93856DEST_PATH_IMAGE022
wherein,
Figure 387434DEST_PATH_IMAGE023
representing the focal length variation parameter of each line of lenses;
Figure 834596DEST_PATH_IMAGE024
represents the upper edge focal length parameter and,
Figure 289848DEST_PATH_IMAGE025
representing the lower edge focal length parameter. r represents the number of lines of the current shooting position. That is, the movement parameters further include corresponding focal length variation parameters; acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of rows or columns, wherein the method comprises the following steps: acquiring a plurality of edge focal length parameters of the shooting equipment; for each shooting position, performing: and calculating the focal length change parameter of the shooting device at the current shooting position based on the difference value of the edge focal length parameters and the number of lines of the shooting device at the current shooting position.
In an embodiment of the invention, computing is performed
Figure 189671DEST_PATH_IMAGE026
The modes of (a) can be respectively shown as formula (6), formula (7) and formula (8); wherein,
Figure 21361DEST_PATH_IMAGE027
a vertical field angle representing an upper edge angle of the lens-shot panorama,
Figure 588608DEST_PATH_IMAGE028
is a vertical field angle of a lower edge angle of the lens-photographed panorama,
Figure 214762DEST_PATH_IMAGE029
is full of lens shootingHorizontal field angle at the upper edge corner of the scene.
Figure 867460DEST_PATH_IMAGE030
Whereinw、hRepresenting the width and height of the lens sensitive element.f up Represents the upper edge focal length parameter and,f down representing a lower edge focal length parameter;arctanrepresenting the arctan function.
Step S102: and driving the shooting equipment to rotate to a plurality of shooting positions to shoot the set area according to the moving path and the moving parameters to obtain a plurality of local images.
Specifically, after a moving path and moving parameters of the shooting device are calculated, the shooting device is driven to rotate to a plurality of shooting positions to shoot the set area, and a plurality of partial images are obtained; in one embodiment of the present invention, driving the photographing apparatus to respective photographing positions is: the method comprises the steps of controlling and monitoring a camera lens to be aligned with the upper right edge angle of a set area, shooting and storing a local image after the camera is static, then driving a shooting device (such as a camera and the like) to horizontally move and scan, wherein the horizontal unit inclination angle of each movement is determined by the movement parameters of the lens, shooting and storing the local image after the camera is static, when the camera scans the edge of the whole area, vertically moving downwards to scan, the vertical unit inclination angle of each movement is determined by the movement parameters of the lens, and after the camera is static, reversely performing horizontal scanning to enable the moving track of the shooting device to be S-shaped until the whole area is completely scanned.
Step S103: and splicing the local images to obtain a panoramic image of the set area.
Preferably, after each local image is obtained by shooting, the acquired local image may be stored in an array, and the corresponding position of the image (for example, the number of rows, columns, and the like corresponding to the image) may be stored through the array, or the local images are shot and stored in sequence to record coordinate position information of the image in the panoramic image.
Further, the plurality of local images are spliced to obtain a panoramic image of the set area.
The method for obtaining the panoramic image comprises the following steps: and acquiring the number of rows and the number of columns corresponding to the shooting position of each local image, and sequentially splicing each local image to the corresponding number of rows and the corresponding number of columns in the panoramic image by utilizing the sequence corresponding to the plurality of shooting positions so as to process and obtain the panoramic image of the set area. Therefore, the positions of the local images are stored in the step, the local images are directly spliced into the panoramic image, and the accuracy and the efficiency of splicing the panoramic image are improved.
As shown in fig. 2, another flow of a method for processing an image according to an embodiment of the present invention may include the following steps:
step S201: acquiring a plurality of range parameters of a monitored set region; the set area is provided with rotatable shooting equipment for monitoring; based on a plurality of the range parameters and initial shooting parameters of the shooting device, a moving path and moving parameters of the shooting device for executing shooting are calculated.
Specifically, the description of calculating the moving path and the moving parameter of the shooting device to perform shooting based on the plurality of range parameters and the initial shooting parameters of the shooting device is consistent with the description of step S101, and is not repeated here.
Step S202: and driving the shooting equipment to shoot at a plurality of shooting positions in the set area according to the moving path and the moving parameters to obtain a plurality of partial images.
Specifically, the description about driving the photographing apparatus to perform photographing at a plurality of photographing positions in the setting area according to the moving path and the moving parameter is consistent with the description of step S102, and is not repeated herein.
Step S203: and correcting each local image by using a vignetting effect model, and performing splicing processing on the plurality of local images based on each corrected local image to obtain a panoramic image of the set area.
Specifically, in one embodiment of the present invention, each local image is corrected using a vignetting effect model before stitching into a panoramic image; that is, the stitching processing of the plurality of local images to obtain the panoramic image of the set area further includes: and correcting each local image by using a vignetting effect model, and performing splicing processing on the plurality of local images based on the corrected local images to obtain a panoramic image of the set area.
By correcting the vignetting effect of each local image, the spliced panoramic images can be more naturally attached to the joints, and the display effect of the panoramic images is improved. Preferably, the local image can be corrected by using the vignetting effect model after being shot, and then the local image is stored, so that the movement of the camera and the vignetting effect correction can be executed in parallel, and the efficiency of processing the image is improved.
An embodiment of the present invention provides an apparatus 300 for processing an image, which is used to implement the above method for processing an image. As shown in the schematic block diagram of fig. 3, an apparatus 300 for processing an image includes: a shooting parameter calculating module 301, a local image obtaining module 302 and a local image splicing module 303; wherein,
the shooting parameter calculating module 301 is configured to obtain a plurality of range parameters of a monitored set area; the set area is provided with rotatable shooting equipment for monitoring; calculating a moving path and moving parameters of the photographing apparatus to perform photographing based on a plurality of the range parameters and initial photographing parameters of the photographing apparatus
The local image obtaining module 302 is configured to drive the shooting device to perform shooting at multiple shooting positions in the set area according to the moving path and the moving parameter, so as to obtain multiple local images;
the local image stitching module 303 is configured to stitch the plurality of local images to obtain a panoramic image of the set area.
In the embodiment, the moving path and the moving parameters of the shooting device for shooting the set area can be calculated, so that the shooting device is driven to rotate to a plurality of shooting positions to shoot the monitored set area, and a plurality of local images are obtained; and further splicing the local images to obtain a panoramic image of a set area. The embodiment of the invention can monitor the whole range of the set area, and overcomes the problem that the fixed-point image acquisition image is incomplete; by calculating the moving path and the moving parameters of the shooting equipment for shooting, the problem that the image quality is influenced by factors such as scene shaking is solved, and the image processing efficiency is improved; and through the comprehensive monitoring to setting for the region, improved the accuracy of panoramic picture show data to a great extent.
An exemplary embodiment of the present invention also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the invention.
Exemplary embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is operable to cause the computer to perform a method according to an embodiment of the present invention.
Exemplary embodiments of the present invention also provide a computer program product comprising a computer program, wherein the computer program is operative, when executed by a processor of a computer, to cause the computer to perform a method according to an embodiment of the present invention.
Referring to fig. 4, a block diagram of a structure of an electronic device 400 that can be the present invention, which is an example of a hardware device that can be applied to aspects of the present invention, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as data center servers, notebook computers, thin clients, laptop computers, desktop computers, workstations, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in the electronic device 400 are connected to the I/O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 may be any type of device capable of inputting information to the electronic device 400, and the input unit 406 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. Output unit 407 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 408 may include, but is not limited to, magnetic or optical disks. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 401 executes the respective methods and processes described above. For example, in some embodiments, the above-described method of processing an image may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM 402 and/or the communication unit 409. In some embodiments, the computing unit 401 may be configured in any other suitable way (e.g., by means of firmware) as the method of processing images described above.
Program code for implementing the methods of the present invention may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (10)

1. A method of processing an image, the method comprising:
acquiring a plurality of range parameters of a monitored set region; the set area is provided with rotatable shooting equipment for monitoring;
calculating a moving path and moving parameters of the photographing apparatus to perform photographing based on a plurality of the range parameters and initial photographing parameters of the photographing apparatus;
driving the shooting equipment to rotate to a plurality of shooting positions to shoot the set area according to the moving path and the moving parameters to obtain a plurality of local images;
and splicing the local images to obtain a panoramic image of the set area.
2. The method of claim 1,
determining initial shooting parameters of the shooting device, including:
determining a plurality of initial shooting positions based on a plurality of range parameters of the set area, driving the shooting device to respectively rotate to the plurality of initial shooting positions, and determining initial shooting parameters of the shooting device corresponding to the initial shooting positions;
the initial shooting parameters comprise one or more of shooting angle parameters, focal length parameters and photosensitive element parameters corresponding to a plurality of initial shooting positions.
3. The method of claim 1,
the calculating a moving path and a moving parameter of the photographing apparatus to perform photographing based on the plurality of range parameters and the initial photographing parameter of the photographing apparatus includes:
calculating a panoramic range of the set area based on a plurality of range parameters;
calculating the number of rows and columns of the local images shot by the shooting equipment to be moved when the local images shot by the shooting equipment cover the panoramic range based on the initial shooting parameters of the shooting equipment;
determining the moving path based on the row number and the column number; and calculating a movement parameter of the photographing apparatus at each photographing position.
4. The method of claim 1,
the calculating the moving parameters of the shooting device at each shooting position comprises the following steps:
for each shooting position, performing:
and acquiring the number of rows or columns of the current shooting position of the shooting device, and calculating a plurality of moving parameters of the shooting device at the shooting position according to the number of rows or columns.
5. The method of claim 4,
the movement parameters include: a horizontal movement inclination angle or a vertical movement inclination angle;
acquiring the number of lines or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of lines or columns, wherein the method comprises the following steps:
acquiring a plurality of edge vertical field angles and a plurality of edge horizontal field angles contained in photosensitive element parameters of the shooting equipment;
for each shooting position, performing: and calculating a horizontal movement inclination angle or a vertical movement inclination angle of the shooting device at the current shooting position based on the plurality of edge vertical field angles and the plurality of edge horizontal field angles in combination with the number of rows or columns corresponding to the shooting position of the shooting device.
6. The method of claim 4,
the movement parameters also comprise corresponding focal length change parameters;
acquiring the number of lines or columns of the current shooting position of the shooting device, and calculating a plurality of movement parameters of the shooting device at the shooting position according to the number of lines or columns, wherein the method comprises the following steps:
acquiring a plurality of edge focal length parameters of the shooting equipment;
for each shooting position, performing: and calculating the focal length change parameter of the shooting device at the current shooting position based on the difference value of the edge focal length parameters and the number of lines of the shooting device at the current shooting position.
7. The method of claim 1,
the obtaining of the panoramic image of the set area by stitching the plurality of local images includes:
and acquiring the number of rows and the number of columns corresponding to the shooting position of each local image, and sequentially splicing each local image to the corresponding number of rows and the corresponding number of columns in the panoramic image by utilizing the sequence corresponding to the plurality of shooting positions so as to process and obtain the panoramic image of the set area.
8. The method of claim 7,
the stitching processing of the plurality of local images to obtain the panoramic image of the set area further includes:
and correcting each local image by using a vignetting effect model, and performing splicing processing on the plurality of local images based on the corrected local images to obtain a panoramic image of the set area.
9. An apparatus for processing an image, the apparatus comprising: the device comprises a shooting parameter calculating module, a local image obtaining module and a local image splicing module; wherein,
the shooting parameter calculating module is used for acquiring a plurality of range parameters of the monitored set area; the set area is provided with rotatable shooting equipment for monitoring; calculating a moving path and moving parameters of the photographing apparatus to perform photographing based on a plurality of the range parameters and initial photographing parameters of the photographing apparatus
The local image acquisition module is used for driving the shooting equipment to execute shooting at a plurality of shooting positions in the set area according to the moving path and the moving parameters to obtain a plurality of local images;
and the local image splicing module is used for splicing the plurality of local images to obtain a panoramic image of the set area.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
CN202211458944.4A 2022-11-18 2022-11-18 Method and device for processing image Active CN115514897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211458944.4A CN115514897B (en) 2022-11-18 2022-11-18 Method and device for processing image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211458944.4A CN115514897B (en) 2022-11-18 2022-11-18 Method and device for processing image

Publications (2)

Publication Number Publication Date
CN115514897A true CN115514897A (en) 2022-12-23
CN115514897B CN115514897B (en) 2023-04-07

Family

ID=84513575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211458944.4A Active CN115514897B (en) 2022-11-18 2022-11-18 Method and device for processing image

Country Status (1)

Country Link
CN (1) CN115514897B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117168344A (en) * 2023-11-03 2023-12-05 杭州鲁尔物联科技有限公司 Monocular panorama looking around deformation monitoring method and device and computer equipment
CN117537735A (en) * 2023-10-20 2024-02-09 中国中建设计研究院有限公司 Measurement method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108871288A (en) * 2018-06-01 2018-11-23 广州中科云图智能科技有限公司 A kind of band-like inclination image airborne survey method of unmanned plane and system
CN109741257A (en) * 2018-12-25 2019-05-10 鸿视线科技(北京)有限公司 Panorama sketch automatically shoots, splicing system and method
CN110036411A (en) * 2019-02-27 2019-07-19 香港应用科技研究院有限公司 The device and method for generating electronics three-dimensional range environment
CN111107269A (en) * 2019-12-31 2020-05-05 维沃移动通信有限公司 Photographing method, electronic device and storage medium
WO2022032538A1 (en) * 2020-08-12 2022-02-17 深圳市大疆创新科技有限公司 Panorama photographing method, apparatus and system, and computer-readable storage medium
CN114071024A (en) * 2021-11-26 2022-02-18 北京百度网讯科技有限公司 Image shooting method, neural network training method, device, equipment and medium
CN114972027A (en) * 2022-05-26 2022-08-30 无锡日联科技股份有限公司 Image splicing method, device, equipment, medium and computer product

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108871288A (en) * 2018-06-01 2018-11-23 广州中科云图智能科技有限公司 A kind of band-like inclination image airborne survey method of unmanned plane and system
CN109741257A (en) * 2018-12-25 2019-05-10 鸿视线科技(北京)有限公司 Panorama sketch automatically shoots, splicing system and method
CN110036411A (en) * 2019-02-27 2019-07-19 香港应用科技研究院有限公司 The device and method for generating electronics three-dimensional range environment
CN111107269A (en) * 2019-12-31 2020-05-05 维沃移动通信有限公司 Photographing method, electronic device and storage medium
WO2022032538A1 (en) * 2020-08-12 2022-02-17 深圳市大疆创新科技有限公司 Panorama photographing method, apparatus and system, and computer-readable storage medium
CN114071024A (en) * 2021-11-26 2022-02-18 北京百度网讯科技有限公司 Image shooting method, neural network training method, device, equipment and medium
CN114972027A (en) * 2022-05-26 2022-08-30 无锡日联科技股份有限公司 Image splicing method, device, equipment, medium and computer product

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117537735A (en) * 2023-10-20 2024-02-09 中国中建设计研究院有限公司 Measurement method and device
CN117537735B (en) * 2023-10-20 2024-04-30 中国中建设计研究院有限公司 Measurement method and device
CN117168344A (en) * 2023-11-03 2023-12-05 杭州鲁尔物联科技有限公司 Monocular panorama looking around deformation monitoring method and device and computer equipment
CN117168344B (en) * 2023-11-03 2024-01-26 杭州鲁尔物联科技有限公司 Monocular panorama looking around deformation monitoring method and device and computer equipment

Also Published As

Publication number Publication date
CN115514897B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN115514897B (en) Method and device for processing image
US10122997B1 (en) Automated matrix photo framing using range camera input
US10200613B2 (en) Video stabilization for mobile devices
US10083365B2 (en) Optical reading of external segmented display
US9615040B2 (en) Determining a maximum inscribed size of a rectangle
CN110139040B (en) Pan-tilt camera positioning method and device, pan-tilt camera, equipment and medium
CN110493514B (en) Image processing method, storage medium, and electronic device
EP3998576A2 (en) Image stitching method and apparatus, device, and medium
CN112954212B (en) Video generation method, device and equipment
CN112738397A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN114785961B (en) Patrol route generation method, device and medium based on holder camera
CN112437231A (en) Image shooting method and device, electronic equipment and storage medium
US8774556B2 (en) Perspective correction using a reflection
CN109587572B (en) Method and device for displaying product, storage medium and electronic equipment
CN117057996A (en) Photovoltaic panel image processing method, device, equipment and medium
JP2021118522A (en) Image processing device, image processing method, and monitoring system
CN110830705A (en) Robot photographing method, robot, terminal device and storage medium
CN115499596B (en) Method and device for processing image
CN113128246B (en) Information processing method and device and electronic equipment
CN112422827B (en) Information processing method, device and equipment and storage medium
CN115278053B (en) Image shooting method and electronic equipment
CN116433769B (en) Space calibration method, device, electronic equipment and storage medium
CN115278184B (en) Projection picture correction method and device
CN112950772B (en) Method and system for extracting orthographic image
CN117036499A (en) Calibration data generation method and device, electronic 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
GR01 Patent grant
GR01 Patent grant