[go: up one dir, main page]

WO2021258579A1 - Image splicing method and apparatus, computer device, and storage medium - Google Patents

Image splicing method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2021258579A1
WO2021258579A1 PCT/CN2020/119741 CN2020119741W WO2021258579A1 WO 2021258579 A1 WO2021258579 A1 WO 2021258579A1 CN 2020119741 W CN2020119741 W CN 2020119741W WO 2021258579 A1 WO2021258579 A1 WO 2021258579A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
converted
optical flow
flow information
images
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
Application number
PCT/CN2020/119741
Other languages
French (fr)
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.)
Beijing Megvii Technology Co Ltd
Original Assignee
Beijing Megvii Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Megvii Technology Co Ltd filed Critical Beijing Megvii Technology Co Ltd
Publication of WO2021258579A1 publication Critical patent/WO2021258579A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular, to an image splicing method, device, computer equipment, and storage medium.
  • FIG. 1 is a schematic flowchart of an image stitching method in an embodiment
  • Figure 5 is an energy diagram obtained based on spatial optical flow information in an embodiment
  • the spatial optical flow information, the first time domain optical flow information, and the second time domain optical flow information can be respectively normalized to obtain the corresponding spatial energy value, first time domain energy value, and second time domain energy
  • the range of the spatial energy value, the first time domain energy value, and the second time domain energy value can all be 0 to 1.
  • the first time domain energy value and the second time domain energy value can be correspondingly added and averaged to obtain the time domain energy value
  • the time domain energy value and the space domain energy value are correspondingly added and averaged to obtain the final energy value, and based on the final energy value, the energy map corresponding to the overlapping area is obtained.
  • the energy map corresponding to the overlapping area is obtained by fusing the spatial optical flow information and the time domain optical flow information, which contains a larger range of effective information. Based on the energy map, the foreground part and the image in the overlapping area can be more accurately distinguished. The background part helps to further improve the quality of subsequent image stitching.
  • S1007 Determine the shortest path in the splicing direction according to each energy value in the energy map as the best suture line.
  • the image stitching module 1140 stitches the converted images according to the energy map, it is specifically used to: determine the shortest path in the stitching direction according to the energy values in the energy map as the best stitching line ; Based on the best stitching line, stitch the converted images.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The present invention relates to an image splicing method and apparatus, a computer device, and a storage medium. The method comprises: obtaining images to be processed acquired from different visual angles, converting the images to be processed to be in a unified coordinate space, and obtaining converted images corresponding to the images to be processed; determining an overlapping region of the converted images; obtaining spatial domain optical flow information on the basis of pixel points of the converted images in the overlapping region, the spatial domain optical flow information being used for representing the degree of deviation of the pixel points in the overlapping region; and splicing the converted images according to the spatial domain optical flow information. By using the method, the image splicing quality can be improved.

Description

图像拼接方法、装置、计算机设备和存储介质Image splicing method, device, computer equipment and storage medium

本公开基于申请号为202010595138.6、申请日为2020年6月24日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。This disclosure is filed based on a Chinese patent application with an application number of 202010595138.6 and an application date of June 24, 2020, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated by reference into this disclosure.

技术领域Technical field

本公开涉及图像处理技术领域,特别是涉及一种图像拼接方法、装置、计算机设备和存储介质。The present disclosure relates to the technical field of image processing, and in particular, to an image splicing method, device, computer equipment, and storage medium.

背景技术Background technique

图像拼接技术是将数张有重叠部分的图像拼成一张图像的技术,在全景成像、智能安防、医学图像分析、虚拟现实等领域有着重要的应用价值。单个摄像头由于视场范围有限,难以实现大范围视场角甚至于全场景视场角的成像,基于单个或多个摄像头采集的多幅不同视角图像或者视频流图像,可以拼接成覆盖大范围场景信息的图像。Image stitching technology is a technology that combines several images with overlapping parts into one image. It has important application value in the fields of panoramic imaging, intelligent security, medical image analysis, and virtual reality. Due to the limited field of view of a single camera, it is difficult to achieve imaging of a large field of view or even a full scene of field of view. Based on multiple images with different perspectives or video stream images collected by a single or multiple cameras, they can be spliced into a large-scale scene. Informational image.

传统的图像拼接方法中,通过提取每幅待拼接图像的特征点并进行特征点匹配,实现图像拼接。然而,当待拼接图像中存在近距离前景物体或移动物体时,通过传统方法拼接后的图像中容易出现明显拼缝或鬼影,导致图像拼接质量不佳。In the traditional image stitching method, the image stitching is realized by extracting the feature points of each image to be stitched and matching the feature points. However, when there are short-distance foreground objects or moving objects in the images to be stitched, obvious stitches or ghosts are likely to appear in the images stitched by traditional methods, resulting in poor image stitching quality.

发明内容Summary of the invention

基于此,有必要针对上述技术问题,提供一种能够提高拼接质量的图像拼接方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide an image splicing method, device, computer equipment, and storage medium that can improve the splicing quality in response to the above technical problems.

根据本公开的一个方面,提供一种图像拼接方法,所述方法包括:According to one aspect of the present disclosure, there is provided an image stitching method, the method including:

获取不同视角采集的各待处理图像,将各所述待处理图像转换到统一坐标空间,获得各所述待处理图像对应的转换后图像;Acquiring each to-be-processed image collected from different perspectives, transforming each of the to-be-processed images into a unified coordinate space, and obtaining a converted image corresponding to each of the to-be-processed images;

确定各所述转换后图像的重叠区域;Determining the overlapping area of each of the converted images;

基于各所述转换后图像在所述重叠区域的像素点,获得空域光流信息,所述空域光流信息用于表征所述重叠区域中各像素点的偏移程度;Obtain spatial optical flow information based on the pixels of each of the converted images in the overlapping area, where the spatial optical flow information is used to characterize the degree of deviation of each pixel in the overlapping area;

根据所述空域光流信息,对各所述转换后图像进行拼接。According to the spatial optical flow information, stitching each of the converted images.

根据本公开的另一个方面,提供一种图像拼接装置,所述装置包括:According to another aspect of the present disclosure, there is provided an image splicing device, the device including:

图像获取模块,用于获取不同视角采集的各待处理图像,将各所述待处理图像转换到统一坐标空间,获得各所述待处理图像对应的转换后图像;The image acquisition module is configured to acquire each to-be-processed image collected from different perspectives, convert each of the to-be-processed images to a unified coordinate space, and obtain a converted image corresponding to each of the to-be-processed images;

重叠区域确定模块,用于确定各所述转换后图像的重叠区域;An overlapping area determining module, configured to determine the overlapping area of each of the converted images;

光流信息确定模块,用于基于各所述转换后图像在所述重叠区域的像素点,获得空域 光流信息,所述空域光流信息用于表征所述重叠区域中各像素点的偏移程度;The optical flow information determining module is configured to obtain spatial optical flow information based on the pixel points of each of the converted images in the overlapping area, where the spatial optical flow information is used to characterize the offset of each pixel in the overlapping area degree;

图像拼接模块,用于根据所述空域光流信息,对各所述转换后图像进行拼接。The image stitching module is used to stitch each of the converted images according to the spatial optical flow information.

根据本公开的又一个方面,提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:According to another aspect of the present disclosure, there is provided a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

获取不同视角采集的各待处理图像,将各所述待处理图像转换到统一坐标空间,获得各所述待处理图像对应的转换后图像;Acquiring each to-be-processed image collected from different perspectives, transforming each of the to-be-processed images into a unified coordinate space, and obtaining a converted image corresponding to each of the to-be-processed images;

确定各所述转换后图像的重叠区域;Determining the overlapping area of each of the converted images;

基于各所述转换后图像在所述重叠区域的像素点,获得空域光流信息,所述空域光流信息用于表征所述重叠区域中各像素点的偏移程度;Obtain spatial optical flow information based on the pixels of each of the converted images in the overlapping area, where the spatial optical flow information is used to characterize the degree of deviation of each pixel in the overlapping area;

根据所述空域光流信息,对各所述转换后图像进行拼接。According to the spatial optical flow information, stitching each of the converted images.

根据本公开的又一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:According to another aspect of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and the computer program implements the following steps when executed by a processor:

获取不同视角采集的各待处理图像,将各所述待处理图像转换到统一坐标空间,获得各所述待处理图像对应的转换后图像;Acquiring each to-be-processed image collected from different perspectives, transforming each of the to-be-processed images into a unified coordinate space, and obtaining a converted image corresponding to each of the to-be-processed images;

确定各所述转换后图像的重叠区域;Determining the overlapping area of each of the converted images;

基于各所述转换后图像在所述重叠区域的像素点,获得空域光流信息,所述空域光流信息用于表征所述重叠区域中各像素点的偏移程度;Obtain spatial optical flow information based on the pixels of each of the converted images in the overlapping area, where the spatial optical flow information is used to characterize the degree of deviation of each pixel in the overlapping area;

根据所述空域光流信息,对各所述转换后图像进行拼接。According to the spatial optical flow information, stitching each of the converted images.

上述图像拼接方法、装置、计算机设备和存储介质,通过获取不同视角采集的各待处理图像,将各待处理图像转换到统一坐标空间,获得各待处理图像对应的转换后图像;确定各转换后图像的重叠区域;基于各转换后图像在重叠区域的像素点,获得空域光流信息,空域光流信息用于表征重叠区域中各像素点的偏移程度;根据空域光流信息,对各转换后图像进行拼接。由于不同景深的物体在不同视角图像中的像素偏移程度不一致,因此通过空域光流信息可以有效区分重叠区域图像中的前景图像和背景图像,根据空域光流信息进行图像拼接时,能够使得缝合线绕过前景物体或运动物体,有效避免缝合线经过前景物体或运动物体时容易出现的拼缝或鬼影问题,从而提高图像拼接质量。The above-mentioned image splicing method, device, computer equipment and storage medium acquire each to-be-processed image collected from different perspectives, convert each to-be-processed image into a unified coordinate space, and obtain the converted image corresponding to each to-be-processed image; determine each converted image The overlapping area of the image; based on the pixels of each converted image in the overlapping area, the spatial optical flow information is obtained. The spatial optical flow information is used to characterize the offset degree of each pixel in the overlapping area; according to the spatial optical flow information, each conversion is performed After the image is stitched. Since the pixel offsets of objects with different depths of field are inconsistent in different viewing angles, the spatial optical flow information can effectively distinguish the foreground image and the background image in the overlapping area image. When image stitching is performed according to the spatial optical flow information, stitching can be made The thread bypasses the foreground object or moving object, effectively avoiding the seam or ghosting problem that is likely to occur when the stitching thread passes through the foreground object or moving object, thereby improving the quality of image stitching.

附图说明Description of the drawings

图1为一个实施例中图像拼接方法的流程示意图;FIG. 1 is a schematic flowchart of an image stitching method in an embodiment;

图2为一个实施例中不同视角采集的两张待处理图像;Figure 2 shows two images to be processed collected from different perspectives in an embodiment;

图3为一个实施例中两张待处理图像及其重叠区域;Figure 3 shows two images to be processed and their overlapping areas in an embodiment;

图4为一个实施例中两张待处理图像对应的转换后图像的重叠区域;FIG. 4 is an overlapping area of converted images corresponding to two images to be processed in an embodiment;

图5为一个实施例中基于空域光流信息获得的能量图;Figure 5 is an energy diagram obtained based on spatial optical flow information in an embodiment;

图6为一个实施例中用于处理各转换后图像的掩码图;Fig. 6 is a mask diagram for processing each converted image in an embodiment;

图7为一个实施例中经掩码图处理后的转换后图像;Fig. 7 is a converted image after mask image processing in an embodiment;

图8为一个实施例中经掩码图处理后的转换后图像;Fig. 8 is a converted image after mask image processing in an embodiment;

图9为一个实施例中的拼接后图像;Figure 9 is an image after stitching in an embodiment;

图10为一个实施例中图像拼接方法的流程示意图;FIG. 10 is a schematic flowchart of an image stitching method in an embodiment;

图11为一个实施例中图像拼接装置的结构框图;Figure 11 is a structural block diagram of an image splicing device in an embodiment;

图12为一个实施例中计算机设备的内部结构图;Figure 12 is an internal structure diagram of a computer device in an embodiment;

图13为一个实施例中计算机设备的内部结构图。Fig. 13 is an internal structure diagram of a computer device in an embodiment.

具体实施方式detailed description

为了使本公开的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本公开进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本公开,并不用于限定本公开。In order to make the objectives, technical solutions, and advantages of the present disclosure clearer, the following further describes the present disclosure in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present disclosure, but not used to limit the present disclosure.

在一个实施例中,如图1所示,提供了一种图像拼接方法,本实施例以该方法应用于终端进行举例说明,可以理解的是,该方法也可以应用于服务器,还可以应用于包括终端和服务器的系统,并通过终端和服务器的交互实现。其中,终端可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。本实施例中,该方法包括以下步骤S102至步骤S108。In one embodiment, as shown in FIG. 1, an image stitching method is provided. This embodiment uses the method applied to a terminal as an example. It is understandable that the method can also be applied to a server, and can also be applied to A system that includes a terminal and a server, and is realized through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps S102 to S108.

S102,获取不同视角采集的各待处理图像,将各待处理图像转换到统一坐标空间,获得各待处理图像对应的转换后图像。S102: Obtain each to-be-processed image collected from different perspectives, convert each to-be-processed image into a unified coordinate space, and obtain a converted image corresponding to each to-be-processed image.

其中,待处理图像表示待拼接图像,不同视角采集的各待处理图像,具体可以是通过不同位置的摄像头针对同一对象拍摄的图像,各待处理图像具有一定的重叠部分。Among them, the image to be processed means the image to be spliced, and the images to be processed collected from different perspectives may specifically be images captured by cameras at different positions for the same object, and the images to be processed have a certain overlap.

获得各待处理图像之后,由于各待处理图像的图像坐标系可能不一致,因此需要对各待处理图像进行图像配准,以将各待处理图像转换到统一坐标空间中,方便后续处理。在一个实施例中,可以选取其中一张待处理图像作为参考图像,将其它待处理图像作为待配准图像,与该参考图像进行配准,从而将各待处理图像置于同一坐标空间中。After each image to be processed is obtained, since the image coordinate system of each image to be processed may be inconsistent, it is necessary to perform image registration on each image to be processed to convert each image to be processed into a unified coordinate space to facilitate subsequent processing. In an embodiment, one of the images to be processed may be selected as a reference image, and other images to be processed are used as images to be registered, and registered with the reference image, so that the images to be processed are placed in the same coordinate space.

具体地,图像配准过程可以如下:对各待处理图像分别进行特征点提取,获得各待处理图像的特征点,将各待配准图像的特征点与参考图像的特征点进行匹配,基于特征点匹配信息可以得到各待配准图像与参考图像之间的坐标变换关系,计算得到用于各待配准图像进行空间配准变换的单应变换矩阵,基于单应变换矩阵,将各待配准图像以及参考图像转换到同一坐标空间中。Specifically, the image registration process can be as follows: extract feature points of each image to be processed, obtain feature points of each image to be processed, and match the feature points of each image to be registered with the feature points of the reference image, based on the feature The point matching information can obtain the coordinate transformation relationship between each image to be registered and the reference image, and calculate the homography transformation matrix used for the spatial registration transformation of each image to be registered. Based on the homography transformation matrix, the The quasi-image and the reference image are transformed into the same coordinate space.

需要说明的是,上述过程中,可以采用任何可能的方式进行特征点提取,例如尺度不变特征变换算法(SIFT),也可以采用任何可能的方式进行特征点匹配,例如随机抽样一致算法(RANSAC),在此不作限制。It should be noted that in the above process, any possible method can be used for feature point extraction, such as the Scale Invariant Feature Transformation Algorithm (SIFT), or any possible method for feature point matching, such as Random Sampling Consensus Algorithm (RANSAC). ), no restrictions here.

S104,确定各转换后图像的重叠区域。S104: Determine the overlapping area of each converted image.

具体地,将各待处理图像转换到同一坐标空间中后,可以获取各转换后图像中图像点 的坐标位置信息,根据各转换后图像中图像点的坐标位置信息的交集部分,确定重叠区域。Specifically, after each image to be processed is converted into the same coordinate space, the coordinate position information of the image points in each converted image can be obtained, and the overlapping area can be determined according to the intersection of the coordinate position information of the image points in each converted image.

以两张待处理图像为例,请参阅图2,示出了一个实施例中不同视角采集的两张待处理图像,左边的待处理图像用L表示,右边的待处理图像用R表示。图像L和图像R的取景范围不同,具有一定的重叠区域,请参阅图3,示出了图像L和图像R的重叠区域。将图像L和图像R转换到统一坐标空间,得到对应的转换后图像,分别用L′和R′表示,具体地,以图像L为参考图像,图像L′和图像L相同,将图像R投影到图像L所在的坐标空间中,得到图像R′,请参阅图4,示出了图像L′和图像R′的重叠区域,图4中的左图和右图分别表示图像R′和图像L′在重叠区域的图像,分别用R1和L1表示。Taking two to-be-processed images as an example, please refer to FIG. 2, which shows two to-be-processed images collected from different perspectives in an embodiment. The to-be-processed image on the left is denoted by L, and the to-be-processed image on the right is denoted by R. The viewing ranges of the image L and the image R are different and have a certain overlapping area. Please refer to FIG. 3, which shows the overlapping area of the image L and the image R. Convert image L and image R to a unified coordinate space to obtain the corresponding converted image, denoted by L′ and R′ respectively. Specifically, using image L as a reference image, image L′ and image L are the same, and image R is projected In the coordinate space where the image L is located, the image R′ is obtained. Please refer to Figure 4, which shows the overlapping area of the image L′ and the image R′. The left and right images in Figure 4 represent the image R′ and the image L, respectively. ′The image in the overlapping area is represented by R1 and L1 respectively.

S106,基于各转换后图像在重叠区域的像素点,获得空域光流信息,空域光流信息用于表征重叠区域中各像素点的偏移程度。S106: Obtain spatial optical flow information based on the pixels of each converted image in the overlap area, where the spatial optical flow information is used to represent the degree of deviation of each pixel in the overlap area.

光流信息可以用于表征像素点的偏移程度,对于不同视角采集的各图像,由于距离和视差等原因,前景目标(包括运动目标)在各图像中的像素会发生偏移,且偏移程度相对于背景物体更大,因此可基于不同视角采集的各图像中的像素偏移情况,获得空域光流信息。Optical flow information can be used to characterize the degree of pixel offset. For each image collected from different perspectives, due to distance and parallax, the pixels of foreground objects (including moving objects) in each image will be offset and offset The degree is greater than that of the background object, so the spatial optical flow information can be obtained based on the pixel offset in each image collected from different perspectives.

以图4中的重叠区域图像为例,可以通过光流算法计算图像R1到图像L1光流信息,获得空域光流信息,该空域光流信息表示图像R1的像素在图像R1中的位置与该像素在图像L1中的位置的偏移程度。需要说明的是,上述过程中,可以采用任何可能的光流算法计算光流信息,例如Lucas-Kanade、FlowNet等算法,在此不作限制。Taking the image of the overlapping area in Fig. 4 as an example, the optical flow information from image R1 to image L1 can be calculated by the optical flow algorithm to obtain spatial optical flow information. The shift degree of the position of the pixel in the image L1. It should be noted that in the above process, any possible optical flow algorithm can be used to calculate the optical flow information, such as Lucas-Kanade, FlowNet, etc., which are not limited here.

S108,根据空域光流信息,对各转换后图像进行拼接。S108, according to the spatial optical flow information, stitch each converted image.

由于不同景深的物体在不同视角图像中的像素偏移程度不一致,前景目标(包括运动目标)的像素偏移程度相对于背景物体更大,即空域光流信息越大,其对应于前景目标的概率越大,空域光流信息越小,其对应于背景物体的概率越大,因此利用空域光流信息对各转换后图像进行拼接,能够使得缝合线绕过前景目标。Since the pixel offsets of objects with different depths of field are inconsistent in different viewing angles, the pixel offset of foreground objects (including moving objects) is greater than that of background objects, that is, the greater the spatial optical flow information, the greater the degree of pixel offset corresponding to the foreground object. The greater the probability, the smaller the spatial optical flow information, and the greater the probability that it corresponds to the background object. Therefore, using the spatial optical flow information to stitch each converted image can make the stitching bypass the foreground target.

上述图像拼接方法中,通过获取不同视角采集的各待处理图像,将各待处理图像转换到统一坐标空间,获得各待处理图像对应的转换后图像;确定各转换后图像的重叠区域;基于各转换后图像在重叠区域的像素点,获得空域光流信息,空域光流信息用于表征重叠区域中各像素点的偏移程度;根据空域光流信息,对各转换后图像进行拼接。由于不同景深的物体在不同视角图像中的像素偏移程度不一致,因此通过空域光流信息可以有效区分重叠区域图像中的前景图像和背景图像,根据空域光流信息进行图像拼接时,能够使得缝合线绕过前景物体或运动物体,有效避免缝合线经过前景物体或运动物体时容易出现的拼缝或鬼影问题,从而提高图像拼接质量。In the above-mentioned image stitching method, by acquiring each to-be-processed image collected from different perspectives, each to-be-processed image is converted to a unified coordinate space, and the converted image corresponding to each to-be-processed image is obtained; the overlap area of each converted image is determined; The pixels of the converted image in the overlap area obtain spatial optical flow information. The spatial optical flow information is used to characterize the offset degree of each pixel in the overlap area; according to the spatial optical flow information, each converted image is spliced. Since the pixel offsets of objects with different depths of field are inconsistent in different viewing angles, the spatial optical flow information can effectively distinguish the foreground image and the background image in the overlapping area image. When image stitching is performed according to the spatial optical flow information, stitching can be made The thread bypasses the foreground object or moving object, effectively avoiding the seam or ghosting problem that is likely to occur when the stitching thread passes through the foreground object or moving object, thereby improving the quality of image stitching.

在一个实施例中,基于各转换后图像在重叠区域的像素点,获得空域光流信息的步骤,具体可以包括以下步骤:获取第一转换后图像在重叠区域中的第一像素点的第一位置信息,以及第二转换后图像在重叠区域中与第一像素点匹配的第二像素点的第二位置信息,各转换后图像包括第一转换后图像和第二转换后图像;根据第一位置信息和第二位置信 息,获得空域光流信息。In one embodiment, the step of obtaining spatial optical flow information based on the pixel points of each converted image in the overlapping area may specifically include the following steps: obtaining the first pixel of the first pixel point in the overlapping area of the first converted image The position information, and the second position information of the second pixel matching the first pixel in the overlap area of the second converted image, each converted image includes the first converted image and the second converted image; The location information and the second location information obtain the spatial optical flow information.

以图4中的重叠区域图像为例,图像R1中的像素点表示第一转换后图像在重叠区域中的像素点,即第一像素点,第一位置信息表示第一像素点在图像R1中的位置信息。图像L1中的像素点表示第二转换后图像在重叠区域中的像素点(为了区分,这里用第四像素点表示),从第四像素点中寻找与第一像素点相匹配的像素点,即第二像素点,第二位置信息表示第二像素点在图像L1中的位置信息。根据第一位置信息相对于第二位置信息的偏移情况,获得空域光流信息。Take the overlapping area image in Figure 4 as an example, the pixels in the image R1 represent the pixels in the overlapping area of the first converted image, that is, the first pixel, and the first position information indicates that the first pixel is in the image R1 Location information. The pixels in the image L1 represent the pixels in the overlap area of the second converted image (for distinguishing purposes, here are represented by the fourth pixel), the fourth pixel is searched for the pixel that matches the first pixel, That is, the second pixel, and the second position information indicates the position information of the second pixel in the image L1. According to the deviation of the first position information relative to the second position information, the spatial optical flow information is obtained.

本实施例中,通过同一像素点在不同视角的重叠区域图像中的位置偏移情况获得空域光流信息,基于这样获得的空域光流信息可以有效区分重叠区域图像中的前景部分和背景部分,并且空域光流信息对对亮度不敏感,即对于各种光照条件下的重叠区域图像,都能准确识别其中的前景部分和背景部分,从而提高在不同光照条件下的图像识别效果。In this embodiment, the spatial optical flow information is obtained based on the position offset of the same pixel in the overlapping area images of different viewing angles. Based on the spatial optical flow information obtained in this way, the foreground part and the background part in the overlapping area image can be effectively distinguished. And the spatial optical flow information is not sensitive to brightness, that is, for the overlapping area images under various lighting conditions, the foreground and background parts can be accurately identified, thereby improving the image recognition effect under different lighting conditions.

在一个实施例中,还包括以下步骤:获取第一待处理图像的第一相邻帧图像,以及第二待处理图像的第二相邻帧图像,各待处理图像包括第一待处理图像和第二待处理图像;将第一相邻帧图像和第二相邻帧图像转换到统一坐标空间中,获得第一辅助图像和第二辅助图像。In one embodiment, the method further includes the following steps: acquiring a first adjacent frame image of the first image to be processed, and a second adjacent frame image of the second image to be processed, each image to be processed includes the first image to be processed and The second image to be processed; the first adjacent frame image and the second adjacent frame image are converted into a unified coordinate space to obtain the first auxiliary image and the second auxiliary image.

以两张待处理图像为例,两张待处理图像包括第一待处理图像和第二待处理图像,第一待处理图像转换到统一坐标空间获得第一转换后图像,第二待处理图像转换到统一坐标空间获得第二转换后图像。具体地,第一待处理图像和第二待处理图像可以分别对应第一摄像头和第二摄像头采集的第t帧图像,第一相邻帧图像和第二相邻帧图像可以分别对应第一摄像头和第二摄像头采集的第t-1帧图像,将第一相邻帧图像转换到统一坐标空间中获得第一辅助图像,将第二相邻帧图像转换到统一坐标空间中获得第二辅助图像,使得第一转换后图像、第二转换后图像、第一辅助图像和第二辅助图像处于同一坐标空间中。Take two images to be processed as an example. The two images to be processed include the first image to be processed and the second image to be processed. Go to the unified coordinate space to obtain the second transformed image. Specifically, the first image to be processed and the second image to be processed may respectively correspond to the t-th frame image collected by the first camera and the second camera, and the first adjacent frame image and the second adjacent frame image may respectively correspond to the first camera With the t-1th frame image collected by the second camera, the first adjacent frame image is converted to the unified coordinate space to obtain the first auxiliary image, and the second adjacent frame image is converted to the unified coordinate space to obtain the second auxiliary image , So that the first converted image, the second converted image, the first auxiliary image, and the second auxiliary image are in the same coordinate space.

本实施例中,通过获取各待处理图像的相邻帧图像,可以获取各待处理图像中的像素在时间上的变化信息,为后续计算光流信息提供更大范围的有效信息,使计算的光流信息能够更准确地反映像素的实际偏移情况,从而有助于提高图像识别的准确性。In this embodiment, by acquiring adjacent frame images of each image to be processed, the temporal change information of the pixels in each image to be processed can be acquired, providing a larger range of effective information for subsequent calculation of optical flow information, so that the calculated The optical flow information can more accurately reflect the actual offset of the pixels, thereby helping to improve the accuracy of image recognition.

在一个实施例中,获得第一辅助图像和第二辅助图像之后,还可以包括以下步骤:获取第一转换后图像在重叠区域的第一像素点的第一位置信息,以及第一辅助图像中与第一像素点匹配的第三像素点的第三位置信息;根据第一位置信息和第三位置信息,获得第一时域光流信息;获取第二转换后图像在重叠区域的第四像素点的第四位置信息,以及第二辅助图像中与第四像素点匹配的第五像素点的第五位置信息,各转换后图像包括第一转换后图像和第二转换后图像;根据第四位置信息和第五位置信息,获得第二时域光流信息。In one embodiment, after obtaining the first auxiliary image and the second auxiliary image, the method may further include the following steps: obtaining first position information of the first pixel in the overlap area of the first converted image, and in the first auxiliary image The third position information of the third pixel matching the first pixel; the first time domain optical flow information is obtained according to the first position information and the third position information; the fourth pixel in the overlap area of the second converted image is obtained The fourth position information of the dot, and the fifth position information of the fifth pixel matching the fourth pixel in the second auxiliary image, each converted image includes the first converted image and the second converted image; according to the fourth The position information and the fifth position information are used to obtain the second time domain optical flow information.

其中,第一转换后图像对应第一摄像头采集的第t帧图像经空间转换后的图像,第一辅助图像对应第一摄像头采集的第t-1帧图像经空间转换后的图像,第二转换后图像对应第二摄像头采集的第t帧图像经空间转换后的图像,第二辅助图像对应第二摄像头采集的第t-1帧图像经空间转换后的图像,重叠区域表示第一转换后图像和第二转换图像的重叠 区域。Among them, the first converted image corresponds to the space-converted image of the t-th frame image collected by the first camera, the first auxiliary image corresponds to the space-converted image of the t-1th frame image collected by the first camera, and the second conversion The rear image corresponds to the space-converted image of the t-th frame captured by the second camera. The second auxiliary image corresponds to the space-converted image of the t-1th frame captured by the second camera. The overlap area represents the first converted image. And the overlapping area of the second converted image.

第一转换后图像在重叠区域的像素点,即第一像素点,第一位置信息表示第一像素点在第一转换后图像中的位置信息。从第一辅助图像的像素点中寻找与第一像素点相匹配的像素点,即第三像素点,第三位置信息表示第三像素点在第一辅助图像中的位置信息。根据第一位置信息相对于第三位置信息的偏移情况,获得第一时域光流信息。The pixel points in the overlap area of the first converted image, that is, the first pixel point, and the first position information represents the position information of the first pixel point in the first converted image. Find a pixel point that matches the first pixel point from the pixel points of the first auxiliary image, that is, the third pixel point, and the third position information represents the position information of the third pixel point in the first auxiliary image. According to the deviation of the first position information relative to the third position information, the first time-domain optical flow information is obtained.

第二转换后图像在重叠区域的像素点,即第四像素点,第四位置信息表示第四像素点在第二转换后图像中的位置信息。从第二辅助图像的像素点中寻找与第四像素点相匹配的像素点,即第五像素点,第五位置信息表示第五像素点在第二辅助图像中的位置信息。根据第四位置信息相对于第五位置信息的偏移情况,获得第二时域光流信息。The pixel points in the overlap area of the second converted image, that is, the fourth pixel point, and the fourth position information represents the position information of the fourth pixel point in the second converted image. Find a pixel point that matches the fourth pixel point from the pixel points of the second auxiliary image, that is, the fifth pixel point, and the fifth position information represents the position information of the fifth pixel point in the second auxiliary image. According to the deviation of the fourth position information relative to the fifth position information, the second time-domain optical flow information is obtained.

本实施例中,充分利用图像在时域上的连续信息,通过同一像素点在不同帧图像中的位置偏移情况获得时域光流信息,用于反映像素在时间维度的变化情况,对空域光流信息进行补充,从而更准确地反映像素的实际偏移情况,有助于提高图像识别的准确性。In this embodiment, the continuous information of the image in the time domain is fully utilized, and the optical flow information in the time domain is obtained through the position offset of the same pixel in different frames of the image, which is used to reflect the change of the pixel in the time dimension, and is useful for the spatial domain. The optical flow information is supplemented to more accurately reflect the actual offset of the pixel and help improve the accuracy of image recognition.

在一个实施例中,根据空域光流信息,对各转换后图像进行拼接的步骤,具体可以包括以下步骤:根据空域光流信息,获得重叠区域对应的能量图;根据能量图,对各转换后图像进行拼接。In one embodiment, the step of stitching each converted image according to the spatial optical flow information may specifically include the following steps: obtaining an energy map corresponding to the overlapping area according to the spatial optical flow information; The images are stitched.

其中,根据空域光流信息,获得重叠区域对应的能量图的步骤,具体可以是:将空域光流信息进行转换,得到对应的空域能量值;基于空域能量值,获得重叠区域对应的能量图。以图4中的重叠区域图像为例,计算得到图像R1到图像L1的空域光流信息之后,可以将空域光流信息进行转换,具体可以是将空域光流信息进行归一化,空域光流信息归一化后得到相应的空域能量值,空域能量值的范围可以是0~1,需要理解的是,空域光流信息越大,对应的空域能量值越大,空域光流信息越小,对应的空域能量值越小。基于空域能量值得到重叠区域对应的能量图,请参阅图5,示出了根据图像R1到图像L1的空域光流信息获得的能量图,在该能量图中,能量值越接近0,颜色越接近黑色,对应的位置越可能是背景图像;能量值越接近1,颜色越接近白色,对应的位置越可能是前景图像。The step of obtaining the energy map corresponding to the overlapping area according to the spatial optical flow information may specifically include: converting the spatial optical flow information to obtain the corresponding spatial energy value; and obtaining the energy map corresponding to the overlapping area based on the spatial energy value. Taking the image of the overlapping area in Figure 4 as an example, after calculating the spatial optical flow information from image R1 to image L1, the spatial optical flow information can be converted. Specifically, the spatial optical flow information can be normalized. After the information is normalized, the corresponding airspace energy value is obtained. The range of the airspace energy value can be 0~1. It should be understood that the greater the airspace optical flow information, the larger the corresponding airspace energy value, and the smaller the airspace optical flow information. The corresponding airspace energy value is smaller. Obtain the energy map corresponding to the overlapping area based on the spatial energy value. Please refer to Figure 5, which shows the energy map obtained according to the spatial optical flow information of the image R1 to the image L1. In this energy map, the closer the energy value is to 0, the more the color Closer to black, the corresponding position is more likely to be the background image; the closer the energy value is to 1, the closer the color is to white, and the more likely the corresponding position is the foreground image.

本实施例中,根据空域光流信息获得重叠区域对应的能量图,能量图可以准确反映重叠区域中分别对应前景图像和背景图像的区域,从而基于能量图可以区分重叠区域图像中的前景部分和背景部分,根据能量图进行图像拼接时,能够使得缝合线只经过背景部分,有效避免缝合线经过前景物体或运动物体时容易出现的拼缝或鬼影问题,从而提高图像拼接质量。In this embodiment, the energy map corresponding to the overlapping area is obtained according to the spatial optical flow information. The energy map can accurately reflect the areas corresponding to the foreground image and the background image in the overlapping area, so that the foreground part and the background image in the overlapping area image can be distinguished based on the energy map. In the background part, when image stitching is performed based on the energy map, the stitching line can only pass through the background part, effectively avoiding the seam or ghosting problem that is likely to occur when the stitching line passes through foreground objects or moving objects, thereby improving the quality of image stitching.

在一个实施例中,根据空域光流信息,获得重叠区域对应的能量图的步骤,具体可以包括以下步骤:将空域光流信息、第一时域光流信息和第二时域光流信息分别进行转换,得到对应的空域能量值、第一时域能量值和第二时域能量值;基于空域能量值、第一时域能量值和第二时域能量值,获得重叠区域对应的能量图。In one embodiment, the step of obtaining the energy map corresponding to the overlapping area according to the spatial optical flow information may specifically include the following steps: separate the spatial optical flow information, the first time domain optical flow information, and the second time domain optical flow information. Perform conversion to obtain the corresponding spatial energy value, first time domain energy value and second time domain energy value; based on the spatial energy value, first time domain energy value and second time domain energy value, obtain the energy map corresponding to the overlapping area .

具体地,可以将空域光流信息、第一时域光流信息和第二时域光流信息分别进行归一化,得到相应的空域能量值、第一时域能量值和第二时域能量值,空域能量值、第一时域 能量值和第二时域能量值的范围都可以是0~1。获得空域能量值、第一时域能量值和第二时域能量值之后,可以将第一时域能量值与第二时域能量值进行对应相加并取平均值,获得时域能量值,再将时域能量值与空域能量值进行对应相加并取平均值,获得最终能量值,基于最终能量值获得重叠区域对应的能量图。Specifically, the spatial optical flow information, the first time domain optical flow information, and the second time domain optical flow information can be respectively normalized to obtain the corresponding spatial energy value, first time domain energy value, and second time domain energy The range of the spatial energy value, the first time domain energy value, and the second time domain energy value can all be 0 to 1. After obtaining the spatial energy value, the first time domain energy value, and the second time domain energy value, the first time domain energy value and the second time domain energy value can be correspondingly added and averaged to obtain the time domain energy value, Then the time domain energy value and the space domain energy value are correspondingly added and averaged to obtain the final energy value, and based on the final energy value, the energy map corresponding to the overlapping area is obtained.

本实施例中,通过融合空域光流信息和时域光流信息获得重叠区域对应的能量图,包含更大范围的有效信息,基于该能量图可以更准确地区分重叠区域图像中的前景部分和背景部分,有助于进一步提高后续图像拼接质量。In this embodiment, the energy map corresponding to the overlapping area is obtained by fusing the spatial optical flow information and the time domain optical flow information, which contains a larger range of effective information. Based on the energy map, the foreground part and the image in the overlapping area can be more accurately distinguished. The background part helps to further improve the quality of subsequent image stitching.

在一个实施例中,根据能量图确定各转换后图像在重叠区域中的前景图像和背景图像,可以采用如下方式:根据能量图中各能量值中大于预设阈值的能量值对应的图像点位置,确定各转换后图像在重叠区域中的前景图像;根据能量图中各能量值中小于或等于预设阈值的能量值对应的图像点位置,确定各转换后图像在重叠区域中的背景图像。In an embodiment, determining the foreground image and background image of each converted image in the overlap area according to the energy map may be as follows: according to the position of the image point corresponding to the energy value greater than the preset threshold in each energy value in the energy map , Determine the foreground image of each converted image in the overlap area; determine the background image of each converted image in the overlap area according to the position of the image point corresponding to the energy value less than or equal to the preset threshold in each energy value in the energy map.

具体地,能量值的范围可以是0~1,预设阈值可以根据实际情况进行设置,例如可以设为0.5,则认为大于0.5的能量值对应的图像点位置在重叠区域图像中对应的图像点属于前景图像,小于或等于0.5的能量值对应的图像点位置在重叠区域图像中对应的图像点属于背景图像。Specifically, the energy value can range from 0 to 1, and the preset threshold can be set according to actual conditions. For example, it can be set to 0.5, and the image point position corresponding to the energy value greater than 0.5 is considered to be the corresponding image point in the overlap area image. Belonging to the foreground image, the image point corresponding to the energy value less than or equal to 0.5 in the overlapping area image corresponds to the background image.

本实施例中,通过合适的能量值阈值区分能量图中对应前景图像和背景图像的图像点位置,便于前景图像和背景图像的区分和提取。In this embodiment, the positions of the image points corresponding to the foreground image and the background image in the energy map are distinguished by a suitable energy value threshold, so as to facilitate the distinction and extraction of the foreground image and the background image.

在一个实施例中,根据能量图,对各转换后图像进行拼接的步骤,具体可以包括以下步骤:根据能量图中的各能量值,确定拼接方向上的最短路径,作为最佳缝合线;基于最佳缝合线,对各转换后图像进行拼接,获得拼接后图像。In one embodiment, the step of stitching each converted image according to the energy map may specifically include the following steps: determining the shortest path in the stitching direction according to each energy value in the energy map as the best stitching line; The best stitching line is to stitch each converted image to obtain the stitched image.

以图5中的能量图为例,拼接方向为上下方向,最短路径表示从能量图的最上面一行走到最下面一行的最短路径,最短路径可以理解为经过的能量值总和最小的路径,具体地可以通过动态规划算法寻找能量图的最短路径,图5所示能量图的最短路径如图5中右侧的线条所示。Take the energy map in Figure 5 as an example, the splicing direction is up and down, and the shortest path means the shortest path from the top of the energy map to the bottom row. The shortest path can be understood as the path with the smallest sum of energy values. The ground can find the shortest path of the energy map through the dynamic programming algorithm. The shortest path of the energy map shown in Figure 5 is shown by the line on the right in Figure 5.

本实施例中,根据能量图在拼接方向上的最短路径确定最佳缝合线,该最短路径表示拼接方向上经过的能量值总和最小的路径,较小能量值所在位置对应背景物体,从而根据该最短路径确定的最佳缝合线能够绕过前景物体或运动物体,可有效避免拼接时缝合线经过前景物体或运动物体时容易出现的拼缝或鬼影问题,从而提高图像拼接质量。In this embodiment, the best stitching line is determined according to the shortest path of the energy map in the splicing direction. The shortest path represents the path with the smallest sum of energy values in the splicing direction. The best stitching line determined by the shortest path can bypass foreground objects or moving objects, which can effectively avoid seam or ghosting problems that are prone to occur when stitching passes through foreground objects or moving objects during stitching, thereby improving the quality of image stitching.

在一个实施例中,基于最佳缝合线,对各转换后图像进行拼接,获得拼接后图像的步骤,具体可以包括以下步骤:基于最佳缝合线对各转换后图像进行裁剪,将裁剪后的各图像进行拼接。In one embodiment, the step of stitching each converted image based on the best stitching line to obtain the stitched image may specifically include the following steps: cropping each converted image based on the best stitching line, and cutting the cropped image The images are stitched together.

具体地,基于最佳缝合线可以将各转换后图像的重叠区域图像分成两部分,第一部分图像靠近自身的非重叠区域图像,第二部分图像远离自身的非重叠区域图像,基于最佳缝合线对各转换后图像进行裁剪,具体是将各转换后图像的重叠区域图像中的第二部分图像裁剪掉,裁剪后的各图像表示各转换后图像裁剪掉上述第二部分图像后剩下的图像。基于 最佳缝合线还可以获得用于处理各转换后图像的掩码图,根据各转换后图像对应的掩码图对各转换后图像进行裁剪,获得裁剪后图像,对各裁剪后图像进行融合,获得拼接后图像。Specifically, based on the optimal stitching line, the overlapping area image of each converted image can be divided into two parts, the first part of the image is close to its own non-overlapping area image, and the second part of the image is far away from its own non-overlapping area image, based on the best stitching line Crop each converted image, specifically by cropping the second part of the image in the overlap area of each converted image, and each cropped image represents the remaining image after each converted image is cropped off the second part of the image. . Based on the best stitching line, the mask map used to process each converted image can also be obtained. According to the mask map corresponding to each converted image, each converted image is cropped to obtain the cropped image, and the cropped images are merged , To obtain the stitched image.

以图5中的最佳缝合线为例,根据该最佳缝合线可以获得用于处理图像L′和图像R′的掩码图,请参阅图6,示出了用于处理图像L′和图像R′的掩码图,图6中的左图和右图分别表示用于处理图像L′和图像R′的掩码图,分别用mask_L和mask_R表示,掩码图mask_L中的白色区域和黑色区域分别对应图像L′中的待保留区域和待去除区域,掩码图mask_L中的渐变区域起到羽化作用,使得拼接处的过渡更自然,请参阅图7,示出了图像L′经掩码图mask_L处理后的图像,用L2表示。掩码图mask_R中的白色区域和黑色区域分别对应图像R′中待保留和待去除的区域,掩码图mask_R中的渐变区域起到羽化作用,使得拼接处的过渡更自然,请参阅图8,示出了图像R′经掩码图mask_R处理后的图像,用R2表示。对图像L2和图像R2进行拼接,获得拼接后图像,请参阅图9,示出了图像L2和图像R2拼接后的图像。Take the optimal stitching line in Fig. 5 as an example. According to the optimal stitching line, the mask map for processing the image L′ and the image R′ can be obtained. The mask map of image R'. The left and right images in Figure 6 respectively represent the mask maps used to process the image L'and the image R', denoted by mask_L and mask_R, respectively. The white area in the mask map mask_L and The black areas correspond to the area to be retained and the area to be removed in the image L′. The gradient area in the mask map mask_L plays a role of feathering, making the transition at the splicing more natural. Please refer to Figure 7, which shows the image L′ The image processed by mask_L is represented by L2. The white area and black area in the mask image mask_R correspond to the areas to be retained and to be removed in the image R′, respectively. The gradient area in the mask image mask_R plays a role of feathering, making the transition at the splicing more natural, see Figure 8. , Shows the image after the image R'is processed by the mask image mask_R, denoted by R2. The image L2 and the image R2 are spliced to obtain a spliced image. Please refer to FIG. 9, which shows the spliced image of the image L2 and the image R2.

本实施例中,基于最佳缝合线对各转换后图像进行拼接,能够绕过前景物体或运动物体,可有效避免拼接时缝合线经过前景物体或运动物体时容易出现的拼缝或鬼影问题,从而提高图像拼接质量。In this embodiment, the converted images are stitched based on the best stitching line, which can bypass foreground objects or moving objects, and can effectively avoid the seam or ghosting problem that is likely to occur when the stitching line passes through foreground objects or moving objects during stitching. , Thereby improving the quality of image stitching.

需要理解的是,上述实施例是以两张图像的拼接为例进行说明,但不限于两张图像的拼接,还可以应用于多于两张图像的拼接,拼接过程与上述实施例类似,此处不再赘述。It should be understood that the above embodiment takes the stitching of two images as an example for description, but it is not limited to the stitching of two images, and can also be applied to the stitching of more than two images. The stitching process is similar to the above embodiment. I won't repeat it here.

在一个实施例中,如图10所示,提供了一种图像拼接方法,该方法包括以下步骤S1001至步骤S1008。In one embodiment, as shown in FIG. 10, an image stitching method is provided, and the method includes the following steps S1001 to S1008.

S1001,获取不同视角采集的各待处理图像以及各待处理图像的相邻帧图像,将各待处理图像以及各相邻帧图像转换到统一坐标空间,获得各待处理图像对应的转换后图像以及各相邻帧图像对应的辅助图像。S1001: Obtain each to-be-processed image and adjacent frame images of each to-be-processed image collected from different perspectives, convert each to-be-processed image and each adjacent frame image to a unified coordinate space, and obtain a converted image corresponding to each to-be-processed image and The auxiliary image corresponding to each adjacent frame image.

S1002,确定各转换后图像的重叠区域。S1002: Determine the overlap area of each converted image.

S1003,基于各转换后图像在重叠区域的像素点,获得空域光流信息。S1003: Obtain spatial optical flow information based on the pixel points of each converted image in the overlapping area.

S1004,基于各转换后图像在重叠区域的像素点以及各辅助图像的像素点,获得时域光流信息。S1004: Obtain time-domain optical flow information based on the pixel points of each converted image in the overlap area and the pixel points of each auxiliary image.

S1005,将空域光流信息和时域光流信息分别进行转换,得到对应的空域能量值和时域能量值。S1005: Convert the spatial optical flow information and the time domain optical flow information to obtain corresponding spatial energy values and time domain energy values.

S1006,基于空域能量值和时域能量值,获得重叠区域对应的能量图。S1006: Obtain an energy map corresponding to the overlapping area based on the energy value in the space domain and the energy value in the time domain.

S1007,根据能量图中的各能量值,确定拼接方向上的最短路径,作为最佳缝合线。S1007: Determine the shortest path in the splicing direction according to each energy value in the energy map as the best suture line.

S1008,基于最佳缝合线,对各转换后图像进行拼接,获得拼接后图像。S1008, based on the best stitching line, stitch each converted image to obtain the stitched image.

上述步骤S1001~S1008的具体限定可以参考前文实施例,此处不再赘述。本实施例中,通过融合空域光流信息和时域光流信息,可以有效区分各待拼接图像的重叠区域的前景物体(包括运动物体)和背景物体,从而可以获得能够绕过前景物体或运动物体的最佳缝合线,避免拼接时出现的拼缝或鬼影问题,提高图像拼接质量。For the specific limitations of the above steps S1001 to S1008, reference may be made to the foregoing embodiment, and details are not described herein again. In this embodiment, by fusing spatial optical flow information and temporal optical flow information, it is possible to effectively distinguish foreground objects (including moving objects) and background objects in the overlapping area of each image to be spliced, so as to obtain the ability to bypass foreground objects or motion The best stitching line of the object, to avoid seam or ghosting problems during stitching, and to improve the quality of image stitching.

需要理解的是,融合空域光流信息和时域光流信息进行图像拼接的方法,还可以应用于视频流拼接。举例来说,对于第一待拼接视频流和第二待拼接视频流,分别从中提取单帧图像(例如第1帧),作为第一待拼接图像和第二待拼接图像,通过上述实施例拼接后可以得到拼接后的第1帧图像,同理,可以获得拼接后的第n帧图像,基于拼接后的各帧图像,可以获得拼接后的视频流。It should be understood that the method of fusing spatial optical flow information and temporal optical flow information for image splicing can also be applied to video stream splicing. For example, for the first video stream to be spliced and the second video stream to be spliced, a single frame image (for example, the first frame) is extracted from the first video stream to be spliced, and used as the first image to be spliced and the second image to be spliced. Then, the spliced first frame image can be obtained, and in the same way, the spliced nth frame image can be obtained, and based on the spliced frame images, the spliced video stream can be obtained.

应该理解的是,虽然图1、10的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1、10中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowcharts of FIGS. 1 and 10 are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least part of the steps in Figures 1 and 10 may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution of these steps or stages The sequence is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.

在一个实施例中,如图11所示,提供了一种图像拼接装置,包括:图像获取模块1110、重叠区域确定模块1120、光流信息确定模块1130和图像拼接模块1140,其中:In one embodiment, as shown in FIG. 11, an image splicing device is provided, including: an image acquisition module 1110, an overlapping area determination module 1120, an optical flow information determination module 1130, and an image splicing module 1140, in which:

图像获取模块1110,用于获取不同视角采集的各待处理图像,将各待处理图像转换到统一坐标空间,获得各待处理图像对应的转换后图像。The image acquisition module 1110 is used to acquire each to-be-processed image collected from different perspectives, convert each to-be-processed image to a unified coordinate space, and obtain a converted image corresponding to each to-be-processed image.

重叠区域确定模块1120,用于确定各转换后图像的重叠区域。The overlapping area determining module 1120 is used to determine the overlapping area of each converted image.

光流信息确定模块1130,用于基于各转换后图像在重叠区域的像素点,获得空域光流信息,空域光流信息用于表征重叠区域中各像素点的偏移程度。The optical flow information determining module 1130 is configured to obtain spatial optical flow information based on the pixels of each converted image in the overlapping area, and the spatial optical flow information is used to represent the degree of deviation of each pixel in the overlapping area.

图像拼接模块1140,用于根据空域光流信息,对各转换后图像进行拼接。The image stitching module 1140 is used to stitch each converted image according to the spatial optical flow information.

在一个实施例中,光流信息确定模块1130在基于各转换后图像在重叠区域的像素点,获得空域光流信息时,具体用于:获取第一转换后图像在重叠区域中的第一像素点的第一位置信息,以及第二转换后图像在重叠区域中与第一像素点匹配的第二像素点的第二位置信息,各转换后图像包括第一转换后图像和第二转换后图像;根据第一位置信息和第二位置信息,获得空域光流信息。In one embodiment, when the optical flow information determining module 1130 obtains spatial optical flow information based on the pixel points of each converted image in the overlap area, it is specifically configured to: obtain the first pixel of the first converted image in the overlap area The first position information of the dot, and the second position information of the second pixel that matches the first pixel in the overlap area of the second converted image, each converted image includes the first converted image and the second converted image ; Obtain spatial optical flow information according to the first position information and the second position information.

在一个实施例中,图像获取模块1110,还用于:获取第一待处理图像的第一相邻帧图像,以及第二待处理图像的第二相邻帧图像,各待处理图像包括第一待处理图像和第二待处理图像;将第一相邻帧图像和第二相邻帧图像转换到统一坐标空间中,获得第一辅助图像和第二辅助图像。In an embodiment, the image acquisition module 1110 is further configured to: acquire a first adjacent frame image of the first image to be processed, and a second adjacent frame image of the second image to be processed, each image to be processed includes the first image The image to be processed and the second image to be processed; the first adjacent frame image and the second adjacent frame image are converted into a unified coordinate space to obtain the first auxiliary image and the second auxiliary image.

在一个实施例中,光流信息确定模块1130,还用于:获取第一转换后图像在重叠区域的第一像素点的第一位置信息,以及第一辅助图像中与第一像素点匹配的第三像素点的第三位置信息;根据第一位置信息和第三位置信息,获得第一时域光流信息;获取第二转换后图像在重叠区域的第四像素点的第四位置信息,以及第二辅助图像中与第四像素点匹配的第五像素点的第五位置信息,各转换后图像包括第一转换后图像和第二转换后图像;根据第四位置信息和第五位置信息,获得第二时域光流信息。In an embodiment, the optical flow information determining module 1130 is further configured to: obtain the first position information of the first pixel in the overlap area of the first converted image, and the first pixel in the first auxiliary image that matches the first pixel. The third position information of the third pixel; the first time-domain optical flow information is obtained according to the first position information and the third position information; the fourth position information of the fourth pixel in the overlap area of the second converted image is obtained, And the fifth position information of the fifth pixel point matching the fourth pixel point in the second auxiliary image, each converted image includes the first converted image and the second converted image; according to the fourth position information and the fifth position information , To obtain the second time domain optical flow information.

在一个实施例中,图像拼接模块1140在根据空域光流信息,对各转换后图像进行拼接时,具体用于:根据空域光流信息,获得重叠区域对应的能量图;根据能量图,对各转换后图像进行拼接。In one embodiment, when the image stitching module 1140 stitches each converted image according to the spatial optical flow information, it is specifically used to: obtain the energy map corresponding to the overlapping area according to the spatial optical flow information; After the conversion, the images are stitched together.

在一个实施例中,图像拼接模块1140在根据空域光流信息,获得重叠区域对应的能量图时,具体用于:将空域光流信息进行转换,得到对应的空域能量值;基于空域能量值,获得重叠区域对应的能量图。In one embodiment, when the image stitching module 1140 obtains the energy map corresponding to the overlapping area according to the spatial optical flow information, it is specifically used to: convert the spatial optical flow information to obtain the corresponding spatial energy value; based on the spatial energy value, Obtain the energy map corresponding to the overlapping area.

在一个实施例中,图像拼接模块1140在根据空域光流信息,获得重叠区域对应的能量图时,具体用于:将空域光流信息、第一时域光流信息和第二时域光流信息分别进行转换,得到对应的空域能量值、第一时域能量值和第二时域能量值;基于空域能量值、第一时域能量值和第二时域能量值,获得重叠区域对应的能量图。In one embodiment, when the image stitching module 1140 obtains the energy map corresponding to the overlapping area according to the spatial optical flow information, it is specifically used to combine the spatial optical flow information, the first time domain optical flow information, and the second time domain optical flow information. The information is converted separately to obtain the corresponding spatial energy value, the first time domain energy value and the second time domain energy value; based on the spatial energy value, the first time domain energy value and the second time domain energy value, the corresponding to the overlapping area is obtained Energy graph.

在一个实施例中,图像拼接模块1140在基于空域能量值、第一时域能量值和第二时域能量值,获得重叠区域对应的能量图时,具体用于:将第一时域能量值与第二时域能量值进行对应相加并取平均值,获得时域能量值;将时域能量值与空域能量值进行对应相加并取平均值,获得最终能量值;基于最终能量值获得重叠区域对应的能量图。In one embodiment, when the image stitching module 1140 obtains the energy map corresponding to the overlapping area based on the spatial energy value, the first time domain energy value, and the second time domain energy value, it is specifically used to: Correspondingly add to the second time-domain energy value and take the average value to obtain the time-domain energy value; add the time-domain energy value and the space-domain energy value correspondingly and take the average value to obtain the final energy value; obtain the final energy value based on the final energy value The energy map corresponding to the overlapping area.

在一个实施例中,图像拼接模块1140还用于:根据能量图中各能量值中大于预设阈值的能量值对应的图像点位置,确定各转换后图像在重叠区域中的前景图像。In one embodiment, the image stitching module 1140 is further configured to: determine the foreground image of each converted image in the overlap area according to the position of the image point corresponding to the energy value greater than the preset threshold in each energy value in the energy map.

在一个实施例中,图像拼接模块1140还用于:根据能量图中各能量值中小于或等于预设阈值的能量值对应的图像点位置,确定各转换后图像在重叠区域中的背景图像。In an embodiment, the image stitching module 1140 is further configured to: determine the background image of each converted image in the overlap area according to the position of the image point corresponding to the energy value less than or equal to the preset threshold in each energy value in the energy map.

在一个实施例中,图像拼接模块1140在根据能量图,对各转换后图像进行拼接时,具体用于:根据能量图中的各能量值,确定拼接方向上的最短路径,作为最佳缝合线;基于最佳缝合线,对各转换后图像进行拼接。In one embodiment, when the image stitching module 1140 stitches the converted images according to the energy map, it is specifically used to: determine the shortest path in the stitching direction according to the energy values in the energy map as the best stitching line ; Based on the best stitching line, stitch the converted images.

在一个实施例中,图像拼接模块1140在基于最佳缝合线,对各转换后图像进行拼接时,具体用于:基于最佳缝合线对各转换后图像进行裁剪,将裁剪后的各图像进行拼接。In one embodiment, when the image stitching module 1140 stitches each converted image based on the best stitching line, it is specifically used to: crop each converted image based on the best stitching line, and perform the cropped image Splicing.

关于图像拼接装置的具体限定可以参见上文中对于图像拼接方法的限定,在此不再赘述。上述图像拼接装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the image splicing device, please refer to the above definition of the image splicing method, which will not be repeated here. Each module in the above-mentioned image splicing device can be implemented in whole or in part by software, hardware, and a combination thereof. The foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图12所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种图像拼接方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 12. The computer equipment includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to realize an image stitching method.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图 可以如图13所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种图像拼接方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 13. The computer equipment includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator's network, NFC (near field communication) or other technologies. The computer program is executed by the processor to realize an image stitching method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, trackball or touchpad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.

本领域技术人员可以理解,图12或图13中示出的结构,仅仅是与本公开方案相关的部分结构的框图,并不构成对本公开方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 12 or FIG. 13 is only a block diagram of a part of the structure related to the solution of the present disclosure, and does not constitute a limitation on the computer device to which the solution of the present disclosure is applied. The computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.

在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述各方法实施例中的步骤。In one embodiment, a computer device is provided, including a memory and a processor, and a computer program is stored in the memory, and the processor implements the steps in the foregoing method embodiments when the computer program is executed.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program is executed by a processor to implement the steps in the foregoing method embodiments.

需要理解的是,上述实施例中的术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。It should be understood that the terms "first", "second", etc. in the foregoing embodiments are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本公开所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage. In the medium, when the computer program is executed, it may include the procedures of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the various embodiments provided in the present disclosure may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, or optical storage. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM may be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as the combinations of these technical features are not contradictory, they should be It is considered as the range described in this specification.

以上所述实施例仅表达了本公开的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本公开构思的前提下,还可以做出若干变形和改进,这些都属于本公开的保护范围。因此,本公开专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present disclosure, and their descriptions are more specific and detailed, but they should not be understood as limiting the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present disclosure, several modifications and improvements can be made, and these all fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the appended claims.

Claims (13)

一种图像拼接方法,所述方法包括:An image stitching method, the method includes: 获取不同视角采集的各待处理图像,将各所述待处理图像转换到统一坐标空间,获得各所述待处理图像对应的转换后图像;Acquiring each to-be-processed image collected from different perspectives, transforming each of the to-be-processed images into a unified coordinate space, and obtaining a converted image corresponding to each of the to-be-processed images; 确定各所述转换后图像的重叠区域;Determining the overlapping area of each of the converted images; 基于各所述转换后图像在所述重叠区域的像素点,获得空域光流信息,所述空域光流信息用于表征所述重叠区域中各像素点的偏移程度;Obtain spatial optical flow information based on the pixels of each of the converted images in the overlapping area, where the spatial optical flow information is used to characterize the degree of deviation of each pixel in the overlapping area; 根据所述空域光流信息,对各所述转换后图像进行拼接。According to the spatial optical flow information, stitching each of the converted images. 根据权利要求1所述的方法,其中,基于各所述转换后图像在所述重叠区域的像素点,获得空域光流信息,包括:The method according to claim 1, wherein the obtaining spatial optical flow information based on the pixel points of each of the converted images in the overlapping area comprises: 获取第一转换后图像在所述重叠区域中的第一像素点的第一位置信息,以及第二转换后图像在所述重叠区域中与所述第一像素点匹配的第二像素点的第二位置信息,各所述转换后图像包括所述第一转换后图像和所述第二转换后图像;Acquire the first position information of the first pixel of the first converted image in the overlap area, and the first position of the second pixel of the second converted image that matches the first pixel in the overlap area 2. Position information, each of the converted images includes the first converted image and the second converted image; 根据所述第一位置信息和所述第二位置信息,获得空域光流信息。Obtain spatial optical flow information according to the first position information and the second position information. 根据权利要求1所述的方法,其中,还包括:The method according to claim 1, further comprising: 获取第一待处理图像的第一相邻帧图像,以及第二待处理图像的第二相邻帧图像,各所述待处理图像包括所述第一待处理图像和所述第二待处理图像;Acquire a first adjacent frame image of a first image to be processed, and a second adjacent frame image of a second image to be processed, each of the images to be processed includes the first image to be processed and the second image to be processed ; 将所述第一相邻帧图像和所述第二相邻帧图像转换到所述统一坐标空间中,获得第一辅助图像和第二辅助图像。The first adjacent frame image and the second adjacent frame image are converted into the unified coordinate space to obtain a first auxiliary image and a second auxiliary image. 根据权利要求1-3任一项所述的方法,其中,还包括:The method according to any one of claims 1-3, further comprising: 获取第一转换后图像在所述重叠区域的第一像素点的第一位置信息,以及所述第一辅助图像中与所述第一像素点匹配的第三像素点的第三位置信息;Acquiring first position information of a first pixel in the overlap area of the first converted image, and third position information of a third pixel in the first auxiliary image that matches the first pixel; 根据所述第一位置信息和所述第三位置信息,获得第一时域光流信息;Obtaining first time-domain optical flow information according to the first position information and the third position information; 获取所述第二转换后图像在所述重叠区域的第四像素点的第四位置信息,以及所述第二辅助图像中与所述第四像素点匹配的第五像素点的第五位置信息,各所述转换后图像包括所述第一转换后图像和所述第二转换后图像;Obtain the fourth position information of the fourth pixel of the second converted image in the overlap area, and the fifth position information of the fifth pixel in the second auxiliary image that matches the fourth pixel , Each of the converted images includes the first converted image and the second converted image; 根据所述第四位置信息和所述第五位置信息,获得第二时域光流信息。Obtain second temporal optical flow information according to the fourth position information and the fifth position information. 根据权利要求4所述的方法,其中,根据所述空域光流信息,对各所述转换后图像进行拼接,包括:The method according to claim 4, wherein, according to the spatial optical flow information, stitching each of the converted images comprises: 根据所述空域光流信息,获得所述重叠区域对应的能量图;Obtaining an energy map corresponding to the overlapping area according to the spatial optical flow information; 根据所述能量图,对各所述转换后图像进行拼接。According to the energy map, stitching each of the converted images. 根据权利要求5所述的方法,其中,根据所述空域光流信息,获得所述重叠区域对应的能量图,包括下述两项中的任意一项:The method according to claim 5, wherein obtaining the energy map corresponding to the overlapping area according to the spatial optical flow information includes any one of the following two items: 第一项:the first item: 将所述空域光流信息进行转换,得到对应的空域能量值;Converting the airspace optical flow information to obtain the corresponding airspace energy value; 基于所述空域能量值,获得所述重叠区域对应的能量图;Obtaining an energy map corresponding to the overlapping area based on the airspace energy value; 第二项:second section: 将所述空域光流信息、所述第一时域光流信息和所述第二时域光流信息分别进行转换,得到对应的空域能量值、第一时域能量值和第二时域能量值;The spatial optical flow information, the first time domain optical flow information, and the second time domain optical flow information are respectively converted to obtain the corresponding spatial energy value, first time domain energy value, and second time domain energy value; 基于所述空域能量值、所述第一时域能量值和所述第二时域能量值,获得所述重叠区域对应的能量图。Based on the spatial energy value, the first time domain energy value, and the second time domain energy value, an energy map corresponding to the overlapping area is obtained. 根据权利要求6所述的方法,其中,基于所述空域能量值、所述第一时域能量值和所述第二时域能量值,获得所述重叠区域对应的能量图,包括:The method according to claim 6, wherein, based on the spatial energy value, the first time domain energy value, and the second time domain energy value, obtaining an energy map corresponding to the overlapping area comprises: 将所述第一时域能量值与所述第二时域能量值进行对应相加并取平均值,获得时域能量值;Correspondingly adding the first time domain energy value and the second time domain energy value and taking an average value to obtain a time domain energy value; 将所述时域能量值与所述空域能量值进行对应相加并取平均值,获得最终能量值;Correspondingly adding the time domain energy value and the space domain energy value and taking an average value to obtain the final energy value; 基于所述最终能量值获得所述重叠区域对应的能量图。An energy map corresponding to the overlapping area is obtained based on the final energy value. 根据权利要求6或7所述的方法,其中,还包括下述两项中的至少一项:The method according to claim 6 or 7, further comprising at least one of the following two items: 根据所述能量图中各能量值中大于预设阈值的能量值对应的图像点位置,确定各所述转换后图像在所述重叠区域中的前景图像;Determine the foreground image of each of the converted images in the overlap area according to the position of the image point corresponding to the energy value greater than the preset threshold in each energy value in the energy map; 根据所述能量图中各能量值中小于或等于所述预设阈值的能量值对应的图像点位置,确定各所述转换后图像在所述重叠区域中的背景图像。Determine the background image of each of the converted images in the overlap area according to the position of the image point corresponding to the energy value that is less than or equal to the preset threshold in each energy value in the energy map. 根据权利要求6或7所述的方法,其中,根据所述能量图,对各所述转换后图像进行拼接,包括:The method according to claim 6 or 7, wherein, according to the energy map, stitching each of the converted images includes: 根据所述能量图中的各能量值,确定拼接方向上的最短路径,作为最佳缝合线;According to the energy values in the energy diagram, determine the shortest path in the splicing direction as the best suture line; 基于所述最佳缝合线,对各所述转换后图像进行拼接。Based on the optimal stitching line, stitching each of the converted images. 根据权利要求9所述的方法,其中,基于所述最佳缝合线,对各所述转换后图像进行拼接,包括:The method according to claim 9, wherein, based on the optimal stitching line, stitching each of the converted images comprises: 基于所述最佳缝合线对各所述转换后图像进行裁剪,将裁剪后的各图像进行拼接。Based on the optimal stitching line, each of the converted images is cropped, and the cropped images are stitched together. 一种图像拼接装置,其中,所述装置包括:An image splicing device, wherein the device includes: 图像获取模块,用于获取不同视角采集的各待处理图像,将各所述待处理图像转换到统一坐标空间,获得各所述待处理图像对应的转换后图像;The image acquisition module is configured to acquire each to-be-processed image collected from different perspectives, convert each of the to-be-processed images to a unified coordinate space, and obtain a converted image corresponding to each of the to-be-processed images; 重叠区域确定模块,用于确定各所述转换后图像的重叠区域;An overlapping area determining module, configured to determine the overlapping area of each of the converted images; 光流信息确定模块,用于基于各所述转换后图像在所述重叠区域的像素点,获得空域光流信息,所述空域光流信息用于表征所述重叠区域中各像素点的偏移程度;The optical flow information determining module is configured to obtain spatial optical flow information based on the pixel points of each of the converted images in the overlapping area, and the spatial optical flow information is used to characterize the offset of each pixel in the overlapping area degree; 图像拼接模块,用于根据所述空域光流信息,对各所述转换后图像进行拼接。The image stitching module is used to stitch each of the converted images according to the spatial optical flow information. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现权利要求1至10中任一项所述方法的步骤。A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 10 when the computer program is executed by the processor. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至10中任一项所述的方法的步骤。A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method according to any one of claims 1 to 10 when the computer program is executed by a processor.
PCT/CN2020/119741 2020-06-24 2020-09-30 Image splicing method and apparatus, computer device, and storage medium Ceased WO2021258579A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010595138.6 2020-06-24
CN202010595138.6A CN111915483B (en) 2020-06-24 2020-06-24 Image stitching method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021258579A1 true WO2021258579A1 (en) 2021-12-30

Family

ID=73227863

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119741 Ceased WO2021258579A1 (en) 2020-06-24 2020-09-30 Image splicing method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN111915483B (en)
WO (1) WO2021258579A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119048343A (en) * 2024-10-30 2024-11-29 上海复瞰科技有限公司 Video image stitching method and system based on feature matching

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112686802B (en) * 2020-12-14 2024-05-31 天津极豪科技有限公司 Image stitching method, device, equipment and storage medium
CN112862685B (en) * 2021-02-09 2024-02-23 北京迈格威科技有限公司 Image stitching processing method, device and electronic system
CN115086686A (en) * 2021-03-11 2022-09-20 北京有竹居网络技术有限公司 Video processing method and related device
CN113139480B (en) * 2021-04-28 2022-03-15 艾拉物联网络(深圳)有限公司 Gesture detection method based on improved VIBE
CN113610701B (en) * 2021-08-04 2023-12-26 同方鼎欣科技股份有限公司 Image paging conversion method, device, computer equipment and readable storage medium
CN113793382B (en) * 2021-08-04 2024-10-18 北京旷视科技有限公司 Video image seam search method, video image splicing method and device
CN113935900A (en) * 2021-09-29 2022-01-14 深圳中科飞测科技股份有限公司 Image splicing method, device and system and storage medium
CN114170289A (en) * 2021-12-09 2022-03-11 惠州Tcl移动通信有限公司 Image processing method, image processing device, computer equipment and computer readable storage medium
CN114519730A (en) * 2022-02-21 2022-05-20 维沃移动通信有限公司 Image processing method, apparatus, device and medium
CN117291954B (en) * 2023-09-21 2024-11-19 小红书科技有限公司 Method for generating optical flow data set, related method and related product
CN118413613A (en) * 2024-05-21 2024-07-30 深圳市鸿合创新信息技术有限责任公司 Video image stitching method, device, terminal equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106157304A (en) * 2016-07-01 2016-11-23 成都通甲优博科技有限责任公司 A kind of Panoramagram montage method based on multiple cameras and system
CN106600654A (en) * 2017-01-24 2017-04-26 浙江四点灵机器人股份有限公司 Large viewing angle depth camera splicing device and splicing method
CN106815802A (en) * 2016-12-23 2017-06-09 深圳超多维科技有限公司 A kind of image split-joint method and device
CN107274337A (en) * 2017-06-20 2017-10-20 长沙全度影像科技有限公司 A kind of image split-joint method based on improvement light stream
US20190068876A1 (en) * 2017-08-29 2019-02-28 Nokia Technologies Oy Method Of Image Alignment For Stitching Using A Hybrid Strategy
CN109948398A (en) * 2017-12-20 2019-06-28 深圳开阳电子股份有限公司 The image processing method and panorama parking apparatus that panorama is parked

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680501B (en) * 2013-12-03 2018-12-07 华为技术有限公司 The method and device of image mosaic
CN105141920B (en) * 2015-09-01 2018-06-19 电子科技大学 A kind of 360 degree of panoramic video splicing systems
CN106803899B (en) * 2015-11-26 2019-10-01 华为技术有限公司 Merge the method and apparatus of image
CN108989751B (en) * 2018-07-17 2020-07-14 上海交通大学 A video stitching method based on optical flow
CN109978755B (en) * 2019-03-11 2023-03-17 广州杰赛科技股份有限公司 Panoramic image synthesis method, device, equipment and storage medium
CN110648281B (en) * 2019-09-23 2021-03-16 华南农业大学 Field panorama image generation method, device, system, server and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106157304A (en) * 2016-07-01 2016-11-23 成都通甲优博科技有限责任公司 A kind of Panoramagram montage method based on multiple cameras and system
CN106815802A (en) * 2016-12-23 2017-06-09 深圳超多维科技有限公司 A kind of image split-joint method and device
CN106600654A (en) * 2017-01-24 2017-04-26 浙江四点灵机器人股份有限公司 Large viewing angle depth camera splicing device and splicing method
CN107274337A (en) * 2017-06-20 2017-10-20 长沙全度影像科技有限公司 A kind of image split-joint method based on improvement light stream
US20190068876A1 (en) * 2017-08-29 2019-02-28 Nokia Technologies Oy Method Of Image Alignment For Stitching Using A Hybrid Strategy
CN109948398A (en) * 2017-12-20 2019-06-28 深圳开阳电子股份有限公司 The image processing method and panorama parking apparatus that panorama is parked

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119048343A (en) * 2024-10-30 2024-11-29 上海复瞰科技有限公司 Video image stitching method and system based on feature matching

Also Published As

Publication number Publication date
CN111915483B (en) 2024-03-19
CN111915483A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
WO2021258579A1 (en) Image splicing method and apparatus, computer device, and storage medium
US10410089B2 (en) Training assistance using synthetic images
US9129435B2 (en) Method for creating 3-D models by stitching multiple partial 3-D models
CN112288628B (en) Aerial image splicing acceleration method and system based on optical flow tracking and frame extraction mapping
WO2021238325A1 (en) Image processing method and apparatus
US11790672B2 (en) Image processing method, microscope, image processing system, and medium based on artificial intelligence
CN107590453A (en) Processing method, device and the equipment of augmented reality scene, computer-readable storage medium
US11620730B2 (en) Method for merging multiple images and post-processing of panorama
WO2019042419A1 (en) Image tracking point acquisition method and device, and storage medium
US10331209B2 (en) Gaze direction mapping
WO2021017589A1 (en) Image fusion method based on gradient domain mapping
CN107710280A (en) Object method for visualizing
WO2017163384A1 (en) Data processing device, data processing method, and data processing program
CN114820547B (en) Lane line detection method, device, computer equipment and storage medium
WO2022141721A1 (en) Multimodal unsupervised pedestrian pixel-level semantic labeling method and system
WO2023066143A1 (en) Image segmentation method and apparatus for panoramic image, and computer device and storage medium
CN108229281A (en) The generation method and method for detecting human face of neural network, device and electronic equipment
CN106101578A (en) Image combining method and equipment
CN112288878A (en) Augmented reality preview method and preview device, electronic device and storage medium
CN116132610A (en) Fully-mechanized mining face video stitching method and system
CN116452641A (en) Document image registration data synthesis method, system, device and medium
WO2018006669A1 (en) Parallax fusion method and apparatus
US11269405B2 (en) Gaze direction mapping
Xie et al. Rcvs: A unified registration and fusion framework for video streams
CN114170084A (en) Image super-resolution processing method, device and equipment

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: 20942002

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15.05.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20942002

Country of ref document: EP

Kind code of ref document: A1