Summary of the invention
The main purpose of the present invention is to provide a kind of extracting method of characteristics of image and extraction elements, it is intended to pass through structure
Build for image topography's block local coordinate system, can to avoid play a game portion's image block carry out principal direction estimation and after
Continuous direction normalization operation, so as to accurately obtain the local invariant feature for representing the image.
To achieve the above object, the present invention provides a kind of extracting method of characteristics of image, the extraction side of described image feature
Method the following steps are included:
The first partial image block of image is obtained, and determines the central point and sampled point in the first partial image block;
According to the central point and sampled point, local coordinate system is established;
According to the local coordinate system, the local invariant feature at the sampled point is extracted;
It is merged the local invariant feature at the sampled point to obtain characteristics of image.
Preferably, described according to the local coordinate system, the step of extracting the local invariant feature at the sampled point packet
It includes:
According to the local coordinate system, preset frequency and predetermined direction are set at the sampled point, obtains predetermined quantity
Small echo;
Obtain the second local image block in the first partial image block centered on the sampled point;
By the small echo of the predetermined quantity and the second local image block, the sound that the predetermined quantity is calculated in inner product is carried out
It answers, the local invariant feature at sampled point described in the Token Holder.
Preferably, the local invariant feature by the sampled point is merged the step of obtaining characteristics of image packet
It includes:
Obtain the phase of each response;
The coding of predetermined bit position is carried out to each frequency according to the phase, and the histogram of predetermined length is calculated
Figure, to obtain described image feature.
Preferably, the coding for carrying out predetermined bit position to each frequency according to the phase, and be calculated predetermined
After the step of histogram of length further include:
Obtain the histogram of another image, and the distance between histogram for calculating two images value;
According to the distance value, the local invariant feature of two images is matched.
Preferably, described according to the distance value, the step of carrying out the matching of local invariant feature, includes:
The distance value is compared with predetermined value;
If the size of the distance value close to the predetermined value, determines that described two images are similar.
In addition, to achieve the above object, the present invention also proposes that a kind of extraction element, the extraction element include:
Module is obtained, for obtaining the first partial image block of image, and is determined in the first partial image block
Heart point and sampled point;
Module is established, for establishing local coordinate system according to the central point and sampled point;
Extraction module, for extracting the local invariant feature at the sampled point according to the local coordinate system;
Fusion treatment module, for being merged the local invariant feature at the sampled point to obtain characteristics of image.
Preferably, the extraction module includes:
Setup unit, for setting preset frequency and predetermined direction at the sampled point according to the local coordinate system
Small echo, obtain the small echo of predetermined quantity;
First acquisition unit, for obtaining the second part in the first partial image block centered on the sampled point
Image block;
First computing unit, for carrying out the small echo of the predetermined quantity and the second local image block inner product and calculating
Local invariant feature to the response of the predetermined quantity, at sampled point described in the Token Holder.
Preferably, the fusion treatment module includes:
Second acquisition unit, for obtaining the phase of each response;
Second computing unit for carrying out the coding of predetermined bit position to each frequency according to the phase, and calculates
To the histogram of predetermined length, to obtain described image feature.
Preferably, the extraction element further include:
Computing module, for obtaining the histogram of another image, and the distance between histogram for calculating two images value;
Matching module, for being matched to the local invariant feature of two images according to the distance value.
Preferably, the matching module includes:
Comparing unit, for the distance value to be compared with predetermined value;
Judging unit, if the size for the distance value determines that described two images are similar close to the predetermined value.
The extracting method and extraction element of characteristics of image provided by the invention, by the first partial image for obtaining image
Block, and determine central point and sampled point in the first partial image block, then established according to the central point and sampled point
Local coordinate system extracts the local invariant feature at the sampled point further according to the local coordinate system, by the sampling
Local invariant feature at point is merged to obtain characteristics of image.In this way, by building for image topography's block can
Invariable rotary local coordinate system can carry out estimation and the subsequent direction normalization behaviour of principal direction to avoid portion's image block of playing a game
Make, so as to accurately obtain the local invariant feature for representing the image.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of extracting method of characteristics of image, referring to Fig.1, in one embodiment, described image feature
Extracting method the following steps are included:
Step S10, obtains the first partial image block of image, and determine the central point in the first partial image block and
Sampled point;
Step S20 establishes local coordinate system according to the central point and sampled point;
In the present embodiment, due to by rotate, the factors such as shooting angle and distance are influenced, same object is in different images
In may seem completely it is different, therefore, the local invariant feature of image be image is carried out understand and image in object
Body carries out the important evidence of Classification and Identification, is the important foundation that subsequent image understands.For this purpose, the present invention provides one kind based on part
The image characteristic extracting method of coordinate system when so that rotation and shooting angle changing, remains to accurately extraction and represents the image
Local invariant feature.
In the present embodiment, a small images regional area i.e. first partial image block is extracted from image, it is assumed that first game
The central point of portion's image block is P, and the sampled point that surrounding extracts feature is Pi, then can establish local coordinate system as shown in Figure 2,
Using the line of central point P and sampled point Pi as y-axis, vertical direction is the coordinate system as x-axis, x-axis and horizontal direction angle
θ.Due to the setting of horizontal direction θ, angle correct can be played the role of, so that the local coordinate in the present invention ties up to
By rotate and shooting angle change etc. factors influenced when, still can keep invariable rotary.
In this preferred embodiment, the setting of parameter is carried out using Gabor filter, and the local invariant for extracting image is special
Sign.In image procossing, Gabor function is the linear filter for being used for edge extracting, the frequency of Gabor filter and side
It is similar with human visual system to expressing, thus it is suitble to texture expression and separation.In the spatial domain, a two-dimensional Gabor filtering
Device is the gaussian kernel function modulated by sinusoidal plane wave, specifically, can be using various forms of filtering such as Log-Gabor
Device can specifically select according to actual needs.
Step S30 extracts the local invariant feature at the sampled point according to the local coordinate system;
Step S40 is merged the local invariant feature at the sampled point to obtain characteristics of image.
In the present embodiment, according to the local coordinate system, predetermined number can be obtained with the small echo of preset frequency and predetermined direction
The small echo of amount, can such as design 5 frequencies, 40 Gabor wavelets in 8 directions, certainly, in other embodiments, can also be with
According to the concrete condition of image, frequency and direction in local coordinate system are rationally set, it is not limited to the present embodiment.Then will
The small echo of predetermined quantity and the second local image block centered on the sampled point carry out convolution or inner product calculating, are made a reservation for
The response of quantity such as 40.The impulse response of Gabor filter can be defined as a sine wave (for two-dimensional Gabor filter
It is sinusoidal plane wave) multiplied by Gaussian function.Due to multiplication Convolution Properties, the Fourier transform of the impulse response of Gabor filter
It is the convolution of Fourier transform and the Gaussian function Fourier transform of its harmonic function.The filter is made of real and imaginary parts,
The two is mutually orthogonal.The meter of two or four codings and histogram is successively carried out further according to the response obtained at sampled point Pi
It calculates, histogram is calculated by two or four codings, finally use expression of the histogram as local invariant feature, from
And extract the complete local invariant feature of image.
The extracting method of characteristics of image provided by the invention by obtaining the first partial image block of image, and determines institute
The central point and sampled point in first partial image block are stated, local coordinate system is then established according to the central point and sampled point,
Further according to the local coordinate system, the local invariant feature at the sampled point is extracted, by the part at the sampled point
Invariant features are merged to obtain characteristics of image.In this way, by building for the rotatable not changed situation of topography's block of image
Portion's coordinate system can carry out the estimation and subsequent direction normalization operation of principal direction to avoid portion's image block of playing a game, so as to
The local invariant feature of the image is represented with accurate acquisition.
Further, as shown in figure 3, on the basis of the embodiment of above-mentioned Fig. 1, in the present embodiment, the step S30 packet
It includes:
Step S301 sets preset frequency and predetermined direction at the sampled point, obtains according to the local coordinate system
The small echo of predetermined quantity;
In the present embodiment, the local Gabor characteristic at sampled point Pi is extracted in the local coordinate system, designs 5 frequencies,
40 Gabor wavelets in 8 directionsU=0~4, v=0~7;
Wherein,(xi,yi) it is sampled point Pi coordinate, f is frequency
Rate, v are direction, and σ is the standard deviation of Gaussian function, and j is plural number.Of course, it should be understood that these parameter values are can basis
What actual needs was rationally arranged.
Step S302 obtains the second local image block in the first partial image block centered on the sampled point;
Step S303, by the small echo of the predetermined quantity and the second local image block, progress inner product is calculated described pre-
The response of fixed number amount, the local invariant feature at sampled point described in the Token Holder.
In the present embodiment, by 40 small echosWith the second part image block F (x, y) centered on sampled point Pi into
Row inner product operation obtains 40 responses
It is each to respond the local invariant feature for respectively representing each small echo in the present embodiment, it needs that each small echo will be represented
Response merged, the histogram of representative image feature is calculated.
In one embodiment, as shown in figure 4, on the basis of the embodiment of above-mentioned Fig. 1, in the present embodiment, the step
S40 includes:
Step S401 obtains the phase of each response;
Step S402, the coding of predetermined bit position is carried out according to the phase to each frequency, and pre- fixed length is calculated
The histogram of degree, to obtain described image feature.
In the present embodiment, in the response that the sampled point Pi is obtainedIt is
A plural number, by the phase for calculating each responseAnd two codings are generated according to following formula
Above-mentioned two codings are subjected to 8bit coding according to each frequency u, the integer of 10 0-255 can be obtained:
After the feature point extraction for carrying out invariable rotary to the n sampled point Pi that central point is P according to above-mentioned steps, to this
A little characteristic points are merged, and the histogram for representing whole image invariant features is formed.It, can basis for each frequencyWithThe histogram that two length corresponding with two codings being calculated is 255
It is understood that above-mentioned coding mode also can change adjustment, for example, using 4 codings or according to real part,
Imaginary numbers encode etc..
Since in existing method, subsequent gradients direction histogram only has recorded the directional information of variation of image grayscale, does not have
The important informations such as intensity and frequency comprising grey scale change, therefore, characteristic differentiation is poor, and the present invention is special using Gabor
Sign can obtain identification and the stronger local grain of descriptive power and indicate, thus can better discriminate between different images information.
In one embodiment, as shown in figure 5, on the basis of the embodiment of above-mentioned Fig. 1, in the present embodiment, the step
After S402 further include:
Step S50 obtains the histogram of another image, and the distance between histogram for calculating two images value;
In the present embodiment, the histogram of another image is obtained, another image can be, phase identical as selected image
Like or completely unrelated image, only need to calculate the distance between the histogram of two images value, that is, can determine whether the two it is similar
Degree.In this way, applicability is wider.
Step S60 matches the local invariant feature of two images according to the distance value.
In the present embodiment, according to the distance value, the matching of local invariant feature is carried out, specific formula for calculation is as follows:
Wherein,AndThe 255 dimensional feature histograms respectively extracted in two images.
In one embodiment, as shown in fig. 6, on the basis of the embodiment of above-mentioned Fig. 5, in the present embodiment, the step
S60 includes:
The distance value is compared by step S601 with predetermined value;
In the present embodiment, the distance value can be compared with predetermined value, wherein predetermined value can be according to practical need
Rationally to be arranged, in this preferred embodiment, the predetermined value can be preferably 0.
Step S602, if the size of the distance value close to the predetermined value, determines that described two images are similar.
In the present embodiment, if judgement obtains the size of the distance value close to the predetermined value such as 0, it can be determined that described
Two images are similar.Further, when the distance between histogram of two images value is smaller, if value range is 0~1
It is interior, then it represents that two width figure similarities are higher;Conversely, when the distance between histogram of two images value is bigger, such as value range
When greater than 1, then it represents that two width figure similarities are lower.
The present invention also provides a kind of extraction elements 1, and referring to Fig. 7, in one embodiment, the extraction element 1 includes:
Module 10 is obtained, for obtaining the first partial image block of image, and is determined in the first partial image block
Central point and sampled point;
Module 20 is established, for establishing local coordinate system according to the central point and sampled point;
In the present embodiment, due to by rotate, the factors such as shooting angle and distance are influenced, same object is in different images
In may seem completely it is different, therefore, the local invariant feature of image be image is carried out understand and image in object
Body carries out the important evidence of Classification and Identification, is the important foundation that subsequent image understands.For this purpose, the present invention provides one kind based on part
The image characteristic extracting method of coordinate system when so that rotation and shooting angle changing, remains to accurately extraction and represents the image
Local invariant feature.
In the present embodiment, a small images regional area i.e. first partial image block is extracted from image, it is assumed that first game
The central point of portion's image block is P, and the sampled point that surrounding extracts feature is Pi, then can establish local coordinate system as shown in Figure 2,
Using the line of central point P and sampled point Pi as y-axis, vertical direction is the coordinate system as x-axis, x-axis and horizontal direction angle
θ.Due to the setting of horizontal direction θ, angle correct can be played the role of, so that the local coordinate in the present invention ties up to
By rotate and shooting angle change etc. factors influenced when, still can keep invariable rotary.
In this preferred embodiment, the setting of parameter is carried out using Gabor filter, and the local invariant for extracting image is special
Sign.In image procossing, Gabor function is the linear filter for being used for edge extracting, the frequency of Gabor filter and side
It is similar with human visual system to expressing, thus it is suitble to texture expression and separation.In the spatial domain, a two-dimensional Gabor filtering
Device is the gaussian kernel function modulated by sinusoidal plane wave, specifically, can be using various forms of filtering such as Log-Gabor
Device can specifically select according to actual needs.
Extraction module 30, for extracting the local invariant feature at the sampled point according to the local coordinate system;
Fusion treatment module 40, for being merged the local invariant feature at the sampled point to obtain characteristics of image.
In the present embodiment, according to the local coordinate system, predetermined number can be obtained with the small echo of preset frequency and predetermined direction
The small echo of amount, can such as design 5 frequencies, 40 Gabor wavelets in 8 directions, certainly, in other embodiments, can also be with
According to the concrete condition of image, frequency and direction in local coordinate system are rationally set, it is not limited to the present embodiment.Then will
The small echo of predetermined quantity and the second local image block centered on the sampled point carry out convolution or inner product calculating, are made a reservation for
The response of quantity such as 40.The impulse response of Gabor filter can be defined as a sine wave (for two-dimensional Gabor filter
It is sinusoidal plane wave) multiplied by Gaussian function.Due to multiplication Convolution Properties, the Fourier transform of the impulse response of Gabor filter
It is the convolution of Fourier transform and the Gaussian function Fourier transform of its harmonic function.The filter is made of real and imaginary parts,
The two is mutually orthogonal.The meter of two or four codings and histogram is successively carried out further according to the response obtained at sampled point Pi
It calculates, histogram is calculated by two or four codings, finally use expression of the histogram as local invariant feature, from
And extract the complete local invariant feature of image.
Extraction element provided by the invention by obtaining the first partial image block of image, and determines the first partial
Central point and sampled point in image block, then establish local coordinate system according to the central point and sampled point, further according to described
Local coordinate system extracts the local invariant feature at the sampled point, by the local invariant feature at the sampled point into
Row fusion obtains characteristics of image.In this way, by building for the rotatable constant local coordinate system of topography's block of image, it can
To avoid the estimation and subsequent direction normalization operation for carrying out principal direction to local image block, so as to accurately obtain
Represent the local invariant feature of the image.
Further, as shown in figure 8, on the basis of the embodiment of above-mentioned Fig. 7, in the present embodiment, the extraction module
30 include:
Setup unit 301, for setting preset frequency and predetermined party at the sampled point according to the local coordinate system
To obtaining the small echo of predetermined quantity;
In the present embodiment, the local Gabor characteristic at sampled point Pi is extracted in the local coordinate system, designs 5 frequencies,
40 Gabor wavelets in 8 directionsU=0~4, v=0~7;
Wherein,(xi,yi) it is sampled point Pi coordinate, f is frequency
Rate, v are direction, and σ is the standard deviation of Gaussian function, and j is plural number.Of course, it should be understood that these parameter values are can basis
What actual needs was rationally arranged.
First acquisition unit 302, for obtaining in the first partial image block second centered on the sampled point
Topography's block;
First computing unit 303, for carrying out inner product calculating for the small echo of the predetermined quantity and the second local image block
Obtain the response of the predetermined quantity, the local invariant feature at sampled point described in the Token Holder.
In the present embodiment, by 40 small echosWith the second part image block F (x, y) centered on sampled point Pi into
Row inner product operation obtains 40 responses
It is each to respond the local invariant feature for respectively representing each small echo in the present embodiment, it needs that each small echo will be represented
Response merged, the histogram of representative image feature is calculated.
In one embodiment, as shown in figure 9, on the basis of the embodiment of above-mentioned Fig. 7, in the present embodiment, the fusion
Processing module 40 includes:
Second acquisition unit 401, for obtaining the phase of each response;
Second computing unit 402 for carrying out the coding of predetermined bit position to each frequency according to the phase, and calculates
The histogram of predetermined length is obtained, to obtain described image feature.
In the present embodiment, in the response that the sampled point Pi is obtainedIt is
A plural number, by the phase for calculating each responseAnd two codings are generated according to following formula
Above-mentioned two codings are subjected to 8bit coding according to each frequency u, the integer of 10 0-255 can be obtained:
After the feature point extraction for carrying out invariable rotary to the n sampled point Pi that central point is P according to above-mentioned steps, to this
A little characteristic points are merged, and the histogram for representing whole image invariant features is formed.It, can basis for each frequencyWithThe histogram that two length corresponding with two codings being calculated is 255
It is understood that above-mentioned coding mode also can change adjustment, for example, using 4 codings or according to real part,
Imaginary numbers encode etc..
Since in existing method, subsequent gradients direction histogram only has recorded the directional information of variation of image grayscale, does not have
The important informations such as intensity and frequency comprising grey scale change, therefore, characteristic differentiation is poor, and the present invention is special using Gabor
Sign can obtain identification and the stronger local grain of descriptive power and indicate, thus can better discriminate between different images information.
In one embodiment, as shown in Figure 10, on the basis of the embodiment of above-mentioned Fig. 7, in the present embodiment, the extraction
Device 1 further include:
Computing module 50 for obtaining the histogram of another image, and calculates the distance between the histogram of two images
Value;
In the present embodiment, the histogram of another image is obtained, another image can be, phase identical as selected image
Like or completely unrelated image, only need to calculate the distance between the histogram of two images value, that is, can determine whether the two it is similar
Degree.In this way, applicability is wider.
Matching module 60, for being matched to the local invariant feature of two images according to the distance value.
In the present embodiment, according to the distance value, the matching of local invariant feature is carried out, specific formula for calculation is as follows:
Wherein,AndThe 255 dimensional feature histograms respectively extracted in two images.
In one embodiment, as shown in figure 11, on the basis of the embodiment of above-mentioned Fig. 1, in the present embodiment, the matching
Module 60 includes:
Comparing unit 601, for the distance value to be compared with predetermined value;
In the present embodiment, the distance value can be compared with predetermined value, wherein predetermined value can be according to practical need
Rationally to be arranged, in this preferred embodiment, the predetermined value can be preferably 0.
Judging unit 602, if the size for the distance value determines described two image phases close to the predetermined value
Seemingly.
In the present embodiment, if judgement obtains the size of the distance value close to the predetermined value such as 0, it can be determined that described
Two images are similar.Further, when the distance between histogram of two images value is smaller, if value range is 0~1
It is interior, then it represents that two width figure similarities are higher;Conversely, when the distance between histogram of two images value is bigger, such as value range
When greater than 1, then it represents that two width figure similarities are lower.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.