CN110516100A - A kind of calculation method of image similarity, system, storage medium and electronic equipment - Google Patents
A kind of calculation method of image similarity, system, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN110516100A CN110516100A CN201910809700.8A CN201910809700A CN110516100A CN 110516100 A CN110516100 A CN 110516100A CN 201910809700 A CN201910809700 A CN 201910809700A CN 110516100 A CN110516100 A CN 110516100A
- Authority
- CN
- China
- Prior art keywords
- image
- singular value
- target
- obtains
- subgraph
- 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
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
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/30—Noise filtering
Abstract
The present invention provides a kind of calculation method of image similarity, system, storage medium and electronic equipment, method includes: the gray level image for obtaining image to be processed, and image to be processed includes target image and contrast images;Singular value decomposition is carried out to gray level image and obtains several subgraphs, the subgraph for choosing wherein preset quantity restores to obtain processing image;Wavelet transform is carried out to processing image and obtains low frequency subgraph picture;The size of adjustment low frequency subgraph picture obtains standard picture;The Hash codes that standard picture is converted into preset length are encoded by Hash, target image corresponds to target hash code, the corresponding comparison Hash codes of contrast images;It calculates target hash code and compares the Hamming distance of Hash codes, the image similarity of target image and contrast images is calculated according to Hamming distance.The present invention eliminates influence of the picture noise to calculating by singular value decomposition, then carries out wavelet transform to image and avoids blocking artifact, improves robustness.
Description
Technical field
The present invention relates to field of image search, espespecially a kind of calculation method of image similarity, system, storage medium and electricity
Sub- equipment.
Background technique
Image is the information carrier in people's life, how rapidly, accurately to be completed in huge image library similar
The retrieval of picture becomes a popular project, and for the important step of the retrieval of similar pictures is exactly the similarity of image
It calculates.The quick calculating of image similarity can use hash algorithm, and picture signal is exactly compressed to a regular length
Cryptographic Hash.Existing hash method is broadly divided into two major classes: (1) general to pass through depth mind in the hash method of supervised learning
Hash codes through e-learning image, to obtain similar picture;(2) general logical in the hash method of unsupervised learning
The binary bits string by the data projection of higher-dimension for low-dimensional is crossed, is obtained by the distance between calculating binary bits string similar
Picture.
The hash method of supervised learning is based on depth network training and a large amount of data set is needed to go training pattern, causes entire
The speed of retrieval is slow;Have the following problems in the hash method of unsupervised learning: a is based on the Kazakhstan of singular value decomposition (SVD decomposition)
Although uncommon method geometric transformation has certain robustness, there is higher misclassification probability;B is based on discrete cosine transform
The hash method of (discrete cosine transform, DCT), although substantive approach is high to the robustness of JPEG picture,
It is not account for contacting between picture block and block since Block DCT is there are blocking artifact, so method is whole
Robustness it is not high;C is based on the Hash side of principal component analysis (principal components analysis, PCA) and DCT
Method, although it is contemplated that edge feature, but overall robustness is also high.
Summary of the invention
The object of the present invention is to provide a kind of calculation method of image similarity, system, storage medium and electronic equipments, real
Influence of the picture noise to calculating is now eliminated by singular value decomposition, wavelet transform then is carried out to image, square is avoided to imitate
It answers, improves robustness.
Technical solution provided by the invention is as follows:
The present invention provides a kind of calculation method of image similarity, comprising:
The gray level image of image to be processed is obtained, the image to be processed includes target image and contrast images;
Singular value decomposition is carried out to the gray level image and obtains several subgraphs, chooses the subgraph of wherein preset quantity
Picture;
It is restored to obtain processing image according to the subgraph of the preset quantity;
Wavelet transform is carried out to the processing image and obtains low frequency subgraph picture;
The size for adjusting the low frequency subgraph picture obtains standard picture;
The Hash codes that the standard picture is converted into preset length are encoded by Hash, the target image corresponds to target
Hash codes, the corresponding comparison Hash codes of the contrast images;
It calculates the target hash code and compares the Hamming distance of Hash codes, target image is calculated according to the Hamming distance
With the image similarity of contrast images.
Further, the gray level image of image to be processed is obtained, the image to be processed includes target image and comparison
Image specifically includes:
Image to be processed is obtained, the image to be processed includes target image and contrast images;
If the image to be processed is non-gray level image, the image progress gray processing to be processed is handled to obtain described
Gray level image.
Further, singular value decomposition is carried out to the gray level image and obtains several subgraphs, choose wherein present count
The subgraph of amount specifically includes:
Defining the gray level image is m × n rank matrix A, carries out singular value decomposition to matrix A, obtainsWherein, U is the orthogonal matrix of m × m rank, VTFor the orthogonal matrix of n × n rank, Σ is that singular value is diagonal
Matrix, r are the number that gray level image carries out the subgraph obtained after singular value decomposition, σiFor the singular value of the i-th width subgraph,
uiIt is singular value σ for the i-th column of matrix UiLeft singular vector, vi TFor matrix VTI-th column be singular value σiThe right side it is unusual to
Amount, if Δr=diag (σ1,σ2,…σr), then
Singular value is ranked up according to descending sequence, the singular value for choosing the preset quantity in sequence forefront is corresponding
Subgraph.
Further, it calculates the target hash code and compares the Hamming distance of Hash codes, according to the Hamming distance meter
The image similarity for calculating target image and contrast images specifically includes:
Hamming distance D is calculated according to target hash code and comparison Hash codes(x,y),Wherein, xk
For the code sign of k-th of position of target hash code, ykFor the code sign for comparing k-th of position of Hash codes, l is the length of Hash codes
Degree,For mould 2 plus operation;
According to the Hamming distance D(x,y)Calculate the image similarity sim (M of target image and contrast images1,M2),Wherein, M1And M2Target image and contrast images are respectively indicated, m and n indicate target
The size of image and contrast images is m × n.
The present invention also provides a kind of computing systems of image similarity, comprising:
Image collection module, obtains the gray level image of image to be processed, the image to be processed include target image and
Contrast images;
Image processing module obtains if obtaining the gray level image that module obtains to described image and carrying out singular value decomposition
Dry subgraph, chooses the subgraph of wherein preset quantity, is restored to obtain processing image according to the subgraph of the preset quantity;
Image transform module carries out wavelet transform to the processing image that described image processing module obtains and obtains
Low frequency subgraph picture;
The size of size adjustment module, the low frequency subgraph picture that adjustment described image conversion module obtains obtains standard drawing
Picture;
Hash codes conversion module is converted by the standard picture that Hash coding obtains the size adjustment module
The Hash codes of preset length, the target image correspond to target hash code, the corresponding comparison Hash codes of the contrast images;
Similarity calculation module calculates the target hash code and comparison Hash codes that the Hash codes conversion module obtains
Hamming distance, according to the Hamming distance calculate target image and contrast images image similarity.
Further, described image obtains module and specifically includes:
Image acquisition unit, obtains image to be processed, and the image to be processed includes target image and contrast images;
Gray scale processing unit is right if the image to be processed that described image acquiring unit obtains is non-gray level image
The image to be processed carries out gray processing and handles to obtain the gray level image.
Further, described image processing module specifically includes:
Singular value decomposition unit, defining described image and obtaining the gray level image that module obtains is m × n rank matrix A, right
Matrix A carries out singular value decomposition, obtainsWherein, U is the orthogonal matrix of m × m rank, VTFor n × n
The orthogonal matrix of rank, Σ are singular value diagonal matrix, and r is the number that gray level image carries out the subgraph obtained after singular value decomposition
Mesh, σiFor the singular value of the i-th width subgraph, uiIt is singular value σ for the i-th column of matrix UiLeft singular vector, vi TFor matrix VT's
I-th column are singular value σiRight singular vector, if Δr=diag (σ1,σ2,…σr), then
Image selection unit is arranged according to the singular value that descending sequence determines the singular value decomposition unit
Sequence chooses the corresponding subgraph of singular value of the preset quantity in sequence forefront;
The subgraph of image restoring unit, the preset quantity chosen according to described image selection unit restores everywhere
Manage image.
Further, the similarity calculation module specifically includes:
Hamming distance computing unit calculates Hamming distance D according to target hash code and comparison Hash codes(x,y),Wherein, xkFor the code sign of k-th of position of target hash code, ykFor comparison Hash codes k-th
The code sign set, l are the length of Hash codes,For mould 2 plus operation;
Similarity calculated, the Hamming distance D obtained according to the Hamming distance computing unit(x,y)Calculate target
Image similarity sim (the M of image and contrast images1,M2),Wherein, M1And M2Point
Not Biao Shi target image and contrast images, m and n indicate that the size of target image and contrast images is m × n.
The present invention also provides a kind of storage medium, computer program, the computer program are stored on the storage medium
Above-mentioned any one method is realized when being executed by processor.
The present invention also provides a kind of electronic equipment, including memory and processor, stored on a processor on memory
The computer program of operation, the processor realize above-mentioned any one method when executing the computer program.
Calculation method, system, storage medium and the electronic equipment of a kind of image similarity provided through the invention, pass through
Singular value decomposition eliminates influence of the picture noise to calculating, then carries out wavelet transform to image and avoids blocking artifact, mentions
Robustness is risen.
Detailed description of the invention
Below by clearly understandable mode, preferred embodiment is described with reference to the drawings, to a kind of meter of image similarity
Calculation method, system, storage medium and electronic equipment above-mentioned characteristic, technical characteristic, advantage and its implementation give further
Explanation.
Fig. 1 is a kind of flow chart of one embodiment of the calculation method of image similarity of the present invention;
Fig. 2 is a kind of flow chart of another embodiment of the calculation method of image similarity of the present invention;
Fig. 3 is the schematic diagram that wavelet transform is carried out to image;
Fig. 4 is the low frequency subgraph picture for obtain after wavelet transform to image;
Fig. 5 is the vertical subgraph for obtain after wavelet transform to image;
Fig. 6 is the horizontal subgraph for obtain after wavelet transform to image;
Fig. 7 is the diagonal line subgraph for obtain after wavelet transform to image;
Fig. 8 (a) is the original image before carrying out image transformation;
Fig. 8 (b) is the image for carrying out obtaining after the overturning of left and right to original image;
Fig. 8 (c) is the image for obtain after Gaussian Blur to original image;
Fig. 8 (d) is the image for obtain after anticlockwise to original image;
Fig. 8 (e) is to the image obtained after original image minification;
Fig. 8 (f) is that the image obtained after Gaussian noise and salt-pepper noise is added to original image;
Fig. 8 (g) is to the image obtained after original image enhancing contrast and brightness;
Fig. 9 is a kind of structural schematic diagram of one embodiment of the computing system of image similarity of the present invention.
Specific embodiment
It, below will be to ordinarily in order to clearly illustrate the embodiment of the present invention or technical solution in the prior art
Bright book Detailed description of the invention a specific embodiment of the invention.It should be evident that the accompanying drawings in the following description is only of the invention one
A little embodiments for those of ordinary skill in the art without creative efforts, can also be according to these
Attached drawing obtains other attached drawings, and obtains other embodiments.
In order to make simplified form, part related to the present invention is only schematically shown in each figure, their not generations
Its practical structures as product of table.In addition, there is identical structure or function in some figures to be easy to understand simplified form
Component, only symbolically depict one of those, or only marked one of those.Herein, "one" not only table
Show " only this ", can also indicate the situation of " more than one ".
One embodiment of the present of invention, as shown in Figure 1, a kind of calculation method of image similarity, comprising:
S100 obtains the gray level image of image to be processed, and the image to be processed includes target image and contrast images;
S200 carries out singular value decomposition to the gray level image and obtains several subgraphs, chooses the son of wherein preset quantity
Image;
S300 restores to obtain processing image according to the subgraph of the preset quantity;
S400 carries out wavelet transform to the processing image and obtains low frequency subgraph picture;
The size that S500 adjusts the low frequency subgraph picture obtains standard picture;
S600 encodes the Hash codes that the standard picture is converted into preset length by Hash, and the target image is corresponding
Target hash code, the corresponding comparison Hash codes of the contrast images;
S700 calculates the target hash code and compares the Hamming distance of Hash codes, calculates target according to the Hamming distance
The image similarity of image and contrast images.
Specifically, obtaining the gray level image of image to be processed first in the present embodiment, which can be to be processed
Image itself is exactly gray level image, is also possible to carry out the image obtained after gray proces to non-gray level image.Wherein, wait locate
Reason image includes target image and contrast images, and target image is the image of similarity to be identified, and contrast images are for comparing
The reference picture of similarity, contrast images can be a width, are also possible to several.Target image and contrast images are input to simultaneously
It is handled simultaneously when system, and target image is identical with the size of contrast images, is m × n.
Singular value decomposition is carried out to the gray level image of acquisition and obtains several subgraphs, the corresponding surprise of each width subgraph
Different value, and the most information of image all concentrates in the biggish singular value in front, lesser singular value is for entire image
Contribution is smaller, therefore can take the corresponding subgraph of the biggish singular value in front to replace entire image to choose wherein present count
The subgraph of amount, to eliminate influence of the noise to calculating.In general the corresponding subgraph of 60-80 singular value also original image is taken
The effect of piece is best.It is restored to obtain processing image according to the subgraph of the preset quantity of selection.
Wavelet transform is carried out to the processing image after reduction and resolves into four subgraph low frequency component LL, horizontal point
LH, vertical component HL, diagonal components HH are measured, the low frequency subgraph picture due to wherein only retaining low frequency component contains processing image
In most information, therefore, only retain low frequency subgraph picture.For carrying out wavelet transform, parameter therein is carried out
Discretization improves the calculating speed of system.
Low frequency subgraph picture obtains standard picture by certain size adjusting, and the size of standard picture can be according to system
Processing requirement carries out corresponding setting adjustment.Then the Hash codes that standard picture is converted into preset length are encoded by Hash,
It is defined as target hash code according to the finally obtained Hash codes of target image, is defined according to the finally obtained Hash codes of contrast images
To compare Hash codes.Hash coding includes the modes such as character string Hash coding and binary system Hash coding.For example, calculating standard drawing
The pixel average of picture traverses the pixel value of all pixels point, is denoted as 1 greater than average value, others are denoted as 0, obtain 256
Binary system Hash codes.
Then it calculates target hash code and compares the Hamming distance of Hash codes, target image and right is calculated according to Hamming distance
Than the image similarity of image, and exported.
The present invention eliminates influence of the picture noise to calculating by singular value decomposition, then carries out discrete wavelet transformer to image
It changes and chooses low frequency subgraph picture therein rather than image is split, avoid blocking artifact, improve robustness.
In other embodiment of the present invention, S100 obtains the gray level image of image to be processed, the image packet to be processed
Include target image and contrast images specifically include: S110 obtains image to be processed, and the image to be processed includes target image
And contrast images;If the S120 image to be processed is non-gray level image, the image to be processed is carried out at gray processing
Reason obtains the gray level image, carries out Hash coding according to the image obtained after processing convenient for subsequent.
Specifically, needing the image to be processed obtained to system to be identified and handled, most due to system in the present embodiment
It is to handle gray level image eventually, it is therefore desirable to image to be processed is identified, it, can be with if being all gray level image
Continue subsequent treatment process.If any one image to be processed is non-gray level image, need to carry out corresponding image
Gray processing handles to obtain gray level image.Similarly, the size of image to be processed needs identical, it is therefore desirable to figure to be processed
As being identified, then handles to identical, be m × n.
Another embodiment of the invention is the optimal enforcement example of the above embodiments, as shown in Fig. 2, the present embodiment with
The above embodiments are compared, and main improve is, S200 carries out singular value decomposition to the gray level image and obtains several subgraphs
Picture, the subgraph for choosing wherein preset quantity specifically include:
It is m × n rank matrix A that S210, which defines the gray level image, carries out singular value decomposition to matrix A, obtainsWherein, U is the orthogonal matrix of m × m rank, VTFor the orthogonal matrix of n × n rank, Σ is that singular value is diagonal
Matrix, r are the number that gray level image carries out the subgraph obtained after singular value decomposition, σiFor the singular value of the i-th width subgraph,
uiIt is singular value σ for the i-th column of matrix UiLeft singular vector, vi TFor matrix VTI-th column be singular value σiThe right side it is unusual to
Amount, if Δr=diag (σ1,σ2,…σr), then
S220 is ranked up singular value according to descending sequence, chooses the singular value of the preset quantity in sequence forefront
Corresponding subgraph.
Specifically, in the present embodiment, it is assumed that pure picture signal is Y [n], and noise signal is Z [n], then comprising noise
Picture signal can be expressed as X [n]=Y [n]+Z [n] (n=0,1,2 ..., K-1), and K is the length of input data.It therefore can root
The Hankel matrix R of M × N rank is established according to the picture signal comprising noise,
Wherein M >=N, and M+N=K+1.
M × n rank Hankel matrix A is established according to gray level image, singular value decomposition is carried out to gray level image, obtains three squares
Battle array, the orthogonal matrix V of orthogonal matrix U, n × n rank of m × m rankTAnd singular value diagonal matrix Σ, determine corresponding singular value, with
And left singular vector and right singular vector.To which gray level image is resolved into several corresponding subgraphs according to singular value.By
It is all concentrated in the corresponding subgraph of the biggish singular value in front in the most information of image, therefore according to descending suitable
Ordered pair singular value is ranked up, and the corresponding subgraph of singular value for choosing the preset quantity in sequence forefront is restored later.One
As for take the effect of the corresponding subgraph of 60-80 singular value also original picture best.
As shown in figure 3, image is every to pass through a sparse transformation, pass through different low-pass filter H [n] and high-pass filter G
[n] is decomposed, and obtains four components LL, LH, HL, HH by desampling fir filter Q, and wherein LL indicates the low frequency of approximation coefficient
Component, LH, HL, HH indicate three high fdrequency components, respectively horizontal, vertical, diagonal component.By wavelet transformation it
For four components obtained afterwards respectively as shown in Fig. 4, Fig. 5 Fig. 6 and Fig. 7, the corresponding low frequency subgraph picture of low frequency component includes transformation
The most information of preceding image, therefore only need to obtain low frequency component LL.
The subgraph comprising gray level image most information that the present invention chooses preset quantity restores, after being then used as
The object of continuous processing, on the one hand reduces system information to be treated, on the other hand remains the major part in gray level image again
Information.
In other embodiment of the present invention, S700 calculates the target hash code and compares the Hamming distance of Hash codes,
Specifically included according to the image similarity that the Hamming distance calculates target image and contrast images: S710 is according to target hash code
Hamming distance D is calculated with comparison Hash codes(x,y),Wherein, xkFor k-th of position of target hash code
Code sign, ykFor the code sign for comparing k-th of position of Hash codes, l is the length of Hash codes,For mould 2 plus operation;S720 root
According to the Hamming distance D(x,y)Calculate the image similarity sim (M of target image and contrast images1,M2),Wherein, M1And M2Target image and contrast images are respectively indicated, m and n indicate target
The size of image and contrast images is m × n.
Specifically, calculating target hash code in the present embodiment and comparing the Hamming distance of Hash codes, for example, when using two
When the mode of system Hash coding obtains corresponding target hash code and comparison Hash codes, xkFor k-th of position of target hash code
Code sign, xk∈ { 0,1 }, ykFor the code sign for comparing k-th of position of Hash codes.yk∈ { 0,1 }, then one by one to each
The code sign of position carries out mould 2 plus operation, finally obtains mutual Hamming distance.Later according to Hamming distance and target
The similarity of the size of image and contrast images calculating image.
In other embodiment of the present invention, randomly select any one width original image, to original image such as Fig. 8 (a) into
The transformation of row image, shown in effect such as Fig. 8 (b), 8 (c), 8 (d), 8 (e), 8 (f), 8 (g) after converting, image transformation include but
Be not limited to overturning, rotation, minification etc. operation, then according to the method described above (SVD-DWT Hash), based on DCT hash method,
Image similarity calculating is carried out based on PCA-DCT hash method and difference hash method, is then compared, similarity calculation
And comparing result such as table 1 as a result.
1 image similarity calculated result of table
One embodiment of the present of invention, as shown in figure 9, a kind of computing system 100 of image similarity, comprising:
Image collection module 110, obtains the gray level image of image to be processed, the image to be processed include target image with
And contrast images;
Described image obtains module 110 and specifically includes:
Image acquisition unit 111, obtains image to be processed, and the image to be processed includes target image and comparison diagram
Picture;
Gray scale processing unit 112, if the image to be processed that described image acquiring unit 111 obtains is non-grayscale image
Picture then carries out gray processing to the image to be processed and handles to obtain the gray level image;
Image processing module 120 obtains the gray level image that module 110 obtains to described image and carries out singular value decomposition
Several subgraphs are obtained, the subgraph of wherein preset quantity is chosen, restores everywhere according to the subgraph of the preset quantity
Manage image;
Described image processing module 120 specifically includes:
Singular value decomposition unit 121, defining described image and obtaining the gray level image that module 110 obtains is m × n rank square
Battle array A carries out singular value decomposition to matrix A, obtainsWherein, U is the orthogonal matrix of m × m rank, VT
For the orthogonal matrix of n × n rank, Σ is singular value diagonal matrix, and r is that gray level image carries out the subgraph obtained after singular value decomposition
Number, σiFor the singular value of the i-th width subgraph, uiIt is singular value σ for the i-th column of matrix UiLeft singular vector, vi TFor matrix
VTI-th column be singular value σiRight singular vector, if Δr=diag (σ1,σ2,…σr), then
Image selection unit 122, the singular value that the singular value decomposition unit 121 is determined according to descending sequence
It is ranked up, chooses the corresponding subgraph of singular value of the preset quantity in sequence forefront;
The subgraph of image restoring unit 123, the preset quantity chosen according to described image selection unit 122 restores
Obtain processing image;
Image transform module 130 carries out discrete wavelet transformer to the processing image that described image processing module 120 obtains
Get low frequency subgraph picture in return;
The size of size adjustment module 140, the low frequency subgraph picture that adjustment described image conversion module 130 obtains obtains
Standard picture;
Hash codes conversion module 150 encodes the standard picture for obtaining the size adjustment module 140 by Hash
The Hash codes of preset length are converted into, the target image corresponds to target hash code, the corresponding comparison Hash codes of the contrast images;
Similarity calculation module 160 calculates the target hash code and comparison that the Hash codes conversion module 150 obtains
The Hamming distance of Hash codes calculates the image similarity of target image and contrast images according to the Hamming distance;
The similarity calculation module 160 specifically includes:
Hamming distance computing unit 161 calculates Hamming distance D according to target hash code and comparison Hash codes(x,y),Wherein, xkFor the code sign of k-th of position of target hash code, ykFor comparison Hash codes k-th
The code sign set, l are the length of Hash codes,For mould 2 plus operation;
Similarity calculated 162, the Hamming distance D obtained according to the Hamming distance computing unit 161(x,y)Meter
Calculate the image similarity sim (M of target image and contrast images1,M2),Wherein, M1
And M2Target image and contrast images are respectively indicated, m and n indicate that the size of target image and contrast images is m × n.
The concrete operations mode of modules in the present embodiment has been carried out in above-mentioned corresponding embodiment of the method
Detailed description, therefore no longer repeated one by one.
An embodiment provides a kind of computer readable storage mediums, are stored thereon with computer program,
All method and steps or Part Methods step in first embodiment are realized when the computer program is executed by processor.
The present invention realizes all or part of the process in above-mentioned first embodiment method, can also by computer program come
Relevant hardware is instructed to complete, the computer program can be stored in a computer readable storage medium, the computer
Program is when being executed by processor, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes meter
Calculation machine program code, the computer program code can be source code form, object identification code form, executable file or certain
Intermediate form etc..The computer-readable medium may include: can carry the computer program code any entity or
Device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software
Distribution medium etc..It should be noted that the content that the computer-readable medium includes can be according to making laws in jurisdiction
Requirement with patent practice carries out increase and decrease appropriate, such as in certain jurisdictions, according to legislation and patent practice, computer
Readable medium does not include electric carrier signal and telecommunication signal.
One embodiment of the present of invention also provides a kind of electronic equipment, including memory and processor, stores on memory
There is the computer program run on a processor, the processor is realized in first embodiment when executing the computer program
All method and steps or Part Methods step.
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng the processor is the control centre of the computer installation, utilizes various interfaces and the entire computer installation of connection
Various pieces.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes
Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization
The various functions of computer installation.The memory can mainly include storing program area and storage data area, wherein storage program
It area can application program (such as sound-playing function, image player function etc.) needed for storage program area, at least one function
Deng;Storage data area, which can be stored, uses created data (such as audio data, video data etc.) etc. according to mobile phone.This
Outside, memory may include high-speed random access memory, can also include nonvolatile memory, such as hard disk, memory, insert
Connect formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory
Block (Flash Card), at least one disk memory, flush memory device or other volatile solid-state parts.
It should be noted that above-described embodiment can be freely combined as needed.The above is only of the invention preferred
Embodiment, it is noted that for those skilled in the art, in the premise for not departing from the principle of the invention
Under, several improvements and modifications can also be made, these modifications and embellishments should also be considered as the scope of protection of the present invention.
Claims (10)
1. a kind of calculation method of image similarity characterized by comprising
The gray level image of image to be processed is obtained, the image to be processed includes target image and contrast images;
Singular value decomposition is carried out to the gray level image and obtains several subgraphs, chooses the subgraph of wherein preset quantity;
It is restored to obtain processing image according to the subgraph of the preset quantity;
Wavelet transform is carried out to the processing image and obtains low frequency subgraph picture;
The size for adjusting the low frequency subgraph picture obtains standard picture;
The Hash codes that the standard picture is converted into preset length are encoded by Hash, the target image corresponds to target Hash
Code, the corresponding comparison Hash codes of the contrast images;
It calculates the target hash code and compares the Hamming distance of Hash codes, target image and right is calculated according to the Hamming distance
Than the image similarity of image.
2. the calculation method of image similarity according to claim 1, which is characterized in that obtain the gray scale of image to be processed
Image, the image to be processed include that target image and contrast images specifically include:
Image to be processed is obtained, the image to be processed includes target image and contrast images;
If the image to be processed is non-gray level image, gray processing is carried out to the image to be processed and handles to obtain the gray scale
Image.
3. the calculation method of image similarity according to claim 1, which is characterized in that carried out to the gray level image odd
Different value decomposes to obtain several subgraphs, and the subgraph for choosing wherein preset quantity specifically includes:
Defining the gray level image is m × n rank matrix A, carries out singular value decomposition to matrix A, obtainsWherein, U is the orthogonal matrix of m × m rank, VTFor the orthogonal matrix of n × n rank, Σ is that singular value is diagonal
Matrix, r are the number that gray level image carries out the subgraph obtained after singular value decomposition, σiFor the singular value of the i-th width subgraph,
uiIt is singular value σ for the i-th column of matrix UiLeft singular vector, vi TFor matrix VTI-th column be singular value σiThe right side it is unusual to
Amount, if Δr=diag (σ1,σ2,…σr), then
Singular value is ranked up according to descending sequence, chooses the corresponding son of singular value of the preset quantity in sequence forefront
Image.
4. the calculation method of image similarity according to claim 3, which is characterized in that calculate the target hash code and
The Hamming distance for comparing Hash codes is specifically wrapped according to the image similarity that the Hamming distance calculates target image and contrast images
It includes:
Hamming distance D is calculated according to target hash code and comparison Hash codes(x,y),Wherein, xkFor mesh
Mark the code sign of k-th of position of Hash codes, ykFor the code sign for comparing k-th of position of Hash codes, l is the length of Hash codes,
For mould 2 plus operation;
According to the Hamming distance D(x,y)Calculate the image similarity sim (M of target image and contrast images1,M2),Wherein, M1And M2Target image and contrast images are respectively indicated, m and n indicate mesh
The size of logo image and contrast images is m × n.
5. a kind of computing system of image similarity characterized by comprising
Image collection module, obtains the gray level image of image to be processed, and the image to be processed includes target image and comparison
Image;
Image processing module obtains the gray level image progress singular value decomposition that module obtains to described image and obtains several
Subgraph chooses the subgraph of wherein preset quantity, is restored to obtain processing image according to the subgraph of the preset quantity;
Image transform module carries out wavelet transform to the processing image that described image processing module obtains and obtains low frequency
Subgraph;
The size of size adjustment module, the low frequency subgraph picture that adjustment described image conversion module obtains obtains standard picture;
Hash codes conversion module is converted into presetting by the standard picture that Hash coding obtains the size adjustment module
The Hash codes of length, the target image correspond to target hash code, the corresponding comparison Hash codes of the contrast images;
Similarity calculation module calculates the Chinese of the target hash code and comparison Hash codes that the Hash codes conversion module obtains
Prescribed distance calculates the image similarity of target image and contrast images according to the Hamming distance.
6. the computing system of image similarity according to claim 5, which is characterized in that it is specific that described image obtains module
Include:
Image acquisition unit, obtains image to be processed, and the image to be processed includes target image and contrast images;
Gray scale processing unit, if the image to be processed that described image acquiring unit obtains is non-gray level image, to described
Image to be processed carries out gray processing and handles to obtain the gray level image.
7. the computing system of image similarity according to claim 5, which is characterized in that described image processing module is specific
Include:
Singular value decomposition unit, defining described image and obtaining the gray level image that module obtains is m × n rank matrix A, to matrix
A carries out singular value decomposition, obtainsWherein, U is the orthogonal matrix of m × m rank, VTFor n × n rank
Orthogonal matrix, Σ are singular value diagonal matrix, and r is the number that gray level image carries out the subgraph obtained after singular value decomposition, σi
For the singular value of the i-th width subgraph, uiIt is singular value σ for the i-th column of matrix UiLeft singular vector, vi TFor matrix VTI-th column
That is singular value σiRight singular vector, if Δr=diag (σ1,σ2,…σr), then
Image selection unit is ranked up according to the singular value that descending sequence determines the singular value decomposition unit,
Choose the corresponding subgraph of singular value of the preset quantity in sequence forefront;
The subgraph of image restoring unit, the preset quantity chosen according to described image selection unit restores to obtain processing figure
Picture.
8. the computing system of image similarity according to claim 7, which is characterized in that the similarity calculation module tool
Body includes:
Hamming distance computing unit calculates Hamming distance D according to target hash code and comparison Hash codes(x,y),Wherein, xkFor the code sign of k-th of position of target hash code, ykFor comparison Hash codes k-th
The code sign set, l are the length of Hash codes,For mould 2 plus operation;
Similarity calculated, the Hamming distance D obtained according to the Hamming distance computing unit(x,y)Calculate target image
With the image similarity sim (M of contrast images1,M2),Wherein, M1And M2Table respectively
Show that target image and contrast images, m and n indicate that the size of target image and contrast images is m × n.
9. a kind of storage medium, computer program is stored on the storage medium, it is characterised in that: the computer program is located
It manages when device executes and realizes the described in any item methods of Claims 1-4.
10. a kind of electronic equipment, including memory and processor, the computer journey run on a processor is stored on memory
Sequence, it is characterised in that: the processor realizes the described in any item methods of Claims 1-4 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910809700.8A CN110516100A (en) | 2019-08-29 | 2019-08-29 | A kind of calculation method of image similarity, system, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910809700.8A CN110516100A (en) | 2019-08-29 | 2019-08-29 | A kind of calculation method of image similarity, system, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110516100A true CN110516100A (en) | 2019-11-29 |
Family
ID=68628055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910809700.8A Pending CN110516100A (en) | 2019-08-29 | 2019-08-29 | A kind of calculation method of image similarity, system, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110516100A (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111091128A (en) * | 2019-12-18 | 2020-05-01 | 北京数衍科技有限公司 | Character and picture classification method and device and electronic equipment |
CN111191058A (en) * | 2019-12-27 | 2020-05-22 | 青岛海洋科学与技术国家实验室发展中心 | Picture retrieval method |
CN111709913A (en) * | 2020-05-21 | 2020-09-25 | 四川虹美智能科技有限公司 | Method, device and system for detecting deteriorated food in refrigerator |
CN112001430A (en) * | 2020-08-07 | 2020-11-27 | 海尔优家智能科技(北京)有限公司 | Refrigerator food material detection method and device, storage medium and electronic device |
CN112115295A (en) * | 2020-08-27 | 2020-12-22 | 广州华多网络科技有限公司 | Video image detection method and device and electronic equipment |
CN112215302A (en) * | 2020-10-30 | 2021-01-12 | Oppo广东移动通信有限公司 | Image identification method and device and terminal equipment |
CN112926617A (en) * | 2019-12-06 | 2021-06-08 | 顺丰科技有限公司 | Packaging change detection method and device, cloud computer equipment and storage medium |
CN113222930A (en) * | 2021-05-08 | 2021-08-06 | 厦门服云信息科技有限公司 | Malicious flow detection method based on image analysis, terminal device and storage medium |
CN113497781A (en) * | 2020-03-19 | 2021-10-12 | 中国电信股份有限公司 | Phishing website identification method and device and computer readable storage medium |
CN114758160A (en) * | 2022-06-16 | 2022-07-15 | 山东捷瑞数字科技股份有限公司 | Image comparison method and device based on three-dimensional engine and medium thereof |
CN114913350A (en) * | 2022-04-19 | 2022-08-16 | 深圳市东信时代信息技术有限公司 | Material duplicate checking method, device, equipment and storage medium |
CN115187570A (en) * | 2022-07-27 | 2022-10-14 | 北京拙河科技有限公司 | Singular traversal retrieval method and device based on DNN deep neural network |
CN116421140A (en) * | 2023-06-12 | 2023-07-14 | 杭州目乐医疗科技股份有限公司 | Fundus camera control method, fundus camera, and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103955879A (en) * | 2014-04-11 | 2014-07-30 | 杭州电子科技大学 | DWT-SVD robust blind watermark method based on multilevel DCT |
CN104182538A (en) * | 2014-09-01 | 2014-12-03 | 西安电子科技大学 | Semi-supervised hash based image retrieval method |
CN104199922A (en) * | 2014-09-01 | 2014-12-10 | 中国科学院自动化研究所 | Large-scale image library retrieval method based on local similarity hash algorithm |
CN106612435A (en) * | 2016-01-16 | 2017-05-03 | 四川用联信息技术有限公司 | Joint image compression method based on SVD-DWT-DCT |
CN107480261A (en) * | 2017-08-16 | 2017-12-15 | 上海荷福人工智能科技(集团)有限公司 | One kind is based on deep learning fine granularity facial image method for quickly retrieving |
CN108537788A (en) * | 2018-04-06 | 2018-09-14 | 中国人民解放军92942部队 | Camouflage painting effect evaluating method and device, computer equipment and storage medium |
US20180276528A1 (en) * | 2015-12-03 | 2018-09-27 | Sun Yat-Sen University | Image Retrieval Method Based on Variable-Length Deep Hash Learning |
CN109584232A (en) * | 2018-11-28 | 2019-04-05 | 成都天衡智造科技有限公司 | Equipment use state on-line monitoring method, system and terminal based on image recognition |
-
2019
- 2019-08-29 CN CN201910809700.8A patent/CN110516100A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103955879A (en) * | 2014-04-11 | 2014-07-30 | 杭州电子科技大学 | DWT-SVD robust blind watermark method based on multilevel DCT |
CN104182538A (en) * | 2014-09-01 | 2014-12-03 | 西安电子科技大学 | Semi-supervised hash based image retrieval method |
CN104199922A (en) * | 2014-09-01 | 2014-12-10 | 中国科学院自动化研究所 | Large-scale image library retrieval method based on local similarity hash algorithm |
US20180276528A1 (en) * | 2015-12-03 | 2018-09-27 | Sun Yat-Sen University | Image Retrieval Method Based on Variable-Length Deep Hash Learning |
CN106612435A (en) * | 2016-01-16 | 2017-05-03 | 四川用联信息技术有限公司 | Joint image compression method based on SVD-DWT-DCT |
CN107480261A (en) * | 2017-08-16 | 2017-12-15 | 上海荷福人工智能科技(集团)有限公司 | One kind is based on deep learning fine granularity facial image method for quickly retrieving |
CN108537788A (en) * | 2018-04-06 | 2018-09-14 | 中国人民解放军92942部队 | Camouflage painting effect evaluating method and device, computer equipment and storage medium |
CN109584232A (en) * | 2018-11-28 | 2019-04-05 | 成都天衡智造科技有限公司 | Equipment use state on-line monitoring method, system and terminal based on image recognition |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112926617A (en) * | 2019-12-06 | 2021-06-08 | 顺丰科技有限公司 | Packaging change detection method and device, cloud computer equipment and storage medium |
CN111091128A (en) * | 2019-12-18 | 2020-05-01 | 北京数衍科技有限公司 | Character and picture classification method and device and electronic equipment |
CN111091128B (en) * | 2019-12-18 | 2023-09-22 | 北京数衍科技有限公司 | Character picture classification method and device and electronic equipment |
CN111191058A (en) * | 2019-12-27 | 2020-05-22 | 青岛海洋科学与技术国家实验室发展中心 | Picture retrieval method |
CN111191058B (en) * | 2019-12-27 | 2023-08-29 | 青岛海洋科技中心 | Picture retrieval method |
CN113497781B (en) * | 2020-03-19 | 2022-08-02 | 中国电信股份有限公司 | Phishing website identification method and device and computer readable storage medium |
CN113497781A (en) * | 2020-03-19 | 2021-10-12 | 中国电信股份有限公司 | Phishing website identification method and device and computer readable storage medium |
CN111709913A (en) * | 2020-05-21 | 2020-09-25 | 四川虹美智能科技有限公司 | Method, device and system for detecting deteriorated food in refrigerator |
CN111709913B (en) * | 2020-05-21 | 2023-04-18 | 四川虹美智能科技有限公司 | Method, device and system for detecting deteriorated food in refrigerator |
CN112001430A (en) * | 2020-08-07 | 2020-11-27 | 海尔优家智能科技(北京)有限公司 | Refrigerator food material detection method and device, storage medium and electronic device |
CN112115295A (en) * | 2020-08-27 | 2020-12-22 | 广州华多网络科技有限公司 | Video image detection method and device and electronic equipment |
CN112215302A (en) * | 2020-10-30 | 2021-01-12 | Oppo广东移动通信有限公司 | Image identification method and device and terminal equipment |
CN113222930A (en) * | 2021-05-08 | 2021-08-06 | 厦门服云信息科技有限公司 | Malicious flow detection method based on image analysis, terminal device and storage medium |
CN114913350A (en) * | 2022-04-19 | 2022-08-16 | 深圳市东信时代信息技术有限公司 | Material duplicate checking method, device, equipment and storage medium |
CN114758160A (en) * | 2022-06-16 | 2022-07-15 | 山东捷瑞数字科技股份有限公司 | Image comparison method and device based on three-dimensional engine and medium thereof |
CN115187570A (en) * | 2022-07-27 | 2022-10-14 | 北京拙河科技有限公司 | Singular traversal retrieval method and device based on DNN deep neural network |
CN115187570B (en) * | 2022-07-27 | 2023-04-07 | 北京拙河科技有限公司 | Singular traversal retrieval method and device based on DNN deep neural network |
CN116421140A (en) * | 2023-06-12 | 2023-07-14 | 杭州目乐医疗科技股份有限公司 | Fundus camera control method, fundus camera, and storage medium |
CN116421140B (en) * | 2023-06-12 | 2023-09-05 | 杭州目乐医疗科技股份有限公司 | Fundus camera control method, fundus camera, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110516100A (en) | A kind of calculation method of image similarity, system, storage medium and electronic equipment | |
CN109816011A (en) | Generate the method and video key frame extracting method of portrait parted pattern | |
CN109816009A (en) | Multi-tag image classification method, device and equipment based on picture scroll product | |
CN110427895A (en) | A kind of video content similarity method of discrimination based on computer vision and system | |
JP2003523587A (en) | Visual attention system | |
CN112801846B (en) | Watermark embedding and extracting method and device, computer equipment and storage medium | |
CN111340077B (en) | Attention mechanism-based disparity map acquisition method and device | |
CN110569961A (en) | neural network training method and device and terminal equipment | |
CN109242796A (en) | Character image processing method, device, electronic equipment and computer storage medium | |
Niu et al. | Machine learning-based framework for saliency detection in distorted images | |
CN112950640A (en) | Video portrait segmentation method and device, electronic equipment and storage medium | |
CN104392207A (en) | Characteristic encoding method for recognizing digital image content | |
CN114926342A (en) | Image super-resolution reconstruction model construction method, device, equipment and storage medium | |
Liu et al. | Coordfill: Efficient high-resolution image inpainting via parameterized coordinate querying | |
CN111784699A (en) | Method and device for carrying out target segmentation on three-dimensional point cloud data and terminal equipment | |
CN115631108A (en) | RGBD-based image defogging method and related equipment | |
CN114612316A (en) | Method and device for removing rain from nuclear prediction network image | |
CN114077885A (en) | Model compression method and device based on tensor decomposition and server | |
Chen et al. | No-reference blurred image quality assessment method based on structure of structure features | |
CN104615988A (en) | Picture identification method | |
CN117437108B (en) | Watermark embedding method for image data | |
CN110059520B (en) | Iris feature extraction method, iris feature extraction device and iris recognition system | |
CN115424175A (en) | Video motion classification method based on hierarchical dynamic modeling of hourglass convolution and application | |
CN115035315B (en) | Ceramic tile color difference grading detection method and system based on attention mechanism | |
CN114372205B (en) | Training method, device and equipment of characteristic quantization model |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191129 |
|
RJ01 | Rejection of invention patent application after publication |