WO2018068719A1 - Image stitching method and apparatus - Google Patents
Image stitching method and apparatus Download PDFInfo
- Publication number
- WO2018068719A1 WO2018068719A1 PCT/CN2017/105657 CN2017105657W WO2018068719A1 WO 2018068719 A1 WO2018068719 A1 WO 2018068719A1 CN 2017105657 W CN2017105657 W CN 2017105657W WO 2018068719 A1 WO2018068719 A1 WO 2018068719A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- coordinate
- image
- coordinate system
- pixel
- optical center
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000003287 optical effect Effects 0.000 claims abstract description 64
- 238000003384 imaging method Methods 0.000 claims description 98
- 230000006870 function Effects 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 19
- 238000006243 chemical reaction Methods 0.000 description 5
- 238000010276 construction Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
- H04N5/265—Mixing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/698—Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/95—Computational photography systems, e.g. light-field imaging systems
- H04N23/951—Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/222—Studio circuitry; Studio devices; Studio equipment
- H04N5/262—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
- H04N5/2624—Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects for obtaining an image which is composed of whole input images, e.g. splitscreen
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
Definitions
- the present application relates to the field of image processing technologies, and in particular, to an image stitching method and apparatus.
- 360-degree panoramic video has gradually become one of the main contents in the field of virtual reality. Compared to traditional limited-view video, this panoramic video provides users with a more realistic and immersive viewing experience. Since the single-lens system for collecting panoramic video is still rare, it is generally composed of video captured by multiple camera devices or multiple lens systems.
- the present invention provides an image splicing method and apparatus, which can provide a spliced image without parallax and improve resource utilization of the image splicing device.
- the present invention provides an image stitching method for an image pickup apparatus including at least two image pickup apparatuses, the method comprising:
- each imaging device For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;
- All images are stitched according to the third coordinate of each pixel in all images.
- the present invention also provides an image splicing apparatus comprising a processor and a memory, wherein the memory stores instructions executable by the processor, and when the instruction is executed, the processor is configured to:
- each imaging device For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;
- each camera device For each pixel in an image captured by each camera device, performing a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; Correcting the second coordinate to obtain a third coordinate by the optical center of the imaging device and the target object point specified in the image; and
- All images are stitched according to the third coordinate of each pixel in all images.
- the invention further provides a computer readable storage medium storing computer readable instructions for causing at least one processor to perform the method described above.
- the present invention further provides an image pickup apparatus comprising at least two image pickup apparatuses, an image display apparatus, a processor, and a memory, wherein the memory stores instructions executable by the processor, when the instructions are executed,
- the processor is used to:
- each imaging device For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;
- a process of converting the first coordinate of the pixel in the two-dimensional coordinate system of the image into the three-dimensional coordinate system is performed a second coordinate; correcting the second coordinate according to an optical center of the imaging device and a target object point specified in the image to obtain a third coordinate;
- the stitched image is displayed by the image display device.
- FIG. 1a is a schematic diagram of an implementation environment according to an embodiment of the invention.
- FIG. 1b is an exemplary flowchart of an image stitching method according to an embodiment of the invention.
- FIG. 2 is a schematic diagram of constructing a Cartesian coordinate system in accordance with an embodiment of the present invention
- FIG. 3 is an exemplary flowchart of a method for compensating an optical center offset according to an embodiment of the invention
- 4a is a schematic diagram of coordinates for correcting a second coordinate according to an embodiment of the invention.
- 4b is a schematic diagram of coordinates for determining an offset according to an embodiment of the invention.
- FIG. 5 is an exemplary flowchart of an image stitching method according to another embodiment of the present invention.
- 6a is a schematic diagram of a two-dimensional image before splicing according to an embodiment of the invention.
- 6b is a schematic diagram of a two-dimensional image after splicing according to an embodiment of the invention.
- FIG. 7 is a schematic structural diagram of an image splicing apparatus according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of an image splicing apparatus according to another embodiment of the present invention.
- two-dimensional imaging captured by two non-co-optic lenses always has a certain parallax in their common field of view.
- the degree of parallax is different, which ultimately leads to visually unacceptable flaws in the stitched image, such as ghosting, ghosting, and continuous line misalignment. Therefore, the spliced image has a poor effect, affects the user's viewing experience, and reduces the resource utilization of the imaging device.
- the image splicing method and apparatus in the embodiments of the present invention are applicable to any image pickup apparatus having at least two image pickup apparatuses, wherein the angles of view of two adjacent image pickup apparatuses have a common portion, that is, a common view portion, and images taken by the two Has overlapping parts.
- the images captured by each camera device are respectively processed, and then the images are stitched in the entire imaging device, and the complete target object point (or depth surface) can be obtained completely.
- FIG. 1a is a schematic diagram of an implementation environment according to an embodiment of the invention.
- the imaging system 100 includes a target object 200 and an imaging device 300.
- the imaging device 300 further includes an image splicing device 310, an image display device 320, and imaging devices 331-335. All the imaging devices 331-335 are combined. Together, it can form a 360-degree panoramic shot.
- the target object 100 is photographed in response to a user operation, and each of the imaging apparatuses 331 to 335 captures an image for the target object 100, and The captured image is transmitted to the image splicing device 310 for splicing, and then the image splicing device 310 transmits the spliced panoramic image to the image display device 320 for display for viewing by the user.
- the imaging device 300 may be a wearable smart terminal, each camera The device is a single camera lens that can take a single image or take multiple consecutive images.
- the image display device 320 is a display screen, and provides a visual interface for the user to display the stitched panoramic image.
- FIG. 1b is an exemplary flowchart of an image stitching method according to an embodiment of the invention. The method is applied to an image pickup apparatus including at least two image pickup apparatuses, as shown in FIG. 1b, comprising the following steps:
- Step 101 Acquire images captured by at least two imaging devices.
- Step 102 For each imaging device, construct a three-dimensional coordinate system of the imaging device with the common optical center of the preset at least two imaging devices as an origin.
- each camera device has an optical center of its own lens, in this step, a common optical center is first preset, which is for the entire imaging device, that is, all the imaging devices have such an ideal.
- the optical center is used as a starting point to construct a three-dimensional coordinate system for each camera.
- the specific method includes: taking the common optical center as the origin, and the imaging surface of the imaging device The two-dimensional coordinate system (X, Y) is established on the parallel plane, and then the Z-axis is determined according to the two-dimensional coordinate system (X, Y) and the right-hand rule.
- the three-dimensional coordinate system is a Cartesian coordinate system.
- This Cartesian coordinate system is also referred to as a Cartesian world coordinate system with respect to the coordinate system of the camera.
- 2 is a schematic diagram of constructing a Cartesian coordinate system in accordance with an embodiment of the present invention.
- the X-axis, the Y-axis, and the Z-axis together constitute a Cartesian coordinate system of the image pickup device A
- the common optical center O is the origin of the coordinate system.
- Incident light The lens system of the imaging device A is entered at an angle ⁇ , and after being refracted by the lens, it is imaged on the imaging surface x'o'y' of the imaging device A.
- the XOY face and the x'o'y' face are parallel.
- a two-dimensional coordinate system (X, Y) is established on the parallel plane XOY plane of the imaging plane x'o'y', and then the Z-axis is determined based on the two-dimensional coordinate system (X, Y) and the right-hand rule.
- Step 103 Performing the following processing for each pixel in an image captured by each camera:
- Step 1031 Convert the first coordinate of the pixel in the two-dimensional coordinate system of the image to the second coordinate in the three-dimensional coordinate system;
- the captured image is two-dimensional, and each pixel has a two-dimensional coordinate, that is, a first coordinate, in the two-dimensional coordinate system of the image.
- Step 1032 Correct the second coordinate according to the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate.
- converting the first coordinate to the second coordinate specifically includes: determining an angular coordinate of the pixel according to the first coordinate, determining incident light and the three-dimensional coordinate according to the lens imaging geometric function and the first coordinate of the imaging device.
- the angle between the Z axes in the system (X, Y, Z) and then calculate the second coordinates based on the angle and the angular coordinates.
- Determining an angular coordinate of the pixel according to the first coordinate comprises determining The following trigonometric values are:
- Atan ( ⁇ ) represents the inverse tangent function
- pw, ph represents the width and height of the pixel, respectively
- f is the focal length of the lens (as shown in Figure 2).
- one pixel p 1 ' in the imaging plane x'o'y', the first coordinate is (x 1 , y 1 ), the connection between p 1 ' and the origin o' and x'
- the angle between the o' axes is Converted to the Cartesian coordinate system (X, Y, Z), corresponding to the object point P 1 , its three-dimensional coordinates are shown in formula (2).
- the projection of P 1 on the two-dimensional plane of XOY is p 1
- the angle between the line between p 1 and the origin O and the XO axis is also
- the above-mentioned common optical center O is unique to all the imaging devices, but considering that each of the imaging devices has its own optical center O' in practice, it is necessary to perform imaging on the image according to the deviation between the optical centers.
- the compensation is such that it is consistent with the imaging of O under the origin.
- FIG. 3 is an exemplary flowchart of an optical center offset compensation method according to an embodiment of the present invention.
- the second coordinate is corrected according to the optical center of the imaging device and the target object point specified in the image, and the third coordinate is obtained.
- the method includes the following steps:
- Step 301 Obtain a distance between the public optical center and the target object point, that is, obtain a depth of the target object point.
- the target object point may be specified by the user according to the object point of interest in the captured image, or may be specified according to the main target object or the content in the scene.
- FIG. 4a is a schematic diagram of coordinates for correcting a second coordinate according to an embodiment of the invention.
- the target point is incident light.
- the above distance is the projection of P 1 on the XOZ plane
- the length, that is, the length between 0 and P', is denoted as R 0 , which is also referred to as the depth of the object point P 1 .
- Step 302 Obtain an offset of the optical center of the imaging device relative to the common optical center.
- regression or simulation estimation may be performed according to sample data of the overlapping image and corresponding/matching relationship with the imaging device.
- the above offset is given.
- a panoramic (ie 360°) video system in which three cameras are placed in a three-dimensional space, each camera capturing an image within a certain range of viewing angles.
- FIG. 4b is a schematic diagram of coordinates for determining an offset according to an embodiment of the invention.
- Fig. 4b in the ABC coordinate system constructed by the three-dimensional spherical surface 400, cameras 401 and 402 are arranged at different positions, and the images taken by the two have overlapping portions.
- the offset between the optical center O' of each camera and the origin O can be determined from the sample data of the superimposed image.
- the optical center O 4a 'with respect to the origin O in the offset X axis, Y axis and Z axis are T x, T y, T z .
- Step 303 calculating a third coordinate according to the distance, the offset, and the second coordinate.
- each coordinate value x 3 , y 3 , and z 3 in the third coordinate (x 3 , y 3 , z 3 ) can be calculated according to the following formula:
- Step 104 splicing all images according to the third coordinate of each pixel in all images.
- a three-dimensional coordinate system of the imaging device is constructed with a common optical center of at least two preset imaging devices as an origin,
- Each pixel in an image captured by each camera device performs a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system;
- the optical center of the device and the target object point specified in the image, the second coordinate is corrected to obtain a third coordinate, and all the images are spliced according to the third coordinate of each pixel in all images, thereby providing a non-parallax splicing
- the depth surface technology can adaptively select the depth position of the main content in the scene as the non-parallax stitching depth surface, so that the main content in the scene presents a non-parallas stitching effect.
- the coordinate conversion and the compensation of the optical center offset in the above method are independent of the geometric characteristics of the target object point, and are not dependent on the shape of the specific target object point, and are more suitable for video applications whose content is constantly changing in the time dimension.
- the above method does not need to perform feature detection and feature matching on the scene content, so that the user can specify the target object quickly and flexibly.
- the point or the specified non-parallax stitching depth surface
- the above method and the specific imaging geometric formula of the imaging device and the projection type of the final stitching are also irrelevant, and therefore, have versatility, and improve resource utilization of the image splicing device.
- FIG. 5 is an exemplary flowchart of an image stitching method according to another embodiment of the present invention. As shown in FIG. 5, the method is applied to an image pickup apparatus including at least two image pickup apparatuses, and includes the following steps:
- Step 501 Acquire an image captured by each of the at least two imaging devices.
- Step 502 For each camera device, construct a Cartesian coordinate system of the camera device with the common optical center of the preset at least two camera devices as an origin.
- Step 503 performing the following processing for each pixel in an image captured by each camera:
- Step 5031 performing coordinate conversion:
- step 5032 the optical center offset compensation is performed:
- the second coordinate is corrected based on the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate.
- the modulus of the second coordinate is 1, that is, the established Cartesian coordinate system is a normalized Cartesian coordinate system. Since the normalized Cartesian coordinate system does not contain depth information, it is in the same incident light. The upper two object points with different depths have the same normalized Cartesian coordinate values. As shown, p 1 '2 converted to the corresponding normalized Cartesian coordinate system (X, Y, Z) is not only the object point P 1, except that P 1, may also be along the incident light Other objects on the point, as shown in Figure 2 P 2 .
- the depths of the object points P 1 and P 2 are different, that is, the distances between the XOZ planes and the optical center O are different, but the two have the same normalized Cartesian coordinate values (x 2 , y 2 , z 2 ). Both correspond to p 1 ' on the imaging plane x'o'y'.
- Step 504 Project the third coordinate into the unit panoramic sphere according to a preset projection type according to the position of each camera in the imaging device.
- the third coordinates are projected into a unit of panoramic sphere.
- Preset projection types include, but are not limited to, rectilinear, fisheye, equirectangular, orthographic, stereographic, and the like.
- Step 505 splicing all the images in the unit panoramic spherical surface to obtain a panoramic image.
- the splicing depth surface without parallax can be reached at the specified target object point position, and the adjacent images are completely aligned, and the effect of no splicing ⁇ is obtained.
- the three-dimensional panoramic image can be reconverted into a two-dimensional image.
- FIG. 6a is a schematic diagram of a two-dimensional image before splicing according to an embodiment of the invention.
- the target point is the first flagpole closest to the lens (as indicated by arrow 601), corresponding to P1-P' shown in Figure 4a.
- the up, down, left and right image misalignment due to parallax occurs at the flagpole.
- the extra point 611' appears at the lower left of the top end 611 of the flagpole.
- the flag is originally the image shown at 612, but due to the parallax, the final image is 612' (as indicated by the dotted line). Show).
- FIG. 6b is a schematic diagram of a two-dimensional image after splicing according to an embodiment of the invention.
- the left picture 620 is the image after the coordinate transformation and the optical center offset compensation, and the upper and lower images are perfectly aligned at the flagpole.
- images that are not aligned outside of the top 611 and the flag 612 disappear, showing a clear flagpole. Visible, implemented in the scene The perfect alignment of the main contents (ie, the flagpole), at the position of the flagpole, becomes the non-parallax stitching depth surface.
- reverse processing may also be adopted, that is, the inverse processing is performed pixel by pixel on a blank panoramic canvas (ie, the optical center offset compensation described in step 5032 is sequentially performed, step 5031).
- the coordinate conversion operation described finds the pixel position of the image captured by the camera device corresponding thereto, and then interpolates to obtain the actual value of the pixel on the current panoramic canvas.
- FIG. 7 is a schematic structural diagram of an image splicing apparatus according to an embodiment of the present invention.
- the image splicing device 700 includes an obtaining module 710, a coordinate system building module 720, a coordinate processing module 730, and a splicing module 740, where
- the acquiring module 710 is configured to acquire an image captured by each of the at least two camera devices;
- a coordinate system construction module 720 configured to construct, for each camera device, a three-dimensional coordinate system of the camera device with a common optical center of at least two preset imaging devices as an origin;
- the coordinate processing module 730 is configured to, for each pixel in an image captured by each camera device, perform a process of converting the first coordinate of the pixel in the two-dimensional coordinate system of the image into the three-dimensional coordinate system. a second coordinate; correcting the second coordinate according to the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate; and
- the splicing module 740 is configured to splicing all the images according to the third coordinate of each pixel in all the images.
- the coordinate processing module 730 includes a conversion unit 731 for determining an angular coordinate of the pixel according to the first coordinate, and determining the incident light and the three-dimensional coordinate system according to the lens imaging geometric function and the first coordinate of the imaging device ( The angle between the Z axes in X, Y, Z); the second coordinate is calculated from the angular coordinates and the included angle.
- the converting unit 731 is configured to determine:
- the three-dimensional coordinate system is a Cartesian coordinate system. If the second coordinate is represented by (x 2 , y 2 , z 2 ) and the angle is represented by ⁇ , the conversion unit 731 is configured to calculate x 2 , y 2 and according to the following formula. z 2 :
- the coordinate processing module 730 includes a correction unit 732 for acquiring a distance between the common optical center and the target object point; acquiring an offset of the optical center of the imaging device with respect to the common optical center; The offset and the second coordinate calculate the third coordinate.
- the correcting unit 732 is configured to calculate x 3 , y 3 and z 3 according to the following formula:
- the splicing module 740 is configured to project the third coordinate into the unit panoramic spherical surface according to a preset projection type according to the position of each camera device in the imaging device; The images are stitched together to obtain a panoramic image.
- FIG. 8 is a schematic structural diagram of an image splicing apparatus according to another embodiment of the present invention.
- the image splicing apparatus 800 can include a processor 810, a memory 820, a port 830, and a bus. 840.
- Processor 810 and memory 820 are interconnected by a bus 840.
- Processor 810 can receive and transmit data through port 830. among them,
- the processor 810 is configured to execute a machine readable instruction module stored by the memory 820.
- the memory 820 stores machine readable instruction modules executable by the processor 810.
- the instruction module executable by the processor 810 includes an acquisition module 821, a coordinate system construction module 822, a coordinate processing module 823, and a splicing module 824. among them,
- the acquiring module 821 may be executed by the processor 810 to: acquire an image captured by each of the at least two camera devices;
- the coordinate system construction module 822 may be configured by the processor 810 to: for each camera device, construct a three-dimensional coordinate system of the camera device with the common optical center of the preset at least two camera devices as an origin;
- the coordinate processing module 823 may be executed by the processor 810 to: for each pixel in an image captured by each camera device, perform the following process: converting the pixel to the first coordinate in the two-dimensional coordinate system of the image a second coordinate in the three-dimensional coordinate system; correcting the second coordinate according to the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate;
- the splicing module 824 when executed by the processor 810, can splicing all of the images based on the third coordinate of each pixel in all of the images.
- an image pickup apparatus includes at least two image pickup apparatuses, an image display apparatus, a processor, and a memory, and the memory stores instructions executable by the processor, and when executing the instructions, the processor is configured to:
- a three-dimensional coordinate system of the imaging device is constructed with a common optical center of at least two preset imaging devices as an origin;
- each camera device For each pixel in an image captured by each camera device, performing a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; The optical center of the imaging device and the target object point specified in the image are corrected to obtain the third coordinate; and,
- the stitched image is displayed by the image display device.
- each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- each of the embodiments of the present invention can be implemented by a data processing program executed by a data processing device such as a computer.
- the data processing program constitutes the present invention.
- a data processing program usually stored in a storage medium is executed by directly reading a program out of a storage medium or by installing or copying the program to a storage device (such as a hard disk and or a memory) of the data processing device. Therefore, such a storage medium also constitutes the present invention.
- the storage medium can use any type of recording method, such as paper storage medium (such as paper tape, etc.), magnetic storage medium (such as floppy disk, hard disk, flash memory, etc.), optical storage medium (such as CD-ROM, etc.), magneto-optical storage medium (such as MO, etc.).
- paper storage medium such as paper tape, etc.
- magnetic storage medium such as floppy disk, hard disk, flash memory, etc.
- optical storage medium such as CD-ROM, etc.
- magneto-optical storage medium Such as MO, etc.
- the present invention also discloses a storage medium in which is stored a data processing program for performing any of the above-described embodiments of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
Disclosed are an image stitching method and apparatus. The method is applied to an image pick-up device comprising at least two image pick-up apparatuses, and comprises: acquiring images respectively picked up by at least two image pick-up apparatuses; with regard to each image pick-up apparatus, constructing a three-dimensional coordinate system of the image pick-up apparatus by taking a pre-set common optical center of the at least two image pick-up apparatuses as an origin; with regard to each pixel in an image picked up by each image pick-up apparatus, executing the following processing: converting a first coordinate of the pixel in a two-dimensional coordinate system of the image into a second coordinate in the three-dimensional coordinate system, and according to the optical center of the image pick-up apparatus and a specific target object point in the image, correcting the second coordinate so as to obtain a third coordinate; and stitching all images according to the third coordinate of each pixel in all the images.
Description
本申请要求于2016年10月12日提交中国专利局、申请号为201610890008.9、申请名称为“一种图像拼接方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610890008.9, filed on Jan. 12,,,,,,,,,,,,,,,,,, .
本申请涉及图像处理技术领域,尤其涉及一种图像拼接方法及装置。The present application relates to the field of image processing technologies, and in particular, to an image stitching method and apparatus.
发明背景Background of the invention
目前,360度全景视频逐渐成为虚拟现实领域主要的内容之一。相比于传统有限视野的视频,这种全景视频能够提供给用户更为逼真的沉浸观看体验。由于目前采集全景视频的单镜头系统还很少,一般是由多个摄像装置或多个镜头系统采集的视频拼接而成。At present, 360-degree panoramic video has gradually become one of the main contents in the field of virtual reality. Compared to traditional limited-view video, this panoramic video provides users with a more realistic and immersive viewing experience. Since the single-lens system for collecting panoramic video is still rare, it is generally composed of video captured by multiple camera devices or multiple lens systems.
发明内容Summary of the invention
有鉴于此,本发明提供了一种图像拼接方法及装置,能够提供无视差的拼接图像,提高图像拼接装置的资源利用率。In view of this, the present invention provides an image splicing method and apparatus, which can provide a spliced image without parallax and improve resource utilization of the image splicing device.
本发明的技术方案是这样实现的:The technical solution of the present invention is implemented as follows:
本发明提供了一种图像拼接方法,应用于包括至少两个摄像装置的摄像设备,所述方法包括:The present invention provides an image stitching method for an image pickup apparatus including at least two image pickup apparatuses, the method comprising:
获取所述至少两个摄像装置各自拍摄到的图像;Acquiring an image captured by each of the at least two camera devices;
针对每个摄像装置,以预设的所述至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;
针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:For each pixel in an image captured by each camera, the following processing is performed:
将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系
下的第二坐标;Converting the first coordinate of the pixel in the two-dimensional coordinate system of the image into the three-dimensional coordinate system
The second coordinate below;
根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标;及,Correcting the second coordinate according to an optical center of the imaging device and a target object point specified in the image to obtain a third coordinate; and
根据所有图像中每个像素的所述第三坐标对所有图像进行拼接。All images are stitched according to the third coordinate of each pixel in all images.
本发明还提供了一种图像拼接装置,包括处理器和存储器,所述存储器中存储可被所述处理器执行的指令,当执行所述指令时,所述处理器用于:The present invention also provides an image splicing apparatus comprising a processor and a memory, wherein the memory stores instructions executable by the processor, and when the instruction is executed, the processor is configured to:
获取至少两个摄像装置各自拍摄到的图像;Acquiring images captured by at least two camera devices;
针对每个摄像装置,以预设的所述至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;
针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标;及,For each pixel in an image captured by each camera device, performing a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; Correcting the second coordinate to obtain a third coordinate by the optical center of the imaging device and the target object point specified in the image; and
根据所有图像中每个像素的所述第三坐标对所有图像进行拼接。All images are stitched according to the third coordinate of each pixel in all images.
本发明又提供了一种计算机可读存储介质,存储有计算机可读指令,可以使至少一个处理器执行上述所述的方法。The invention further provides a computer readable storage medium storing computer readable instructions for causing at least one processor to perform the method described above.
本发明又提供了一种摄像设备,包括至少两个摄像装置、图像显示装置、处理器和存储器,所述存储器中存储可被所述处理器执行的指令,当执行所述指令时,所述处理器用于:The present invention further provides an image pickup apparatus comprising at least two image pickup apparatuses, an image display apparatus, a processor, and a memory, wherein the memory stores instructions executable by the processor, when the instructions are executed, The processor is used to:
获取所述至少两个摄像装置各自拍摄到的图像;Acquiring an image captured by each of the at least two camera devices;
针对每个摄像装置,以预设的所述至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;
针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下
的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标;及,For each pixel in an image captured by each camera, a process of converting the first coordinate of the pixel in the two-dimensional coordinate system of the image into the three-dimensional coordinate system is performed
a second coordinate; correcting the second coordinate according to an optical center of the imaging device and a target object point specified in the image to obtain a third coordinate; and
根据所有图像中每个像素的所述第三坐标对所有图像进行拼接;All images are stitched according to the third coordinate of each pixel in all images;
将拼接后的图像通过所述图像显示装置进行显示。The stitched image is displayed by the image display device.
附图简要说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚的说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。其中,In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following drawings will be briefly described, and the drawings in the following description are only some embodiments of the present application. Other drawings may also be obtained from those of ordinary skill in the art in light of the inventive work. among them,
图1a为依据本发明一实施例的实施环境示意图;FIG. 1a is a schematic diagram of an implementation environment according to an embodiment of the invention; FIG.
图1b为依据本发明一实施例的图像拼接方法的示例性流程图;FIG. 1b is an exemplary flowchart of an image stitching method according to an embodiment of the invention; FIG.
图2为依据本发明一实施例的构建笛卡尔坐标系的示意图;2 is a schematic diagram of constructing a Cartesian coordinate system in accordance with an embodiment of the present invention;
图3为依据本发明一实施例的光心偏移补偿方法的示例性流程图;FIG. 3 is an exemplary flowchart of a method for compensating an optical center offset according to an embodiment of the invention; FIG.
图4a为依据本发明一实施例的对第二坐标进行修正的坐标示意图;4a is a schematic diagram of coordinates for correcting a second coordinate according to an embodiment of the invention;
图4b为依据本发明一实施例的确定偏移量的坐标示意图;4b is a schematic diagram of coordinates for determining an offset according to an embodiment of the invention;
图5为依据本发明另一实施例的图像拼接方法的示例性流程图;FIG. 5 is an exemplary flowchart of an image stitching method according to another embodiment of the present invention; FIG.
图6a为依据本发明一实施例的拼接前的二维图像示意图;6a is a schematic diagram of a two-dimensional image before splicing according to an embodiment of the invention;
图6b为依据本发明一实施例的拼接后的二维图像示意图;6b is a schematic diagram of a two-dimensional image after splicing according to an embodiment of the invention;
图7依据本发明一实施例的图像拼接装置的结构示意图;FIG. 7 is a schematic structural diagram of an image splicing apparatus according to an embodiment of the present invention; FIG.
图8为依据本发明另一实施例的图像拼接装置的结构示意图。FIG. 8 is a schematic structural diagram of an image splicing apparatus according to another embodiment of the present invention.
实施方式Implementation
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,
而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present application. It is obvious that the described embodiments are a part of the embodiments of the present application.
Rather than all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
根据镜头的光学透视几何原理,两个不共光心的镜头捕获的二维成像,在它们的公共视野部分总会存在一定的视差(parallax)。并且,在不同的深度面上,视差程度不一样,最终导致所拼接的图像在视觉上出现难以接受的瑕疵,例如重影、鬼影、连续线条错位断裂等。因此,拼接出的图像效果很差,影响了用户的观看体验,并且降低了成像装置的资源利用率。According to the optical perspective geometry of the lens, two-dimensional imaging captured by two non-co-optic lenses always has a certain parallax in their common field of view. Moreover, at different depths, the degree of parallax is different, which ultimately leads to visually unacceptable flaws in the stitched image, such as ghosting, ghosting, and continuous line misalignment. Therefore, the spliced image has a poor effect, affects the user's viewing experience, and reduces the resource utilization of the imaging device.
本发明实施例中的图像拼接方法和装置适用于任何具有至少两个摄像装置的摄像设备,其中,两个相邻的摄像装置的视角具有公共部分,即公共视野部分,二者所拍摄的图像具有重叠部分。根据本发明实施例中的方法,分别针对每个摄像装置拍摄到的图像进行处理,然后在整个的摄像设备中进行图像的拼接,在指定的目标物点(或者深度面)上能够得到完整的无视差的全景图像。The image splicing method and apparatus in the embodiments of the present invention are applicable to any image pickup apparatus having at least two image pickup apparatuses, wherein the angles of view of two adjacent image pickup apparatuses have a common portion, that is, a common view portion, and images taken by the two Has overlapping parts. According to the method in the embodiment of the present invention, the images captured by each camera device are respectively processed, and then the images are stitched in the entire imaging device, and the complete target object point (or depth surface) can be obtained completely. A panoramic image without parallax.
图1a为依据本发明一实施例的实施环境示意图。如图1a所示,摄像系统100包括目标物体200和摄像设备300,其中,摄像设备300又包括图像拼接装置310、图像显示装置320和摄像装置331~335,所有的摄像装置331~335组合在一起能够构成360度的全景拍摄。FIG. 1a is a schematic diagram of an implementation environment according to an embodiment of the invention. As shown in FIG. 1a, the imaging system 100 includes a target object 200 and an imaging device 300. The imaging device 300 further includes an image splicing device 310, an image display device 320, and imaging devices 331-335. All the imaging devices 331-335 are combined. Together, it can form a 360-degree panoramic shot.
根据本发明的实施例,当用户使用摄像设备300移动到某个场景时,响应于用户操作,对目标物体100进行拍摄,每个摄像装置331~335拍摄得到针对目标物体100的图像,并将拍摄到的图像传送给图像拼接装置310进行拼接,然后图像拼接装置310将拼接后的全景图像传送给图像显示装置320进行显示,供用户观看。According to an embodiment of the present invention, when the user moves to a certain scene using the imaging apparatus 300, the target object 100 is photographed in response to a user operation, and each of the imaging apparatuses 331 to 335 captures an image for the target object 100, and The captured image is transmitted to the image splicing device 310 for splicing, and then the image splicing device 310 transmits the spliced panoramic image to the image display device 320 for display for viewing by the user.
在实际应用时,摄像设备300可以为可穿戴式智能终端,每个摄像
装置是单个摄像机的镜头,可以拍照得到单张图像,或者摄像得到多张连续的图像。图像显示装置320为显示屏,为用户提供可视化界面,显示拼接后的全景图像。In practical applications, the imaging device 300 may be a wearable smart terminal, each camera
The device is a single camera lens that can take a single image or take multiple consecutive images. The image display device 320 is a display screen, and provides a visual interface for the user to display the stitched panoramic image.
图1b为依据本发明一实施例的图像拼接方法的示例性流程图。该方法应用于包括至少两个摄像装置的摄像设备,如图1b所示,包括如下步骤:FIG. 1b is an exemplary flowchart of an image stitching method according to an embodiment of the invention. The method is applied to an image pickup apparatus including at least two image pickup apparatuses, as shown in FIG. 1b, comprising the following steps:
步骤101,获取至少两个摄像装置各自拍摄到的图像。Step 101: Acquire images captured by at least two imaging devices.
本步骤中,首先获取摄像设备中所有摄像装置各自拍摄到的图像。In this step, first, images captured by all the imaging devices in the imaging device are acquired.
步骤102,针对每个摄像装置,以预设的至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系。Step 102: For each imaging device, construct a three-dimensional coordinate system of the imaging device with the common optical center of the preset at least two imaging devices as an origin.
由于每个摄像装置都具备一个自身镜头的光心,本步骤中,首先预设一个公共光心,该公共光心是对整个摄像设备而言的,即假设所有的摄像装置都具备这样一个理想的光心,以此为原点为每个摄像装置构建三维坐标系。Since each camera device has an optical center of its own lens, in this step, a common optical center is first preset, which is for the entire imaging device, that is, all the imaging devices have such an ideal. The optical center is used as a starting point to construct a three-dimensional coordinate system for each camera.
若三维坐标系表示为(X,Y,Z),以预设的公共光心为原点构建该摄像装置的三维坐标系时,具体包括:以公共光心为原点,在该摄像装置的成像面的平行面上建立二维坐标系(X,Y),然后根据二维坐标系(X,Y)和右手定则确定Z轴。If the three-dimensional coordinate system is represented as (X, Y, Z), when the three-dimensional coordinate system of the imaging device is constructed with the preset common optical center as the origin, the specific method includes: taking the common optical center as the origin, and the imaging surface of the imaging device The two-dimensional coordinate system (X, Y) is established on the parallel plane, and then the Z-axis is determined according to the two-dimensional coordinate system (X, Y) and the right-hand rule.
在一实施例中,该三维坐标系为笛卡尔坐标系。相对于摄像装置的坐标系而言,这种笛卡尔坐标系又被称为笛卡尔世界坐标系。图2为依据本发明一实施例的构建笛卡尔坐标系的示意图。如图2所示,X轴、Y轴和Z轴共同组成了一摄像装置A的笛卡尔坐标系,公共光心O为坐标系的原点。入射光以θ角进入摄像装置A的透镜系统,经过透镜折射后,在摄像装置A的成像面x'o'y'上成像。其中,XOY面和x'o'y'面平行。
这样,在成像面x'o'y'的平行面XOY面上建立二维坐标系(X,Y),然后根据二维坐标系(X,Y)和右手定则确定Z轴。In an embodiment, the three-dimensional coordinate system is a Cartesian coordinate system. This Cartesian coordinate system is also referred to as a Cartesian world coordinate system with respect to the coordinate system of the camera. 2 is a schematic diagram of constructing a Cartesian coordinate system in accordance with an embodiment of the present invention. As shown in FIG. 2, the X-axis, the Y-axis, and the Z-axis together constitute a Cartesian coordinate system of the image pickup device A, and the common optical center O is the origin of the coordinate system. Incident light The lens system of the imaging device A is entered at an angle θ, and after being refracted by the lens, it is imaged on the imaging surface x'o'y' of the imaging device A. Among them, the XOY face and the x'o'y' face are parallel. Thus, a two-dimensional coordinate system (X, Y) is established on the parallel plane XOY plane of the imaging plane x'o'y', and then the Z-axis is determined based on the two-dimensional coordinate system (X, Y) and the right-hand rule.
步骤103,针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:Step 103: Performing the following processing for each pixel in an image captured by each camera:
步骤1031,将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;Step 1031: Convert the first coordinate of the pixel in the two-dimensional coordinate system of the image to the second coordinate in the three-dimensional coordinate system;
这里,所拍摄到的图像是二维的,在该图像的二维坐标系中每个像素具备一个二维坐标,即第一坐标。Here, the captured image is two-dimensional, and each pixel has a two-dimensional coordinate, that is, a first coordinate, in the two-dimensional coordinate system of the image.
步骤1032,根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标。Step 1032: Correct the second coordinate according to the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate.
其中,对于步骤1031,将第一坐标转换为第二坐标,具体包括:根据第一坐标确定该像素的角坐标,根据该摄像装置的透镜成像几何函数和第一坐标确定入射光与该三维坐标系(X,Y,Z)中Z轴之间的夹角,然后根据夹角和角坐标计算出第二坐标。For step 1031, converting the first coordinate to the second coordinate specifically includes: determining an angular coordinate of the pixel according to the first coordinate, determining incident light and the three-dimensional coordinate according to the lens imaging geometric function and the first coordinate of the imaging device. The angle between the Z axes in the system (X, Y, Z), and then calculate the second coordinates based on the angle and the angular coordinates.
若一像素的第一坐标表示为(x1,y1),角坐标表示为根据第一坐标确定该像素的角坐标包括确定的如下三角函数值:If the first coordinate of a pixel is represented as (x 1 , y 1 ), the angular coordinate is expressed as Determining an angular coordinate of the pixel according to the first coordinate comprises determining The following trigonometric values are:
若第二坐标表示为(x2,y2,z2),夹角表示为θ,则按照如下公式计算出第二坐标中的x2、y2和z2:If the second coordinate is expressed as (x 2 , y 2 , z 2 ) and the angle is expressed as θ, x 2 , y 2 and z 2 in the second coordinate are calculated according to the following formula:
若摄像装置的透镜成像几何函数为r(θ),当该摄像装置的透镜为直线型(rectilinear)时,有r(θ)=f·tan(θ),则夹角
If the lens imaging geometric function of the imaging device is r(θ), when the lens of the imaging device is rectilinear, r(θ)=f·tan(θ), the angle is
当该摄像装置的透镜为等距型(equidistant)时,有r(θ)=f·θ,则夹角When the lens of the camera device is equidistant, there is r(θ)=f·θ, then the angle is
其中,atan(·)表示取反正切值函数,pw,ph分别表示该像素的宽度与高度,f为透镜的焦距(如图2所示)。Among them, atan (·) represents the inverse tangent function, pw, ph represents the width and height of the pixel, respectively, f is the focal length of the lens (as shown in Figure 2).
对应到图2中,成像面x'o'y'中的一个像素p1′,其第一坐标为(x1,y1),p1′和原点o′之间的连线与x′o′轴之间的夹角为转换到笛卡尔坐标系(X,Y,Z)下,对应物点P1,其三维坐标如公式(2)所示。其中,P1在XOY二维面上的投影为p1,p1和原点O之间的连线与XO轴之间的夹角也为
Corresponding to FIG. 2, one pixel p 1 ' in the imaging plane x'o'y', the first coordinate is (x 1 , y 1 ), the connection between p 1 ' and the origin o' and x' The angle between the o' axes is Converted to the Cartesian coordinate system (X, Y, Z), corresponding to the object point P 1 , its three-dimensional coordinates are shown in formula (2). Wherein, the projection of P 1 on the two-dimensional plane of XOY is p 1 , and the angle between the line between p 1 and the origin O and the XO axis is also
上述公共光心O对所有的摄像装置而言是唯一的,但是考虑到实际中每个摄像装置都具备自己的一个光心O′,因此,需要根据光心之间的偏离对成像的图像进行补偿,使得其与O为原点下的成像一致。The above-mentioned common optical center O is unique to all the imaging devices, but considering that each of the imaging devices has its own optical center O' in practice, it is necessary to perform imaging on the image according to the deviation between the optical centers. The compensation is such that it is consistent with the imaging of O under the origin.
对此,图3为依据本发明一实施例的光心偏移补偿方法的示例性流程图。针对步骤1032,根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标,如图3所示,具体包括如下步骤:In this regard, FIG. 3 is an exemplary flowchart of an optical center offset compensation method according to an embodiment of the present invention. For the step 1032, the second coordinate is corrected according to the optical center of the imaging device and the target object point specified in the image, and the third coordinate is obtained. As shown in FIG. 3, the method includes the following steps:
步骤301,获取公共光心和目标物点之间的距离,即获取目标物点的深度。Step 301: Obtain a distance between the public optical center and the target object point, that is, obtain a depth of the target object point.
本步骤中,目标物点可以由用户根据所拍摄到的图像中自己感兴趣的物点进行指定,或者,可以根据场景中的主要目标物或内容物进行指定。在指定了目标物点之后,估计出在XOZ面上公共光心和目标物点之
间的距离。例如,根据第三方软件估计出在一具体的场景中该目标物点的深度为10m,或者20m等。In this step, the target object point may be specified by the user according to the object point of interest in the captured image, or may be specified according to the main target object or the content in the scene. After specifying the target point, estimate the common optical center and target point on the XOZ plane.
The distance between them. For example, the depth of the target point in a specific scene is estimated to be 10 m, or 20 m, etc. according to third party software.
图4a为依据本发明一实施例的对第二坐标进行修正的坐标示意图。如图4a所示,目标物点为入射光上的物点P1,上述距离即为P1在XOZ面上投影的长度,即O到P′之间的长度,记为R0,该距离也称之为物点P1的深度。4a is a schematic diagram of coordinates for correcting a second coordinate according to an embodiment of the invention. As shown in Figure 4a, the target point is incident light. On the object point P 1 , the above distance is the projection of P 1 on the XOZ plane The length, that is, the length between 0 and P', is denoted as R 0 , which is also referred to as the depth of the object point P 1 .
步骤302,获取该摄像装置的光心相对于公共光心的偏移量。Step 302: Obtain an offset of the optical center of the imaging device relative to the common optical center.
本步骤中,考虑到在一个摄像设备中相邻两个摄像装置所拍摄的图像之间具备重叠部分,根据重叠图像的样本数据以及和摄像装置的对应/匹配关系进行回归或者仿真估计,可以确定出上述偏移量。例如,一个全景(即360°)视频系统,在三维空间中安置有多个照相机,每个照相机拍摄到一定视角范围内的图像。In this step, considering that there is an overlapping portion between images captured by two adjacent imaging devices in one imaging device, regression or simulation estimation may be performed according to sample data of the overlapping image and corresponding/matching relationship with the imaging device. The above offset is given. For example, a panoramic (ie 360°) video system in which three cameras are placed in a three-dimensional space, each camera capturing an image within a certain range of viewing angles.
图4b为依据本发明一实施例的确定偏移量的坐标示意图。如图4b所示,在三维球面400所构建的ABC坐标系中,在不同位置上布置有照相机401和402,二者所拍摄的图像具有重叠部分。根据重叠图像的样本数据可以确定出每个照相机的光心O′与原点O之间的偏移量。回到图4a中,光心O′相对于原点O在X轴、Y轴和Z轴上的偏移量分别为Tx,Ty,Tz。4b is a schematic diagram of coordinates for determining an offset according to an embodiment of the invention. As shown in Fig. 4b, in the ABC coordinate system constructed by the three-dimensional spherical surface 400, cameras 401 and 402 are arranged at different positions, and the images taken by the two have overlapping portions. The offset between the optical center O' of each camera and the origin O can be determined from the sample data of the superimposed image. Back to the figures, the optical center O 4a 'with respect to the origin O in the offset X axis, Y axis and Z axis are T x, T y, T z .
步骤303,根据距离、偏移量和第二坐标计算出第三坐标。 Step 303, calculating a third coordinate according to the distance, the offset, and the second coordinate.
对第二坐标进行修正,可以按照如下公式计算得到第三坐标(x3,y3,z3)中的每个坐标值x3、y3和z3:
Correcting the second coordinate, each coordinate value x 3 , y 3 , and z 3 in the third coordinate (x 3 , y 3 , z 3 ) can be calculated according to the following formula:
步骤104,根据所有图像中每个像素的第三坐标对所有图像进行拼接。 Step 104, splicing all images according to the third coordinate of each pixel in all images.
针对每个图像中的每个像素进行上述处理后,根据每个摄像装置在摄像设备中所处的位置,按照某种投影类型对所有处理后的图像进行拼接,从而获得在目标物点所处的深度面上无任何视差的全景图像。After performing the above processing for each pixel in each image, according to the position of each imaging device in the imaging device, all the processed images are spliced according to a certain projection type, thereby obtaining the target object point. A panoramic image without any parallax on the depth surface.
在本实施例中,通过获取至少两个摄像装置各自拍摄到的图像,针对每个摄像装置,以预设的至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系,针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标,根据所有图像中每个像素的第三坐标对所有图像进行拼接,提供了一种无视差拼接深度面的技术,可以自适应的选择场景中的主要内容所在深度位置作为无视差拼接深度面,使得场景中的主要内容呈现无视差瑕疵的拼接效果。In this embodiment, by acquiring images captured by at least two imaging devices, for each imaging device, a three-dimensional coordinate system of the imaging device is constructed with a common optical center of at least two preset imaging devices as an origin, Each pixel in an image captured by each camera device performs a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; The optical center of the device and the target object point specified in the image, the second coordinate is corrected to obtain a third coordinate, and all the images are spliced according to the third coordinate of each pixel in all images, thereby providing a non-parallax splicing The depth surface technology can adaptively select the depth position of the main content in the scene as the non-parallax stitching depth surface, so that the main content in the scene presents a non-parallas stitching effect.
此外,上述方法中坐标的转换和光心偏移的补偿,与目标物点的几何特性无关,不依赖于具体的目标物点的形状,更适用于在时间维度上内容不断变化的视频应用。和现有技术相比,上述方法无需对场景内容进行特征检测与特征匹配,从而可以快速灵活的根据用户指定的目标物
点(或者指定的无视差拼接深度面),对期望位置处的物点或场景内容进行完整对齐,提供无视差的拼接图像。并且,上述方法和摄像装置的具体成像几何公式、最终拼接的投影类型也无关,因此,具有通用性,提高了图像拼接装置的资源利用率。In addition, the coordinate conversion and the compensation of the optical center offset in the above method are independent of the geometric characteristics of the target object point, and are not dependent on the shape of the specific target object point, and are more suitable for video applications whose content is constantly changing in the time dimension. Compared with the prior art, the above method does not need to perform feature detection and feature matching on the scene content, so that the user can specify the target object quickly and flexibly.
The point (or the specified non-parallax stitching depth surface) provides a complete alignment of the object point or scene content at the desired location, providing a stitched image with no parallax. Moreover, the above method and the specific imaging geometric formula of the imaging device and the projection type of the final stitching are also irrelevant, and therefore, have versatility, and improve resource utilization of the image splicing device.
图5为依据本发明另一实施例的图像拼接方法的示例性流程图。如图5所示,该方法应用于包括至少两个摄像装置的摄像设备,包括如下步骤:FIG. 5 is an exemplary flowchart of an image stitching method according to another embodiment of the present invention. As shown in FIG. 5, the method is applied to an image pickup apparatus including at least two image pickup apparatuses, and includes the following steps:
步骤501,获取至少两个摄像装置各自拍摄到的图像。Step 501: Acquire an image captured by each of the at least two imaging devices.
步骤502,针对每个摄像装置,以预设的至少两个摄像装置的公共光心为原点构建该摄像装置的笛卡尔坐标系。Step 502: For each camera device, construct a Cartesian coordinate system of the camera device with the common optical center of the preset at least two camera devices as an origin.
步骤503,针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理: Step 503, performing the following processing for each pixel in an image captured by each camera:
步骤5031,进行坐标转换: Step 5031, performing coordinate conversion:
将该像素在该图像的二维坐标系下的第一坐标转换为该笛卡尔坐标系下的第二坐标;Converting the first coordinate of the pixel in the two-dimensional coordinate system of the image to the second coordinate in the Cartesian coordinate system;
步骤5032,进行光心偏移补偿:In step 5032, the optical center offset compensation is performed:
根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标。The second coordinate is corrected based on the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate.
由上述公式(2)可以看出,第二坐标的模为1,即所建立的笛卡尔坐标系是归一化的笛卡尔坐标系。由于归一化笛卡尔坐标系是不含深度信息的,所以在同一入射光线上两个深度不同的物点拥有相同的归一化笛卡尔坐标值。如图2所示,将p1′转换到归一化笛卡尔坐标系(X,Y,Z)下对应的物点不仅仅是P1,除了P1,还可以是沿着入射光上的其他物点,如图2中的P2。物点P1和P2的深度不同,即在XOZ面上相对
于光心O之间的距离不同,但是二者拥有相同的归一化笛卡尔坐标值(x2,y2,z2),都对应于成像面x'o'y'上的p1′。It can be seen from the above formula (2) that the modulus of the second coordinate is 1, that is, the established Cartesian coordinate system is a normalized Cartesian coordinate system. Since the normalized Cartesian coordinate system does not contain depth information, it is in the same incident light. The upper two object points with different depths have the same normalized Cartesian coordinate values. As shown, p 1 '2 converted to the corresponding normalized Cartesian coordinate system (X, Y, Z) is not only the object point P 1, except that P 1, may also be along the incident light Other objects on the point, as shown in Figure 2 P 2 . The depths of the object points P 1 and P 2 are different, that is, the distances between the XOZ planes and the optical center O are different, but the two have the same normalized Cartesian coordinate values (x 2 , y 2 , z 2 ). Both correspond to p 1 ' on the imaging plane x'o'y'.
步骤504,根据每个摄像装置在摄像设备中所处的位置,按照预设的投影类型将第三坐标投影到单位全景球面中。Step 504: Project the third coordinate into the unit panoramic sphere according to a preset projection type according to the position of each camera in the imaging device.
当所有的摄像装置组成了一个全景的摄像设备时,将第三坐标投影到一单位全景球面中。预设的投影类型包括但不限于:直线型(rectilinear)、鱼眼型(fisheye)、等矩柱状投影(equirectangular)、正射投影(orthographic)、球面投影(stereographic)等。When all of the cameras constitute a panoramic camera device, the third coordinates are projected into a unit of panoramic sphere. Preset projection types include, but are not limited to, rectilinear, fisheye, equirectangular, orthographic, stereographic, and the like.
步骤505,在单位全景球面中将所有的图像进行拼接,得到全景图像。 Step 505, splicing all the images in the unit panoramic spherical surface to obtain a panoramic image.
通过上述步骤,在拼接后的全景图像中,能够在指定的目标物点位置上达到无视差的拼接深度面,相邻图像完全对齐,得到无拼接瑕疵的效果。在向用户展示图像时,可以将三维的全景图像再转换为二维的图像。Through the above steps, in the spliced panoramic image, the splicing depth surface without parallax can be reached at the specified target object point position, and the adjacent images are completely aligned, and the effect of no splicing 瑕疵 is obtained. When an image is presented to a user, the three-dimensional panoramic image can be reconverted into a two-dimensional image.
图6a为依据本发明一实施例的拼接前的二维图像示意图。其中,在左图600中,目标物点为距离镜头最近的第一个旗杆(如箭头601所示),对应于图4a中所示的P1-P′。在光心偏移补偿之前,在该旗杆处出现由于视差导致的上下、左右图像不对齐现象。在右图610中可以清楚的看到,旗杆的顶端611的左下方还出现多余的点611′,旗帜原本为612所示的图像,但是由于视差,导致最终成像的为612′(如虚线所示)。FIG. 6a is a schematic diagram of a two-dimensional image before splicing according to an embodiment of the invention. Wherein, in the left diagram 600, the target point is the first flagpole closest to the lens (as indicated by arrow 601), corresponding to P1-P' shown in Figure 4a. Before the optical center offset compensation, the up, down, left and right image misalignment due to parallax occurs at the flagpole. As can be clearly seen in the right diagram 610, the extra point 611' appears at the lower left of the top end 611 of the flagpole. The flag is originally the image shown at 612, but due to the parallax, the final image is 612' (as indicated by the dotted line). Show).
图6b为依据本发明一实施例的拼接后的二维图像示意图。相应地,左图620为经过坐标变换、光心偏移补偿后的成像,在旗杆处上下图像完美对齐。在右图630中可以清楚的看到,在顶端611和旗帜612之外没有对齐的图像都消失,展现出了清晰的旗杆。可见,实现了对场景中
主要内容物(即旗杆)的完美对齐,在旗杆位置处,成为无视差拼接深度面。FIG. 6b is a schematic diagram of a two-dimensional image after splicing according to an embodiment of the invention. Correspondingly, the left picture 620 is the image after the coordinate transformation and the optical center offset compensation, and the upper and lower images are perfectly aligned at the flagpole. As can be clearly seen in the right diagram 630, images that are not aligned outside of the top 611 and the flag 612 disappear, showing a clear flagpole. Visible, implemented in the scene
The perfect alignment of the main contents (ie, the flagpole), at the position of the flagpole, becomes the non-parallax stitching depth surface.
在具体应用时,还可以采用逆向处理的方式,即在一张空白的全景画布(canvas)上,逐像素执行逆处理过程(即依次执行步骤5032所述的光心偏移补偿、步骤5031所述的坐标转换操作),找到它对应到的摄像装置所捕获图像的像素位置,然后插值得到当前全景画布上该像素的实际值。In a specific application, reverse processing may also be adopted, that is, the inverse processing is performed pixel by pixel on a blank panoramic canvas (ie, the optical center offset compensation described in step 5032 is sequentially performed, step 5031). The coordinate conversion operation described) finds the pixel position of the image captured by the camera device corresponding thereto, and then interpolates to obtain the actual value of the pixel on the current panoramic canvas.
图7依据本发明一实施例的图像拼接装置的结构示意图。如图7所示,图像拼接装置700包括获取模块710、坐标系构建模块720、坐标处理模块730和拼接模块740,其中,FIG. 7 is a schematic structural diagram of an image splicing apparatus according to an embodiment of the present invention. As shown in FIG. 7, the image splicing device 700 includes an obtaining module 710, a coordinate system building module 720, a coordinate processing module 730, and a splicing module 740, where
获取模块710,用于获取至少两个摄像装置各自拍摄到的图像;The acquiring module 710 is configured to acquire an image captured by each of the at least two camera devices;
坐标系构建模块720,用于针对每个摄像装置,以预设的至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;a coordinate system construction module 720, configured to construct, for each camera device, a three-dimensional coordinate system of the camera device with a common optical center of at least two preset imaging devices as an origin;
坐标处理模块730,用于针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标;及,The coordinate processing module 730 is configured to, for each pixel in an image captured by each camera device, perform a process of converting the first coordinate of the pixel in the two-dimensional coordinate system of the image into the three-dimensional coordinate system. a second coordinate; correcting the second coordinate according to the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate; and
拼接模块740,用于根据所有图像中每个像素的第三坐标对所有图像进行拼接。The splicing module 740 is configured to splicing all the images according to the third coordinate of each pixel in all the images.
在一实施例中,坐标处理模块730包括转换单元731,用于根据第一坐标确定该像素的角坐标;根据该摄像装置的透镜成像几何函数和第一坐标确定入射光与该三维坐标系(X,Y,Z)中Z轴之间的夹角;根据角坐标和夹角计算出第二坐标。In an embodiment, the coordinate processing module 730 includes a conversion unit 731 for determining an angular coordinate of the pixel according to the first coordinate, and determining the incident light and the three-dimensional coordinate system according to the lens imaging geometric function and the first coordinate of the imaging device ( The angle between the Z axes in X, Y, Z); the second coordinate is calculated from the angular coordinates and the included angle.
在一实施例中,若第一坐标表示为(x1,y1),角坐标表示为转换单元731用于,确定:
In an embodiment, if the first coordinate is represented by (x 1 , y 1 ), the angular coordinate is expressed as The converting unit 731 is configured to determine:
该三维坐标系为笛卡尔坐标系,若第二坐标表示为(x2,y2,z2),夹角表示为θ,转换单元731用于,按照如下公式计算得到x2、y2和z2:The three-dimensional coordinate system is a Cartesian coordinate system. If the second coordinate is represented by (x 2 , y 2 , z 2 ) and the angle is represented by θ, the conversion unit 731 is configured to calculate x 2 , y 2 and according to the following formula. z 2 :
z2=cos(θ)z 2 =cos(θ)
在一实施例中,坐标处理模块730包括修正单元732,用于获取公共光心和目标物点之间的距离;获取该摄像装置的光心相对于公共光心的偏移量;根据距离、偏移量和第二坐标计算出第三坐标。In an embodiment, the coordinate processing module 730 includes a correction unit 732 for acquiring a distance between the common optical center and the target object point; acquiring an offset of the optical center of the imaging device with respect to the common optical center; The offset and the second coordinate calculate the third coordinate.
在一实施例中,若距离表示为R0,偏移量表示为(Tx,Ty,Tz),第二坐标表示为(x2,y2,z2),第三坐标表示为(x3,y3,z3),修正单元732用于,按照如下公式计算得到x3、y3和z3:In an embodiment, if the distance is represented as R 0 , the offset is expressed as (T x , T y , T z ), the second coordinate is represented as (x 2 , y 2 , z 2 ), and the third coordinate is expressed as (x 3 , y 3 , z 3 ), the correcting unit 732 is configured to calculate x 3 , y 3 and z 3 according to the following formula:
在一实施例中,拼接模块740用于,根据每个摄像装置在摄像设备中所处的位置,按照预设的投影类型将第三坐标投影到单位全景球面中;在单位全景球面中将所有的图像进行拼接,得到全景图像。In an embodiment, the splicing module 740 is configured to project the third coordinate into the unit panoramic spherical surface according to a preset projection type according to the position of each camera device in the imaging device; The images are stitched together to obtain a panoramic image.
图8为依据本发明另一实施例的图像拼接装置的结构示意图。该图像拼接装置800可包括:处理器810、存储器820、端口830以及总线
840。处理器810和存储器820通过总线840互联。处理器810可通过端口830接收和发送数据。其中,FIG. 8 is a schematic structural diagram of an image splicing apparatus according to another embodiment of the present invention. The image splicing apparatus 800 can include a processor 810, a memory 820, a port 830, and a bus.
840. Processor 810 and memory 820 are interconnected by a bus 840. Processor 810 can receive and transmit data through port 830. among them,
处理器810用于执行存储器820存储的机器可读指令模块。The processor 810 is configured to execute a machine readable instruction module stored by the memory 820.
存储器820存储有处理器810可执行的机器可读指令模块。处理器810可执行的指令模块包括:获取模块821、坐标系构建模块822、坐标处理模块823和拼接模块824。其中,The memory 820 stores machine readable instruction modules executable by the processor 810. The instruction module executable by the processor 810 includes an acquisition module 821, a coordinate system construction module 822, a coordinate processing module 823, and a splicing module 824. among them,
获取模块821被处理器810执行时可以为:获取至少两个摄像装置各自拍摄到的图像;The acquiring module 821 may be executed by the processor 810 to: acquire an image captured by each of the at least two camera devices;
坐标系构建模块822被处理器810执行时可以为:针对每个摄像装置,以预设的至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;The coordinate system construction module 822 may be configured by the processor 810 to: for each camera device, construct a three-dimensional coordinate system of the camera device with the common optical center of the preset at least two camera devices as an origin;
坐标处理模块823被处理器810执行时可以为:针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标;及,The coordinate processing module 823 may be executed by the processor 810 to: for each pixel in an image captured by each camera device, perform the following process: converting the pixel to the first coordinate in the two-dimensional coordinate system of the image a second coordinate in the three-dimensional coordinate system; correcting the second coordinate according to the optical center of the imaging device and the target object point specified in the image to obtain a third coordinate;
拼接模块824被处理器810执行时可以为:根据所有图像中每个像素的第三坐标对所有图像进行拼接。The splicing module 824, when executed by the processor 810, can splicing all of the images based on the third coordinate of each pixel in all of the images.
由此可以看出,当存储在存储器820中的指令模块被处理器810执行时,可实现前述各个实施例中获取模块、坐标系构建模块、坐标处理模块和拼接模块的各种功能。It can be seen that when the instruction modules stored in the memory 820 are executed by the processor 810, various functions of the acquisition module, the coordinate system construction module, the coordinate processing module, and the splicing module in the foregoing various embodiments can be implemented.
根据本发明又一实施例,一种摄像设备包括至少两个摄像装置、图像显示装置、处理器和存储器,存储器中存储可被处理器执行的指令,当执行指令时,处理器用于:According to still another embodiment of the present invention, an image pickup apparatus includes at least two image pickup apparatuses, an image display apparatus, a processor, and a memory, and the memory stores instructions executable by the processor, and when executing the instructions, the processor is configured to:
获取至少两个摄像装置各自拍摄到的图像;
Acquiring images captured by at least two camera devices;
针对每个摄像装置,以预设的至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;For each imaging device, a three-dimensional coordinate system of the imaging device is constructed with a common optical center of at least two preset imaging devices as an origin;
针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对第二坐标进行修正,得到第三坐标;及,For each pixel in an image captured by each camera device, performing a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; The optical center of the imaging device and the target object point specified in the image are corrected to obtain the third coordinate; and,
根据所有图像中每个像素的第三坐标对所有图像进行拼接;All images are stitched according to the third coordinate of each pixel in all images;
将拼接后的图像通过图像显示装置进行显示。The stitched image is displayed by the image display device.
上述装置和系统实施例中,各个模块及单元实现自身功能的具体方法在方法实施例中均有描述,这里不再赘述。In the foregoing apparatus and system embodiments, specific methods for implementing functions of the respective modules and units are described in the method embodiments, and details are not described herein again.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
另外,本发明的每一个实施例可以通过由数据处理设备如计算机执行的数据处理程序来实现。显然,数据处理程序构成了本发明。此外,通常存储在一个存储介质中的数据处理程序通过直接将程序读取出存储介质或者通过将程序安装或复制到数据处理设备的存储设备(如硬盘和或内存)中执行。因此,这样的存储介质也构成了本发明。存储介质可以使用任何类型的记录方式,例如纸张存储介质(如纸带等)、磁存储介质(如软盘、硬盘、闪存等)、光存储介质(如CD-ROM等)、磁光存储介质(如MO等)等。Additionally, each of the embodiments of the present invention can be implemented by a data processing program executed by a data processing device such as a computer. Obviously, the data processing program constitutes the present invention. Further, a data processing program usually stored in a storage medium is executed by directly reading a program out of a storage medium or by installing or copying the program to a storage device (such as a hard disk and or a memory) of the data processing device. Therefore, such a storage medium also constitutes the present invention. The storage medium can use any type of recording method, such as paper storage medium (such as paper tape, etc.), magnetic storage medium (such as floppy disk, hard disk, flash memory, etc.), optical storage medium (such as CD-ROM, etc.), magneto-optical storage medium ( Such as MO, etc.).
因此,本发明还公开了一种存储介质,其中存储有数据处理程序,该数据处理程序用于执行本发明上述方法的任何一种实施例。Accordingly, the present invention also discloses a storage medium in which is stored a data processing program for performing any of the above-described embodiments of the present invention.
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡
在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。
The above description is only the preferred embodiment of the present application and is not intended to limit the application.
Any modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the present application are intended to be included within the scope of the present disclosure.
Claims (16)
- 一种图像拼接方法,其特征在于,应用于包括至少两个摄像装置的摄像设备,所述方法包括:An image splicing method is applied to an image pickup apparatus including at least two image pickup apparatuses, and the method includes:获取所述至少两个摄像装置各自拍摄到的图像;Acquiring an image captured by each of the at least two camera devices;针对每个摄像装置,以预设的所述至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系;For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:For each pixel in an image captured by each camera, the following processing is performed:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;Converting the pixel to a first coordinate in the two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system;根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标;及,Correcting the second coordinate according to an optical center of the imaging device and a target object point specified in the image to obtain a third coordinate; and根据所有图像中每个像素的所述第三坐标对所有图像进行拼接。All images are stitched according to the third coordinate of each pixel in all images.
- 根据权利要求1所述的方法,其中,若所述三维坐标系表示为(X,Y,Z),所述以预设的所述至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系包括:The method according to claim 1, wherein if the three-dimensional coordinate system is represented as (X, Y, Z), the image pickup device is constructed with a predetermined common optical center of the at least two camera devices as an origin The three-dimensional coordinate system includes:以所述公共光心为原点,在该摄像装置的成像面的平行面上建立二维坐标系(X,Y);Establishing a two-dimensional coordinate system (X, Y) on a parallel plane of the imaging surface of the imaging device with the common optical center as an origin;根据所述二维坐标系(X,Y)和右手定则确定Z轴。The Z axis is determined based on the two-dimensional coordinate system (X, Y) and the right hand rule.
- 根据权利要求1所述的方法,其中,所述将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标包括:The method of claim 1, wherein the converting the first coordinate of the pixel in the two-dimensional coordinate system of the image to the second coordinate in the three-dimensional coordinate system comprises:根据所述第一坐标确定该像素的角坐标;Determining an angular coordinate of the pixel according to the first coordinate;根据该摄像装置的透镜成像几何函数和所述第一坐标确定入射光与该三维坐标系(X,Y,Z)中Z轴之间的夹角;Determining an angle between incident light and a Z-axis in the three-dimensional coordinate system (X, Y, Z) according to a lens imaging geometric function of the imaging device and the first coordinate;根据所述角坐标和所述夹角计算出所述第二坐标。 The second coordinate is calculated according to the angular coordinate and the included angle.
- 根据权利要求3所述的方法,其中,若第一坐标表示为(x1,y1),角坐标表示为所述根据第一坐标确定该像素的角坐标包括:The method according to claim 3, wherein if the first coordinate is expressed as (x 1 , y 1 ), the angular coordinate is expressed as The determining the angular coordinates of the pixel according to the first coordinate comprises:该三维坐标系为笛卡尔坐标系,若第二坐标表示为(x2,y2,z2),夹角表示为θ,所述根据所述夹角和所述角坐标计算出所述第二坐标包括:The three-dimensional coordinate system is a Cartesian coordinate system. If the second coordinate is represented by (x 2 , y 2 , z 2 ), the angle is represented by θ, and the first coordinate is calculated according to the angle and the angular coordinate. The two coordinates include:按照如下公式计算得到x2、y2和z2:Calculate x 2 , y 2 and z 2 according to the following formula:z2=cos(θ)z 2 =cos(θ)
- 根据权利要求3或4所述的方法,其中,所述根据该摄像装置的透镜成像几何函数r(θ)和所述第一坐标(x1,y1)确定入射光与该三维坐标系(X,Y,Z)中Z轴之间的夹角θ包括:The method according to claim 3 or 4, wherein said incident light and said three-dimensional coordinate system are determined according to a lens imaging geometric function r(θ) of said imaging device and said first coordinate (x 1 , y 1 ) The angle θ between the Z axes in X, Y, Z) includes:当该摄像装置的透镜为直线型时,有r(θ)=f·tan(θ),则When the lens of the imaging device is linear, r(θ)=f·tan(θ), then当该摄像装置的透镜为等距型时,有r(θ)=f·θ,则When the lens of the imaging device is of an equidistant type, r(θ)=f·θ, then其中,atan(·)表示取反正切值函数,pw,ph分别表示该像素的宽度与高度,f为透镜的焦距。Where atan(·) represents the inverse tangent function, pw, ph represents the width and height of the pixel, respectively, and f is the focal length of the lens.
- 根据权利要求1所述的方法,其中,所述根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标 包括:The method according to claim 1, wherein said correcting said second coordinates according to an optical center of said image pickup device and a target object point specified in said image, to obtain a third coordinate include:获取所述公共光心和所述目标物点之间的距离;Obtaining a distance between the public optical center and the target object point;获取该摄像装置的光心相对于所述公共光心的偏移量;Obtaining an offset of an optical center of the camera device relative to the common optical center;根据所述距离、所述偏移量和所述第二坐标计算出所述第三坐标。The third coordinate is calculated based on the distance, the offset, and the second coordinate.
- 根据权利要求6所述的方法,其中,所述根据所述距离R0、所述偏移量(Tx,Ty,Tz)和所述第二坐标(x2,y2,z2)计算出所述第三坐标(x3,y3,z3)包括:The method according to claim 6, wherein said according to said distance R 0 , said offset (T x , T y , T z ) and said second coordinate (x 2 , y 2 , z 2 Calculating the third coordinate (x 3 , y 3 , z 3 ) includes:按照如下公式计算得到x3、y3和z3:Calculate x 3 , y 3 and z 3 according to the following formula:
- 根据权利要求1至7中任一项所述的方法,其中,所述根据所有图像中每个像素的所述第三坐标对所有图像进行拼接包括:The method according to any one of claims 1 to 7, wherein said splicing all images according to said third coordinate of each pixel in all images comprises:根据每个摄像装置在所述摄像设备中所处的位置,按照预设的投影类型将所述第三坐标投影到单位全景球面中;And projecting the third coordinate into the unit panoramic spherical surface according to a preset projection type according to a position of each camera device in the imaging device;在所述单位全景球面中将所有的图像进行拼接,得到全景图像。All the images are spliced in the unit panoramic spherical surface to obtain a panoramic image.
- 一种图像拼接装置,其特征在于,包括处理器和存储器,所述存储器中存储可被所述处理器执行的指令,当执行所述指令时,所述处理器用于:An image splicing apparatus, comprising: a processor and a memory, wherein the memory stores instructions executable by the processor, and when the instructions are executed, the processor is configured to:获取至少两个摄像装置各自拍摄到的图像;Acquiring images captured by at least two camera devices;针对每个摄像装置,以预设的所述至少两个摄像装置的公共光心为 原点构建该摄像装置的三维坐标系;For each camera device, the common optical center of the at least two camera devices is preset Constructing a three-dimensional coordinate system of the camera device at an origin;针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标;及,For each pixel in an image captured by each camera device, performing a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; Correcting the second coordinate to obtain a third coordinate by the optical center of the imaging device and the target object point specified in the image; and根据所有图像中每个像素的所述第三坐标对所有图像进行拼接。All images are stitched according to the third coordinate of each pixel in all images.
- 根据权利要求9所述的装置,其中,当执行所述指令时,所述处理器进一步用于:根据所述第一坐标确定该像素的角坐标;根据该摄像装置的透镜成像几何函数和所述第一坐标确定入射光与该三维坐标系(X,Y,Z)中Z轴之间的夹角;根据所述角坐标和所述夹角计算出所述第二坐标。The apparatus according to claim 9, wherein, when the instruction is executed, the processor is further configured to: determine an angular coordinate of the pixel according to the first coordinate; according to a lens imaging geometric function and a location of the imaging device The first coordinate determines an angle between the incident light and the Z axis in the three-dimensional coordinate system (X, Y, Z); the second coordinate is calculated according to the angular coordinate and the included angle.
- 根据权利要求10所述的装置,其中,若第一坐标表示为(x1,y1),角坐标表示为当执行所述指令时,所述处理器进一步用于:确定:The apparatus according to claim 10, wherein if the first coordinate is expressed as (x 1 , y 1 ), the angular coordinate is expressed as When the instructions are executed, the processor is further configured to: determine:该三维坐标系为笛卡尔坐标系,若第二坐标表示为(x2,y2,z2),夹角表示为θ,当执行所述指令时,所述处理器进一步用于:按照如下公式计算得到x2、y2和z2:The three-dimensional coordinate system is a Cartesian coordinate system. If the second coordinate is represented by (x 2 , y 2 , z 2 ), the angle is represented by θ. When the instruction is executed, the processor is further configured to: The formula calculates x 2 , y 2 and z 2 :z2=cos(θ)z 2 =cos(θ)
- 根据权利要求9所述的装置,其中,当执行所述指令时,所述处理器进一步用于:获取所述公共光心和所述目标物点之间的距离;获取该摄像装置的光心相对于所述公共光心的偏移量;根据所述距离、所 述偏移量和所述第二坐标计算出所述第三坐标。The apparatus according to claim 9, wherein, when the instruction is executed, the processor is further configured to: acquire a distance between the common optical center and the target object point; acquire an optical center of the imaging device An offset from the common optical center; according to the distance, The offset and the second coordinate calculate the third coordinate.
- 根据权利要求12所述的装置,其中,若所述距离表示为R0,所述偏移量表示为(Tx,Ty,Tz),所述第二坐标表示为(x2,y2,z2),所述第三坐标表示为(x3,y3,z3),当执行所述指令时,所述处理器进一步用于:按照如下公式计算得到x3、y3和z3:The apparatus according to claim 12, wherein said distance is expressed as (T x , T y , T z ) if said distance is represented as R 0 and said second coordinate is represented as (x 2 , y 2 , z 2 ), the third coordinate is represented as (x 3 , y 3 , z 3 ), when executing the instruction, the processor is further configured to: calculate x 3 , y 3 and according to the following formula z 3 :
- 根据权利要求9至13中任一项所述的装置,其中,当执行所述指令时,所述处理器进一步用于:根据每个摄像装置在摄像设备中所处的位置,按照预设的投影类型将所述第三坐标投影到单位全景球面中;在所述单位全景球面中将所有的图像进行拼接,得到全景图像。The apparatus according to any one of claims 9 to 13, wherein, when the instruction is executed, the processor is further configured to follow a preset according to a position of each camera in the image pickup apparatus The projection type projects the third coordinate into the unit panoramic spherical surface; all the images are spliced in the unit panoramic spherical surface to obtain a panoramic image.
- 一种计算机可读存储介质,其特征在于,存储有计算机可读指令,可以使至少一个处理器执行如权利要求1至8任一项所述的方法。A computer readable storage medium, characterized by storing computer readable instructions, which may cause at least one processor to perform the method of any one of claims 1 to 8.
- 一种摄像设备,其特征在于,包括至少两个摄像装置、图像显示装置、处理器和存储器,所述存储器中存储可被所述处理器执行的指令,当执行所述指令时,所述处理器用于:An image pickup apparatus comprising at least two image pickup apparatuses, an image display apparatus, a processor, and a memory, wherein the memory stores an instruction executable by the processor, and when the instruction is executed, the processing Used for:获取所述至少两个摄像装置各自拍摄到的图像;Acquiring an image captured by each of the at least two camera devices;针对每个摄像装置,以预设的所述至少两个摄像装置的公共光心为原点构建该摄像装置的三维坐标系; For each imaging device, constructing a three-dimensional coordinate system of the imaging device with a common optical center of the at least two imaging devices as a starting point;针对每个摄像装置拍摄到的一图像中的每个像素,执行以下处理:将该像素在该图像的二维坐标系下的第一坐标转换为该三维坐标系下的第二坐标;根据该摄像装置的光心和该图像中指定的目标物点,对所述第二坐标进行修正,得到第三坐标;及,For each pixel in an image captured by each camera device, performing a process of converting a first coordinate of the pixel in a two-dimensional coordinate system of the image to a second coordinate in the three-dimensional coordinate system; Correcting the second coordinate to obtain a third coordinate by the optical center of the imaging device and the target object point specified in the image; and根据所有图像中每个像素的所述第三坐标对所有图像进行拼接;All images are stitched according to the third coordinate of each pixel in all images;将拼接后的图像通过所述图像显示装置进行显示。 The stitched image is displayed by the image display device.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610890008.9A CN106331527B (en) | 2016-10-12 | 2016-10-12 | A kind of image split-joint method and device |
CN201610890008.9 | 2016-10-12 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018068719A1 true WO2018068719A1 (en) | 2018-04-19 |
Family
ID=57820319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/105657 WO2018068719A1 (en) | 2016-10-12 | 2017-10-11 | Image stitching method and apparatus |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106331527B (en) |
WO (1) | WO2018068719A1 (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111142825A (en) * | 2019-12-27 | 2020-05-12 | 杭州拓叭吧科技有限公司 | Multi-screen view display method and system and electronic equipment |
CN113873220A (en) * | 2020-12-03 | 2021-12-31 | 上海飞机制造有限公司 | Deviation analysis method, device, system, equipment and storage medium |
CN114554176A (en) * | 2022-01-24 | 2022-05-27 | 北京有竹居网络技术有限公司 | Depth camera |
CN115781665A (en) * | 2022-11-01 | 2023-03-14 | 深圳史河机器人科技有限公司 | Monocular camera-based mechanical arm control method and device and storage medium |
CN116643393A (en) * | 2023-07-27 | 2023-08-25 | 南京木木西里科技有限公司 | Microscopic image deflection-based processing method and system |
CN118118645A (en) * | 2024-04-23 | 2024-05-31 | 北京工业大学 | Panoramic farm implementation method and device based on VR technology |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106331527B (en) * | 2016-10-12 | 2019-05-17 | 腾讯科技(北京)有限公司 | A kind of image split-joint method and device |
US10885650B2 (en) | 2017-02-23 | 2021-01-05 | Eys3D Microelectronics, Co. | Image device utilizing non-planar projection images to generate a depth map and related method thereof |
CN110519774B (en) * | 2018-05-21 | 2023-04-18 | 中国移动通信集团广东有限公司 | Base station investigation method, system and equipment based on VR technology |
EP3606032B1 (en) * | 2018-07-30 | 2020-10-21 | Axis AB | Method and camera system combining views from plurality of cameras |
CN109889736B (en) * | 2019-01-10 | 2020-06-19 | 深圳市沃特沃德股份有限公司 | Image acquisition method, device and equipment based on double cameras and multiple cameras |
CN110072158B (en) * | 2019-05-06 | 2021-06-04 | 复旦大学 | Spherical equator area double-C type panoramic video projection method |
CN112449100B (en) * | 2019-09-03 | 2023-11-17 | 中国科学院长春光学精密机械与物理研究所 | Aviation camera inclined image splicing method, device, terminal and storage medium |
US11645780B2 (en) | 2020-03-16 | 2023-05-09 | Realsee (Beijing) Technology Co., Ltd. | Method and device for collecting images of a scene for generating virtual reality data |
CN111432119B (en) * | 2020-03-27 | 2021-03-23 | 北京房江湖科技有限公司 | Image shooting method and device, computer readable storage medium and electronic equipment |
CN112771842A (en) * | 2020-06-02 | 2021-05-07 | 深圳市大疆创新科技有限公司 | Imaging method, imaging apparatus, computer-readable storage medium |
CN112669199B (en) * | 2020-12-16 | 2022-06-21 | 影石创新科技股份有限公司 | Image stitching method, computer-readable storage medium and computer device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030184778A1 (en) * | 2002-03-28 | 2003-10-02 | Sanyo Electric Co., Ltd. | Image processing method, image processing apparatus, computer program product and computer memory product |
CN101710932A (en) * | 2009-12-21 | 2010-05-19 | 深圳华为通信技术有限公司 | Image stitching method and device |
CN102798350A (en) * | 2012-07-10 | 2012-11-28 | 中联重科股份有限公司 | Method, device and system for measuring deflection of arm support |
CN103379267A (en) * | 2012-04-16 | 2013-10-30 | 鸿富锦精密工业(深圳)有限公司 | Three-dimensional space image acquisition system and method |
CN106331527A (en) * | 2016-10-12 | 2017-01-11 | 腾讯科技(北京)有限公司 | Image splicing method and device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6972796B2 (en) * | 2000-02-29 | 2005-12-06 | Matsushita Electric Industrial Co., Ltd. | Image pickup system and vehicle-mounted-type sensor system |
KR20020025301A (en) * | 2000-09-28 | 2002-04-04 | 오길록 | Apparatus and Method for Furnishing Augmented-Reality Graphic using Panoramic Image with Supporting Multiuser |
CN101521745B (en) * | 2009-04-14 | 2011-04-13 | 王广生 | Multi-lens optical center superposing type omnibearing shooting device and panoramic shooting and retransmitting method |
CN101783883B (en) * | 2009-12-26 | 2012-08-29 | 华为终端有限公司 | Adjusting method in co-optical-center videography and co-optical-center camera system |
US10666860B2 (en) * | 2012-09-11 | 2020-05-26 | Ricoh Company, Ltd. | Image processor, image processing method and program, and imaging system |
CN104506764A (en) * | 2014-11-17 | 2015-04-08 | 南京泓众电子科技有限公司 | An automobile traveling recording system based on a spliced video image |
CN105812640A (en) * | 2016-05-27 | 2016-07-27 | 北京伟开赛德科技发展有限公司 | Spherical omni-directional camera device and video image transmission method thereof |
-
2016
- 2016-10-12 CN CN201610890008.9A patent/CN106331527B/en active Active
-
2017
- 2017-10-11 WO PCT/CN2017/105657 patent/WO2018068719A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030184778A1 (en) * | 2002-03-28 | 2003-10-02 | Sanyo Electric Co., Ltd. | Image processing method, image processing apparatus, computer program product and computer memory product |
CN101710932A (en) * | 2009-12-21 | 2010-05-19 | 深圳华为通信技术有限公司 | Image stitching method and device |
CN103379267A (en) * | 2012-04-16 | 2013-10-30 | 鸿富锦精密工业(深圳)有限公司 | Three-dimensional space image acquisition system and method |
CN102798350A (en) * | 2012-07-10 | 2012-11-28 | 中联重科股份有限公司 | Method, device and system for measuring deflection of arm support |
CN106331527A (en) * | 2016-10-12 | 2017-01-11 | 腾讯科技(北京)有限公司 | Image splicing method and device |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111142825A (en) * | 2019-12-27 | 2020-05-12 | 杭州拓叭吧科技有限公司 | Multi-screen view display method and system and electronic equipment |
CN111142825B (en) * | 2019-12-27 | 2024-04-16 | 杭州拓叭吧科技有限公司 | Multi-screen visual field display method and system and electronic equipment |
CN113873220A (en) * | 2020-12-03 | 2021-12-31 | 上海飞机制造有限公司 | Deviation analysis method, device, system, equipment and storage medium |
CN114554176A (en) * | 2022-01-24 | 2022-05-27 | 北京有竹居网络技术有限公司 | Depth camera |
CN115781665A (en) * | 2022-11-01 | 2023-03-14 | 深圳史河机器人科技有限公司 | Monocular camera-based mechanical arm control method and device and storage medium |
CN115781665B (en) * | 2022-11-01 | 2023-08-08 | 深圳史河机器人科技有限公司 | Mechanical arm control method and device based on monocular camera and storage medium |
CN116643393A (en) * | 2023-07-27 | 2023-08-25 | 南京木木西里科技有限公司 | Microscopic image deflection-based processing method and system |
CN116643393B (en) * | 2023-07-27 | 2023-10-27 | 南京木木西里科技有限公司 | Microscopic image deflection-based processing method and system |
CN118118645A (en) * | 2024-04-23 | 2024-05-31 | 北京工业大学 | Panoramic farm implementation method and device based on VR technology |
Also Published As
Publication number | Publication date |
---|---|
CN106331527A (en) | 2017-01-11 |
CN106331527B (en) | 2019-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018068719A1 (en) | Image stitching method and apparatus | |
US10609282B2 (en) | Wide-area image acquiring method and apparatus | |
CN109087244B (en) | Panoramic image splicing method, intelligent terminal and storage medium | |
CN110809786B (en) | Calibration device, calibration chart, chart pattern generation device, and calibration method | |
CN101673395B (en) | Image mosaic method and image mosaic device | |
JP2017112602A (en) | Image calibrating, stitching and depth rebuilding method of panoramic fish-eye camera and system thereof | |
US20110249117A1 (en) | Imaging device, distance measuring method, and non-transitory computer-readable recording medium storing a program | |
JP2017108387A (en) | Image calibrating, stitching and depth rebuilding method of panoramic fish-eye camera and system thereof | |
CN106709865B (en) | Depth image synthesis method and device | |
US8155387B2 (en) | Method and system for position determination using image deformation | |
US10063792B1 (en) | Formatting stitched panoramic frames for transmission | |
JP2007192832A (en) | Calibrating method of fish eye camera | |
WO2016155110A1 (en) | Method and system for correcting image perspective distortion | |
KR102200866B1 (en) | 3-dimensional modeling method using 2-dimensional image | |
WO2020151268A1 (en) | Generation method for 3d asteroid dynamic map and portable terminal | |
JP2024537798A (en) | Photographing and measuring method, device, equipment and storage medium | |
CN108282650B (en) | Naked eye three-dimensional display method, device and system and storage medium | |
CN109785225B (en) | Method and device for correcting image | |
TWI615808B (en) | Image processing method for immediately producing panoramic images | |
JPWO2018167918A1 (en) | Projector, mapping data creation method, program, and projection mapping system | |
TW201342303A (en) | Three-dimensional image obtaining system and three-dimensional image obtaining method | |
WO2021093804A1 (en) | Omnidirectional stereo vision camera configuration system and camera configuration method | |
WO2018006669A1 (en) | Parallax fusion method and apparatus | |
TW201439664A (en) | Controlling method and electronic apparatus | |
JP2018032991A (en) | Image display unit, image display method and computer program for image display |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17860624 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17860624 Country of ref document: EP Kind code of ref document: A1 |