CN109102020A - A kind of image comparison method and device - Google Patents
A kind of image comparison method and device Download PDFInfo
- Publication number
- CN109102020A CN109102020A CN201810909704.9A CN201810909704A CN109102020A CN 109102020 A CN109102020 A CN 109102020A CN 201810909704 A CN201810909704 A CN 201810909704A CN 109102020 A CN109102020 A CN 109102020A
- Authority
- CN
- China
- Prior art keywords
- corresponding relationship
- image
- characteristic distance
- likelihood probability
- distance
- 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
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the present application provides a kind of image comparison method and device, is related to technical field of machine vision, wherein the above method includes: to obtain to the characteristic distance between contrast images, wherein the characteristic distance are as follows: the distance between feature of image;According to characteristic distance obtained, in the default corresponding relationship between characteristic distance and image likelihood probability, determine to the image similarity between contrast images, as the comparing result to contrast images;Wherein, the default corresponding relationship meets the following conditions: variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;When characteristic distance is equal to 0, image similarity is equal to 1;When characteristic distance tends to infinity, image likelihood probability tends to 0.Image comparison is carried out using scheme provided by the embodiments of the present application, intuitive image comparison result can be provided for user.
Description
Technical field
This application involves technical field of machine vision, more particularly to a kind of image comparison method and device.
Background technique
In application relevant to machine vision, it will usually the comparison being related between image, for example, two faces of comparison
Whether image is consistent, so that it is determined that whether two facial images correspond to same people.
In the prior art, when carrying out image comparison, the feature of two images to be compared generally first is obtained respectively, then
The distance between obtained feature is calculated, and using calculated distance as the comparing result of two images.
Although above-mentioned distance can reflect the similarity between image to a certain extent, above-mentioned comparing result is inadequate
Intuitively, user is difficult to determine the likelihood probability between two images according to above-mentioned distance.
Summary of the invention
The embodiment of the present application is designed to provide a kind of image comparison method and device, to provide intuitive figure for user
As comparing result.Specific technical solution is as follows:
In a first aspect, the embodiment of the present application provides a kind of image comparison method, which comprises
Obtain to the characteristic distance between contrast images, wherein the characteristic distance are as follows: between the feature of image away from
From;
According to characteristic distance obtained, in the default corresponding relationship between characteristic distance and image likelihood probability, really
Determine to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
In one embodiment of the application, the default corresponding relationship also meets the following conditions:
When characteristic distance is equal to pre-determined distance, image similarity is equal to default likelihood probability.
In one embodiment of the application, the default corresponding relationship is determining in the following way:
Lateral symmetry processing is carried out to preset function, obtains the first corresponding relationship, wherein the preset function is that can incite somebody to action
Independent variable maps to the function in [0,1] range, and characteristic distance is the independent variable of the preset function, and image likelihood probability is institute
State the dependent variable of preset function;
Longitudinal stretching processing is carried out to first corresponding relationship, obtains the default corresponding relationship.
In one embodiment of the application, the preset function are as follows: sigmoid function.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship indicated with following relational expressions:
f(x)=2/ (ex+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship determined based on function y=1/x.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship indicated with following relational expressions:
f(x)=1/ (xn/2+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability, n ∈ N+。
Second aspect, the embodiment of the present application provide a kind of image comparison device, and described device includes:
Distance obtains module, for obtaining to the characteristic distance between contrast images, wherein the characteristic distance are as follows: figure
The distance between feature of picture;
Similarity determining module is used for according to characteristic distance obtained, between characteristic distance and image likelihood probability
Default corresponding relationship in, determine to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
In one embodiment of the application, the default corresponding relationship also meets the following conditions:
When characteristic distance is equal to pre-determined distance, image similarity is equal to default likelihood probability.
In one embodiment of the application, described image compares device further include:
Relationship determination module, for determining the default corresponding relationship;
Wherein, the relationship determination module, comprising:
Symmetrical treatment unit obtains the first corresponding relationship, wherein institute for carrying out lateral symmetry processing to preset function
Stating preset function is the function that can be mapped to independent variable in [0,1] range, and characteristic distance is becoming certainly for the preset function
Amount, image likelihood probability are the dependent variable of the preset function;
Stretch processing unit obtains the default correspondence for carrying out longitudinal stretching processing to first corresponding relationship
Relationship.
In one embodiment of the application, the preset function are as follows: sigmoid function.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship indicated with following relational expressions:
f(x)=2/ (ex+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship determined based on function y=1/x.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship indicated with following relational expressions:
f(x)=1/ (xn/2+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability, n ∈ N+。
The third aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: processor and machine readable storage are situated between
Matter, the machine readable storage medium are stored with the machine-executable instruction that can be executed by the processor, the processor
Promoted by the machine-executable instruction: realizing method and step described in above-mentioned first aspect.
Fourth aspect, the embodiment of the present application provide a kind of machine readable storage medium, are stored with machine-executable instruction,
When being called and being executed by processor, the machine-executable instruction promotes the processor: realizing described in above-mentioned first aspect
Method and step.
As seen from the above, it when carrying out image comparison using scheme provided by the embodiments of the present application, is obtaining to contrast images
Between characteristic distance after, it is default corresponding between characteristic distance and image similarity according to characteristic distance obtained
In relationship, determine to the image likelihood probability between contrast images.With in the prior art merely to the spy between contrast images
Sign distance as a comparison compare by result, and image likelihood probability can intuitively reflect to the similar situation between contrast images, because
This can provide a user intuitive image comparison result when carrying out image comparison using scheme provided by the embodiments of the present application.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of image comparison method provided by the embodiments of the present application;
Fig. 2 is the curve synoptic diagram of the first corresponding relationship provided by the embodiments of the present application;
Fig. 3 is the curve synoptic diagram of second of corresponding relationship provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of image comparison device provided by the embodiments of the present application;
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
When due to carrying out image comparison in the prior art, there are not intuitive enough the technical problem of comparing result, the application is real
It applies example and provides a kind of image comparison method and device.
In one embodiment of the application, a kind of image comparison method is provided, this method comprises:
It obtains to the characteristic distance between contrast images, wherein characteristic distance are as follows: the distance between feature of image;
According to characteristic distance obtained, in the default corresponding relationship between characteristic distance and image likelihood probability, really
Determine to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, above-mentioned default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
With in the prior art merely with to the characteristic distance between contrast images as a comparison result compared with, image is similar general
Rate can intuitively reflect to the similar situation between contrast images, therefore, carry out image using scheme provided in this embodiment
When comparison, intuitive image comparison result can be provided a user.
Below by specific embodiment, image comparison method provided by the embodiments of the present application is described in detail.
Fig. 1 is a kind of flow diagram of image comparison method provided by the embodiments of the present application, this method comprises:
S101: it obtains to the characteristic distance between contrast images.
It is above-mentioned to include at least two images to contrast images in order to carry out image comparison.It can be to contrast images any
The image of type, for example, it may be facial image, scene image etc..
When contrast images are facial images, carrying out image comparison is usually to detect whether facial image corresponds to
Same people;When scene image when contrast images, carrying out image comparison is usually to confirm what whether scene image showed
It is same scenery.
Wherein, features described above distance are as follows: the distance between feature of image.
It will be appreciated by persons skilled in the art that image was made of pixel, due to each in an image
The pixel value of pixel is different and shows different colors, Texture eigenvalue.Specifically, in application process can be using pre-
If algorithm extract image feature, for example, above-mentioned preset algorithm can be the image characteristics extraction algorithm based on convolutional network
Etc..
It is each after the feature of contrast images extracting, it can be calculated using Euclidean distance calculation or COS distance
Mode calculates the distance between extracted feature, obtains the distance between the feature to contrast images.For ease of description, this Shen
Above-mentioned calculated distance please be known as to the characteristic distance between contrast images in embodiment.
S102: the default corresponding relationship according to characteristic distance obtained, between characteristic distance and image likelihood probability
In, it determines to the image likelihood probability between contrast images, as the comparing result to contrast images.
Wherein, above-mentioned default corresponding relationship meets the following conditions 1-3:
Condition 1: variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
Condition 2: when characteristic distance is equal to 0, image similarity is equal to 1;
Condition 3: when characteristic distance tends to infinity, image likelihood probability tends to 0.
Assuming that above-mentioned default corresponding relationship is with function f(x)=f (x) is indicated, wherein x indicates characteristic distance, f(x)Indicate figure
As likelihood probability, f () indicates x and f(x)Between transforming function transformation function, in this case, the condition that above-mentioned default corresponding relationship meets
1-3 can be expressed as condition 1 ' -3 ':
Condition 1 ': above-mentioned f () is a monotonic decreasing function, it is, as x increases, f(x)Value be gradually reduced;
Condition 2 ': when x=0, f(0)=f (0)=1;
Condition 3 ': limf (x | x- >+∞)=0.
Specifically, as shown in Fig. 2, showing a kind of curve synoptic diagram of corresponding relationship for meeting above-mentioned condition 1-3.
In one embodiment of the application, above-mentioned default corresponding relationship can also meet following conditions 4.
Condition 4: when characteristic distance is equal to pre-determined distance, image similarity is equal to default likelihood probability.
Specifically, above-mentioned pre-determined distance and default likelihood probability can be determined according to practical application scene.
For example, practical application scene can be understood as facial image comparison scene when contrast images are facial image, this
In the case of kind, when the value that can be above-mentioned pre-determined distance is 1.1, the value of above-mentioned default likelihood probability is 0.5.Wherein, exist
Practical application scene be facial image compare scene when, above-mentioned pre-determined distance can be according to Google publication Facenet this
What the distance for the characteristics of image that one software systems are announced determined.
In addition, the value of above-mentioned pre-determined distance is also possible to what research staff determined based on experience value, for example, it may be on
When the value for stating pre-determined distance is 0.85, the value of above-mentioned default similarity probability is 0.5.
The application is only illustrated for above-mentioned, is not constituted and is limited to the application.
In one embodiment of the application, above-mentioned default corresponding relationship can be what A-B according to the following steps was determined:
Step A: lateral symmetry processing is carried out to preset function, obtains the first corresponding relationship.
Wherein, above-mentioned preset function is the function that can be mapped to independent variable in [0,1] range, and characteristic distance is above-mentioned
The independent variable of preset function, image likelihood probability are the dependent variable of above-mentioned preset function.
Due to having horizontally and vertically two reference axis under two-dimensional coordinate system, using horizontal axis as X-axis, the longitudinal axis is Y-axis, function
Independent variable be x, for dependent variable is y, lateral symmetry processing is carried out to function, it is possible to understand that are as follows:, will using Y-axis as symmetry axis
The processing that independent variable x mirror image in function is-x.
Specifically, above-mentioned preset function can be with are as follows: sigmoid function.
Sigmoid function mathematic(al) representation are as follows: 1/ (1+e-x)。
After carrying out lateral symmetry processing to sigmoid function, the available letter for increasing and presenting monotone decreasing with x
Number, it is, above-mentioned first corresponding relationship.
In addition, function, under two-dimensional coordinate system, the value along X-axis independent variable x may be positive value, it is also possible to it is negative value,
And in practical applications, the value of x may be limited due to practical application scene, for example, it is merely capable of negated negative value etc.,
In this case, after carrying out lateral symmetry processing to preset function, the value range of x can also be further limited
Step B: carrying out longitudinal stretching processing to above-mentioned first corresponding relationship, obtains default corresponding relationship.
Under two-dimensional coordinate system, longitudinal stretching processing is carried out to the first corresponding relationship, it is possible to understand that are as follows: according to preset drawing
Ratio is stretched, the first corresponding relationship is adjusted along the longitudinal axis.Wherein, the specific value of above-mentioned stretch ratio by preset function tool
The conditional decision that body form and default corresponding relationship need to meet.For example, the above-mentioned condition 2 that default corresponding relationship needs to meet
Deng.
In one embodiment of the application, the case where above-mentioned preset function is sigmoid function, above-mentioned default corresponding pass
System can be the following corresponding relationship for stating relational expression expression:
f(x)=2/ (ex+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability.
Specifically, the curve synoptic diagram of default corresponding relationship is as shown in Figure 3.
Specifically, in the case where above-mentioned preset function is sigmoid function, first to 1/ (1+e of sigmoid function-x) into
The lateral symmetry processing of row, obtain x ∈ [0 ,+∞) 1/ (e of functionx+ 1), due to carrying out lateral symmetry treated sigmoid letter
1/ (e of numberx+ 1) in x=0, value is that 1/ (1+1)=0.5 need to be using 2 as stretch ratio, to letter to meet above-mentioned condition 2
1/ (e of numberx+ 1) longitudinal stretching processing is carried out, 2/ (e of function is obtainedx+ 1), at this moment, when x=0,2/ (1+1)=1.
In another embodiment of the application, above-mentioned default corresponding relationship can be the correspondence determining based on function y=1/x
Relationship.
Specifically, being passed when determining above-mentioned default corresponding relationship based on function y=1/x since the function itself meets dullness
Subtracting property, and when x tends to infinity, y tends to 0, and therefore, the translation that the direction x can be carried out to function y=1/x is handled, so that
The f arrived(x)Meet f(0)=1.
It, can be by this function of y=1/x to make monotone decline more obvious on the basis of above-mentioned translation processing
In x extend to xn/2, n ∈ N+。
Based on the above situation, in one embodiment of the application, above-mentioned default corresponding relationship can state relational expression to be following
The corresponding relationship of expression:
f(x)=1/ (xn/2+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability, n ∈ N+。
Specifically, the value of above-mentioned n can be 3 etc..
Meet aforementioned condition 1-3 to the corresponding relationship for stating relational expression expression above below to be illustrated.
1, monotonicity
Prove function f(x)=1/ (xn/2+ 1), n ∈ N+, x ∈ [0 ,+∞) monotone decreasing in section, that is, prove it
Derivative f ' (x) < 0.
Because of y=1/ (xn/2+ 1) it is considered as by y=1/u, u=xn/2+ 1 is combined, therefore,
F ' (x)=dy/dx=dy/dudu/dx=-n (xN/2-1)/2(xn/2+1)2。
And because x > 0, and n > 0, so, (xn/2+1)2> 0, (xN/2-1) > 0,
So f ' (x) < 0, so function monotone decreasing.
2, particular point value
As x=0, f(x)=1/ (xn/2+ 1)=1/ (0n/2+ 1)=1/ (1+1)=0.5.
3, limiting
According to higher mathematics basis it is found that the limit is defined as: set function f(x)When | x | it is defined when greater than a certain positive number,
If there is constant A, for any given positive number ε (no matter its more youngest is small), there is always positive number X, so that when x satisfaction differs
Formula | x | when>X, corresponding functional value f (x) all meets inequality | f (x)-A |<ε, then constant A is just called function f(x)When x becomes
Limit when ∞, is denoted as limx->∞F (x)=A.
Function f is proved now(x)=1/ (xn/2+ 1), n ∈ N+, x ∈ [0 ,+∞) limit is 0 in section, it is,
limx->∞f(x)=0, process is as follows:
Arbitrary ε > 0 is given, there is always positive number X, x ∈ [0 ,+∞), as x > X, inequality | 1/ (xn/2+ 1) -0 | < ε at
It is vertical.
This inequality is equivalent to | (xn/2) | > 1/ ε -1 enables m=n/2,1/ ε -1=a, then | xm| > a, it may be assumed that | x | > a1/m。
It follows that m=n/2,1/ ε -1=a, if taking X=a1/m, then as | x | > X=a1/m, inequality | 1/ (xn/2+
1) -0 | < ε is set up, i.e., its limit is proven.
As seen from the above, it when carrying out image comparison using the scheme that above-mentioned each embodiment provides, is obtaining to comparison diagram
After characteristic distance as between, according to characteristic distance obtained, default pair between characteristic distance and image similarity
In should being related to, determine to the image likelihood probability between contrast images.With in the prior art merely between contrast images
Characteristic distance as a comparison compare by result, and image likelihood probability can intuitively reflect to the similar situation between contrast images,
Therefore, when carrying out image comparison using the scheme that above-mentioned each embodiment provides, intuitive image comparison can be provided a user
As a result.
Corresponding with above-mentioned image comparison method, the embodiment of the present application also provides a kind of image comparison devices.
Fig. 4 is a kind of structural schematic diagram of image comparison device provided by the embodiments of the present application, which includes:
Distance obtains module 401, for obtaining to the characteristic distance between contrast images, wherein the characteristic distance are as follows:
The distance between feature of image;
Similarity determining module 402, for according to characteristic distance obtained, from characteristic distance and image likelihood probability it
Between default corresponding relationship in, determine to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
In one embodiment of the application, the default corresponding relationship can also meet the following conditions:
When characteristic distance is equal to pre-determined distance, image similarity is equal to default likelihood probability.
In one embodiment of the application, above-mentioned image comparison device can also include:
Relationship determination module, for determining the default corresponding relationship;
Wherein, the relationship determination module, comprising:
Symmetrical treatment unit obtains the first corresponding relationship, wherein institute for carrying out lateral symmetry processing to preset function
Stating preset function is the function that can be mapped to independent variable in [0,1] range, and characteristic distance is becoming certainly for the preset function
Amount, image likelihood probability are the dependent variable of the preset function;
Stretch processing unit obtains the default correspondence for carrying out longitudinal stretching processing to first corresponding relationship
Relationship.
In one embodiment of the application, the preset function can be with are as follows: sigmoid function.
In one embodiment of the application, the default corresponding relationship can close for following the corresponding of relational expression expression of stating
System:
f(x)=2/ (ex+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship determined based on function y=1/x.
In one embodiment of the application, the default corresponding relationship is the corresponding relationship indicated with following relational expressions:
f(x)=1/ (xn/2+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability, n ∈ N+。
As seen from the above, it when carrying out image comparison using the scheme that above-mentioned each embodiment provides, is obtaining to comparison diagram
After characteristic distance as between, according to characteristic distance obtained, default pair between characteristic distance and image similarity
In should being related to, determine to the image likelihood probability between contrast images.With in the prior art merely between contrast images
Characteristic distance as a comparison compare by result, and image likelihood probability can intuitively reflect to the similar situation between contrast images,
Therefore, when carrying out image comparison using the scheme that above-mentioned each embodiment provides, intuitive image comparison can be provided a user
As a result.
Corresponding with above-mentioned image comparison method, the embodiment of the present application also provides a kind of electronic equipment.
Fig. 5 is the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application, which includes: processor
501 and machine readable storage medium 502, the machine readable storage medium 502, which is stored with, to be executed by the processor 501
Machine-executable instruction, the processor 501 promoted by the machine-executable instruction: realizing provided by the embodiments of the present application
Image comparison method.
In one embodiment of the application, a kind of image comparison method is provided, comprising:
Obtain to the characteristic distance between contrast images, wherein the characteristic distance are as follows: between the feature of image away from
From;
According to characteristic distance obtained, in the default corresponding relationship between characteristic distance and image likelihood probability, really
Determine to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
It should be noted that its for the image comparison method that above-mentioned processor 501 is promoted to realize by machine-executable instruction
His embodiment, identical as the embodiment that preceding method embodiment part refers to, which is not described herein again.
Above-mentioned machine readable storage medium may include random access memory (Random Access Memory, RAM),
It also may include nonvolatile memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.It is optional
, above-mentioned machine readable storage medium can also be that at least one is located remotely from the storage device of aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete
Door or transistor logic, discrete hardware components.
As seen from the above, it when electronic equipment provided in this embodiment carries out image comparison, is obtaining between contrast images
Characteristic distance after, the default corresponding relationship according to characteristic distance obtained, between characteristic distance and image similarity
In, it determines to the image likelihood probability between contrast images.With in the prior art merely with to the feature between contrast images away from
It is compared from result as a comparison, image likelihood probability can intuitively reflect to the similar situation between contrast images, therefore, answer
When carrying out image comparison with scheme provided in this embodiment, intuitive image comparison result can be provided a user.
Corresponding with above-mentioned image comparison method, the embodiment of the present application also provides a kind of machine readable storage mediums, deposit
Machine-executable instruction is contained, when being called and being executed by processor, the machine-executable instruction promotes the processor: real
Existing image comparison method provided by the embodiments of the present application.
In one embodiment of the application, a kind of image comparison method is provided, comprising:
Obtain to the characteristic distance between contrast images, wherein the characteristic distance are as follows: between the feature of image away from
From;
According to characteristic distance obtained, in the default corresponding relationship between characteristic distance and image likelihood probability, really
Determine to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
It should be noted that other implementations for the image comparison method that above-mentioned machine-executable instruction promotes processor to realize
Example, identical as the embodiment that preceding method embodiment part refers to, which is not described herein again.
As seen from the above, when carrying out image comparison using electronic equipment provided in this embodiment, by executing above-mentioned machine
The machine-executable instruction stored in readable storage medium storing program for executing, after obtaining to the characteristic distance between contrast images, according to institute
The characteristic distance of acquisition in the default corresponding relationship between characteristic distance and image similarity, is determined between contrast images
Image likelihood probability.With in the prior art merely with to the characteristic distance between contrast images as a comparison result compared with, figure
As likelihood probability can intuitively reflect to the similar situation between contrast images, therefore, using scheme provided in this embodiment
When carrying out image comparison, intuitive image comparison result can be provided a user.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For electronic equipment and machine readable storage medium embodiment, since it is substantially similar to the method embodiment, so the ratio of description
Relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely the preferred embodiments of the application, are not intended to limit the protection scope of the application.It is all
Any modification, equivalent replacement, improvement and so within spirit herein and principle are all contained in the protection scope of the application
It is interior.
Claims (16)
1. a kind of image comparison method, which is characterized in that the described method includes:
It obtains to the characteristic distance between contrast images, wherein the characteristic distance are as follows: the distance between feature of image;
According to characteristic distance obtained, in the default corresponding relationship between characteristic distance and image likelihood probability, determine to
Image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
2. the method according to claim 1, wherein the default corresponding relationship also meets the following conditions:
When characteristic distance is equal to pre-determined distance, image similarity is equal to default likelihood probability.
3. method according to claim 1 or 2, which is characterized in that the default corresponding relationship is true in the following way
Fixed:
Lateral symmetry processing is carried out to preset function, obtains the first corresponding relationship, wherein the preset function is that will can become certainly
Amount maps to the function in [0,1] range, and characteristic distance is the independent variable of the preset function, and image likelihood probability is described pre-
If the dependent variable of function;
Longitudinal stretching processing is carried out to first corresponding relationship, obtains the default corresponding relationship.
4. according to the method described in claim 3, it is characterized in that, the preset function are as follows: sigmoid function.
5. according to the method described in claim 4, it is characterized in that, the default corresponding relationship is to be indicated with following relational expressions
Corresponding relationship:
f(x)=2/ (ex+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability.
6. method according to claim 1 or 2, which is characterized in that the default corresponding relationship is based on function y=1/x
Determining corresponding relationship.
7. according to the method described in claim 6, it is characterized in that, the default corresponding relationship is to be indicated with following relational expressions
Corresponding relationship:
f(x)=1/ (xn/2+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability, n ∈ N+。
8. a kind of image comparison device, which is characterized in that described device includes:
Distance obtains module, for obtaining to the characteristic distance between contrast images, wherein the characteristic distance are as follows: image
The distance between feature;
Similarity determining module is used for according to characteristic distance obtained, pre- between characteristic distance and image likelihood probability
If in corresponding relationship, determining to the image likelihood probability between contrast images, as the comparing result to contrast images;
Wherein, the default corresponding relationship meets the following conditions:
Variation tendency of successively decreasing is presented as characteristic distance becomes larger in image likelihood probability;
When characteristic distance is equal to 0, image similarity is equal to 1;
When characteristic distance tends to infinity, image likelihood probability tends to 0.
9. device according to claim 8, which is characterized in that the default corresponding relationship also meets the following conditions:
When characteristic distance is equal to pre-determined distance, image similarity is equal to default likelihood probability.
10. device according to claim 8 or claim 9, which is characterized in that described device further include:
Relationship determination module, for determining the default corresponding relationship;
Wherein, the relationship determination module, comprising:
Symmetrical treatment unit obtains the first corresponding relationship, wherein described pre- for carrying out lateral symmetry processing to preset function
If function is the function that can be mapped to independent variable in [0,1] range, characteristic distance is the independent variable of the preset function, figure
As the dependent variable that likelihood probability is the preset function;
Stretch processing unit obtains the default corresponding relationship for carrying out longitudinal stretching processing to first corresponding relationship.
11. device according to claim 10, which is characterized in that the preset function are as follows: sigmoid function.
12. device according to claim 11, which is characterized in that the default corresponding relationship is to be indicated with following relational expressions
Corresponding relationship:
f(x)=2/ (ex+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability.
13. device according to claim 1 or 2, which is characterized in that the default corresponding relationship is based on function y=1/x
Determining corresponding relationship.
14. device according to claim 13, which is characterized in that the default corresponding relationship is to be indicated with following relational expressions
Corresponding relationship:
f(x)=1/ (xn/2+1)
Wherein, x expression characteristic distance, and x ∈ [0 ,+∞), f(x)Indicate image likelihood probability, n ∈ N+。
15. a kind of electronic equipment characterized by comprising processor and machine readable storage medium, the machine readable storage
Media storage has the machine-executable instruction that can be executed by the processor, and the processor is by the machine-executable instruction
Promote: realizing method and step as claimed in claim 1 to 7.
16. a kind of machine readable storage medium, which is characterized in that be stored with machine-executable instruction, by processor call and
When execution, the machine-executable instruction promotes the processor: realizing method and step as claimed in claim 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810909704.9A CN109102020A (en) | 2018-08-10 | 2018-08-10 | A kind of image comparison method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810909704.9A CN109102020A (en) | 2018-08-10 | 2018-08-10 | A kind of image comparison method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109102020A true CN109102020A (en) | 2018-12-28 |
Family
ID=64849301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810909704.9A Pending CN109102020A (en) | 2018-08-10 | 2018-08-10 | A kind of image comparison method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109102020A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111639667A (en) * | 2020-04-14 | 2020-09-08 | 北京迈格威科技有限公司 | Image recognition method and device, electronic equipment and computer readable storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103425768A (en) * | 2013-08-07 | 2013-12-04 | 浙江商业职业技术学院 | Image retrieval method based on vision and lexeme similarity constraint |
CN107766290A (en) * | 2016-08-18 | 2018-03-06 | 中国石油化工股份有限公司 | Convergent multiple regression engineering statistics new method |
-
2018
- 2018-08-10 CN CN201810909704.9A patent/CN109102020A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103425768A (en) * | 2013-08-07 | 2013-12-04 | 浙江商业职业技术学院 | Image retrieval method based on vision and lexeme similarity constraint |
CN107766290A (en) * | 2016-08-18 | 2018-03-06 | 中国石油化工股份有限公司 | Convergent multiple regression engineering statistics new method |
Non-Patent Citations (1)
Title |
---|
杨风召等: "一种有效的量化交易数据相似性搜索方法", 《计算机研究与发展》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111639667A (en) * | 2020-04-14 | 2020-09-08 | 北京迈格威科技有限公司 | Image recognition method and device, electronic equipment and computer readable storage medium |
CN111639667B (en) * | 2020-04-14 | 2023-06-16 | 北京迈格威科技有限公司 | Image recognition method, device, electronic equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108416752B (en) | Method for removing motion blur of image based on generation type countermeasure network | |
WO2016180224A1 (en) | Method and device for processing image of person | |
CN105893920B (en) | Face living body detection method and device | |
KR20160048140A (en) | Method and apparatus for generating an all-in-focus image | |
JP2006146922A (en) | Template-based face detection method | |
EP2309454B1 (en) | Apparatus and method for detecting motion | |
US10448879B2 (en) | Skin condition detection method and electronic device | |
WO2009117607A1 (en) | Methods, systems, and media for automatically classifying face images | |
EP2336949A1 (en) | Apparatus and method for registering plurality of facial images for face recognition | |
US8995718B2 (en) | System and method for low complexity change detection in a sequence of images through background estimation | |
CN110147708B (en) | Image data processing method and related device | |
CN110651300A (en) | Object detection device, object detection method, and program | |
CN112016469A (en) | Image processing method and device, terminal and readable storage medium | |
CN109376671A (en) | Image processing method, electronic equipment and computer-readable medium | |
CN108875751B (en) | Image processing method and device, neural network training method and storage medium | |
JP2010108494A (en) | Method and system for determining characteristic of face within image | |
CN108875549B (en) | Image recognition method, device, system and computer storage medium | |
CN111327887A (en) | Electronic device, method of operating the same, and method of processing image of the electronic device | |
CN107368181B (en) | Gesture recognition method and device | |
JP2005149370A (en) | Imaging device, personal authentication device and imaging method | |
CN110503002B (en) | Face detection method and storage medium | |
CN109102020A (en) | A kind of image comparison method and device | |
CN110442313A (en) | A kind of display properties method of adjustment and relevant device | |
CN109981967B (en) | Shooting method and device for intelligent robot, terminal equipment and medium | |
EP2998928A1 (en) | Apparatus and method for extracting high watermark image from continuously photographed images |
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: 20181228 |
|
RJ01 | Rejection of invention patent application after publication |