CN113643180B - Image registration method, device, equipment and medium - Google Patents

Image registration method, device, equipment and medium Download PDF

Info

Publication number
CN113643180B
CN113643180B CN202110952011.XA CN202110952011A CN113643180B CN 113643180 B CN113643180 B CN 113643180B CN 202110952011 A CN202110952011 A CN 202110952011A CN 113643180 B CN113643180 B CN 113643180B
Authority
CN
China
Prior art keywords
vector
feature
pixel
image
dimensional vector
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.)
Active
Application number
CN202110952011.XA
Other languages
Chinese (zh)
Other versions
CN113643180A (en
Inventor
秦勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Century TAL Education Technology Co Ltd
Original Assignee
Beijing Century TAL Education 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 Century TAL Education Technology Co Ltd filed Critical Beijing Century TAL Education Technology Co Ltd
Priority to CN202110952011.XA priority Critical patent/CN113643180B/en
Publication of CN113643180A publication Critical patent/CN113643180A/en
Application granted granted Critical
Publication of CN113643180B publication Critical patent/CN113643180B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/14Transformations for image registration, e.g. adjusting or mapping for alignment of images
    • G06T3/147Transformations for image registration, e.g. adjusting or mapping for alignment of images using affine transformations

Landscapes

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

Abstract

The present disclosure relates to an image registration method, apparatus, device, and medium; wherein the method comprises the following steps: acquiring a reference image and an original image to be registered; respectively converting the reference image and the original image according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; extracting a first feature vector from the first one-dimensional vector, and extracting a second feature vector from the second one-dimensional vector; performing feature point matching on the first feature vector and the second feature vector to obtain feature point pairs; and carrying out affine transformation processing on the reference image according to the characteristic point pairs to obtain a target image registered with the original image. The present disclosure can increase the speed and accuracy of image registration.

Description

一种图像配准方法、装置、设备及介质Image registration method, device, equipment and medium

技术领域Technical Field

本公开涉及图像处理技术领域,尤其涉及一种图像配准方法、装置、设备及介质。The present disclosure relates to the field of image processing technology, and in particular to an image registration method, device, equipment and medium.

背景技术Background technique

图像配准是将不同条件(如设备、时间、光照、角度等)下针对同一对象的两张或多张图像进行匹配、叠加的过程。目前,图像配准的通用方法为:先利用图像特征点进行匹配,再通过随机采样等方法计算待配准的两张图像的单应矩阵,以此实现图像配准。然而,面对存在诸如光照不均匀、角度扭曲等问题的特征复杂的图像,上述通用的图像配准方式效果较差,使得图像之间的图像配准准确性较低。Image registration is the process of matching and superimposing two or more images of the same object under different conditions (such as equipment, time, lighting, angle, etc.). At present, the general method of image registration is to first use image feature points for matching, and then calculate the homography matrix of the two images to be registered by random sampling and other methods to achieve image registration. However, in the face of images with complex features such as uneven lighting and angular distortion, the above general image registration method is less effective, resulting in low accuracy of image registration between images.

发明内容Summary of the invention

为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种图像配准方法、装置、设备及介质。In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides an image registration method, device, equipment and medium.

本公开提供了一种图像配准方法,包括:The present disclosure provides an image registration method, comprising:

获取基准图像和待配准的原始图像;根据希尔伯特曲线分别对所述基准图像和所述原始图像进行转换,得到所述基准图像对应的第一一维向量和所述原始图像对应的第二一维向量;其中,所述第一一维向量用于表征所述基准图像中像素点之间的序列关系,所述第二一维向量用于表征所述原始图像中像素点之间的序列关系;从所述第一一维向量中提取第一特征向量,从所述第二一维向量中提取第二特征向量;对所述第一特征向量和所述第二特征向量进行特征点匹配,得到特征点对;根据所述特征点对,对所述基准图像进行仿射变换处理,以得到与所述原始图像配准的目标图像。Acquire a reference image and an original image to be registered; transform the reference image and the original image respectively according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; wherein the first one-dimensional vector is used to characterize the sequence relationship between pixel points in the reference image, and the second one-dimensional vector is used to characterize the sequence relationship between pixel points in the original image; extract a first eigenvector from the first one-dimensional vector, and extract a second eigenvector from the second one-dimensional vector; perform feature point matching on the first eigenvector and the second eigenvector to obtain a feature point pair; perform affine transformation processing on the reference image according to the feature point pair to obtain a target image registered with the original image.

本公开提供了一种图像配准装置,包括:The present disclosure provides an image registration device, comprising:

图像获取模块,用于获取基准图像和待配准的原始图像;图像转换模块,用于根据希尔伯特曲线分别对所述基准图像和所述原始图像进行转换,得到所述基准图像对应的第一一维向量和所述原始图像对应的第二一维向量;其中,所述第一一维向量用于表征所述基准图像中像素点之间的序列关系,所述第二一维向量用于表征所述原始图像中像素点之间的序列关系;特征提取模块,用于从所述第一一维向量中提取第一特征向量,从所述第二一维向量中提取第二特征向量;匹配模块,用于对所述第一特征向量和所述第二特征向量进行特征点匹配,得到特征点对;配准模块,用于根据所述特征点对,对所述基准图像进行仿射变换处理,以得到与所述原始图像配准的目标图像。An image acquisition module is used to acquire a reference image and an original image to be registered; an image conversion module is used to convert the reference image and the original image respectively according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; wherein the first one-dimensional vector is used to characterize the sequence relationship between pixel points in the reference image, and the second one-dimensional vector is used to characterize the sequence relationship between pixel points in the original image; a feature extraction module is used to extract a first feature vector from the first one-dimensional vector and a second feature vector from the second one-dimensional vector; a matching module is used to perform feature point matching on the first feature vector and the second feature vector to obtain a feature point pair; a registration module is used to perform affine transformation processing on the reference image according to the feature point pair to obtain a target image registered with the original image.

本公开提供了一种电子设备,所述电子设备包括:处理器;以及存储程序的存储器,其中,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行根据上述图像配准方法。The present disclosure provides an electronic device, comprising: a processor; and a memory storing a program, wherein the program comprises instructions, and when the instructions are executed by the processor, the processor executes the above-mentioned image registration method.

本公开提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行根据图像配准方法。The present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute an image registration method.

本公开提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现上述图像配准方法。The present disclosure provides a computer program product, including a computer program, which implements the above-mentioned image registration method when executed by a processor.

本公开实施例提供的技术方案与现有技术相比具有如下优点:Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

本公开实施例提供的一种图像配准方法、装置、设备及介质,首先根据希尔伯特曲线分别对获取到的基准图像和原始图像进行转换,得到对应的第一一维向量和第二一维向量;然后从第一一维向量中提取第一特征向量,从第二一维向量中提取第二特征向量;最后对第一特征向量和第二特征向量进行特征点匹配,并根据得到的特征点对,对基准图像进行仿射变换处理,以得到与原始图像配准的目标图像。本公开能够有效增加图像配准的速度和准确性。The disclosed embodiments provide an image registration method, apparatus, device and medium, which first converts the acquired reference image and original image respectively according to the Hilbert curve to obtain the corresponding first one-dimensional vector and second one-dimensional vector; then extracts the first feature vector from the first one-dimensional vector, and extracts the second feature vector from the second one-dimensional vector; finally, performs feature point matching on the first feature vector and the second feature vector, and performs affine transformation processing on the reference image according to the obtained feature point pairs to obtain a target image registered with the original image. The disclosed embodiments can effectively increase the speed and accuracy of image registration.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

图1为本公开实施例提供的图像配准方法流程图;FIG1 is a flow chart of an image registration method provided by an embodiment of the present disclosure;

图2为本公开实施例提供的原始图像和基准图像的示意图;FIG2 is a schematic diagram of an original image and a reference image provided by an embodiment of the present disclosure;

图3为本公开实施例提供的图像配准装置的结构示意图;FIG3 is a schematic diagram of the structure of an image registration device provided by an embodiment of the present disclosure;

图4为本公开实施例提供的电子设备的结构示意图。FIG. 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.

具体实施方式Detailed ways

为了能够更清楚地理解本公开的上述目的、特征和优点,下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. In addition, the method embodiments may include additional steps and/or omit the steps shown. The scope of the present disclosure is not limited in this respect.

本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

采用现有的图像配准方法处理特征复杂的图像时,图像配准的准确性较低,效果较差。例如,在一种常见的应用场景中,面对带有语义信息的题型(如选择、填空、判断题),用户普遍采用拍照判题与图题库结合的方式对这些题型进行批改。由于书写习惯和拍照场景等多种原因,导致用户拍摄的文本图像可能出现背透(也即同一页纸两边都写字导致一边影响了另一边)、光照不均匀、影印和拍摄角度不正等大量问题(可参照图2所示的原始图像);从而,在这种方式中,如何更加准确地将用户拍摄的文本图像和题库中图像的作答区域对应起来,,将对拍照判题的准确率有非常大的影响。其中,实现区域对应的比较有效的方式就是使用图像配准,可见,拍照判题的准确率严重依赖图像配准的效果,然而目前的图像配准方法在变化比较复杂的文本图像上配准效果不佳,进而制约了拍照判题的准确率。When using existing image registration methods to process images with complex features, the accuracy of image registration is low and the effect is poor. For example, in a common application scenario, when faced with questions with semantic information (such as multiple choice, fill-in-the-blank, and true or false questions), users generally use a combination of photo-taking and image question banks to correct these questions. Due to various reasons such as writing habits and photo-taking scenes, the text images taken by users may have a lot of problems such as back-transparency (that is, writing on both sides of the same page causes one side to affect the other side), uneven lighting, photocopying, and incorrect shooting angles (refer to the original image shown in Figure 2); therefore, in this way, how to more accurately match the text image taken by the user with the answer area of the image in the question bank will have a great impact on the accuracy of photo-taking. Among them, a more effective way to achieve area correspondence is to use image registration. It can be seen that the accuracy of photo-taking is heavily dependent on the effect of image registration. However, the current image registration method has poor registration effect on text images with more complex changes, which in turn restricts the accuracy of photo-taking.

基于以上考虑,本公开实施例提供了一种图像配准方法、装置、设备及介质,该技术可以广泛应用于目标检测、模型重建、运动估计、特征匹配,肿瘤检测、病变定位、血管造影、地质勘探、航空侦察等领域。为便于理解,以下对本公开实施例进行详细介绍。Based on the above considerations, the embodiments of the present disclosure provide an image registration method, device, equipment and medium, which can be widely used in target detection, model reconstruction, motion estimation, feature matching, tumor detection, lesion localization, angiography, geological exploration, aerial reconnaissance and other fields. For ease of understanding, the embodiments of the present disclosure are described in detail below.

参照图1提供的一种图像配准方法流程图,该方法可以包括如下步骤:Referring to the flowchart of an image registration method provided in FIG1 , the method may include the following steps:

步骤S102,获取基准图像和待配准的原始图像。Step S102: Acquire a reference image and an original image to be registered.

本实施例中的基准图像和原始图像可以为各种需要图像配准场景下的图像,例如图像增强、图像的形状分析、图像拼接场景下的图像。基准图像和原始图像为包含同一内容的二维图像,其中,原始图像是需要以基准图像作为配准目标进行配准的图像。在实际应用中,原始图像可以是用户通过在终端中的图像选择操作、图像拍摄操作或图像上传操作等方式获取的图像,如图2所示,具体例如为拍摄目标试题得到的文本图像,相应的,基准图像具体例如为预设试题库中包括目标试题的图像。The reference image and the original image in this embodiment can be images in various scenarios requiring image registration, such as image enhancement, image shape analysis, and images in image stitching scenarios. The reference image and the original image are two-dimensional images containing the same content, wherein the original image is an image that needs to be registered with the reference image as the registration target. In practical applications, the original image can be an image obtained by a user through an image selection operation, an image shooting operation, or an image upload operation in a terminal, as shown in FIG2 , specifically, for example, a text image obtained by shooting a target test question, and correspondingly, the reference image specifically, for example, is an image including the target test question in a preset test question library.

在一些实现方式中,基准图像和原始图像可以均为预先经过灰度处理后的灰度图像,也即基准图像和原始图像分别为灰度图像。In some implementations, the reference image and the original image may both be grayscale images that have been pre-processed in grayscale, that is, the reference image and the original image are both grayscale images.

步骤S104,根据希尔伯特曲线分别对基准图像和原始图像进行转换,得到基准图像对应的第一一维向量和原始图像对应的第二一维向量;其中,第一一维向量用于表征基准图像中像素点之间的序列关系,第二一维向量用于表征原始图像中像素点之间的序列关系。Step S104, converting the reference image and the original image respectively according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; wherein the first one-dimensional vector is used to represent the sequence relationship between pixel points in the reference image, and the second one-dimensional vector is used to represent the sequence relationship between pixel points in the original image.

希尔伯特曲线(Hilbert)是一种空间填充曲线;空间填充曲线是指,通过一维曲线去包含整个二维甚至多维空间的一种函数曲线。希尔伯特曲线的离散近似表示方法非常实用,其将多维空间转换为一维空间时能够很好地保留空间邻近性,可以采用高阶希尔伯特曲线填满二维平面,而后将曲线展开,在二维平面上相邻的像素点在一维的希尔伯特曲线上依然处于相邻的位置上。The Hilbert curve is a space-filling curve; a space-filling curve is a function curve that uses a one-dimensional curve to contain the entire two-dimensional or even multi-dimensional space. The discrete approximate representation method of the Hilbert curve is very practical. It can well preserve spatial proximity when converting multi-dimensional space into one-dimensional space. A high-order Hilbert curve can be used to fill the two-dimensional plane, and then the curve can be expanded. Adjacent pixels on the two-dimensional plane are still in adjacent positions on the one-dimensional Hilbert curve.

在本实施例中,根据希尔伯特曲线对基准图像和原始图像进行转换的方式是相同的,在此仅以原始图像为例对该转换方式进行描述。希尔伯特曲线可以在任意形状的文本识别场景中,用于表示规则文本或不规则文本;本实施例可以根据原始图像的文本密集程度或者像素点大小,选择合适阶数的希尔伯特曲线,将原始图像中所有的像素点按照希尔伯特曲线的扫描顺序排列成一个一维向量,得到原始图像对应的第二一维向量。可以理解,第二一维向量中具有序列关系的元素即为原始图像中的像素点,原始图像中的像素点与第二一维向量中的元素一一对应,元素的数值即为对应像素点的像素值;其中,像素值可以采用灰度值表示。In this embodiment, the method of converting the reference image and the original image according to the Hilbert curve is the same, and the conversion method is described here only by taking the original image as an example. The Hilbert curve can be used to represent regular text or irregular text in text recognition scenarios of any shape; this embodiment can select a Hilbert curve of a suitable order according to the text density or pixel size of the original image, and arrange all the pixels in the original image into a one-dimensional vector according to the scanning order of the Hilbert curve to obtain a second one-dimensional vector corresponding to the original image. It can be understood that the elements with a sequence relationship in the second one-dimensional vector are the pixels in the original image, and the pixels in the original image correspond one-to-one to the elements in the second one-dimensional vector, and the value of the element is the pixel value of the corresponding pixel; wherein the pixel value can be represented by a gray value.

本实施例通过将二维的基准图像和原始图像,转换为对应的一维向量,使图像中二维空间下的相邻像素点在一维向量中成为按照序列排布在一维空间下的相邻像素点,将二维图像的配准问题,即求取空间变换矩阵问题,转化为一维空间中向量相似度度匹配问题,使得图像配准问题变成一个匹配问题,由此可以避免基于简单的描述子筛选配对得到单应矩阵。此外需要说明是,图像通常分为包括对象内容的关键区域和不包括对象内容的背景区域,在一维向量中,背景区域的相邻像素点和关键区域的相邻像素点是分开排布的,因此在一维向量中可以忽略光照不均匀、角度畸形和背透等因素造成的背景噪声影响。This embodiment converts a two-dimensional reference image and an original image into corresponding one-dimensional vectors, so that adjacent pixels in the two-dimensional space of the image become adjacent pixels arranged in sequence in the one-dimensional space in the one-dimensional vector, and converts the two-dimensional image registration problem, that is, the problem of obtaining the spatial transformation matrix, into a vector similarity matching problem in the one-dimensional space, so that the image registration problem becomes a matching problem, thereby avoiding obtaining the homography matrix based on simple descriptor screening and pairing. In addition, it should be noted that the image is usually divided into a key area including the object content and a background area not including the object content. In the one-dimensional vector, the adjacent pixels in the background area and the adjacent pixels in the key area are arranged separately. Therefore, the background noise caused by factors such as uneven lighting, angle deformity and back penetration can be ignored in the one-dimensional vector.

步骤S106,从第一一维向量中提取第一特征向量,从第二一维向量中提取第二特征向量。Step S106: extracting a first eigenvector from the first one-dimensional vector, and extracting a second eigenvector from the second one-dimensional vector.

在一些实现方式中,从第一一维向量中提取第一特征向量的方式可以参照如下所示:基于预设大小的窗口对第一一维向量进行滑窗,并根据第一一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第四像素点,根据第四像素点在第一一维向量中的序列关系得到第一特征向量;第一特征向量用于表征第四像素点之间的序列关系。与之类似,从第二一维向量中提取第二特征向量的方式包括:基于预设大小的窗口对第二一维向量进行滑窗,并根据第二一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第三像素点;基于所述第三像素点确定第二特征向量。In some implementations, the method of extracting the first feature vector from the first one-dimensional vector may refer to the following: sliding the window of the first one-dimensional vector based on a window of a preset size, and extracting the fourth pixel point whose pixel value changes dramatically in each window according to the pixel value of the pixel point in the first one-dimensional vector, and obtaining the first feature vector according to the sequence relationship of the fourth pixel point in the first one-dimensional vector; the first feature vector is used to characterize the sequence relationship between the fourth pixel points. Similarly, the method of extracting the second feature vector from the second one-dimensional vector includes: sliding the window of the second one-dimensional vector based on a window of a preset size, and extracting the third pixel point whose pixel value changes dramatically in each window according to the pixel value of the pixel point in the second one-dimensional vector; and determining the second feature vector based on the third pixel point.

步骤S108,对第一特征向量和第二特征向量进行特征点匹配,得到特征点对。Step S108: performing feature point matching on the first feature vector and the second feature vector to obtain a feature point pair.

本实施例可以按照特征点检测算法匹配第一特征向量和第二特征向量之间的特征点,得到两个特征向量上表示同一像素点的特征点,由此构成一个特征点对,或者说,特征点对可以表示原始图像上的一个像素点和基准图像上的一个像素点。其中,特征点检测算法诸如为SIFT(Scale-invariant feature transform,尺度不变特征变换)特征检测算法、SURF(Speeded Up Robust Features,加速稳健特征)算法、orb(Oriented FAST andRotated BRIEF)算法等。In this embodiment, the feature points between the first feature vector and the second feature vector can be matched according to the feature point detection algorithm to obtain the feature points representing the same pixel point on the two feature vectors, thereby forming a feature point pair, or in other words, the feature point pair can represent a pixel point on the original image and a pixel point on the reference image. Among them, the feature point detection algorithm is such as SIFT (Scale-invariant feature transform) feature detection algorithm, SURF (Speeded Up Robust Features) algorithm, orb (Oriented FAST and Rotated BRIEF) algorithm, etc.

步骤S110,根据特征点对,对基准图像进行仿射变换处理,以得到与原始图像配准的目标图像。Step S110 , performing affine transformation processing on the reference image according to the feature point pairs to obtain a target image registered with the original image.

在得到特征点对之后,可以基于第一特征向量和第二特征向量中匹配的特征点对,对基准图像中的全部像素点进行仿射变换处理,得到与预设图像对齐的目标图像。例如,基于特征点对,计算基准图像相对于原始图像的单应性矩阵,基于单应性矩阵对基准图像进行仿射变换处理,得到与原始图像配准的目标图像。After obtaining the feature point pairs, all pixels in the reference image may be affine transformed based on the matching feature point pairs in the first feature vector and the second feature vector to obtain a target image aligned with the preset image. For example, based on the feature point pairs, the homography matrix of the reference image relative to the original image is calculated, and the reference image is affine transformed based on the homography matrix to obtain a target image aligned with the original image.

其中,单应性矩阵用来描述物体在世界坐标系和像素坐标系之间的位置映射关系;在本实施例中,单应性矩阵是用来表示物体对象在基准图像和原始图像之间的位置映射关系,通过将基准图像和原始图像进行图像配准,得到两幅图像匹配的特征点对,然后基于特征点对在图像上的位置,计算得到单应性矩阵。Among them, the homography matrix is used to describe the position mapping relationship of the object between the world coordinate system and the pixel coordinate system; in this embodiment, the homography matrix is used to represent the position mapping relationship of the object between the reference image and the original image, and the reference image and the original image are aligning to obtain the matching feature point pairs of the two images, and then the homography matrix is calculated based on the position of the feature point pairs on the image.

本公开实施例提供的图像配准方法,首先根据希尔伯特曲线分别对获取到的基准图像和原始图像进行转换,得到对应的第一一维向量和第二一维向量;然后从第一一维向量中提取第一特征向量,从第二一维向量中提取第二特征向量;最后对第一特征向量和第二特征向量进行特征点匹配,并根据得到的特征点对,对基准图像进行仿射变换处理,以得到与原始图像配准的目标图像。上述技术方案中,利用希尔伯特曲线得到的一维向量保证了二维图像上的相邻像素点在一维空间也是相邻的,也就保证了特征点的求取能够表示局部信息;同时,从一维向量中提取到的特征向量中,每个特征点更具有代表性且数量较少,相比于二维图像,特征向量去除了噪声和冗余,只保留少数关键信息,有效增加了图像配准的速度和准确性。The image registration method provided by the embodiment of the present disclosure first converts the acquired reference image and original image respectively according to the Hilbert curve to obtain the corresponding first one-dimensional vector and second one-dimensional vector; then extracts the first eigenvector from the first one-dimensional vector, and extracts the second eigenvector from the second one-dimensional vector; finally, the first eigenvector and the second eigenvector are matched with feature points, and the reference image is affine transformed according to the obtained feature point pairs to obtain the target image registered with the original image. In the above technical scheme, the one-dimensional vector obtained by using the Hilbert curve ensures that the adjacent pixel points on the two-dimensional image are also adjacent in the one-dimensional space, which ensures that the feature points can represent local information; at the same time, in the feature vector extracted from the one-dimensional vector, each feature point is more representative and less in number. Compared with the two-dimensional image, the feature vector removes noise and redundancy, and only retains a small amount of key information, which effectively increases the speed and accuracy of image registration.

为便于理解,以下对本公开实施例提供的图像配准方法展开详细描述。For ease of understanding, the image registration method provided by the embodiment of the present disclosure is described in detail below.

针对上述步骤S106,本实施例以第一一维向量为例,提供一种从第一一维向量中提取第一特征向量的方法,包括如下步骤:With respect to the above step S106, this embodiment takes the first one-dimensional vector as an example to provide a method for extracting a first feature vector from the first one-dimensional vector, including the following steps:

步骤1,将第一一维向量输入至预设的编码器,通过编码器对第一一维向量进行压缩,得到与第一一维向量相对应的低维度的第一压缩向量。Step 1: input a first one-dimensional vector into a preset encoder, and compress the first one-dimensional vector through the encoder to obtain a low-dimensional first compressed vector corresponding to the first one-dimensional vector.

其中,编码器是对预设的VAE(Variational Autoencoder,变分自编码器)模型进行训练后得到的,其中,VAE模型的卷积核和反卷积核均为一维的。The encoder is obtained after training a preset VAE (Variational Autoencoder) model, in which the convolution kernel and deconvolution kernel of the VAE model are both one-dimensional.

第一一维向量通常维度较高,将会导致非常大的计算量,基于此,本实施例可以采用编码器对高维度的第一一维向量进行编码压缩,输出较低维度的第一压缩向量,减小向量长度。在具体实现时,第一压缩向量相对于第一一维向量的压缩比例可根据实际情况设置,比如设置编码器的压缩比例为1/4,则经由编码器输出的第一压缩向量的向量长度为第一一维向量的1/4。本实施例使用编码器进行向量压缩,能够减少向量的计算量,从而加快计算速度以及减少计算偏差,实现更加快速和准确的图像配准。The first one-dimensional vector is usually of high dimension, which will result in a very large amount of calculation. Based on this, the present embodiment can use an encoder to encode and compress the high-dimensional first one-dimensional vector, output a first compressed vector of lower dimension, and reduce the vector length. In a specific implementation, the compression ratio of the first compressed vector relative to the first one-dimensional vector can be set according to actual conditions. For example, if the compression ratio of the encoder is set to 1/4, the vector length of the first compressed vector output by the encoder is 1/4 of the first one-dimensional vector. The present embodiment uses an encoder to perform vector compression, which can reduce the amount of vector calculation, thereby speeding up the calculation speed and reducing the calculation deviation, and achieving faster and more accurate image registration.

步骤2,根据所述第一压缩向量中像素点的像素值,从所述第一压缩向量中提取像素值变化剧烈的像素点,并将提取的像素点确定为目标特征点。Step 2: extracting pixels whose pixel values change dramatically from the first compression vector according to the pixel values of the pixels in the first compression vector, and determining the extracted pixels as target feature points.

在一种具体实施例中,可以通过如下步骤2.1至2.4实现:In a specific embodiment, it can be achieved through the following steps 2.1 to 2.4:

步骤2.1,对第一压缩向量进行差分运算,得到差分向量;差分向量用于表示像素点之间像素值的变化。具体的,对第一压缩向量进行差分运算为求取第一压缩向量的梯度向量,得到差分向量。Step 2.1, performing a differential operation on the first compressed vector to obtain a differential vector; the differential vector is used to represent the change in pixel values between pixel points. Specifically, performing a differential operation on the first compressed vector is to obtain a gradient vector of the first compressed vector to obtain a differential vector.

步骤2.2,以预设的第一窗口在第一压缩向量上进行滑窗,并根据差分向量,提取各第一窗口内像素值变化最大的第一像素点。Step 2.2, sliding a preset first window on the first compression vector, and extracting the first pixel point with the largest pixel value change in each first window according to the differential vector.

在一种具体实施例中,第一窗口例如为包括32个元素的窗口;在此情况下,使用长度大小为32的第一窗口,在第一压缩向量上无重叠滑动,根据差分向量所表示的像素值的变化,找到每个第一窗口内像素值变化最大的第一像素。In a specific embodiment, the first window is, for example, a window including 32 elements; in this case, a first window with a length of 32 is used to slide without overlapping on the first compression vector, and the first pixel with the largest change in pixel value in each first window is found based on the change in pixel value represented by the differential vector.

步骤2.3,以预设的第二窗口在局部向量上进行滑窗,并根据差分向量,提取各第二窗口内与第一像素点的像素值之差最大的第二像素点;其中,局部向量是第一压缩向量中,以第一像素点为中心的预设大小的向量。Step 2.3, sliding a preset second window on the local vector, and extracting the second pixel point with the largest difference in pixel value with the first pixel point in each second window according to the differential vector; wherein the local vector is a vector of a preset size centered on the first pixel point in the first compressed vector.

在第一压缩向量中以第一像素点所在位置为中心确定预设大小的局部向量,比如:以第一像素点所在位置为中心向左32个元素,向右32个元素,由此确定预设长度大小为64的局部向量。第二窗口例如为包括4个元素的窗口;基于此,使用长度大小为4的第二窗口,在局部向量上滑窗,并根据差分向量所表示的像素值的变化,找到每个第二窗口内与第一像素点的像素值之差最大的第二像素点。基于此,可以在局部向量上找到第一像素点对应的16个第二像素点。In the first compressed vector, a local vector of a preset size is determined with the position of the first pixel as the center, for example, 32 elements to the left and 32 elements to the right with the position of the first pixel as the center, thereby determining a local vector with a preset length of 64. The second window is, for example, a window including 4 elements; based on this, a second window with a length of 4 is used to slide the window on the local vector, and according to the change of the pixel value represented by the differential vector, the second pixel point with the largest difference in pixel value with the first pixel point in each second window is found. Based on this, 16 second pixel points corresponding to the first pixel point can be found on the local vector.

步骤2.4,将提取的所述第一像素点和所述第二像素点作为像素值变化剧烈的像素点。Step 2.4: taking the extracted first pixel point and the second pixel point as pixel points with drastic pixel value changes.

容易理解的是,在第一压缩向量上得到的第一像素点和第二像素点均为多个,本实施例将全部的第一像素点和第二像素点均确定为目标特征点。It is easy to understand that there are multiple first pixel points and second pixel points obtained on the first compression vector, and in this embodiment, all the first pixel points and second pixel points are determined as target feature points.

步骤3,基于所述目标特征点确定第一特征向量。具体的,可以将目标特征点作为第一特征向量的元素,根据目标特征点在第一压缩向量中的序列关系,得到第一特征向量;利用第一特征向量表征目标特征点之间的序列关系。Step 3: Determine a first feature vector based on the target feature point. Specifically, the target feature point can be used as an element of the first feature vector, and the first feature vector is obtained according to the sequence relationship of the target feature point in the first compression vector; the first feature vector is used to characterize the sequence relationship between the target feature points.

需要说明的是,从第二一维向量中提取第二特征向量的方法,与上述实施例所描述的从第一一维向量中提取第一特征向量的方法相同,在此不再展开描述。It should be noted that the method of extracting the second eigenvector from the second one-dimensional vector is the same as the method of extracting the first eigenvector from the first one-dimensional vector described in the above embodiment, and will not be described in detail here.

根据上述实施例从第一一维向量中提到取第一特征向量,以及从第二一维向量中提取到第二特征向量后,根据如下实施例对第一特征向量和第二特征向量进行特征点匹配,包括:After extracting the first feature vector from the first one-dimensional vector according to the above embodiment and extracting the second feature vector from the second one-dimensional vector, feature point matching is performed on the first feature vector and the second feature vector according to the following embodiment, including:

首先根据预设的匹配度算法确定第一特征向量和第二特征向量之间特征点的匹配度,将匹配度高于预设匹配度阈值的特征点确定为候选特征点对;而后再根据RANSAC(Random Sample Consensus,随机采样)算法对候选特征点对进行优化,得到最终的特征点对。First, the matching degree of the feature points between the first eigenvector and the second eigenvector is determined according to the preset matching degree algorithm, and the feature points with matching degrees higher than the preset matching degree threshold are determined as candidate feature point pairs; then, the candidate feature point pairs are optimized according to the RANSAC (Random Sample Consensus) algorithm to obtain the final feature point pairs.

在根据特征点对对基准图像进行仿射变换处理之前,本实施例还可以预先记录同一像素点在基准图像上的位置与在第一一维向量上的位置之间的第一对应关系;以及,记录同一像素点在原始图像上的位置与在第二一维向量上的位置之间的第二对应关系。Before performing affine transformation processing on the reference image according to the feature points, the present embodiment may also pre-record a first correspondence between the position of the same pixel point on the reference image and the position on the first one-dimensional vector; and record a second correspondence between the position of the same pixel point on the original image and the position on the second one-dimensional vector.

在具体实施例中,在根据希尔伯特曲线分别对基准图像和原始图像进行转换的过程中,可以将二维图像上的像素点与转换后一维向量上的元素一一对应转化为字典,通过第一字典记录基准图像上的像素点与第一一维向量上的元素之间的第一对应关系,以及通过第二字典记录原始图像上的像素点与第二一维向量上的元素之间的第二对应关系。In a specific embodiment, in the process of converting the reference image and the original image respectively according to the Hilbert curve, the pixel points on the two-dimensional image and the elements on the converted one-dimensional vector can be converted into a dictionary in a one-to-one correspondence, and the first correspondence between the pixel points on the reference image and the elements on the first one-dimensional vector is recorded through the first dictionary, and the second correspondence between the pixel points on the original image and the elements on the second one-dimensional vector is recorded through the second dictionary.

在实际应用中,根据第一对应关系,能够确定第一特征向量上的特征点在基准图像上映射的位置坐标;以及,根据第二对应关系,能够确定第二特征向量上的特征点在原始图像上映射的位置坐标。In practical applications, the first correspondence relationship can be used to determine the position coordinates of the feature points on the first feature vector mapped on the reference image; and the second correspondence relationship can be used to determine the position coordinates of the feature points on the second feature vector mapped on the original image.

根据上述实施例,对根据特征点对对基准图像进行仿射变换处理的具体实现方式展开描述,包括:According to the above embodiment, a specific implementation method of performing affine transformation processing on a reference image according to feature points is described, including:

根据第一对应关系和第二对应关系,计算特征点对中各个特征点在对应图像上映射的位置坐标。其中,特征点对中的特征点包括:属于第一特征向量的第一特征点和属于第二特征向量的第二特征点。在位置坐标的具体计算过程中,可以根据第一对应关系,以及第一压缩向量与第一一维向量之间的压缩比例,确定特征点对中的第一特征点在基准图像上映射的位置坐标。当然,可以采用同样的方式,确定特征点对中的第二特征点在原始图像上映射的位置坐标。According to the first corresponding relationship and the second corresponding relationship, the position coordinates of each feature point in the feature point pair mapped on the corresponding image are calculated. Among them, the feature points in the feature point pair include: a first feature point belonging to the first feature vector and a second feature point belonging to the second feature vector. In the specific calculation process of the position coordinates, the position coordinates of the first feature point in the feature point pair mapped on the reference image can be determined according to the first corresponding relationship and the compression ratio between the first compression vector and the first one-dimensional vector. Of course, the same method can be used to determine the position coordinates of the second feature point in the feature point pair mapped on the original image.

基于特征点对中各个特征点的位置坐标,计算基准图像相对于原始图像的单应性矩阵;基于单应性矩阵对基准图像进行仿射变换处理,得到与原始图像配准的目标图像。Based on the position coordinates of each feature point in the feature point pair, the homography matrix of the reference image relative to the original image is calculated; based on the homography matrix, the reference image is affine transformed to obtain a target image that is aligned with the original image.

例如,从特征点对中选择任意二组或二组以上的候选特征点对;基于候选特征点对计算基准图像相对于原始图像的候选单应性矩阵,并基于候选单应性矩阵对基准图像中的特征点作仿射变换处理;根据原始图像中的特征点,判断仿射变换处理得到的特征点的准确度是否大于预设阈值;若否,则返回执行从特征点对中选择任意二组或二组以上的候选特征点对;若是,则将候选单应性矩阵作为最终的单应性矩阵;而后,基于最终的单应性矩阵对基准图像进行仿射变换处理,得到与原始图像配准的目标图像。For example, any two or more candidate feature point pairs are selected from the feature point pairs; a candidate homography matrix of the reference image relative to the original image is calculated based on the candidate feature point pairs, and the feature points in the reference image are affine transformed based on the candidate homography matrix; based on the feature points in the original image, it is determined whether the accuracy of the feature points obtained by the affine transformation is greater than a preset threshold; if not, the process returns to select any two or more candidate feature point pairs from the feature point pairs; if so, the candidate homography matrix is used as the final homography matrix; then, the reference image is affine transformed based on the final homography matrix to obtain a target image aligned with the original image.

为了使上述实施例中的编码器能够直接用于向量压缩,需要预先对包含该编码器的VAE模型进行训练;对VAE模型进行训练的目的,是最终确定可满足要求的参数。利用已训练得到的参数,编码器能够实现预期的向量压缩。本实施例给出了一种VAE模型的训练方法,参照如下所示:In order to enable the encoder in the above embodiment to be directly used for vector compression, the VAE model containing the encoder needs to be trained in advance; the purpose of training the VAE model is to finally determine the parameters that can meet the requirements. Using the trained parameters, the encoder can achieve the expected vector compression. This embodiment provides a training method for the VAE model, as shown below:

(1)获取样本图像;其中,样本图像为多张,对于每张样本图像,均根据希尔伯特曲线将样本图像转换为第一样本向量。(1) Obtain a sample image; wherein there are multiple sample images, and for each sample image, the sample image is converted into a first sample vector according to the Hilbert curve.

(2)将第一样本向量输入至待训练的VAE模型的编码器,以输出第一样本压缩向量。(2) Input the first sample vector into the encoder of the VAE model to be trained to output the first sample compressed vector.

(3)将上述第一样本压缩向量输入至待训练的VAE模型的解码器,通过解码器对第一样本压缩向量进行解码,以生成样本图像对应的还原图像。(3) Inputting the first sample compression vector into the decoder of the VAE model to be trained, and decoding the first sample compression vector through the decoder to generate a restored image corresponding to the sample image.

(4)根据L1损失函数计算样本图像与还原图像之间的损失函数值,根据损失函数值对待训练的VAE模型进行参数调整,直至损失函数值收敛至预设值时结束训练,得到训练好的VAE模型。(4) The loss function value between the sample image and the restored image is calculated based on the L1 loss function, and the parameters of the VAE model to be trained are adjusted according to the loss function value. The training is terminated when the loss function value converges to the preset value, and a trained VAE model is obtained.

(5)保留训练好的VAE模型中的编码器。(5) Keep the encoder in the trained VAE model.

通过以上步骤,得到可直接用于向量压缩的编码器。Through the above steps, an encoder that can be directly used for vector compression is obtained.

综上,本公开实施例提供的图像配准方法,利用希尔伯特曲线得到的一维向量保证了二维图像上的相邻像素点在一维空间也是相邻的,也就保证了特征点的求取能够表示局部信息;同时,从一维向量中提取到的特征向量中,每个特征点更具有代表性且数量较少,同时,向量压缩之后,减少了向量长度的同时还保留了关键信息,因而相比于二维图像,特征向量去除了噪声和冗余,只保留少数关键信息,在图像配准上效果更佳,有效增加了图像配准的速度和准确性。In summary, the image registration method provided by the embodiment of the present disclosure uses the one-dimensional vector obtained by the Hilbert curve to ensure that adjacent pixel points on the two-dimensional image are also adjacent in the one-dimensional space, which also ensures that the feature points can represent local information; at the same time, in the feature vector extracted from the one-dimensional vector, each feature point is more representative and fewer in number. At the same time, after the vector is compressed, the vector length is reduced while retaining key information. Therefore, compared with the two-dimensional image, the feature vector removes noise and redundancy and only retains a small amount of key information, which has a better effect on image registration and effectively increases the speed and accuracy of image registration.

在通过上述方式增加图像配准效果的基础上,进一步的,还能够在实际应用中取得有益效果,比如面对变化复杂的文本图像,能够明显提高拍照判题的准确性。On the basis of improving the image registration effect through the above-mentioned method, further, beneficial effects can be achieved in practical applications. For example, in the face of complex text images, the accuracy of photo identification can be significantly improved.

基于上述实施例所提供的图像配准方法,本实施例提供一种图像配准装置。参见图3所示的一种图像配准装置的结构示意图,该装置包括:Based on the image registration method provided in the above embodiment, this embodiment provides an image registration device. Referring to the structural schematic diagram of an image registration device shown in FIG3 , the device includes:

图像获取模块302,用于获取基准图像和待配准的原始图像;An image acquisition module 302 is used to acquire a reference image and an original image to be registered;

图像转换模块304,用于根据希尔伯特曲线分别对基准图像和原始图像进行转换,得到基准图像对应的第一一维向量和原始图像对应的第二一维向量;其中,所述第一一维向量用于表征所述基准图像中像素点之间的序列关系,所述第二一维向量用于表征所述原始图像中像素点之间的序列关系;An image conversion module 304 is used to convert the reference image and the original image according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; wherein the first one-dimensional vector is used to represent the sequence relationship between the pixel points in the reference image, and the second one-dimensional vector is used to represent the sequence relationship between the pixel points in the original image;

特征提取模块306,用于从第一一维向量中提取第一特征向量,从第二一维向量中提取第二特征向量;A feature extraction module 306, configured to extract a first feature vector from the first one-dimensional vector and a second feature vector from the second one-dimensional vector;

匹配模块308,用于对第一特征向量和第二特征向量进行特征点匹配,得到特征点对;A matching module 308, configured to perform feature point matching on the first feature vector and the second feature vector to obtain a feature point pair;

配准模块310,用于根据特征点对,对基准图像进行仿射变换处理,以得到与原始图像配准的目标图像。The registration module 310 is used to perform affine transformation processing on the reference image according to the feature point pairs to obtain a target image registered with the original image.

在一种实施例中,特征提取模块306包括:In one embodiment, the feature extraction module 306 includes:

向量压缩单元,用于将所述第一一维向量输入至预设的编码器,通过所述编码器对所述第一一维向量进行压缩,得到与所述第一一维向量相对应的低维度的第一压缩向量;a vector compression unit, configured to input the first one-dimensional vector into a preset encoder, and compress the first one-dimensional vector through the encoder to obtain a low-dimensional first compressed vector corresponding to the first one-dimensional vector;

第一特征点提取单元,用于根据所述第一压缩向量中像素点的像素值,从所述第一压缩向量中提取像素值变化剧烈的像素点,并将提取的像素点确定为目标特征点;A first feature point extraction unit, configured to extract pixel points whose pixel values change dramatically from the first compression vector according to the pixel values of the pixel points in the first compression vector, and determine the extracted pixel points as target feature points;

向量确定单元,用于基于所述目标特征点确定第一特征向量。A vector determination unit is used to determine a first feature vector based on the target feature point.

在一种实施例中,特征点提取单元具体用于:In one embodiment, the feature point extraction unit is specifically used for:

对所述第一压缩向量进行差分运算,得到差分向量;所述差分向量用于表示像素点之间像素值的变化;Performing a differential operation on the first compressed vector to obtain a differential vector; the differential vector is used to represent a change in pixel values between pixel points;

以预设的第一窗口在所述第一压缩向量上进行滑窗,并根据所述差分向量,提取各所述第一窗口内像素值变化最大的第一像素点;Performing sliding window operation on the first compression vector with a preset first window, and extracting first pixel points with the largest pixel value change in each of the first windows according to the differential vector;

以预设的第二窗口在局部向量上进行滑窗,并根据所述差分向量,提取各所述第二窗口内与所述第一像素点的像素值之差最大的第二像素点;其中,所述局部向量是所述第一压缩向量中,以所述第一像素点为中心的预设大小的向量;Sliding a preset second window on the local vector, and extracting the second pixel point having the largest difference in pixel value between the second window and the first pixel point according to the differential vector; wherein the local vector is a vector of a preset size centered on the first pixel point in the first compressed vector;

将提取的所述第一像素点和所述第二像素点作为像素值变化剧烈的像素点。The extracted first pixel point and the second pixel point are used as pixel points whose pixel values change dramatically.

在一种实施例中,特征提取模块306还包括第二特征点提取单元,其用于:In one embodiment, the feature extraction module 306 further includes a second feature point extraction unit, which is used to:

基于预设大小的窗口对第二一维向量进行滑窗,并根据第二一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第三像素点;基于所述第三像素点确定第二特征向量。The second one-dimensional vector is slid based on a window of a preset size, and third pixels with drastic pixel value changes in each window are extracted according to the pixel values of the pixels in the second one-dimensional vector; and the second eigenvector is determined based on the third pixel.

在一种实施例中,匹配模块308具体用于:In one embodiment, the matching module 308 is specifically configured to:

根据预设的匹配度算法确定所述第一特征向量和所述第二特征向量之间特征点的匹配度;Determining the matching degree of feature points between the first feature vector and the second feature vector according to a preset matching degree algorithm;

将匹配度高于预设匹配度阈值的特征点确定为候选特征点对;Determine feature points whose matching degree is higher than a preset matching degree threshold as candidate feature point pairs;

根据RANSAC算法对所述候选特征点对进行优化,得到最终的特征点对。The candidate feature point pairs are optimized according to the RANSAC algorithm to obtain the final feature point pairs.

在一种实施例中,图像配准装置还包括关系记录模块,其用于:In one embodiment, the image registration apparatus further includes a relationship recording module, which is used to:

记录同一像素点在所述基准图像上的位置与在所述第一一维向量上的位置之间的第一对应关系;Recording a first corresponding relationship between a position of a same pixel point on the reference image and a position on the first one-dimensional vector;

记录同一像素点在所述原始图像上的位置与在所述第二一维向量上的位置之间的第二对应关系。A second corresponding relationship between the position of the same pixel point on the original image and the position on the second one-dimensional vector is recorded.

在一种实施例中,配准模块310具体用于:In one embodiment, the registration module 310 is specifically configured to:

根据所述第一对应关系和所述第二对应关系,计算所述特征点对中各个特征点在对应图像上映射的位置坐标;Calculating the position coordinates of each feature point in the feature point pair mapped on the corresponding image according to the first corresponding relationship and the second corresponding relationship;

基于所述特征点对中各个特征点的位置坐标,计算所述基准图像相对于所述原始图像的单应性矩阵;Calculating a homography matrix of the reference image relative to the original image based on the position coordinates of each feature point in the feature point pair;

基于所述单应性矩阵对所述基准图像进行仿射变换处理,得到与所述原始图像配准的目标图像。Affine transformation is performed on the reference image based on the homography matrix to obtain a target image registered with the original image.

本实施例所提供的装置,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。The implementation principle and technical effects of the device provided in this embodiment are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

本公开示例性实施例还提供一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器。所述存储器存储有能够被所述至少一个处理器执行的计算机程序,所述计算机程序在被所述至少一个处理器执行时用于使所述电子设备执行根据本公开实施例的方法。The exemplary embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to cause the electronic device to perform the method according to the embodiment of the present disclosure when executed by the at least one processor.

本公开示例性实施例还提供一种计算机程序产品,包括计算机程序,其中,所述计算机程序在被计算机的处理器执行时用于使所述计算机执行根据本公开实施例的方法。The exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, the computer is used to enable the computer to perform the method according to the embodiments of the present disclosure.

参考图4,现将描述可以作为本公开的服务器或客户端的电子设备400的结构框图,其是可以应用于本公开的各方面的硬件设备的示例。电子设备旨在表示各种形式的数字电子的计算机设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。With reference to Figure 4, a block diagram of an electronic device 400 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present disclosure described and/or required herein.

如图4所示,电子设备400包括计算单元401,其可以根据存储在只读存储器(ROM)402中的计算机程序或者从存储单元408加载到随机访问存储器(RAM)403中的计算机程序,来执行各种适当的动作和处理。在RAM 403中,还可存储设备400操作所需的各种程序和数据。计算单元401、ROM 402以及RAM 403通过总线404彼此相连。输入/输出(I/O)接口405也连接至总线404。As shown in FIG4 , the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to the bus 404.

电子设备400中的多个部件连接至I/O接口405,包括:输入单元406、输出单元407、存储单元408以及通信单元409。输入单元406可以是能向电子设备400输入信息的任何类型的设备,输入单元406可以接收输入的数字或字符信息,以及产生与电子设备的用户设置和/或功能控制有关的键信号输入。输出单元407可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。存储单元404可以包括但不限于磁盘、光盘。通信单元409允许电子设备400通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信收发机和/或芯片组,例如蓝牙TM设备、WiFi设备、WiMax设备、蜂窝通信设备和/或类似物。A plurality of components in the electronic device 400 are connected to the I/O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 may be any type of device capable of inputting information to the electronic device 400, and the input unit 406 may receive input digital or character information, and generate key signal inputs related to user settings and/or function control of the electronic device. The output unit 407 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 404 may include, but is not limited to, a disk, an optical disk. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network such as the Internet and/or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and/or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and/or the like.

计算单元401可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元401的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元401执行上文所描述的各个方法和处理。例如,在一些实施例中,图像配准方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元408。在一些实施例中,计算机程序的部分或者全部可以经由ROM402和/或通信单元409而被载入和/或安装到电子设备400上。在一些实施例中,计算单元401可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行图像配准方法。The computing unit 401 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above. For example, in some embodiments, the image registration method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed on the electronic device 400 via the ROM 402 and/or the communication unit 409. In some embodiments, the computing unit 401 may be configured to perform the image registration method in any other appropriate manner (e.g., by means of firmware).

用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions/operations specified in the flow chart and/or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

如本公开使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and/or data to a programmable processor.

为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1.一种图像配准方法,其特征在于,包括:1. An image registration method, comprising: 获取基准图像和待配准的原始图像;Acquire a reference image and an original image to be registered; 根据希尔伯特曲线分别对所述基准图像和所述原始图像进行转换,得到所述基准图像对应的第一一维向量和所述原始图像对应的第二一维向量;其中,所述第一一维向量用于表征所述基准图像中像素点之间的序列关系,所述第二一维向量用于表征所述原始图像中像素点之间的序列关系;The reference image and the original image are respectively converted according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; wherein the first one-dimensional vector is used to represent the sequence relationship between pixel points in the reference image, and the second one-dimensional vector is used to represent the sequence relationship between pixel points in the original image; 从所述第一一维向量中提取第一特征向量,从所述第二一维向量中提取第二特征向量;其中,所述从所述第一一维向量中提取第一特征向量,包括:基于预设大小的窗口对所述第一一维向量进行滑窗,并根据所述第一一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第四像素点,根据所述第四像素点在所述第一一维向量中的序列关系得到第一特征向量;所述像素值变化剧烈的第四像素点包括:预设的第一窗口内的像素点之间像素值变化最大的第一像素点,预设的第二窗口内与所述第一像素点的像素值之差最大的第二像素点;所述从所述第二一维向量中提取第二特征向量,包括:基于预设大小的窗口对所述第二一维向量进行滑窗,并根据所述第二一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第三像素点;基于所述第三像素点确定第二特征向量;所述像素值变化剧烈的第三像素点的提取方式与所述第四像素点的提取方式相同;Extracting a first feature vector from the first one-dimensional vector, and extracting a second feature vector from the second one-dimensional vector; wherein, extracting the first feature vector from the first one-dimensional vector comprises: sliding a window on the first one-dimensional vector based on a window of a preset size, and extracting a fourth pixel point whose pixel value changes dramatically in each window according to the pixel values of the pixel points in the first one-dimensional vector, and obtaining the first feature vector according to the sequence relationship of the fourth pixel point in the first one-dimensional vector; the fourth pixel point whose pixel value changes dramatically comprises: a first pixel point whose pixel value changes the most between the pixels in the preset first window, and a second pixel point whose pixel value difference with the first pixel point in the preset second window is the largest; extracting the second feature vector from the second one-dimensional vector comprises: sliding a window on the second one-dimensional vector based on a window of a preset size, and extracting a third pixel point whose pixel value changes dramatically in each window according to the pixel values of the pixels in the second one-dimensional vector; determining the second feature vector based on the third pixel point; the extraction method of the third pixel point whose pixel value changes dramatically is the same as the extraction method of the fourth pixel point; 根据匹配度高于预设匹配度阈值,对所述第一特征向量和所述第二特征向量进行特征点匹配,得到特征点对;According to the matching degree being higher than a preset matching degree threshold, performing feature point matching on the first feature vector and the second feature vector to obtain a feature point pair; 根据所述特征点对,对所述基准图像进行仿射变换处理,以得到与所述原始图像配准的目标图像。According to the feature point pairs, an affine transformation process is performed on the reference image to obtain a target image registered with the original image. 2.根据权利要求1所述的方法,其特征在于,所述从所述第一一维向量中提取第一特征向量,包括:2. The method according to claim 1, characterized in that extracting the first feature vector from the first one-dimensional vector comprises: 将所述第一一维向量输入至预设的编码器,通过所述编码器对所述第一一维向量进行压缩,得到与所述第一一维向量相对应的低维度的第一压缩向量;Inputting the first one-dimensional vector to a preset encoder, compressing the first one-dimensional vector through the encoder, and obtaining a low-dimensional first compressed vector corresponding to the first one-dimensional vector; 根据所述第一压缩向量中像素点的像素值,从所述第一压缩向量中提取像素值变化剧烈的像素点,并将提取的像素点确定为目标特征点;According to the pixel values of the pixels in the first compression vector, extracting the pixel points whose pixel values change dramatically from the first compression vector, and determining the extracted pixel points as target feature points; 基于所述目标特征点确定第一特征向量。A first feature vector is determined based on the target feature point. 3.根据权利要求2所述的方法,其特征在于,所述根据所述第一压缩向量中像素点的像素值,从所述第一压缩向量中提取像素值变化剧烈的像素点,包括:3. The method according to claim 2, characterized in that extracting pixels whose pixel values change dramatically from the first compressed vector according to the pixel values of the pixels in the first compressed vector comprises: 对所述第一压缩向量进行差分运算,得到差分向量;所述差分向量用于表示像素点之间像素值的变化;Performing a differential operation on the first compressed vector to obtain a differential vector; the differential vector is used to represent a change in pixel values between pixel points; 以预设的第一窗口在所述第一压缩向量上进行滑窗,并根据所述差分向量,提取各所述第一窗口内像素值变化最大的第一像素点;Performing sliding window operation on the first compression vector with a preset first window, and extracting first pixel points with the largest pixel value change in each of the first windows according to the differential vector; 以预设的第二窗口在局部向量上进行滑窗,并根据所述差分向量,提取各所述第二窗口内与所述第一像素点的像素值之差最大的第二像素点;其中,所述局部向量是所述第一压缩向量中,以所述第一像素点为中心的预设大小的向量;Sliding a preset second window on the local vector, and extracting the second pixel point having the largest difference in pixel value between the second window and the first pixel point according to the differential vector; wherein the local vector is a vector of a preset size centered on the first pixel point in the first compressed vector; 将提取的所述第一像素点和所述第二像素点作为像素值变化剧烈的像素点。The extracted first pixel point and the second pixel point are used as pixel points whose pixel values change dramatically. 4.根据权利要求1所述的方法,其特征在于,所述根据匹配度高于预设匹配度阈值,对所述第一特征向量和所述第二特征向量进行特征点匹配,得到特征点对,包括:4. The method according to claim 1, characterized in that the step of performing feature point matching on the first feature vector and the second feature vector to obtain a feature point pair according to the matching degree being higher than a preset matching degree threshold comprises: 根据预设的匹配度算法确定所述第一特征向量和所述第二特征向量之间特征点的匹配度;Determining the matching degree of feature points between the first feature vector and the second feature vector according to a preset matching degree algorithm; 将匹配度高于预设匹配度阈值的特征点确定为候选特征点对;Determine feature points whose matching degree is higher than a preset matching degree threshold as candidate feature point pairs; 根据随机采样RANSAC算法对所述候选特征点对进行优化,得到最终的特征点对。The candidate feature point pairs are optimized according to the random sampling RANSAC algorithm to obtain the final feature point pairs. 5.根据权利要求1所述的方法,其特征在于,所述方法还包括:5. The method according to claim 1, characterized in that the method further comprises: 记录同一像素点在所述基准图像上的位置与在所述第一一维向量上的位置之间的第一对应关系;Recording a first corresponding relationship between a position of a same pixel point on the reference image and a position on the first one-dimensional vector; 记录同一像素点在所述原始图像上的位置与在所述第二一维向量上的位置之间的第二对应关系。A second corresponding relationship between the position of the same pixel point on the original image and the position on the second one-dimensional vector is recorded. 6.根据权利要求5所述的方法,其特征在于,所述根据所述特征点对,对所述基准图像进行仿射变换处理,以得到与所述原始图像配准的目标图像,包括:6. The method according to claim 5, characterized in that the step of performing affine transformation processing on the reference image according to the feature point pairs to obtain a target image registered with the original image comprises: 根据所述第一对应关系和所述第二对应关系,计算所述特征点对中各个特征点在对应图像上映射的位置坐标;Calculating the position coordinates of each feature point in the feature point pair mapped on the corresponding image according to the first corresponding relationship and the second corresponding relationship; 基于所述特征点对中各个特征点的位置坐标,计算所述基准图像相对于所述原始图像的单应性矩阵;Calculating a homography matrix of the reference image relative to the original image based on the position coordinates of each feature point in the feature point pair; 基于所述单应性矩阵对所述基准图像进行仿射变换处理,得到与所述原始图像配准的目标图像。Affine transformation is performed on the reference image based on the homography matrix to obtain a target image registered with the original image. 7.根据权利要求2所述的方法,其特征在于,所述编码器是对预设的VAE模型进行训练后得到的,其中,所述VAE模型的卷积核和反卷积核均为一维的。7. The method according to claim 2 is characterized in that the encoder is obtained after training a preset VAE model, wherein the convolution kernel and deconvolution kernel of the VAE model are both one-dimensional. 8.根据权利要求1所述的方法,其特征在于,所述基准图像和所述原始图像分别为灰度图像。8. The method according to claim 1, characterized in that the reference image and the original image are grayscale images respectively. 9.根据权利要求1所述的方法,其特征在于,所述原始图像包括:拍摄目标试题得到的文本图像,所述基准图像包括:预设试题库中包括所述目标试题的图像。9. The method according to claim 1 is characterized in that the original image comprises: a text image obtained by photographing a target test question, and the reference image comprises: an image of the target test question in a preset test question library. 10.一种图像配准装置,其特征在于,包括:10. An image registration device, comprising: 图像获取模块,用于获取基准图像和待配准的原始图像;An image acquisition module, used to acquire a reference image and an original image to be registered; 图像转换模块,用于根据希尔伯特曲线分别对所述基准图像和所述原始图像进行转换,得到所述基准图像对应的第一一维向量和所述原始图像对应的第二一维向量;其中,所述第一一维向量用于表征所述基准图像中像素点之间的序列关系,所述第二一维向量用于表征所述原始图像中像素点之间的序列关系;An image conversion module, used to convert the reference image and the original image respectively according to the Hilbert curve to obtain a first one-dimensional vector corresponding to the reference image and a second one-dimensional vector corresponding to the original image; wherein the first one-dimensional vector is used to represent the sequence relationship between the pixel points in the reference image, and the second one-dimensional vector is used to represent the sequence relationship between the pixel points in the original image; 特征提取模块,用于从所述第一一维向量中提取第一特征向量,从所述第二一维向量中提取第二特征向量;其中,所述特征提取模块还用于:基于预设大小的窗口对所述第一一维向量进行滑窗,并根据所述第一一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第四像素点,根据所述第四像素点在所述第一一维向量中的序列关系得到第一特征向量;所述像素值变化剧烈的第四像素点包括:预设的第一窗口内的像素点之间像素值变化最大的第一像素点,预设的第二窗口内与所述第一像素点的像素值之差最大的第二像素点;以及,基于预设大小的窗口对所述第二一维向量进行滑窗,并根据所述第二一维向量中像素点的像素值,提取各窗口内像素值变化剧烈的第三像素点;基于所述第三像素点确定第二特征向量;所述像素值变化剧烈的第三像素点的提取方式与所述第四像素点的提取方式相同;A feature extraction module, used to extract a first feature vector from the first one-dimensional vector, and to extract a second feature vector from the second one-dimensional vector; wherein the feature extraction module is further used to: slide the first one-dimensional vector based on a window of a preset size, and extract fourth pixels whose pixel values vary dramatically in each window according to the pixel values of the pixels in the first one-dimensional vector, and obtain a first feature vector according to the sequence relationship of the fourth pixels in the first one-dimensional vector; the fourth pixels whose pixel values vary dramatically include: a first pixel whose pixel value varies the most between pixels in the preset first window, and a second pixel whose pixel value difference with the first pixel in the preset second window is the largest; and, slide the second one-dimensional vector based on a window of a preset size, and extract third pixels whose pixel values vary dramatically in each window according to the pixel values of the pixels in the second one-dimensional vector; determine a second feature vector based on the third pixel; the extraction method of the third pixel whose pixel value varies dramatically is the same as the extraction method of the fourth pixel; 匹配模块,用于根据匹配度高于预设匹配度阈值,对所述第一特征向量和所述第二特征向量进行特征点匹配,得到特征点对;A matching module, configured to match feature points of the first feature vector and the second feature vector according to a matching degree being higher than a preset matching degree threshold, to obtain a feature point pair; 配准模块,用于根据所述特征点对,对所述基准图像进行仿射变换处理,以得到与所述原始图像配准的目标图像。The registration module is used to perform affine transformation processing on the reference image according to the feature point pair to obtain a target image registered with the original image. 11.一种电子设备,其特征在于,所述电子设备包括:11. An electronic device, characterized in that the electronic device comprises: 处理器;以及Processor; and 存储程序的存储器,Memory for storing programs, 其中,所述程序包括指令,所述指令在由所述处理器执行时使所述处理器执行根据权利要求1至9任一所述的图像配准方法。The program includes instructions, which, when executed by the processor, enable the processor to perform the image registration method according to any one of claims 1 to 9. 12.一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行根据权利要求1至9任一所述的图像配准方法。12. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the image registration method according to any one of claims 1 to 9.
CN202110952011.XA 2021-08-19 2021-08-19 Image registration method, device, equipment and medium Active CN113643180B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110952011.XA CN113643180B (en) 2021-08-19 2021-08-19 Image registration method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110952011.XA CN113643180B (en) 2021-08-19 2021-08-19 Image registration method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN113643180A CN113643180A (en) 2021-11-12
CN113643180B true CN113643180B (en) 2024-06-21

Family

ID=78422799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110952011.XA Active CN113643180B (en) 2021-08-19 2021-08-19 Image registration method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113643180B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69536083D1 (en) * 1994-04-20 2010-08-05 Oki Electric Ind Co Ltd Apparatus and method for encoding and decoding images using edge synthesis and wavelet inverse transform
US20070061735A1 (en) * 1995-06-06 2007-03-15 Hoffberg Steven M Ergonomic man-machine interface incorporating adaptive pattern recognition based control system
US6597818B2 (en) * 1997-05-09 2003-07-22 Sarnoff Corporation Method and apparatus for performing geo-spatial registration of imagery
US20040175057A1 (en) * 2003-03-04 2004-09-09 Thomas Tsao Affine transformation analysis system and method for image matching

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Robust Feature Matching for Remote Sensing Image Registration via Locally Linear Transforming;Jiayi Ma;《IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING》;全文 *
基于双特征的丘陵山区耕地低空遥感图像配准算法;宋飞;杨扬;杨昆;张愫;毕东升;;北京航空航天大学学报(09);全文 *

Also Published As

Publication number Publication date
CN113643180A (en) 2021-11-12

Similar Documents

Publication Publication Date Title
CN108509915B (en) Method and device for generating face recognition model
WO2020006961A1 (en) Image extraction method and device
CN113971751A (en) Training feature extraction model, and method and device for detecting similar images
CN112991180B (en) Image stitching method, device, equipment and storage medium
CN111783622A (en) Method, apparatus, device and computer-readable storage medium for facial expression recognition
CN114155546B (en) An image correction method, device, electronic device and storage medium
CN114511041B (en) Model training method, image processing method, apparatus, equipment and storage medium
CN114255337A (en) Method and device for correcting document image, electronic equipment and storage medium
CN110866469A (en) A method, device, equipment and medium for facial feature recognition
CN110414502A (en) Image processing method and device, electronic device, and computer-readable medium
WO2020034981A1 (en) Method for generating encoded information and method for recognizing encoded information
CN112528978B (en) Face key point detection method and device, electronic equipment and storage medium
CN114120454A (en) Training method and device of living body detection model, electronic equipment and storage medium
JP2022185143A (en) Text detection method, and text recognition method and device
CN112287945A (en) Screen fragmentation determination method and device, computer equipment and computer readable storage medium
CN113569855A (en) Tongue picture segmentation method, equipment and storage medium
CN114898376B (en) Formula identification method, device, equipment and medium
CN113255629B (en) Document processing method and device, electronic equipment and computer readable storage medium
CN113516697B (en) Image registration method, device, electronic equipment and computer readable storage medium
CN116415020A (en) Image retrieval method, device, electronic equipment and storage medium
CN113822871A (en) Target detection method and device based on dynamic detection head, storage medium and equipment
CN113643180B (en) Image registration method, device, equipment and medium
CN114519729A (en) Image registration quality assessment model training method, device and computer equipment
CN116129228B (en) Image matching model training method, image matching method and device thereof
CN117746502A (en) Image annotation method, action recognition method, device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant