WO2020143090A1 - 基于多摄像头的图像获取方法、装置及设备 - Google Patents
基于多摄像头的图像获取方法、装置及设备 Download PDFInfo
- Publication number
- WO2020143090A1 WO2020143090A1 PCT/CN2019/073764 CN2019073764W WO2020143090A1 WO 2020143090 A1 WO2020143090 A1 WO 2020143090A1 CN 2019073764 W CN2019073764 W CN 2019073764W WO 2020143090 A1 WO2020143090 A1 WO 2020143090A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- camera
- image
- function
- overlapping area
- boundary
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
-
- 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/90—Arrangement of cameras or camera modules, e.g. multiple cameras in TV studios or sports stadiums
-
- 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
Definitions
- the invention relates to the field of imaging, in particular to an image acquisition method, device and equipment based on multiple cameras.
- the main object of the present invention is to provide an image acquisition method, device and equipment based on multiple cameras, which can remove overlapping regions only by the geometric optics method, thereby increasing the speed of the stitching process.
- the invention provides an image acquisition method based on multiple cameras, including:
- This application provides an image acquisition device based on multiple cameras, including:
- the simultaneous acquisition unit is configured to acquire the first image captured by the first camera and the second image captured by the second camera simultaneously with the first camera;
- An overlapping area acquisition unit configured to obtain an overlapping area of the first image and the second image via geometric optics
- a backup image generating unit configured to remove the overlapping area in the first image to obtain a backup image after removing the overlapping area
- a stitching unit is used to stitch the backup image and the second image.
- the present application provides an apparatus, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, and the processor implements the computer program as described in any one of the foregoing The described image acquisition method based on multiple cameras.
- the present invention has the beneficial effect that, according to the multi-camera-based image acquisition method, device and equipment provided by the present invention, the overlapping area in the images captured by different cameras is calculated by geometric optics and before the stitching process , Delete the overlapping area in the image formed by the first camera, thereby reducing the stitching operation of each pixel in the overlapping area when stitching multiple images, that is to say, it is not necessary to use the pixel level of each image frame.
- the comparison algorithm plays a technical effect of saving splicing calculation power and accelerating splicing speed.
- FIG. 1 is a schematic flowchart of an image acquisition method based on multiple cameras according to an embodiment of the present application
- FIG. 2 is a schematic block diagram of a structure of an image acquisition device based on multiple cameras according to an embodiment of the present application
- FIG. 3 is a structural block diagram of a storage medium according to an embodiment of the application.
- FIG. 4 is a structural block diagram of a device according to an embodiment of the application.
- FIG. 5-7 are schematic diagrams of the principle of the image acquisition method based on multiple cameras of this application.
- Figures a and b are schematic diagrams of the auxiliary lines made when calculating the coordinate values of point A 1 and point B 1 in Figure 6;
- FIG. c is a schematic diagram of the auxiliary line made when calculating the coordinate value of point B 2 in FIG. 7 of the present application.
- A2 is the first camera
- A1 is the second camera
- f is the focus
- A is the point that can be imaged in the first camera and the second camera at the same time
- line l1 is the connection between the lower end of the first camera and the focus
- line l2 is the second The upper end of the camera is connected to the focus.
- an embodiment of an image acquisition method based on multiple cameras includes:
- the multi-camera means that the number of cameras is two or more than two.
- the center of the distance between the first camera (lens A2 in the figure below) and the second camera (lens A1 in the figure above) is taken as the origin, and the center of the first camera is
- the center line of the second camera is the y-axis
- the parallel line passing through the origin between the center of the first camera and the focal length of the first camera is the x-axis
- the z-axis is perpendicular to the y-axis and the x-axis
- the vertical paper establish a three-dimensional rectangular coordinate system; the left-side cone formed by the straight line l1 (the connection between the lower end of the first camera and the focal length, ie the imaging boundary) and the straight line l2 (the connection between the upper end of the second camera and the focal length, ie the imaging boundary)
- the body area is the area that can be imaged by both the first camera and the second camera (that is, point A can be imaged by the first camera and the
- AB is the target to be imaged
- AB is the solid area corresponding to the overlapped area of imaging
- A(-u1,h1 ) Is the intersection point with the l1 line
- B(-u2,-h2) is the intersection point with the l2 line
- using geometric optics to calculate the coordinates A 1 and B 1 (the imaging point coordinates of the first camera)
- a 2 and B 2 (the coordinates of the imaging point of the second camera)
- a 1 and B 1 are boundary points/critical points
- the coordinates of A 1 and B 1 can be obtained to know the imaging A 1 B 1 , A 2 B 2 is the same, and then A 1 B 1 or A 2 B 2 can be removed.
- the calculation method of the coordinates of A 1 ⁇ B 1 ⁇ A 2 ⁇ B 2 combines the imaging principle and similar triangles. It is assumed that the diameter of the camera (that is, the convex lens) is r, the distance between the two cameras is d, and the focal length of the lens is f. The following describes the coordinates of the point A 1 of the method for finding.
- step S1 the first image captured by the first camera and the second image captured by the second camera simultaneously with the first camera are acquired. According to this, the first image and the second image captured simultaneously are obtained as a basis for subsequent stitching.
- the overlapping area of the first image and the second image is obtained via geometric optics.
- Any feasible method can be used to obtain the overlapping area of the first image and the second image through geometric optics, for example: establishing a first framing boundary function of the first camera and a second framing boundary function of the second camera, and calculating the first framing The boundary function and the framing boundary intersection curve function of the second framing boundary function; obtain the object distance, and substitute the object distance into the framing boundary intersection curve function to obtain the first intersection curve function; according to the imaging principle, calculate the first An intersection curve function is a first intersection curve imaging function imaged by the first camera, and the area enclosed by the first intersection curve imaging function is the overlapping area of the first image and the second image; the overlapping area is acquired.
- the overlapping area is removed from the first image to obtain a backup image after removing the overlapping area.
- the overlapping area is the area overlapping the second image in the image acquired by the first camera. Therefore, in order to obtain a suitable image, the overlapping area should be removed in the first image.
- the stitching method may include: based on the backup image, incorporating the second image into the backup image from a first predetermined direction, where the first predetermined direction refers to a direction in which the second camera points to the first camera Or, based on the second image, the backup image is merged into the second image from a second predetermined direction, where the second predetermined direction refers to the direction in which the first camera points to the second camera. Therefore, the original image is stitched and synthesized into the final image, which avoids the process of copying the image data and searching for the stitching path, which is convenient and fast.
- the step S2 of obtaining the overlapping area of the first image and the second image via geometric optics includes:
- S203 Calculate the first intersection curve function imaged by the first camera according to the imaging principle.
- the area enclosed by the first intersection curve function is the overlap of the first image and the second image. area;
- the parameters of the first camera and the second camera are the same, and the viewing range may be a cone range.
- the shape of the "cone” is only an implementation example, not Constitute the limitations of this solution in other possible embodiments.
- the camera framing has a range and cannot be shot 360 degrees without a dead angle. Therefore, the range that the camera can shoot can be expressed by the range circled by the three-dimensional function, and the boundary of the range that the camera can shoot is called the framing boundary function.
- the parameters of the first camera and the second camera may also be different, and the viewfinder range may be any feasible range.
- the intersection area of the two cones is the overlapping viewfinder area
- the boundary curve of the overlapping viewfinder area is the viewfinder intersection curve
- the function of this curve is the viewfinder intersection curve function.
- the specific calculation method can calculate the intersection curve function of the framing boundary through the method of analytical geometry. Obtain the object distance, and substitute the object distance into the view boundary intersection curve function to obtain the first intersection curve function.
- the object distance refers to the distance between the vertical plane of the object to be photographed and the vertical plane of the multi-camera, which can be set by the user to operate, such as manually inputting the parameter of the object distance, or the user selects the object to The object distance is calculated by the multi-camera distance measurement principle.
- the principle of multi-camera distance measurement is an existing technology and will not be repeated here.
- the first intersection curve function is a function of the intersection curve of the view boundary intersection curve function and the vertical plane where the object corresponding to the object distance is located (that is, the vertical plane where the subject is located), which is a two-dimensional closed curve
- the aforementioned intersection boundary curve function of the viewfinder is a function of three-dimensional space.
- the imaging principle the first intersection curve imaging function of the first intersection curve function imaged by the first camera is calculated, and the area enclosed by the first intersection curve imaging function is the overlapping area on the imaging side. Based on the imaging principle, under the premise that the camera parameters are known, the image formed by the photographed object is certain. According to this, the first intersection curve imaging function that is imaged by the first camera with the first intersection curve function can be obtained.
- the calculation method adopts the method of analytic geometry, which will not be described in detail.
- the framing ranges of the first camera and the second camera are both conical, and the first framing boundary function of the first camera and the second framing boundary function of the second camera are calculated.
- the step S201 of the intersection curve function of the first framing boundary function and the framing boundary of the second framing boundary function includes:
- the intersection curve function of the framing boundary of the first camera and the second camera is calculated. It is worth mentioning that the three-dimensional coordinate system is different from the dimensional directions defined by the coordinate system described and illustrated in FIG. 5, Different coordinate systems are only for the content described, and do not cause conflicts.
- the framing range of the present application may not be conical. At this time, the parameter r is set to different values according to the framing range, so that it can be applied to various lenses.
- the obtaining object distance includes:
- the first intersection curve function is obtained.
- the first camera is turned on first, and the user can select the subject of interest in the temporary image acquired by the first camera, and set the object distance accordingly, or the target subject can be obtained through specific settings, such as in the first camera Within the range of the camera to extract the subject located in a special area to meet different needs.
- the method of obtaining the object distance is to use the multi-camera distance measuring principle.
- step S4 of splicing the backup image and the second image it includes:
- the overlapping content is further deleted. Since the previous step has deleted an overlapping area determined by the object distance value before stitching the image, the remaining overlapping content is not much. On this basis, the overlapping pixels are further deleted, thereby further improving the quality of the image. In addition, since there are not many overlapping contents left, there are not many pixels to be deleted in this embodiment, which can greatly reduce the demand for computing power.
- the reason for the occurrence of duplicate pixels is introduced here:
- the viewfinder range of the camera is continuously extended toward the object side in a tapered shape, so the overlapping part of the viewfinder range of the two cameras is also continuously extended
- the overlapping area obtained before in this embodiment refers to the overlapping area of the part determined according to an object distance value in the overlapping portion extending toward the object side, that is, when the value is greater than the object distance value Objects in the extended space of the camera still exist. Some objects still appear in the viewing range of the two cameras at the same time. Therefore, in this embodiment, after deleting the overlapping area within an object distance, some objects larger than the object distance are still in the captured image. There will be some overlap, so duplicate pixels appear.
- the image acquisition method based on multiple cameras includes:
- image acquisition based on multiple cameras is achieved. Since the foregoing method has acquired image acquisition of multiple cameras, according to this, image acquisition based on multiple cameras can be achieved.
- Amo (where o is greater than m and less than or equal to n) is the overlapping area of the image captured by the mth camera with the image captured by the oth camera, and the overlapping area should be removed, so that the mth camera There is no overlapping area between the captured image and the image captured by the o-th camera. According to this, all overlapping regions can be removed and then stitched to obtain the final non-overlapping image.
- the first camera and the second camera in the foregoing embodiments are any two of the multiple cameras in this embodiment, and the first image and the second image are any of the preliminary images in the embodiment. Two.
- an embodiment of an image acquisition device based on multiple cameras includes:
- the simultaneous obtaining unit 1 is configured to obtain the first image captured by the first camera and the second image captured by the second camera simultaneously with the first camera;
- the overlapping area acquisition unit 2 is used to obtain the overlapping area of the first image and the second image via geometric optics;
- the backup image generating unit 3 is configured to remove the overlapping area in the first image to obtain a backup image after removing the overlapping area;
- the stitching unit 4 is used for stitching the backup image and the second image.
- the first image captured by the first camera and the second image captured by the second camera simultaneously with the first camera are acquired. According to this, the first image and the second image captured simultaneously are obtained as a basis for subsequent stitching.
- the overlapping area of the first image and the second image is obtained via geometric optics.
- Any feasible method can be used to obtain the overlapping area of the first image and the second image through geometric optics, for example: establishing a first framing boundary function of the first camera and a second framing boundary function of the second camera, and calculating the first framing The boundary function and the framing boundary intersection curve function of the second framing boundary function; obtain the object distance, and substitute the object distance into the framing boundary intersection curve function to obtain the first intersection curve function; according to the imaging principle, calculate the first An intersection curve function is a first intersection curve imaging function imaged by the first camera, and the area enclosed by the first intersection curve imaging function is the overlapping area of the first image and the second image; the overlapping area is acquired.
- the overlapping area is removed from the first image to obtain a backup image after removing the overlapping area.
- the overlapping area is the area overlapping the second image in the image acquired by the first camera. Therefore, in order to obtain a suitable image, the overlapping area should be removed in the first image.
- the stitching unit 4 includes: a first stitching subunit for incorporating a second image from the first predetermined direction into the backup image based on the backup image, where the first predetermined direction refers to the second The camera points in the direction of the first camera; or, the second splicing subunit is used to merge the backup image from the second predetermined direction into the second image based on the second image, where the second predetermined direction refers to the first camera Point in the direction of the second camera. Therefore, the original image is stitched and synthesized into the final image, which avoids the process of copying the image data and searching for the stitching path, which is convenient and fast.
- the overlapping area acquisition unit 2 includes:
- the framing boundary intersection curve function calculation subunit is used to establish the first framing boundary function of the first camera and the second framing boundary function of the second camera, and calculate the relationship between the first framing boundary function and the second framing boundary function Intersecting curve function of viewfinder boundary;
- the first intersection curve function calculation subunit is used to obtain the object distance, and substitute the object distance into the view boundary intersection curve function to obtain the first intersection curve function;
- the overlapping area calculation subunit is used for calculating the first intersection curve imaging function of the first intersection curve function imaged by the first camera according to the imaging principle, and the area enclosed by the first intersection curve imaging function is the first image The overlapping area with the second image;
- the overlapping area acquisition subunit is used to acquire the overlapping area.
- the overlapping area of the first image and the second image is obtained via geometric optics.
- the parameters of the first camera and the second camera are the same, and the viewing range may be a cone range.
- the “cone” is only an implementation example and does not constitute Limitations of this solution in other possible embodiments.
- the parameters of the first camera and the second camera are different, and the viewing range may be any feasible range. Therefore, the intersection area of the two cones is the overlapping viewfinder area, the boundary curve of the overlapping viewfinder area is the viewfinder intersection curve, and the function of this curve is the viewfinder intersection curve function.
- the specific calculation method can calculate the intersection curve function of the framing boundary through the method of analytical geometry.
- the object distance refers to the distance between the vertical plane of the object to be photographed and the vertical plane of the multi-camera, which can be set by the user to operate, such as manually inputting the parameter of the object distance, or the user selects the object to
- the object distance is calculated by the multi-camera distance measurement principle.
- the principle of multi-camera distance measurement is an existing technology and will not be repeated here.
- the first intersection curve function is a function of the intersection curve of the view boundary intersection curve function and the vertical plane in which the object corresponding to the object distance is located (that is, the vertical plane in which the subject is located) is a two-dimensional closed curve
- the aforementioned intersection boundary curve function of the viewfinder is a function of three-dimensional space.
- the imaging principle the first intersection curve imaging function of the first intersection curve function imaged by the first camera is calculated, and the area enclosed by the first intersection curve imaging function is the overlapping area on the imaging side.
- the image formed by the photographed object is certain. According to this, the first intersection curve imaging function that is imaged by the first camera with the first intersection curve function can be obtained.
- the calculation method adopts the method of analytic geometry, which will not be described in detail.
- the framing ranges of the first camera and the second camera are both cone-shaped, and the sub-unit for calculating the intersection curve function of the framing boundary includes:
- the three-dimensional Cartesian coordinate system building module is used to take the center of the distance between the first camera and the second camera as the origin, take the line connecting the center of the first camera and the center of the second camera as the y-axis, and make the straight line of the z-axis parallel to the Connecting the center of a camera to the focus of the first camera, setting the x-axis perpendicular to the y-axis and z-axis, and establishing a three-dimensional rectangular coordinate system;
- the curve function of the intersection of the framing boundaries of the first camera and the second camera is calculated.
- the first intersection curve function calculation subunit includes:
- a subject receiving module configured to acquire a temporary image through the first camera, and receive a subject selected by the user in the temporary image
- the object distance setting module is used to turn on the second camera, use the principle of multi-camera distance measurement to obtain the distance between the shooting object and the plane where the first camera and the second camera are located, and set the distance to the object distance.
- the first intersection curve function is obtained.
- the first camera is turned on first, and the user can select the subject of interest in the temporary image acquired by the first camera, and set the object distance accordingly, or the target subject can be obtained through specific settings, such as in the first camera Within the range of the camera to extract the subject located in a special area to meet different needs.
- the method of obtaining the object distance is to use the multi-camera distance measuring principle.
- the device includes:
- a comparison unit for comparing the first pixel of the backup image with the second pixel of the second image
- the pixel deletion unit is configured to delete the first pixel that is the same as the second pixel in the backup image, so as to obtain a backup image for stitching.
- the device includes:
- a plurality of preliminary image acquisition units configured to acquire a plurality of preliminary images simultaneously shot by a plurality of cameras, wherein the cameras have n in total, and n is equal to or greater than 3;
- overlapping area acquisition units for acquiring A12, A13, ..., A1n, A23, A24, ..., A2n, Am(m+1), Am(m+2), ..., Amn overlapping areas via geometric optics, n is greater than m, the Amn refers to the overlapping area of the mth camera and the nth camera;
- the preliminary image splicing unit is used for splicing the plurality of preliminary images to remove overlapping regions, as described above, to achieve image acquisition based on multiple cameras. Since the foregoing method has acquired image acquisition of multiple cameras, according to this, image acquisition based on multiple cameras can be achieved.
- the first camera and the second camera in the foregoing embodiments are any two of the multiple cameras in this embodiment, and the first image and the second image are any two of the multiple preliminary images in this embodiment. Pcs.
- the overlapping area in the images captured by different cameras is calculated by geometric optics, and before the stitching process, the overlapping area is deleted from the image formed by the first camera, thereby starting The technical effect of saving splicing calculation power and accelerating splicing speed.
- the present application also provides a storage medium 10 that stores a computer program 20, which when run on a computer, causes the computer to execute the multi-camera-based image acquisition method described in the above embodiment Or, when the processor executes the computer program, an image acquisition method based on multiple cameras as described in the above embodiment is implemented.
- the present application also provides a device 30 containing instructions.
- the device 30 causes the device 30 to execute the multi-camera based on the multi-camera described in the above embodiment through the processor 40 provided therein.
- Image acquisition method or when the processor executes the computer program, an image acquisition method based on multiple cameras as described in the above embodiment is implemented.
- the device 30 in this embodiment is a computer device 30.
- the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present application are generated.
- the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
- the computer instructions may be stored in a storage medium, or transmitted from one storage medium to another storage medium, for example, the computer instructions may be from a website site, computer, server, or data center via wire (eg, coaxial cable, optical fiber) , Digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) to another website, computer, server or data center.
- wire eg, coaxial cable, optical fiber
- DSL Digital subscriber line
- wireless such as infrared, wireless, microwave, etc.
- the storage medium may be any available medium that can be stored by a computer or a data storage device such as a server, a data center, etc. integrated with one or more available media.
- the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, Solid State Disk (SSD)), or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Studio Devices (AREA)
- Length Measuring Devices By Optical Means (AREA)
- Image Analysis (AREA)
Abstract
一种基于多摄像头的图像获取方法、装置及设备,其中,基于多摄像头的图像获取方法包括:获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像(S1);经由几何光学获得第一图像与第二图像的重叠区域(S2);在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像(S3);拼接所述备用图像与所述第二图像(S4)。从而起到节省算力,加快拼接速度的技术效果。
Description
本发明涉及到摄像领域,特别是涉及一种基于多摄像头的图像获取方法、装置及设备。
手机集成多摄像头是一个趋势,可以扩大拍摄区域。多摄像头或多摄像头成像,先获取每个摄像头拍摄时的图像,再将每个摄像头拍摄时的图像进行拼接处理,从而获取具有更广拍摄区域的最终图像。现有技术的多摄像头成像的拼接合成技术一般采用基于不同摄像头每图像帧像素级的比较算法,耗费算力,不易使用。因此现有技术缺乏快捷地计算重叠区域、快捷地拼接图像,以获得最终的多摄像头成像的方案。
本发明的主要目的为提供一种基于多摄像头的图像获取方法、装置及设备,仅通过几何光学的方法就能去除重叠区域,从而提高拼接处理的速度。
本发明提供一种基于多摄像头的图像获取方法,包括:
获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像;
经由几何光学获得第一图像与第二图像的重叠区域;
在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像;
拼接所述备用图像与所述第二图像。
本申请提供一种基于多摄像头的图像获取装置,包括:
同时获取单元,用于获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像;
重叠区域获取单元,用于经由几何光学获得第一图像与第二图像的重叠区域;
备用图像生成单元,用于在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像;
拼接单元,用于拼接所述备用图像与所述第二图像。
本申请提供一种设备,其包括处理器、存储器及存储于所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如前述任一项所述的基于多摄像头的图像获取方法。
本发明与现有技术相比,有益效果在于:根据本发明提供的基于多摄像头的图像获取方法、装置及设备,通过几何光学计算出不同摄像头拍摄的图像中的重叠区域,并在拼接处理前,在第一摄像头所成图像中删除所述重叠区域,从而在对多幅图像进行拼接时,减少了重叠区域内每一像素的拼接运算,也就是说,不需要采用每图像帧像素级的比较算法,起到节省拼接运算力、加快拼接速度的技术效果。
图1为本申请一实施例的基于多摄像头的图像获取方法的流程示意图;
图2为本申请一实施例的基于多摄像头的图像获取装置的结构示意框图;
图3为本申请一实施例的存储介质的结构框图;
图4为本申请一实施例的设备的结构框图;
图5-7为本申请的基于多摄像头的图像获取方法的原理示意图;
图a、b为本申请求取图6中点A
1和点B
1坐标值时所做辅助线的示意图;
图c为求取本申请图7中点B
2的坐标值时所做辅助线的示意图。
其中附图标记示意如下:
A2为第一摄像头,A1为第二摄像头,f为焦点,A为可同时在第一摄像头、第二摄像头中成像的点,直线l1为第一摄像头下端与焦点连线,直线l2为第二摄像头上端与焦点连线。
本发明目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
如图1所示,一种基于多摄像头的图像获取方法的一实施方式,包括:
S1、获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像;
S2、经由几何光学获得第一图像与第二图像的重叠区域;
S3、在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像;
S4、拼接所述备用图像与所述第二图像。
其中,所述多摄像头指摄像头的数量为两个或者大于两个。
在此介绍本申请的原理:参见图5,以第一摄像头(图中下方的透镜A2)与第二摄像头(图中上方的透镜A1)的间距的中心为原点,以第一摄像头的中心与第二摄像头的中心连线为y轴,第一摄像头的中心与第一摄像头的焦距的连线的经过所述原点的平行线为x轴,设置z轴垂直于所述y轴与x轴(即 垂直纸面),建立三维直角坐标系;直线l1(第一摄像头下端与焦距连线,即成像边界)与直线l2(第二摄像头上端与焦距连线,即成像边界)所构成的左面圆锥体区域即是第一摄像头、第二摄像头均能成像的区域(即点A可被第一摄像头、第二摄像头同时成像),只需在在第一摄像头所成图像中去除该区域通过第一摄像头的成像,即可进行后续的拼接步骤。
参见图6、7,更具体地,在此将利用几何光学获取成像坐标点的方法介绍如下:AB为待成像目标,且该AB为成像的重叠区域对应的实体区域,A(-u1,h1)为与l1直线的交点,B(-u2,-h2)为与l2直线的交点,利用几何光学计算出A点、B点所成像的坐标A
1和B
1(第一摄像头的成像点坐标)、或者A
2和B
2(第二摄像头的成像点坐标),由于A
1和B
1为边界点/临界点,因此,求出A
1和B
1的坐标就可以知道成像A
1B
1,A
2B
2也是如此,然后将A
1B
1或A
2B
2去除即可。
其中,A
1\B
1\A
2\B
2 4个点的坐标的计算方法结合了成像原理与相似三角形。其中,假设摄像头(即凸透镜)的直径为r,两摄像头之间的间距为d,镜片焦距为f。以下介绍点A
1的坐标的求法。
对于点A
1,过点A作平行于x轴的直线,求出s
1(如图a所示)就可以知道点A
1的坐标。由相似三角形有:
所以有
再推出A
1的横坐标X
a1,有:
所以:
也就是说,A
1的坐标为:
同理也可以推出A
2、B
1、B
2,可参见图b、图c,此处不做详细描述。
最终,求得A
1\B
1\A
2\B
2 4个点的坐标如下:
在获取A
1\B
1\A
2\B
24个点坐标之后,在相应的摄像头获取的图片中去取相应的重叠区域,再进行拼接操作即可。
如上述步骤S1所述,获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像。据此,获得同时拍摄的第一图像与第二图像,以作为后续拼接的基础。
如上述步骤S2所述,经由几何光学获得第一图像与第二图像的重叠区域。通过几何光学获得第一图像与第二图像的重叠区域可以采用任意可行方法,例如:建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数;获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数;根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为第一图像与第二图像的重叠区域;获取所述重叠区域。
如上述步骤S3所述,在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像。如前所述,所述重叠区域是在第一摄像头获取的图像中,与第二图像重叠的区域。因此为了得到合适的图像,应在第一图像中去除所述重叠区域。
如上述步骤S4所述,拼接所述备用图像与所述第二图像。从而获得最终图像。其中拼接的方法可以包括:以所述备用图像为基础,将所述第二图像由第一预定方向并入所述备用图像中,所述第一预定方向指第二摄像头指向第一摄像头的方向;或者,以所述第二图像为基础,将所述备用图像由第二预定方向并入所述第二图像中,所述第二预定方向指第一摄像头指向第二摄像头的方向。从而在原始图像上拼接合成为最终图像,避免了复制图像数据、并寻找拼接路径的过程,方便快捷。
一实施方式中,所述经由几何光学获得第一图像与第二图像的重叠区域的步骤S2,包括:
S201、建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数;
S202、获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数;
S203、根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为第一图像与第二图像的重叠区域;
S204、获取所述重叠区域。
如上所述,实现了经由几何光学获得第一图像与第二图像的重叠区域。本实施方式中,优选的,所述第一摄像头与第二摄像头的参数相同,且取景范围可以均为圆锥体范围,可以理解的是,该“圆锥体”形状仅为一个实施示例,并不构成本方案在其他可实施方式中的限制。摄像头取景是有范围的,无法 360度无死角拍摄,因此摄像头所能拍摄的范围可用三维的函数圈成的范围来表示,而摄像头所能拍摄的范围的边界,被称为取景边界函数。进一步地,所述第一摄像头与第二摄像头的参数也可以不同,且取景范围可以为任意可行范围。因此两个圆锥体的相交区域即为重叠取景区域,所述重叠取景区域的边界曲线即为取景边界相交曲线,该曲线的函数即为取景边界相交曲线函数。具体计算方法可以通过解析几何的方法计算出取景边界相交曲线函数。获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数。其中,物距是指被拍摄对象所在竖直平面与多摄像头所在竖直平面的距离,可以是用户操作而进行设置物距,例如将物距的参数手动输入,或者由用户选择拍摄对象,以通过多摄像头测距原理计算得到物距。其中多摄像头测距原理为已有技术,不再赘述。其中所述第一相交曲线函数为所述取景边界相交曲线函数与所述物距对应的物体所在竖直平面(即被拍摄物所在竖直平面)的相交曲线的函数,是二维闭合曲线,而前述的取景边界相交曲线函数,是三维空间的函数。根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为成像侧的重叠区域。基于成像原理,在摄像头参数已知的前提下,被拍摄对像所成的像是一定的。据此可以获取与第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数。其中计算方法采用解析几何的方法,不再赘述。
一实施方式中,所述第一摄像头与所述第二摄像头的取景范围均为圆锥体状,所述建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数的步骤S201,包括:
S2011、以第一摄像头与第二摄像头的间距的中心为原点,以第一摄像头的中心与第二摄像头的中心连线为y轴,使z轴所在直线平行于第一摄像头的中心与第一摄像头的焦点的连线,设置x轴垂直于所述y轴与z轴,建立三维直角坐标系;
S2012、建立第一摄像头的第一取景边界函数:F1=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,k≠0,z<=-f;建立第二摄像头的第二取景边界函数:F2=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,k≠0,z<=-f,其中d为第一摄像头与第二摄像头的间隔,r为第一摄像头与第二摄像头的直径,f为第一摄像头与第二摄像头的焦距,k
2=f
2/(r/2)
2;
S2013、计算出第一取景边界函数与第二取景边界函数的取景边界相交曲线函数F3:当y>0时,F3=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,k≠0,z<=-f;当y<=0时,F3=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,k≠0,z<=-f。
如上所述,计算出第一摄像头与第二摄像头的取景边界相交曲线函数,值得一提的是,该三维坐标系与图5中描述和示意出的坐标系定义的维度方向有所不一样,不同的坐标系仅分别针对所描述的内容,并不造成矛盾。
具体的,标准圆锥体边界曲线方程为z
2=k
2(x
2+y
2),在本实施例中建立的三维坐标系中,可得到第一取景边界函数:F1=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,(k≠0),z<=-f;建立第二摄像头的第二取景边界函数:F2=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,(k≠0),z<=-f,其中d为第一摄像头与第二摄像头的间隔,r为第一摄像头与第二摄像头的直径,f为第一摄像头与第二摄像头的焦距,k
2=f
2/(r/2)
2。从而得到第一取景边界函数F1与第二取景边界函数F2的相交轨迹,即取景边界相交曲线函数F3:当y>0时,F3=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,(k≠0),z<=-f;当y<=0时,F3=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,(k≠0),z<=-f。进一步地,本申请的取景范围可以不为圆锥体状,此时参数r根据取景范围的不同而设置不同的数值,从而可以适用于各种镜头。
一实施方式中,所述获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数的步骤S202中,所述获取物距包括:
S2021、通过第一摄像头获取暂时图像,接收用户在所述暂时图像中选择的拍摄对象;
S2022、打开第二摄像头,利用多摄像头测距原理,获得所述拍摄对象与第一摄像头、第二摄像头所在平面间的距离,并将所述距离设置为所述物距。
如上所述,得到了第一相交曲线函数。其中先打开第一摄像头,用户得以在第一摄像头获取的暂时图像中选择感兴趣的拍摄对象,据此设置物距,也可以是通过特定的设定来获取目标拍摄对象,比如在第一摄像头的摄像范围内提取位于特殊区域的拍摄对象,以满足不同的需求。其中获得物距的方法为利用多摄像头测距原理。
一实施方式中,所述拼接所述备用图像与所述第二图像的步骤S4之前,包括:
S31、比较所述备用图像的第一像素点与所述第二图像的第二像素点;
S32、在所述备用图像中删除与所述第二像素点相同的第一像素点,从而获得用于拼接使用的备用图像。
如上述步骤所述,实现了进一步删除重叠内容。由于前述步骤已在拼接图像之前,删除了一个物距值所确定的重叠区域,因此剩下的重叠内容不多,在此基础上进一步删除重叠的像素点,从而进一步提高图像的质量。另外,由于剩下的重叠内容不多,因此本实施方式中所需要删除的像素点不多,能大大减少算力的需求。
另外,在此介绍重复像素点出现的原因:由于本实施方式中,摄像头的取景范围是呈锥形不断朝物侧延伸扩大的,因此两个摄像头取景范围的交叠部分也随着不断的延伸扩大,本实施例之前所述取得的重叠区域,是指在朝物侧延伸的交叠部分中,根据一个物距值所确定的部分的交叠区域,也就是说,在大于该物距值的延伸空间内的物体,依旧存在部分物体同时出现在两个摄像头的取景范围中,因此,本实施例在删除一个物距内的重叠区域后,大于该物距的部分物体在拍摄图像中仍会存在部分的重叠,因此出现重复像素点。
一实施方式中,所述基于多摄像头的图像获取方法,包括:
ST1、获取多个摄像头同时拍摄的多个初步图像,其中所述摄像头共有n个,n大于等于3;
ST2、经由几何光学,获取A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域,n大于m,所述Amn指第m个摄像头与第n个摄像头的重叠区域;
ST3、在所述多个初步图像中去除所述A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域;
ST4、接拼去除重叠区域的所述多个初步图像。
如上述步骤ST1-ST4所述,实现了基于多摄像头的图像获取。由于前述方法已获得多摄像头的图像获取,据此,可以实现基于多摄像头的图像获取。
其中,由于Amo(其中,o大于m且小于等于n)是在第m个摄像头拍摄的图像中与第o个摄像头拍摄的图像的重叠区域,且该重叠区域应被去除,从而第m个摄像头拍摄的图像与第o个摄像头拍摄的图不存在重叠区域。据此,可以将所有重叠区域去除,再进行拼接,即可得到最终无重叠的图像。其中,前述实施例中的所第一摄像头、第二摄像头为本实施例的多个摄像头中的任意两个,以及第一图像、第二图像为本实施例中的多个初步图像中的任意两个。
参见图2,一种基于多摄像头的图像获取装置的一实施方式,包括:
同时获取单元1,用于获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像;
重叠区域获取单元2,用于经由几何光学获得第一图像与第二图像的重叠区域;
备用图像生成单元3,用于在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像;
拼接单元4,用于拼接所述备用图像与所述第二图像。
如上述单元1所述,获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像。据此,获得同时拍摄的第一图像与第二 图像,以作为后续拼接的基础。
如上述单元2所述,经由几何光学获得第一图像与第二图像的重叠区域。通过几何光学获得第一图像与第二图像的重叠区域可以采用任意可行方法,例如:建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数;获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数;根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为第一图像与第二图像的重叠区域;获取所述重叠区域。
如上述单元3所述,在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像。如前所述,所述重叠区域是在第一摄像头获取的图像中,与第二图像重叠的区域。因此为了得到合适的图像,应在第一图像中去除所述重叠区域。
如上述单元4所述,拼接所述备用图像与所述第二图像。从而获得最终图像。其中,优选的,拼接单元4包括:第一拼接子单元,用于以备用图像为基础,将第二图像由第一预定方向并入所述备用图像中,所述第一预定方向指第二摄像头指向第一摄像头的方向;或者,第二拼接子单元,用于以第二图像为基础,将备用图像由第二预定方向并入第二图像中,所述第二预定方向指第一摄像头指向第二摄像头的方向。从而在原始图像上拼接合成为最终图像,避免了复制图像数据、并寻找拼接路径的过程,方便快捷。
一实施方式中,所述重叠区域获取单元2,包括:
取景边界相交曲线函数计算子单元,用于建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数;
第一相交曲线函数计算子单元,用于获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数;
重叠区域计算子单元,用于根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为第一图像与第二图像的重叠区域;
重叠区域获取子单元,用于获取所述重叠区域。
如上所述,实现了经由几何光学获得第一图像与第二图像的重叠区域。本实施方式中,优选的,所述第一摄像头与第二摄像头的参数相同,且取景范围可以均为圆锥体范围,可以理解的是,该“圆锥体”仅为一个实施示例,并不构成本方案在其他可实施方式中的限制。进一步地,所述第一摄像头与第二摄 像头的参数不同,且取景范围可以为任意可行范围。因此两个圆锥体的相交区域即为重叠取景区域,所述重叠取景区域的边界曲线即为取景边界相交曲线,该曲线的函数即为取景边界相交曲线函数。具体计算方法可以通过解析几何的方法计算出取景边界相交曲线函数。获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数。其中,物距是指被拍摄对象所在竖直平面与多摄像头所在竖直平面的距离,可以是用户操作而进行设置物距,例如将物距的参数手动输入,或者由用户选择拍摄对象,以通过多摄像头测距原理计算得到物距。其中多摄像头测距原理为已有技术,不再赘述。其中所述第一相交曲线函数为所述取景边界相交曲线函数与所述物距对应的物体所在竖直平面(即被拍摄物所在竖直平面)的相交曲线的函数,是二维闭合曲线,而前述的取景边界相交曲线函数,是三维空间的函数。根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为成像侧的重叠区域。基于成像原理,在摄像头参数已知的前提下,被拍摄对像所成的像是一定的。据此可以获取与第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数。其中计算方法采用解析几何的方法,不再赘述。
一实施方式中,所述第一摄像头与所述第二摄像头的取景范围均为圆锥体状,所述取景边界相交曲线函数计算子单元,包括:
三维直角坐标系建立模块,用于以第一摄像头与第二摄像头的间距的中心为原点,以第一摄像头的中心与第二摄像头的中心连线为y轴,使z轴所在直线平行于第一摄像头的中心与第一摄像头的焦点的连线,设置x轴垂直于所述y轴与z轴,建立三维直角坐标系;
取景边界函数建立模块,用于建立第一摄像头的第一取景边界函数:F1=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,k≠0,z<=-f;建立第二摄像头的第二取景边界函数:F2=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,k≠0,z<=-f,其中d为第一摄像头与第二摄像头的间隔,r为第一摄像头与第二摄像头的直径,f为第一摄像头与第二摄像头的焦距,k
2=f
2/(r/2)
2;
取景边界相交曲线函数计算模块,用于计算出第一取景边界函数与第二取景边界函数的取景边界相交曲线函数F3:当y>0时,F3=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,k≠0,z<=-f;当y<=0时,F3=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,k≠0,z<=-f。
如上所述,计算出第一摄像头与第二摄像头的取景边界相交曲线函数。具体的,标准圆锥体边界曲线方程为z
2=k
2(x
2+y
2),在本实施例中建立的三维坐标系中,可得到第一取景边界函数:F1=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2= 0,(k≠0),z<=-f;建立第二摄像头的第二取景边界函数:F2=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,(k≠0),z<=-f,其中d为第一摄像头与第二摄像头的间隔,r为第一摄像头与第二摄像头的直径,f为第一摄像头与第二摄像头的焦距,k
2=f
2/(r/2)
2。从而得到第一取景边界函数F1与第二取景边界函数F2的相交轨迹,即取景边界相交曲线函数F3:当y>0时,F3=k
2(x
2+(y+d/2+r/2)
2)-(z+f)
2=0,(k≠0),z<=-f;当y<=0时,F3=k
2(x
2+(y-d/2-r/2)
2)-(z+f)
2=0,(k≠0),z<=-f。
一实施方式中,所述第一相交曲线函数计算子单元,包括:
拍摄对象接收模块,用于通过第一摄像头获取暂时图像,接收用户在所述暂时图像中选择的拍摄对象;
物距设置模块,用于打开第二摄像头,利用多摄像头测距原理,获得所述拍摄对象与第一摄像头、第二摄像头所在平面间的距离,并将所述距离设置为所述物距。
如上所述,得到了第一相交曲线函数。其中先打开第一摄像头,用户得以在第一摄像头获取的暂时图像中选择感兴趣的拍摄对象,据此设置物距,也可以是通过特定的设定来获取目标拍摄对象,比如在第一摄像头的摄像范围内提取位于特殊区域的拍摄对象,以满足不同的需求。其中获得物距的方法为利用多摄像头测距原理。
一实施方式中,所述装置包括:
比较单元,用于比较所述备用图像的第一像素点与所述第二图像的第二像素点;
像素点删除单元,用于在所述备用图像中删除与所述第二像素点相同的第一像素点,从而获得用于拼接使用的备用图像。
如上所述,实现了进一步删除重叠内容。由于前述步骤已在拼接图像之前删除了重叠区域,因此剩下的重叠内容不多,在此基础上进一步删除重叠的像素点,从而进一步提高图像的质量。另外,由于剩下的重叠内容不多,因此本实施方式中所需要删除的像素点不多,能大大减少算力的需求。另外,在此介绍重复像素点出现的原因:由于本实施例是删除物距内的重叠区域,因此大于物距的拍摄图像仍会存在部分的重叠,因此出现重复像素点。
一实施方式中,所述装置,包括:
多个初步图像获取单元,用于获取多个摄像头同时拍摄的多个初步图像,其中所述摄像头共有n个,n大于等于3;
多个重叠区域获取单元,用于经由几何光学,获取A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域, n大于m,所述Amn指第m个摄像头与第n个摄像头的重叠区域;
多个重叠区域去除单元,用于在所述多个初步图像中去除所述A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域;
初步图像拼接单元,用于接拼去除重叠区域的所述多个初步图像如上所述,实现了基于多摄像头的图像获取。由于前述方法已获得多摄像头的图像获取,据此,可以实现基于多摄像头的图像获取。
其中,由于Amo(其中,o大于m且小于等于n)是在第m个摄像头拍摄的图像中与第o个摄像头拍摄的图像的重叠区域,且该重叠区域应被去除,从而第m个摄像头拍摄的图像与第o个摄像头拍摄的图不存在重叠区域。据此,可以将所有重叠区域去除,再进行拼接,即可得到最终无重叠的图像。其中,前述实施例中的第一摄像头、第二摄像头为本实施例的多个摄像头中的任意两个,以及第一图像、第二图像为本实施例中的多个初步图像中的任意两个。
根据本发明提供的基于多摄像头的图像获取装置,通过几何光学计算出不同摄像头拍摄的图像中的重叠区域,并在拼接处理前,在第一摄像头所成图像中删除所述重叠区域,从而起到节省拼接运算力、加快拼接速度的技术效果。
参考附图3,本申请还提供了一种存储介质10,存储介质10中存储有计算机程序20,当其在计算机上运行时,使得计算机执行以上实施例所描述的基于多摄像头的图像获取方法,或者所述处理器执行所述计算机程序时实现如以上实施例所描述的基于多摄像头的图像获取方法。
参考附图4,本申请还提供了一种包含指令的设备30,当存储介质10在设备30上运行时,使得设备30通过其内部设置的处理器40执行以上实施例所描述的基于多摄像头的图像获取方法,或者所述处理器执行所述计算机程序时实现如以上实施例所描述的基于多摄像头的图像获取方法。本实施方式中的设备30为计算机设备30。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在存储介质中,或者从一个存储介质向另一存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述存储介质可以是计算机能够存储的任何可用介质或者是包含一 个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。
Claims (15)
- 一种基于多摄像头的图像获取方法,其特征在于,包括:获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像;经由几何光学获得第一图像与第二图像的重叠区域;在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像;拼接所述备用图像与所述第二图像。
- 根据权利要求1所述的基于多摄像头的图像获取方法,其特征在于,所述经由几何光学获得第一图像与第二图像的重叠区域的步骤,包括:建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数;获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数;根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为第一图像与第二图像的重叠区域;获取所述重叠区域。
- 根据权利要求2所述的基于多摄像头的图像获取方法,其特征在于,所述第一摄像头与所述第二摄像头的取景范围均为圆锥体状,所述建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数的步骤,包括:以第一摄像头与第二摄像头的间距的中心为原点,以第一摄像头的中心与第二摄像头的中心连线为y轴,使z轴所在直线平行于第一摄像头的中心与第一摄像头的焦点的连线,设置x轴垂直于所述y轴与z轴,建立三维直角坐标系;建立第一摄像头的第一取景边界函数:F1=k 2(x 2+(y+d/2+r/2) 2)-(z+f) 2=0,k≠0,z<=-f;建立第二摄像头的第二取景边界函数:F2=k 2(x 2+(y-d/2-r/2) 2)-(z+f) 2=0,k≠0,z<=-f,其中d为第一摄像头与第二摄像头的间隔,r为第一 摄像头与第二摄像头的直径,f为第一摄像头与第二摄像头的焦距,k 2=f 2/(r/2) 2;计算出第一取景边界函数与第二取景边界函数的取景边界相交曲线函数F3:当y>0时,F3=k 2(x 2+(y+d/2+r/2) 2)-(z+f) 2=0,k≠0,z<=-f;当y<=0时,F3=k 2(x 2+(y-d/2-r/2) 2)-(z+f) 2=0,k≠0,z<=-f。
- 根据权利要求2所述的基于多摄像头的图像获取方法,其特征在于,所述获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数的步骤中,所述获取物距包括:通过第一摄像头获取暂时图像,接收用户在所述暂时图像中选择的拍摄对象;打开第二摄像头,利用多摄像头测距原理,获得所述拍摄对象与第一摄像头、第二摄像头所在平面间的距离,并将所述距离设置为所述物距。
- 根据权利要求2所述的基于多摄像头的图像获取方法,其特征在于,所述拼接所述备用图像与所述第二图像的步骤之前,包括:比较所述备用图像的第一像素点与所述第二图像的第二像素点;在所述备用图像中删除与所述第二像素点相同的第一像素点,从而获得用于拼接使用的备用图像。
- 根据权利要求1所述的基于多摄像头的图像获取方法,其特征在于,所述拼接所述备用图像与所述第二图像的步骤,包括:以所述备用图像为基础,将所述第二图像由第一预定方向并入所述备用图像中,所述第一预定方向指第二摄像头指向第一摄像头的方向;或者,以所述第二图像为基础,将所述备用图像由第二预定方向并入所述第二图像中,所述第二预定方向指第一摄像头指向第二摄像头的方向。
- 根据权利要求1-6任一项所述的基于多摄像头的图像获取方法,其特征在于,获取多个摄像头同时拍摄的多个初步图像,其中所述摄像头共有n个,n大于等于3;经由几何光学,获取A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域,n大于m,所述Amn指第m个摄像头与第n个摄像头的重叠区域;在所述多个初步图像中去除所述A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域;接拼去除重叠区域的所述多个初步图像。
- 一种基于多摄像头的图像获取装置,其特征在于,包括:同时获取单元,用于获取第一摄像头拍摄的第一图像以及与第一摄像头同时拍摄的第二摄像头拍摄的第二图像;重叠区域获取单元,用于经由几何光学获得第一图像与第二图像的重叠区域;备用图像生成单元,用于在所述第一图像中去除所述重叠区域,获得去除所述重叠区域后的备用图像;拼接单元,用于拼接所述备用图像与所述第二图像。
- 根据权利要求8所述的基于多摄像头的图像获取装置,其特征在于,所述重叠区域获取单元,包括:取景边界相交曲线函数计算子单元,用于建立第一摄像头的第一取景边界函数与第二摄像头的第二取景边界函数,计算出所述第一取景边界函数与所述第二取景边界函数的取景边界相交曲线函数;第一相交曲线函数计算子单元,用于获取物距,将所述物距代入所述取景边界相交曲线函数中,得到第一相交曲线函数;重叠区域计算子单元,用于根据成像原理,计算出第一相交曲线函数通过第一摄像头成像的第一相交曲线成像函数,所述第一相交曲线成像函数所围成的区域即为第一图像与第二图像的重叠区域;重叠区域获取子单元,用于获取所述重叠区域。
- 根据权利要求9所述的基于多摄像头的图像获取装置,其特征在于,所述取景边界相交曲线函数计算子单元,包括:三维直角坐标系建立模块,用于以第一摄像头与第二摄像头的间距的中心为原点,以第一摄像头的中心与第二摄像头的中心连线为y轴,使z轴所在直线平行于第一摄像头的中心与第一摄像头的焦点的连线,设置x轴垂直于所述y轴与z轴,建立三维直角坐标系;取景边界函数建立模块,用于建立第一摄像头的第一取景边界函数:F1=k 2(x 2+(y+d/2+r/2) 2)-(z+f) 2=0,k≠0,z<=-f;建立第二摄像头的第二取景边界函数:F2=k 2(x 2+(y-d/2-r/2) 2)-(z+f) 2=0,k≠0,z<=-f,其中d为第一 摄像头与第二摄像头的间隔,r为第一摄像头与第二摄像头的直径,f为第一摄像头与第二摄像头的焦距,k 2=f 2/(r/2) 2;取景边界相交曲线函数计算模块,用于计算出第一取景边界函数与第二取景边界函数的取景边界相交曲线函数F3:当y>0时,F3=k 2(x 2+(y+d/2+r/2) 2)-(z+f) 2=0,k≠0,z<=-f;当y<=0时,F3=k 2(x 2+(y-d/2-r/2) 2)-(z+f) 2=0,k≠0,z<=-f。
- 根据权利要求9所述的基于多摄像头的图像获取装置,其特征在于,所述第一相交曲线函数计算子单元,包括:拍摄对象接收模块,用于通过第一摄像头获取暂时图像,接收用户在所述暂时图像中选择的拍摄对象;物距设置模块,用于打开第二摄像头,利用多摄像头测距原理,获得所述拍摄对象与第一摄像头、第二摄像头所在平面间的距离,并将所述距离设置为所述物距。
- 根据权利要求9所述的基于多摄像头的图像获取装置,其特征在于,所述装置,包括:比较单元,用于比较所述备用图像的第一像素点与所述第二图像的第二像素点;像素点删除单元,用于在所述备用图像中删除与所述第二像素点相同的第一像素点,从而获得用于拼接使用的备用图像。
- 根据权利要求8所述的基于多摄像头的图像获取装置,其特征在于,所述拼接单元,包括:第一拼接子单元,用于以所述备用图像为基础,将所述第二图像由第一预定方向并入所述备用图像中,所述第一预定方向指第二摄像头指向第一摄像头的方向;第二拼接子单元,用于以所述第二图像为基础,将所述备用图像由第二预定方向并入所述第二图像中,所述第二预定方向指第一摄像头指向第二摄像头的方向。
- 根据权利要求8-13任一项所述的基于多摄像头的图像获取装置,其特征在于,包括:多个初步图像获取单元,用于获取多个摄像头同时拍摄的多个初步图像, 其中所述摄像头共有n个,n大于等于3;多个重叠区域获取单元,用于经由几何光学,获取A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域,n大于m,所述Amn指第m个摄像头与第n个摄像头的重叠区域;多个重叠区域去除单元,用于在所述多个初步图像中去除所述A12,A13,…,A1n,A23,A24,…,A2n,Am(m+1),Am(m+2),…,Amn重叠区域;初步图像拼接单元,用于接拼去除重叠区域的所述多个初步图像。
- 一种设备,其特征在于,其包括处理器、存储器及存储于所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的基于多摄像头的图像获取方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910024692.6 | 2019-01-10 | ||
| CN201910024692.6A CN109889736B (zh) | 2019-01-10 | 2019-01-10 | 基于双摄像头、多摄像头的图像获取方法、装置及设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020143090A1 true WO2020143090A1 (zh) | 2020-07-16 |
Family
ID=66925878
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/073764 Ceased WO2020143090A1 (zh) | 2019-01-10 | 2019-01-29 | 基于多摄像头的图像获取方法、装置及设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109889736B (zh) |
| WO (1) | WO2020143090A1 (zh) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112884767B (zh) * | 2021-03-26 | 2022-04-26 | 长鑫存储技术有限公司 | 图像拟合方法 |
| CN115868933B (zh) * | 2022-12-12 | 2024-01-05 | 四川互慧软件有限公司 | 一种采集监护仪波形的方法和系统 |
| CN117315815A (zh) * | 2023-10-20 | 2023-12-29 | 深圳紫杉视讯有限公司 | 一种行车记录仪的图像处理方法、装置及电子设备 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080012877A1 (en) * | 1999-01-28 | 2008-01-17 | Lewis Michael C | Method and system for providing edge antialiasing |
| US20080298718A1 (en) * | 2007-05-31 | 2008-12-04 | Che-Bin Liu | Image Stitching |
| CN105279735A (zh) * | 2015-11-20 | 2016-01-27 | 沈阳东软医疗系统有限公司 | 一种图像拼接的融合方法、装置及设备 |
| CN105869113A (zh) * | 2016-03-25 | 2016-08-17 | 华为技术有限公司 | 全景图像的生成方法和装置 |
| CN106296577A (zh) * | 2015-05-19 | 2017-01-04 | 富士通株式会社 | 图像拼接方法和图像拼接设备 |
Family Cites Families (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101931772B (zh) * | 2010-08-19 | 2012-02-29 | 深圳大学 | 一种全景视频融合方法、系统及视频处理设备 |
| CN102620713A (zh) * | 2012-03-26 | 2012-08-01 | 梁寿昌 | 一种利用双摄像头测距和定位的方法 |
| CN105138194A (zh) * | 2013-01-11 | 2015-12-09 | 海信集团有限公司 | 一种定位方法及电子设备 |
| CN104933755B (zh) * | 2014-03-18 | 2017-11-28 | 华为技术有限公司 | 一种静态物体重建方法和系统 |
| CN104754228A (zh) * | 2015-03-27 | 2015-07-01 | 广东欧珀移动通信有限公司 | 一种利用移动终端摄像头拍照的方法及移动终端 |
| CN106683071B (zh) * | 2015-11-06 | 2020-10-30 | 杭州海康威视数字技术股份有限公司 | 图像的拼接方法和装置 |
| CN105654502B (zh) * | 2016-03-30 | 2019-06-28 | 广州市盛光微电子有限公司 | 一种基于多镜头多传感器的全景相机标定装置和方法 |
| CN106683045A (zh) * | 2016-09-28 | 2017-05-17 | 深圳市优象计算技术有限公司 | 一种基于双目像机的全景图像拼接方法 |
| CN106331527B (zh) * | 2016-10-12 | 2019-05-17 | 腾讯科技(北京)有限公司 | 一种图像拼接方法及装置 |
| CN106791422A (zh) * | 2016-12-30 | 2017-05-31 | 维沃移动通信有限公司 | 一种图像处理方法及移动终端 |
| CN108769578B (zh) * | 2018-05-17 | 2020-07-31 | 南京理工大学 | 一种基于多路摄像头的实时全景成像系统及方法 |
-
2019
- 2019-01-10 CN CN201910024692.6A patent/CN109889736B/zh active Active
- 2019-01-29 WO PCT/CN2019/073764 patent/WO2020143090A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080012877A1 (en) * | 1999-01-28 | 2008-01-17 | Lewis Michael C | Method and system for providing edge antialiasing |
| US20080298718A1 (en) * | 2007-05-31 | 2008-12-04 | Che-Bin Liu | Image Stitching |
| CN106296577A (zh) * | 2015-05-19 | 2017-01-04 | 富士通株式会社 | 图像拼接方法和图像拼接设备 |
| CN105279735A (zh) * | 2015-11-20 | 2016-01-27 | 沈阳东软医疗系统有限公司 | 一种图像拼接的融合方法、装置及设备 |
| CN105869113A (zh) * | 2016-03-25 | 2016-08-17 | 华为技术有限公司 | 全景图像的生成方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109889736A (zh) | 2019-06-14 |
| CN109889736B (zh) | 2020-06-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2021227360A1 (zh) | 一种交互式视频投影方法、装置、设备及存储介质 | |
| EP2328125A1 (en) | Image splicing method and device | |
| CN106934777B (zh) | 扫描图像获取方法及装置 | |
| WO2020014909A1 (zh) | 拍摄方法、装置和无人机 | |
| WO2021098544A1 (zh) | 图像处理方法及装置、存储介质、电子设备 | |
| CN110738599B (zh) | 图像拼接方法、装置、电子设备及存储介质 | |
| CN107833179A (zh) | 一种红外图像的快速拼接方法及系统 | |
| WO2019056527A1 (zh) | 一种拍摄方法及装置 | |
| US20200160560A1 (en) | Method, system and apparatus for stabilising frames of a captured video sequence | |
| CN110611767B (zh) | 图像处理方法、装置和电子设备 | |
| CN115278071B (zh) | 图像处理方法、装置、电子设备和可读存储介质 | |
| CN107343165A (zh) | 一种监控方法、设备及系统 | |
| CN109889736B (zh) | 基于双摄像头、多摄像头的图像获取方法、装置及设备 | |
| WO2020135394A1 (zh) | 视频拼接方法及装置 | |
| WO2017128750A1 (zh) | 一种图像采集方法和图像采集装置 | |
| CN116416701A (zh) | 一种巡检方法、巡检装置、电子设备及存储介质 | |
| JP2011238048A (ja) | 位置姿勢計測装置及び位置姿勢計測プログラム | |
| WO2022179554A1 (zh) | 视频拼接方法、装置、计算机设备和存储介质 | |
| CN108513057A (zh) | 图像处理方法及装置 | |
| CN114881901A (zh) | 视频合成方法、装置、设备、介质及产品 | |
| JP7827879B2 (ja) | 画像処理方法及び装置、並びにデバイス | |
| CN105827932A (zh) | 一种图像合成方法和移动终端 | |
| WO2018006669A1 (zh) | 视差融合方法和装置 | |
| CN114390206A (zh) | 拍摄方法、装置和电子设备 | |
| WO2017096859A1 (zh) | 照片的处理方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19909516 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: 19909516 Country of ref document: EP Kind code of ref document: A1 |

