CN109063068A - A kind of picture retrieval method and device - Google Patents

A kind of picture retrieval method and device Download PDF

Info

Publication number
CN109063068A
CN109063068A CN201810812032.XA CN201810812032A CN109063068A CN 109063068 A CN109063068 A CN 109063068A CN 201810812032 A CN201810812032 A CN 201810812032A CN 109063068 A CN109063068 A CN 109063068A
Authority
CN
China
Prior art keywords
retrieved
corner system
text
picture
target
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.)
Granted
Application number
CN201810812032.XA
Other languages
Chinese (zh)
Other versions
CN109063068B (en
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.)
Beijing Testin Information Technology Co Ltd
Original Assignee
Guangzhou Cloud Information Technology 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 Guangzhou Cloud Information Technology Co Ltd filed Critical Guangzhou Cloud Information Technology Co Ltd
Priority to CN201810812032.XA priority Critical patent/CN109063068B/en
Publication of CN109063068A publication Critical patent/CN109063068A/en
Application granted granted Critical
Publication of CN109063068B publication Critical patent/CN109063068B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This application involves field of terminal more particularly to a kind of picture retrieval method and devices, to alleviate the problem of searching for fall short picture as caused by the text in wrong identification picture in the prior art.This method comprises: treating retrieving image carries out Text region, character string to be retrieved corresponding with picture to be retrieved is determined according to the result of Text region;According to the text string generation to be retrieved four-corner system to be retrieved;Calculate the similarity of the four-corner system to be retrieved Yu the target four-corner system;In the case where similarity meets preset condition, picture to be retrieved is determined as Target Photo corresponding with the target four-corner system.This programme judges whether the character string of search matches with the text in picture based on four-corner system rule, when there are when font difference with picture Central Plains text for the text identified from picture, the application compares the character string of search and the character string identified based on the four-corner system, caused by capable of alleviating to a certain extent due to identifying mistake the case where search fall short picture.

Description

A kind of picture retrieval method and device
Technical field
This application involves field of terminal more particularly to a kind of picture retrieval method and devices.
Background technique
People scan in online search pictures often by text.It is existing for including the picture of text Often through optical character recognition technology (Optical Character Recognition, OCR) by the text in picture in technology Word is converted to textual form, and when the search key of user and the characters matching identified from picture, then the picture is visual The Target Photo searched for user.
But the font of text is varied in picture, segment word differs greatly by design beautification with former font, Picture lower for pixel, the lesser text of size is there are unintelligible, incomplete situation in figure, and OCR is for above-mentioned picture The recognition correct rate of middle text is lower, and user is thus caused to search for fall short picture.
Summary of the invention
The embodiment of the present application provides a kind of method and apparatus of picture retrieval, to alleviate in the prior art since mistake is known Caused by text in other picture the problem of search fall short picture.
The embodiment of the present application adopts the following technical solutions:
In a first aspect, providing a kind of picture retrieval method, comprising:
It treats retrieving image and carries out Text region, and is opposite with the picture to be retrieved according to the determination of the result of Text region The character string to be retrieved answered;
According to the text string generation four-corner system to be retrieved to be retrieved;
Calculate the similarity of the four-corner system to be retrieved and the target four-corner system;
In the case where the similarity meets preset condition, the picture to be retrieved is determined as and the target quadrangle The corresponding Target Photo of number.
Second aspect provides a kind of picture searching device, comprising:
Character string determining module treats retrieving image and carries out Text region, and according to the determination of the result of Text region and institute State the corresponding character string to be retrieved of picture to be retrieved;
Four-corner system generation module, according to the text string generation four-corner system to be retrieved to be retrieved;
Similarity determining module calculates the similarity of the four-corner system to be retrieved and the target four-corner system;
Target Photo determining module, it is in the case where the similarity meets preset condition, the picture to be retrieved is true It is set to Target Photo corresponding with the target four-corner system.
The third aspect provides a kind of terminal device, which includes processor, memory and be stored in described deposit On reservoir and the computer program that can run on the processor, the computer program are realized when being executed by the processor The step of method as described in relation to the first aspect.
Fourth aspect provides a kind of computer readable storage medium, which is characterized in that the computer-readable storage medium Computer program is stored in matter, and the step of method as described in relation to the first aspect is realized when the computer program is executed by processor Suddenly.
The embodiment of the present application use at least one above-mentioned technical solution can reach it is following the utility model has the advantages that
The application is based on four by the way that the character string identified in target string and picture is respectively converted into the four-corner system Angle number calculates the similarity of two character strings, and then determines whether picture to be retrieved is Target Photo according to similarity.This Shen The scheme that please be provided judges whether the character string of search matches with the text in picture based on Chinese four-corner system rule, when from figure There are when certain font difference, the application is based on the four-corner system and compares search the text and picture Central Plains text identified in piece Character string and the character string that is identified from picture, can alleviate to a certain extent since search caused by identification mistake is less than mesh Mark on a map piece the case where.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is a kind of one of flow diagram of picture retrieval method provided by the present application;
Fig. 2 is the two of a kind of flow diagram of picture retrieval method provided by the present application;
Fig. 3 is the three of a kind of flow diagram of picture retrieval method provided by the present application;
Fig. 4 is the four of a kind of flow diagram of picture retrieval method provided by the present application;
Fig. 5 is the five of a kind of flow diagram of picture retrieval method provided by the present application;
Fig. 6 is the six of a kind of flow diagram of picture retrieval method provided by the present application;
Fig. 7 is a kind of structural schematic diagram of picture searching device provided by the present application;
Fig. 8 is a kind of hardware structural diagram of mobile terminal provided by the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with the application specific embodiment and Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
Informationization is the main trend of current era development, and people can obtain required information from various channels.Network is The transmitting of information provides bridge, when user needs search pictures, is scanned for often by text using search engine. Demand of the user to picture is varied, then can be with for example, Target Photo needed for user is the picture for including required text Required text is inputted in a search engine, it is assumed that text needed for user is " a key application ", then search engine should be fed back to User's picture relevant to " a key application ".Specifically, the text for including in picture can be identified by OCR technique, When recognize in picture include " a key application " when, it is determined that the picture is Target Photo needed for user.
But in retrieving, there is part photo resolution lower, cause the text in picture unintelligible, utilizes OCR skill The text that art identifies is possible to not corresponding with the text in picture, for example, the text for including in figure is " a key application ", but by More in " key " stroke, font is more complicated, it is possible to be identified as " chain " by OCR technique.It is identified by OCR technique, the picture In include text be " a chain application ", since the text that the text identified is searched for user is not corresponding, the picture is not User can be fed back to as Target Photo.The picture should be identified as Target Photo, but since OCR technique identifies mistake, lead Family of applying can not obtain the picture.
It can be seen that the picture number arrived in the prior art by text search is few, there is leakage search, search fall short The case where picture.To solve the above-mentioned problems, the application provides a kind of picture retrieval method, below in conjunction with attached drawing, is described in detail The technical solution that each embodiment of the application provides.
Embodiment one
The application provides a kind of picture retrieval method, to alleviate in the prior art due to the text in wrong identification picture The problem of caused search fall short picture, referring to Fig. 1, this method includes:
Step 11: treat retrieving image and carry out Text region, and according to the result of Text region it is determining with it is described to be retrieved The corresponding character string to be retrieved of picture.
Specifically, treating retrieving image carries out Text region, using OCR technique or other Text regions can be used Technology.OCR technique determines the shape of text in picture by detecting dark, bright mode, then with character identifying method by shape Translate into computword.It can by identification software by the text conversion in image at text formatting for the character in picture So that word processor is further edited and processed.
Wherein, the method for character recognition is varied, during identification, can determine include in picture every first The position of a text carries out Text region to the region where each text one by one, then the text that will identify that according to from up to Under, sequence arrangement from left to right generates character string to be retrieved.The character string to be retrieved is corresponding with picture to be retrieved, to It is compared afterwards with target string needed for user.
In above-mentioned steps 11, according to the determining character to be retrieved corresponding with the picture to be retrieved of the result of Text region String, referring to fig. 2, can specifically include following steps:
Step 111: according to Text region as a result, determining text included in the character string to be retrieved.
Each text conversion in picture is text formatting by this step, is retrieved from literal pool according to the font in picture With the highest text of text matching degree in picture, the text retrieved is determined as the text in picture, thus by picture format Text conversion be text formatting text.
Preferably, in this step, according to the result of Text region determine the character string to be retrieved included in text, It specifically includes: by text all in the result of the Text region, being determined as the text in the character string to be retrieved included.
In scheme provided by the present application, for any picture, each text identified from picture is determined as to be checked The text for including in rope character string so that character string to be retrieved include picture in each text, character string to be retrieved with Entire picture is corresponding, with text information whole in picture.Therefore, character string to be retrieved can be embodied completely in the application Character features in picture represent complete picture, rather than only embody part picture.
Step 112: according to the typesetting characteristic information of the picture to be retrieved, determining text in the character string to be retrieved It puts in order.
Under normal conditions, direction arranges the text in picture horizontally or vertically, i.e., transversely arranged or longitudinal arrangement, in step In rapid 111 by each text conversion in picture be text formatting, then according to sequence from top to bottom, from left to right will convert Obtained character arranging is a character string.But the text in the picture of part includes artistic effect, it is possible to according to certain Direction arrangement, the direction for arranging text are likely to be straight line, and the orientation of every row text there may be certain angle, every row Text may also be according to curved arrangement.Scheme provided by the present application determines text according to the typesetting characteristic information of picture to be retrieved Orientation, and then the accuracy of identification is improved, the case where multline text intersects identification is avoided the occurrence of, the character identified is improved The accuracy of character order in string.
Since text composing structure is varied in picture, illustrate several text composition features below by way of example way The determination method of information:
In picture, text, which is likely to be, laterally or longitudinally to be arranged, for the arrangement mode of text, can be according to adjacent Text spacing is determined.Specifically, for the text identified any in figure, if be less than with the spacing of laterally adjacent text The spacing of longitudinally adjacent text can then determine that the text in the picture is transversely arranged.On the contrary, if any identification in figure The spacing of text and laterally adjacent text out is greater than the spacing of longitudinally adjacent text, then can determine that the text in the picture is Longitudinal arrangement.
In picture, text is likely to be according to curved arrangement, can will be determined as adjacent text apart from nearest text Word.Specifically, identifying first text positioned at the upper left corner first, then, the nearest text of first text of distance is made For second text, and so on, realize the identification to the text of curved arrangement.
For the text of longitudinal arrangement, especially poem, ancient Chinese prose, it may be possible to arrange from right to left.Therefore, it is identifying In the process, for the text of longitudinal arrangement, the position of the text near image edge can be first identified, if right side text in figure Character-spacing is less than distance of the left side text apart from picture left margin with a distance from picture right margin, then can determine in picture and longitudinally arrange The text of column is tactic according to from right to left.
Step 113: based on text included in the character string to be retrieved and it is described put in order, it is determining with it is described The corresponding character string to be retrieved of picture to be retrieved.
Under normal conditions, using the text in picture positioned at the upper left corner as first text in the first row text, with this Other texts of text colleague are sequentially arranged in the first row text, to obtain the first row text.When the text identified is right When side does not recognize text, i.e. the first row Text region finishes, at this time using text adjacent below first text as the The beginning of two row texts identifies the second row text according to the method for identification the first row text, according to the method will be in picture Every row text identify, every row text is then formed into character string to be retrieved according to sequence from top to bottom is end to end, I.e. using the first row text as the character string beginning, the end of the first row text connects the beginning of the second row text, will identify in picture Whole texts be arranged as a character string in the order described above, obtain character string to be retrieved.
The above method can determine the typesetting knot of text in picture according to the spacing of the position of text in picture, adjacent text Structure, and then determine the recognition sequence of text in figure, the accuracy of the text identified is further increased, guarantees the text identified It is consistent with text meaning in figure, avoid different row texts from intersecting the problem for identifying the readable difference of text caused by identification.
Step 12: according to the text string generation four-corner system to be retrieved to be retrieved.
Preferably, the character string to be retrieved in the application is not wrapped without the character string in space, and in character string continuously for a string Symbol is included, only includes Chinese text.
In this step, it is specifically included according to the text string generation four-corner system to be retrieved to be retrieved referring to Fig. 3:
Step 121: according to four-corner system rule, each character in the character string to be retrieved being converted to corresponding First numeric string.
Specifically, each text in character string is divided into " upper left ", " right side according to Chinese four-corner system transformation rule On ", " lower-left ", " bottom right " four regions, each region is converted into number according to four-corner system pithy formula, four-corner system pithy formula can To be summarised as " cross one hangs down two or three points of right-falling strokes, and fork four inserts five squares six, and heptangle eight or eight has horizontal change fraction ninth is that small under point ", according to upper Rule is stated, each region is respectively converted into a number, by be converted to four numbers according to above-mentioned " upper left ", " right side On ", to be sequentially arranged as one include four digital four-corner systems for " lower-left ", " bottom right ", then take again on " bottom right " The pen shape of side one makees " symbol " and makees 0 if this pen shape is used by the upper right corner.By symbol arrangement the four of above-mentioned acquisition The end of a number, obtaining one includes five digital four-corner systems, which is to be turned by the text identified It gets in return, the four-corner system corresponding with the text of identification.The conversion process of the four-corner system is more complicated, below by way of citing It elaborates.
After the text that one recognizes is divided into " upper left ", " upper right ", " lower-left ", " bottom right " four regions, to each When region carries out four-corner system conversion, there is following rule:
(1) one can be with the subangle number of taking.Example: " with " left side is one, is above taken as 2 (i.e. upper left is 2), under to be taken as 7 (i.e. left Down for 7).
(2) one two sections and other pen constitute two kinds of pen shapes, point two corners number of taking.Example: " water " left side is one, on Be taken as 1 (i.e. upper left is 1), under be taken as 9 (i.e. lower-left is 9).
(3) inferior horn pen shape tends to one jiao, according to actual position the number of taking, and unfilled corner is taken as 0.Example: " being jealous of " lower right corner lacks, and is taken as 0 (i.e. bottom right is 0).
(4) all peripheries are the three classes words of " mouth, door (door) ", and two inferior horns of left and right change to take the pen shape of the inside, do not take peripheral font. Example: field=6040.
(5) pen shapes, anterior angle is used, and relief angle is taken as 0.Example: " king " upper left corner is one horizontal, takes 1, the upper right corner because The upper left corner is used, so taking 0.
(6) " have and singly take both sides, is double to take again up and down ", it is angular to there are two singles or a single one to answer pen, no matter height, without exception Take most left or most right pen shape (upper left lower-left take most left, upper right bottom right takes most right).There are two multiple pens can use, is taken in Shang Jiao higher Multiple pen, lower multiple pen (upper left upper right take most upper, lower-left bottom right takes most lower) is taken under.
(7) slash of the first stroke of a Chinese character in, inferior horn have his pen, take his pen to make inferior horn, but the slash of the left side first stroke of a Chinese character, skimming pen is taken to make angle.
Single and multiple pen in above-mentioned rule specifically refer to: vertical two or the three points of right-falling strokes of cross one, category single;Another seven kinds it is angular often It is composed of single or pen shape itself has apparent turnover, belong to multiple pen.
In this application, can be by the four-corner system that each word identifies include " upper left ", " upper right ", " lower-left ", The 4-digit number of " bottom right ", be also possible to include " symbol " five digit number, to guarantee to identify consistency, in a picture, The numeric string digit that each Text region goes out is identical.I.e. in same picture, each text is converted into four quadrangles number Code is converted into five four-corner systems.
Step 122: according in the character string to be retrieved character first order sequence, by first numeric string according to The first order sequence is arranged in the four-corner system to be retrieved, and the first length of the four-corner system to be retrieved is each described The sum of the length of first numeric string.
The sequence of first order described in this step may refer to above-mentioned steps 112, by taking " a key application " as an example, the character It include four texts " one ", " key ", " Shen ", " asking " in string, four words are arranged successively in character string, four texts corresponding the One numeric string is followed successively by " 10000 ", " 85740 ", " 50006 ", " 35727 ", by this four first numeric strings according to the of character One, which puts in order, joins end to end, and obtains the four-corner system to be retrieved " 10000857405000635727 ", the four-corner system to be retrieved Totally 20, i.e. length is 20, and each first numeric string 5, i.e. length are 5, shares 4 the first numeric strings, therefore to be retrieved four The first length (20) of angle number are the sum of the length of the first numeric string (4 × 5).
Each character in character string can be converted to the four-corner system by technical solution provided by the present application, obtain to be retrieved four Angle number.It include the font style characteristic of each text in character string in the four-corner system to be retrieved, and the four-corner system puts in order Embody putting in order for text in character string.Therefore, a string of character strings can be converted to a string of numbers by scheme provided by the present application Word embodies putting in order for the font style characteristic of text in character string and text in character string by quadrangle coding.
Step 13: calculating the similarity of the four-corner system to be retrieved and the target four-corner system.
Before this step, technical solution provided by the present application further includes the steps that the determining target four-corner system, that is, is counting Before the similarity for calculating the four-corner system to be retrieved and the target four-corner system, referring to fig. 4, method further include:
Step 15: determining target string.
It is scanned for when user's search pictures often through text, the text of user's rustling sound is determined as target string. A string literal specifically is keyed in specified region by user, the text that user keys in is determined as target string.
Step 16: according to four-corner system rule, each character in the target string being converted to corresponding the Two numeric strings.
The method that each character in target string is converted to corresponding second numeric string be may refer into above-mentioned step Rapid 121, in this step, the length of second numeric string is identical as the length of first numeric string, and thus, it is possible to make to generate The four-corner system accurately reflect the length of character string, when target string is identical as string length to be retrieved, target quadrangle Number and four-corner system length to be retrieved are also identical.
Step 17: according to the second order sequence of character in the target string, by second numeric string according to institute It states second order sequence and is arranged in the target four-corner system, the second length of the target four-corner system is each second number The sum of length of word string.
The method for generating the target four-corner system may refer to above-mentioned steps 122, and scheme provided by the present application can be by user's key The character string entered is converted to the four-corner system, and the character order and text font of text are keyed in target four-corner system performance user Feature.Then to compare the target four-corner system and the four-corner system to be retrieved, and then realize the retrieval to Target Photo.
After determining the target four-corner system, in this step, the four-corner system to be retrieved and the target four-corner system are calculated Similarity specifically included referring to Fig. 5:
Step 131: according to the second length of the first length of the four-corner system to be retrieved and the target four-corner system, Establish similarity two-dimensional array.
It is illustrated below by citing, if target string is " application ", the word to be retrieved identified from picture Symbol string is " a key application ", is the four-corner system according to method migration provided by the present application, and the target four-corner system is " 5000635727 ", the four-corner system to be retrieved are " 10000847355000635727 ".According to the four-corner system to be retrieved it is found that The retrieval four-corner system totally 20, i.e. the first length are 20, according to target retrieval number it is found that target retrieval number totally 10, i.e., Second length is 10.The two-dimensional array that 20*10 is established according to the first length and the second length, as initial similarity two-dimemsional number Group, as shown in following table 1-1:
Table 1-1 initializes similarity two-dimensional array
0 1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
It should be noted that for ease of description, the lattice for having been filled into numerical value in above-mentioned initialization are the 0th row and the 0th column Lattice, upper table 1-1 determine array line number according to the first length, determine array columns according to the second length, indeed, it is possible to according to Two length determine array line number, determine array columns according to the first length.In subsequent calculating process, no matter how ranks set It is fixed, as long as obtained result is all identical, i.e. 20 row, 10 columns group according to the array that the first length and the second length determine The value being calculated is identical as the value that 10 row, 20 columns group is calculated.
Step 132: according to the four-corner system to be retrieved and the target four-corner system, determining the similarity two-dimemsional number The value of each element in group.
Scheme provided by the present application compares each number in the four-corner system to be retrieved and the target four-corner system one by one Right, the comparing result for integrating each determines the similarity of the four-corner system to be retrieved and the target four-corner system.In this step, according to The four-corner system to be retrieved and the target four-corner system determine the value of each element in the similarity two-dimensional array, such as Shown in Fig. 6, specifically include:
Step 1321: using either element in the similarity two-dimensional array as element undetermined, being based on the element undetermined The position at place, the first numerical digit in the determining four-corner system to be retrieved associated with the element undetermined and with it is described to Determine the second numerical digit in the associated target four-corner system of element.
In this step, using the element of the i-th column jth row in similarity two-dimensional array as element undetermined, determining and member undetermined The numerical digit of the four-corner system to be retrieved of element colleague, i.e., be determined as the first numerical digit for j-th of numerical digit of the four-corner system to be retrieved, determine with I-th of numerical digit of the target four-corner system is determined as the second numerical digit by the numerical digit of the target four-corner system of element same column undetermined.
Step 1322: the element undetermined is determined according to the comparing result of first numerical digit and second numerical digit Value.
By taking the application above table as an example, element undetermined is likely located in any one blank cell, preferably, from upper left to Lower right successively calculates the value of each element.In this example, the value of the element of the 1st row the 1st column is first calculated, then successively calculates the 1 row the 2nd column, the 1st row the 3rd column, and so on, after the value for calculating the 1st row the 1st column, it can also successively calculate the 2nd row first Column, the 3rd row the 1st column, and so on, until determining the value of each element in array.
In this step, the element undetermined is determined according to the comparing result of first numerical digit and second numerical digit Value, specifically includes:
When the element undetermined is there are when at least one adjacent known element, according to first numerical digit and described second The comparison result of numerical digit and at least one described adjacent known element determine the value of the element undetermined.
Scheme provided by the present application can be by the comparison value root of the target four-corner system and each numerical digit of the four-corner system to be retrieved Accumulation calculating is carried out according to weight.The value of each element is related to adjacent known element, so that the value of the element calculated afterwards includes The value of the element calculated before having as a result, so that the value of last calculated object element includes the target four-corner system With each numerical digit of the four-corner system to be retrieved compare as a result, so, technical solution provided by the present application can be such that object element embodies The global alignment result of the target four-corner system and the four-corner system to be retrieved out.
Step 1323: using the element adjacent with the element undetermined as new element undetermined, circulation executes above step, Until traversing the similarity two-dimensional array.
The target four-corner system is compared technical solution provided by the present application with each numerical digit of the four-corner system to be retrieved, Each element in calculated similarity two-dimensional array can embody each number in the target four-corner system and the four-corner system to be retrieved The similarity of position.Moreover, value of the element being calculated behind part with reference to the adjacent element calculated before, keeps similarity two-dimentional Last calculated object element can embody the target four-corner system and each numerical digit synthesis of the four-corner system to be retrieved in array Comparison result.
Below by technical solution provided by the present application is illustrated, in this example, target string is " application ", to be retrieved Character string is " a key application ", is the four-corner system according to method migration provided by the present application, and the target four-corner system is " 5000635727 ", the four-corner system to be retrieved are " 10000847355000635727 ".
First by pair of jth bit digital in i-th bit number in the target four-corner system and the four-corner system to be retrieved Ratio is determined as when position reduced value, wherein the value range of i is the integer less than or equal to target four-corner system length, and j's takes Being worth range is the integer less than or equal to four-corner system length to be retrieved.According to the position of element undetermined, similarity two dimension is determined The value of element undetermined in array, specifically, the value for the element that the i-th row jth arranges in the two-dimensional array is the minimum in following values Value: the value of (i-1) row (j-1) column element with when position reduced value and i-th row (j-1) column element value and 1 and The value of (i-1) row jth column element with 1 and.
When i is 1 and j is 1, i.e., element undetermined is the first row first row (as shown in overstriking lattice in following table), when position compares Value, that is, target four-corner system i-th bit (i.e. the 1st) " 5 " is compared with four-corner system jth to be retrieved position (i.e. the 1st) " 1 ", when When i-th bit number is identical as jth bit digital in second four-corner system in first four-corner system, determine described when position is right Ratio is 0, when jth bit digital difference in i-th bit number in first four-corner system and second four-corner system, is determined The position reduced value of working as is 1.Since " 5 " are different from " 1 ", so when position reduced value is 1.
The value of (i-1) row (j-1) column element with when position reduced value and the 0th column element of i.e. the 0th row value and 1 With, calculate known to numerical value be 1.
The value of i-th row (j-1) column element with 1 and the 0th column element of i.e. the 1st row value with 1 and, calculating know numerical value It is 2.
The value of (i-1) row jth column element with 1 and the 1st column element of i.e. the 0th row value with 1 and, calculating know numerical value It is 2.
According to the above-mentioned numerical value being calculated it is found that " 1 ", " 2 ", the minimum value in " 2 " they are 1, therefore, the 1st row the 1st column The value of element is 1, as shown in following table 1-2.
Table 1-2 similarity two-dimensional array
According to other elements undetermined in above-mentioned calculation method computation sheet, each element in obtained similarity two-dimensional array Value as shown in following table 1-3.
Table 1-3 similarity two-dimensional array
Step 133: according to the value of object element in the similarity two-dimensional array, determine the four-corner system to be retrieved and The similarity of the target four-corner system.
By taking above table provided by the present application as an example, the element of the 20th row the 10th column is object element, such as overstriking in table 1-3 Shown in lattice, the element i.e. finally determine an element value, the value of the object element represent the target four-corner system with it is to be retrieved The correlation of the four-corner system.Compare the length of the target four-corner system and the length of the four-corner system to be retrieved first, by biggish length The value of degree is determined as radix, and in this example, the length of the four-corner system to be retrieved is greater than the length of the target four-corner system, therefore, will The length of the four-corner system to be retrieved is determined as radix, i.e. radix is 20.Then, similarity is calculated by cardinal sum object element, Similarity is the difference of the radix and object element and the ratio of radix, and the value of object element is 10 in the application, according to upper It states method and calculates similarity (20-10)/20=0.5, therefore, target string " application " and character string to be retrieved " a key application " Similarity be 0.5.
Technical solution provided by the present application constructs two-dimensional array according to the target four-corner system and the four-corner system to be retrieved, will Each of the target four-corner system is compared with each of the four-corner system to be retrieved, and global alignment result obtains target element Element, and then calculate according to object element the similarity of the four-corner system to be retrieved and the target four-corner system.Method provided by the present application It can be applied to the identical four-corner system of two string length, also can be applied to the different four-corner system of two string length.
Step 14: in the case where the similarity meets preset condition, by the picture to be retrieved be determined as with it is described The corresponding Target Photo of the target four-corner system.
The preset condition of similarity can be set according to actual needs, can be judged by way of setting default similarity Whether picture to be retrieved is Target Photo corresponding with the target four-corner system.In this step, meet in the similarity default In the case where condition, the picture to be retrieved is determined as Target Photo corresponding with the target four-corner system, it is specific to wrap It includes:
When the similarity is greater than default similarity, the picture to be retrieved is determined as and the target four-corner system Corresponding Target Photo.
If it is desired to retrieve a fairly large number of Target Photo, then the lower default similarity of a numerical value can be set, The numerical value can be 0.3, and the similarity of " application " and " a key application " is 0.5 in this example, be higher than default similarity, therefore, this The picture in application including " a key application " is Target Photo corresponding with the target four-corner system.It is similar in the application The range of degree is more than or equal to 0 and less than or equal to 1, and the value range of default similarity is identical as the range of similarity.
In addition, the application also provides a kind of optional scheme, it, can also be right when the Target Photo quantity retrieved is more The sum of Target Photo is preset, such as above-mentioned preset condition can be with are as follows: with maximally related 10 picture of target string, root According to the preset condition, the Target Photo quantity retrieved is less than or equal to 10.Similar, item can will be preset in this programme Part is combined with default similarity, for example, preset condition can be set to, similarity is greater than 0.8 and maximally related 10 picture, It may be implemented from many aspects to screen the Target Photo retrieved.
Technical scheme can treat retrieving image by default similarity and be screened, and control according to actual needs The correlation of Target Photo and the target four-corner system obtains the higher Target Photo of correlation if necessary, then can be set compared with High default similarity can suitably turn down default similarity, thus centainly if the Target Photo quantity retrieved is very few Expand search range in degree.
The application is based on four by the way that the character string identified in target string and picture is respectively converted into the four-corner system Angle number calculates the similarity of two character strings, and then determines whether picture to be retrieved is Target Photo according to similarity.This Shen The scheme that please be provided judges whether the character string of search matches with the text in picture based on Chinese four-corner system rule, when from figure There are when certain font difference, the application is based on the four-corner system and compares search the text and picture Central Plains text identified in piece Character string and the character string that is identified from picture, can alleviate to a certain extent since search caused by identification mistake is less than mesh Mark on a map piece the case where.
Embodiment two
The scheme provided based on the above embodiment, the present embodiment provides a kind of picture retrieval method, target in the present embodiment Character string is " a key application ", and the text in picture to be retrieved is " a key application ", but since software for discerning characters identifies mistake, " key " is identified as " chain ", so that character string to be retrieved is " a chain application ", in this case, using side provided by the present application Method implementation process is as follows:
The corresponding target four-corner system of target string " a key application " is " 10000857405000635727 ", to be retrieved The corresponding four-corner system to be retrieved of character string " a chain application " is " 10000847355000635727 ", above-mentioned to be converted by character string For method method referring to described in embodiment one of the four-corner system, converted according to four-corner system rule, it is corresponding in this example In the four-corner system of a character be 5 four-corner systems for including " symbol ".
Firstly, being arranged according to 20 rows 20 that the length of the target four-corner system and the length of the four-corner system to be retrieved establish initialization Similarity two-dimensional array, as shown in following table 2-1.
Table 2-1 initializes similarity two-dimensional array
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Then the method according to embodiment one calculates the value of element undetermined in above-mentioned similarity two-dimensional array, obtains To complete similarity two-dimensional array, as shown in following table 2-2.
Table 2-2 similarity two-dimensional array
According to similarity two-dimensional array shown in table 2-2 it is found that object element is 3.According to the target four-corner system and to be checked The length of the rope four-corner system determines that radix is 20, calculates available " a key application " and " one according to the formula in embodiment one The similarity of chain application " is (20-3)/20=0.85.
According to calculated result it is found that the similarity of " a key application " and " a chain application " is relatively high, it is assumed that default phase It is 0.8 like degree, even if causing character string to be retrieved and text original in picture endless since software for discerning characters identifies mistake It is complete corresponding, since " key " and " chain " font similarity-rough set are high,, still can be with by technical solution provided by the present application Show that target string is corresponding with picture to be retrieved as a result, influence of the identification mistake to search result is smaller.
Under relatively, if retrieved according to retrieval mode in the prior art, due to " a key application " and " chain a Shen It does not correspond to please ", so picture to be retrieved will not feed back to user as Target Photo, it may appear that the case where missing inspection rope.And this Shen It please be in scheme, it is contemplated that software for discerning characters is possible to the Text region in original image be other texts familiar in shape, uses Scheme provided by the present application can treat the font of searching character string and be compared with the font of target string.Therefore, the application The scheme of offer can guarantee that user can still retrieve when certain font deviation occur in text and character string to be retrieved in original image To picture to be retrieved, avoid the problem that retrieving fall short picture as caused by Text region mistake.
The application also provides an example, to solve above-mentioned problems of the prior art.In this example, due to text Identification software identifies mistake, and picture Central Plains to be retrieved text is " a key application ", the character string to be retrieved obtained after identification For " a chain application ", retrieved in this case using method provided by the present application.Target string is " nest in this example Coffee ", character string to be retrieved is " a chain application ", according to method provided by the above embodiment, the corresponding target of target string The four-corner system is " 90215229046600061011 ", and the corresponding four-corner system to be retrieved of character string to be retrieved is “10000847355000635727”。
Initial similarity two-dimensional array is established according to the length of the four-corner system to be retrieved and the target four-corner system first, it is as follows Shown in table 2-3.
Table 2-3 initializes similarity two-dimensional array
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
To the target four-corner system, each is compared the method according to examples detailed above with the four-corner system to be retrieved, obtains To complete similarity two-dimensional array, as shown in following table 2-4.
Table 2-4 similarity two-dimensional array
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
3 3 2 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 17 18
4 3 3 3 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18
5 4 4 4 4 4 5 6 7 8 8 9 10 11 12 13 14 15 16 17 18
6 5 5 5 5 5 5 6 7 8 9 9 10 11 12 13 14 15 16 16 17
7 6 6 6 6 6 6 6 7 8 9 10 10 11 12 13 14 15 16 16 17
8 7 7 7 7 7 7 7 7 8 9 10 11 11 12 13 14 15 16 17 17
9 8 7 7 7 7 8 8 8 8 9 10 10 11 11 12 13 14 15 16 17
10 9 8 8 8 8 8 8 9 9 9 10 11 11 12 12 13 14 15 16 17
11 10 9 9 9 9 9 9 9 10 10 10 11 12 12 12 13 14 15 16 17
12 11 10 10 10 10 10 10 10 10 11 11 11 12 13 12 13 14 15 16 17
13 12 11 10 10 10 11 11 11 11 11 12 11 11 12 13 13 14 15 16 17
14 13 12 11 10 10 11 12 12 12 12 12 12 11 11 12 13 14 15 16 17
15 14 13 12 11 10 11 12 13 13 13 13 12 12 11 12 13 14 15 16 17
16 15 14 13 12 11 11 12 13 14 14 14 13 13 12 11 12 13 14 15 16
17 16 15 14 13 12 12 12 13 14 15 15 14 14 13 12 12 13 14 15 16
18 17 16 15 14 13 13 13 13 14 15 16 15 14 14 13 13 13 14 15 16
19 18 17 16 15 14 14 14 14 14 15 16 16 15 15 14 14 14 14 15 16
20 19 18 17 16 15 15 15 15 15 15 16 17 16 16 15 15 15 15 15 16
According to above-mentioned similarity two-dimensional array it is found that the value of object element is 16, according to method provided by the above embodiment It is (20-16)/20=0.1999 that similarity, which is calculated,.
According to calculated result it is found that utilizing technology provided by the present application in the case where software for discerning characters identifies mistake Scheme, " Nescafe " are very low with the similarity of " a chain application ".So even if character string to be retrieved and original text in picture There are difference for word font, are also less prone to the case where picture of " a chain application " is fed back to user.Under normal conditions, phase is preset Value range like the value of degree can be 0.4~0.8, show that target string is similar to character string to be retrieved lower than 0.4 Degree is very low, and the larger probability of picture to be retrieved is not the Target Photo of user search.
According to examples detailed above provided by the present application it is found that when there is identification mistake in software for discerning characters, by picture to be retrieved In text be mistakenly identified as other texts familiar in shape, when " key " is identified as " chain ", using scheme provided by the present application according to So picture to be retrieved can be determined as Target Photo and feed back to user.Moreover, even if there is above-mentioned identification mistake, with target character The excessive picture to be retrieved of string difference is also not readily ascertained as Target Photo, it is possible thereby to make the picture for feeding back to user and use The target string that family is keyed in has higher similarity, improves retrieval accuracy.
Embodiment three
The scheme provided based on the above embodiment, the embodiment of the present application also provide a kind of picture searching device, such as Fig. 7 institute Show, comprising:
Character string determining module 71, treat retrieving image carry out Text region, and according to the result of Text region determine with The corresponding character string to be retrieved of the picture to be retrieved;
Four-corner system generation module 72, according to the text string generation four-corner system to be retrieved to be retrieved;
Similarity determining module 73 calculates the similarity of the four-corner system to be retrieved and the target four-corner system;
Target Photo determining module 74, in the case where the similarity meets preset condition, by the picture to be retrieved It is determined as Target Photo corresponding with the target four-corner system.
The application is based on four by the way that the character string identified in target string and picture is respectively converted into the four-corner system Angle number calculates the similarity of two character strings, and then determines whether picture to be retrieved is Target Photo according to similarity.This Shen The scheme that please be provided judges whether the character string of search matches with the text in picture based on Chinese four-corner system rule, when from figure There are when certain font difference, the application is based on the four-corner system and compares search the text and picture Central Plains text identified in piece Character string and the character string that is identified from picture, can alleviate to a certain extent since search caused by identification mistake is less than mesh Mark on a map piece the case where.
Example IV
A kind of hardware structural diagram of Fig. 8 mobile terminal of each embodiment to realize the present invention, the mobile terminal 800 Including but not limited to: radio frequency unit 801, audio output unit 803, input unit 804, sensor 805, is shown network module 802 Show the components such as unit 806, user input unit 807, interface unit 808, memory 809, processor 810 and power supply 811. It will be understood by those skilled in the art that mobile terminal structure shown in Fig. 8 does not constitute the restriction to mobile terminal, it is mobile whole End may include perhaps combining certain components or different component layouts than illustrating more or fewer components.In the present invention In embodiment, mobile terminal includes but is not limited to mobile phone, tablet computer, laptop, palm PC, car-mounted terminal, can wear Wear equipment and pedometer etc..
Wherein, processor 810 carry out Text region for treating retrieving image, and are determined according to the result of Text region Character string to be retrieved corresponding with the picture to be retrieved;According to the text string generation four-corner system to be retrieved to be retrieved; Calculate the similarity of the four-corner system to be retrieved and the target four-corner system;The case where the similarity meets preset condition Under, the picture to be retrieved is determined as Target Photo corresponding with the target four-corner system.
In embodiments of the present invention, by the way that the character string identified in search string and picture is respectively converted into quadrangle Number, the similarity of two character strings is calculated based on the four-corner system, and then determines whether picture to be retrieved is mesh according to similarity It marks on a map piece.Whether scheme provided by the present application judges the text in the character string and picture of search based on Chinese four-corner system rule Matching, when the text and picture Central Plains text identified from picture is there are when certain font difference, the application is based on quadrangle Number compares the character string of search and the character string identified from picture, can alleviate to a certain extent since identification mistake causes Search fall short picture the case where.
It should be understood that the embodiment of the present invention in, radio frequency unit 801 can be used for receiving and sending messages or communication process in, signal Send and receive, specifically, by from base station downlink data receive after, to processor 810 handle;In addition, by uplink Data are sent to base station.In general, radio frequency unit 801 includes but is not limited to antenna, at least one amplifier, transceiver, coupling Device, low-noise amplifier, duplexer etc..In addition, radio frequency unit 801 can also by wireless communication system and network and other set Standby communication.
Mobile terminal provides wireless broadband internet by network module 802 for user and accesses, and such as user is helped to receive It sends e-mails, browse webpage and access streaming video etc..
Audio output unit 803 can be received by radio frequency unit 801 or network module 802 or in memory 809 The audio data of storage is converted into audio signal and exports to be sound.Moreover, audio output unit 803 can also be provided and be moved The relevant audio output of specific function that dynamic terminal 800 executes is (for example, call signal receives sound, message sink sound etc. Deng).Audio output unit 803 includes loudspeaker, buzzer and receiver etc..
Input unit 804 is for receiving audio or video signal.Input unit 804 may include graphics processor (Graphics Processing Unit, GPU) 8041 and microphone 8042, graphics processor 8041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 806.Through graphics processor 8041, treated that picture frame can be deposited Storage is sent in memory 809 (or other storage mediums) or via radio frequency unit 801 or network module 802.Mike Wind 8042 can receive sound, and can be audio data by such acoustic processing.Treated audio data can be The format output that mobile communication base station can be sent to via radio frequency unit 801 is converted in the case where telephone calling model.
Mobile terminal 800 further includes at least one sensor 805, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 8061, and proximity sensor can close when mobile terminal 800 is moved in one's ear Display panel 8061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify mobile terminal posture (ratio Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);It passes Sensor 805 can also include fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, wet Meter, thermometer, infrared sensor etc. are spent, details are not described herein.
Display unit 806 is for showing information input by user or being supplied to the information of user.Display unit 806 can wrap Display panel 8061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 8061.
User input unit 807 can be used for receiving the number or character information of input, and generate the use with mobile terminal Family setting and the related key signals input of function control.Specifically, user input unit 807 include touch panel 8071 and Other input equipments 8072.Touch panel 8071, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 8071 or in touch panel 8071 Neighbouring operation).Touch panel 8071 may include both touch detecting apparatus and touch controller.Wherein, touch detection Device detects the touch orientation of user, and detects touch operation bring signal, transmits a signal to touch controller;Touch control Device processed receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 810, receiving area It manages the order that device 810 is sent and is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc. Seed type realizes touch panel 8071.In addition to touch panel 8071, user input unit 807 can also include other input equipments 8072.Specifically, other input equipments 8072 can include but is not limited to physical keyboard, function key (such as volume control button, Switch key etc.), trace ball, mouse, operating stick, details are not described herein.
Further, touch panel 8071 can be covered on display panel 8061, when touch panel 8071 is detected at it On or near touch operation after, send processor 810 to determine the type of touch event, be followed by subsequent processing device 810 according to touching The type for touching event provides corresponding visual output on display panel 8061.Although in fig. 8, touch panel 8071 and display Panel 8061 is the function that outputs and inputs of realizing mobile terminal as two independent components, but in some embodiments In, can be integrated by touch panel 8071 and display panel 8061 and realize the function that outputs and inputs of mobile terminal, it is specific this Place is without limitation.
Interface unit 808 is the interface that external device (ED) is connect with mobile terminal 800.For example, external device (ED) may include having Line or wireless head-band earphone port, external power supply (or battery charger) port, wired or wireless data port, storage card end Mouth, port, the port audio input/output (I/O), video i/o port, earphone end for connecting the device with identification module Mouthful etc..Interface unit 808 can be used for receiving the input (for example, data information, electric power etc.) from external device (ED) and By one or more elements that the input received is transferred in mobile terminal 800 or can be used in 800 He of mobile terminal Data are transmitted between external device (ED).
Memory 809 can be used for storing software program and various data.Memory 809 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 809 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 810 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection A part by running or execute the software program and/or module that are stored in memory 809, and calls and is stored in storage Data in device 809 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place Managing device 810 may include one or more processing units;Preferably, processor 810 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 810.
Mobile terminal 800 can also include the power supply 811 (such as battery) powered to all parts, it is preferred that power supply 811 Can be logically contiguous by power-supply management system and processor 810, to realize management charging by power-supply management system, put The functions such as electricity and power managed.
In addition, mobile terminal 800 includes some unshowned functional modules, details are not described herein.
Preferably, the embodiment of the present invention also provides a kind of mobile terminal, including processor 810, and memory 809 is stored in On memory 809 and the computer program that can run on the processor 810, the computer program are executed by processor 810 A kind of above-mentioned each process of picture retrieval method embodiment of Shi Shixian, and identical technical effect can be reached, to avoid repeating, Which is not described herein again.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium Calculation machine program, the computer program realize a kind of each process of above-mentioned picture retrieval method embodiment when being executed by processor, And identical technical effect can be reached, to avoid repeating, which is not described herein again.Wherein, the computer readable storage medium, Such as read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, letter Claim RAM), magnetic or disk etc..
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal Replacement, improvement etc., should be included within the scope of the claims of this application.

Claims (10)

1. a kind of picture retrieval method characterized by comprising
It treats retrieving image and carries out Text region, and is corresponding with the picture to be retrieved according to the determination of the result of Text region Character string to be retrieved;
According to the text string generation four-corner system to be retrieved to be retrieved;
Calculate the similarity of the four-corner system to be retrieved and the target four-corner system;
In the case where the similarity meets preset condition, the picture to be retrieved is determined as and the target four-corner system Corresponding Target Photo.
2. the method as described in claim 1, which is characterized in that according to the determination of the result of Text region and the picture to be retrieved Corresponding character string to be retrieved, comprising:
According to Text region as a result, determining text included in the character string to be retrieved;
According to the typesetting characteristic information of the picture to be retrieved, putting in order for text in the character string to be retrieved is determined;
Based on text included in the character string to be retrieved and it is described put in order, the determining and picture phase to be retrieved Corresponding character string to be retrieved.
3. method according to claim 2, which is characterized in that determine the character string to be retrieved according to the result of Text region Included in text, comprising:
By text all in the result of the Text region, it is determined as the text in the character string to be retrieved included.
4. method according to claim 2, which is characterized in that according to the text string generation quadrangle number to be retrieved to be retrieved Code, specifically includes:
According to four-corner system rule, each character in the character string to be retrieved is converted into corresponding first numeric string;
According to the first order sequence of character in the character string to be retrieved, by first numeric string according to the first order Sequence is arranged in the four-corner system to be retrieved, and the first length of the four-corner system to be retrieved is each first numeric string The sum of length.
5. method as claimed in claim 4, which is characterized in that calculating the four-corner system to be retrieved and the target four-corner system Similarity before, further includes:
Determine target string;
According to four-corner system rule, each character in the target string is converted into corresponding second numeric string;
It is according to the second order sequence of character in the target string, second numeric string is suitable according to the second order Sequence is arranged in the target four-corner system, the second length of the target four-corner system be each second numeric string length it With.
6. method as claimed in claim 5, which is characterized in that calculate the four-corner system to be retrieved and the target four-corner system Similarity specifically includes:
According to the second length of the first length of the four-corner system to be retrieved and the target four-corner system, similarity two is established Dimension group;
According to the four-corner system to be retrieved and the target four-corner system, each element in the similarity two-dimensional array is determined Value;
According to the value of object element in the similarity two-dimensional array, the four-corner system to be retrieved and the target quadrangle are determined The similarity of number.
7. method as claimed in claim 6, which is characterized in that according to the four-corner system to be retrieved and the target quadrangle number Code, determines the value of each element in the similarity two-dimensional array, specifically includes:
Using either element in the similarity two-dimensional array as element undetermined, based on the position where the element undetermined, really Fixed the first numerical digit with the associated four-corner system to be retrieved of element undetermined and associated with the element undetermined The target four-corner system in the second numerical digit;
The value of the element undetermined is determined according to the comparing result of first numerical digit and second numerical digit;
Using the element adjacent with the element undetermined as new element undetermined, circulation executes above step, until described in traversal Similarity two-dimensional array.
8. the method for claim 7, which is characterized in that according to the comparison knot of first numerical digit and second numerical digit Fruit determines the value of the element undetermined, specifically includes:
When the element undetermined is there are when at least one adjacent known element, according to first numerical digit and second numerical digit Comparison result and at least one described adjacent known element determine the value of the element undetermined.
9. the method as described in claim 1, which is characterized in that in the case where the similarity meets preset condition, by institute It states picture to be retrieved and is determined as Target Photo corresponding with the target four-corner system, specifically include:
When the similarity is greater than default similarity, the picture to be retrieved is determined as opposite with the target four-corner system The Target Photo answered.
10. a kind of picture searching device characterized by comprising
Character string determining module treats retrieving image and carries out Text region, and according to the result of Text region it is determining with it is described to The corresponding character string to be retrieved of retrieving image;
Four-corner system generation module, according to the text string generation four-corner system to be retrieved to be retrieved;
Similarity determining module calculates the similarity of the four-corner system to be retrieved and the target four-corner system;
The picture to be retrieved is determined as by Target Photo determining module in the case where the similarity meets preset condition Target Photo corresponding with the target four-corner system.
CN201810812032.XA 2018-07-23 2018-07-23 Picture retrieval method and device Active CN109063068B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810812032.XA CN109063068B (en) 2018-07-23 2018-07-23 Picture retrieval method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810812032.XA CN109063068B (en) 2018-07-23 2018-07-23 Picture retrieval method and device

Publications (2)

Publication Number Publication Date
CN109063068A true CN109063068A (en) 2018-12-21
CN109063068B CN109063068B (en) 2020-07-03

Family

ID=64836043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810812032.XA Active CN109063068B (en) 2018-07-23 2018-07-23 Picture retrieval method and device

Country Status (1)

Country Link
CN (1) CN109063068B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879849A (en) * 2019-11-09 2020-03-13 广东智媒云图科技股份有限公司 Similarity comparison method and device based on image-to-character conversion
CN112347283A (en) * 2020-11-13 2021-02-09 广州酷狗计算机科技有限公司 Picture matching method, device, equipment and storage medium
CN112766269A (en) * 2021-03-04 2021-05-07 深圳康佳电子科技有限公司 Picture text retrieval method, intelligent terminal and storage medium
CN113326685A (en) * 2021-08-04 2021-08-31 北京星天科技有限公司 Typesetting method and device driven by database

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976253A (en) * 2010-10-27 2011-02-16 重庆邮电大学 Chinese variation text matching recognition method
CN103399907A (en) * 2013-07-31 2013-11-20 深圳市华傲数据技术有限公司 Method and device for calculating similarity of Chinese character strings on the basis of edit distance
US9367763B1 (en) * 2015-01-12 2016-06-14 Xerox Corporation Privacy-preserving text to image matching
CN108228757A (en) * 2017-12-21 2018-06-29 北京市商汤科技开发有限公司 Image search method and device, electronic equipment, storage medium, program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976253A (en) * 2010-10-27 2011-02-16 重庆邮电大学 Chinese variation text matching recognition method
CN103399907A (en) * 2013-07-31 2013-11-20 深圳市华傲数据技术有限公司 Method and device for calculating similarity of Chinese character strings on the basis of edit distance
US9367763B1 (en) * 2015-01-12 2016-06-14 Xerox Corporation Privacy-preserving text to image matching
CN108228757A (en) * 2017-12-21 2018-06-29 北京市商汤科技开发有限公司 Image search method and device, electronic equipment, storage medium, program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879849A (en) * 2019-11-09 2020-03-13 广东智媒云图科技股份有限公司 Similarity comparison method and device based on image-to-character conversion
CN110879849B (en) * 2019-11-09 2022-09-20 广东智媒云图科技股份有限公司 Similarity comparison method and device based on image-to-character conversion
CN112347283A (en) * 2020-11-13 2021-02-09 广州酷狗计算机科技有限公司 Picture matching method, device, equipment and storage medium
CN112766269A (en) * 2021-03-04 2021-05-07 深圳康佳电子科技有限公司 Picture text retrieval method, intelligent terminal and storage medium
CN112766269B (en) * 2021-03-04 2024-03-12 深圳康佳电子科技有限公司 Picture text retrieval method, intelligent terminal and storage medium
CN113326685A (en) * 2021-08-04 2021-08-31 北京星天科技有限公司 Typesetting method and device driven by database

Also Published As

Publication number Publication date
CN109063068B (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN109063068A (en) A kind of picture retrieval method and device
TWI733127B (en) Information detection method, device and equipment
CN110059685B (en) Character area detection method, device and storage medium
US8619049B2 (en) Monitoring interactions between two or more objects within an environment
CN109684980B (en) Automatic scoring method and device
CN103814351A (en) Collaborative gesture-based input language
JP2008250950A (en) Image processor, control program, computer-readable recording medium, electronic equipment and control method of image processor
CN113378556A (en) Method and device for extracting text keywords
WO2022142551A1 (en) Form processing method and apparatus, and medium and computer device
CN107734260A (en) A kind of image processing method and mobile terminal
CN111209377B (en) Text processing method, device, equipment and medium based on deep learning
CN105303149A (en) Figure image display method and apparatus
CN111598149B (en) Loop detection method based on attention mechanism
CN111159338A (en) Malicious text detection method and device, electronic equipment and storage medium
CN111507094A (en) Text processing model training method, device and equipment based on deep learning
CN107885566A (en) Display control method, mobile terminal and computer-readable recording medium
JP5015097B2 (en) Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method
CN109992753A (en) A kind of translation processing method and terminal device
CN109257504A (en) A kind of audio-frequency processing method and terminal device
CN104881647A (en) Information processing method, information processing system and information processing apparatus
CN116994272A (en) Identification method and device for target picture
CN110490953A (en) Text based image generating method, terminal device and medium
CN109639880A (en) A kind of display method of weather information and terminal device
CN107734171A (en) A kind of display methods, mobile terminal and the readable storage medium storing program for executing at short message interface
CN106469437B (en) Image processing method and image processing apparatus

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210716

Address after: 100016 no.4301, No.52 Jiuxianqiao hospital, Chaoyang District, Beijing

Patentee after: BEIJING TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 2016, building 2, No.8, Fenghuang Third Road, Zhongxin Guangzhou Knowledge City, Guangzhou 510260, Guangdong Province

Patentee before: GUANGZHOU TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right