Nothing Special   »   [go: up one dir, main page]

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
integer
integers
standard image
comparison
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010887737.5A
Other languages
Chinese (zh)
Inventor
马计国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN111986089A/en
Publication of CN111986089A publication Critical patent/CN111986089A/en
Pending legal-status Critical Current

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

The application provides a method, a device, equipment and a medium for storing and comparing an image with integral characteristic values, wherein an acquired original image is zoomed into a standard image with the size of x multiplied by y pixels and is divided into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels; reducing the dimensions of three (x y)/N-dimensional vectors in each pixel block respectively and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image; and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison. The method and the device convert the characteristic value of the picture into an integer form so as to be convenient for storage and comparison, and greatly save comparison processing speed and memory required by storage.

Description

Image storage and comparison method, device, equipment and medium with characteristic value being integer
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a medium for storing and comparing an integer feature value.
Background
Currently, more and more scenes require the comparison of pictures, such as the common authentication for pirate or plagiarism patterns. As the pictures or the patterns are more and more hidden, local comparison of colors, shapes and the like of the patterns in the pictures is often needed.
In the traditional picture comparison process, the image to be compared needs to be compared with the pictures in the database one by one, for example, the common characteristic vectors extracted by the pictures are used for comparison, but the characteristic vectors or pixel memories contained in one picture are too much, so that the comparison speed is very high, the comparison speed is very slow, and local or fine plagiarism patterns cannot be found; in addition, the data occupation of the stored pictures in the picture database is very large.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, it is an object of the present application to provide an image storage and comparison method, apparatus, device and medium with integer eigenvalues to solve at least one problem in the prior art.
To achieve the above and other related objects, the present application provides an image storage and comparison method for feature value integer, the method comprising: zooming the obtained original image into a standard image with the size of x multiplied by y pixels, and dividing the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels; reducing the dimensions of three (x y)/N-dimensional vectors in each pixel block respectively and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image; and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison.
In an embodiment of the present application, the scaling the acquired original image into a standard image with a size of x × y pixels and dividing the standard image into N pixel blocks includes: deleting the RGBA four channels of the original image into RGB three channels, and scaling the RGB three channels into a standard image with the size of x multiplied by y pixels; and dividing the standard image according to the N grids to obtain N pixel blocks.
In an embodiment of the present application, the scaling process eliminates distortion of the original image by calculating the mean of each channel in the pixel block.
In an embodiment of the present application, the reducing dimensions of the three (x × y)/N-dimensional vectors in each pixel block and recombining the three (x × y)/N-dimensional vectors into integers to obtain a set of 3N integers corresponding to the standard image includes: converting the pixel value of each dimension in each vector into an 8-bit binary number to obtain a binary number matrix of 8 x (x y)/N corresponding to each vector; rearranging and combining the binary number matrix according to the arrangement mode from low order to high order to reduce the dimension and recombine the binary number matrix into an integer; and collecting the integers corresponding to all the pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image.
In an embodiment of the present application, the reducing the dimension of the binary number matrix into an integer according to the arrangement from the lower bits to the higher 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 sequentially correspond from left to right from low to high; each column corresponds to binary numbers belonging to the same bit in each dimension; combining binary numbers belonging to the same bit in each dimension into a numerical value section corresponding to the bit; and arranging the numerical value sections in sequence from low order to high order according to corresponding bits of each numerical value section so as to recombine to obtain an integer which corresponds to a vector and comprises 8 numerical value sections.
In an embodiment of the present application, the determining whether there are similar pixel blocks or images by integer comparison includes: setting a comparison line for an integer comprising 8 numerical value sections, so as to compare numerical values of one or more high numerical value sections at the right side of the comparison line in the integer with numerical values of one or more high numerical value sections corresponding to each integer in the image database; if the comparison is the same, judging that the integers are similar; if the comparison of at least 2 integers in the 3 integers corresponding to the pixel block is judged to be the same, judging that a pixel block similar to the pixel block exists in the image database; and if the comparison of at least m integers in the 3N integers corresponding to the standard image is judged to be the same, judging that an image similar to the standard image exists in the image database.
In an embodiment of the present application, the comparison line can be adjusted according to a comparison condition or a scene requirement, so as to adjust the comparison accuracy.
To achieve the above and other related objects, the present application provides an image storage and comparison apparatus for integer feature value, the apparatus comprising: the device comprises: the zooming and dividing module is used for zooming the obtained original image into a standard image with the size of x multiplied by y pixels and dividing the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels; the integer conversion module is used for respectively reducing the dimensions of three (x multiplied by y)/N-dimensional vectors in each pixel block and recombining the vectors into integers so as to obtain a set of 3N integers corresponding to the standard image; and the storage comparison module is used for storing the set into an image database following the data storage form by taking the set as the data storage form of the standard image so as to judge whether similar pixel blocks or images exist through integer comparison.
To achieve the above and other related objects, the present application provides a computer apparatus, comprising: a memory, and a processor; the memory is to store computer instructions; the processor executes computer instructions to implement the method as described above.
To achieve the above and other related objects, the present application provides a computer readable storage medium storing computer instructions which, when executed, perform the method as described above.
In summary, the method, apparatus, device and medium for storing and comparing an image with integer eigenvalues provided in the present application are implemented by scaling an acquired original image into a standard image with x × y pixel size, and dividing the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels; reducing the dimensions of three (x y)/N-dimensional vectors in each pixel block respectively and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image; and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison.
Has the following beneficial effects:
the method and the device convert the characteristic value of the picture into an integer form so as to be convenient for storage and comparison, and greatly save comparison processing speed and memory required by storage.
Drawings
Fig. 1 is a flowchart illustrating an image storing and comparing method for integer feature values according to an embodiment of the present disclosure.
Fig. 2 is a schematic view of a scenario corresponding to step S101 in an embodiment of the present application.
Fig. 3 is a block diagram of an image storage and comparison apparatus for integer feature value transformation according to an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application is provided by way of specific examples, and other advantages and effects of the present application will be readily apparent to those skilled in the art from the disclosure herein. The present application is capable of other and different embodiments and its several details are capable of modifications and/or changes in various respects, all without departing from the spirit of the present application. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only schematic and illustrate the basic idea of the present application, and although the drawings only show the components related to the present application and are not drawn according to the number, shape and size of the components in actual implementation, the type, quantity and proportion of the components in actual implementation may be changed at will, and the layout of the components may be more complex.
Throughout the specification, when a part is referred to as being "connected" to another part, this includes not only a case of being "directly connected" but also a case of being "indirectly connected" with another element interposed therebetween. In addition, when a certain part is referred to as "including" a certain component, unless otherwise stated, other components are not excluded, but it means that other components may be included.
The terms first, second, third, etc. are used herein to describe various elements, components, regions, layers and/or sections, but are not limited thereto. These terms are only used to distinguish one element, component, region, layer or section from another element, component, region, layer or section. Thus, a first element, component, region, layer or section discussed below could be termed a second element, component, region, layer or section without departing from the scope of the present application.
Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," and/or "comprising," when used in this specification, specify the presence of stated features, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, operations, elements, components, items, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning 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 ". An exception to this definition will occur only when a combination of elements, functions or operations are inherently mutually exclusive in some way.
In the traditional picture comparison process, images to be compared need to be compared with pictures in a database one by one, for example, common characteristic vectors extracted by pictures are used for comparison, but the characteristic vectors or pixel memories contained in one picture are too much, so that the comparison speed is very high, the comparison speed is very slow, and local or fine plagiarism patterns cannot be found; in addition, the data occupation of the stored pictures in the picture database is very large.
In order to solve the above problems, the present application provides an image storage and comparison method, apparatus, device and medium with integer eigenvalues, which converts the eigenvalues of the pictures into integer form for storage and comparison, thereby greatly saving the comparison speed and the memory required for storage.
Fig. 1 is a schematic flow chart of an image storage and comparison method for integer feature values according to an embodiment of the present application. As shown, the method comprises:
step S101: zooming the obtained original image into a standard image with the size of x multiplied by y pixels, and dividing the standard image into N pixel blocks; wherein, each pixel block has three (x y)/N-dimensional vectors respectively corresponding to RGB three channels.
In an embodiment of the present application, the scaling the obtained original image into a standard image with a size of x × y pixels and dividing the standard image into N pixel blocks includes:
A. deleting the RGBA four channels of the original image into RGB three channels, and scaling the RGB three channels into a standard image with the size of x multiplied by y pixels;
in this embodiment, typically an original image has four channels RGBA, which represent the color spaces Red (Red) Green (Green) Blue (Blue) and Alpha, respectively, but it is actually just the RGB model with the additional information added. The adopted color is usually RGB, and the Alpha channel is generally used as an opacity parameter, so that the Alpha channel which has little influence or no influence in the image comparison process is removed, the number of channels is reduced, and the data used for comparison is reduced.
In addition, the original image usually has different pixel sizes and often has a larger pixel size, such as 4032 × 3024, 2048 × 1024, and so on, so as to facilitate the present application to convert the image into an integer and then store the integer in the image for comparison, the present application uniformly scales the original image to a smaller or minimum uniform pixel size, such as 12 × 12 pixel size, so as to be uniformly used as a standard image, as shown in fig. 2. The zooming method can be realized by adopting some zooming methods which are common in the technical field of image processing.
In this embodiment, since the image distortion problem may be caused during the scaling process of the image, 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, each pixel is assigned a weight, normalized, and then removed from distortion by a numerical difference method.
It should be noted that, the distortion removing process in the method may also adopt a common method for processing image distortion. In addition, the effect of processing image distortion does not need to be a very high standard, because the purpose of performing a series of processing around an image is to compare pictures, such as comparing the color or shape of a pattern in a certain region, rather than using or appreciating the patterns, and the effect on picture comparison is small as long as the feature information corresponding to the pattern in the region is not changed greatly. Therefore, the requirements for image distortion processing are not too high.
B. And dividing the standard image according to the N grids to obtain N pixel blocks.
For example, as shown in FIG. 2, it is shown as a scene schematic from an original image to a block of pixels. After the original image is scaled to a standard image with a size of 12 × 12 pixels, the standard image is divided into blocks in a nine-grid frame, so that 9 blocks of pixels with a size of 4 × 4 pixels can be obtained. Accordingly, each pixel block then has three 16-dimensional ((12 × 12)/9 ═ 4 × 4) vectors, corresponding to the RGB three channels:
Figure BDA0002656062430000051
the specific vectors are as follows:
Figure BDA0002656062430000052
Figure BDA0002656062430000053
Figure BDA0002656062430000054
it should be noted that the N-shaped lattices that divide the standard image in the present application are not limited to centrosymmetric four-shaped lattices, nine-shaped lattices, sixteen-shaped lattices, and the like, and may also include non-centrosymmetric multi-shaped lattices, such as six-shaped lattices, eight-shaped lattices, and twelve-shaped lattices, and the like. Each pixel block divided by the N-grid is preferably a square or a rectangle.
Step S102: and respectively reducing the dimensions of the three (x multiplied by y)/N-dimensional vectors in each pixel block and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image.
In an embodiment of the present application, the reducing dimensions of the three (x × y)/N-dimensional vectors in each pixel block and recombining the three (x × y)/N-dimensional vectors into integers to obtain a set of 3N integers corresponding to the standard image includes:
A. and converting the pixel value of each dimension in each vector into an 8-bit binary number to obtain an 8 x (x y)/N binary number matrix corresponding to each vector.
For example, vectors
Figure BDA0002656062430000055
First dimension R of1The pixel value correspondence of (1) is converted to 8 binary numbers as follows:
R1={r11,r12,…,r18};
it should be noted that the pixel value range in each of the RGB three channels is (0-255), and the corresponding binary system is exactly 8 bits (00000000-11111111), so that the pixel value in each dimension can be converted into an 8-bit binary system.
Further, taking each vector as exemplified in FIG. 2 is 16-dimensional, then as vectors
Figure BDA0002656062430000062
The resulting binary matrix is shown below;
Figure BDA0002656062430000061
specifically, as in the binary number matrix formula (1) exemplified above, each row corresponds to an 8-bit binary number for each dimension, and the bits for each dimension correspond from left to right sequentially from low to high, as in the first row, r11Corresponding to the lowest order, r18The highest bit is corresponded; each column corresponding to a binary number belonging to the same (high-low) bit in each dimension, e.g. r in the first column11、r21、…、r161Then the corresponding is a binary number belonging to the same lower order bit in each dimension.
B. And rearranging and combining the binary number matrix according to the arrangement mode from low order to high order to reduce the dimension and recombine the binary number matrix into an integer. The method specifically comprises the following steps:
b1, combining binary numbers belonging to the same bit in each dimension into a numerical value section corresponding to the bit;
it is also common practice that when the matrix is reduced to a row of integers, the integers may be naturally arranged in the order of horizontal numbering. But the innovation of the present application proposes a vertical combination arrangement with identical bits. Vectors as exemplified above
Figure BDA0002656062430000063
In the binary number matrix formula (1), the corresponding vector is obtained
Figure BDA0002656062430000064
The integers of (a) are as follows:
{r11,r21,…,r161|r12,r22,…,r162|…|r18,r28,…,r168}; (2)
b2, arranging the corresponding bits according to each numerical value section from low to high in sequence, and recombining to obtain an integer corresponding to a vector and comprising 8 numerical value sections.
Correspondingly, the integer formula (2), r as exemplified above11To r161The numerical value section corresponding to the lowest order; r is18To r168Then the correspondence is highestThe numerical value sections of the bits are sequentially arranged from the lower bits to the upper bits to obtain corresponding vectors
Figure BDA0002656062430000065
The integer of (2) above, wherein the integer comprises an integer of 8 numerical segments.
C. And collecting the integers corresponding to all the pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image.
In the example illustrated above, the integer formula (2) 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, so that a standard image corresponds to a set of 27 integers.
Step S103: and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison.
It should be noted that, the features are extracted from the image and expressed as integers for storage and comparison, and compared with directly storing the image or feature vector, the occupied memory is greatly reduced, and the calculation speed is greatly improved.
In this embodiment, the mass images stored in the image database are also in the form of storage of an integer set, so that judgment of similar images can be achieved through comparison between integers.
In the embodiment of the present application, step S103 specifically includes:
A. setting a comparison line for an integer comprising 8 numerical value sections, so as to compare numerical values of one or more high numerical value sections at the right side of the comparison line in the integer with numerical values of one or more high numerical value sections corresponding to each integer in the image database;
it should be emphasized that, further, in the present application, the integers that have been converted to characterize the image features are arranged in the binary matrix corresponding to the vector from the lower order to the upper order, so that the integers can be directly compared with the upper order of the integers. Because, if the integer obtained by conversion according to the method described in the present application, if the 32 high bits are the same, the high 2 bits of the 16-dimensional vector corresponding to the integer are always the same, and the low bits can be used as noise allowing the user to add text, logo, etc.
Therefore, according to the characteristic that the integers are arranged according to the sequence from the low order to the high order, the comparison line is arranged for the integers comprising 8 numerical value sections, and partial integers are compared, for example, the later numerical value sections in the integers are compared.
In addition, the comparison line can be adjusted according to comparison conditions or scene requirements so as to adjust comparison accuracy.
For example, the expected alignment accuracy can be achieved by aligning the alignment lines in the 2 nd numerical region or the 3 rd numerical region.
B. If the comparison is the same, judging that the integers are similar;
C. and if the comparison of at least 2 integers in the 3 integers corresponding to the pixel blocks is judged to be the same, judging that the pixel blocks similar to the pixel blocks exist in the image database.
D. And if the comparison of at least m integers in the 3N integers corresponding to the standard image is judged to be the same, judging that an image similar to the standard image exists in the image database.
For example, assuming that the 27 integers are all the same, the same image can be determined; if one or more integers belonging to a pixel block are the same, the pixel block can also be judged to have similar or identical pixel blocks. It should be noted that the pixel block represents a portion (e.g., one-ninth region) in an image, where a complete pattern or a partial pattern may exist, and then, for a local or fine pattern in the image, comparison may also be implemented to determine whether the pattern in the image has a plagiarism or infringement possibility.
In a scene in which the method is actually applied, if more than 4 integers are similar in the 27 integers, it can be determined that the images are very similar or the same, and thus an image highly similar or the same as a standard image in an image database can be found. Therefore, the method and the device judge similar or identical images through integer comparison, and greatly reduce the processing speed.
In summary, the present application provides an image storage and comparison method, apparatus, device and medium with integer eigenvalues, which scales an acquired original image into a standard image with x × y pixel size, and divides the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels; reducing the dimensions of three (x y)/N-dimensional vectors in each pixel block respectively and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image; and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison. The method and the device convert the characteristic value of the picture into an integer form so as to be convenient for storage and comparison, and greatly save comparison processing speed and memory required by storage.
Fig. 3 is a block diagram of an image storage and comparison apparatus for integer feature value transformation according to an embodiment of the present application. As shown, the apparatus 300 includes:
a scaling and dividing module 301, configured to scale the acquired original image into a standard image of x × y pixel size, and divide the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels;
an integer conversion module 302, configured to separately reduce the dimensions of three (x × y)/N-dimensional vectors in each pixel block and recombine the three vectors into integers, so as to obtain a set of 3N integers corresponding to the standard image;
and a storage comparison module 303, configured to store the set as a data storage form of the standard image into an image database following the data storage form, so as to determine whether similar pixel blocks or images exist through integer comparison.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules/units of the apparatus are based on the same concept as the method embodiment described in the present application, the technical effect brought by the contents is the same as the method embodiment of the present application, and specific contents may refer to the description in the foregoing method embodiment of the present application, and are not described herein again.
It should be further noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these units can be implemented entirely in software, invoked by a processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the storage comparing module 303 may be a processing element separately installed, or may be integrated into a chip of the system, or may be stored in a memory of the system in the form of program codes, and a processing element of the apparatus calls and executes the functions of the storage comparing module 303. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
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 microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention. As shown, the computer device 400 includes: a memory 401, and a processor 402; the memory 401 is used for storing computer instructions; the processor 402 executes computer instructions to implement the method described in fig. 1.
In some embodiments, the number of the memories 401 in the computer device 400 may be one or more, the number of the processors 402 may be one or more, and fig. 4 is taken as an example.
In an embodiment of the present application, the processor 402 in the computer device 400 loads one or more instructions corresponding to processes of an application program into the memory 401 according to the steps described in fig. 1, and the processor 402 executes the application program stored in the memory 401, thereby implementing the method described in fig. 1.
The Memory 401 may include a Random Access Memory (RAM), and may also include a non-volatile Memory (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 expanded 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 for handling hardware-based tasks.
The Processor 402 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In some specific applications, the various components of the computer device 400 are coupled together by a bus system that may include a power bus, a control bus, a status signal bus, etc., in addition to a data bus. But for clarity of explanation the various busses are shown in fig. 4 as a bus system.
In an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method described in fig. 1.
The present application may be embodied as systems, methods, and/or computer program products, in any combination of technical details. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present application.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, 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 disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable programs described herein may be downloaded from a computer-readable storage medium to a variety of computing/processing devices, or 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 may include copper transmission cables, fiber optic 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 the respective computing/processing device.
The computer program instructions for carrying out operations of the present application may be assembly instructions, Instruction Set Architecture (ISA) 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 an object oriented programming language such as Smalltalk, C + + or the like and procedural programming languages, such as the "C" programming 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. In the case of a remote computer, the remote computer may 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry can execute computer-readable program instructions to implement aspects of the present application by utilizing state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
In summary, the method, apparatus, device and medium for storing and comparing an image with integer eigenvalues provided in the present application are implemented by scaling an acquired original image into a standard image with x × y pixel size, and dividing the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels; reducing the dimensions of three (x y)/N-dimensional vectors in each pixel block respectively and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image; and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison.
The application effectively overcomes various defects in the prior art and has high industrial utilization value.
The above embodiments are merely illustrative of the principles and utilities of the present application and are not intended to limit the invention. Any person skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present application.

Claims (10)

1. A method for storing and comparing images with characteristic values in integer numbers is characterized by comprising the following steps:
zooming the obtained original image into a standard image with the size of x multiplied by y pixels, and dividing the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels;
reducing the dimensions of three (x y)/N-dimensional vectors in each pixel block respectively and recombining the vectors into integers to obtain a set of 3N integers corresponding to the standard image;
and taking the set as a data storage form of the standard image to be stored in an image database following the data storage form, so as to judge whether similar pixel blocks or images exist through integer comparison.
2. The method of claim 1, wherein the scaling of the acquired original image to a standard image of x y pixel size and the partitioning into N blocks of pixels comprises:
deleting the RGBA four channels of the original image into RGB three channels, and scaling the RGB three channels into a standard image with the size of x multiplied by y pixels;
and dividing the standard image according to the N grids to obtain N pixel blocks.
3. The method of claim 2, wherein the scaling process removes distortion from the original image by calculating an average of each channel within a block of pixels.
4. The method of claim 1, wherein said reducing dimensions and recombining three (x y)/N-dimensional vectors in each pixel block into integers to obtain a set of 3N integers corresponding to the standard image comprises:
converting the pixel value of each dimension in each vector into an 8-bit binary number to obtain a binary number matrix of 8 x (x y)/N corresponding to each vector;
rearranging and combining the binary number matrix according to the arrangement mode from low order to high order to reduce the dimension and recombine the binary number matrix into an integer;
and collecting the integers corresponding to all the pixel blocks of the standard image to obtain a set of 3N integers corresponding to the standard image.
5. The method of claim 4, wherein the reducing the dimension of the binary number matrix into an integer according to the arrangement from lower bits to higher bits comprises:
in the binary number matrix, each row corresponds to an 8-bit binary number of each dimension, and the bits of each dimension sequentially correspond from left to right from low to high; each column corresponds to binary numbers belonging to the same bit in each dimension;
combining binary numbers belonging to the same bit in each dimension into a numerical value section corresponding to the bit;
and arranging the numerical value sections in sequence from low order to high order according to corresponding bits of each numerical value section so as to recombine to obtain an integer which corresponds to a vector and comprises 8 numerical value sections.
6. The method of claim 5, wherein the segmenting whether similar pixel blocks or images exist through integer ratios comprises:
setting a comparison line for an integer comprising 8 numerical value sections, so as to compare numerical values of one or more high numerical value sections at the right side of the comparison line in the integer with numerical values of one or more high numerical value sections corresponding to each integer in the image database;
if the comparison is the same, judging that the integers are similar;
if the comparison of at least 2 integers in the 3 integers corresponding to the pixel block is judged to be the same, judging that a pixel block similar to the pixel block exists in the image database;
and if the comparison of at least m integers in the 3N integers corresponding to the standard image is judged to be the same, judging that an image similar to the standard image exists in the image database.
7. The method of claim 6, wherein the alignment line can be adjusted according to the alignment condition or the scene requirement, so as to adjust the alignment accuracy.
8. An apparatus for storing and comparing an integer number of feature values, the apparatus comprising:
the zooming and dividing module is used for zooming the obtained original image into a standard image with the size of x multiplied by y pixels and dividing the standard image into N pixel blocks; each pixel block is provided with three (x y)/N-dimensional vectors respectively corresponding to RGB three channels;
the integer conversion module is used for respectively reducing the dimensions of three (x multiplied by y)/N-dimensional vectors in each pixel block and recombining the vectors into integers so as to obtain a set of 3N integers corresponding to the standard image;
and the storage comparison module is used for storing the set into an image database following the data storage form by taking the set as the data storage form of the standard image so as to judge whether similar pixel blocks or images exist through integer comparison.
9. A computer device, the device comprising: a memory, and a processor; the memory is to store computer instructions; the processor executes computer instructions to implement the method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer instructions which, when executed, perform the method of any one of claims 1 to 7.
CN202010887737.5A 2020-08-28 2020-08-28 Image storage and comparison method, device, equipment and medium with characteristic value being integer Pending CN111986089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010887737.5A CN111986089A (en) 2020-08-28 2020-08-28 Image storage and comparison method, device, equipment and medium with characteristic value being integer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010887737.5A CN111986089A (en) 2020-08-28 2020-08-28 Image storage and comparison method, device, equipment and medium with characteristic value being integer

Publications (1)

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

Family

ID=73440190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010887737.5A Pending CN111986089A (en) 2020-08-28 2020-08-28 Image storage and comparison method, device, equipment and medium with characteristic value being integer

Country Status (1)

Country Link
CN (1) CN111986089A (en)

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 *

Similar Documents

Publication Publication Date Title
US11961267B2 (en) Color conversion between color spaces using reduced dimension embeddings
US11636665B2 (en) Streaming image semantic segmentation method, logical integrated circuit system and electronic device
US11663743B2 (en) Image data decompression
US12008791B2 (en) Image data compression
CN113506305B (en) Image enhancement method, semantic segmentation method and device for three-dimensional point cloud data
CN102835104B (en) Block-removal filtering method
US11403783B2 (en) Techniques to dynamically gate encoded image components for artificial intelligence tasks
CN111986089A (en) Image storage and comparison method, device, equipment and medium with characteristic value being integer
US20110221775A1 (en) Method for transforming displaying images
US20220004857A1 (en) Neural network processing apparatus, neural network processing method, and neural network processing program
US11170260B2 (en) Techniques for determining importance of encoded image components for artificial intelligence tasks
WO2021036424A1 (en) Parallel efficient computing method for box filter
CN109408028B (en) Floating point number operation method and device and storage medium
CN111986277A (en) Image local comparison method, device, equipment and medium based on gray value
US12148188B2 (en) Image data decompression
CN107766863B (en) Image characterization method and server
CN115578243B (en) Sparse matrix-oriented expansion processing method
CN116977154B (en) Visible light image and infrared image fusion storage method, device, equipment and medium
CN113487624B (en) Human body instance segmentation method, terminal equipment and storage medium
CN113542808B (en) Video processing method, apparatus, device and computer readable medium
CN111275793B (en) Text rendering method and device, electronic equipment and storage medium
Sari et al. An Approach For Stitching Satellite Images In A Bigdata Mapreduce Framework
CN114037785A (en) Image processing method and device
CN117522753A (en) Image processing method, device, equipment and computer readable storage medium
CN113849671A (en) Image fingerprint comparison method, device, equipment and medium based on large integer type

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