Summary of the invention
In order to solve the low searching efficiency that can only use text description to come search pictures to cause in the prior art, the embodiment of the invention provides a kind of image searching method and system.Said technical scheme is following:
The embodiment of the invention has proposed a kind of image searching method, comprising:
The picture of pre-stored, the picture of request search are handled the fingerprint index data that obtain said picture;
The fingerprint index data of the picture of the fingerprint index data of the picture of described request search and pre-stored are mated,, then obtain the picture of said coupling if the picture of coupling is arranged.
Preferred as technique scheme handled the fingerprint index data that obtain said picture with the picture of pre-stored, the picture of request search, comprising:
Said picture is revised as preset resolution, and said picture is carried out sharpening handle to extract said picture prospect;
Extract the rgb value of said each pixel of picture prospect, respectively R, G, B three values are divided by preset value and get result's integer-bit;
The coordinate figure of rgb value after said each pixel processing and said pixel place picture is generated the litura information of this pixel;
Generate the fingerprint index data of picture of picture, the request search of pre-stored according to said litura information.
Preferred as technique scheme, the fingerprint index data of the picture of said picture, the request search that generates pre-stored according to said litura information comprise:
Litura information according to said each pixel generates finger print information;
Calculate the fingerprint index data of picture of picture, the request search of said pre-stored according to the finger print information of said each pixel.
Preferred as technique scheme generates finger print information according to the litura information of said each pixel, comprising:
Obtain the litura information of each pixel of said picture prospect, and generate set with finger print information as said picture according to the litura information of said each pixel.
Preferred as technique scheme calculated the fingerprint index data of picture of picture, the request search of said pre-stored according to the finger print information of said each pixel, comprising:
Convert said finger print information to the MD5 sign indicating number with fingerprint index data as said picture.
The embodiment of the invention has also proposed a kind of image searching system, comprising:
Acquisition module is used for the picture of pre-stored, the picture of request search are handled the fingerprint index data that obtain said picture;
Matching module is used for the fingerprint index data of the picture of the fingerprint index data of the picture of described request search and said pre-stored are mated, if the picture of coupling is arranged, then obtains said coupling picture.
Preferred as technique scheme, acquisition module comprises:
Revise the unit, be used for said picture is revised as preset resolution, and said picture is carried out sharpening handle to extract said picture prospect;
The Fuzzy Processing unit is used to extract the rgb value of said each pixel of picture prospect, respectively R, and G, B three values are divided by preset value and get result's integer-bit;
Generation unit is used for the litura information with this pixel of coordinate figure generation of rgb value after said each pixel processing and said pixel place picture;
The fingerprint index data generating unit is used for generating according to said litura information the fingerprint index data of picture of picture, the request search of pre-stored.
Preferred as technique scheme, the fingerprint index data generating unit comprises at least:
The finger print information subelement is used for generating finger print information according to the litura information of said each pixel;
Data generate subelement, are used for calculating according to the finger print information of said each pixel the fingerprint index data of picture of picture, the request search of said pre-stored.
Preferred as technique scheme, the finger print information subelement also is used to obtain the litura information of said each pixel of picture prospect; And generate set with finger print information as said picture according to the litura information of said each pixel.
Preferred as technique scheme, data generate subelement and also are used for converting said finger print information to the MD5 sign indicating number with the fingerprint index data as said picture.
The beneficial effect of the technical scheme that the embodiment of the invention provides is: in the invention present embodiment; Through the picture of pre-stored and the picture of request search are all carried out Fuzzy processing; So just make search engine can search identical picture or approximate picture, with the search that picture is mated fully.This mode is compared and is used the search of text description in the prior art, search engine is found meet the Search Results of searchers's intention, has improved the efficient of the search of search engine.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing that embodiment of the present invention is done to describe in detail further below.
The mentality of designing of the embodiment of the invention is: the picture of the request search that the picture of pre-stored in the search engine and searchers are submitted to is handled respectively to obtain the fingerprint index data of picture.And then will ask the fingerprint index data of picture of picture and the pre-stored of search to be searched for.So just can realize to the search of identical picture, approximate picture.
Embodiment 1
First embodiment of the invention has proposed a kind of image searching method, and its flow process is as shown in Figure 1, comprising:
Step 101, the picture of the picture of pre-stored, request search is handled the fingerprint index data that obtain said picture;
Step 102, the fingerprint index data of the picture of the fingerprint index data of the picture of described request search and pre-stored are mated,, then obtain the picture of said coupling if the picture of coupling is arranged.
In the invention present embodiment; Search engine is in order to satisfy searchers's specific demand, can't use the text description pictorial information or, the picture and the picture of request search of pre-stored handled too under the situation of magnanimity with the result of text description; The search that can mate picture fully like this; Replace traditional use text description and carried out the mode of picture searching, search engine has been found meet the Search Results that the searchers is intended to, improved the efficient of search engine searches picture.
Embodiment 2
Second embodiment of the invention is on the basis of first embodiment, to improve, and its flow process is as shown in Figure 2, comprising:
In the present embodiment, can handle the fingerprint index data of obtaining picture to the picture of pre-stored earlier, again the picture of request search handled the fingerprint index data of obtaining picture.Also can handle the picture of pre-stored, the picture of request search simultaneously, obtain the fingerprint index data of picture.Perhaps can handle the picture of request search earlier, again the picture of pre-stored handled the fingerprint index data of obtaining picture, and then carry out picture searching.
The embodiment of the invention is only described a kind of mode wherein, and other mode only is that the time slot of handling is different, and is then identical to the mode that picture is handled, so repeats no more in the present embodiment.
Step 201, the picture of the picture of pre-stored, request search is handled the fingerprint index data that obtain said picture;
Concrete implementation step is following:
Step 2011, from search engine, extract picture;
Concrete, at first the picture pre-stored extracts from search engine.Wherein, the picture of pre-stored is that search engine passes through a program of automatically extracting webpage all picture the web pages downloaded from the WWW.
Step 2012, the said picture that extracts is adjusted into unified resolution;
The photo resolution of pre-stored is not monolithic in the search engine, and for the ease of calculating the litura information of all pictures, processing at first need unitize to the resolution of picture.For example: the size that can be adjusted into the resolution of all pictures 640*480.Enlarge processing for all resolution less than the picture of 640*480, dwindle processing for all resolution greater than the picture of 640*480, all picture unified resolution are 640*480 at last.
Step 2013, the picture of adjustment resolution is carried out sharpening handle, and extract the picture prospect;
The essence that sharpening is handled is the contrast that increases the image detail edge, strengthens the edge of picture, and this helps our eyes to see image detail clearly, thereby distinctness, picture that the edge of target object is become are clear.The edge of picture prospect is outstanding after the sharpening, and its prospect is separated with background, and purpose is to remove unessential background information, so that carry out the calculating of picture prospect litura information.Wherein, the method that the picture perspective process was handled and extracted in sharpening is a prior art all, this is not made qualification in the embodiment of the invention.
Step 2014, the said picture prospect litura information of calculating;
Concrete; At first will extract the rgb value of said each pixel of picture prospect; Rgb value with said pixel carries out Fuzzy processing then, and rgb value and the said pixel after said each pixel processing belonged to the litura information of the coordinate figure of picture as this pixel.Concrete, can the position coordinates that add said pixel before the rgb value of each pixel after the said Fuzzy processing promptly be constituted the litura information of said pixel.
The purpose of further, picture being carried out Fuzzy processing is to cause the correct Search Results of omission in search procedure for the picture that prevents to be similar to has the nuance in color, the brightness.For example; Picture in order to reduce the capacity of picture, need carry out processed compressed to picture when carrying out format conversion; Lossy compression can make the original image quality of data descend; Though naked eyes almost can't be differentiated the decline of picture quality, after the processed compressed of being carried out was calculated through again coding the parameters such as brightness, colourity and saturation degree of each pixel of picture, the rgb value of each pixel that shows can change to some extent; Picture after the compression it seems that generally naked eyes can't differentiate; If but do not carry out Fuzzy processing, the compression before with the compression after picture behind the rgb value that accurately matees its each pixel, can judge that these two figure are different.Therefore picture is carried out can avoiding after the Fuzzy processing generation of this kind situation as far as possible, improved the efficient of search pictures.
Therefore step 2014 can be specific as follows:
The rgb value of each pixel of step 20141, the said picture prospect of extraction;
Concrete, the rgb color pattern is to be the intensity level in 0-255 scope of RGB component distribution of each pixel in the image.The RGB image only uses three kinds of colors, just can make them according to different mixed, on screen, reappears 16777216 kinds of colors.
Step 20142, the rgb value that extracts is carried out Fuzzy processing;
Concrete, the rgb value that extracts need carry out Fuzzy processing.Sometimes two kinds of colors are very approaching, and naked eyes can't be distinguished this two kinds of colors, but directly extract the rgb value of these two kinds of colors Computer Processing the time; Can find that these two values are inequality; In fact their similarity is very high, in order to let the very high color of similarity generate identical colouring information, and then generates identical picture fingerprint; Can correspond to close color same value, need handle rgb value so.Algorithm be respectively R, G, B three values divided by 8 round numbers, if the rgb value that obtains is identical, explain that so its primitive color is very close.The color that obtains like this is the color after the obfuscation, and it will generate identical colouring information.
For example: RGB={255,0, the color that 0} representes is red, RGB={253,0, the color that 0} representes also is red.Though rgb value is unequal, these two kinds of colors are very approximate, and naked eyes almost can't be differentiated their difference.In order to make it generate identical colouring information, need carry out the RGB Fuzzy processing, algorithm be to the R value divided by 8 round numbers, two rgb values that draw all are RGB={16,0,0}.Rgb value after the Fuzzy processing is identical, just can generate same colouring information.
The coordinate figure of step 20143, the rgb value after said each pixel handled and said pixel place picture is as the litura information of this pixel.
Concrete; Image all is made up of pixel; Each pixel all has a unique positional information in said picture; Said positional information shows with the form of coordinate; The for example above-mentioned picture that from search engine, extracts becomes 640*480 through the adjustment of resolution, and each pixel of so said picture just can be regarded each point in the coordinate system of being made up of 640 transverse axis coordinates and 480 ordinate of orthogonal axes as, so each pixel just all has a coordinate to confirm its position in said picture.These group data of rgb value after the positional information of said pixel and the said Fuzzy processing can constitute the litura information of said pixel.
The finger print information of step 2015, the said picture of generation;
Concrete, obtain all litura information of said picture prospect, and generate set with finger print information as said picture according to said all litura information.
The fingerprint index data of step 2016, the said picture of generation;
Concrete, convert said finger print information to the MD5 sign indicating number with fingerprint index data as said picture, can make picture like this when individual element point matees, the result of coupling is more accurate.And carry out regeneration finger print information after the Fuzzy processing, also can prevent because the color that picture exists, the problem that the nuance in the brightness causes omission.
Step 2017, the fingerprint index data of the picture of pre-stored are deposited in the index data base;
Concrete, with the fingerprint index data of the picture of pre-stored, and in the index data base of the chained address corresponding stored of said picture in the search engine.
The picture that step 2018, the request of obtaining are searched for;
Concrete, the searchers will ask the picture of search to send search engine to, so that search engine obtains the fingerprint index data of picture after with the picture processing and in index data base, searches for.
Step 2019, obtain the fingerprint index data of said picture according to the picture of described request search.
Concrete; The picture of the request search that user interface receives at first need carry out technical finesse with it, and its method is identical with step 2012-2016; That is: said picture is revised as preset resolution, and said picture is carried out sharpening handle to extract said picture prospect; Extract the rgb value of said each pixel of picture prospect; And the rgb value of each pixel of the said picture prospect that will extract carries out Fuzzy processing; The method of Fuzzy processing is: respectively R, and G, B three values are divided by preset value and get result's integer-bit; Rgb value after each pixel Fuzzy processing and said pixel are belonged to the litura information of the coordinate figure of picture as said pixel.
Step 202, the fingerprint index data of the picture of the fingerprint index data of the picture of described request search and pre-stored are mated,, then obtain the picture of said coupling if the picture of coupling is arranged.
The practical implementation step is following:
Step 2021, obtain the fingerprint index data of the picture of described request search;
Step 2022, obtain the fingerprint index data of the picture of the pre-stored in the said index data base;
Step 2023, the fingerprint index data of the picture of described request search are mated with the fingerprint index data of the picture of said pre-stored,, then obtain the link and the demonstration of said picture and correspondence thereof if the picture of coupling is arranged; If no, then step finishes.
Concrete; Search for the fingerprint index data of picture stored in fingerprint index data and the index data base of said picture; Return to user interface to the picture that is complementary and its chained address in order, then the Search Results of receiving is shown to the searchers with the form of webpage.
In the invention present embodiment; Search engine is in order to satisfy searchers's specific demand; Can't use the text description pictorial information or with the result of text description too under the situation of magnanimity; The picture of the request search that picture stored and searchers are submitted to is handled, and the contrast that can mate picture has fully like this replaced the mode that traditional use text description is carried out picture searching; Search engine is found meet the Search Results that the searchers is intended to, improved the efficient of search engine searches picture.
Embodiment 3
The embodiment of the invention has proposed a kind of image searching system, and its structure is as shown in Figure 3, comprising:
Acquisition module is used for the picture of pre-stored, the picture of request search are handled the fingerprint index data that obtain said picture;
Matching module is used for the fingerprint index data of the picture of the fingerprint index data of the picture of described request search and said pre-stored are mated, if the picture of coupling is arranged, then obtains said coupling picture.
In the invention present embodiment; Search engine is in order to satisfy searchers's specific demand, can't use the text description pictorial information or, the picture and the picture of request search of pre-stored handled too under the situation of magnanimity with the result of text description; The search that can mate picture fully like this; Replace traditional use text description and carried out the mode of picture searching, search engine has been found meet the Search Results that the searchers is intended to, improved the efficient of search engine searches picture.
Embodiment 4
Fourth embodiment of the invention is on the basis of the 3rd embodiment, to improve, and its structure is as shown in Figure 4, comprising:
Acquisition module is used for the picture of pre-stored, the picture of request search are handled the fingerprint index data that obtain said picture;
Wherein, acquisition module 1 can specifically comprise:
Revise unit 11, be used for said picture is revised as preset resolution, and said picture is carried out sharpening handle to extract said picture prospect;
Picture stored resolution is not monolithic in the search engine, and for the ease of calculating the litura information of all pictures, processing at first need unitize to the resolution of picture.For example: the size that can be adjusted into the resolution of all pictures 640*480.Enlarge processing for all resolution less than the picture of 640*480, dwindle processing for all resolution greater than the picture of 640*480, all picture unified resolution are 640*480 at last.
The essence that sharpening is handled is the contrast that increases the image detail edge, strengthens the edge of picture, and this helps our eyes to see image detail clearly, thereby distinctness, picture that the edge of target object is become are clear.The edge of picture prospect is outstanding after the sharpening, and its prospect is separated with background, and purpose is to remove unessential background information, so that carry out the calculating of picture prospect litura information.Wherein, the method that the picture perspective process was handled and extracted in sharpening is a prior art all, this is not made qualification in the embodiment of the invention.
Fuzzy Processing unit 12 is used to extract the rgb value of said each pixel of picture prospect, respectively R, and G, B three values are divided by preset value and get result's integer-bit;
Concrete, calculate said picture prospect litura information; That is: at first will extract the rgb value of each pixel of said picture prospect; Rgb value with said pixel carries out Fuzzy processing then; And with the rgb value of each pixel after the Fuzzy processing and the position coordinates of said pixel, as the litura information of said pixel.Concrete, can the position coordinates that add said pixel before the rgb value of each pixel after the said Fuzzy processing promptly be constituted the litura information of said pixel.
In an embodiment of the present invention, can calculate the litura information of picture in the following manner:
Extract the rgb value of each pixel of said picture prospect;
Concrete, the rgb color pattern is to be the intensity level in 0-255 scope of RGB component distribution of each pixel in the image.The RGB image only uses three kinds of colors, just can make them according to different mixed, on screen, reappears 16777216 kinds of colors.
The rgb value that extracts is carried out Fuzzy processing;
Concrete, the rgb value that extracts need carry out Fuzzy processing.Sometimes two kinds of colors are very approaching, and naked eyes can't be distinguished this two kinds of colors, but directly extract the rgb value of these two kinds of colors Computer Processing the time; Can find that these two values are inequality; In fact their similarity is very high, in order to let the very high color of similarity generate identical colouring information, and then generates identical picture fingerprint; Can correspond to close color same value, need handle rgb value so.Algorithm be respectively R, G, B three values divided by 8 round numbers, if the rgb value that obtains is identical, explain that so its primitive color is very close.The color that obtains like this is the color after the obfuscation, and it will generate identical colouring information.
For example: RGB={255,0, the color that 0} representes is red, RGB={253,0, the color that 0} representes also is red.Though rgb value is unequal, these two kinds of colors are very approximate, and naked eyes almost can't be differentiated their difference.In order to make it generate identical colouring information, need carry out the RGB Fuzzy processing, algorithm be to the R value divided by 8 round numbers, two rgb values that draw all are RGB={16,0,0}.Rgb value after the Fuzzy processing is identical, just can generate same colouring information.
Rgb value and said pixel after said each pixel processing are belonged to the litura information of the coordinate figure of picture as this pixel.
Concrete; Image all is made up of pixel; Each pixel all has a unique positional information in said picture; Said positional information shows with the form of coordinate; The for example above-mentioned picture that from search engine, extracts becomes 640*480 through the adjustment of resolution, and each pixel of so said picture just can be regarded each point in the coordinate system of being made up of 640 transverse axis coordinates and 480 ordinate of orthogonal axes as, so each pixel just all has a coordinate to confirm its position in said picture.These group data of rgb value after the positional information of said pixel and the said Fuzzy processing can constitute the litura information of said pixel.
Generation unit 13 is used for the litura information with this pixel of coordinate figure generation of rgb value after said each pixel processing and said pixel place picture;
Fingerprint index data generating unit 14 is used for generating according to said litura information the fingerprint index data of picture of picture, the request search of pre-stored.
Concrete, fingerprint index data generating unit 14 can be specially, and its structure is as shown in Figure 5:
Finger print information subelement 141 is used for generating finger print information according to the litura information of said each pixel;
Concrete, the finger print information subelement is used to obtain the litura information of said each pixel of picture prospect, and generates set with the finger print information as said picture according to the litura information of said each pixel.
Data generate subelement 142, are used for calculating according to the finger print information of said each pixel the fingerprint index data of picture of picture, the request search of said pre-stored.
Concrete, data generate subelement and are used for converting said finger print information to the MD5 sign indicating number with the fingerprint index data as said picture.
Matching module 2 is used for the fingerprint index data of the picture of the fingerprint index data of the picture of described request search and said pre-stored are mated, if the picture of coupling is arranged, then obtains said coupling picture.
Concrete; The fingerprint index data of the picture of the fingerprint index data of the picture of request search and said pre-stored are mated; Return to user interface to the picture that is complementary and its chained address in order, then the Search Results of receiving is shown to the searchers with the form of webpage.
The system of the embodiment of the invention third and fourth embodiment, identical with the design of the method for aforesaid first and second embodiment with principle, so in third and fourth embodiment to first and second embodiment in identical part repeat no more.
The all or part of of the technique scheme that the embodiment of the invention provides can be accomplished through the relevant hardware of programmed instruction; Said program can be stored in the storage medium that can read, and said storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.