Image storage and comparison method, device, equipment and medium for eigenvalue integerization

By scaling and dividing the original image into multiple pixel blocks, reducing the dimensions and recombining it into an integer set for storage and comparison, the problems of slow image comparison and large storage occupancy are solved, and efficient image comparison is achieved.

CN111986089BActive Publication Date: 2025-02-11JIYI DATA TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010887737.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-28
Publication Date
2025-02-11
Estimated Expiration
2040-08-28

AI Technical Summary

Technical Problem

In the traditional image comparison process, it is necessary to compare the comparison images with the images in the database one by one, resulting in slow comparison speed and difficulty in finding local or subtle plagiarism patterns. At the same time, the image data stored in the database occupies a huge amount of money.

Method used

By scaling the original image into a standard image and dividing it into multiple pixel blocks, the RGB three-channel vector of each pixel block is dimensionalized and reorganized into integers, forming a set of integers for storage and comparison.

Benefits of technology

It greatly saves the required memory for comparison processing speed and storage, improves the comparison efficiency, and allows to discover similar pixel blocks or images more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111986089B_ABST
    Figure CN111986089B_ABST
Patent Text Reader

Abstract

The present application provides an image storage and comparison method, device, equipment and medium with integerized eigenvalues, by scaling the acquired original image to 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; the three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers respectively 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 determine whether there are similar pixel blocks or images by integer comparison. The present application converts the eigenvalues ​​of the image into integer form for easy storage and comparison, which greatly saves the comparison processing speed and the memory required for storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and medium for storing and comparing images with integerized eigenvalues. Background Art

[0002] Currently, more and more scenarios require image comparison, such as the identification of plagiarized or copied patterns. As the plagiarism of images or patterns becomes more and more covert, it is often necessary to perform partial comparisons on the color, shape, etc. of the patterns in the images.

[0003] The traditional image comparison process requires comparing the image to be compared with the images in the database one by one, such as using the feature vectors extracted from the image for comparison. However, an image contains a large number of feature vectors or pixel memories, which results in a large number of comparisons and a very slow comparison speed. In addition, local or subtle plagiarized patterns are often not discovered. In addition, the data occupied by storing images in the image database is also very large. Summary of the invention

[0004] 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, device, equipment and medium with integerized eigenvalues ​​to solve at least one problem existing in the prior art.

[0005] To achieve the above-mentioned purpose and other related purposes, the present application provides an image storage and comparison method with integerized eigenvalues, the method comprising: scaling the acquired original image to 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; reducing the dimensions of the three (x×y) / N-dimensional vectors in each pixel block respectively and reorganizing them into integers to obtain a set of 3N integers corresponding to the standard image; storing the set as the data storage form of the standard image in an image database that complies with the data storage form, so as to determine whether there are similar pixel blocks or images through integer comparison.

[0006] In one embodiment of the present application, the acquired original image is scaled into a standard image of x×y pixel size and divided into N pixel blocks, including: reducing the RGBA four channels of the original image to RGB three channels, and scaling it to a standard image of x×y pixel size; dividing the standard image into N grids to obtain N pixel blocks.

[0007] In one embodiment of the present application, the scaling process eliminates the distortion of the original image by calculating the mean value of each channel in the pixel block.

[0008] In one embodiment of the present application, the three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers 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 an 8-bit binary number to obtain an 8×(x×y) / N binary number matrix corresponding to each vector; rearranging and combining the binary number matrix according to an arrangement from low to high bits to reduce the dimension and reorganize it into an integer; and collecting the integers corresponding to all pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image.

[0009] In one embodiment of the present application, the binary number matrix is ​​reorganized into an integer by dimensionality reduction according to the arrangement from low to high, including: 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 low to high from left to right; each column corresponds to the binary numbers belonging to the same bit in each dimension; the binary numbers belonging to the same bit in each dimension are combined into numerical segments corresponding to the bit; according to the corresponding bits of each numerical segment, they are arranged in sequence from low to high to recombining to obtain an integer containing 8 numerical segments corresponding to a vector.

[0010] In one embodiment of the present application, the method of determining whether there are similar pixel blocks or images by integer comparison includes: setting a comparison line for an integer including 8 numerical segments, so that the values ​​of one or more high-order numerical segments on the right side of the comparison line in the integer are compared with the values ​​of one or more high-order numerical segments corresponding to each integer in the image database; if the comparison shows the same, the integers are determined to be similar; if at least 2 integers out of the 3 integers corresponding to the pixel block are determined to be the same after comparison, it is determined that there is a pixel block similar to the pixel block in the image database; if at least m integers out of the 3N integers corresponding to the standard image are determined to be the same after comparison, it is determined that there is an image similar to the standard image in the image database.

[0011] In one embodiment of the present application, the comparison line can be adjusted according to the comparison situation or scene requirements to adjust the comparison accuracy.

[0012] To achieve the above-mentioned purpose and other related purposes, the present application provides an image storage and comparison device with integerized eigenvalues, the device comprising: the device comprising: a scaling and segmentation module, used to scale the acquired original image to a standard image of x×y pixel size, and segment it into N pixel blocks; wherein each pixel block has three (x×y) / N-dimensional vectors corresponding to the three RGB channels respectively; an integer conversion module, used to reduce the dimensions of the three (x×y) / N-dimensional vectors in each pixel block and reorganize them into integers, so as to obtain a set of 3N integers corresponding to the standard image; a storage and comparison module, used to store the set as the data storage form of the standard image in an image database that follows the data storage form, so as to determine whether there are similar pixel blocks or images through integer comparison.

[0013] To achieve the above-mentioned purpose and other related purposes, the present application provides a computer device, which includes: a memory and a processor; the memory is used to store computer instructions; the processor executes the computer instructions to implement the above-mentioned method.

[0014] To achieve the above-mentioned purpose and other related purposes, the present application provides a computer-readable storage medium storing computer instructions, which execute the above-mentioned method when executed.

[0015] In summary, the present application provides an image storage and comparison method, device, equipment and medium with integerized eigenvalues, which scales the acquired original image to a standard image of x×y pixel size and divides it into N pixel blocks; wherein each pixel block has three (x×y) / N-dimensional vectors corresponding to the three RGB channels respectively; the three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension 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 determine whether there are similar pixel blocks or images through integer comparison.

[0016] It has the following beneficial effects:

[0017] This application converts the feature values ​​of the image into integer form for easy storage and comparison, which greatly saves the comparison processing speed and the memory required for storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 Shown is a flowchart of an image storage and comparison method for integerizing feature values ​​in an embodiment of the present application.

[0019] Figure 2 Shown is a schematic diagram of a scenario corresponding to step S101 in an embodiment of the present application.

[0020] Figure 3 Shown is a module diagram of an image storage and comparison device for integerizing feature values ​​in one embodiment of the present application.

[0021] Figure 4 Shown is a schematic diagram of the structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0022] The following describes the embodiments of the present application through 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 the details in this specification can also be modified or changed in various ways 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 can be combined with each other without conflict.

[0023] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. Although the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation, the type, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout may also be more complicated.

[0024] 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" by placing other elements therebetween. In addition, when a part is said to "include" a certain constituent element, unless otherwise stated, it does not exclude other constituent elements, but means that other constituent elements may be included.

[0025] The terms first, second and third are used to describe various parts, components, regions, layers and / or segments, but are not limited thereto. These terms are only used to distinguish a certain part, component, region, layer or segment from other parts, components, regions, layers or segments. Therefore, the first part, component, region, layer or segment described below may refer to the second part, component, region, layer or segment within the scope of this application.

[0026] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless there is an indication to the contrary in the context. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "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 will only occur when the combination of elements, functions or operations is inherently mutually exclusive in some way.

[0027] The traditional image comparison process requires comparing the image to be compared with the images in the database one by one, such as using the feature vectors extracted from the image for comparison. However, an image contains a large number of feature vectors or pixel memories, which results in a large number of comparisons and a very slow comparison speed. In addition, local or subtle plagiarized patterns are often not discovered. In addition, the data occupied by storing images in the image database is also very large.

[0028] To solve the above problems, the present application proposes an image storage and comparison method, device, equipment and medium with integerized eigenvalues, which convert the eigenvalues ​​of the image into integer form for easy storage and comparison, greatly saving the comparison speed and the memory required for storage.

[0029] like Figure 1 FIG. 1 is a flow chart of an image storage and comparison method for integerizing feature values ​​in an embodiment of the present application. As shown in the figure, the method includes:

[0030] Step S101: scaling the acquired original image to 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.

[0031] In one embodiment of the present application, scaling the acquired original image to a standard image of x×y pixel size and dividing it into N pixel blocks includes:

[0032] A. 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;

[0033] In this embodiment, usually an original image has four channels, RGBA, which represent the color space of Red, Green, Blue and Alpha respectively, but it is actually just an RGB model with 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 effect in the image comparison process to reduce the number of channels, thereby reducing the data used for comparison.

[0034] In addition, usually the pixel size of an original image is different, and often has a larger pixel size, such as 4032×3024, 2048×1024, etc. In order to facilitate the conversion of the image into an integer and the subsequent storage and comparison in this application, this application uniformly scales the original image to a smaller or extremely small uniform pixel size, such as a 12×12 pixel size, to unify it as a standard image, which can be referred to Figure 2 The scaling method of the present application can adopt some common scaling methods in the field of image processing technology.

[0035] In this embodiment, since the image may be distorted during the scaling process, the present application eliminates the distortion of the original image by calculating the mean value of each channel in the pixel block during the scaling process. For example, a weight is assigned to each pixel point, and normalization is performed to eliminate the distortion by a numerical difference method.

[0036] It should be noted that the process of eliminating distortion in this method can also use common methods for processing image distortion. In addition, the effect of processing image distortion here does not require extremely high standards, because the purpose of this application to perform a series of processing around the image is for image comparison, such as comparing the color or shape of a certain area of ​​the pattern, rather than for use or appreciation. As long as the feature information corresponding to the pattern in the area does not change significantly, the impact on the image comparison is small. Therefore, the requirements for image distortion processing are not too high.

[0037] B. Divide the standard image into N grids to obtain N pixel blocks.

[0038] For example, if Figure 2 As shown, it is a schematic diagram of the scene from the original image to the pixel block. After the original image is scaled to a standard image of 12×12 pixels, it is segmented according to the nine-square grid framework to obtain 9 pixel blocks of 4×4 pixels. Correspondingly, each pixel block has three 16-dimensional ((12×12) / 9=4×4) vectors corresponding to the three RGB channels: The specific vectors are as follows:

[0039]

[0040]

[0041]

[0042] It should be noted that the N-grids used to segment the standard image in the present application are not limited to the centrosymmetric four-grids, nine-grids, sixteen-grids, etc., but may also include non-centrosymmetric multi-grids such as six-grids, eight-grids, twelve-grids, etc. In addition, each pixel block segmented by the N-grids is preferably a square or a rectangle.

[0043] Step S102: reduce the dimensions of the three (x×y) / N-dimensional vectors in each pixel block and reorganize them into integers to obtain a set of 3N integers corresponding to the standard image.

[0044] In one embodiment of the present application, the three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers to obtain a set of 3N integers corresponding to the standard image, including:

[0045] A. Convert the pixel value of each dimension in each of the vectors into an 8-bit binary number to obtain a binary number matrix of 8×(x×y) / N corresponding to each vector.

[0046] For example, the vector The pixel value of the first dimension R1 is converted to 8 binary numbers as follows:

[0047] R1={r 11 ,r 12 ,…,r 18};

[0048] It should be noted that the pixel value range in each channel of the RGB three channels is (0 to 255), and its corresponding binary number is exactly 8 bits (00000000 to 11111111). Therefore, the pixel value of each dimension can be converted into an 8-bit binary number.

[0049] Furthermore, following Figure 2 Each vector in the example is 16-dimensional, so if the vector The resulting binary number matrix is ​​shown below;

[0050]

[0051] Specifically, in the binary matrix formula (1) as exemplified above, each row corresponds to an 8-bit binary number in each dimension, and the bits of each dimension correspond from low to high from left to right. For example, in the first row, r 11 Corresponding to the lowest bit, r 18Corresponds to the highest bit; each column corresponds to the binary number belonging to the same (high and low) bit in each dimension, such as r in the first column 11 、r 21 ,…,r 161 It corresponds to the binary number belonging to the same low bit in each dimension.

[0052] B. Rearrange the binary number matrix from low to high to reduce the dimension and reorganize it into an integer. Specifically including:

[0053] b1. Combine the binary numbers belonging to the same bit in each dimension into a value segment corresponding to the bit;

[0054] Usually when a matrix is ​​reduced to a row of integers, it may be naturally arranged in the horizontal numbering order, which is also the usual practice. However, the present application innovatively proposes to arrange the vertical combination according to the same bit. In the binary matrix formula (1), we get the corresponding vector The integers are as follows:

[0055] {r 11 ,r 21 ,…,r 161 |r 12 ,r 22 ,…,r 162 |…|r 18 ,r 28 ,…,r 168}; (2)

[0056] b2. Arrange the corresponding bits of each of the numerical segments in order from low bits to high bits, so as to recombine and obtain an integer corresponding to a vector containing 8 numerical segments.

[0057] Correspondingly, as in the integer formula (2) given above, r 11 to r 161 The corresponding value is the lowest bit segment; r 18 to r 168 The corresponding value segment is the highest bit. Arrange them in order from low to high bits, and you will get the corresponding vector The integer is the integer formula (2) as exemplified above, wherein the integer includes integers of 8 numerical ranges.

[0058] C. Gathering integers corresponding to all pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image.

[0059] For example, the integer formula (2) as given above actually only corresponds to one vector in one pixel block. As can be seen from the above example, there are 3 vectors in a pixel block, and a standard image contains 9 pixel blocks. Therefore, a standard image corresponds to a set of 27 integers.

[0060] Step S103: The set is used as the data storage format of the standard image and stored in an image database that complies with the data storage format, so as to determine whether there are similar pixel blocks or images through integer comparison.

[0061] It should be noted that extracting features from images and representing them as integers for storage and comparison will greatly reduce the memory usage and greatly improve the calculation speed compared to directly storing images or feature vectors.

[0062] In this embodiment, the massive amount of images stored in the image database are also stored in the form of integer sets, so similar images can be judged by comparing integers.

[0063] In the embodiment of the present application, step S103 specifically includes:

[0064] A. setting a comparison line for an integer including eight value segments, so that the values ​​of one or more high-order value segments on the right side of the comparison line in the integer are compared with the values ​​of one or more high-order value segments corresponding to each integer in the image database;

[0065] It should be emphasized that, further, the integers that have been converted into image features in this application are arranged in order from low to high in the binary matrix of the corresponding vector, so the integers can be directly compared with the high bits of the integers. Because, if the integers converted according to the method described in this application have the same 32 high bits, then the high 2 bits of the 16-dimensional vector corresponding to this integer must be the same, and the low bits can be used to allow users to add text, logos and other noise.

[0066] Therefore, according to the characteristic of arranging in order from low to high, the present application sets a comparison line for integers containing 8 numerical segments, so that some integers are compared, such as comparing several numerical segments at the end of the integers.

[0067] In addition, the comparison line can be adjusted according to the comparison situation or scene requirements to adjust the comparison accuracy.

[0068] For example, by setting the comparison line in the second numerical area or the third numerical area and then performing the comparison, the expected comparison accuracy can be achieved.

[0069] B. If there is a same comparison, the integers are judged to be close;

[0070] C. If at least two of the three integers corresponding to the pixel block are compared and determined to be the same, it is determined that there is a pixel block similar to the pixel block in the image database.

[0071] D. If at least m integers among the 3N integers corresponding to the standard image are compared and determined to be the same, it is determined that there is an image similar to the standard image in the image database.

[0072] For example, if all 27 integers are the same, then it can be determined that the images are the same; 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 portion of an image (such as one-ninth of an area), and there may be a complete pattern or a partial pattern in this portion. Therefore, a comparison can also be performed for local or subtle patterns in the image to determine whether the pattern in the image is likely to be plagiarized or infringed.

[0073] In the actual application scenario of this method, if there are more than 4 similar integers among the 27 integers, then it can be judged as a very similar or identical image, and an image in the image database that is highly similar or identical to the standard image can be found. Therefore, this application judges similar or identical images by comparing integers, which greatly reduces the processing speed.

[0074] In summary, the present application proposes an image storage and comparison method, device, equipment and medium with integerized eigenvalues, which is achieved by scaling the acquired original image to 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; the three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension 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 determine whether there are similar pixel blocks or images by integer comparison. The present application converts the eigenvalues ​​of the image into integer form for easy storage and comparison, which greatly saves the comparison processing speed and the memory required for storage.

[0075] like Figure 3 As shown, it is a schematic diagram of a module of an image storage and comparison device for integerizing feature values ​​in one embodiment of the present application. As shown in the figure, the device 300 includes:

[0076] The scaling and segmentation module 301 is used to scale the acquired original image to a standard image of x×y pixel size and segment it into N pixel blocks; wherein each pixel block has three (x×y) / N-dimensional vectors corresponding to the three RGB channels respectively;

[0077] An integer conversion module 302 is used to reduce the dimensions of the three (x×y) / N-dimensional vectors in each pixel block and reorganize them into integers to obtain a set of 3N integers corresponding to the standard image;

[0078] The storage comparison module 303 is used to store the set as the data storage form of the standard image into an image database that complies with the data storage form, so as to determine whether there are similar pixel blocks or images through integer comparison.

[0079] It should be noted that the information interaction, execution process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment described in the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown in the previous description of the present application, and will not be repeated here.

[0080] It should also be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these units can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the storage comparison module 303 can be a separately established processing element, or it can be integrated in a chip of the above system for implementation. In addition, it can also be stored in the memory of the above system in the form of program code, and called and executed by a processing element of the above device. The function of the above storage comparison module 303. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0081] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0082] like Figure 4 As shown, it is a schematic diagram of the structure of a computer device in an embodiment of the present application. 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 following Figure 1 The method described.

[0083] In some embodiments, the number of the memory 401 in the computer device 400 can be one or more, the number of the processor 402 can be one or more, and Figure 4 Take one as an example.

[0084] In one embodiment of the present application, the processor 402 in the computer device 400 will follow the following steps: Figure 1 In the above steps, one or more instructions corresponding to the process of the application are loaded into the memory 401, and the processor 402 runs the application stored in the memory 401, thereby achieving the following Figure 1 The method described.

[0085] The memory 401 may include a random access memory (RAM), or may include a non-volatile memory, such as at least one disk memory. The memory 401 stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.

[0086] The processor 402 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0087] In some specific applications, the various components of the computer device 400 are coupled together through a bus system, wherein the bus system may include a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clarity, Figure 4 In the text, all kinds of buses are called bus systems.

[0088] In one embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following Figure 1 The method described.

[0089] At any possible level of technical detail combination, the present application may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present application.

[0090] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can 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 thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: 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), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0091] The computer-readable program described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0092] The computer program instructions for performing the operation of the present application can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of computer-readable program instructions to personalize electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLAs), the electronic circuits can execute computer-readable program instructions, thereby realizing various aspects of the present application.

[0093] In summary, the present application provides an image storage and comparison method, device, equipment and medium with integerized eigenvalues, which scales the acquired original image to a standard image of x×y pixel size and divides it into N pixel blocks; wherein each pixel block has three (x×y) / N-dimensional vectors corresponding to the three RGB channels respectively; the three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension 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 determine whether there are similar pixel blocks or images through integer comparison.

[0094] The present invention effectively overcomes various shortcomings of the prior art and has high industrial utilization value.

[0095] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present application.

Claims

1. A method for storing and comparing images with integerized eigenvalues, characterized in that: The method comprises: The acquired 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 the three RGB channels respectively; The three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers to obtain a set of 3N integers corresponding to the standard image; The three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers to obtain a set of 3N integers corresponding to the standard image, including: Convert the pixel value of each dimension in each of the vectors into an 8-bit binary number to obtain a binary number matrix of 8×(x×y) / N corresponding to each vector; rearrange and combine the binary number matrix according to the arrangement from low to high bits to reduce the dimension and reorganize it into an integer; collect the integers corresponding to all pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image; The step of reorganizing the binary number matrix into an integer by reducing the dimension according to the arrangement from low to high bits includes: 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 low to high from left to right; each column corresponds to the binary numbers belonging to the same bit in each dimension; the binary numbers belonging to the same bit in each dimension are combined into a numerical segment corresponding to the bit; according to the corresponding bits of each numerical segment, they are arranged in sequence from low to high, so as to recombine to obtain an integer containing 8 numerical segments corresponding to a vector; The set is used as the data storage form of the standard image and stored in an image database following the data storage form, so as to be used for determining whether there are similar pixel blocks or images through integer comparison.

2. The method according to claim 1, characterized in that: The obtained original image is scaled to a standard image of x×y pixel size and divided into N pixel blocks, including: The RGBA four-channel original image is reduced to RGB three-channel, and scaled to a standard image of x×y pixel size; The standard image is divided into N grids to obtain N pixel blocks.

3. The method according to claim 2, characterized in that The scaling process eliminates the distortion of the original image by calculating the mean value of each channel in the pixel block.

4. The method according to claim 1, characterized in that: The method of determining whether similar pixel blocks or images exist by integer comparison includes: A comparison line is set for an integer including eight value segments, so that the values ​​of one or more high-order value segments on the right side of the comparison line in the integer are compared with the values ​​of one or more high-order value segments corresponding to each integer in the image database; If there is a sameness in the comparison, the integers are judged to be close; If at least two of the three integers corresponding to the pixel block are compared and determined to be the same, it is determined that there is a pixel block similar to the pixel block in the image database; If at least m integers among the 3N integers corresponding to the standard image are compared and determined to be the same, it is determined that there is an image similar to the standard image in the image database.

5. The method according to claim 4, characterized in that The comparison line can be adjusted according to the comparison situation or scene requirements to adjust the comparison accuracy.

6. An image storage and comparison device with integerized eigenvalues, characterized in that: The device comprises: A scaling and segmentation module is used to scale the acquired original image to a standard image of x×y pixel size and segment it into N pixel blocks; wherein each pixel block has three (x×y) / N-dimensional vectors corresponding to the three RGB channels respectively; An integer conversion module, used for reducing the dimensions of the three (x×y) / N-dimensional vectors in each pixel block and reorganizing them into integers, so as to obtain a set of 3N integers corresponding to the standard image; The three (x×y) / N-dimensional vectors in each pixel block are reduced in dimension and reorganized into integers to obtain a set of 3N integers corresponding to the standard image, including: Convert the pixel value of each dimension in each of the vectors into an 8-bit binary number to obtain a binary number matrix of 8×(x×y) / N corresponding to each vector; rearrange and combine the binary number matrix according to the arrangement from low to high bits to reduce the dimension and reorganize it into an integer; collect the integers corresponding to all pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image; The step of reorganizing the binary number matrix into an integer by reducing the dimension according to the arrangement from low to high bits includes: 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 low to high from left to right; each column corresponds to the binary numbers belonging to the same bit in each dimension; the binary numbers belonging to the same bit in each dimension are combined into a numerical segment corresponding to the bit; according to the corresponding bits of each numerical segment, they are arranged in sequence from low to high, so as to recombine to obtain an integer containing 8 numerical segments corresponding to a vector; The storage comparison module is used to store the set as the data storage form of the standard image in an image database that complies with the data storage form, so as to determine whether there are similar pixel blocks or images through integer comparison.

7. 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 the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: Computer instructions are stored, and when the computer instructions are executed, the method according to any one of claims 1 to 5 is performed.

Citation Information

Patent Citations

  • Image retrieval method based on local block binary encoding features

    CN103714122A