High in the clouds image-recognizing method based on words tree retrieval with similarity checking
Technical field
The present invention relates to image identification technical field, and in particular to a kind of cloud based on words tree retrieval with similarity checking
End image-recognizing method.
Background technology
It is user-defined that realtime graphic search is that one kind can be supported, the realtime graphic of ultra-large image data base
Identification technology.It can realize recognizing the image input content of mobile end equipment in real time.Whole identification process be
What high in the clouds was carried out, can so make user without huge image data base is locally downloading, and can also abundant land productivity
The retrieval of high speed is carried out to database with cloud computing resource.
However, be currently based on high in the clouds realtime graphic identification technology its pass through to upload local picture to server, server
The picture that band is recognized is compared one by one with the picture of storage, and it has following defect:In the case where wireless network is poor,
The speed that user uploads image in real time can be greatly affected.
The content of the invention
In order to solve the above-mentioned technical problem the present invention provides a kind of high in the clouds figure based on words tree retrieval with similarity checking
As recognition methods.
The present invention is achieved through the following technical solutions:
Based on words tree retrieval and the high in the clouds image-recognizing method of similarity checking, comprise the following steps,
Image acquisition step:Target image is obtained, and all ORB characteristic points are extracted using ORB algorithms to target image, and
To corresponding description of each ORB characteristic point generation, the ORB for generating target image describes subsequence;
Image uploading step:The ORB is described into subsequence to upload to based in the high in the clouds image data base for describing subsample;
Image recognizing step:High in the clouds image data base carries out match cognization using the searching algorithm based on words tree to image
And the forward N of matching degree candidate image is returned, wherein N is the natural number more than 1;
Similarity verification step:Candidate image is found in image data base beyond the clouds, target image and candidate image is obtained
128 dimensional vectors, the distance between target image and each candidate image are calculated respectively, and find out the most short candidate image of distance.
The present invention describes subsequence by extracting the ORB characteristic points of target image to generate ORB, and ORB is described into sub- sequence
Row are uploaded in the high in the clouds image data base based on description subsample and carry out retrieval matching, compared to the side for uploading target image
Formula, the data volume for describing son is small, reduces the requirement to network, i.e. network poor small on the speed influence for recognizing.Using words tree
Searching algorithm to be found out and carry out similitude using the distance between target image and candidate image after the forward N of matching degree images and test
Card, the similitude is verified as small-scale, you can ensures quick-searching, also greatly improves the precision of retrieval.
The generation method of the high in the clouds image data base is comprised the following steps:
Sub- generation step is described:Collect pictures, extract the ORB characteristic points per pictures, and each ORB characteristic point is generated
It is corresponding to describe son to obtain describing subsample;
Tree shaped model generation step:The tree shaped model of image data base is generated according to description subsample;
Database generation step:To picture is added in tree shaped model, the image data base of tree is set up.
Existing images match is the matching between image and image, and the increase of the time of retrieval is with the increase line of image
Property increase.One Feature Descriptor matches all Feature Descriptors to lane database, and description of lane database is more, matching
Time is more long, because violence matching is to match one by one, finally finds the most short match group of distance.Ensureing certain degree of accuracy
Under the premise of, there is contradiction in its retrieval rate and range, this 2 points of sizes all with high in the clouds image data base are closely related.And use
The above method, because description in database has carried out tree-shaped classification, when being matched, description to be matched
The branch most like with it can be found, spy to be matched can be allowed without traversal database, i.e. tree search structure really
Description is levied without matching all of description one by one, nodes of the retrieval time mainly with passing through have relation, in database
The many nodes for not representing retrieval process of description are more.So retrieval time is not linearly increasing by the size of database, and
It is that logarithm increases, solves the contradiction between retrieval range and speed.And can add corresponding point for new addition iamge description
Branch, rather than simple increase, therefore also can solve the retrieval situation of large database concept on range.
The sub- generation step of description is specially:Collect pictures, every pictures are zoomed in and out to set up a figure respectively
As pyramid, each yardstick to picture extracts all ORB characteristic points using ORB algorithms, and each ORB characteristic point is generated
Corresponding description.
The tree shaped model generation step is:By the use of the Euclidean distance between description as criterion, to description subsample
Polymerization classification is done with K-means algorithms, the tree shaped model of image data base is generated.
The tree shaped model generation step is specially:
A1, one tree of definition, its maximum number of plies are L, and every layer of maximum son node number is K;
A2, to description subsample K-means algorithms do polymerization classification, obtain child node classification results, will be per height section
Average description of son is described in point as description of the child node;
If the twice of the quantity more than K of description subsample in A3, the child node, to the description subsample in the child node
Make further K-means classification, repeat the step, until the maximum number of plies of tree is saved less than or equal to L or without son
The twice of the description subsample quantity more than K of point;
A4, sort label successively to all of child node, generates the tree shaped model of image data base.
The database generation step is:
B1, give one, picture unique numbering;
B2, the picture is zoomed in and out to set up an image pyramid, each yardstick to picture is carried using ORB algorithms
All ORB characteristic points are taken, and to corresponding description of each ORB characteristic point generation;
B3, the son that is described of the picture is classified using tree shaped model, and by the sub classification results of each description
It is associated in the child node that it is assigned to;
B3, the step of be B1 to B3 to each pictures, obtain the image data base with tree.
128 dimensional vectors for obtaining target image and candidate image are carried out in similarity checking system.
The similarity checking system generation method is comprised the following steps,
C1, by image library image be input into neural network model, obtain every figure it is corresponding 1024 dimension by normalizing
Description of change;
C2, the study that the image in image library is carried out three bytes, the close distance set up between positive sample and positive sample,
Become estranged distance between positive sample and negative sample.
The present invention compared with prior art, has the following advantages and advantages:
1st, it is of the invention that image data base is based on description subsample structure, in recognition target image, by target figure
As retrieval matching is realized in the extraction of description, compared to target image, the data volume for describing son is small, the poor speed to recognizing of network
Degree influence is small.
2nd, the present invention utilizes target image and candidate after finding out the forward N of matching degree image using words tree searching algorithm
The distance between image carries out similitude checking, and the similitude is verified as small-scale, it is ensured that very big while quick-searching
Improve the precision of retrieval.
3rd, the method for the present invention is based on tree search structure, and it can allow Feature Descriptor to be matched without matching institute one by one
Some description, nodes of the retrieval time mainly with passing through have relation, and with the increase of picture number, its retrieval time is not
Size by database is linearly increasing, but logarithm increases, and greatly improves retrieval rate.
Specific embodiment
To make the object, technical solutions and advantages of the present invention become more apparent, with reference to embodiment, the present invention is made
Further to describe in detail, exemplary embodiment of the invention and its explanation are only used for explaining the present invention, are not intended as to this
The restriction of invention.
Embodiment 1
The present embodiment discloses a kind of generation method of the high in the clouds image data base based on description subsample, including following step
Suddenly:
Sub- generation step is described:Collect pictures, extract the ORB characteristic points per pictures, and each ORB characteristic point is generated
It is corresponding to describe son to obtain describing subsample;
Tree shaped model generation step:The tree shaped model of image data base is generated according to description subsample;
Database generation step:To picture is added in tree shaped model, the image data base of tree is set up.
Specifically:
In sub- generation step is described, the picture number of collection will generally require tens of thousands of more and from various scenes, its
It is stored in a file, conventional picture format, for example JPG, JPEG, JPE, JFIF, BMP;Every is schemed respectively
Piece carries out certain scaling to set up an image pyramid, and each yardstick to picture extracts all using ORB algorithms
ORB characteristic points, and to corresponding description of each ORB characteristic point generation.Each picture to being collected into does the step
Treatment, description of ORB characteristic points is the binary sequence of 128.
In tree shaped model generation step, by the use of the Euclidean distance between description as criterion, description subsample is used
K-means algorithms do polymerization classification, generate the tree shaped model of image data base.Do not changed as tree shaped model generation is latter.Compared with
For detailed, following step method can be used:
A1, one tree of definition, its maximum number of plies are L, and every layer of maximum son node number is K;
A2, to description subsample K-means algorithms do polymerization classification, obtain child node classification results, will be per height section
Average description of son is described in point as description of the child node;
If the twice of the quantity more than K of description subsample in A3, the child node, to the description subsample in the child node
Make further K-means classification, repeat the step, until the maximum number of plies of tree is saved less than or equal to L or without son
The twice of the description subsample quantity more than K of point;
A4, all of K-means classification terminate after, from left to right sort label successively to all of child node, generation
The tree shaped model of image data base.
To adding institute's view data in need in tree shaped model to form image data base, it would be desirable to be added to tree-shaped mould
Picture in type is stored in identical file underedge, can specifically use following step:
B1, to added in tree shaped model a pictures when, give one, the picture unique numbering;
B2, the picture is zoomed in and out to set up an image pyramid, each yardstick to picture is carried using ORB algorithms
All ORB characteristic points are taken, and to corresponding description of each ORB characteristic point generation, thus obtaining can represent this
One ORB of picture feature describes subsequence;
B3, the son that is described of the picture is classified using tree shaped model, and by the sub classification results of each description
It is associated in the child node that it is assigned to;After the completion of classification, the numbering will be recorded in each child node of tree shaped model
Description that picture has is occurred in that several times respectively in each node, and the numbering picture can also store its description in those sequences
Number child node on occur in that how many times respectively;
B3, the step of be B1 to B3 to each pictures, obtain the image data base with tree.User can root
According to the demand of itself, at any time arbitrarily to increase in database or deletion picture.
High in the clouds image data base is generated by above-mentioned steps method, when user needs to be identified picture, can be used down
Row method.
Embodiment 2
A kind of high in the clouds image-recognizing method verified with similarity based on words tree retrieval, is comprised the following steps,
Image acquisition step:Target image is obtained, and all ORB characteristic points are extracted using ORB algorithms to target image, and
To corresponding description of each ORB characteristic point generation, the ORB for generating target image describes subsequence;
Image uploading step:The ORB is described into subsequence to upload to based in the high in the clouds image data base for describing subsample;
Image recognizing step:High in the clouds image data base carries out match cognization using the searching algorithm based on words tree to image
And the forward N of matching degree candidate image is returned, wherein N is the natural number more than 1;
Similarity verification step:Candidate image is found in image data base beyond the clouds, target image and candidate image is obtained
128 dimensional vectors, the distance between target image and each candidate image are calculated respectively, and find out the most short candidate image of distance.
Specifically, user is when using realtime graphic identifying system, the mobile end equipment of user often collects a frame target
Image, target image that can be first to collecting uses ORB algorithms to extract all ORB characteristic points, and each ORB characteristic point is given birth to
Into corresponding description, the ORB for generating the target image describes subsequence, and this sequence is sent into high in the clouds.With collect
Target image is compared, and the data volume that ORB describes subsequence can be small very more.
High in the clouds is received after ORB describes subsequence, that is, start with the searching algorithm of retrieval words tree, tree-like what is generated
The forward N of the picture match score candidate's picture, for example 10 are found in image data base.Retrieve each time, can generate
One can customize length according to matching score height arrangement matching result numbered sequence, i.e., using words tree image data base
Efficiently characteristic is retrieved, several candidate pictures similar with Target Photo are promptly found out.
According to candidate's picture number, these pictures are found from picture database, and candidate image and target image is defeated
Enter and obtain corresponding 128 dimensional vector of each image respectively in similarity checking system, according to 128 dimensional vectors calculate target image with it is each
The distance between candidate's picture, finds the most short vector of distance, and the image that its corresponding image is as most matched is fed back to
User.The deficiency of the retrieval precision in the case where words tree structure size is limited can be made up by similarity verification step, and
And, due to by retrieving words tree by best match range shorter that may be present to several candidate's pictures, so
It will be very rapid that similarity checking is carried out to remaining best match candidate picture.
Embodiment 3
In example 2, obtain target image and 128 dimensional vectors of candidate image is carried out in similarity checking system.
The present embodiment is refined to the generation method of similarity checking system.
The present embodiment is based on ImageNet image libraries and neural network model classical on network, and it is in embedded systems
Carry out.Certainly, other image libraries can also be used.It comprises the following steps,
C1, by image library image be input into neural network model, obtain every figure it is corresponding 1024 dimension by normalizing
Description of change;
Two positive samples, one are included in C2, the study that the image in image library is carried out three bytes, i.e. each three byte
Negative sample, with set up between positive sample and positive sample close distance, between positive sample and negative sample become estranged distance.
Now, any one image is input into embedded system, i.e., can exports its corresponding 128 dimensional vector.
Above-described specific embodiment, has been carried out further to the purpose of the present invention, technical scheme and beneficial effect
Describe in detail, should be understood that and the foregoing is only specific embodiment of the invention, be not intended to limit the present invention
Protection domain, all any modification, equivalent substitution and improvements within the spirit and principles in the present invention, done etc. all should include
Within protection scope of the present invention.