CN114625906A - Image processing method, image processing apparatus, computer device, and medium - Google Patents
Image processing method, image processing apparatus, computer device, and medium Download PDFInfo
- Publication number
- CN114625906A CN114625906A CN202210240229.7A CN202210240229A CN114625906A CN 114625906 A CN114625906 A CN 114625906A CN 202210240229 A CN202210240229 A CN 202210240229A CN 114625906 A CN114625906 A CN 114625906A
- Authority
- CN
- China
- Prior art keywords
- image
- mapping
- target
- target image
- candidate
- 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
Links
- 238000012545 processing Methods 0.000 title claims abstract description 57
- 238000003672 processing method Methods 0.000 title claims abstract description 27
- 238000013507 mapping Methods 0.000 claims abstract description 147
- 238000000034 method Methods 0.000 claims abstract description 18
- 238000012216 screening Methods 0.000 claims abstract description 12
- 238000005260 corrosion Methods 0.000 claims description 20
- 230000007797 corrosion Effects 0.000 claims description 20
- 238000007781 pre-processing Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 19
- 230000006835 compression Effects 0.000 claims description 11
- 238000007906 compression Methods 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000001914 filtration Methods 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000013473 artificial intelligence Methods 0.000 abstract description 7
- 238000005516 engineering process Methods 0.000 description 11
- 239000011159 matrix material Substances 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 239000012535 impurity Substances 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Library & Information Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The application is applicable to the technical field of artificial intelligence, and provides an image processing method, an image processing device, computer equipment and a medium, wherein the method comprises the following steps: performing hash value matching on the preprocessed target image and each sample image to obtain a hash value matching result, and screening each sample image according to the hash value matching result to obtain a candidate image; respectively carrying out feature mapping on the image features of the preprocessed target image and the image features of each candidate image to obtain image mapping features; and performing feature matching on the target image and each candidate image according to the image mapping features, and outputting a similar image of the target image according to a feature matching result. By performing feature mapping on the image features of the preprocessed target image and the image features of each candidate image, feature matching can be effectively performed on the target image and each candidate image based on the image mapping features, similar images of the target image can be effectively determined based on the result of the feature matching, and the accuracy of image processing is improved.
Description
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to an image processing method, an image processing apparatus, a computer device, and a medium.
Background
With the development of internet technology, information exchange and transmission modes become rich gradually, while for internet data, image information becomes an important mode of information transmission, and in order to realize the query of picture information in the internet, a processing method for images in the internet is indispensable.
In the existing image processing process, when a similar image of a target image needs to be acquired, image pixel feature comparison is performed on the target image and a sample image prestored in an image database, and the similar image of the target image is determined according to the result of the image pixel feature comparison.
Disclosure of Invention
In view of this, embodiments of the present application provide an image processing method, an image processing apparatus, a computer device, and a medium, so as to solve the problem of low image processing accuracy in the existing image processing process.
A first aspect of an embodiment of the present application provides an image processing method, including:
acquiring a target image, and performing image preprocessing on the target image;
performing hash value matching on the preprocessed target image and sample images in an image database to obtain a hash value matching result, screening each sample image according to the hash value matching result to obtain a candidate image, wherein the hash value matching result is used for representing the hash value similarity between the target image and the corresponding sample image;
respectively acquiring the image characteristics of the preprocessed target image and the image characteristics of each candidate image, and respectively performing characteristic mapping on the image characteristics of the preprocessed target image and the image characteristics of each candidate image to obtain image mapping characteristics;
and performing feature matching on the target image and each candidate image according to the image mapping features, and outputting similar images of the target image in the image database according to the result of the feature matching.
Further, the matching the preprocessed target image with the hash value of the sample image in the image database includes:
carrying out gray level processing on the preprocessed target image and each sample image respectively to obtain a target gray level image and a sample gray level image of each sample image;
respectively calculating pixel differences between adjacent pixels in the target gray level image and each sample gray level image to obtain a target difference set and a sample difference set;
respectively compiling hash values of the target difference set and each sample difference set to obtain a target difference hash and a sample difference hash;
and respectively calculating the Hamming distance between the target difference hash and each sample difference hash to obtain the hash value matching result.
Further, the obtaining the image features of the preprocessed target image and the image features of the candidate images, and performing feature mapping on the image features of the preprocessed target image and the image features of the candidate images respectively includes:
respectively carrying out vector conversion on the preprocessed target image and each candidate image to obtain image vector characteristics;
mapping the image vector characteristics of the preprocessed target image and the image vector characteristics of each candidate image respectively according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set;
combining the image vector characteristics of the target image with the vector characteristics in the first mapping vector set respectively to obtain a first combined characteristic set, wherein the first combined characteristic set comprises at least one first image mapping characteristic corresponding to the target image;
combining the image vector characteristics of each candidate image with the vector characteristics respectively corresponding to the second mapping vector set to obtain a second combined characteristic set, wherein the second combined characteristic set comprises second image mapping characteristics corresponding to at least one candidate image;
wherein the image mapping feature comprises the first combined feature set and the second combined feature set.
Further, the performing feature matching on the target image and each candidate image includes:
and performing similarity calculation on the combined features corresponding to the same preset mapping torque between the first combined feature set and the second combined feature set to obtain a feature matching result.
Further, after the pre-processing image vector features of the target image and the candidate images are mapped according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set, the method further includes:
similarity calculation is carried out on mapping vector signs corresponding to the same preset mapping torque between the first mapping vector set and the second mapping vector set to obtain vector similarity;
and correcting the result of the feature matching according to the vector similarity.
Further, the screening each sample image according to the hash value matching result to obtain a candidate image includes:
and if the Hamming distance corresponding to any sample image is smaller than a preset distance, determining the sample image as the candidate image.
Further, the image preprocessing the target image includes:
respectively carrying out image compression on the target image and each sample image, and carrying out gray level processing on the target image and each sample image after image compression;
and carrying out image corrosion treatment on the target image and each sample image after the gray level treatment, and carrying out image filtering treatment on the target image and each sample image after the image corrosion treatment.
A second aspect of an embodiment of the present application provides an image processing apparatus, including:
the image preprocessing module is used for acquiring a target image and preprocessing the target image;
the hash value matching module is used for matching the preprocessed target image with the hash values of the sample images in the image database to obtain a hash value matching result, screening each sample image according to the hash value matching result to obtain a candidate image, and the hash value matching result is used for representing the hash value similarity between the target image and the corresponding sample image;
the feature mapping module is used for respectively acquiring the image features of the preprocessed target image and the image features of the candidate images, and respectively performing feature mapping on the image features of the preprocessed target image and the image features of the candidate images to obtain image mapping features;
and the feature matching module is used for performing feature matching on the target image and each candidate image according to the image mapping features and outputting a similar image of the target image in the image database according to the result of the feature matching.
A third aspect of embodiments of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the computer device, where the processor implements the steps of the image processing method provided in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the image processing method provided by the first aspect.
According to the image processing method, the image processing device, the computer equipment and the medium, the preprocessed target image is matched with the hash value of each sample image, the sample images can be effectively screened based on the hash value matching result so as to delete the image with large difference with the target image, the image features of the preprocessed target image and the image features of the candidate images are subjected to feature mapping, the target image and the candidate images can be effectively subjected to feature matching based on the image mapping features, the similar images of the target image can be effectively determined based on the feature matching result, and the accuracy of image processing is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of an image processing method provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating an implementation of an image processing method according to another embodiment of the present application;
fig. 3 is a block diagram of an image processing apparatus according to an embodiment of the present application;
fig. 4 is a block diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In the embodiment of the application, the image processing method is realized based on the artificial intelligence technology and is used for outputting the similar image of the target image.
Referring to fig. 1, fig. 1 shows a flowchart of an implementation of an image processing method provided in an embodiment of the present application, where the image processing method is applied to any computer device, where the computer device may be a server, a mobile phone, a tablet, or a wearable smart device, and the image processing method includes:
step S10, acquiring a target image and carrying out image preprocessing on the target image;
the image quality of the target image can be effectively improved by carrying out image preprocessing on the target image, so that the accuracy of image processing is improved;
in this step, the image preprocessing effect on the target image can be achieved by performing image filtering or image quality enhancement processing on the target image.
Optionally, in this step, the performing image preprocessing on the target image includes:
performing image compression on the target image, and performing gray level processing on the target image after the image compression;
because redundant information exists in the image, the redundant information in the target image can be effectively removed by carrying out image compression on the target image so as to improve the image quality of the target image;
in this step, the target image may be compressed by using a run-length coding method, an entropy coding method, or a transform coding method, and the gray scale image corresponding to the target image after image compression is obtained by performing gray scale processing on the target image after image compression.
Carrying out image corrosion processing on the target image subjected to the gray processing, and carrying out image filtering processing on the target image subjected to the image corrosion processing;
the image corrosion processing is used for carrying out image detection on a target image by a corrosion operator and finding out a region which can bear the corrosion operator in the target image, the image corrosion processing is a process of eliminating boundary points and enabling boundaries to shrink inwards and can be used for eliminating small and meaningless pixel points in the target image, the image corrosion processing is carried out on the target image, the image quality of the target image is effectively improved, and optionally, the impurity points and noise in the target image can be effectively filtered out by carrying out image filtering processing on the target image after the image corrosion processing, and the image quality of the target image is further improved.
Step S20, performing hash value matching on the preprocessed target image and sample images in an image database to obtain a hash value matching result, and screening each sample image according to the hash value matching result to obtain a candidate image;
the pre-stored sample images in the image database can be added and deleted according to user requirements, the hash value matching result is used for representing the hash value similarity between the target image and the corresponding sample image, the preprocessed target image is subjected to hash value matching with each sample image, and based on the hash value matching result, image screening can be effectively performed on each sample image so as to delete the image with large difference with the target image, for example, when the hash value similarity between the target image and the sample image a1 is smaller than a similarity threshold value, it is determined that the difference between the target image and the sample image a1 is large, and the sample image a1 is deleted;
optionally, in this step, the performing hash value matching on the preprocessed target image and the sample image in the image database includes:
carrying out gray level processing on the preprocessed target image and each sample image respectively to obtain a target gray level image and a sample gray level image of each sample image;
respectively calculating pixel differences between adjacent pixels in the target gray level image and each sample gray level image to obtain a target difference set and a sample difference set;
respectively calculating pixel differences between adjacent pixels in the target gray-scale image and each sample gray-scale image to obtain a target difference set and a sample difference set which respectively represent pixel difference characteristics between adjacent pixels in the target gray-scale image and each sample gray-scale image;
respectively compiling hash values of the target difference set and each sample difference set to obtain a target difference hash and a sample difference hash;
binary coding is respectively carried out on the target difference set and each sample difference set to obtain a target difference hash and a sample difference hash which represent pixel difference characteristics between adjacent pixels in the target gray level image and each sample gray level image;
respectively calculating Hamming distances between the target difference hash and each sample difference hash to obtain a hash value matching result;
and calculating the Hamming distance between the target difference hash and each sample difference hash to obtain the hash value similarity between the target image and each sample image.
Further, in this step, the screening each sample image according to the hash value matching result to obtain a candidate image includes:
if the Hamming distance corresponding to any sample image is smaller than a preset distance, determining the sample image as the candidate image;
the preset distance can be set according to requirements, if the hamming distance corresponding to any sample image is smaller than the preset distance, the difference between the target image and the corresponding sample image is judged to be small, and the sample image is determined to be a candidate image.
Step S30, respectively acquiring the image features of the preprocessed target image and the image features of each candidate image, and respectively performing feature mapping on the image features of the preprocessed target image and the image features of each candidate image to obtain image mapping features;
the image features comprise color features, texture features, shape features, spatial relationship features and the like, and the color features and the texture features are used for representing surface properties of a scene corresponding to an image or an image area; the shape features comprise contour features and region features, the contour features of the image mainly aim at the outer boundary of an object, the region features of the image are related to the whole shape region, the spatial relationship features are used for representing the mutual spatial position or relative direction relationship among a plurality of targets segmented in the image, and the relationship can also be divided into a connection/adjacency relationship, an overlapping/overlapping relationship, an inclusion/containment relationship and the like; in the step, the image features of the preprocessed target image and the image features of each candidate image are subjected to feature mapping to obtain mapping features of a plurality of mapping dimensions; optionally, in this step, feature mapping may be performed on the image features of the preprocessed target image and the image features of each candidate image respectively in a matrix, vector, or preset coding algorithm manner, so as to obtain image mapping features.
Step S40, according to the image mapping characteristics, performing characteristic matching on the target image and each candidate image, and outputting a similar image of the target image in the image database according to the result of the characteristic matching;
the feature matching result comprises feature similarity of the target image and each candidate image in different mapping dimensions, the target image and each candidate image are subjected to feature matching based on image mapping features, feature similarity calculation is respectively carried out on the target image and each candidate image in multiple mapping dimensions, the feature matching result is obtained, and similar images of the target image in an image database are output based on the feature similarity of the target image and each candidate image in different mapping dimensions.
In this embodiment, the preprocessed target image and each sample image are subjected to hash value matching, each sample image can be effectively subjected to image screening based on a hash value matching result, so as to delete an image with a large difference from the target image, the image features of the preprocessed target image and the image features of each candidate image are subjected to feature mapping, the target image and each candidate image can be effectively subjected to feature matching based on the image mapping features, similar images of the target image can be effectively determined based on the feature matching result, and the accuracy of image processing is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of an image processing method according to another embodiment of the present disclosure. With respect to the embodiment of fig. 1, the image processing method provided by this embodiment is used to further refine step S30 in the embodiment of fig. 1, and includes:
step S31, respectively carrying out vector conversion on the preprocessed target image and each candidate image to obtain image vector characteristics;
respectively acquiring color histograms of a preprocessed target image and each candidate image, and performing vector conversion on the acquired color histograms to obtain image vector characteristics of the target image and each candidate image;
step S32, mapping the image vector characteristics of the preprocessed target image and the image vector characteristics of each candidate image respectively according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set;
the preset mapping torque can be set according to requirements, the preset mapping torque is used for mapping image vector characteristics of a target image and image vector characteristics of each candidate image to specified characteristic dimensions respectively, the number of the preset mapping torque can be set according to requirements, and matrix parameters of different preset mapping torques are different;
for example, the preset mapping torque in this step includes mapping torque b1 and mapping torque b2, and the first mapping vector set and the second mapping vector set are obtained by performing matrix operation on the image vector characteristics of the target image and the image vector characteristics of each candidate image respectively according to mapping torque b1 and mapping torque b2, the first mapping vector set includes mapping vector c1 and mapping vector c2, mapping vector c1 is the matrix operation result of mapping torque b1 and the image vector characteristics of the target image, and mapping vector c2 is the matrix operation result of mapping torque b2 and the image vector characteristics of the target image;
step S33, combining the image vector characteristics of the target image with the vector characteristics in the first mapping vector set respectively to obtain a first combined characteristic set;
wherein, the first combined feature set includes at least one first image mapping feature corresponding to the target image, for example, an image vector feature d1 of the target image, and then the image vector feature d1 is combined with the mapping vector c1 and the mapping vector c2, so as to obtain the combined feature e1 and the combined feature e 2;
step S34, combining the image vector characteristics of each candidate image with the corresponding vector characteristics in the second mapping vector set respectively to obtain a second combined characteristic set;
the second combined feature set includes second image mapping features corresponding to at least one candidate image, for example, the candidate image includes candidate image h1 and candidate image h2, and image vector features d2 of candidate image h1 and image vector features d3 of candidate image h2 are respectively combined with corresponding vector features in the second mapping vector set to obtain a second combined feature set;
in the step, the image vector features of each candidate image are combined with the corresponding vector features in the second mapping vector set respectively to obtain combined features with different feature dimensions, and feature similarity between the target image and each candidate image in different feature dimensions can be effectively calculated and obtained on the basis of the combined features with different feature dimensions;
optionally, in this embodiment, for step S32, after the mapping the image vector features of the target image and the candidate images after the preprocessing according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set, the method further includes:
similarity calculation is carried out on mapping vector characteristics corresponding to the same preset mapping torque between the first mapping vector set and the second mapping vector set to obtain vector similarity, and the result of feature matching is corrected according to the vector similarity; the vector similarity is used for representing the feature similarity of the target image and each candidate image after feature mapping, and the feature matching result is corrected through the vector similarity, so that the accuracy of the feature matching result is effectively improved.
Further, in this embodiment, with respect to step S40, the performing feature matching on the target image and each candidate image includes: and performing similarity calculation on the combined features corresponding to the same preset mapping torque between the first combined feature set and the second combined feature set to obtain a feature matching result, wherein when the preset mapping torque comprises mapping torque b1 and mapping torque b2, the feature matching result comprises the similarity of the target image and each candidate image in two feature dimensions.
In this embodiment, after the feature similarities of different feature dimensions between the target image and each candidate image are obtained, the average of the feature similarities of all the feature dimensions between the target image and each candidate image is calculated for each candidate image, so as to obtain an average similarity, the average similarity corresponding to each candidate image is compared with the preset similarity, and if the average similarity corresponding to any candidate image is greater than the preset similarity, the candidate image is output as the similar image of the target image.
Referring to fig. 3, fig. 3 is a block diagram of an image processing apparatus 100 according to an embodiment of the present disclosure. The image processing apparatus 100 in this embodiment includes units for executing the steps in the embodiment corresponding to fig. 1 and 2. Please refer to fig. 1 and fig. 2 and the related descriptions in the embodiments corresponding to fig. 1 and fig. 2. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 3, the image processing apparatus 100 includes: an image preprocessing module 10, a hash value matching module 11, a feature mapping module 12, and a feature matching module 13, wherein:
the image preprocessing module 10 is configured to acquire a target image and perform image preprocessing on the target image; in the module, the image quality of the target image can be effectively improved by carrying out image preprocessing on the target image, so that the accuracy of image processing is improved.
Optionally, the image preprocessing module 10 is further configured to: performing image compression on the target image, and performing gray level processing on the target image after the image compression;
carrying out image corrosion processing on the target image subjected to the gray processing, and carrying out image filtering processing on the target image subjected to the image corrosion processing;
the image corrosion processing is used for carrying out image detection on a target image by a corrosion operator and finding out a region which can bear the corrosion operator in the target image, the image corrosion processing is a process of eliminating boundary points and enabling boundaries to shrink inwards and can be used for eliminating small and meaningless pixel points in the target image, the image corrosion processing is carried out on the target image, the image quality of the target image is effectively improved, and optionally, the impurity points and noise in the target image can be effectively filtered out by carrying out image filtering processing on the target image after the image corrosion processing, and the image quality of the target image is further improved.
A hash value matching module 11, configured to perform hash value matching on the preprocessed target image and sample images in the image database to obtain a hash value matching result, and filter each sample image according to the hash value matching result to obtain a candidate image, where the pre-stored sample images in the image database may be added and deleted according to user requirements, the hash value matching result is used to represent hash value similarities between the target image and corresponding sample images, and by performing hash value matching on the preprocessed target image and each sample image, each sample image can be effectively filtered based on the hash value matching result to delete images with large differences from the target image, for example, when the hash value similarity between the target image and the sample image a1 is smaller than a similarity threshold, it is determined that the difference between the target image and the sample image a1 is large, the sample image a1 is deleted.
Optionally, the hash value matching module 11 is further configured to: carrying out gray level processing on the preprocessed target image and each sample image respectively to obtain a target gray level image and a sample gray level image of each sample image;
respectively calculating pixel differences between adjacent pixels in the target gray level image and each sample gray level image to obtain a target difference set and a sample difference set;
respectively compiling hash values of the target difference set and each sample difference set to obtain a target difference hash and a sample difference hash;
and respectively calculating the Hamming distance between the target difference hash and each sample difference hash to obtain the hash value matching result.
The feature mapping module 12 is configured to obtain image features of the preprocessed target image and image features of each candidate image, and perform feature mapping on the image features of the preprocessed target image and the image features of each candidate image, respectively, to obtain image mapping features. The image features comprise color features, texture features, shape features, spatial relationship features and the like, and the color features and the texture features are used for representing surface properties of a scene corresponding to an image or an image area; the shape features comprise contour features and region features, the contour features of the image mainly aim at the outer boundary of an object, the region features of the image are related to the whole shape region, the spatial relationship features are used for representing the mutual spatial position or relative direction relationship among a plurality of targets segmented in the image, and the relationship can also be divided into a connection/adjacency relationship, an overlapping/overlapping relationship, an inclusion/containment relationship and the like; in the module, the mapping characteristics of a plurality of mapping dimensions are obtained by respectively performing characteristic mapping on the image characteristics of the preprocessed target image and the image characteristics of each candidate image.
Optionally, the feature mapping module 12 is further configured to: respectively carrying out vector conversion on the preprocessed target image and each candidate image to obtain image vector characteristics;
mapping the image vector characteristics of the preprocessed target image and the image vector characteristics of each candidate image respectively according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set;
combining the image vector characteristics of the target image with the vector characteristics in the first mapping vector set respectively to obtain a first combined characteristic set, wherein the first combined characteristic set comprises at least one first image mapping characteristic corresponding to the target image;
combining the image vector characteristics of each candidate image with the vector characteristics respectively corresponding to the second mapping vector set to obtain a second combined characteristic set, wherein the second combined characteristic set comprises second image mapping characteristics corresponding to at least one candidate image;
wherein the image mapping feature comprises the first combined feature set and the second combined feature set.
Further, the feature mapping module 12 is further configured to: and if the Hamming distance corresponding to any sample image is smaller than a preset distance, determining the sample image as the candidate image.
And the feature matching module 13 is configured to perform feature matching on the target image and each candidate image according to the image mapping feature, and output a similar image of the target image in the image database according to a result of the feature matching. The feature matching result comprises feature similarities of the target image and the candidate images in different mapping dimensions, the target image and the candidate images are subjected to feature matching based on image mapping features, feature similarity calculation is respectively carried out on the target image and the candidate images in multiple mapping dimensions, the feature matching result is obtained, and similar images of the target image in the image database are output based on the feature similarities of the target image and the candidate images in the different mapping dimensions.
Optionally, the feature matching module 13 is further configured to: and performing similarity calculation on the combined features corresponding to the same preset mapping torque between the first combined feature set and the second combined feature set to obtain a feature matching result.
Further, the feature matching module 13 is further configured to: similarity calculation is carried out on mapping vector signs corresponding to the same preset mapping torque between the first mapping vector set and the second mapping vector set to obtain vector similarity;
and correcting the result of the feature matching according to the vector similarity.
In this embodiment, the preprocessed target image and each sample image are subjected to hash value matching, each sample image can be effectively subjected to image screening based on a hash value matching result, so as to delete an image with a large difference from the target image, the image features of the preprocessed target image and the image features of each candidate image are subjected to feature mapping, the target image and each candidate image can be effectively subjected to feature matching based on the image mapping features, similar images of the target image can be effectively determined based on the feature matching result, and the accuracy of image processing is improved.
Fig. 4 is a block diagram of a computer device 2 according to another embodiment of the present application. As shown in fig. 4, the computer device 2 of this embodiment includes: a processor 20, a memory 21 and a computer program 22, such as a program of an image processing method, stored in said memory 21 and executable on said processor 20. The processor 20 implements the steps in the embodiments of the respective image processing methods described above, such as S10 to S40 shown in fig. 1, or S31 to S34 shown in fig. 2, when executing the computer program 22. Alternatively, when the processor 20 executes the computer program 22, the functions of the units in the embodiment corresponding to fig. 3, for example, the functions of the units 10 to 13 shown in fig. 3, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 3, which is not repeated herein.
Illustratively, the computer program 22 may be divided into one or more units, which are stored in the memory 21 and executed by the processor 20 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 22 in the computer device 2. For example, the computer program 22 may be divided into an image preprocessing module 10, a hash value matching module 11, a feature mapping module 12, and a feature matching module 13, and the specific functions of the respective units are as described above.
The computer device may include, but is not limited to, a processor 20, a memory 21. Those skilled in the art will appreciate that fig. 4 is merely an example of a computer device 2 and is not intended to limit the computer device 2 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the computer device may also include input output devices, network access devices, buses, etc.
The processor 20 may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. The memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the computer device 2. The memory 21 is used for storing the computer program and other programs and data required by the computer device. The memory 21 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated module, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be non-volatile or volatile. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable storage medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable storage media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. An image processing method, comprising:
acquiring a target image, and performing image preprocessing on the target image;
performing hash value matching on the preprocessed target image and sample images in an image database to obtain a hash value matching result, screening each sample image according to the hash value matching result to obtain a candidate image, wherein the hash value matching result is used for representing the hash value similarity between the target image and the corresponding sample image;
respectively acquiring the image characteristics of the preprocessed target image and the image characteristics of each candidate image, and respectively performing characteristic mapping on the image characteristics of the preprocessed target image and the image characteristics of each candidate image to obtain image mapping characteristics;
and performing feature matching on the target image and each candidate image according to the image mapping features, and outputting similar images of the target image in the image database according to the result of the feature matching.
2. The image processing method according to claim 1, wherein the performing hash value matching on the preprocessed target image and the sample images in the image database comprises:
carrying out gray level processing on the preprocessed target image and each sample image respectively to obtain a target gray level image and a sample gray level image of each sample image;
respectively calculating pixel differences between adjacent pixels in the target gray level image and each sample gray level image to obtain a target difference set and a sample difference set;
respectively compiling hash values of the target difference set and each sample difference set to obtain a target difference hash and a sample difference hash;
and respectively calculating the Hamming distance between the target difference hash and each sample difference hash to obtain the hash value matching result.
3. The image processing method according to claim 1, wherein the obtaining the image features of the pre-processed target image and the image features of the candidate images, and performing feature mapping on the image features of the pre-processed target image and the image features of the candidate images, respectively, comprises:
respectively carrying out vector conversion on the preprocessed target image and each candidate image to obtain image vector characteristics;
mapping the image vector characteristics of the preprocessed target image and the image vector characteristics of each candidate image respectively according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set;
combining the image vector characteristics of the target image with the vector characteristics in the first mapping vector set respectively to obtain a first combined characteristic set, wherein the first combined characteristic set comprises at least one first image mapping characteristic corresponding to the target image;
combining the image vector characteristics of each candidate image with the vector characteristics respectively corresponding to the second mapping vector set to obtain a second combined characteristic set, wherein the second combined characteristic set comprises second image mapping characteristics corresponding to at least one candidate image;
wherein the image mapping feature comprises the first combined feature set and the second combined feature set.
4. The image processing method according to claim 3, wherein the performing feature matching on the target image and each candidate image comprises:
and performing similarity calculation on the combined features corresponding to the same preset mapping torque between the first combined feature set and the second combined feature set to obtain a feature matching result.
5. The image processing method according to claim 3, wherein after the mapping the image vector features of the preprocessed target image and candidate images respectively according to at least two preset mapping torques to obtain a first mapping vector set and a second mapping vector set, the method further comprises:
similarity calculation is carried out on mapping vector signs corresponding to the same preset mapping torque between the first mapping vector set and the second mapping vector set to obtain vector similarity;
and correcting the result of the feature matching according to the vector similarity.
6. The image processing method according to claim 2, wherein the screening of each sample image according to the hash value matching result to obtain a candidate image comprises:
and if the Hamming distance corresponding to any sample image is smaller than a preset distance, determining the sample image as the candidate image.
7. The image processing method according to any one of claims 1 to 6, wherein the image preprocessing the target image includes:
performing image compression on the target image, and performing gray level processing on the target image after the image compression;
and carrying out image corrosion processing on the target image after the gray processing, and carrying out image filtering processing on the target image after the image corrosion processing.
8. An image processing apparatus characterized by comprising:
the image preprocessing module is used for acquiring a target image and preprocessing the target image;
the hash value matching module is used for performing hash value matching on the preprocessed target image and sample images in an image database to obtain a hash value matching result, screening each sample image according to the hash value matching result to obtain a candidate image, and the hash value matching result is used for representing the hash value similarity between the target image and the corresponding sample image;
the feature mapping module is used for respectively acquiring the image features of the preprocessed target image and the image features of the candidate images, and respectively performing feature mapping on the image features of the preprocessed target image and the image features of the candidate images to obtain image mapping features;
and the feature matching module is used for performing feature matching on the target image and each candidate image according to the image mapping features and outputting a similar image of the target image in the image database according to the result of the feature matching.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210240229.7A CN114625906A (en) | 2022-03-10 | 2022-03-10 | Image processing method, image processing apparatus, computer device, and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210240229.7A CN114625906A (en) | 2022-03-10 | 2022-03-10 | Image processing method, image processing apparatus, computer device, and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114625906A true CN114625906A (en) | 2022-06-14 |
Family
ID=81901280
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210240229.7A Pending CN114625906A (en) | 2022-03-10 | 2022-03-10 | Image processing method, image processing apparatus, computer device, and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114625906A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7761466B1 (en) * | 2007-07-30 | 2010-07-20 | Hewlett-Packard Development Company, L.P. | Hash-based image identification |
CN110516100A (en) * | 2019-08-29 | 2019-11-29 | 武汉纺织大学 | A kind of calculation method of image similarity, system, storage medium and electronic equipment |
CN110738236A (en) * | 2019-09-16 | 2020-01-31 | 深圳市国信合成科技有限公司 | Image matching method and device, computer equipment and storage medium |
CN112559792A (en) * | 2020-12-22 | 2021-03-26 | 中国科学院合肥物质科学研究院 | Similarity-based pest image retrieval method |
CN112651953A (en) * | 2020-12-31 | 2021-04-13 | 平安国际智慧城市科技股份有限公司 | Image similarity calculation method and device, computer equipment and storage medium |
-
2022
- 2022-03-10 CN CN202210240229.7A patent/CN114625906A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7761466B1 (en) * | 2007-07-30 | 2010-07-20 | Hewlett-Packard Development Company, L.P. | Hash-based image identification |
CN110516100A (en) * | 2019-08-29 | 2019-11-29 | 武汉纺织大学 | A kind of calculation method of image similarity, system, storage medium and electronic equipment |
CN110738236A (en) * | 2019-09-16 | 2020-01-31 | 深圳市国信合成科技有限公司 | Image matching method and device, computer equipment and storage medium |
CN112559792A (en) * | 2020-12-22 | 2021-03-26 | 中国科学院合肥物质科学研究院 | Similarity-based pest image retrieval method |
CN112651953A (en) * | 2020-12-31 | 2021-04-13 | 平安国际智慧城市科技股份有限公司 | Image similarity calculation method and device, computer equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101770582B (en) | Image matching system and method | |
CN111340109B (en) | Image matching method, device, equipment and storage medium | |
CN110705583A (en) | Cell detection model training method and device, computer equipment and storage medium | |
CN110969046B (en) | Face recognition method, face recognition device and computer-readable storage medium | |
CN111079764A (en) | Low-illumination license plate image recognition method and device based on deep learning | |
CN110648284B (en) | Image processing method and device with uneven illumination | |
CN111882565B (en) | Image binarization method, device, equipment and storage medium | |
CN112507897A (en) | Cross-modal face recognition method, device, equipment and storage medium | |
CN113255433A (en) | Model training method, device and computer storage medium | |
CN111179270A (en) | Image co-segmentation method and device based on attention mechanism | |
CN109829857A (en) | A kind of antidote and device based on the tilted image for generating confrontation network | |
CN111539975B (en) | Method, device, equipment and storage medium for detecting moving object | |
CN117078970A (en) | Picture identification method and device, electronic equipment and storage medium | |
CN108647680B (en) | Image positioning frame detection method and device | |
WO2020119058A1 (en) | Micro-expression description method and device, computer device and readable storage medium | |
CN111340722A (en) | Image processing method, processing device, terminal device and readable storage medium | |
CN114625906A (en) | Image processing method, image processing apparatus, computer device, and medium | |
CN114329024A (en) | Icon searching method and system | |
CN112487943B (en) | Key frame de-duplication method and device and electronic equipment | |
KR102361444B1 (en) | System and method of quality adjustment of object detection based on polyggon | |
US10679336B2 (en) | Detecting method, detecting apparatus, and computer readable storage medium | |
CN114693919A (en) | Target detection method, terminal equipment and storage medium | |
CN111160363B (en) | Method and device for generating feature descriptors, readable storage medium and terminal equipment | |
CN114332890A (en) | Table structure extraction method and device, electronic equipment and storage medium | |
CN113610071A (en) | Face living body detection method and device, electronic equipment and storage medium |
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 |