CN110069653A - Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass - Google Patents

Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass Download PDF

Info

Publication number
CN110069653A
CN110069653A CN201910190266.XA CN201910190266A CN110069653A CN 110069653 A CN110069653 A CN 110069653A CN 201910190266 A CN201910190266 A CN 201910190266A CN 110069653 A CN110069653 A CN 110069653A
Authority
CN
China
Prior art keywords
picture
matrix
grass
profile diagram
searched
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
Application number
CN201910190266.XA
Other languages
Chinese (zh)
Inventor
张誉怀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910190266.XA priority Critical patent/CN110069653A/en
Publication of CN110069653A publication Critical patent/CN110069653A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

This disclosure relates to which field of image recognition, discloses a kind of method, apparatus, medium and electronic equipment for drawing profile diagram search pictures based on grass.This method comprises: grass, which is drawn profile diagram, is tied to predetermined resolution, profile diagram is drawn with grass after being constrained;The pixel matrix that grass after constraining draws profile diagram is obtained, as the first matrix;For the first picture in picture set to be searched, the first picture is tied to predetermined resolution and carries out gray processing processing, to obtain second picture;For each second picture, obtain by the pixel matrix after the gray value binaryzation of second picture all pixels point, as the second matrix;Based on the first matrix and the second matrix, determine to draw the matched picture of profile diagram from picture set to be searched with the grass as search result.Under the method, user inputs grass and draws profile diagram, so that it may search out and draw the matched picture of profile diagram with the grass, the efficiency for obtaining Target Photo in a large amount of pictures can be improved.

Description

Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass
Technical field
This disclosure relates to field of image recognition, in particular to it is a kind of based on grass draw profile diagram search pictures method, apparatus, Medium and electronic equipment.
Background technique
Along with the development of internet especially mobile Internet, the mankind enter the epoch of information explosion.People are clear Look at webpage or using during APP (Application, abbreviation application program), for some information of rapid saving, usually In such a way that screenshot perhaps saves picture compared with the mode that traditional duplication is perhaps copied screenshot or save picture more It is convenient.Picture is had become contemporary society's transmitting, is shown and protected stored heavy with its intuitive and image expression way Want means.In many cases, after user's text information desired in the case where being saved by the way of screenshot or preservation picture, by It is more in the picture saved using this mode, it is stranded very much if rethinking and looking for oneself desired picture from these pictures in the future It is difficult.
In the realization of the prior art, user can only with the naked eye use people in screenshot or after saving picture to its terminal The mode of work finds its desired picture from numerous pictures for recording and having text information in turn.
Drawback of the prior art is that if the picture for shorthand information of user's preservation is more, and user The presentation back of the picture wanted to look in a user device, then will lead to user finds its required picture Inefficiency.
Summary of the invention
In order to solve the technical issues of finding picture inefficiency present in the relevant technologies, the present invention provides a kind of bases Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn in grass.
According to the one side of the application, a kind of method that profile diagram search pictures are drawn based on grass, the method packet are provided It includes:
The grass that user inputs is drawn profile diagram and is tied to predetermined resolution, profile diagram is drawn with grass after being constrained;
The pixel matrix that grass after the constraint draws profile diagram is obtained, as the first matrix;
For one first picture every in picture set to be searched, first picture is tied to predetermined resolution and is carried out Gray processing processing, to obtain second picture, wherein the picture in the picture set to be searched is the first picture;
For by gray processing treated each second picture, obtain the gray scale of all pixels point of the second picture Pixel matrix after being worth binaryzation, as the second matrix;
Based on first matrix and second matrix, determine to draw with the grass from the picture set to be searched The matched picture of profile diagram is as search result.
According to the another aspect of the application, a kind of device that profile diagram search pictures are drawn based on grass, described device are provided Include:
Grass draws profile diagram constraints module, is configured as drawing profile diagram and being tied to predetermined resolution the grass that user inputs, with Grass draws profile diagram after being constrained;
First matrix obtains module, is configured as obtaining the pixel matrix that grass after the constraint draws profile diagram, as the One matrix;
Gray processing module is configured as every one first picture in the picture set to be searched, by first figure After piece is tied to predetermined resolution and carries out gray processing processing, to obtain second picture, wherein in the picture set to be searched Picture be the first picture;
Second matrix obtains module, is configured as by gray processing treated each second picture, acquisition will be described Pixel matrix after the gray value binaryzation of all pixels point of second picture, as the second matrix;
Matching module is configured as based on first matrix and second matrix, from the picture set to be searched In determine to draw the matched picture of profile diagram with the grass as search result.
According to the another aspect of the application, a kind of computer-readable program medium is provided, computer program is stored with Instruction makes computer execute foregoing method when the computer program instructions are computer-executed.
According to the another aspect of the application, a kind of electronic equipment is provided, the electronic equipment includes:
Processor;
Memory is stored with computer-readable instruction on the memory, and the computer-readable instruction is by the processing When device executes, foregoing method is realized.
The technical solution that the embodiment of the present invention provides can include the following benefits:
For the method provided by the present invention for drawing profile diagram search pictures based on grass, this method comprises: user is inputted Grass draw profile diagram and be tied to predetermined resolution, profile diagram is drawn with grass after being constrained;Grass draws profile diagram after obtaining the constraint Pixel matrix, as the first matrix;For one first picture every in picture set to be searched, first picture is constrained To predetermined resolution and gray processing processing is carried out, to obtain second picture, wherein the picture in the picture set to be searched is First picture;For by gray processing treated each second picture, obtain the ash of all pixels point of the second picture Pixel matrix after angle value binaryzation, as the second matrix;Based on first matrix and second matrix, from it is described to Determine to draw the matched picture of profile diagram in search pictures set with the grass as search result.
Under the method, profile diagram is drawn by allowing user only to need drafting or inputting a grass, then establishes pixel matrix, And gray processing and binary conversion treatment are carried out to matrix, so that it may search out and draw the matched picture of profile diagram with the grass, can be improved The efficiency of Target Photo is obtained in a large amount of pictures.
It should be understood that the above general description and the following detailed description are merely exemplary, this can not be limited Invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and in specification together principle for explaining the present invention.
Fig. 1 is a kind of applied field of method that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment Scape schematic diagram;
Fig. 2 is a kind of process of method that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment Figure;
Fig. 3 is the flow chart of the details of the step 250 of the embodiment shown in corresponding embodiment according to fig. 2;
Fig. 4 is the flow chart according to the details of the step 253 of the embodiment shown in Fig. 3 corresponding embodiment;
Fig. 5 is the flow chart of the details of the step 253 of another embodiment shown according to Fig. 3 corresponding embodiment;
Fig. 6 is the flow chart of the details of the step 250 of another embodiment shown in corresponding embodiment according to fig. 2;
Fig. 7 is the flow chart of the details of the step 250 of the another embodiment shown in corresponding embodiment according to fig. 2;
Fig. 8 is the step 253 according to the embodiment shown in Fig. 7 corresponding embodiment " details flow chart;
Fig. 9 is a kind of block diagram of device that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment;
Figure 10 is a kind of electronics of method that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment Device examples block diagram;
Figure 11 is shown according to an exemplary embodiment a kind of to draw profile diagram search pictures based on grass for realizing above-mentioned Method computer readable storage medium.
Specific embodiment
Here will the description is performed on the exemplary embodiment in detail, the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
In addition, attached drawing is only the schematic illustrations of the disclosure, it is not necessarily drawn to scale.Identical attached drawing mark in figure Note indicates same or similar part, thus will omit repetition thereof.Some block diagrams shown in the drawings are function Energy entity, not necessarily must be corresponding with physically or logically independent entity.
The disclosure provides firstly a kind of method for drawing profile diagram search pictures based on grass.Picture refers to by figure, image Etc. compositions print media.Signified picture is only the figure of spreadsheet format in the presently disclosed embodiments.Grass draws profile Figure can be the brief diagram being made of irregular lines, can be the photo of shooting, be also possible to what user was produced with Freehandhand-drawing Irregular frame diagram can also be the picture that machine automatically generates, in addition, grass, which draws profile diagram, can also be complete by rule Lines composed by figure.Therefore it is only that the disclosure claims a kind of generation of the figure of search pictures to be used to that grass, which draws profile diagram, can To be any figure that can be used to search pictures, therefore the protection scope of the disclosure should not be restricted.
Method of the invention can be fixed on various terminals, such as server, the physical infrastructure of cloud computing, intelligent hand Machine, tablet computer, desktop computer, laptop, iPad, self-service terminal etc. are any to have the function of operation control and communication The equipment or cluster tool of function.
When being stored with picture in the equipment of user or terminal, each picture of storage is arranged in particular order, Under traditional approach, if user wants to find required picture in the picture of storage, can only with the naked eye in numerous pictures by One finds;However, as the picture that the reduction and people of the price of storage medium are generated by modes such as shooting, screenshots is more next More, the picture stored in the equipment or terminal of user is also just more and more, at this time if also allowing user with the naked eye numerous In picture find needed for picture, efficiency be undoubtedly it is very low under.The present disclosure proposes a kind of creative technical solution, Profile diagram is drawn come search pictures by grass, substantially increases the efficiency of search pictures.
Fig. 1 is a kind of applied field of method that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment Scape schematic diagram.As shown in Figure 1, the grass for the number " 7 " that user inputs a Freehandhand-drawing to terminal draws profile diagram, however terminal is not recognized Know the practical significance of " 7 ", it is actually multiple pixels that " 7 ", which draw the form of expression in profile diagram in grass, and pixel is characterized Information can be identified by terminal.Embodiment shown in FIG. 1 is by believing to being recorded in grass and draw pixel on profile diagram Breath is handled, and is had found and is drawn a kind of approach of profile diagram and picture foundation connection in grass, finally in the database of terminal connection In retrieve and draw the matched picture of profile diagram with the grass of user's input, the skills of profile diagram search pictures is drawn based on grass to realize Art scheme.
Fig. 2 is a kind of process of method that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment Figure.As shown in Fig. 2, the method the following steps are included:
Step 210, the grass that user inputs is drawn profile diagram and is tied to predetermined resolution, profile is drawn with grass after being constrained Figure.
Resolution ratio is for measuring the information content stored in image and the index for characterizing image definition.Usually with horizontal picture The product of prime number and Vertical number of pixels is expressed.
The grass that user inputs is drawn profile diagram and is tied to predetermined resolution and refers to that grass, which is drawn profile diagram, zooms to scheduled ruler It is very little, and do not keep aspect ratio.For example, grass is drawn the square-shaped image that profile diagram is scaled 8 × 8.
In one embodiment, by grass draw profile diagram be tied to predetermined resolution mode may is that first obtain grass draw wheel Then the width and height of wide figure obtain the width and height of predetermined resolution, draw profile diagram and predetermined resolution according to the grass of acquisition It is wide and high, determining, grass draws scaling of the profile diagram on wide direction and high direction and grass drawn then according to scaling The pixel value of each pixel of profile diagram is replicated on wide direction and high direction respectively, and grass is drawn after finally obtaining constraint Profile diagram.
It should be pointed out that the grass of user's input is drawn profile diagram and be can be and is directly inputted to implementation terminal of the invention, It can be and be first input into another terminal, then another terminal is sent to implementation terminal of the invention.In addition, user, which inputs grass, draws wheel The mode of wide figure, which can be using mouse, keyboard, drawing board, touch screen, touch tablet, capacitance pen etc., to be recorded user's grass and draws profile The pixel dot position information of figure simultaneously sends present invention implementation terminal;It can also be and directly submit times of storage on the subscriber terminal What picture comprising certain lines or structure.
Step 220, the pixel matrix that grass after the constraint draws profile diagram is obtained, as the first matrix.
In one embodiment, the pixel value of each pixel on profile diagram is drawn to grass first according to sequence from left to right It is laterally traversed, obtains the pixel value of all pixels point, the pixel value traversed to the first row pixel is set as first The value of the first row of matrix, wherein matrix column number and the sequence consensus that each pixel is traversed;Then again to next Capable pixel traversal, until the pixel value that the grass draws each pixel of profile diagram is all accordingly present in the first matrix.
Step 230, for one first picture every in picture set to be searched, first picture is narrowed down into predetermined resolution Rate simultaneously carries out gray processing processing, to obtain second picture, wherein the picture in the picture set to be searched is the first picture.
Gray color refers to a series of intermediate colors from black to white in pure white, black and the two.Do not include in gray color Any form and aspect, i.e., there is no colors as red, yellow.
In one embodiment, gray processing processing refers to R (Red, red), G (Green, green) and B (Blue, indigo plant Color) values of three color variances is set as similarly being worth, i.e. gray value.
In one embodiment, by the average value of each tri- variate-values of pixel R, G, B of the picture before gray processing It is set as the value of tri- variables of R, G, B of the picture gray processing treated the corresponding pixel of picture, i.e. gray value.
In one embodiment, the value of 0.32*x+0.56*y+0.12*z is set as to treated by the picture gray processing The value of tri- variables of R, G, B of the corresponding pixel of picture, i.e. gray value, each picture of the picture before wherein x is gray processing The variate-value of vegetarian refreshments R, y are the variate-value of the G of the pixel of the picture before gray processing, and z is the picture before gray processing The variate-value of the B of the pixel.
Step 240, it for by gray processing treated each second picture, obtains all pixels of the second picture Pixel matrix after the gray value binaryzation of point, as the second matrix.
Binaryzation refers to, the value of tri- variables of pixel R, G, B each in picture is set as 0 or 255, when a pixel When the value of tri- variables of R, G, B of point is 0, which is black, and the value of tri- variables of R, G, B when a pixel When being 255, which is white.
In one embodiment, binaryzation is carried out in the following way: the gray value of more each pixel and and gray scale It is worth the size of threshold value;As soon as the gray value of the pixel is set as when the gray value of pixel is greater than gray value threshold value 255, as soon as conversely, the gray value of the pixel is set as 0 when the gray value of pixel is less than gray value threshold value.
In one embodiment, gray value threshold value is set as 127.
In one embodiment, which is set as ash by the average value for obtaining the gray value of all pixels point in picture Angle value threshold value.
In one embodiment, gray value threshold value is obtained in the following way: obtaining the gray scale of all pixels point in picture Value;For each gray value, determine the gray value in the frequency of occurrence of pixel, the i.e. frequency of the gray value;With gray value Frequency is ordinate, using gray value as abscissa, establishes grey value histograms, judges each gray value by grey value histograms Frequency is changed most violent gray value as gray value threshold value by frequency variation.
Step 250, be based on first matrix and second matrix, determined from the picture set to be searched with The grass draws the matched picture of profile diagram as search result.
In one embodiment, it is based on first matrix and second matrix, from the picture set to be searched It determines to draw the matched picture of profile diagram with the grass as shown in Figure 3 as the specific steps of search result.Fig. 3 is according to fig. 2 The flow chart of the details of the step 250 of an embodiment shown in corresponding embodiment, as shown in figure 3, step 250 includes following step It is rapid:
Step 251, first matrix and second matrix are shown laid flat in n-dimensional vector respectively, wherein n is described predetermined The horizontal pixel of resolution ratio and the product of vertical pixel.
By matrix be shown laid flat in vector refer to by the pixel value of each element in matrix according to certain sequence be placed in one to In amount, each element in matrix can be found in the vector.
In one embodiment, it since the first row of matrix, for every a line in such a way that column are incremented by, takes to traversal The element in matrix and it is converted into the element in vector out.
In one embodiment, it since the first row of matrix, for each column in such a way that row is incremented by, takes to traversal The element in matrix and it is converted into the element in vector out.
For example, the corresponding predetermined resolution of a matrix is 80*80, then horizontal pixel is 80, vertical pixel 80, the two Product be 6400, so the matrix to be shown laid flat in the vector of 6400 dimensions.
Step 252, for every one second matrix, the n of the n-dimensional vector and first matrix that calculate every one second matrix is tieed up The COS distance of vector.
COS distance can be used for numerical value of two vectors of characterization in terms of the difference of directionality, be pressed from both sides using two vectors Cosine of an angle value can measure the size of two vector difference.Therefore the difference between two vectors can be judged with COS distance It is different, and then the matching degree of corresponding two picture can be judged according to the difference condition of two vectors.
Specifically, the COS distance between two vectors can calculate in the following way:
Wherein, n is the element number of two vectors, AiFor i-th of element of the n-dimensional vector of the first matrix, BiFor the second square I-th of element of the n-dimensional vector of battle array.
In one embodiment, since the range of cosine value is [- 1,1], normalized to cos θ by following formula [- 1,1] between:
Due to for different pictures determine COS distance may be widely different, cause the comparativity of COS distance compared with Difference.So the advantage of this embodiment is that, the difference of the COS distance between the vector determined based on different pictures is reduced, is mentioned The high comparativity of COS distance.
Step 253, it according to the COS distance, determines to draw profile diagram with the grass from the picture set to be searched Matched picture is as search result.
In one embodiment, in all second pictures of picture set to be searched, corresponding COS distance is obtained most Big second picture draws the matched picture of profile diagram as with the grass.
In one embodiment, to each second picture in all second pictures, judgement for the second picture the Whether the COS distance that the n-dimensional vector of two matrixes determines is less than predetermined COS distance threshold value;It is less than in corresponding COS distance pre- Determine to appoint in the second picture of COS distance threshold value and takes one as with the grass and draw the matched picture of profile diagram.In some cases Under, the COS distance of a second picture is smaller, it is closest to be not meant to that the second picture and the grass draw profile diagram, when more When the corresponding COS distance of a second picture is less than predetermined COS distance threshold value, these second pictures may not be able to be enough at this time COS distance draws the matching degree of profile diagram to characterize it with the grass, i.e., grass draws profile diagram and the matching degree of second picture exists It can not achieve apparent differentiation with COS distance at this time.So the advantage of this embodiment is that, make corresponding COS distance foot Enough small second pictures have it is fair be selected as drawing the chance of the matched picture of profile diagram with the grass, to a certain degree On reduce to COS distance is used the dependence for determining that the matched picture of profile diagram is drawn with the grass.
Fig. 4 is the flow chart according to the details of the step 253 of the embodiment shown in Fig. 3 corresponding embodiment.Such as Fig. 4 institute Show, step 253 includes following sub-step:
Step 2531, it to all second pictures, is determined according to the n-dimensional vector of the second matrix for each second picture COS distance is ranked up from small to large.
In one embodiment, using Bubble Sort Algorithm, to the COS distance determined for each second picture from it is small to It is ranked up greatly.
In one embodiment, using quick sorting algorithm, to the COS distance determined for each second picture from it is small to It is ranked up greatly.
Step 2532, sequence is drawn into the matched picture of profile diagram as with the grass in the second picture of preceding predetermined number.
In one embodiment, a counter is equipped in the implementation terminal of the disclosure, it can be to the sequence of second picture It is counted, as soon as often counting a second picture, which adds 1, until counter counts count to the predetermined number, finally by meter The second picture that number device number is crossed draws the matched picture of profile diagram as with the grass.
In conclusion embodiment illustrated in fig. 4 is advantageous in that, a second picture is selected to draw wheel as with the grass Exterior feature schemes matched picture, and right rear line is presented, and the second picture and the grass selected in this case draw profile diagram real With a possibility that it is lower;However if multiple matched pictures of profile diagram that may draw with the grass are existed in this way to user's presentation There is a possibility that really drawing the matched picture of profile diagram with the grass in these pictures to be considerably improved, simultaneously because incited somebody to action A large amount of second picture filters out, and the second picture quantity presented at this time to user is sufficiently small, also mentions to a certain extent The high efficiency of search pictures.
So the advantage of this embodiment is that, it ensure that the number that the matched picture of profile diagram is drawn with the grass of acquisition, While improving the efficiency of search pictures, the accuracy of the picture searched out is improved.
Fig. 5 is the flow chart of the details of the step 253 of another embodiment shown according to Fig. 3 corresponding embodiment.Such as Fig. 5 institute Show, step 253 the following steps are included:
Step 2531', to each second picture in all second pictures, judgement is directed to the second matrix of the second picture N-dimensional vector determine COS distance whether be less than predetermined COS distance threshold value.
Step 2532', using corresponding COS distance be less than predetermined COS distance threshold value second picture as with the grass Draw the matched picture of profile diagram.
If drawn for a picture and grass, the COS distance that profile diagram determines is too big, and the picture and grass draw profile diagram With a possibility that it is lower, while corresponding COS distance be less than predetermined COS distance threshold value second picture may have it is multiple, this A little second pictures are all that very possible profile diagram of drawing with the grass is matched, if by these second pictures to user's displaying, meeting Improve the efficiency of search pictures.So the advantage of this embodiment is that, it eliminates and draws a possibility that profile diagram matches with the grass Lower second picture improves the efficiency of search pictures.
Fig. 6 is the flow chart of the details of the step 250 of another embodiment shown in corresponding embodiment according to fig. 2.Such as Fig. 6 institute Show, step 250 includes following sub-step:
First matrix and second matrix are shown laid flat in n-dimensional vector respectively by step 251', and wherein n is described pre- Determine the horizontal pixel of resolution ratio and the product of vertical pixel.
Step 252', the n-dimensional vector obtained to all the second matrixes for second picture clusters, more to be divided into A class.
In one embodiment, all n-dimensional vectors are clustered by K-means algorithm.K-means algorithm is hard poly- Class algorithm is the representative of the typically objective function clustering method based on prototype, it is certain distance work of data point to prototype For the objective function of optimization, the adjustment rule of interative computation is obtained using the method that function seeks extreme value.K-means algorithm generally flows Journey are as follows: arbitrarily select k object as initial cluster center from m data object;It calculates in all data objects and k cluster The distance of the heart recently just incorporates the object for class representated by which center into apart from which center;Redefine the center of class; Cluster is iterated with the center of the class redefined until cluster no longer variation or the number of iterations reach predetermined threshold.
In one embodiment, each vector is using Euclidean distance at a distance from initial cluster center.A such as vector For (x1, y1), the vector of initial cluster center is (x2, y2), then Euclidean distance between the two are as follows:
Step 253' obtains the center vector of institute's directed quantity in class for each class in the multiple class.
In one embodiment, the average value for obtaining the corresponding element of institute's directed quantity in class, as the center vector Corresponding element value.
Step 254' determines the distance between the n-dimensional vector of each center vector Yu first matrix.
Step 255' makees the corresponding second picture of n-dimensional vector in the class belonging to the smallest center vector To draw the matched picture of profile diagram with the grass.
Apart from smaller, illustrate that the corresponding second picture of the vector in class belonging to the center vector and the grass draw profile diagram It is more similar.The advantage of this embodiment is that drawing the matched picture of profile diagram with the grass how to determine by way of cluster A preferable solution is provided, the efficiency of search pictures is improved.
Fig. 7 is the flow chart of the details of the step 250 of the another embodiment shown in corresponding embodiment according to fig. 2.Such as Fig. 7 institute Show, step 250 the following steps are included:
First matrix and second matrix are shown laid flat in n-dimensional vector respectively by step 251 ", and wherein n is described pre- Determine the horizontal pixel of resolution ratio and the product of vertical pixel.
Step 252 " determines and the n-dimensional vector of first matrix respectively for the n-dimensional vector of every one second matrix COS distance and Euclidean distance.
Relating to how to determine COS distance and Euclidean distance between two vectors, the disclosure is in the above-described embodiment Specific elaboration is made, details are not described herein again.
Step 253 " is determined and institute according to the COS distance and Euclidean distance from the picture set to be searched It states grass and draws the matched picture of profile diagram as search result.
In one embodiment, it according to the COS distance and Euclidean distance, is determined from the picture set to be searched The matched picture of profile diagram is drawn with the grass out to specifically include: obtaining the weight of COS distance and Euclidean distance respectively;Based on institute Weight is stated, the weighted sum of the COS distance and Euclidean distance that determine for the n-dimensional vector of every one second matrix is obtained;To all Two pictures are arranged from small to large according to the weighted sum that the n-dimensional vector of the second matrix for each second picture determines Sequence;By sequence in the second picture of preceding predetermined number, the matched picture of profile diagram is drawn as with the grass.
It since COS distance and Euclidean distance can characterize the similarity degree of two vectors, and is from two different angles Spend the similarity degree of two vectors embodied.So the advantage of this embodiment is that, it is contemplated that COS distance and Euclidean distance The different role of two aspect key factors when determining that second picture and grass draw the matching degree of profile diagram, improves and determines The accuracy of the matched picture of profile diagram is drawn with the grass.
Fig. 8 is the step 253 according to the embodiment shown in Fig. 7 corresponding embodiment " details flow chart.Such as Fig. 8 institute Show, step 253 " the following steps are included:
Step 2531 ", by the Euclidean distance determined for the n-dimensional vector of all second matrixes according to sequence from small to large It is divided into multiple Euclidean distance sections.
Step 2532 ", to all second pictures, determined according to the n-dimensional vector of the second matrix for each second picture Euclidean distance be ranked up from small to large, wherein to the second picture in each Euclidean distance section, according to for every 1 the The COS distance that the n-dimensional vector of second matrix of two pictures determines is ranked up from small to large.
Step 2533 ", by sequence in the second picture of preceding predetermined number, the matched figure of profile diagram is drawn as with the grass Piece.
It since COS distance and Euclidean distance can characterize the similarity degree of two vectors, and is from two different angles Spend the similarity degree of two vectors embodied.If obtained according only to the size relation of COS distance or Euclidean distance with The grass draws the matched picture of profile diagram, such that the second picture embodied and the grass draw the matching degree of profile diagram It is not accurate enough.The advantage of this embodiment is that making COS distance and Euclidean distance that can draw profile diagram with the grass obtaining Its due effect is embodied during matched picture, improve determine draw the matched picture of profile diagram with the grass Accuracy.
The disclosure additionally provides a kind of device that profile diagram search pictures are drawn based on grass, is that the device of the disclosure is implemented below Example.
Fig. 9 is a kind of block diagram of device that profile diagram search pictures are drawn based on grass shown according to an exemplary embodiment. As shown in figure 9, the device 900 that should draw profile diagram search pictures based on grass includes:
Grass draws profile diagram constraints module 910, is configured as drawing profile diagram and being tied to predetermined resolution the grass that user inputs, Profile diagram is drawn with grass after being constrained.
First matrix obtains module 920, is configured as obtaining the pixel matrix that grass after the constraint draws profile diagram, as First matrix.
Gray processing module 930 is configured as every one first picture in the picture set to be searched, by described first After picture is tied to predetermined resolution and carries out gray processing processing, to obtain second picture, wherein the picture set to be searched In picture be the first picture.
Second matrix obtains module 940, is configured as obtaining for by gray processing treated each second picture by institute Pixel matrix after stating the gray value binaryzation of all pixels point of second picture, as the second matrix.
Matching module 950 is configured as based on first matrix and second matrix, from the pictures to be searched Determine to draw the matched picture of profile diagram in conjunction with the grass as search result.
According to the third aspect of the disclosure, additionally provides a kind of can be realized and above-mentioned profile diagram search pictures are drawn based on grass The electronic equipment of method.
Person of ordinary skill in the field it is understood that various aspects of the invention can be implemented as system, method or Program product.Therefore, various aspects of the invention can be embodied in the following forms, it may be assumed that complete hardware embodiment, complete The embodiment combined in terms of full Software Implementation (including firmware, microcode etc.) or hardware and software, can unite here Referred to as circuit, " module " or " system ".
The electronic equipment 1000 of this embodiment according to the present invention is described referring to Figure 10.The electricity that Figure 10 is shown Sub- equipment 1000 is only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in Figure 10, electronic equipment 1000 is showed in the form of universal computing device.The component of electronic equipment 1000 can To include but is not limited to: at least one above-mentioned processing unit 1010, connects not homologous ray at least one above-mentioned storage unit 1020 The bus 1030 of component (including storage unit 1020 and processing unit 1010).
Wherein, the storage unit is stored with program code, and said program code can be held by the processing unit 1010 Row, so that various according to the present invention described in the execution of the processing unit 1010 above-mentioned " embodiment method " part of this specification The step of illustrative embodiments.
Storage unit 1020 may include the readable medium of volatile memory cell form, such as Random Access Storage Unit (RAM) 1021 and/or cache memory unit 1022, it can further include read-only memory unit (ROM) 1023.
Storage unit 1020 can also include program/utility with one group of (at least one) program module 1025 1024, such program module 1025 includes but is not limited to: operating system, one or more application program, other program moulds It may include the realization of network environment in block and program data, each of these examples or certain combination.
Bus 1030 can be to indicate one of a few class bus structures or a variety of, including storage unit bus or storage Cell controller, peripheral bus, graphics acceleration port, processing unit use any bus structures in a variety of bus structures Local bus.
Electronic equipment 1000 can also be with one or more external equipments 1200 (such as keyboard, sensing equipment, bluetooth equipment Deng) communication, can also be enabled a user to one or more equipment interact with the electronic equipment 1000 communicate, and/or with make The electronic equipment 1000 can with it is one or more of the other calculating equipment be communicated any equipment (such as router, modulation Demodulator etc.) communication.This communication can be carried out by input/output (I/O) interface 1050.Also, electronic equipment 1000 Network adapter 1060 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public affairs can also be passed through Common network network, such as internet) communication.As shown, network adapter 1060 passes through its of bus 1030 and electronic equipment 1000 The communication of its module.It should be understood that although not shown in the drawings, other hardware and/or software can be used in conjunction with electronic equipment 1000 Module, including but not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, magnetic Tape drive and data backup storage system etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the disclosure The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating Equipment (can be personal computer, server, terminal installation or network equipment etc.) is executed according to disclosure embodiment Method.
According to the fourth aspect of the disclosure, a kind of computer readable storage medium is additionally provided, being stored thereon with can be real The program product of existing this specification above method.In some possible embodiments, various aspects of the invention can also be real It is now a kind of form of program product comprising program code, when described program product is run on the terminal device, the journey Sequence code is each according to the present invention described in above-mentioned " illustrative methods " part of this specification for executing the terminal device The step of kind illustrative embodiments.
With reference to shown in Figure 11, the program product for realizing the above method of embodiment according to the present invention is described 1100, can using portable compact disc read only memory (CD-ROM) and including program code, and can in terminal device, Such as it is run on PC.However, program product of the invention is without being limited thereto, in this document, readable storage medium storing program for executing can be with To be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or It is in connection.
Described program product can be using any combination of one or more readable mediums.Readable medium can be readable letter Number medium or readable storage medium storing program for executing.Readable storage medium storing program for executing for example can be but be not limited to electricity, magnetic, optical, electromagnetic, infrared ray or System, device or the device of semiconductor, or any above combination.The more specific example of readable storage medium storing program for executing is (non exhaustive List) include: electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM), read-only Memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read only memory (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, In carry readable program code.The data-signal of this propagation can take various forms, including but not limited to electromagnetic signal, Optical signal or above-mentioned any appropriate combination.Readable signal medium can also be any readable Jie other than readable storage medium storing program for executing Matter, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or and its The program of combined use.
The program code for including on readable medium can transmit with any suitable medium, including but not limited to wirelessly, have Line, optical cable, RF etc. or above-mentioned any appropriate combination.
The program for executing operation of the present invention can be write with any combination of one or more programming languages Code, described program design language include object oriented program language-Java, C++ etc., further include conventional Procedural programming language-such as " C " language or similar programming language.Program code can be fully in user It calculates and executes in equipment, partly executes on a user device, being executed as an independent software package, partially in user's calculating Upper side point is executed on a remote computing or is executed in remote computing device or server completely.It is being related to far Journey calculates in the situation of equipment, and remote computing device can pass through the network of any kind, including local area network (LAN) or wide area network (WAN), it is connected to user calculating equipment, or, it may be connected to external computing device (such as utilize ISP To be connected by internet).
In addition, above-mentioned attached drawing is only the schematic theory of processing included by method according to an exemplary embodiment of the present invention It is bright, rather than limit purpose.It can be readily appreciated that the time that above-mentioned processing shown in the drawings did not indicated or limited these processing is suitable Sequence.In addition, be also easy to understand, these processing, which can be, for example either synchronously or asynchronously to be executed in multiple modules.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and change can executed without departing from the scope.The scope of the present invention is limited only by the attached claims.

Claims (10)

1. a kind of method for drawing profile diagram search pictures based on grass, which is characterized in that the described method includes:
The grass that user inputs is drawn profile diagram and is tied to predetermined resolution, profile diagram is drawn with grass after being constrained;
The pixel matrix that grass after the constraint draws profile diagram is obtained, as the first matrix;
For one first picture every in picture set to be searched, first picture is tied to predetermined resolution and carries out gray scale Change processing, to obtain second picture, wherein the picture in the picture set to be searched is the first picture;
For by gray processing treated each second picture, obtain the gray value two of all pixels point of the second picture Pixel matrix after value, as the second matrix;
Based on first matrix and second matrix, determine to draw profile with the grass from the picture set to be searched Matched picture is schemed as search result.
2. the method according to claim 1, wherein it is described be based on first matrix and second matrix, Determine to draw the matched picture of profile diagram from the picture set to be searched with the grass as search result, comprising:
First matrix and second matrix are shown laid flat in n-dimensional vector respectively, wherein n is the level of the predetermined resolution The product of pixel and vertical pixel;
For every one second matrix, calculate the cosine of the n-dimensional vector of every one second matrix and the n-dimensional vector of first matrix away from From;
According to the COS distance, determine that the matched picture of profile diagram is drawn with the grass to be made from the picture set to be searched For search result.
3. according to the method described in claim 2, it is characterized in that, described according to the COS distance, from the figure to be searched Determine to draw the matched picture of profile diagram in piece set with the grass as search result, comprising:
To all second pictures, the COS distance that determines according to the n-dimensional vector of the second matrix for each second picture is from small To being ranked up greatly;
By sequence in the second picture of preceding predetermined number, the matched picture of profile diagram is drawn as with the grass.
4. according to the method described in claim 2, it is characterized in that, described according to the COS distance, from the figure to be searched Determine to draw the matched picture of profile diagram in piece set with the grass as search result, comprising:
To each second picture in all second pictures, judgement is determined for the n-dimensional vector of the second matrix of the second picture COS distance whether be less than predetermined COS distance threshold value;
The second picture that corresponding COS distance is less than predetermined COS distance threshold value is matched as profile diagram is drawn with the grass Picture.
5. the method according to claim 1, wherein it is described be based on first matrix and second matrix, Determine to draw the matched picture of profile diagram from the picture set to be searched with the grass as search result, comprising:
First matrix and second matrix are shown laid flat in n-dimensional vector respectively, wherein n is the level of the predetermined resolution The product of pixel and vertical pixel;
The n-dimensional vector obtained to all the second matrixes for second picture clusters, to be divided into multiple classes;
For each class in the multiple class, the center vector of institute's directed quantity in class is obtained;
Determine the distance between the n-dimensional vector of each center vector Yu first matrix;
The corresponding second picture of n-dimensional vector in the class belonging to the smallest center vector is drawn into wheel as with the grass Exterior feature schemes matched picture.
6. the method according to claim 1, wherein it is described be based on first matrix and second matrix, Determine to draw the matched picture of profile diagram from the picture set to be searched with the grass as search result, comprising:
First matrix and second matrix are shown laid flat in n-dimensional vector respectively, wherein n is the level of the predetermined resolution The product of pixel and vertical pixel;
For the n-dimensional vector of every one second matrix, determine respectively and the COS distance of the n-dimensional vector of first matrix and European Distance;
According to the COS distance and Euclidean distance, determine to draw profile diagram with the grass from the picture set to be searched The picture matched is as search result.
7. according to the method described in claim 6, it is characterized in that, described according to the COS distance and Euclidean distance, from institute It states and determines to draw the matched picture of profile diagram in picture set to be searched with the grass as search result, comprising:
It is multiple European by being divided into for the determining Euclidean distance of the n-dimensional vector of all second matrixes according to sequence from small to large Apart from section;
To all second pictures, the Euclidean distance that determines according to the n-dimensional vector of the second matrix for each second picture is from small To being ranked up greatly, wherein to the second picture in each Euclidean distance section, according to the second square for being directed to each second picture The COS distance that the n-dimensional vector of battle array determines is ranked up from small to large;
By sequence in the second picture of preceding predetermined number, the matched picture of profile diagram is drawn as with the grass.
8. a kind of device for drawing profile diagram search pictures based on grass, the picture belong to picture set to be searched, which is characterized in that Described device includes:
Grass draws profile diagram constraints module, is configured as drawing profile diagram and being tied to predetermined resolution the grass that user inputs, to obtain Grass draws profile diagram after constraint;
First matrix obtains module, is configured as obtaining the pixel matrix that grass after the constraint draws profile diagram, as the first square Battle array;
Gray processing module is configured as every one first picture in the picture set to be searched, about by first picture Beam is to predetermined resolution and after carrying out gray processing processing, to obtain second picture, wherein the figure in the picture set to be searched Piece is the first picture;
Second matrix obtains module, is configured as obtaining for by gray processing treated each second picture by described second Pixel matrix after the gray value binaryzation of all pixels point of picture, as the second matrix;
Matching module is configured as based on first matrix and second matrix, from the picture set to be searched really It makes and draws the matched picture of profile diagram as search result with the grass.
9. a kind of computer-readable program medium, which is characterized in that it is stored with computer program instructions, when the computer journey When sequence instruction is computer-executed, computer is made to execute method according to any one of claim 1 to 7.
10. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
Processor;
Memory is stored with computer-readable instruction on the memory, and the computer-readable instruction is held by the processor When row, method as described in any one of claim 1 to 7 is realized.
CN201910190266.XA 2019-03-13 2019-03-13 Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass Pending CN110069653A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910190266.XA CN110069653A (en) 2019-03-13 2019-03-13 Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910190266.XA CN110069653A (en) 2019-03-13 2019-03-13 Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass

Publications (1)

Publication Number Publication Date
CN110069653A true CN110069653A (en) 2019-07-30

Family

ID=67366297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910190266.XA Pending CN110069653A (en) 2019-03-13 2019-03-13 Method, apparatus, medium and the electronic equipment of profile diagram search pictures are drawn based on grass

Country Status (1)

Country Link
CN (1) CN110069653A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140169683A1 (en) * 2012-12-18 2014-06-19 Samsung Electronics Co., Ltd. Image retrieval method, real-time drawing prompting method, and devices thereof
CN108109108A (en) * 2016-11-25 2018-06-01 北京视联动力国际信息技术有限公司 A kind of image split-joint method and device based on cosine similarity adaptive algorithm
CN108614884A (en) * 2018-05-03 2018-10-02 桂林电子科技大学 A kind of image of clothing search method based on convolutional neural networks
CN108932514A (en) * 2017-05-26 2018-12-04 上海大唐移动通信设备有限公司 A kind of image-recognizing method and device
CN109145140A (en) * 2018-09-08 2019-01-04 中山大学 One kind being based on the matched image search method of hand-drawn outline figure and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140169683A1 (en) * 2012-12-18 2014-06-19 Samsung Electronics Co., Ltd. Image retrieval method, real-time drawing prompting method, and devices thereof
CN108109108A (en) * 2016-11-25 2018-06-01 北京视联动力国际信息技术有限公司 A kind of image split-joint method and device based on cosine similarity adaptive algorithm
CN108932514A (en) * 2017-05-26 2018-12-04 上海大唐移动通信设备有限公司 A kind of image-recognizing method and device
CN108614884A (en) * 2018-05-03 2018-10-02 桂林电子科技大学 A kind of image of clothing search method based on convolutional neural networks
CN109145140A (en) * 2018-09-08 2019-01-04 中山大学 One kind being based on the matched image search method of hand-drawn outline figure and system

Similar Documents

Publication Publication Date Title
AU2018250370B2 (en) Weakly supervised model for object detection
EP3853764A1 (en) Training neural networks for vehicle re-identification
EP4040401A1 (en) Image processing method and apparatus, device and storage medium
CN110348412B (en) Key point positioning method and device, electronic equipment and storage medium
CN108876871A (en) Image processing method, device and computer readable storage medium based on circle fitting
CN110096929A (en) Target detection neural network based
CN107832794A (en) A kind of convolutional neural networks generation method, the recognition methods of car system and computing device
CN113742483A (en) Document classification method and device, electronic equipment and storage medium
US20100142769A1 (en) Information processing apparatus and information processing method
CN109919077A (en) Gesture recognition method, device, medium and calculating equipment
CN110704652A (en) Vehicle image fine-grained retrieval method and device based on multiple attention mechanism
CN109766752B (en) Target matching and positioning method and system based on deep learning and computer
CN106570549A (en) Coding pattern generation and identification methods and coding pattern generation and identification devices
Wang An improved machine learning and artificial intelligence algorithm for classroom management of English distance education
CN113780098A (en) Character recognition method, character recognition device, electronic equipment and storage medium
CN111444802B (en) Face recognition method and device and intelligent terminal
CN110163095B (en) Loop detection method, loop detection device and terminal equipment
CN114565916A (en) Target detection model training method, target detection method and electronic equipment
CN112990318A (en) Continuous learning method, device, terminal and storage medium
CN111598149A (en) Loop detection method based on attention mechanism
CN111460910A (en) Face type classification method and device, terminal equipment and storage medium
Ling et al. Research on gesture recognition based on YOLOv5
CN109255377A (en) Instrument recognition methods, device, electronic equipment and storage medium
CN107958236A (en) The generation method and terminal of recognition of face sample image
CN109461203B (en) Gesture three-dimensional image generation method and device, computer equipment and storage medium

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: 20190730

RJ01 Rejection of invention patent application after publication