CN111986089A - Image storage and comparison method, device, equipment and medium with characteristic value being integer - Google Patents

Image storage and comparison method, device, equipment and medium with characteristic value being integer Download PDF

Info

Publication number
CN111986089A
CN111986089A CN202010887737.5A CN202010887737A CN111986089A CN 111986089 A CN111986089 A CN 111986089A CN 202010887737 A CN202010887737 A CN 202010887737A CN 111986089 A CN111986089 A CN 111986089A
Authority
CN
China
Prior art keywords
image
integers
integer
comparison
pixel
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.)
Granted
Application number
CN202010887737.5A
Other languages
Chinese (zh)
Other versions
CN111986089B (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.)
Jiyi Data Technology Shanghai Co ltd
Original Assignee
Jiyi Data Technology Shanghai 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 Jiyi Data Technology Shanghai Co ltd filed Critical Jiyi Data Technology Shanghai Co ltd
Priority to CN202010887737.5A priority Critical patent/CN111986089B/en
Priority claimed from CN202010887737.5A external-priority patent/CN111986089B/en
Publication of CN111986089A publication Critical patent/CN111986089A/en
Application granted granted Critical
Publication of CN111986089B publication Critical patent/CN111986089B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/4084Scaling of whole images or parts thereof, e.g. expanding or contracting in the transform domain, e.g. fast Fourier transform [FFT] domain scaling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/32Normalisation of the pattern dimensions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)

Abstract

本申请提供了一种特征值整数化的图像存储与比对方法、装置、设备和介质,通过将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。本申请将图片的特征值转化为整数形式,以便于存储和比对,大大节省了对比处理速度和存储所需内存。

Figure 202010887737

The present application provides an image storage and comparison method, device, device and medium with integer eigenvalues, by scaling the acquired original image into a standard image of x×y pixel size, and dividing it into N pixel blocks; wherein , each pixel block has three (x×y)/N-dimensional vectors corresponding to the three RGB channels respectively; let the three (x×y)/N-dimensional vectors in each pixel block be dimension-reduced and reorganized into integers , to obtain a set of 3N integers corresponding to the standard image; the set is used as the data storage form of the standard image to be stored in an image database that follows the data storage form, so as to check whether there are similar Pixel block or image. The present application converts the feature values of the pictures into integer form for easy storage and comparison, which greatly saves the comparison processing speed and the memory required for storage.

Figure 202010887737

Description

特征值整数化的图像存储与比对方法、装置、设备和介质Method, apparatus, device and medium for image storage and comparison with eigenvalue integerization

技术领域technical field

本发明涉及图像处理技术领域,特别是涉及一种特征值整数化的图像存储与比对方法、装置、设备和介质。The present invention relates to the technical field of image processing, and in particular, to a method, device, device and medium for image storage and comparison with integer eigenvalues.

背景技术Background technique

当前越来越多的场景中需要图片的对比,如常见的针对盗用或抄袭图案的鉴定。随着图片或图案的抄袭越来越隐蔽,往往还需要对图片中的图案的颜色、形状等进行局部的比对。At present, more and more scenes require the comparison of pictures, such as the common identification of embezzled or plagiarized patterns. As the plagiarism of pictures or patterns becomes more and more concealed, it is often necessary to locally compare the colors and shapes of the patterns in the pictures.

而传统的图片比对过程,需要将待比对图像与数据库中的图片进行逐一比对,如常见的利用图片提取出的特征向量进行比对,但是一个图片中所包含的特征向量或像素内存也非常多,这就造成需比对的速度非常多,比对速度非常缓慢,而且对于局部或细微的抄袭图案往往不能发现;另外,图片数据库中存储图片的数据占用也非常庞大。In the traditional image comparison process, it is necessary to compare the images to be compared with the images in the database one by one. There are also a lot of them, which results in a lot of comparison speed. The comparison speed is very slow, and local or subtle plagiarism patterns are often not found. In addition, the image data stored in the image database is also very large.

发明内容SUMMARY OF THE INVENTION

鉴于以上所述现有技术的缺点,本申请的目的在于提供一种特征值整数化的图像存储与比对方法、装置、设备和介质,以解决现有技术中存在的至少一个问题。In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide an image storage and comparison method, apparatus, device and medium with integer eigenvalues, so as to solve at least one problem existing in the prior art.

为实现上述目的及其他相关目的,本申请提供一种特征值整数化的图像存储与比对方法,所述方法包括:将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。In order to achieve the above purpose and other related purposes, the present application provides a method for storing and comparing images with integer eigenvalues. N pixel blocks; wherein, each pixel block has three (x×y)/N-dimensional vectors corresponding to the three RGB channels respectively; let the three (x×y)/N-dimensional vectors in each pixel block be respectively Dimensionality reduction and reorganization into integers to obtain a set of 3N integers corresponding to the standard image; the set is used as the data storage form of the standard image to be stored in an image database that follows the data storage form, for use by integer ratios Check if there are similar pixel blocks or images.

于本申请的一实施例中,所述将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块,包括:将原始图像的RGBA四通道删减为RGB三通道,并缩放为x×y像素大小的标准图像;将所述标准图像按N宫格进行分割以得到N个像素块。In an embodiment of the present application, scaling the acquired original image into a standard image of x×y pixel size and dividing it into N pixel blocks includes: pruning four RGBA channels of the original image into three RGB channels , and scaled to a standard image of x×y pixel size; the standard image is divided according to N grids to obtain N pixel blocks.

于本申请的一实施例中,所述缩放过程通过计算像素块内每个通道的均值方法以消除原始图像的失真。In an embodiment of the present application, the scaling process removes the distortion of the original image by calculating the mean value of each channel in the pixel block.

于本申请的一实施例中,所述令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合,包括:将各所述向量中每个维度的像素值转化为8位二进制数,以得到对应每个向量的8×(x×y)/N的二进制数矩阵;将所述二进制数矩阵根据低位到高位的排列方式重新排列组合,以降维重组为一整数;汇集所述标准图像的全部像素块所对应的整数,以得到对应所述标准图像的3N个整数的集合。In an embodiment of the present application, the three (x×y)/N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers respectively, so as to obtain a set of 3N integers corresponding to the standard image , including: converting the pixel value of each dimension in each of the vectors into 8-bit binary numbers to obtain an 8×(x×y)/N binary number matrix corresponding to each vector; The arrangement from the low order to the high order is rearranged and combined to form an integer for dimension reduction; the integers corresponding to all the pixel blocks of the standard image are collected to obtain a set of 3N integers corresponding to the standard image.

于本申请的一实施例中,所述将所述二进制数矩阵根据低位到高位的排列方式以降维重组为一整数,包括:所述二进制数矩阵中,每行对应每个维度的8位二进制数,且每个维度的位由左到右依次对应为由低到高;每列对应每个维度中属于相同位的二进制数;将每个维度中属于相同位的二进制数组合为对应该位的数值区段;根据各所述数值区段按照对应的位,按由低位到高位依次排列,以重新组合得到对应一向量的包含8个数值区段的整数。In an embodiment of the present application, the reorganization of the binary number matrix into an integer by reducing the dimension according to the arrangement of the low order to the high order includes: in the binary number matrix, each row corresponds to an 8-bit binary number of each dimension. number, and the bits of each dimension correspond from low to high from left to right; each column corresponds to the binary numbers that belong to the same bit in each dimension; the binary numbers that belong to the same bit in each dimension are combined into the corresponding bit According to the corresponding bits, the numerical segments are arranged in order from low to high, so as to recombine to obtain an integer corresponding to a vector including 8 numerical segments.

于本申请的一实施例中,所述通过整数比对断是否存在相似的像素块或图像,包括:针对包含8个数值区段的整数设置比对线,以令所述整数中在所述比对线右边的一或多个高位数值区段的数值与所述图像数据库中各整数对应的一或多个高位数值区段的数值进行比对;若比对存在相同,则判定该整数相近;若对应所述像素块的3个整数中至少2个整数的对比判定为相同,则判定所述图像数据库中存在与所述像素块相似的像素块;若对应所述标准图像的3N个整数中至少m个整数的对比判定为相同,则判定所述图像数据库中存在与所述标准图像相似的图像。In an embodiment of the present application, determining whether there are similar pixel blocks or images by an integer comparison includes: setting a comparison line for an integer including 8 value segments, so that the integer is in the The value of one or more high-order value segments on the right side of the comparison line is compared with the value of one or more high-order value segments corresponding to each integer in the image database; if the comparison is the same, it is determined that the integer is similar ; If the comparison of at least 2 integers in the 3 integers corresponding to the pixel block is the same, then it is determined that there is a pixel block similar to the pixel block in the image database; if the 3N integers corresponding to the standard image exist If the comparison of at least m integers is the same, it is determined that there is an image similar to the standard image in the image database.

于本申请的一实施例中,所述比对线可根据比对情况或场景需求进行调节,以供调整比对精确度。In an embodiment of the present application, the comparison line can be adjusted according to the comparison situation or scene requirements, so as to adjust the comparison accuracy.

为实现上述目的及其他相关目的,本申请提供一种特征值整数化的图像存储与比对装置,所述装置包括:所述装置包括:缩放分割模块,用于将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;整数转化模块,用于令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;存储比对模块,用于将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。In order to achieve the above purpose and other related purposes, the present application provides an image storage and comparison device with integer eigenvalues. The device includes: the device includes: a scaling and segmentation module for scaling the acquired original image to x A standard image of ×y pixel size is divided into N pixel blocks; each pixel block has three (x×y)/N-dimensional vectors corresponding to the three RGB channels respectively; the integer conversion module is used to make each The three (x×y)/N-dimensional vectors in the pixel blocks are respectively dimensionally reduced and reorganized into integers to obtain a set of 3N integers corresponding to the standard image; the storage comparison module is used to use the set as the The data storage form of the standard image is stored in an image database conforming to the data storage form, so as to check whether there are similar pixel blocks or images through integer comparison.

为实现上述目的及其他相关目的,本申请提供一种计算机设备,所述设备包括:存储器、及处理器;所述存储器用于存储计算机指令;所述处理器运行计算机指令实现如上所述的方法。In order to achieve the above purpose and other related purposes, the present application provides a computer device, the device includes: a memory and a processor; the memory is used to store computer instructions; the processor executes the computer instructions to implement the above method. .

为实现上述目的及其他相关目的,本申请提供一种计算机可读存储介质,存储有计算机指令,所述计算机指令被运行时执行如上所述的方法。In order to achieve the above object and other related objects, the present application provides a computer-readable storage medium storing computer instructions, and when the computer instructions are executed, the above-mentioned method is executed.

综上所述,本申请提供的一种特征值整数化的图像存储与比对方法、装置、设备和介质,通过将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。To sum up, a method, device, device and medium for image storage and comparison with integer eigenvalues provided by the present application, by scaling the acquired original image into a standard image of x×y pixel size, and dividing it into N pixel blocks; wherein, each pixel block has three (x×y)/N-dimensional vectors corresponding to the three RGB channels respectively; let the three (x×y)/N-dimensional vectors in each pixel block decrease respectively The dimensions are merged into integers to obtain a set of 3N integers corresponding to the standard image; the set is used as the data storage form of the standard image to be stored in an image database that follows the data storage form for comparison by integers Check if there are similar pixel blocks or images.

具有以下有益效果:Has the following beneficial effects:

本申请将图片的特征值转化为整数形式,以便于存储和比对,大大节省了对比处理速度和存储所需内存。The present application converts the feature values of the pictures into integer form for easy storage and comparison, which greatly saves the comparison processing speed and the memory required for storage.

附图说明Description of drawings

图1显示为本申请于一实施例中特征值整数化的图像存储与比对方法的流程示意图。FIG. 1 is a schematic flowchart of an image storage and comparison method for eigenvalue integerization in an embodiment of the present application.

图2显示为本申请于一实施例中对应步骤S101的场景示意图。FIG. 2 is a schematic diagram of a scene corresponding to step S101 in an embodiment of the present application.

图3显示为本申请于一实施例中特征值整数化的图像存储与比对装置的模块示意图。FIG. 3 is a schematic block diagram of an image storage and comparison apparatus for eigenvalue integerization according to an embodiment of the present application.

图4显示为本申请于一实施例中计算机设备的结构示意图。FIG. 4 is a schematic structural diagram of a computer device in an embodiment of the present application.

具体实施方式Detailed ways

以下通过特定的具体实例说明本申请的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本申请的其他优点与功效。本申请还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本申请的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。The embodiments of the present application are described below through specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments may be combined with each other under the condition of no conflict.

需要说明的是,以下实施例中所提供的图示仅以示意方式说明本申请的基本构想,虽然图式中仅显示与本申请中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,但其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。It should be noted that the drawings provided in the following embodiments are only used to illustrate the basic concept of the present application in a schematic way, although the drawings only show the components related to the present application rather than the number, shape and number of components in actual implementation. The dimensions are drawn, but the type, quantity and proportion of each component can be arbitrarily changed in actual implementation, and the component layout may also be more complicated.

在通篇说明书中,当说某部分与另一部分“连接”时,这不仅包括“直接连接”的情形,也包括在其中间把其它元件置于其间而“间接连接”的情形。另外,当说某种部分“包括”某种构成要素时,只要没有特别相反的记载,则并非将其它构成要素,排除在外,而是意味着可以还包括其它构成要素。Throughout the specification, when a part is said to be "connected" to another part, this includes not only the case of "direct connection" but also the case of "indirect connection" with other elements interposed therebetween. In addition, when it says that a certain part "includes" a certain constituent element, unless there is particularly no description to the contrary, it does not exclude other constituent elements, but means that other constituent elements may also be included.

其中提到的第一、第二及第三等术语是为了说明多样的部分、成分、区域、层及/或段而使用的,但并非限定于此。这些术语只用于把某部分、成分、区域、层或段区别于其它部分、成分、区域、层或段。因此,以下叙述的第一部分、成分、区域、层或段在不超出本申请范围的范围内,可以言及到第二部分、成分、区域、层或段。The terms first, second, and third mentioned herein are used for the purpose of describing various parts, components, regions, layers and/or sections and are not intended to be limiting. These terms are only used to distinguish one part, component, region, layer or section from another part, component, region, layer or section. Thus, recitation of a first part, component, region, layer or section below may refer to a second part, component, region, layer or section without departing from the scope of the present application.

再者,如同在本文中所使用的,单数形式“一”、“一个”和“该”旨在也包括复数形式,除非上下文中有相反的指示。应当进一步理解,术语“包含”、“包括”表明存在所述的特征、操作、元件、组件、项目、种类、和/或组,但不排除一个或多个其他特征、操作、元件、组件、项目、种类、和/或组的存在、出现或添加。此处使用的术语“或”和“和/或”被解释为包括性的,或意味着任一个或任何组合。因此,“A、B或C”或者“A、B和/或C”意味着“以下任一个:A;B;C;A和B;A和C;B和C;A、B和C”。仅当元件、功能或操作的组合在某些方式下内在地互相排斥时,才会出现该定义的例外。Also, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context dictates otherwise. It should be further understood that the terms "comprising", "comprising" indicate the presence of a stated feature, operation, element, component, item, kind, and/or group, but do not exclude one or more other features, operations, elements, components, The existence, appearance or addition of items, categories, and/or groups. The terms "or" and "and/or" as used herein are to be construed to be inclusive or to mean any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C" . Exceptions to this definition arise only when combinations of elements, functions, or operations are inherently mutually exclusive in some way.

传统的图片比对过程,需要将待比对图像与数据库中的图片进行逐一比对,如常见的利用图片提取出的特征向量进行比对,但是一个图片中所包含的特征向量或像素内存也非常多,这就造成需比对的速度非常多,比对速度非常缓慢,而且对于局部或细微的抄袭图案往往不能发现;另外,图片数据库中存储图片的数据占用也非常庞大。In the traditional image comparison process, it is necessary to compare the images to be compared with the images in the database one by one. For example, the common feature vector extracted from the image is compared, but the feature vector or pixel memory contained in a There are a lot of them, which results in a lot of comparison speeds. The comparison speed is very slow, and local or subtle plagiarism patterns are often not found. In addition, the data storage of pictures in the picture database is also very large.

为解决上述问题,本申请提出一种特征值整数化的图像存储与比对方法、装置、设备和介质,将图片的特征值转化为整数形式,以便于存储和比对,大大节省了对比速度和存储所需内存。In order to solve the above problems, the present application proposes a method, device, equipment and medium for image storage and comparison with integer eigenvalues, which converts the eigenvalues of pictures into integer form, which is convenient for storage and comparison, and greatly saves the comparison speed. and memory required for storage.

如图1所示,展示为本申请于一实施例中的特征值整数化的图像存储与比对方法的流程示意图。如图所示,所述方法包括:As shown in FIG. 1 , a schematic flowchart of an image storage and comparison method for eigenvalue integerization in an embodiment of the present application is shown. As shown, the method includes:

步骤S101:将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量。Step S101: Scale the acquired original image into a standard image of x×y pixel size, and divide it into N pixel blocks; wherein each pixel block has three (x×y)/N dimensions corresponding to three RGB channels respectively. vector.

于本申请一实施例中,所述将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块,包括:In an embodiment of the present application, scaling the acquired original image into a standard image with a size of x×y pixels and dividing it into N pixel blocks includes:

A、将原始图像的RGBA四通道删减为RGB三通道,并缩放为x×y像素大小的标准图像;A. Reduce the RGBA four channels of the original image to RGB three channels, and scale it to a standard image of x×y pixel size;

于本实施例中,通常一张原始图像均具有RGBA四个通道,它们分别代表Red(红色)Green(绿色)Blue(蓝色)和Alpha的色彩空间,但是它其实仅仅是RGB模型的附加了额外的信息。采用的颜色通常是RGB,而Alpha通道一般用作不透明度参数,因此,本申请将在图像比对过程中产生影响较小或不产生影响的Alpha通道去掉,以减少通道数,从而减少比对用到的数据。In this embodiment, an original image usually has four RGBA channels, which represent the color spaces of Red (red), Green (green), Blue (blue) and Alpha respectively, but it is only an addition to the RGB model. additional information. The color used is usually RGB, and the Alpha channel is generally used as an opacity parameter. Therefore, this application removes the Alpha channel that has little or no impact in the image comparison process to reduce the number of channels, thereby reducing the comparison. data used.

另外,通常一张原始图像的像素大小各不相同,且往往具有较大的像素尺寸,如4032×3024、2048×1024等等,为了便于本申请将图片转化为整数、以及后续的存储于对比,本申请统一将原始图像缩放至较小或极小的统一像素大小,如12×12的像素大小,以统一为标准图像,可参考图2所示。而本申请进行缩放的方法,采用图像处理技术领域中常见的一些缩放方法即可。In addition, the pixel size of an original image is usually different, and often has a larger pixel size, such as 4032×3024, 2048×1024, etc. In order to facilitate this application, the image is converted into an integer and subsequently stored for comparison. , the present application uniformly scales the original image to a smaller or extremely small uniform pixel size, such as a pixel size of 12×12, to be unified as a standard image, as shown in FIG. 2 . The zooming method in the present application may use some common zooming methods in the field of image processing technology.

于本实施例中,由于图像进行缩放处理过程中会带来图像失真的问题,故本申请在所述缩放过程通过计算像素块内每个通道的均值方法以消除原始图像的失真。例如,对每个像素点分配权重,以及进行归一化处理,通过数值差分方法来消除失真。In this embodiment, since the image scaling process will bring about the problem of image distortion, the present application eliminates the distortion of the original image by calculating the mean value of each channel in the pixel block in the scaling process. For example, weights are assigned to each pixel, and normalization is performed to eliminate distortion by numerical difference method.

需说明的是,本方法中消除失真的过程也采用常见的处理图像失真的方法即可。另外,这里处理图像失真的效果也并非需要极高的标准,因为,本申请围绕图像进行一系列处理的目的是用于图片比对,如对某部分区域图案的颜色或形状等进行比对,而并非用于使用或欣赏等,只要该区域内图案对应的特征信息无较大变化,均对图片比对的影响较小。因此,对于图像失真处理的要求不算太高。It should be noted that, the process of eliminating distortion in this method may also adopt a common method of dealing with image distortion. In addition, the effect of processing image distortion here does not require extremely high standards, because the purpose of performing a series of processing around images in this application is to compare pictures, such as comparing the color or shape of patterns in a certain area, It is not for use or appreciation, etc., as long as there is no major change in the feature information corresponding to the pattern in this area, the impact on the picture comparison is small. Therefore, the requirements for image distortion processing are not too high.

B、将所述标准图像按N宫格进行分割以得到N个像素块。B. The standard image is divided according to N grids to obtain N pixel blocks.

举例来说,如图2所示,其展示为由原始图像到像素块的场景示意图。原始图像缩放为12×12的像素大小的标准图像后,按九宫格框架进行分割,可以得到9个4×4的像素大小的像素块。相应地,每个像素块则具有分别对应RGB三通道的三个16维((12×12)/9=4×4)的向量:

Figure BDA0002656062430000051
具体向量如下:For example, as shown in FIG. 2, which is shown as a schematic diagram of a scene from an original image to a pixel block. After the original image is scaled to a standard image with a pixel size of 12×12, it is divided according to the nine-square grid frame, and nine pixel blocks with a pixel size of 4×4 can be obtained. Correspondingly, each pixel block has three 16-dimensional ((12×12)/9=4×4) vectors corresponding to the three RGB channels:
Figure BDA0002656062430000051
The specific vector is as follows:

Figure BDA0002656062430000052
Figure BDA0002656062430000052

Figure BDA0002656062430000053
Figure BDA0002656062430000053

Figure BDA0002656062430000054
Figure BDA0002656062430000054

需说明的是,本申请中分割标准图像的N宫格并不限于中心对称的四宫格、九宫格、十六宫格等,还可包括如六宫格、八宫格、十二宫格等非中心对称的多宫格。另外,由N宫格分割后的每个像素块优选为正方形或长方形。It should be noted that the N-grid for dividing the standard image in this application is not limited to the centrally symmetric four-grid, nine-grid, sixteen-grid, etc., but also includes, for example, six-grid, eight-grid, twelve-grid, etc. Non-centrosymmetric multi-grid. In addition, each pixel block divided by N grids is preferably a square or a rectangle.

步骤S102:令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合。Step S102 : reducing the dimensions of the three (x×y)/N-dimensional vectors in each pixel block and reorganizing them into integers to obtain a set of 3N integers corresponding to the standard image.

于本申请一实施例中,所述令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合,包括:In an embodiment of the present application, the three (x×y)/N-dimensional vectors in each pixel block are respectively reduced in dimension and reorganized into integers, so as to obtain a set of 3N integers corresponding to the standard image, include:

A、将各所述向量中每个维度的像素值转化为8位二进制数,以得到对应每个向量的8×(x×y)/N的二进制数矩阵。A. Convert the pixel value of each dimension in each of the vectors into 8-bit binary numbers to obtain an 8×(x×y)/N binary number matrix corresponding to each vector.

举例来说,向量

Figure BDA0002656062430000055
的第一个维度R1的像素值对应转为8为二进制数如下所示:For example, the vector
Figure BDA0002656062430000055
The pixel value of 1 in the first dimension R corresponds to 8 converted to a binary number as follows:

R1={r11,r12,…,r18};R 1 ={r 11 ,r 12 ,...,r 18 };

需说明的是,RGB三通道的每个通道内的像素值范围为(0~255),其对应二进制正好为8位(00000000~11111111),因此,可将每个维度的像素值转化为8位二进制数。It should be noted that the range of pixel values in each channel of the three RGB channels is (0 to 255), and the corresponding binary value is exactly 8 bits (00000000 to 11111111). Therefore, the pixel value of each dimension can be converted into 8 Bit binary number.

进一步地,承接如图2中所举例的每个向量为16维,那么如向量

Figure BDA0002656062430000062
所得到的二进制数矩阵如下所示;Further, it is assumed that each vector as exemplified in Figure 2 is 16-dimensional, then if the vector
Figure BDA0002656062430000062
The resulting matrix of binary numbers is shown below;

Figure BDA0002656062430000061
Figure BDA0002656062430000061

具体来说,如上所举例的二进制数矩阵公式(1)中,每行对应每个维度的8位二进制数,且每个维度的位由左到右依次对应为由低到高,如第一行中,r11对应为最低位,r18对应为最高位;每列对应每个维度中属于相同(高低)位的二进制数,如第一列中的r11、r21、…、r161则对应为各维度中属于相同低位的二进制数。Specifically, in the binary number matrix formula (1) exemplified above, each row corresponds to an 8-bit binary number of each dimension, and the bits of each dimension correspond from left to right in order from low to high, such as the first In the row, r 11 corresponds to the lowest bit, and r 18 corresponds to the highest bit; each column corresponds to the binary numbers belonging to the same (high and low) bits in each dimension, such as r 11 , r 21 , ..., r 161 in the first column It corresponds to the binary numbers that belong to the same low-order bit in each dimension.

B、将所述二进制数矩阵根据低位到高位的排列方式重新排列组合,以降维重组为一整数。具体包括:B. Rearrange and combine the binary number matrix according to the arrangement from the low order to the high order, so as to reduce the dimension and reorganize it into an integer. Specifically include:

b1、将每个维度中属于相同位的二进制数组合为对应该位的数值区段;b1. Combine the binary numbers belonging to the same bit in each dimension into a numerical segment corresponding to the bit;

通常将矩阵降维转换为一行整数时,可能会按横向编号顺序自然排列,这也是通常的做法。但是本申请创新的提出按相同位来纵向组合排列。如上举例的向量

Figure BDA0002656062430000063
的二进制数矩阵公式(1)中,得到对应向量
Figure BDA0002656062430000064
的整数如下所示:When converting a matrix to a row of integers, it may be naturally arranged in horizontal numbering order, which is also common practice. However, the innovative proposal of the present application is arranged in vertical combination according to the same position. vector as above
Figure BDA0002656062430000063
In the binary matrix formula (1) of , the corresponding vector is obtained
Figure BDA0002656062430000064
The integers are as follows:

{r11,r21,…,r161|r12,r22,…,r162|…|r18,r28,…,r168}; (2){r 11 ,r 21 ,…,r 161 |r 12 ,r 22 ,…,r 162 |…|r 18 ,r 28 ,…,r 168 }; (2)

b2、根据各所述数值区段按照对应的位,按由低位到高位依次排列,以重新组合得到对应一向量的包含8个数值区段的整数。b2. According to each of the numerical segments, the corresponding bits are arranged in order from the low order to the high order, so as to recombine to obtain an integer corresponding to a vector including 8 numerical segments.

对应地,如上所举例的整数公式(2),r11到r161则对应为最低位的数值区段;r18到r168则对应为最高位的数值区段,按照由低位到高位的顺序依次进行排列,则得到对应向量

Figure BDA0002656062430000065
的整数如上所举例的整数公式(2),其中,该整数包含8个数值区段的整数。Correspondingly, in the integer formula (2) exemplified above, r 11 to r 161 correspond to the lowest value segment; r 18 to r 168 correspond to the highest value segment, in the order from low to high Arrange in order to get the corresponding vector
Figure BDA0002656062430000065
The integer of is the integer formula (2) exemplified above, wherein the integer includes an integer of 8 value segments.

C、汇集所述标准图像的全部像素块所对应的整数,以得到对应所述标准图像的3N个整数的集合。C. Collect integers corresponding to all pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image.

在举例来说,如上所举例的整数公式(2)实际上只对应一个像素块中的一个向量

Figure BDA0002656062430000066
而如上举例可知,一个像素块中有3个向量,一个标准图像则又包含9个像素块,因此,一个标准图像则对应有27个整数的集合。For example, the integer formula (2) as exemplified above actually corresponds to only one vector in one pixel block
Figure BDA0002656062430000066
As can be seen from the above example, there are 3 vectors in a pixel block, and a standard image includes 9 pixel blocks. Therefore, a standard image corresponds to a set of 27 integers.

步骤S103:将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。Step S103: Use the set as the data storage form of the standard image to store in an image database that follows the data storage form, so as to check whether there are similar pixel blocks or images through integer comparison.

需要说明的是,将图像提炼出特征,并以整数表示,来进行存储和比对,与直接存储图像或特征向量相比,所占内存将大大减少,计算速度也将大大提高。It should be noted that extracting features from images and expressing them as integers for storage and comparison will greatly reduce the memory occupied and the calculation speed compared with directly storing images or feature vectors.

于本实施例中,所述图像数据库中存储海量图像也是整数集合的存储形式,因此,通过整数与整数之间的比对即可实现相似图像的判断。In this embodiment, the massive images stored in the image database are also in the storage form of integer sets. Therefore, similar images can be judged by comparing integers with integers.

于本申请实施例中,本步骤S103具体包括:In this embodiment of the present application, this step S103 specifically includes:

A、针对包含8个数值区段的整数设置比对线,以令所述整数中在所述比对线右边的一或多个高位数值区段的数值与所述图像数据库中各整数对应的一或多个高位数值区段的数值进行比对;A. A comparison line is set for an integer including 8 value segments, so that the value of one or more high-order value segments on the right side of the comparison line in the integer corresponds to the number corresponding to each integer in the image database Compare the values of one or more high-value segments;

需要强调的是,进一步地,本申请中已转为表征图像特征的整数,由于针对应向量的二进制矩阵中,是按照低位到高位的顺序排列的,因此,可直接将整数与整数的高位进行相比。因为,若按本申请所述方法转换得到的整数,若32个高位相同,则这个整数对应的16维向量的高2位一定相同,低位可以作为允许用户添加文字,logo等噪音。It should be emphasized that, further, in this application, the integers that characterize the image features have been converted. Since the binary matrix for the corresponding vector is arranged in the order from the low order to the high order, the integer and the high order of the integer can be directly carried out. compared to. Because, if the 32 high-order bits of the integer converted by the method described in this application are the same, then the high-order 2 bits of the 16-dimensional vector corresponding to this integer must be the same, and the low-order bits can be used as noises that allow users to add text and logos.

故本申请根据按照低位到高位的顺序排列的特点,针对包含8个数值区段的整数设置比对线,令部分整数进行比对,如在整数中靠后的若干个数值区段来进行比对。Therefore, according to the characteristics of arranging in the order of low order to high order, the present application sets up a comparison line for an integer including 8 numerical segments, and makes some integers to be compared, such as several numerical segments in the rear of the integer. right.

另外,所述比对线可根据比对情况或场景需求进行调节,以供调整比对精确度。In addition, the comparison line can be adjusted according to the comparison situation or scene requirements, so as to adjust the comparison accuracy.

举例来说,通过将比对线设置在第2个数值区或第3个数值区段后来进行比对,便能达到预期的比对精确度。For example, the desired alignment accuracy can be achieved by setting the alignment line in the 2nd value field or the 3rd value block and then performing the alignment.

B、若比对存在相同,则判定该整数相近;B. If the comparison is the same, it is determined that the integers are similar;

C、若对应所述像素块的3个整数中至少2个整数的对比判定为相同,则判定所述图像数据库中存在与所述像素块相似的像素块。C. If at least two integers among the three integers corresponding to the pixel block are determined to be the same by comparison, it is determined that a pixel block similar to the pixel block exists in the image database.

D、若对应所述标准图像的3N个整数中至少m个整数的对比判定为相同,则判定所述图像数据库中存在与所述标准图像相似的图像。D. If at least m integers among the 3N integers corresponding to the standard image are determined to be the same by comparison, it is determined that there is an image similar to the standard image in the image database.

举例来说,假设27个整数全部相同,那么可判断为相同图像;若属于一像素块的一或多条整数相同,也可判断该像素块存在相似或相同的像素块。需说明的是,像素块表示一个图像中的部分(如九分之一的区域),在这部分中可能存在一完整图案或部分图案,那么针对图像中局部或细微的图案,也可实现比对,以供判断图像中这一图案是否存在抄袭或侵权的可能。For example, assuming that all 27 integers are the same, it can be determined as the same image; if one or more integers belonging to a pixel block are the same, it can also be determined that there are similar or identical pixel blocks in the pixel block. It should be noted that a pixel block represents a part of an image (such as one-ninth of the area), and there may be a complete pattern or partial pattern in this part, then for local or subtle patterns in the image, the ratio can also be realized. Yes, in order to judge whether the pattern in the image has the possibility of plagiarism or infringement.

在实际应用本方法的场景中,27个整数中存在4个以上整数相近,那么可判断为非常相似或相同的图像了,即可找到图像数据库中与标准图像高相似或相同的图像。因此,本申请通过整数的对比来判断相似或相同的图像,大大减少了处理速度。In the actual application of this method, if there are more than 4 integers in the 27 integers that are similar, it can be judged as very similar or identical images, and images that are highly similar or identical to standard images in the image database can be found. Therefore, the present application judges similar or identical images through the comparison of integers, which greatly reduces the processing speed.

综上所述,本申请提出的一种特征值整数化的图像存储与比对方法、装置、设备和介质,通过将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。本申请将图片的特征值转化为整数形式,以便于存储和比对,大大节省了对比处理速度和存储所需内存。To sum up, a method, device, device and medium for image storage and comparison with eigenvalue integerization proposed in this application, by scaling the acquired original image into a standard image of x×y pixel size, and dividing it into N pixel blocks; wherein, each pixel block has three (x×y)/N-dimensional vectors corresponding to the three RGB channels respectively; let the three (x×y)/N-dimensional vectors in each pixel block decrease respectively The dimensions are merged into integers to obtain a set of 3N integers corresponding to the standard image; the set is used as the data storage form of the standard image to be stored in an image database that follows the data storage form for comparison by integers Check if there are similar pixel blocks or images. The present application converts the feature values of the pictures into integer form for easy storage and comparison, which greatly saves the comparison processing speed and the memory required for storage.

如图3所示,展示为本申请于一实施例中的特征值整数化的图像存储与比对装置的模块示意图。如图所示,所述装置300包括:As shown in FIG. 3 , it is a block diagram of an image storage and comparison apparatus for eigenvalue integerization according to an embodiment of the present application. As shown, the apparatus 300 includes:

缩放分割模块301,用于将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;The scaling and dividing module 301 is used to scale the obtained original image into a standard image of x×y pixel size, and divide it into N pixel blocks; wherein, each pixel block has three (x×y) corresponding RGB three channels respectively. )/N-dimensional vector;

整数转化模块302,用于令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;Integer conversion module 302, for making three (x×y)/N-dimensional vectors in each pixel block to be dimension-reduced and reorganized into integers to obtain a set of 3N integers corresponding to the standard image;

存储比对模块303,用于将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。The storage comparison module 303 is configured to use the set as a data storage form of the standard image to store in an image database conforming to the data storage form, so as to check whether there are similar pixel blocks or images through integer comparison.

需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请所述方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information exchange, execution process, etc. among the modules/units of the above-mentioned device are based on the same concept as the method embodiments described in the present application, and the technical effects brought by them are the same as those of the method embodiments of the present application. For the content, reference may be made to the descriptions in the method embodiments shown in the foregoing application, and details are not repeated here.

还需要说明的是,应理解以上装置的各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些单元可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块通过处理元件调用软件的形式实现,部分模块通过硬件的形式实现。例如,存储比对模块303可以为单独设立的处理元件,也可以集成在上述系统的某一个芯片中实现,此外,也可以以程序代码的形式存储于上述系统的存储器中,由上述装置的某一个处理元件调用并执行以上存储比对模块303的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should also be noted that it should be understood that the division of each module of the above apparatus is only a division of logical functions, and may be fully or partially integrated into a physical entity during actual implementation, or may be physically separated. And these units can all be implemented in the form of software calling through processing elements; they can also all be implemented in hardware; some modules can also be implemented in the form of calling software through processing elements, and some modules can be implemented in hardware. For example, the storage and comparison module 303 may be a separately established processing element, or may be integrated into a certain chip of the above-mentioned system to realize, in addition, it may also be stored in the memory of the above-mentioned system in the form of program code, and it can be stored by a certain of the above-mentioned device. A processing element invokes and executes the above functions of the storage comparison module 303 . The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, and can also be implemented independently. The processing element described here may be an integrated circuit with signal processing capability. In the implementation process, each step of the above-mentioned method or each of the above-mentioned modules can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.

例如,以上这些模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,简称ASIC),或,一个或多个微处理器(digital signal processor,简称DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,简称FPGA)等。再如,当以上某个模块通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,简称CPU)或其它可以调用程序代码的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,简称SOC)的形式实现。For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), or one or more microprocessors ( digital signal processor, referred to as DSP), or, one or more Field Programmable Gate Array (Field Programmable Gate Array, referred to as FPGA) and the like. For another example, when one of the above modules is implemented in the form of processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU for short) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC for short).

如图4所示,展示为本申请于一实施例中的计算机设备的结构示意图。如图所示,所述计算机设备400包括:存储器401、及处理器402;所述存储器401用于存储计算机指令;所述处理器402运行计算机指令实现如图1所述的方法。As shown in FIG. 4 , a schematic structural diagram of a computer device in an embodiment of the present application is shown. As shown in the figure, the computer device 400 includes: a memory 401 and a processor 402; the memory 401 is used to store computer instructions; the processor 402 executes the computer instructions to implement the method described in FIG. 1 .

在一些实施例中,所述计算机设备400中的所述存储器401的数量均可以是一或多个,所述处理器402的数量均可以是一或多个,而图4中均以一个为例。In some embodiments, the number of the memory 401 in the computer device 400 may be one or more, the number of the processor 402 may be one or more, and in FIG. example.

于本申请一实施例中,所述计算机设备400中的处理器402会按照如图1所述的步骤,将一个或多个以应用程序的进程对应的指令加载到存储器401中,并由处理器402来运行存储在存储器401中的应用程序,从而实现如图1所述的方法。In an embodiment of the present application, the processor 402 in the computer device 400 loads one or more instructions corresponding to the process of the application program into the memory 401 according to the steps shown in FIG. The controller 402 is used to run the application program stored in the memory 401, thereby implementing the method described in FIG. 1 .

所述存储器401可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。所述存储器401存储有操作系统和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。操作系统可包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。The memory 401 may include random access memory (Random Access Memory, RAM for short), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 401 stores operating systems and operation instructions, executable modules or data structures, or their subsets, or their extended sets, wherein the operation instructions may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks.

所述处理器402可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application SpecificIntegrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The processor 402 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP for short) ), Application Specific Integrated Circuit (ASIC for short), Field-Programmable Gate Array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

在一些具体的应用中,所述计算机设备400的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清除说明起见,在图4中将各种总线都成为总线系统。In some specific applications, various components of the computer device 400 are coupled together through a bus system, where the bus system may include a power bus, a control bus, a status signal bus, and the like in addition to a data bus. However, for the sake of clarity of illustration, the various buses are referred to as bus systems in FIG. 4 .

于本申请的一实施例中,本申请提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如图1所述的方法。In an embodiment of the present application, the present application provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the method described in FIG. 1 .

在任何可能的技术细节结合层面,本申请可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本申请的各个方面的计算机可读程序指令。At any possible level of incorporation of technical details, the present application may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present application.

计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.

这里所描述的计算机可读程序可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable programs described herein can be downloaded to various computing/processing devices from computer-readable storage media, or to external computers or external storage devices over a network, eg, the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .

用于执行本申请操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、集成电路配置数据或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本申请的各个方面。Computer program instructions for carrying out the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or in one or more source or object code written in any combination of programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present application.

综上所述,本申请提供的一种特征值整数化的图像存储与比对方法、装置、设备和介质,通过将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。To sum up, a method, device, device and medium for image storage and comparison with integer eigenvalues provided by the present application, by scaling the acquired original image into a standard image of x×y pixel size, and dividing it into N pixel blocks; wherein, each pixel block has three (x×y)/N-dimensional vectors corresponding to the three RGB channels respectively; let the three (x×y)/N-dimensional vectors in each pixel block decrease respectively The dimensions are merged into integers to obtain a set of 3N integers corresponding to the standard image; the set is used as the data storage form of the standard image to be stored in an image database that follows the data storage form for comparison by integers Check if there are similar pixel blocks or images.

本申请有效克服了现有技术中的种种缺点而具高度产业利用价值。The present application effectively overcomes various shortcomings in the prior art and has high industrial application value.

上述实施例仅例示性说明本申请的原理及其功效,而非用于限制本发明。任何熟悉此技术的人士皆可在不违背本申请的精神及范畴下,对上述实施例进行修饰或改变。因此,举凡所属技术领域中包含通常知识者在未脱离本发明所揭示的精神与技术思想下所完成的一切等效修饰或改变,仍应由本申请的权利要求所涵盖。The above-mentioned embodiments merely illustrate the principles and effects of the present application, but are not intended to limit the present invention. Anyone skilled in the art can make modifications or changes to the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical idea disclosed in the present invention should still be covered by the claims of the present application.

Claims (10)

1.一种特征值整数化的图像存储与比对方法,其特征在于,所述方法包括:1. an image storage and comparison method of eigenvalue integerization, is characterized in that, described method comprises: 将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;The obtained original image is scaled to a standard image of x×y pixel size, and divided into N pixel blocks; wherein, each pixel block has three (x×y)/N-dimensional vectors corresponding to three RGB channels respectively; 令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;Let the three (x×y)/N-dimensional vectors in each pixel block be dimension-reduced and reorganized into integers to obtain a set of 3N integers corresponding to the standard image; 将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。The set is used as the data storage form of the standard image to be stored in an image database conforming to the data storage form, so as to check whether there are similar pixel blocks or images through integer comparison. 2.根据权利要求1所述的方法,其特征在于,所述将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块,包括:2. The method according to claim 1, characterized in that, scaling the acquired original image to a standard image of x×y pixel size and dividing it into N pixel blocks, comprising: 将原始图像的RGBA四通道删减为RGB三通道,并缩放为x×y像素大小的标准图像;Reduce the RGBA four-channel of the original image to RGB three-channel, and scale it to a standard image of x×y pixel size; 将所述标准图像按N宫格进行分割以得到N个像素块。The standard image is divided into N grids to obtain N pixel blocks. 3.根据权利要求2所述的方法,其特征在于,所述缩放过程通过计算像素块内每个通道的均值方法以消除原始图像的失真。3. The method according to claim 2, wherein the scaling process eliminates the distortion of the original image by calculating the mean value of each channel in the pixel block. 4.根据权利要求1所述的方法,其特征在于,所述令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合,包括:4 . The method according to claim 1 , wherein the three (x×y)/N-dimensional vectors in each pixel block are dimension-reduced and reorganized into integers to obtain the corresponding standard image. 5 . A set of 3N integers, including: 将各所述向量中每个维度的像素值转化为8位二进制数,以得到对应每个向量的8×(x×y)/N的二进制数矩阵;Converting the pixel value of each dimension in each of the vectors into 8-bit binary numbers to obtain a 8×(x×y)/N binary number matrix corresponding to each vector; 将所述二进制数矩阵根据低位到高位的排列方式重新排列组合,以降维重组为一整数;Rearranging and combining the binary number matrix according to the arrangement of the low order to the high order, and reorganizing it into an integer in order to reduce the dimension; 汇集所述标准图像的全部像素块所对应的整数,以得到对应所述标准图像的3N个整数的集合。The integers corresponding to all pixel blocks of the standard image are collected to obtain a set of 3N integers corresponding to the standard image. 5.根据权利要求4所述的方法,其特征在于,所述将所述二进制数矩阵根据低位到高位的排列方式以降维重组为一整数,包括:5. The method according to claim 4, wherein the binary number matrix is reorganized into an integer according to the arrangement of low order to high order with dimension reduction, comprising: 所述二进制数矩阵中,每行对应每个维度的8位二进制数,且每个维度的位由左到右依次对应为由低到高;每列对应每个维度中属于相同位的二进制数;In the binary number matrix, each row corresponds to an 8-bit binary number of each dimension, and the bits of each dimension correspond from left to right in order from low to high; each column corresponds to the binary numbers belonging to the same bit in each dimension. ; 将每个维度中属于相同位的二进制数组合为对应该位的数值区段;Combine binary numbers that belong to the same bit in each dimension into a numerical segment corresponding to that bit; 根据各所述数值区段按照对应的位,按由低位到高位依次排列,以重新组合得到对应一向量的包含8个数值区段的整数。According to the corresponding bits, the numerical segments are arranged in order from low to high, so as to recombine to obtain an integer corresponding to a vector including 8 numerical segments. 6.根据权利要求5所述的方法,其特征在于,所述通过整数比对断是否存在相似的像素块或图像,包括:6. The method according to claim 5, characterized in that, determining whether there are similar pixel blocks or images through integer comparison, comprising: 针对包含8个数值区段的整数设置比对线,以令所述整数中在所述比对线右边的一或多个高位数值区段的数值与所述图像数据库中各整数对应的一或多个高位数值区段的数值进行比对;An alignment line is set for an integer including 8 value segments, so that the value of one or more high-order numeric segments to the right of the alignment line in the integer is one or more corresponding to each integer in the image database. Compare the values of multiple high-value segments; 若比对存在相同,则判定该整数相近;If the comparisons are identical, the integers are determined to be similar; 若对应所述像素块的3个整数中至少2个整数的对比判定为相同,则判定所述图像数据库中存在与所述像素块相似的像素块;If the comparison of at least 2 integers among the 3 integers corresponding to the pixel block is determined to be the same, then it is determined that a pixel block similar to the pixel block exists in the image database; 若对应所述标准图像的3N个整数中至少m个整数的对比判定为相同,则判定所述图像数据库中存在与所述标准图像相似的图像。If at least m integers among the 3N integers corresponding to the standard image are determined to be the same by comparison, it is determined that an image similar to the standard image exists in the image database. 7.根据权利要求6所述的方法,其特征在于,所述比对线可根据比对情况或场景需求进行调节,以供调整比对精确度。7 . The method according to claim 6 , wherein the comparison line can be adjusted according to the comparison situation or scene requirements, so as to adjust the comparison accuracy. 8 . 8.一种特征值整数化的图像存储与比对装置,其特征在于,所述装置包括:8. A device for storing and comparing images with integer eigenvalues, wherein the device comprises: 缩放分割模块,用于将获取的原始图像缩放为x×y像素大小的标准图像,并分割为N个像素块;其中,每个像素块具有分别对应RGB三通道的三个(x×y)/N维的向量;The scaling and segmentation module is used to scale the obtained original image into a standard image of x×y pixel size, and divide it into N pixel blocks; each pixel block has three (x×y) corresponding RGB three channels respectively. /N-dimensional vector; 整数转化模块,用于令每个像素块中三个(x×y)/N维的向量分别降维并重组为整数,以得到对应所述标准图像的3N个整数的集合;Integer conversion module, for making three (x×y)/N-dimensional vectors in each pixel block to be reduced in dimension and reorganized into integers respectively, so as to obtain a set of 3N integers corresponding to the standard image; 存储比对模块,用于将该集合作为所述标准图像的数据存储形式以存入遵循该数据存储形式的图像数据库,以供通过整数比对断是否存在相似的像素块或图像。The storage and comparison module is used for using the set as the data storage form of the standard image to store in the image database conforming to the data storage form, so as to check whether there are similar pixel blocks or images through integer comparison. 9.一种计算机设备,其特征在于,所述设备包括:存储器、及处理器;所述存储器用于存储计算机指令;所述处理器运行计算机指令实现如权利要求1至7中任意一项所述的方法。9. A computer device, characterized in that, the device comprises: a memory and a processor; the memory is used to store computer instructions; the processor executes the computer instructions to implement any one of claims 1 to 7. method described. 10.一种计算机可读存储介质,其特征在于,存储有计算机指令,所述计算机指令被运行时执行如权利要求1至7中任一项所述的方法。10. A computer-readable storage medium, characterized by storing computer instructions that, when executed, perform the method of any one of claims 1 to 7.
CN202010887737.5A 2020-08-28 Image storage and comparison method, device, equipment and medium for eigenvalue integerization CN111986089B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010887737.5A CN111986089B (en) 2020-08-28 Image storage and comparison method, device, equipment and medium for eigenvalue integerization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010887737.5A CN111986089B (en) 2020-08-28 Image storage and comparison method, device, equipment and medium for eigenvalue integerization

Publications (2)

Publication Number Publication Date
CN111986089A true CN111986089A (en) 2020-11-24
CN111986089B CN111986089B (en) 2025-02-11

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114493983A (en) * 2021-12-06 2022-05-13 深圳市乐升半导体有限公司 Character data compression method, device, storage medium and electronic device

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658219A (en) * 2004-02-18 2005-08-24 富士施乐株式会社 Image processing apparatus
CN103714122A (en) * 2013-12-06 2014-04-09 安徽大学 Image retrieval method based on local block binary coding characteristics
CN104715449A (en) * 2015-03-31 2015-06-17 百度在线网络技术(北京)有限公司 Method and device for generating mosaic image
CN104794189A (en) * 2015-04-16 2015-07-22 惠州Tcl移动通信有限公司 Image screening method and system
US20160092445A1 (en) * 2013-05-16 2016-03-31 Beijing Jingdong Shangke Information Technology Co., Ltd. Image provision method, server device, and terminal device
CN106997366A (en) * 2016-01-26 2017-08-01 视辰信息科技(上海)有限公司 Database construction method, augmented reality fusion method for tracing and terminal device
US20180081877A1 (en) * 2015-03-31 2018-03-22 Channelsight Limited Method and system for product recognition
CN109214428A (en) * 2018-08-13 2019-01-15 平安科技(深圳)有限公司 Image partition method, device, computer equipment and computer storage medium
CN109344276A (en) * 2018-08-27 2019-02-15 广州企图腾科技有限公司 A kind of finger image generation method, image similarity comparative approach and storage medium
CN109902190A (en) * 2019-03-04 2019-06-18 京东方科技集团股份有限公司 Image encrypting algorithm optimization method, search method, device, system and medium
CN110348353A (en) * 2019-06-28 2019-10-18 广东奥园奥买家电子商务有限公司 A kind of image processing method and device
CN111161140A (en) * 2018-11-08 2020-05-15 银河水滴科技(北京)有限公司 Method and device for correcting distorted image

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658219A (en) * 2004-02-18 2005-08-24 富士施乐株式会社 Image processing apparatus
US20160092445A1 (en) * 2013-05-16 2016-03-31 Beijing Jingdong Shangke Information Technology Co., Ltd. Image provision method, server device, and terminal device
CN103714122A (en) * 2013-12-06 2014-04-09 安徽大学 Image retrieval method based on local block binary coding characteristics
CN104715449A (en) * 2015-03-31 2015-06-17 百度在线网络技术(北京)有限公司 Method and device for generating mosaic image
US20180081877A1 (en) * 2015-03-31 2018-03-22 Channelsight Limited Method and system for product recognition
CN104794189A (en) * 2015-04-16 2015-07-22 惠州Tcl移动通信有限公司 Image screening method and system
CN106997366A (en) * 2016-01-26 2017-08-01 视辰信息科技(上海)有限公司 Database construction method, augmented reality fusion method for tracing and terminal device
CN109214428A (en) * 2018-08-13 2019-01-15 平安科技(深圳)有限公司 Image partition method, device, computer equipment and computer storage medium
CN109344276A (en) * 2018-08-27 2019-02-15 广州企图腾科技有限公司 A kind of finger image generation method, image similarity comparative approach and storage medium
CN111161140A (en) * 2018-11-08 2020-05-15 银河水滴科技(北京)有限公司 Method and device for correcting distorted image
CN109902190A (en) * 2019-03-04 2019-06-18 京东方科技集团股份有限公司 Image encrypting algorithm optimization method, search method, device, system and medium
CN110348353A (en) * 2019-06-28 2019-10-18 广东奥园奥买家电子商务有限公司 A kind of image processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘鹏等: "《人工智能应用技术基础》", 西安电子科技大学出版社, pages: 83 - 84 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114493983A (en) * 2021-12-06 2022-05-13 深圳市乐升半导体有限公司 Character data compression method, device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN112422972B (en) Method and decompression unit for decompressing compressed blocks of image data
WO2022166258A1 (en) Behavior recognition method and apparatus, terminal device, and computer-readable storage medium
CN112419477B (en) A facial image style conversion method, device, storage medium and electronic equipment
US11620039B2 (en) Performant configuration user interface
CN113570030A (en) Data processing method, device, equipment and storage medium
US11636665B2 (en) Streaming image semantic segmentation method, logical integrated circuit system and electronic device
CN116227209A (en) Multi-dimensional linear difference method for point cloud data, terminal equipment and storage medium
CN111986089A (en) Image storage and comparison method, device, equipment and medium with characteristic value being integer
US20240104822A1 (en) Multicore system for neural rendering
CN116433451A (en) Watermark Removal Method Based on Global Context Attention Gates to Optimize Watermark Decomposition Network
CN115797687A (en) Image recognition model training method and device, computer equipment and storage medium
CN113643191B (en) Smoothing method and device for voxel model and electronic equipment
CN115081542A (en) Subspace clustering method, terminal device and computer-readable storage medium
CN109408028B (en) Floating point number operation method and device and storage medium
CN113487624B (en) Human body instance segmentation method, terminal equipment and storage medium
CN111986083A (en) Method and device for automatically combining images
CN111986277A (en) Image local comparison method, device, equipment and medium based on gray value
CN113542808B (en) Video processing method, apparatus, device and computer readable medium
CN113393401B (en) Object detection hardware accelerator, system, method, device and medium
CN114241378B (en) Method, device, electronic device, and storage medium for generating transition video
US20240111840A1 (en) Selecting a Tiling Scheme for Processing Instances of Input Data Through a Neural Netwok
CN116258672B (en) Medical image segmentation methods, systems, storage media and electronic equipment
CN117808857B (en) A self-supervised 360° depth estimation method, device, equipment and medium
TWI775084B (en) Image recognition method, device, computer device and storage media
CN113379595B (en) Page picture synthesis method and device

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