CN115311360A - Method and device for acquiring pose of target camera in circular shooting and electronic equipment - Google Patents

Method and device for acquiring pose of target camera in circular shooting and electronic equipment Download PDF

Info

Publication number
CN115311360A
CN115311360A CN202210841406.7A CN202210841406A CN115311360A CN 115311360 A CN115311360 A CN 115311360A CN 202210841406 A CN202210841406 A CN 202210841406A CN 115311360 A CN115311360 A CN 115311360A
Authority
CN
China
Prior art keywords
camera
target
shooting
ring
target camera
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
CN202210841406.7A
Other languages
Chinese (zh)
Other versions
CN115311360B (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 Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information 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 Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN202210841406.7A priority Critical patent/CN115311360B/en
Publication of CN115311360A publication Critical patent/CN115311360A/en
Application granted granted Critical
Publication of CN115311360B publication Critical patent/CN115311360B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration

Landscapes

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

Abstract

The application provides a method and a device for acquiring the pose of a target camera in a circular shooting and electronic equipment. The method comprises the following steps: acquiring a plurality of ring-shot images of a target object and camera poses corresponding to the plurality of ring-shot images; obtaining a shooting central point of the target object in a world coordinate system according to the camera pose and the multiple ring shooting images; acquiring a target distance between a target camera and the shooting central point; the target camera is a camera for shooting the plurality of ring-shot images; acquiring a target camera correction height of the target camera when the target camera shoots the ring-shot image; determining the rotation angle of the target camera according to the number of preset shooting positions; and acquiring the pose of the target camera according to the target distance, the correction height of the target camera and the rotation angle. According to the method and the device, the ideal camera pose of the target camera can be obtained, and the construction effect of the 3D appearance image of the object can be greatly improved.

Description

Method and device for acquiring pose of target camera in circular shooting and electronic equipment
Technical Field
The application relates to the technical field of computers, in particular to a method and a device for acquiring pose of a target camera in a circular shooting and electronic equipment.
Background
In some web site platforms (such as used car web site, used article web site, etc.), it is usually necessary to show 360 degree full view of the articles. In order to show a 360-degree overview of an article, the conventional method records a 360-degree video of the article by circling the article. The video recording mode occupies a large memory, and the loading speed at the user end is very slow, so that the user cannot smoothly switch the observation angle.
To solve the above problem, a series of images are taken around the object using a camera, and the center and height of the object on the images are aligned to construct a stable 360-degree 3D appearance of the object. In order to align the centers and heights of the objects on the images, an ideal camera pose needs to be acquired, and how to acquire the ideal camera pose is a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring a pose of a target camera in a circular shooting and electronic equipment, so as to acquire an ideal camera pose and improve the construction effect of the 3D appearance of an object. The specific implementation scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for acquiring a pose of a target camera in a loop shooting, including:
acquiring a plurality of annularly shot images of a target object and camera poses corresponding to the plurality of annularly shot images;
obtaining a shooting central point of the target object in a world coordinate system according to the camera pose and the multiple ring shooting images;
acquiring a target distance between a target camera and the shooting central point; the target camera is a camera for shooting the plurality of ring-shot images;
acquiring a target camera correction height when the target camera shoots the ring-shooting image;
determining the rotation angle of the target camera according to the preset position number of the shooting positions;
and acquiring the pose of the target camera according to the target distance, the correction height of the target camera and the rotation angle.
Optionally, acquiring camera poses corresponding to the multiple ring-shot images includes:
performing sparse reconstruction on the multiple annularly shot images to obtain a reconstruction result;
and determining the camera poses corresponding to the multiple ring-shot images according to the reconstruction result.
Optionally, the acquiring a target distance between the target camera and the shooting central point includes:
acquiring a camera shooting position corresponding to each ring shooting image;
acquiring initial distances between a plurality of camera shooting positions and the shooting central point;
and acquiring the minimum initial distance in the plurality of initial distances, and taking the minimum initial distance as the target distance.
Optionally, the obtaining of the target camera correction height of the target camera when shooting the ring-shooting image includes:
acquiring gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when shooting each ring-shot image;
correcting the height of a camera corresponding to each ring-shot image according to the gravity field data corresponding to the ring-shot image to obtain a camera correction height;
calculating an average height of the plurality of camera corrected heights, and taking the average height as the target camera corrected height.
Optionally, the determining the rotation angle of the target camera according to the preset number of positions of the shooting positions includes:
and calculating the ratio of 360 degrees to the number of the positions, and taking the ratio as the rotation angle of the target camera.
Optionally, the determining the target camera pose of the target camera according to the target distance, the target camera corrected height and the rotation angle includes:
determining the three-dimensional coordinates of the target camera according to the corrected height, the rotation angle and the target distance of the target camera;
and generating a target camera pose of the target camera according to the three-dimensional coordinates.
In a second aspect, an embodiment of the present application provides an apparatus for acquiring a pose of a target camera in a circular shooting, including:
the system comprises a ring-shooting image acquisition module, a ring-shooting image acquisition module and a control module, wherein the ring-shooting image acquisition module is used for acquiring a plurality of ring-shooting images of a target object and camera poses corresponding to the plurality of ring-shooting images;
the shooting central point acquisition module is used for acquiring a shooting central point of the target object in a world coordinate system according to the camera pose and the multiple ring shooting images;
the target distance acquisition module is used for acquiring a target distance between a target camera and the shooting central point; the target camera is a camera for shooting the plurality of ring-shooting images;
the camera correction height acquisition module is used for acquiring the correction height of the target camera when the target camera shoots the ring-shot image;
the rotation angle determining module is used for determining the rotation angle of the target camera according to the position number of preset shooting positions;
and the target camera pose acquisition module is used for acquiring the target camera pose of the target camera according to the target distance, the target camera correction height and the rotation angle.
Optionally, the ring-shooting image obtaining module includes:
the reconstruction result acquisition unit is used for performing sparse reconstruction on the plurality of annularly shot images to obtain a reconstruction result;
and the camera pose determining unit is used for determining the camera poses corresponding to the multiple annularly shot images according to the reconstruction result.
Optionally, the target distance obtaining module includes:
the camera shooting position acquisition unit is used for acquiring a camera shooting position corresponding to each ring shooting image;
an initial distance acquisition unit configured to acquire initial distances between a plurality of the camera shooting positions and the shooting center point;
and the target distance acquisition unit is used for acquiring the minimum initial distance in the plurality of initial distances and taking the minimum initial distance as the target distance.
Optionally, the camera calibration height acquisition module includes:
the camera height acquisition unit is used for acquiring gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when each ring-shot image is shot;
the camera correction height acquisition unit is used for correcting the camera height corresponding to the ring-shot image according to the gravity field data corresponding to each ring-shot image to obtain the camera correction height;
a camera corrected height acquisition unit for calculating an average height of the plurality of camera corrected heights, taking the average height as the target camera corrected height.
Optionally, the rotation angle determining module comprises:
and the rotation angle acquisition unit is used for calculating the ratio of 360 degrees to the number of the positions and taking the ratio as the rotation angle of the target camera.
Optionally, the object camera pose acquisition module includes:
a three-dimensional coordinate determination unit for determining a three-dimensional coordinate of the target camera according to the target camera calibration height, the rotation angle, and the target distance;
and the target camera pose generation unit is used for generating the target camera pose of the target camera according to the three-dimensional coordinates.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of the target camera pose determination method of any one of the above.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the target camera pose determination method described in any one of the above.
According to the scheme provided by the embodiment of the application, the shooting central point of the target object in the world coordinate system is obtained according to the camera pose and the multiple ring shooting images by acquiring the multiple ring shooting images of the target object and the camera poses corresponding to the multiple ring shooting images, the target distance between the target camera and the shooting central point is acquired, the target camera is a camera for shooting the multiple ring shooting images, the correction height of the target camera when the target camera shoots the ring shooting images is acquired, the rotation angle of the target camera is determined according to the preset position number of the shooting positions, and the target camera pose of the target camera is acquired according to the target distance, the correction height of the target camera and the rotation angle. According to the method and the device, the ideal camera pose of the target camera can be obtained by combining the target distance between the camera and the shooting central point, the correction height of the target camera and the camera rotation angle, the 3D appearance image of the object is constructed according to the ideal camera pose, and the construction effect of the 3D appearance image of the object can be greatly improved.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for obtaining a pose of a target camera in a circular shooting according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating steps of a method for determining a pose of a camera according to an embodiment of the present application;
fig. 3 is a flowchart illustrating steps of a method for obtaining a target distance according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating steps of a method for obtaining a corrected height of a target camera according to an embodiment of the present disclosure;
fig. 5 is a flowchart illustrating steps of a method for generating a pose of a target camera according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a device for acquiring a pose of a target camera in a circular shooting according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, which is a flowchart illustrating steps of a method for acquiring a pose of a target camera in a loop shot provided by an embodiment of the present application, as shown in fig. 1, the method for acquiring the pose of the target camera in the loop shot may include: step 101, step 102, step 103, step 104, step 105 and step 106.
Step 101: and acquiring a plurality of annularly shot images of the target object and camera poses corresponding to the plurality of annularly shot images.
The method and the device for finding the central point of the target object in the world coordinate system can be applied to a scene in which the central point of the target object in the world coordinate system is found by combining the viewing cone regions corresponding to the multiple annularly shot images.
The target object refers to an object to be found at a central point in the world coordinate system, and in this example, the target object may be an object such as a vehicle, an exhibit (e.g., an antique, a vessel, etc.), and specifically, a specific type of the target object may be determined according to a business requirement, which is not limited in this embodiment.
The multiple ring-shot images are images obtained by shooting the target object around the target object for one circle, in this example, an overlapped image region exists between two adjacent ring-shot images in the multiple ring-shot images, that is, any two adjacent images in the multiple ring-shot images are overlapped images.
When a ring-shot image of a target object is captured, the following three-point capturing requirements should be noted:
1. when a ring shot image is shot, the image cannot be too close to a target object; when the distance is too close, the proportion of the target object on the image is large, and when the ring-shot image is cut, a black edge phenomenon can occur.
2. In the shooting process, the target object should be as close to the center of the image as possible; if the target object deviates from the center of the image seriously, after the homography transformation is carried out on the image and the center of the target object on the image is aligned, the overlapped parts of all the images are possibly very small, so that a black edge appears after the ring-shot image is cut;
3. the taken ring-shot image should be as clear as possible.
When constructing a 3D appearance image of a target object, the target object may be image-captured around the target object to obtain a plurality of ring-captured images of the target object.
After obtaining the plurality of ring-shot images of the target object, a camera pose of the target camera may be determined from the plurality of ring-shot images. The target camera is a camera for shooting a plurality of images shot in a circle. In this example, the target camera may be a digital camera, or a camera application installed in a cellular phone, or the like.
In a specific implementation, after a plurality of circular images of the target object are obtained through shooting, the camera pose may be obtained in a sparse reconstruction manner, and specifically, the following detailed description may be made in conjunction with fig. 2.
Referring to fig. 2, a flowchart illustrating steps of a camera pose determination method provided in an embodiment of the present application is shown, and as shown in fig. 2, the camera pose determination method may include: step 201 and step 202.
Step 201: and performing sparse reconstruction on the plurality of annularly shot images to obtain a reconstruction result.
In this embodiment, after the multiple ring-shot images of the target object are acquired, sparse reconstruction may be performed on the multiple ring-shot images to obtain a reconstruction result.
In practical applications, the sparse reconstruction method may be: open source slam algorithms such as orb-slam, openslam, etc. Or colomap for sparse reconstruction.
After sparse reconstruction is performed on the multiple ring-shot images to obtain a reconstruction result, step 202 is performed.
Step 202: and determining the camera poses corresponding to the multiple ring-shot images according to the reconstruction result.
After the multiple annularly shot images are subjected to sparse reconstruction to obtain a reconstruction result, the camera poses corresponding to the multiple annularly shot images can be determined according to the reconstruction result.
It can be understood that the above sparse reconstruction method is a sparse reconstruction method commonly used in the prior art, and this example is not repeated for this implementation process.
After the multiple ring-shooting images of the target object and the camera poses corresponding to the multiple ring-shooting images are acquired, step 102 is executed.
Step 102: and obtaining a shooting central point of the target object in a world coordinate system according to the camera pose and the multiple ring shooting images.
After the multiple ring-shooting images and the camera pose are obtained, the shooting central point of the target object in the world coordinate system can be obtained according to the camera pose and the multiple ring-shooting images. Specifically, the shooting center point of the target object in the world coordinate system may be acquired in the following manner.
In a specific implementation manner of the present application, a central point of a target object in a world coordinate system may be obtained according to a common region of viewing cone regions corresponding to a plurality of annularly shot images, and specifically, the method may include the following steps:
1. and acquiring a viewing cone region corresponding to the multiple annularly shot images according to the multiple annularly shot images and the camera poses.
In this example, position information of the target object in the plurality of ring-shot images may be acquired, and a viewing cone region of the target object in the world coordinate system in the plurality of ring-shot images may be acquired according to the position information and the camera pose. Specifically, shooting point coordinates corresponding to the multiple ring-shooting images can be acquired, position information of the target object in the image coordinate system is converted according to the camera pose, target position information of the target object in the world coordinate system is obtained, and then a view cone region of the target object in the multiple ring-shooting images in the world coordinate system is determined according to the shooting point coordinates and the target position information. Specifically, the viewing cone region is composed of five points and four lines, the coordinates of the shooting points can be used as the vertex coordinates of the viewing cone region, and the four vertex coordinates of the target object in the world coordinate system are respectively connected with the coordinates of the shooting points to form the viewing cone region.
2. And acquiring a central point of the target object in a world coordinate system according to the plurality of viewing cone regions.
After the view cone regions corresponding to the plurality of ring-shot images are obtained, a common region of the plurality of view cone regions may be calculated, and a central point of the common region may be used as a central point of the target object in the world coordinate system.
In another specific implementation manner of the present application, a central point of the target object in the world coordinate system may be obtained by means of point projection, and specifically, the following steps may be included:
1. a real target object can be used as an origin, a set distance (such as 5 meters) and the like are expanded outwards to form a spherical space with the target object as the origin, and a plurality of points are uniformly dispersed in the spherical space;
2. projecting the diffused points in the spherical space to a plurality of ring-shot images;
3. and acquiring a common point in a region corresponding to the target object projected on the plurality of ring-shot images, wherein the region corresponding to the common point can be used as a common region, and further calculating a central point of the common region to be used as a central point of the target object in a world coordinate system.
It can be understood that the two specific implementation manners are only two acquisition manners of the shooting center point listed for better understanding of the technical solution of the embodiment of the present application, and in a specific implementation, the shooting center point of the target object in the world coordinate system may also be acquired in other manners, and specifically, the present embodiment may be determined according to business requirements, which is not limited in this embodiment.
After a shooting central point of the target object in the world coordinate system is obtained according to the camera pose and the multiple ring shooting images, step 103, step 104 and step 105 are executed.
Step 103: acquiring a target distance between a target camera and the shooting central point; the target camera is a camera for shooting the plurality of annularly shot images.
The target camera refers to a camera that takes a plurality of images taken in a loop, and in this example, the target camera may be a digital camera, a camera application provided in an electronic device (such as a mobile phone, a tablet computer, and the like), or the like.
After acquiring the photographing central point of the target object within the world coordinate system, a target distance between the target camera and the photographing central point may be acquired. Specifically, the minimum distance between the shooting position of the target camera and the shooting center point may be acquired as the target distance between the target camera and the shooting center point, and the implementation process may be described in detail as follows in conjunction with fig. 3.
Referring to fig. 3, a flowchart illustrating steps of a target distance obtaining method provided in an embodiment of the present application is shown, and as shown in fig. 3, the target distance obtaining method may include: step 301, step 302 and step 303.
Step 301: and acquiring a camera shooting position corresponding to each ring shooting image.
In the present embodiment, the camera shooting position refers to a position where the subject camera is located when shooting each of the ring-shot images.
When the target object is photographed with the ring-shot images, a camera photographing position corresponding to each ring-shot image may be acquired.
After the camera shooting position corresponding to each ring-shot image is acquired, step 302 is executed.
Step 302: acquiring initial distances between a plurality of camera shooting positions and the shooting central point.
The initial distance refers to a distance between a camera photographing position and a photographing center point.
After the camera shooting position corresponding to each ring-shot image is acquired, the initial distances between the plurality of camera shooting positions and the shooting center point can be acquired.
After acquiring the initial distances between the plurality of camera shooting positions and the shooting center point, step 303 is performed.
Step 303: and acquiring the minimum initial distance in the plurality of initial distances, and taking the minimum initial distance as the target distance.
After the initial distances between the plurality of camera photographing positions and the photographing center point are acquired, a minimum initial distance among the plurality of initial distances may be acquired and taken as a target distance between the target camera and the photographing center point.
Step 104: and acquiring the correction height of the target camera when the target camera shoots the ring-shot image.
The target camera correction height refers to an average camera height of the target camera when taking a loop-taking image.
When a plurality of loop-shot images of a target object are taken with a target camera, a target camera correction height of the target camera when taking the loop-shot images can be acquired. Specifically, the height at which the subject camera takes each of the loop-taken images may be acquired, and then the average of the plurality of heights may be calculated to obtain the subject camera corrected height. This implementation can be described in detail below in conjunction with fig. 4.
Referring to fig. 4, a flowchart illustrating steps of a target camera corrected height acquiring method provided in an embodiment of the present application is shown, and as shown in fig. 4, the target camera corrected height acquiring method may include: step 401, step 402 and step 403.
Step 401: and acquiring gravity field data corresponding to the plurality of ring-shot images and the camera height of the target camera when shooting each ring-shot image.
In this embodiment, the gravity field data refers to data of a gravity direction of the subject camera when the subject camera takes a plurality of loop-captured images.
The camera height refers to the height of the subject camera at the time each loop image is taken.
When the target camera is used for shooting the ring-shot image of the target object, the gravity field data of the target camera when multiple ring-shot images are shot can be acquired, and the height of the target camera when each ring-shot image is shot, namely the height of the camera, is recorded.
After acquiring the gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when shooting each ring-shot image, step 402 is executed.
Step 402: and correcting the height of the camera corresponding to the ring-shot image according to the gravity field data corresponding to each ring-shot image to obtain the corrected height of the camera.
After acquiring the gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when shooting each ring-shot image, the camera height corresponding to the ring-shot image can be corrected according to the gravity field data corresponding to each ring-shot image to obtain the camera correction height. Specifically, because there are phenomena such as shake in the process of shooting the ring-shot image, in the above scheme, after sparse reconstruction is performed on the ring-shot image, the y-axis is not perpendicular to the ground, and at this time, the pose of the camera needs to be corrected, and the specific correction process is as follows:
1. obtaining R and t of the camera according to the sparse reconstruction result, wherein R is a translation matrix, and t is a rotation matrix;
2. after obtaining the gravity field data corresponding to each ring-shot image and the R and t of the camera, the direction of the gravity field of the target camera can be converted into a world coordinate system through the R and t;
3. after conversion, the y axis of the world coordinate system can be rotated to the direction same as that of the gravity field, correction is completed at the moment, the pose of the correction camera can be obtained, and the camera correction height of the target camera can be obtained at the moment.
Step 402: calculating an average height of the plurality of camera corrected heights, and taking the average height as the target camera corrected height.
After the multiple camera correction heights corresponding to the target camera are acquired, an average height of the multiple camera correction heights may be calculated, and then the average height may be used as the target camera correction height.
Step 105: and determining the rotation angle of the target camera according to the preset position number of the shooting positions.
The rotation angle refers to an angle at which the subject camera rotates when two adjacent loop images are taken.
The number of positions refers to the number of preset shooting positions for shooting the ring-shot image of the target object, in this example, the number of positions may be 10, 20, and the like, specifically, the specific number of positions may be determined according to business requirements, which is not limited in this embodiment.
In specific implementation, the number of positions of shooting positions when the target camera shoots the ring-shot image can be preset, and then the rotating angle of the target camera can be determined according to the number of the positions. Specifically, a ratio between 360 ° and the number of positions may be calculated, and the ratio may be taken as the rotation angle of the subject camera. For example, if the set number of positions is 50, the rotation angle =360 °/50=7.2 ° or the like.
Step 106: and acquiring the pose of the target camera according to the target distance, the correction height of the target camera and the rotation angle.
After the target distance, the corrected height of the target camera and the rotation angle are obtained through the steps, the camera pose of the target camera can be obtained according to the target distance, the corrected height of the target camera and the rotation angle. Specifically, the corrected height of the target camera can be used as a y-axis coordinate of the target camera, an x-axis coordinate and a z-axis coordinate of an ideal pose of the target camera are calculated according to the target distance, the rotation angle and the y-axis coordinate, and then the pose of the target camera is determined according to the x-axis coordinate, the y-axis coordinate and the z-axis coordinate. This implementation can be described in detail below in conjunction with fig. 5.
Referring to fig. 5, a flowchart illustrating steps of a method for generating a pose of a target camera according to an embodiment of the present application is shown, where as shown in fig. 5, the method for generating a pose of a target camera may include: step 501 and step 502.
Step 501: and determining the three-dimensional coordinates of the target camera according to the corrected height, the rotation angle and the target distance of the target camera.
In this embodiment, after the corrected height, the rotation angle, and the target distance of the target camera are obtained, the corrected height of the target camera is the y-axis coordinate of the target camera, and then the x-axis coordinate and the z-axis coordinate of the target camera can be calculated by combining the rotation angle and the target distance according to the pythagorean theorem, so that the x-axis coordinate, the y-axis coordinate, and the z-axis coordinate can be used as the three-dimensional coordinate of the target camera in the world coordinate system.
After determining the three-dimensional coordinates of the target camera according to the corrected height, the rotation angle, and the target distance of the target camera, step 502 is performed.
Step 502: and generating the target camera pose of the target camera according to the three-dimensional coordinates.
After the three-dimensional coordinates of the target camera are determined according to the corrected height, the rotation angle and the target distance of the target camera, the pose of the target camera can be generated according to the three-dimensional coordinates. Specifically, a rotation matrix t can be obtained according to the obtained x-axis coordinate, y-axis coordinate and z-axis coordinate, and then the direction from the x-axis coordinate, the y-axis coordinate and the z-axis coordinate to the coordinate origin is used as the direction of the optical axis of the camera, that is, the translation matrix R can be determined. And the rotation matrix t and the translation matrix R are the pose of the target camera.
According to the method and the device, the ideal camera pose of the target camera can be obtained by combining the target distance between the camera and the shooting central point, the correction height of the target camera and the camera rotation angle, the 3D appearance image of the object is constructed according to the ideal camera pose, and the construction effect of the 3D appearance image of the object can be greatly improved.
After the target camera pose (i.e., the ideal camera pose) is generated, the 3D appearance image of the object can be constructed according to the target camera pose, and the specific implementation process includes the following steps:
carrying out homography transformation on the image: after the ideal camera pose is obtained, homography transformation processing can be carried out on the ring-shot image according to the corrected camera pose and the ideal camera pose, and homography transformation is carried out on the ring-shot image.
After homography transformation is performed on all the ring-shot images, a mask (mask) of each transformed image can be acquired, and the mask of each image is subjected to bilateral symmetry first and then to up-and-down symmetry. Since the 3D center of the object is projected to the center of the image, when the image is cut, the image is vertically symmetrical and horizontally symmetrical around the center, and mask1 is obtained. On the image, calculating an intersection point A of a connecting line of the center and the upper left corner and the edge of the processed mask, wherein the transverse distance and the longitudinal distance from the intersection point A to the center are 1/2 of the length and the width of a rectangle cut on the image. And cutting the image on each transformed ring shot image to obtain a final cutting result, namely outputting a 3D appearance image of the object.
And then, performing post-processing on the output object 3D appearance image, such as background replacement, text addition, and privacy information erasure, to generate a final displayed object 3D appearance image.
According to the method for acquiring the pose of the target camera in the ring shooting, the shooting central point of the target object in the world coordinate system is acquired according to the multiple ring shooting images of the target object and the camera poses corresponding to the multiple ring shooting images, the target distance between the target camera and the shooting central point is acquired, the target camera is a camera for shooting the multiple ring shooting images, the correction height of the target camera when the target camera shoots the ring shooting images is acquired, the rotation angle of the target camera is determined according to the preset position number of the shooting positions, and the pose of the target camera is acquired according to the target distance, the correction height of the target camera and the rotation angle. According to the method and the device, the ideal camera pose of the target camera can be obtained by combining the target distance between the camera and the shooting central point, the correction height of the target camera and the camera rotation angle, the 3D appearance image of the object is constructed according to the ideal camera pose, and the construction effect of the 3D appearance image of the object can be greatly improved.
Referring to fig. 6, a schematic structural diagram of an apparatus for acquiring a pose of a target camera in a loop shot according to an embodiment of the present disclosure is shown, and as shown in fig. 6, the apparatus 600 for acquiring a pose of a target camera in a loop shot may include the following modules:
a ring-shooting image obtaining module 610, configured to obtain a plurality of ring-shooting images of a target object and camera poses corresponding to the plurality of ring-shooting images;
a shooting center point obtaining module 620, configured to obtain a shooting center point of the target object in a world coordinate system according to the camera pose and the multiple ring-shot images;
a target distance obtaining module 630, configured to obtain a target distance between a target camera and the shooting center point; the target camera is a camera for shooting the plurality of ring-shooting images;
a camera corrected height acquiring module 640, configured to acquire a target camera corrected height of the target camera when the target camera takes the ring-shot image;
a rotation angle determining module 650 for determining a rotation angle of the target camera according to the number of preset shooting positions;
a target camera pose acquisition module 660, configured to acquire the target camera pose of the target camera according to the target distance, the target camera calibration height, and the rotation angle.
Optionally, the ring-shooting image obtaining module 610 includes:
the reconstruction result acquisition unit is used for performing sparse reconstruction on the plurality of annularly shot images to obtain a reconstruction result;
and the camera pose determining unit is used for determining the camera poses corresponding to the multiple ring-shooting images according to the reconstruction result.
Optionally, the target distance obtaining module 630 includes:
the camera shooting position acquisition unit is used for acquiring a camera shooting position corresponding to each ring shooting image;
an initial distance acquisition unit configured to acquire initial distances between a plurality of the camera shooting positions and the shooting center point;
and the target distance acquisition unit is used for acquiring the minimum initial distance in the plurality of initial distances and taking the minimum initial distance as the target distance.
Optionally, the camera correction height acquiring module 640 includes:
the camera height acquisition unit is used for acquiring gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when each ring-shot image is shot;
the camera correction height acquisition unit is used for correcting the camera height corresponding to the ring-shot image according to the gravity field data corresponding to each ring-shot image to obtain the camera correction height;
a camera corrected height acquisition unit for calculating an average height of the plurality of camera corrected heights, taking the average height as the target camera corrected height.
Optionally, the rotation angle determining module 650 includes:
and the rotation angle acquisition unit is used for calculating the ratio of 360 degrees to the number of the positions and taking the ratio as the rotation angle of the target camera.
Optionally, the object camera pose acquisition module 660 includes:
a three-dimensional coordinate determination unit for determining a three-dimensional coordinate of the target camera according to the target camera calibration height, the rotation angle, and the target distance;
and the target camera pose generation unit is used for generating the target camera pose of the target camera according to the three-dimensional coordinates.
According to the device for acquiring the pose of the target camera in the ring shooting, the shooting central point of the target object in the world coordinate system is obtained according to the multiple ring shooting images of the target object and the camera poses corresponding to the multiple ring shooting images, the target distance between the target camera and the shooting central point is acquired, the target camera is a camera for shooting the multiple ring shooting images, the correction height of the target camera when the target camera shoots the ring shooting images is acquired, the rotation angle of the target camera is determined according to the preset position number of the shooting positions, and the pose of the target camera is acquired according to the target distance, the correction height of the target camera and the rotation angle. According to the method and the device, the ideal camera pose of the target camera can be obtained by combining the target distance between the camera and the shooting central point, the correction height of the target camera and the camera rotation angle, the 3D appearance image of the object is constructed according to the ideal camera pose, and the construction effect of the 3D appearance image of the object can be greatly improved.
Preferably, an embodiment of the present application further provides an electronic device, including: the processor, the memory, and the computer program stored in the memory and capable of running on the processor, when executed by the processor, implement each process of the above method embodiment for obtaining the pose of the target camera in the loop shooting, and can achieve the same technical effect, and in order to avoid repetition, the details are not repeated here.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the above method for obtaining the pose of the target camera in the loop shooting, and can achieve the same technical effect, and is not described here again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Those of ordinary skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed in the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A method for acquiring the pose of a target camera in a circular shooting is characterized by comprising the following steps:
acquiring a plurality of ring-shot images of a target object and camera poses corresponding to the plurality of ring-shot images;
obtaining a shooting central point of the target object in a world coordinate system according to the camera pose and the multiple ring shooting images;
acquiring a target distance between a target camera and the shooting central point; the target camera is a camera for shooting the plurality of ring-shot images;
acquiring a target camera correction height of the target camera when the target camera shoots the ring-shot image;
determining the rotation angle of the target camera according to the preset position number of the shooting positions;
and acquiring the pose of the target camera according to the target distance, the correction height of the target camera and the rotation angle.
2. The method of claim 1, wherein obtaining camera poses corresponding to the plurality of ring-shot images comprises:
performing sparse reconstruction on the multiple annularly shot images to obtain a reconstruction result;
and determining the camera poses corresponding to the multiple ring-shot images according to the reconstruction result.
3. The method of claim 1, wherein the obtaining the target distance between the target camera and the photographing center point comprises:
acquiring a camera shooting position corresponding to each ring shooting image;
acquiring initial distances between a plurality of camera shooting positions and the shooting central point;
and acquiring the minimum initial distance in the plurality of initial distances, and taking the minimum initial distance as the target distance.
4. The method of claim 1, wherein said obtaining a target camera corrected height for said target camera when capturing said loop image comprises:
acquiring gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when shooting each ring-shot image;
correcting the height of a camera corresponding to each ring-shot image according to the gravity field data corresponding to each ring-shot image to obtain the corrected height of the camera;
calculating an average height of the plurality of camera corrected heights, and taking the average height as the target camera corrected height.
5. The method according to claim 1, wherein the determining the rotation angle of the target camera according to the preset number of positions of the shooting positions comprises:
and calculating the ratio of 360 degrees to the number of the positions, and taking the ratio as the rotation angle of the target camera.
6. The method of claim 1, wherein the obtaining the target camera pose of the target camera from the target distance, the target camera correction height, and the rotation angle comprises:
determining the three-dimensional coordinates of the target camera according to the corrected height, the rotation angle and the target distance of the target camera;
and generating the target camera pose of the target camera according to the three-dimensional coordinates.
7. An apparatus for acquiring a pose of a target camera in a loop shot, comprising:
the system comprises a ring-shooting image acquisition module, a ring-shooting image acquisition module and a control module, wherein the ring-shooting image acquisition module is used for acquiring a plurality of ring-shooting images of a target object and camera poses corresponding to the plurality of ring-shooting images;
the shooting central point acquisition module is used for acquiring a shooting central point of the target object in a world coordinate system according to the camera pose and the multiple ring shooting images;
the target distance acquisition module is used for acquiring a target distance between a target camera and the shooting central point; the target camera is a camera for shooting the plurality of ring-shot images;
the camera correction height acquisition module is used for acquiring the correction height of the target camera when the target camera shoots the ring-shot image;
the rotation angle determining module is used for determining the rotation angle of the target camera according to the position number of preset shooting positions;
and the target camera pose acquisition module is used for acquiring the target camera pose of the target camera according to the target distance, the target camera correction height and the rotation angle.
8. The apparatus of claim 7, wherein the ring-shot image acquisition module comprises:
the reconstruction result acquisition unit is used for performing sparse reconstruction on the plurality of annularly shot images to obtain a reconstruction result;
and the camera pose determining unit is used for determining the camera poses corresponding to the multiple ring-shooting images according to the reconstruction result.
9. The apparatus of claim 7, wherein the target distance obtaining module comprises:
the camera shooting position acquisition unit is used for acquiring a camera shooting position corresponding to each ring shooting image;
an initial distance acquisition unit configured to acquire initial distances between a plurality of the camera shooting positions and the shooting center point;
and the target distance acquisition unit is used for acquiring the minimum initial distance in the plurality of initial distances and taking the minimum initial distance as the target distance.
10. The apparatus of claim 7, wherein the camera calibration height acquisition module comprises:
the camera height acquisition unit is used for acquiring gravity field data corresponding to the multiple ring-shot images and the camera height of the target camera when each ring-shot image is shot;
the camera correction height acquisition unit is used for correcting the camera height corresponding to the ring-shot image according to the gravity field data corresponding to each ring-shot image to obtain the camera correction height;
a camera rectification height acquisition unit for calculating an average height of the plurality of camera rectification heights, and taking the average height as the target camera rectification height.
11. The apparatus of claim 7, wherein the rotation angle determination module comprises:
and the rotation angle acquisition unit is used for calculating the ratio of 360 degrees to the number of the positions and taking the ratio as the rotation angle of the target camera.
12. The apparatus of claim 7, wherein the object camera pose acquisition module comprises:
a three-dimensional coordinate determination unit for determining a three-dimensional coordinate of the target camera according to the target camera correction height, the rotation angle, and the target distance;
and the target camera pose generation unit is used for generating the target camera pose of the target camera according to the three-dimensional coordinates.
13. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of the target camera pose determination method of any of claims 1 to 6.
14. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, carries out the steps of the target camera pose determination method according to any one of claims 1 to 6.
CN202210841406.7A 2022-07-18 2022-07-18 Method and device for acquiring pose of target camera in ring shooting and electronic equipment Active CN115311360B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210841406.7A CN115311360B (en) 2022-07-18 2022-07-18 Method and device for acquiring pose of target camera in ring shooting and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210841406.7A CN115311360B (en) 2022-07-18 2022-07-18 Method and device for acquiring pose of target camera in ring shooting and electronic equipment

Publications (2)

Publication Number Publication Date
CN115311360A true CN115311360A (en) 2022-11-08
CN115311360B CN115311360B (en) 2023-06-16

Family

ID=83857129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210841406.7A Active CN115311360B (en) 2022-07-18 2022-07-18 Method and device for acquiring pose of target camera in ring shooting and electronic equipment

Country Status (1)

Country Link
CN (1) CN115311360B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010287074A (en) * 2009-06-12 2010-12-24 Nippon Telegr & Teleph Corp <Ntt> Camera calibration device, camera calibration method, camera calibration program and recording medium recording the program
CN109902675A (en) * 2018-09-17 2019-06-18 华为技术有限公司 The method and apparatus of the pose acquisition methods of object, scene reconstruction
KR20210016757A (en) * 2019-08-05 2021-02-17 주식회사 케이티 System and method for managing base station antenna information
CN114095662A (en) * 2022-01-20 2022-02-25 荣耀终端有限公司 Shooting guide method and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010287074A (en) * 2009-06-12 2010-12-24 Nippon Telegr & Teleph Corp <Ntt> Camera calibration device, camera calibration method, camera calibration program and recording medium recording the program
CN109902675A (en) * 2018-09-17 2019-06-18 华为技术有限公司 The method and apparatus of the pose acquisition methods of object, scene reconstruction
KR20210016757A (en) * 2019-08-05 2021-02-17 주식회사 케이티 System and method for managing base station antenna information
CN114095662A (en) * 2022-01-20 2022-02-25 荣耀终端有限公司 Shooting guide method and electronic equipment

Also Published As

Publication number Publication date
CN115311360B (en) 2023-06-16

Similar Documents

Publication Publication Date Title
CN106934777B (en) Scanning image acquisition method and device
US11330172B2 (en) Panoramic image generating method and apparatus
EP3451649B1 (en) Method and apparatus for generating indoor panoramic video
CN107517360B (en) Image area shielding method and device
CN106604003B (en) Method and system for realizing curved-surface curtain projection through short-focus projection
CN112348958A (en) Method, device and system for acquiring key frame image and three-dimensional reconstruction method
CN110099220B (en) Panoramic stitching method and device
CN112039937B (en) Display method, position determination method and device
US11922568B2 (en) Finite aperture omni-directional stereo light transport
US20180114291A1 (en) Image processing method and device as well as non-transitory computer-readable medium
CN108205822B (en) Picture pasting method and device
CN114549289A (en) Image processing method, image processing device, electronic equipment and computer storage medium
CN113079369B (en) Method and device for determining image pickup equipment, storage medium and electronic device
CN106997366B (en) Database construction method, augmented reality fusion tracking method and terminal equipment
CN109801351B (en) Dynamic image generation method and processing device
JP2012256274A (en) Image generation device, image generation method, and computer program
CN115311360B (en) Method and device for acquiring pose of target camera in ring shooting and electronic equipment
CN115086625B (en) Correction method, device and system for projection picture, correction equipment and projection equipment
WO2021035674A1 (en) Image generating method and apparatus, movable platform, and storage medium
JP2005234698A (en) Distortion parameter generation method, video generation method, distortion parameter generation system and video generation system
JP2017021430A (en) Panoramic video data processing device, processing method, and program
CN115297315A (en) Correction method and device for shooting central point in circular shooting and electronic equipment
CN113674356A (en) Camera screening method and related device
CN112215966A (en) Virtual image and real user photo group photo method
JP6901580B2 (en) Horizontal calibration method of panoramic image or video, system and mobile terminal

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