Summary of the invention
In view of the deficiencies of the prior art, on the one hand, the present invention provides a kind of license image shadow Detection side based on cluster
Method, the license image shadow detection method include: the image block of the multiple and different scales of random acquisition from testing image;It calculates
The characteristics of image of described image block;Described image block is clustered based on described image feature;And it is each after calculating cluster
The average brightness of image block included by classification, and based on the comparison result of minimum average B configuration brightness and predetermined threshold determine it is described to
It whether include shade in altimetric image.
In one embodiment of the invention, the comparison result based on minimum average B configuration brightness and predetermined threshold determines institute
If stating in testing image the step of whether including shade includes: that the minimum average B configuration brightness is greater than the predetermined threshold, really
Shade is not included in the fixed testing image;And if the minimum average B configuration brightness is less than or equal to the predetermined threshold,
The number for calculating the image block of classification corresponding to the minimum average B configuration brightness accounts for the ratio of all image blocks collected, if institute
State ratio within a predetermined range, it is determined that include shade in the testing image.
In one embodiment of the invention, the license image shadow detection method further comprises: based on minimum
Whether the comparison result of average brightness and predetermined threshold determines in the testing image comprising before shade, by minimum average B configuration brightness
It is compared with the half of maximum average brightness, and if minimum average B configuration brightness is greater than the half of maximum average brightness, really
Shade is not included in the fixed testing image.
In one embodiment of the invention, described the step of described image block is clustered based on described image feature
It is realized using K mean cluster algorithm.
In one embodiment of the invention, the step of characteristics of image for calculating described image block includes described in calculating
The Gradient Features and/or color characteristic of image block.
On the other hand, also a kind of license image shadow Detection device based on cluster of the present invention, the license image shade
Detection device includes: acquisition module, the image block for the multiple and different scales of random acquisition from testing image;Feature extraction mould
Block, for calculating the characteristics of image of described image block;Cluster module, for being carried out based on described image feature to described image block
Cluster;And shade judgment module, for calculating the average brightness of image block included by each classification after cluster, and based on most
Whether the comparison result of small average brightness and predetermined threshold determines in the testing image comprising shade.
In one embodiment of the invention, ratio of the shade judgment module based on minimum average B configuration brightness and predetermined threshold
If relatively result determines whether the operation comprising shade includes: the minimum average B configuration brightness greater than described pre- in the testing image
Determine threshold value, it is determined that do not include shade in the testing image;And if the minimum average B configuration brightness be less than or equal to it is described
Predetermined threshold, the then number for calculating the image block of classification corresponding to the minimum average B configuration brightness account for all image blocks collected
Ratio, if the ratio is within a predetermined range, it is determined that include shade in the testing image.
In one embodiment of the invention, the shade judgment module is further used for: being based on minimum average B configuration brightness
It whether determines in the testing image with the comparison result of predetermined threshold comprising before shade, minimum average B configuration brightness and maximum are put down
The half of equal brightness is compared, and if minimum average B configuration brightness is greater than the half of maximum average brightness, it is determined that it is described to
Shade is not included in altimetric image.
In one embodiment of the invention, the cluster module is based on described image feature using K mean cluster algorithm
Described image block is clustered.
In one embodiment of the invention, the characteristic extracting module calculates the operation of the characteristics of image of described image block
Gradient Features and/or color characteristic including calculating described image block.
License image shadow detection method and device provided by the invention based on cluster is judged automatically by picture characteristics
It whether there is shade in image, avoid the process manually checked and judged, treatment effeciency can be greatly improved.
Specific embodiment
In the following description, a large amount of concrete details are given so as to provide a more thorough understanding of the present invention.So
And it is obvious to the skilled person that the present invention may not need one or more of these details and be able to
Implement.In other examples, in order to avoid confusion with the present invention, for some technical characteristics well known in the art not into
Row description.
It should be understood that the present invention can be implemented in different forms, and should not be construed as being limited to propose here
Embodiment.On the contrary, provide these embodiments will make it is open thoroughly and completely, and will fully convey the scope of the invention to
Those skilled in the art.
The purpose of term as used herein is only that description specific embodiment and not as limitation of the invention.Make herein
Used time, " one " of singular, "one" and " described/should " be also intended to include plural form, unless the context clearly indicates separately
Outer mode.It is also to be understood that term " composition " and/or " comprising ", when being used in this specification, determines the feature, whole
The presence of number, step, operations, elements, and/or components, but be not excluded for one or more other features, integer, step, operation,
The presence or addition of component, assembly unit and/or group.Herein in use, term "and/or" includes any of related listed item and institute
There is combination.
In order to thoroughly understand the present invention, detailed step and detailed structure will be proposed in following description, so as to
Illustrate technical solution of the present invention.Presently preferred embodiments of the present invention is described in detail as follows, however other than these detailed descriptions, this
Invention can also have other embodiments.
The embodiment of the present invention provides the license image shadow detection method based on cluster, for the spy based on single image
Property judge automatically in image with the presence or absence of shade.This method is described in detail below with reference to Fig. 1.Fig. 1 shows real according to the present invention
Apply example, license image shadow detection method 100 based on cluster flow chart.As shown in Figure 1, method 100 includes following step
It is rapid:
Step 101: the image block of the multiple and different scales of random acquisition from testing image.For given license figure to be measured
As I, height normalization first can be carried out to it, its height also be zoomed into standard size (such as 512 pixels), while keeping it
Length-width ratio is constant.Height normalize after image in can with the image block of the multiple and different scales of random acquisition, image block
Height is equal with width, and its height and width change at random in a certain section (such as [16,64]).For example, can be random
The image block of P different scale is acquired, wherein P is parameter, and value can be set based on the complexity of license image to be measured.
Illustratively, the representative value of P can be 2560,5120 etc..
Step 102: calculating the characteristics of image of acquired image block.For each acquired image block Rm(m=1,
2 ..., Q), calculate its characteristics of image x (Rm).Illustratively, the Gradient Features and/or color characteristic of image block can be calculated.
Wherein, calculating Gradient Features may include calculating gradient orientation histogram (HOG, Histogram of Oriented
Gradients it) indicates.HOG feature is a kind of statistical value of image gradient distribution.In one embodiment of the invention, HOG is special
The parameter of sign can be set as follows: laterally (x coordinate axis direction) is divided into 8 units, and longitudinal (y-coordinate axis direction) is divided into 8
A unit, gradient direction value is 0-180 degree, and gradient direction is divided into 9 channels.Calculating color characteristic can further wrap
Include calculating color histogram.Color histogram is a kind of statistical presentation of color of image feature, and described is that different color exists
Shared ratio in entire image, and it is not relevant for spatial position locating for every kind of color.Color histogram is close with color space
Cut phase is closed, and calculating color histogram may include calculating RGB color histogram, hsv color histogram and Lab color histogram
Deng.Optionally, Gradient Features and color characteristic, which both can be independently operated, or are stitched together as assemblage characteristic, uses.
Step 103: image block being clustered based on characteristics of image calculated.Cluster is by physics or abstract object
Set is divided into the process for the multiple classes being made of similar object.It in one embodiment of the invention, can be poly- using K mean value
Class algorithm is to all feature x (Rm) (m=1,2 ..., Q) it is clustered.Wherein, the specific value of the classification number T of cluster can
It is arranged with the complexity based on testing image.Illustratively, the value range of T can be [5,10].
Step 104: calculating the average brightness of image block included by each classification after clustering, and be based on minimum average B configuration brightness
It whether determines in testing image with the comparison result of predetermined threshold comprising shade.By cluster, each image block RmHave one
A corresponding classification cm, wherein cm∈[1,...,T].Assuming that the corresponding image block set of T classification is respectively Si, i=1 ...,
T.For each classification, all pixels in the average brightness namely all image blocks of its corresponding all image block are calculated
The mean value l of RGB triple channeli;For all average brightness li, i=1 ..., T calculate minimum value l thereinminAnd it records most
Small value corresponding class number d, d ∈ [1 ..., T].In one embodiment, if lminIt is (exemplary greater than predetermined threshold L
Ground, the representative value of L are 64), then to determine not including shade in image I.If lminLess than or equal to L, then corresponding classification is calculatedThe number of middle image block accounts for the ratio γ of all images block, it may be assumed that
WhereinRepresent setThe number of middle image block.If γ for example meets condition γ within a predetermined range
>=0.005 and γ≤0.50, then determine in image I comprising shade;Otherwise, it is determined that not including shade in image I.
According to one embodiment of present invention, at step 104, the image block included by each classification after calculating cluster
Average brightness after, can be first by minimum average B configuration brightness lminWith maximum average brightness lmaxHalf be compared.Example
Property, if minimum average B configuration brightness lminGreater than maximum average brightness lmaxHalf, i.e. lminAnd lmaxBetween relationship meet under
Formula (2):
It can then determine and not include shade in testing image.
, whereas if lminAnd lmaxBetween relationship be unsatisfactory for formula (2), then be further continued for carry out as described above based on minimum
The comparison result of average brightness and predetermined threshold determines in testing image the step of whether including shade.
License image shadow detection method according to the above embodiment of the present invention based on cluster, which provides, to be suitable for remotely
It opens an account, the automation solutions of the application scenarios such as personal reference.This method judges automatically image by the characteristic of single image
In whether there is shade, have the characteristics that precision height, it is fireballing;This method uses machine learning techniques simultaneously, has good
Generalization can handle different types of license image;This method uses unsupervised approaches, does not need to collect a large amount of instruction in advance
Practice sample;In addition, this method avoid the processes manually checked and judged, therefore it can be greatly improved and remotely open an account, personal sign
The business such as letter handle efficiency.
According to another aspect of the present invention, the license image shadow Detection device based on cluster is additionally provided.Fig. 2 shows
The structural block diagram of license image shadow Detection device 200 according to an embodiment of the present invention based on cluster.As shown in Fig. 2, license
Image shadow Detection device 200 includes that acquisition module 201, characteristic extracting module 202, cluster module 203 and shade judge mould
Block 204.Wherein image block of the acquisition module 201 for the multiple and different scales of random acquisition from testing image;Feature extraction mould
Block 202 is used to calculate the characteristics of image of 201 acquired image block of acquisition module;Cluster module 203 is used to be based on feature extraction
The characteristics of image calculated of module 202 clusters image block;Shade judgment module 204 is for each classification after calculating cluster
The average brightness of included image block, and determined in testing image based on the comparison result of minimum average B configuration brightness and predetermined threshold
It whether include shade.
In one embodiment of the invention, ratio of the shade judgment module 204 based on minimum average B configuration brightness and predetermined threshold
If relatively result, which determines in testing image whether the operation comprising shade may include: minimum average B configuration brightness, is greater than predetermined threshold,
It then determines and does not include shade in testing image;And if minimum average B configuration brightness is less than or equal to predetermined threshold, calculate minimum
The number of the image block of classification corresponding to average brightness accounts for the ratio of all image blocks collected, if the ratio is in predetermined model
In enclosing, it is determined that include shade in testing image.
In one embodiment of the invention, shade judgment module 204 is further used for: based on minimum average B configuration brightness with
Whether the comparison result of predetermined threshold determines in testing image comprising before shade, by minimum average B configuration brightness and maximum average brightness
Half be compared, and if minimum average B configuration brightness is greater than the half of maximum average brightness, it is determined that in testing image not
Include shade.
In one embodiment of the invention, cluster module 203 can be based on characteristics of image pair using K mean cluster algorithm
Image block is clustered.Illustratively, the classification base of cluster in testing image complexity and be arranged.At of the invention one
In embodiment, the operation that characteristic extracting module 202 calculates the characteristics of image of image block may include the gradient spy for calculating image block
Sign and/or color characteristic.
The detailed process of above-mentioned each module operation can be understood with reference to the embodiment of Fig. 1 description, details are not described herein again.This
The modules of inventive embodiments can be implemented in hardware, or the software module to run on one or more processors
It realizes, or is implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice microprocessor or
Person's digital signal processor (DSP) is realized in the license image shadow Detection device according to an embodiment of the present invention based on cluster
Some or all components some or all functions.The present invention is also implemented as executing side as described herein
Some or all device or device programs (for example, computer program and computer program product) of method.It is such
It realizes that program of the invention can store on a computer-readable medium, or can have the shape of one or more signal
Formula.Such signal can be downloaded from an internet website to obtain, and perhaps provide on memory carrier or with any other shape
Formula provides.
The present invention has been explained by the above embodiments, but it is to be understood that, above-described embodiment is only intended to
The purpose of citing and explanation, is not intended to limit the invention to the scope of the described embodiments.Furthermore those skilled in the art
It is understood that the present invention is not limited to the above embodiments, introduction according to the present invention can also be made more kinds of member
Variants and modifications, all fall within the scope of the claimed invention for these variants and modifications.Protection scope of the present invention by
The appended claims and its equivalent scope are defined.