[go: up one dir, main page]

CN104361569A - Method and device for splicing images - Google Patents

Method and device for splicing images Download PDF

Info

Publication number
CN104361569A
CN104361569A CN201410632500.7A CN201410632500A CN104361569A CN 104361569 A CN104361569 A CN 104361569A CN 201410632500 A CN201410632500 A CN 201410632500A CN 104361569 A CN104361569 A CN 104361569A
Authority
CN
China
Prior art keywords
image
pixel
splicing
points
transformation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410632500.7A
Other languages
Chinese (zh)
Inventor
朱旭东
李婵
王智玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201410632500.7A priority Critical patent/CN104361569A/en
Publication of CN104361569A publication Critical patent/CN104361569A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a method and a device for splicing images. The method for splicing the images includes that superposed regions and transformation matrixes are determined by the aid of feature points of the first images and second images; certain pixel points in current rows in the superposed regions are used as splicing points, and transformation errors of the certain pixel points meet preset conditions; the transformation errors are errors between certain pixel point positions of the second images and matched pixel point positions in the second images, and the certain pixel points of the first images are transformed to the certain pixel point positions of the second images via the transformation matrixes; the images are spliced according to the splicing points. The method and the device have the advantage that the problem of splicing gaps when different object distances exist on spliced surfaces can be solved.

Description

图像拼接的方法及装置Image mosaic method and device

技术领域technical field

本申请涉及计算机视觉领域和图像处理技术,尤其涉及图像拼接的方法及装置。The present application relates to the field of computer vision and image processing technology, in particular to a method and device for image stitching.

背景技术Background technique

图像拼接是计算机视觉领域和图像处理的一个重要分支,它是将两幅以上的具有部分重叠的图像进行无缝拼接从而得到大画幅或宽视角的图像。Image stitching is an important branch in the field of computer vision and image processing. It seamlessly stitches more than two partially overlapping images to obtain a large-format or wide-view image.

相邻图像的配准及拼接是全景图生成技术的关键,目前普遍使用的是基于SIFT特征匹配的无缝图像拼接方法,该方法利用SIFT特征匹配、RANSAC算法、L-M算法、多分辨率融合算法克服了传统图像拼接技术中的局限性,实现了光照和尺度变化条件下的多视角无缝图像拼接。The registration and stitching of adjacent images is the key to panorama generation technology. Currently, the seamless image stitching method based on SIFT feature matching is widely used. This method uses SIFT feature matching, RANSAC algorithm, L-M algorithm, and multi-resolution fusion algorithm. It overcomes the limitations of traditional image stitching technology and realizes multi-view seamless image stitching under the conditions of illumination and scale changes.

该现有技术对于拼接表面为同一景深平面的情况,或者物体距离摄像机的距离足够远,可以近似为同一平面的情况,可以取得较好的拼接效果。当存在图像聚焦模糊、变换矩阵误差以及特征点检测错误时,拼接缝隙会被察觉。一个通用有效的方法是使用图像融合,将待拼接图像分解到不同的频带进行处理:以两个频带为例,待融合图像分成低频和高频两部分数据,低频部分数据使用较大的权重进行融和,由于低频对应图像的平坦部分,不会产生较大的细节丢失,高频图像使用较小的权重进行融和,保留图像细节部分。最后再把两个频带处理后的数据恢复到时域,得并相加,得到最终融合后的图像。This prior art can achieve a better stitching effect when the splicing surfaces are on the same depth-of-field plane, or the distance between the object and the camera is far enough to approximate the same plane. Stitching gaps are perceived when there are image focus blurs, transformation matrix errors, and feature point detection errors. A general and effective method is to use image fusion to decompose the image to be stitched into different frequency bands for processing: taking two frequency bands as an example, the image to be fused is divided into two parts of low-frequency and high-frequency data, and the low-frequency part is processed with a larger weight. Fusion, since the low frequency corresponds to the flat part of the image, there will be no large loss of detail, and the high frequency image is blended with a smaller weight to retain the image details. Finally, restore the processed data of the two frequency bands to the time domain, and add them together to obtain the final fused image.

但上述过程只可以解决存在较小的拼接缝隙,如1-2个像素点。在实际的拼接场景中,常常还有一种情况,既在两个相机的重合区域中,存在不同物距的物体,当景深(就是物距)较近,且存在不同景深时,拼接后的图像往往会产生明显的拼缝。But the above process can only solve the small splicing gaps, such as 1-2 pixels. In the actual stitching scene, there is often a situation where there are objects with different object distances in the overlapping area of the two cameras. When the depth of field (that is, the object distance) is close and there are different depths of field, the image after stitching Often there will be obvious patchwork.

发明内容Contents of the invention

本申请提供图像拼接的方法及装置,能够改善拼接表面存在不同物距时的拼接缝隙问题。The present application provides an image stitching method and device, which can improve the stitching gap problem when there are different object distances on the stitching surface.

根据本申请实施例的第一方面,提供一种图像拼接的方法,该方法包括步骤:According to a first aspect of an embodiment of the present application, a method for image stitching is provided, the method comprising steps:

通过第一图像和第二图像中的特征点确定重合区域以及变换矩阵;Determining an overlapping region and a transformation matrix through the feature points in the first image and the second image;

将所述重合区域内当前行中变换误差满足预定条件的像素点作为拼接点;所述变换误差为所述第一图像的像素点经过所述变换矩阵变换到第二图像的像素点位置与所述第二图像中的匹配像素点位置之间的误差;The pixel points whose transformation errors in the current line in the overlapping area meet the predetermined conditions are used as splicing points; The error between the matching pixel positions in the second image;

根据所述拼接点进行图像拼接。Image stitching is performed according to the stitching points.

根据本申请实施例的第二方面,提供一种图像拼接的装置,该装置包括:According to a second aspect of the embodiments of the present application, an image mosaic device is provided, the device comprising:

图像预拼接模块,用于通过第一图像和第二图像中的特征点确定重合区域以及变换矩阵;An image pre-stitching module is used to determine the overlapping area and the transformation matrix through the feature points in the first image and the second image;

拼接点提取模块,用于将重合区域内当前行中变换误差满足预定条件的像素点作为拼接点;所述变换误差为所述第一图像的像素点经过所述变换矩阵变换到第二图像的像素点位置与所述第二图像中的匹配像素点位置之间的误差;The splicing point extraction module is used to use pixels whose transformation errors in the current row in the overlapping area satisfy predetermined conditions as splicing points; the transformation error is the pixel point of the first image transformed into the second image through the transformation matrix an error between a pixel location and a matching pixel location in said second image;

图像拼接模块,用于根据所述拼接点进行图像拼接。The image splicing module is used for splicing images according to the splicing points.

本申请在选取拼接点之前首先对拼接区域内是否存在不同物距的物体进行检测,如果存在不同物距的物体,则选择变换误差足够小的像素点作为拼接点,尽可能的绕开物距不同的像素点作为拼接点,因此拼接后的图像不会有明显的拼缝,避免了不同物距图像拼接产生的拼缝问题。Before selecting the splicing point, this application first detects whether there are objects with different object distances in the splicing area. If there are objects with different object distances, then select a pixel with a small enough transformation error as the splicing point, and avoid the object distance as much as possible. Different pixels are used as splicing points, so the spliced image will not have obvious splicing, which avoids the splicing problem caused by splicing images with different object distances.

附图说明Description of drawings

图1为本申请实施例中图像拼接方法的流程图;Fig. 1 is the flowchart of image mosaic method in the embodiment of the present application;

图2是本申请实施例中图像拼接装置的硬件架构图;FIG. 2 is a hardware architecture diagram of an image stitching device in an embodiment of the present application;

图3是本申请实施例中图像拼接装置的内部结构逻辑框图;Fig. 3 is a logic block diagram of the internal structure of the image stitching device in the embodiment of the present application;

图4是本申请一应用实例的处理流程图。Fig. 4 is a processing flowchart of an application example of the present application.

具体实施方式Detailed ways

图像拼接技术中拼接区域拼接点该如何选取对于图像拼接的效果起着至关重要的作用,现有技术对于拼接区域中存在多物距的情况无法达到令人满意的拼接效果。本申请针对该问题提出了一种图像拼接的方法,在图像拼接时首先检测在摄相机公共可视角内(即拼接区域)是否存在远近物距差异明显的情况,如果存在不同物距的物体,则尽量避开不同物距的像素点选取拼接点的解决方案,利用此方案选取拼接点实现图像拼接。以下结合图1进行详细描述。In the image stitching technology, how to select the stitching points in the stitching area plays a vital role in the effect of image stitching. The existing technology cannot achieve a satisfactory stitching effect when there are multiple object distances in the stitching area. The present application proposes a method for image mosaic to solve this problem. During image mosaic, it is first detected whether there is an obvious difference in distance between objects in the common viewing angle of the camera (that is, in the stitching area). If there are objects with different object distances, Then try to avoid the solution of selecting splicing points for pixel points with different object distances, and use this scheme to select splicing points to realize image splicing. A detailed description will be made below in conjunction with FIG. 1 .

申请人经过仔细研究发现,在图像拼接时,当将其中一张图像的像素点转换到另一张图像中的匹配像素点位置时,不同的物距下需要使用不同的变换矩阵来描述它的变换关系,现有技术中选取拼接点的方式并没有考虑这一点,由于变换矩阵无法同时表示不同物距的变换模型,因此拼接后的图像往往会产生较大的拼缝。因此申请人借助变换矩阵来作为检测物距是否相同的手段。变换矩阵是指在两幅待拼接图像中,计算其中一张图像中的像素点变换到另一张图像中的匹配像素点时所使用的矩阵。为了描述上的方便,以两张待拼接图像进行拼接的过程为例,对于多张待拼接图像拼接的情况可以分解成一组两两拼接的过程。在本申请中,将为了描述方便,两幅图像中其中一幅图像称为第一图像,另一张图像称为第二图像;变换矩阵为第一图像的像素变换到第二图像的相应位置时所使用的矩阵。After careful research, the applicant found that during image stitching, when converting the pixels of one of the images to the matching pixel positions in the other image, different transformation matrices need to be used to describe its position under different object distances. Transformation relationship, which is not considered in the way of selecting splicing points in the prior art, because the transformation matrix cannot represent the transformation models of different object distances at the same time, so the spliced image often produces a large splicing seam. The applicant therefore resorts to the transformation matrix as a means of detecting whether the object distances are the same. The transformation matrix refers to the matrix used when calculating the transformation of the pixels in one image to the matching pixels in the other image in the two images to be spliced. For the convenience of description, the process of stitching two images to be stitched is taken as an example, and the stitching of multiple images to be stitched can be decomposed into a pairwise stitching process. In this application, for the convenience of description, one of the two images is called the first image, and the other image is called the second image; the transformation matrix is the transformation of the pixels of the first image to the corresponding positions of the second image The matrix used when .

为了检测拼接区域是否存在不同物距的物体,本方法首先对待拼接的两张图像进行特征点检测和匹配,根据特征点确定出待拼接的两张图像的重合区域以及变换矩阵(步骤101),重合区域是由特征点所确定的重合区域,该步骤可以通过现有技术中已经存在的技术手段获得,变换矩阵则通过两幅图像中一对匹配的特征点在两幅图像中的空间位置关系计算得出,为了描述方便,在本申请中变换矩阵为第一图像的特征点变换到第二像素的匹配特征点所使用的变换矩阵。作为一个实施例,本申请通过SIFT特征匹配算法采集两张待拼接图像中的SIFT特征点进行匹配,找出两幅待拼接图像中属于同一个物理点的一对特征点,即特征点和该特征点的匹配特征点。如果匹配到的特征点对数量超出变换矩阵变量数量,就可以求解出变换矩阵中所有的变量,本实施例使用RANSAC算法得到变换矩阵。In order to detect whether there are objects with different object distances in the splicing area, the method first performs feature point detection and matching on the two images to be spliced, and determines the overlapping area and the transformation matrix of the two images to be spliced according to the feature points (step 101), The overlapping area is the overlapping area determined by the feature points. This step can be obtained through existing technical means in the prior art, and the transformation matrix is based on the spatial position relationship of a pair of matching feature points in the two images. It is calculated that, for the convenience of description, in this application, the transformation matrix is the transformation matrix used to transform the feature points of the first image to the matching feature points of the second pixel. As an embodiment, the present application uses the SIFT feature matching algorithm to collect SIFT feature points in two images to be stitched for matching, and find out a pair of feature points belonging to the same physical point in the two images to be stitched, that is, the feature point and the Matching feature points of feature points. If the number of matched feature point pairs exceeds the number of variables in the transformation matrix, all the variables in the transformation matrix can be solved. In this embodiment, the transformation matrix is obtained by using the RANSAC algorithm.

本申请利用得到的变换矩阵作为检验是否存在不同物距的物体的技术手段。具体过程如下:This application uses the obtained transformation matrix as a technical means to check whether there are objects with different object distances. The specific process is as follows:

对步骤101中所获得的重合区域进行扫描,判断当前行中是否存在变换误差(变换误差是指第一图像的像素点经过步骤101所求得变换矩阵变换到第二图像的像素点的位置与第二图像中的匹配像素点的位置之间的误差)满足预定条件的像素点,然后选取该行中满足预定条件的像素点作为拼接点(步骤102),从而避开了不同物距的物体。值得指出的是,在本申请中,设置的预定条件是为了使变换误差足够小,以便各个拼接点在图像拼接时能够看作是同一拼接平面,从而可以使用同一变换矩阵而不会导致明显拼接缝,因此如何设置可根据用户的不同需求而不同。在一个实施例中,在重合区域进行行扫描的规则可以是存在多种情况,例如逐行遍历的方式,设置优先扫描区域的方式等等,用户可以根据需求灵活选择。扫描时判断当前像素点的变换误差是否满足条件,如果误差值不满足预定条件,则继续对该行中其他像素进行检测,选取该行中变换误差符合预定条件的像素点作为最终选定的拼接点。The overlapping region obtained in step 101 is scanned to judge whether there is a transformation error in the current row (transformation error refers to the pixel point of the first image converted to the pixel point of the second image through the transformation matrix obtained in step 101 and The error between the positions of the matching pixel points in the second image) satisfy the pixel point of the predetermined condition, and then select the pixel point satisfying the predetermined condition in the row as the splicing point (step 102), thereby avoiding objects with different object distances . It is worth pointing out that in this application, the predetermined condition is set to make the transformation error small enough so that each stitching point can be regarded as the same stitching plane during image stitching, so that the same transformation matrix can be used without causing obvious stitching Seams, so how to set it can be different according to different needs of users. In one embodiment, there may be various rules for line scanning in overlapping areas, such as the way of traversing line by line, the way of setting priority scanning areas, etc., and the user can choose flexibly according to requirements. When scanning, it is judged whether the transformation error of the current pixel satisfies the condition. If the error value does not meet the predetermined condition, continue to detect other pixels in the row, and select the pixel in the row whose transformation error meets the predetermined condition as the final splicing point.

由于所选取的拼接点从第一图像变换到第二图像时变换误差足够小,因此可以认为这些拼接点在同一拼接平面,可以使用相同的变换矩阵,因此可以使用现有技术中的技术手段根据这些拼接点进行图像拼接(步骤103),拼接后的图像不会产生明显的拼接缝。Since the transformation error of the selected splicing points is small enough when transforming from the first image to the second image, it can be considered that these splicing points are in the same splicing plane, and the same transformation matrix can be used, so the technical means in the prior art can be used according to Image stitching is performed on these stitching points (step 103), and the stitched image will not produce obvious stitching seams.

对于步骤102,如何判断像素点的变换误差是否满足预定条件,本申请提供了多种实现方式:作为一个实施例,在执行完步骤101获得变换矩阵之后,判断重合区域内的每个像素点的变换误差是否满足预定条件,并将判断结果记录下来,记录的方式可以由用户自由选择,例如,可以将变换误差满足预定条件的像素点标记为0,将变换误差不满足预定条件内的像素点标记为1等等。在将重合区域内的像素点全部扫描完成后,为了优化本方案,进一步消除因噪声带来的影响,可以对标记结果进行去噪处理,以消除误判。去噪的方式可以是通过3*3或4*4或4*3等多种腐蚀模板,也可以使用低通滤波器等方式进行处理。由于在执行步骤102之前已经将重合区域的所有像素点进行了标记,因此在步骤102中可以根据已经标记好的判断结果来获知该像素点是否为属于变换误差满足预定条件的像素点。而作为另一个实施例,则无需预先对重合区域的所有像素点进行标记,而是当扫描到某个像素点时再判断该像素点的变换误差是否满足预定条件。如果是,则无需再继续扫描同一行的其它像素点,如果不是,则继续扫描同一行中的其他像素点。For step 102, how to determine whether the transformation error of the pixel point meets the predetermined condition, the application provides multiple implementation methods: as an embodiment, after performing step 101 to obtain the transformation matrix, determine the error of each pixel point in the overlapping area Whether the transformation error meets the predetermined condition, and record the judgment result. The recording method can be freely selected by the user. For example, the pixels whose transformation error meets the predetermined condition can be marked as 0, and the pixels whose transformation error does not meet the predetermined condition can be marked as 0 marked as 1 and so on. After scanning all the pixels in the overlapping area, in order to optimize this scheme and further eliminate the influence of noise, the marking result can be denoised to eliminate misjudgment. The way of denoising can be through various corrosion templates such as 3*3 or 4*4 or 4*3, or it can be processed by low-pass filter and other methods. Since all the pixels in the overlapping area have been marked before step 102 is executed, in step 102 it can be known whether the pixel belongs to a pixel whose transformation error satisfies a predetermined condition according to the marked judgment result. As another embodiment, it is not necessary to mark all the pixels in the overlapping area in advance, but to judge whether the transformation error of the pixel satisfies the predetermined condition when a certain pixel is scanned. If yes, there is no need to continue to scan other pixels in the same row; if not, continue to scan other pixels in the same row.

作为一个实施例,申请人针对上一段中如何判断像素点的变换误差是否满足预定条件提出了更加具体的解决方案:由于不同摄像机的位置、角度不同,在图像拼接点需要将像素点位置转移到同一个坐标平面,因此,本申请将第一图像重合区域中的每个像素点利用步骤102的变换矩阵进行像素点映射(即将像素的空间坐标转换成同一坐标平面),变换到第二图像中,然后通过下述公式1中fSAD与预设值对比,判断重合区域内的第一图像的像素点是否与第二图像在同一拼接平面;如前文申请人提到的,设置的预定条件是为了使变换误差足够小,以便各个拼接点在图像拼接时能够看作是同一拼接平面,从而可以使用同一变换矩阵而不会导致明显拼接缝,因此预设值可以根据用户所需要的精度有不同的设置方式,例如,可以将预设值设置为W*W*0.1*WMEAN,其中WMEAN为窗口内第二图像的像素点的图象亮度的均值;也可以在要求高精度、不考虑误判的极端情况下可以将预设值设置为0,简化方案。As an example, the applicant proposed a more specific solution for how to judge whether the transformation error of the pixel points meets the predetermined conditions in the previous paragraph: due to the different positions and angles of different cameras, the position of the pixel points needs to be transferred to The same coordinate plane, therefore, this application uses the transformation matrix in step 102 to perform pixel point mapping (that is, convert the spatial coordinates of the pixels into the same coordinate plane) for each pixel in the overlapping area of the first image, and transform it into the second image , and then by comparing f SAD with the preset value in the following formula 1, it is judged whether the pixels of the first image in the overlapping area are on the same stitching plane as the second image; as mentioned by the previous applicant, the predetermined condition set is In order to make the transformation error small enough, so that each stitching point can be regarded as the same stitching plane during image stitching, so that the same transformation matrix can be used without causing obvious stitching seams, so the preset value can be changed according to the accuracy required by the user. Different setting methods, for example, the preset value can be set to W*W*0.1*W MEAN , where W MEAN is the average value of the image brightness of the pixels of the second image in the window; Considering the extreme case of misjudgment, the preset value can be set to 0 to simplify the solution.

f SAD ( x , y , d 1 , d 2 ) = Σ i ∈ W Σ j ∈ W | T ( I 1 ( x + i , y + j ) ) - I 2 ( x + i + d 1 , y + j + d 2 ) |   (公式1) f SAD ( x , the y , d 1 , d 2 ) = Σ i ∈ W Σ j ∈ W | T ( I 1 ( x + i , the y + j ) ) - I 2 ( x + i + d 1 , the y + j + d 2 ) | (Formula 1)

其中,fSAD为第一图像中的像素点为中心位置的滑动窗口内各像素点变换到第二图像的匹配像素点的误差累加之和;W是滑动窗口的大小,T表示所述变换矩阵,d1是指I1的图像像素点映射到I2的图像后横坐标的图像偏移量;d2指从I1的图像像素点映射到I2的图像后纵坐标的图像偏移量;I1是指第一图像,I2为作为第二图像。本申请使用滑动窗的方式对待拼接窗口内的不同物距进行检测是考虑到图象噪声、镜头畸变等因素的影响,即使是处于同一变换矩阵的像素点,也存在一定幅度范围内的差异。作为申请人经过反复试验所获得的经验值,W的一个优选取值范围为3至5个像素点,如果无需考虑图像噪声以及镜头畸变等因素的影响,则可以将W的取值设为1,此时代表不设置滑动窗口的情况。Wherein, f SAD is the pixel in the first image as the sum of the accumulated errors of the matching pixels of the second image transformed from each pixel in the sliding window of the center position; W is the size of the sliding window, and T represents the transformation matrix , d1 refers to the image offset of the image pixel point of I 1 mapped to the image rear abscissa of I 2 ; d2 refers to the image offset of the image pixel point of I 1 mapped to the image rear ordinate of I 2 ; I 1 means the first image, I 2 means the second image. This application uses the sliding window method to detect different object distances in the window to be stitched in consideration of the influence of image noise, lens distortion and other factors. Even pixels in the same transformation matrix have differences within a certain range. As an empirical value obtained by the applicant through trial and error, a preferred value range of W is 3 to 5 pixels. If there is no need to consider the influence of factors such as image noise and lens distortion, the value of W can be set to 1 , which represents the situation where no sliding window is set.

值得一提的是,在实际中有可能在拼接点所在重合区域内的某些行中不存在变换误差值满足预定条件的像素点,此时,为了尽可能的避开物距不同的物体,作为上述方法的进一步的改进方案,可以将该行中fSAD最小值的像素点作为拼接点。It is worth mentioning that in practice, there may be no pixel points whose transformation error values meet the predetermined conditions in some lines in the overlapping area where the splicing point is located. At this time, in order to avoid objects with different object distances as much as possible, As a further improvement of the above method, the pixel point with the minimum value of f SAD in the row can be used as a splicing point.

以上是对本申请中图像拼接的方法的详细阐述,本申请还提供了一种与上述方法相对应的图像拼接装置,该装置可以应用在PC上、手机上或者有足够处理能力的摄像装置等多种硬件设备上。该装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以安装于PC上的软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图2所示,为本申请图像拼接装置所在PC的一种硬件结构图,除了图2所示的处理器、网络接口、内存以及非易失性存储器之外,实施例中装置所在的PC通常还可以包括其他硬件,对此图2中不再详细示出。The above is a detailed description of the image stitching method in this application. This application also provides an image stitching device corresponding to the above method, which can be applied to PCs, mobile phones, or camera devices with sufficient processing capabilities. on a hardware device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking the implementation of software installed on a PC as an example, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for operation by the processor of the device where it is located. From the perspective of hardware, as shown in Figure 2, it is a hardware structure diagram of the PC where the image stitching device of the present application is located. In addition to the processor, network interface, internal memory and non-volatile memory shown in Figure 2, the implementation The PC where the device in the example is located may generally include other hardware, which is not shown in detail in FIG. 2 .

图3是图像拼接装置内部结构的逻辑框图。该装置包括图像预拼接模块、拼接点提取模块和图像拼接模块。Fig. 3 is a logical block diagram of the internal structure of the image stitching device. The device includes an image pre-splicing module, a splicing point extraction module and an image splicing module.

图像预拼接模块的功能是确定待拼接的图像由特征点所确定的重合区域以及变换矩阵。该装置中的拼接点提取模块完成判断是否存在不同物距的像素点以及如何确定拼接点的功能。拼接点提取模块通过判断当前行的各像素点变换误差是否满足预定条件来确定是否存在不同物距的物体,如果重合区域内的当前像素点的变换误差不满足预定条件,则对重合区域内当前像素点所在行的其他像素点进行扫描,将变换误差满足预定条件的像素点作为拼接点;值得说明的是,与前文中所详述的图像拼接的方法一致,判断像素点的变换误差值是否满足预定条件有多种方式,可以先记录所有像素点的变换误差值得判别结果,然后扫描像素点时时直接调用该判别结果;也可以扫描到某个像素点时再对该像素点所求的变换误差值进行判断,详细过程可参照前文对应部分,不再赘述。待拼接点提取模块最终确定出拼接点后图像拼接模块根据所述拼接点完成图像拼接的过程。The function of the image pre-stitching module is to determine the overlapping area and the transformation matrix of the image to be stitched determined by the feature points. The splicing point extraction module in the device completes the function of judging whether there are pixels with different object distances and how to determine the splicing point. The splicing point extraction module determines whether there are objects with different object distances by judging whether the transformation error of each pixel point in the current line meets the predetermined condition. If the transformation error of the current pixel point in the overlapping area does not meet the predetermined condition, the current Scan the other pixels in the row where the pixel is located, and take the pixel whose transformation error meets the predetermined condition as the splicing point; There are many ways to meet the predetermined conditions. You can first record the transformation error value judgment results of all pixels, and then directly call the judgment results when scanning pixels; you can also scan to a certain pixel and then calculate the transformation of the pixel. The error value is used to judge, and the detailed process can refer to the corresponding part above, so I won’t repeat it here. After the splicing point extraction module finally determines the splicing point, the image splicing module completes the image splicing process according to the splicing point.

拼接点提取模块确定拼接点的其他途径还可以有:如果某行中没有变换误差值满足预定条件的像素点,则将该行中fSAD的值最小的像素点作为拼接点。出于与上述图像拼接的方法的同一发明构思,在此不再详述。Other methods for determining the splicing point by the splicing point extraction module may include: if there is no pixel point whose transformation error value satisfies the predetermined condition in a row, the pixel point with the smallest value of f SAD in the row is used as the splicing point. Due to the same inventive concept as the above image mosaic method, no further details are given here.

同样出于同一发明构思,拼接点提取模块同样可以通过公式1中fSAD与预设值对比,判断所述像素点的变换误差值是否满足预定条件;具体判断方式请参照上文相关部分的描述。Also based on the same inventive concept, the splicing point extraction module can also judge whether the transformation error value of the pixel meets the predetermined condition by comparing f SAD in formula 1 with the preset value; for the specific judgment method, please refer to the description of the relevant part above .

以下结合图4的流程图列举一个本申请的应用实例,以对本申请有更加清晰的理解。An application example of the present application is listed below in conjunction with the flow chart of FIG. 4 , so as to have a clearer understanding of the present application.

步骤401:对待拼接的两幅图像进行特征点的检测和匹配,并计算出第一图像的像素点变换到第二图像的相应像素点的变换矩阵,确定两幅图像的重合区域;Step 401: Perform feature point detection and matching on the two images to be stitched, and calculate a transformation matrix for transforming pixels of the first image to corresponding pixels of the second image, and determine the overlapping area of the two images;

步骤402:根据步骤401中所获得的重合区域,利用所求得的变换矩阵将第一图像中重合区域内的每一个像素点映射到第二图像中。Step 402: According to the overlapping area obtained in step 401, use the obtained transformation matrix to map each pixel in the overlapping area in the first image to the second image.

步骤403:对映射图像中重合区域内的像素点,确定滑动窗口的范围W,逐个像素点进行扫描,判断变换误差fSAD;全部扫描完成后,使用腐蚀模板消除误判,并使用标记图来记录结果,标记图中,fSAD小于或等于预设值的为属于变换模型的像素点标记为0,否则,记为1,表示当前像素点为不同的物距。Step 403: Determine the range W of the sliding window for the pixels in the overlapping area in the mapped image, scan pixel by pixel, and judge the transformation error f SAD ; Record the results, and in the marking diagram, if f SAD is less than or equal to the preset value, the pixel belonging to the transformation model is marked as 0, otherwise, it is recorded as 1, indicating that the current pixel is a different object distance.

步骤404:对映射图像中重合区域内的像素点逐个扫描,根据步骤403中得到的标记图判断当前像素点对应的标记图中的位置是否为1;Step 404: Scan the pixels in the overlapping area in the mapped image one by one, and judge whether the position in the marker map corresponding to the current pixel is 1 according to the marker map obtained in step 403;

步骤405:如果当前像素点对应的标记图中的位置为0,则将此像素点位置作为拼接点。Step 405: If the position in the marker map corresponding to the current pixel is 0, use this pixel position as a stitching point.

步骤406:如果当前像素点对应的标记图中位置为1,则继续搜索当前行中的其它像素点,搜索标记图中位置为0的像素点;Step 406: If the position in the marker map corresponding to the current pixel is 1, continue to search for other pixels in the current row, and search for the pixel whose position is 0 in the marker map;

步骤407:将搜索到的该行中标记图为0的像素点位置作为当前行的拼接点。Step 407: Use the searched position of the pixel whose marker image is 0 in the row as the splicing point of the current row.

步骤408:如果一行中所有属于重叠区域的标记图都为1,则取fSAD值最小的像素点位置作为拼接点。Step 408: If all the marker images belonging to the overlapping area in a row are 1, then take the pixel position with the smallest f SAD value as the splicing point.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Other embodiments of the present application will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the application, these modifications, uses or adaptations follow the general principles of the application and include common knowledge or conventional technical means in the technical field not disclosed in the application . The specification and examples are to be considered exemplary only, with a true scope and spirit of the application indicated by the following claims.

应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It should be understood that the present application is not limited to the precise constructions which have been described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1.一种图像拼接的方法,其特征在于,该方法包括步骤:1. A method for image stitching, characterized in that the method comprises steps: 通过第一图像和第二图像中的特征点确定重合区域以及变换矩阵;Determining an overlapping region and a transformation matrix through the feature points in the first image and the second image; 将所述重合区域内当前行中变换误差满足预定条件的像素点作为拼接点;所述变换误差为所述第一图像的像素点经过所述变换矩阵变换到第二图像的像素点位置与所述第二图像中的匹配像素点位置之间的误差;The pixel points whose transformation errors in the current line in the overlapping area meet the predetermined conditions are used as splicing points; The error between the matching pixel positions in the second image; 根据所述拼接点进行图像拼接。Image stitching is performed according to the stitching points. 2.根据权利要求1所述的方法,其特征在于:将所述重合区域内当前行中变换误差满足预定条件的像素点作为拼接点的过程包括:2. The method according to claim 1, characterized in that: the process of using the pixels whose transformation error meets the predetermined condition in the current line in the overlapping area as the splicing point comprises: 判断所述重合区域内的每个像素点的变换误差是否满足所述预定条件,并记录判断结果;Judging whether the transformation error of each pixel in the overlapping area satisfies the predetermined condition, and recording the judgment result; 根据所记录的判断结果,将当前行中满足预定条件的像素点作为所述拼接点。According to the recorded judgment results, the pixel points in the current row that satisfy the predetermined condition are used as the splicing points. 3.根据权利要求1所述的方法,其特征在于,通过下述公式中fSAD与预设值对比,判断所述变换误差是否满足所述预定条件;3. method according to claim 1, is characterized in that, compares with preset value by f SAD in the following formula, judges whether described transformation error meets described predetermined condition; ff SADSAD (( xx ,, ythe y ,, dd 11 ,, dd 22 )) == ΣΣ ii ∈∈ WW ΣΣ jj ∈∈ WW || TT (( II 11 (( xx ++ ii ,, ythe y ++ jj )) )) -- II 22 (( xx ++ ii ++ dd 11 ,, ythe y ++ jj ++ dd 22 )) || 其中,fSAD为第一图像中的像素点为中心位置的滑动窗口内各像素点变换到第二图像的像素点位置与第二图像中的匹配像素点位置之间的误差累加之和;W是滑动窗口的大小,T表示所述变换矩阵,d1是指I1的图像像素点映射到I2的图像后横坐标的图像偏移量;d2指从I1的图像像素点映射到I2的图像后纵坐标的图像偏移量;I1是指第一图像,I2为作为第二图像。Wherein, f SAD is the pixel point in the first image as the sum of error accumulation between the pixel point position in the second image and the matching pixel point position in the second image for each pixel point in the sliding window of the center position; W is the size of the sliding window, T represents the transformation matrix, d1 refers to the image offset of the abscissa after the image pixel of I 1 is mapped to the image of I 2 ; d2 refers to the image pixel of I 1 mapped to I 2 The image offset of the ordinate after the image; I 1 refers to the first image, and I 2 refers to the second image. 4.根据权利要求3所述的方法,其特征在于,该方法还包括步骤:4. method according to claim 3, is characterized in that, this method also comprises the step: 如果当前行中不存在变换误差满足预定条件的像素点,则将该行中所述fSAD的值最小的像素点作为拼接点。If there is no pixel point whose transformation error satisfies the predetermined condition in the current row, the pixel point with the smallest value of f SAD in the row is used as a splicing point. 5.根据权利要求3所述的方法,其特征在于,所述预设值为W*W*0.1*WMEAN,其中WMEAN为窗口内所述第二图像的图象亮度的均值,W为滑动窗口的大小。5. The method according to claim 3, wherein the preset value is W*W*0.1*W MEAN , wherein W MEAN is the mean value of the image brightness of the second image in the window, and W is The size of the sliding window. 6.一种图像拼接的装置,其特征在于,该装置包括:6. A device for image stitching, characterized in that the device comprises: 图像预拼接模块,用于通过第一图像和第二图像中的特征点确定重合区域以及变换矩阵;An image pre-stitching module is used to determine the overlapping area and the transformation matrix through the feature points in the first image and the second image; 拼接点提取模块,用于将重合区域内当前行中变换误差满足预定条件的像素点作为拼接点;所述变换误差为所述第一图像的像素点经过所述变换矩阵变换到第二图像的像素点位置与所述第二图像中的匹配像素点位置之间的误差;The splicing point extraction module is used to use the pixels whose transformation errors in the current row in the overlapping area meet the predetermined conditions as splicing points; an error between a pixel location and a matching pixel location in said second image; 图像拼接模块,用于根据所述拼接点进行图像拼接。The image splicing module is used for splicing images according to the splicing points. 7.根据权利要求6所述的装置,其特征在于:所述拼接点提取模块7. The device according to claim 6, characterized in that: the splicing point extraction module 将所述重合区域内当前行中变换误差满足预定条件的像素点作为拼接点的过程包括:The process of using the pixels whose transformation error meets the predetermined condition in the current line in the overlapping area as the splicing point includes: 判断所述重合区域内的每个像素点的变换误差是否满足所述预定条件,并记录判断结果;Judging whether the transformation error of each pixel in the overlapping area satisfies the predetermined condition, and recording the judgment result; 根据所记录的判断结果,将当前行中满足预定条件的像素点作为所述拼接点。According to the recorded judgment result, the pixel points in the current row that satisfy the predetermined condition are used as the splicing points. 8.根据权利要求6所述的装置,其特征在于,所述拼接点提取模块通过下述公式中fSAD与预设值对比,判断所述变换误差是否满足所述预定条件;8. The device according to claim 6, wherein the splicing point extraction module judges whether the transformation error satisfies the predetermined condition by comparing f SAD with a preset value in the following formula; ff SADSAD (( xx ,, ythe y ,, dd 11 ,, dd 22 )) == ΣΣ ii ∈∈ WW ΣΣ jj ∈∈ WW || TT (( II 11 (( xx ++ ii ,, ythe y ++ jj )) )) -- II 22 (( xx ++ ii ++ dd 11 ,, ythe y ++ jj ++ dd 22 )) || 其中,fSAD为第一图像中的像素点为中心位置的滑动窗口内各像素点变换到第二图像的像素点位置与第二图像中的匹配像素点位置之间的误差累加之和;W是滑动窗口的大小,T表示所述变换矩阵,d1是指I1的图像像素点映射到I2的图像后横坐标的图像偏移量;d2指从I1的图像像素点映射到I2的图像后纵坐标的图像偏移量;I1是指第一图像,I2为作为第二图像。Wherein, f SAD is the pixel point in the first image as the sum of error accumulation between the pixel point position in the second image and the matching pixel point position in the second image for each pixel point in the sliding window of the center position; W is the size of the sliding window, T represents the transformation matrix, d1 refers to the image offset of the abscissa after the image pixel of I 1 is mapped to the image of I 2 ; d2 refers to the image pixel of I 1 mapped to I 2 The image offset of the ordinate after the image; I 1 refers to the first image, and I 2 refers to the second image. 9.根据权利要求8所述的装置,其特征在于,所述拼接点提取模块还用于:9. The device according to claim 8, wherein the splicing point extraction module is also used for: 如果当前行中不存在变换误差满足预定条件的像素点,则将该行中所述fSAD的值最小的像素点作为拼接点。If there is no pixel point whose transformation error satisfies the predetermined condition in the current row, the pixel point with the smallest value of f SAD in the row is used as a splicing point. 10.根据权利要求8所述的装置,其特征在于,所述预设值为W*W*0.1*WMEAN,其中WMEAN为窗口内所述第二图像的图象亮度的均值,W为滑动窗口的大小。10. The device according to claim 8, wherein the preset value is W*W*0.1*W MEAN , wherein W MEAN is the mean value of the image brightness of the second image in the window, and W is The size of the sliding window.
CN201410632500.7A 2014-11-11 2014-11-11 Method and device for splicing images Pending CN104361569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410632500.7A CN104361569A (en) 2014-11-11 2014-11-11 Method and device for splicing images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410632500.7A CN104361569A (en) 2014-11-11 2014-11-11 Method and device for splicing images

Publications (1)

Publication Number Publication Date
CN104361569A true CN104361569A (en) 2015-02-18

Family

ID=52528827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410632500.7A Pending CN104361569A (en) 2014-11-11 2014-11-11 Method and device for splicing images

Country Status (1)

Country Link
CN (1) CN104361569A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554449A (en) * 2015-12-11 2016-05-04 浙江宇视科技有限公司 Method and device for quickly splicing camera images
CN105773309A (en) * 2016-03-10 2016-07-20 天津大学 Online testing method for ultra-view-field cutter
CN106296577A (en) * 2015-05-19 2017-01-04 富士通株式会社 Image split-joint method and image mosaic device
CN106385550A (en) * 2016-09-06 2017-02-08 青岛海信移动通信技术股份有限公司 Method and terminal for capturing screen image
CN107085842A (en) * 2017-04-01 2017-08-22 上海讯陌通讯技术有限公司 The real-time antidote and system of self study multiway images fusion
CN107742316A (en) * 2016-12-13 2018-02-27 腾讯科技(深圳)有限公司 Image mosaic point acquisition methods and acquisition device
CN108389170A (en) * 2018-03-07 2018-08-10 鞍钢集团矿业有限公司 The image enhancement and denoising method and device of more wide angle cameras overlapping regions
CN111008985A (en) * 2019-11-07 2020-04-14 贝壳技术有限公司 Panorama picture seam detection method and device, readable storage medium and electronic equipment
CN113222882A (en) * 2020-01-21 2021-08-06 上海铼钠克数控科技股份有限公司 Cloth seam detection method and device, electronic equipment and storage medium
CN114565516A (en) * 2022-03-03 2022-05-31 上海核工程研究设计院有限公司 Sensor data fused security shell surface area robust splicing method
CN117726559A (en) * 2023-12-14 2024-03-19 江苏北方湖光光电有限公司 Luminance self-adaptive matching method based on low-illumination multi-view image stitching

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739674A (en) * 2008-11-19 2010-06-16 深圳迈瑞生物医疗电子股份有限公司 Automatic image sequence splicing method and device and splicing system
US20130223758A1 (en) * 2010-08-24 2013-08-29 Hui-Man Hou Stitched Digital Images
CN103501415A (en) * 2013-10-01 2014-01-08 中国人民解放军国防科学技术大学 Overlap structural deformation-based video real-time stitching method
US20140168482A1 (en) * 2012-12-14 2014-06-19 Inview Technology Corporation Overlap patterns and image stitching for multiple-detector compressive-sensing camera

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739674A (en) * 2008-11-19 2010-06-16 深圳迈瑞生物医疗电子股份有限公司 Automatic image sequence splicing method and device and splicing system
US20130223758A1 (en) * 2010-08-24 2013-08-29 Hui-Man Hou Stitched Digital Images
US20140168482A1 (en) * 2012-12-14 2014-06-19 Inview Technology Corporation Overlap patterns and image stitching for multiple-detector compressive-sensing camera
CN103501415A (en) * 2013-10-01 2014-01-08 中国人民解放军国防科学技术大学 Overlap structural deformation-based video real-time stitching method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙立伟 等: "一种大倾斜相机影像全自动无缝镶嵌方法", 《电视技术》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106296577B (en) * 2015-05-19 2019-11-29 富士通株式会社 Image split-joint method and image mosaic device
CN106296577A (en) * 2015-05-19 2017-01-04 富士通株式会社 Image split-joint method and image mosaic device
CN105554449A (en) * 2015-12-11 2016-05-04 浙江宇视科技有限公司 Method and device for quickly splicing camera images
CN105554449B (en) * 2015-12-11 2018-04-27 浙江宇视科技有限公司 A kind of method and device for being used to quickly splice camera review
CN105773309A (en) * 2016-03-10 2016-07-20 天津大学 Online testing method for ultra-view-field cutter
CN105773309B (en) * 2016-03-10 2017-11-03 天津大学 A kind of ultraphotic cutter online test method
CN106385550A (en) * 2016-09-06 2017-02-08 青岛海信移动通信技术股份有限公司 Method and terminal for capturing screen image
CN107742316A (en) * 2016-12-13 2018-02-27 腾讯科技(深圳)有限公司 Image mosaic point acquisition methods and acquisition device
CN107742316B (en) * 2016-12-13 2020-04-10 腾讯科技(深圳)有限公司 Image splicing point acquisition method and acquisition device
CN107085842B (en) * 2017-04-01 2020-04-10 上海讯陌通讯技术有限公司 Self-learning multipath image fusion real-time correction method and system
WO2018176926A1 (en) * 2017-04-01 2018-10-04 上海讯陌通讯技术有限公司 Real-time correction method and system for self-learning multi-channel image fusion
CN107085842A (en) * 2017-04-01 2017-08-22 上海讯陌通讯技术有限公司 The real-time antidote and system of self study multiway images fusion
CN108389170A (en) * 2018-03-07 2018-08-10 鞍钢集团矿业有限公司 The image enhancement and denoising method and device of more wide angle cameras overlapping regions
CN111008985A (en) * 2019-11-07 2020-04-14 贝壳技术有限公司 Panorama picture seam detection method and device, readable storage medium and electronic equipment
CN113222882A (en) * 2020-01-21 2021-08-06 上海铼钠克数控科技股份有限公司 Cloth seam detection method and device, electronic equipment and storage medium
CN114565516A (en) * 2022-03-03 2022-05-31 上海核工程研究设计院有限公司 Sensor data fused security shell surface area robust splicing method
CN114565516B (en) * 2022-03-03 2024-05-14 上海核工程研究设计院股份有限公司 A robust splicing method for containment surface area based on sensor data fusion
CN117726559A (en) * 2023-12-14 2024-03-19 江苏北方湖光光电有限公司 Luminance self-adaptive matching method based on low-illumination multi-view image stitching
CN117726559B (en) * 2023-12-14 2024-08-09 江苏北方湖光光电有限公司 Luminance self-adaptive matching method based on low-illumination multi-view image stitching

Similar Documents

Publication Publication Date Title
CN104361569A (en) Method and device for splicing images
WO2021115071A1 (en) Three-dimensional reconstruction method and apparatus for monocular endoscope image, and terminal device
JP5699788B2 (en) Screen area detection method and system
US10798359B2 (en) Generating hi-res dewarped book images
US20190385285A1 (en) Image Processing Method and Device
CN113920205A (en) Calibration method of non-coaxial camera
KR20230110618A (en) Image correction method, device and system, electronic device
CN109479082B (en) Image processing method and apparatus
CN110717942A (en) Image processing method and apparatus, electronic device, computer-readable storage medium
WO2017092631A1 (en) Image distortion correction method for fisheye image, and calibration method for fisheye camera
TW201432621A (en) Method and apparatus for image enhancement and edge verification using at least one additional image
CN108596878B (en) Image sharpness evaluation method
WO2015014111A1 (en) Optical flow tracking method and apparatus
KR101450782B1 (en) Image processing device and program
CN104881869A (en) Real time panorama tracing and splicing method for mobile platform
JPWO2018147059A1 (en) Image processing apparatus, image processing method, and program
WO2019080061A1 (en) Camera device-based occlusion detection and repair device, and occlusion detection and repair method therefor
CN114897684A (en) Vehicle image splicing method and device, computer equipment and storage medium
CN117522803A (en) Precise positioning method of bridge components based on binocular vision and target detection
JP6107372B2 (en) Image processing apparatus, image processing method, and image processing program
CN111091513B (en) Image processing method, device, computer-readable storage medium, and electronic device
CN102831578B (en) Image processing method and image processing device
JP6138706B2 (en) Digital watermark embedding method or digital watermark detection method
JP2001194126A (en) Apparatus and method for measuring three-dimensional shape and program providing medium
TWI571099B (en) Device and method for depth estimation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150218

RJ01 Rejection of invention patent application after publication