Summary of the invention
The present invention is intended to solve one of technical matters in correlation technique at least to a certain extent.
For this reason, one object of the present invention is the recognition methods proposing a kind of similar pictures, and the method can improve the recognition accuracy of similar pictures.
Another object of the present invention is the recognition device proposing a kind of similar pictures.
Another object of the present invention is to propose a kind of electronic equipment.
For achieving the above object, the recognition methods of the similar pictures that first aspect present invention embodiment proposes, comprising: the content information and the colouring information that obtain picture to be compared; According to described content information generating content fingerprint, generate color fingerprint according to described colouring information; According to described user supplied video content using fingerprints and described color fingerprint, generate mixed-fingerprint; According to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures.
Optionally, described content information is the gray-scale value of picture, described according to described content information generating content fingerprint, comprising: the every pictures in picture corresponding to be compared, according to the gray-scale value calculating mean value of each pixel in every pictures; Each pixel in corresponding every pictures, when the gray-scale value of described pixel is more than or equal to described mean value, described pixel characteristic of correspondence value is defined as 1, when the gray-scale value of described pixel is less than described mean value, described pixel characteristic of correspondence value is defined as 0; Corresponding every pictures, forms the eigenwert of described picture by each pixel characteristic of correspondence value step-by-step in described picture; By the eigenwert of bit comparison picture to be compared, obtain not identical number; By the ratio of the total number of pixel of not identical number and every pictures, be defined as user supplied video content using fingerprints.
Optionally, described colouring information is the rgb value of picture, described according to described colouring information generation color fingerprint, comprising: the every pictures in picture corresponding to be compared, carries out dimensionality reduction mapping, obtain new rgb value to the rgb value of each pixel in every pictures; Corresponding every pictures, according to the new rgb value of each pixel, adds up the number of pixels be mapped in the dimension at each new rgb value place, and using the number of pixels in each dimension as an element, the vector of the corresponding every pictures of composition; Vectorial cosine between vector corresponding for picture to be compared is defined as color fingerprint.
Optionally, described new rgb value be the rgb value before dimensionality reduction is mapped backward divided by preset value under round after the numerical value that obtains, wherein, described preset value be greater than 1 numerical value.
Optionally, described preset value is 64.
Optionally, described according to described user supplied video content using fingerprints and described color fingerprint, the computing formula generating mixed-fingerprint is: mixed-fingerprint=k1* user supplied video content using fingerprints+k2* color fingerprint; Wherein, k1 and k2 default is more than or equal to 0, is less than or equal to the value of 1, and k1+k2=1.
Optionally, described according to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures, comprising: when described mixed-fingerprint is less than or equal to default threshold value, judge that described picture is similar pictures.
Optionally, described default threshold value be less than or equal to 1 value.
Optionally, described method also comprises: the storage space obtaining the electronic equipment at described similar pictures place uses information; And, according to described use information prompting user, cleaning operation is carried out to described similar pictures.
Optionally, described method also comprises: the size of all similar pictures in calculating electronic equipment, obtains similar pictures total amount information; When getting the file clean-up request of user for described electronic equipment, in docuterm for clearance, show described total amount information.
The recognition methods of the similar pictures that first aspect present invention embodiment proposes, by obtaining content information and colouring information, and generate mixed-fingerprint according to content information and colouring information, similar pictures is determined whether according to mixed-fingerprint, content and color can be considered when similar pictures identification, relative to the mode of single consideration color histogram, the recognition accuracy of similar pictures can be improved.
For achieving the above object, the recognition device of the similar pictures that second aspect present invention embodiment proposes, comprising: acquisition module, for obtaining content information and the colouring information of picture to be compared; First generation module, for according to described content information generating content fingerprint, generates color fingerprint according to described colouring information; Second generation module, for according to described user supplied video content using fingerprints and described color fingerprint, generates mixed-fingerprint; Judge module, for according to described mixed-fingerprint and the threshold value preset, judges whether described picture is similar pictures.
Optionally, described content information is the gray-scale value of picture, described first generation module comprises: for the first module according to described content information generating content fingerprint, described first module specifically for every pictures in corresponding picture to be compared, according to the gray-scale value calculating mean value of each pixel in every pictures; Each pixel in corresponding every pictures, when the gray-scale value of described pixel is more than or equal to described mean value, described pixel characteristic of correspondence value is defined as 1, when the gray-scale value of described pixel is less than described mean value, described pixel characteristic of correspondence value is defined as 0; Corresponding every pictures, forms the eigenwert of described picture by each pixel characteristic of correspondence value step-by-step in described picture; By the eigenwert of bit comparison picture to be compared, obtain not identical number; By the ratio of the total number of pixel of not identical number and every pictures, be defined as user supplied video content using fingerprints.
Optionally, described colouring information is the rgb value of picture, described first generation module comprises the second unit for generating color fingerprint according to described colouring information, described second unit is specifically for every pictures in corresponding picture to be compared, dimensionality reduction mapping is carried out to the rgb value of each pixel in every pictures, obtains new rgb value; Corresponding every pictures, according to the new rgb value of each pixel, adds up the number of pixels be mapped in the dimension at each new rgb value place, and using the number of pixels in each dimension as an element, the vector of the corresponding every pictures of composition; Vectorial cosine between vector corresponding for picture to be compared is defined as color fingerprint.
Optionally, described new rgb value be the rgb value before dimensionality reduction is mapped backward divided by preset value under round after the numerical value that obtains, wherein, described preset value be greater than 1 numerical value.
Optionally, described preset value is 64.
Optionally, described second generation module generates mixed-fingerprint specifically for adopting following formula: mixed-fingerprint=k1* user supplied video content using fingerprints+k2* color fingerprint; Wherein, k1 and k2 default is more than or equal to 0, is less than or equal to the value of 1, and k1+k2=1.
Optionally, described judge module specifically for: when described mixed-fingerprint is less than or equal to default threshold value, judge that described picture is similar pictures.
Optionally, described default threshold value be less than or equal to 1 value.
Optionally, also comprise: cleaning module, use information for the storage space obtaining the electronic equipment at described similar pictures place; And, according to described use information prompting user, cleaning operation is carried out to described similar pictures.
Optionally, also comprise: display module, for the size of similar pictures all in calculating electronic equipment, obtain similar pictures total amount information; When getting the file clean-up request of user for described electronic equipment, in docuterm for clearance, show described total amount information.
The recognition device of the similar pictures that second aspect present invention embodiment proposes, by obtaining content information and colouring information, and generate mixed-fingerprint according to content information and colouring information, similar pictures is determined whether according to mixed-fingerprint, content and color can be considered when similar pictures identification, relative to the mode of single consideration color histogram, the recognition accuracy of similar pictures can be improved.
For achieving the above object, the electronic equipment that third aspect present invention embodiment proposes, comprising: housing, processor, storer, circuit board and power circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and storer are arranged on circuit boards; Power circuit, for powering for each circuit of electronic equipment or device; Storer is used for stores executable programs code; Processor runs the program corresponding with executable program code by reading the executable program code stored in storer, for execution following steps: the content information and the colouring information that obtain picture to be compared; According to described content information generating content fingerprint, generate color fingerprint according to described colouring information; According to described user supplied video content using fingerprints and described color fingerprint, generate mixed-fingerprint; According to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures.
Optionally, described content information is the gray-scale value of picture, described according to described content information generating content fingerprint, comprising: the every pictures in picture corresponding to be compared, according to the gray-scale value calculating mean value of each pixel in every pictures; Each pixel in corresponding every pictures, when the gray-scale value of described pixel is more than or equal to described mean value, described pixel characteristic of correspondence value is defined as 1, when the gray-scale value of described pixel is less than described mean value, described pixel characteristic of correspondence value is defined as 0; Corresponding every pictures, forms the eigenwert of described picture by each pixel characteristic of correspondence value step-by-step in described picture; By the eigenwert of bit comparison picture to be compared, obtain not identical number; By the ratio of the total number of pixel of not identical number and every pictures, be defined as user supplied video content using fingerprints.
Optionally, described colouring information is the rgb value of picture, described according to described colouring information generation color fingerprint, comprising: the every pictures in picture corresponding to be compared, carries out dimensionality reduction mapping, obtain new rgb value to the rgb value of each pixel in every pictures; Corresponding every pictures, according to the new rgb value of each pixel, adds up the number of pixels be mapped in the dimension at each new rgb value place, and using the number of pixels in each dimension as an element, the vector of the corresponding every pictures of composition; Vectorial cosine between vector corresponding for picture to be compared is defined as color fingerprint.
Optionally, described new rgb value be the rgb value before dimensionality reduction is mapped backward divided by preset value under round after the numerical value that obtains, wherein, described preset value be greater than 1 numerical value.
Optionally, described preset value is 64.
Optionally, described according to described user supplied video content using fingerprints and described color fingerprint, the computing formula generating mixed-fingerprint is: mixed-fingerprint=k1* user supplied video content using fingerprints+k2* color fingerprint; Wherein, k1 and k2 default is more than or equal to 0, is less than or equal to the value of 1, and k1+k2=1.
Optionally, described according to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures, comprising: when described mixed-fingerprint is less than or equal to default threshold value, judge that described picture is similar pictures.
Optionally, described default threshold value be less than or equal to 1 value.
Optionally, described method also comprises: the storage space obtaining the electronic equipment at described similar pictures place uses information; And, according to described use information prompting user, cleaning operation is carried out to described similar pictures.
Optionally, described method also comprises: the size of all similar pictures in calculating electronic equipment, obtains similar pictures total amount information; When getting the file clean-up request of user for described electronic equipment, in docuterm for clearance, show described total amount information.
The electronic equipment that third aspect present invention embodiment proposes, by obtaining content information and colouring information, and generate mixed-fingerprint according to content information and colouring information, similar pictures is determined whether according to mixed-fingerprint, content and color can be considered when similar pictures identification, relative to the mode of single consideration color histogram, the recognition accuracy of similar pictures can be improved.
The aspect that the present invention adds and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by practice of the present invention.
Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar module or has module that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.On the contrary, embodiments of the invention comprise fall into attached claims spirit and intension within the scope of all changes, amendment and equivalent.
Fig. 1 is the schematic flow sheet of the recognition methods of the similar pictures that one embodiment of the invention proposes, and the method comprises:
S11: the content information and the colouring information that obtain picture to be compared.
For the comparison of two pictures, suppose that two pictures to be compared are called the first picture and second picture, then can obtain content information and the colouring information of the first picture respectively, and obtain content information and the colouring information of second picture.
In some embodiments, content information is such as gray-scale value, and colouring information is such as rgb value.
For the first picture, suppose the first picture to be pixel be the thumbnail of n*n, then this thumbnail can be converted to the gray-scale value of n*n, thus obtain content information.In addition, the rgb value of the thumbnail of all right extracting directly n*n, thus obtain colouring information.
S12: according to described content information generating content fingerprint, generates color fingerprint according to described colouring information.
In some embodiments, see Fig. 2, described content information is the gray-scale value of picture, described according to described content information generating content fingerprint, comprising:
S21: the every pictures in picture corresponding to be compared, according to the gray-scale value calculating mean value of each pixel in every pictures.
For the first picture, because the first picture comprises n*n pixel, and S11 can obtain the gray-scale value of each pixel, therefore, by calculating the mean value that can obtain the gray-scale value of n*n pixel.
S22: each pixel in corresponding every pictures, when the gray-scale value of described pixel is more than or equal to described mean value, described pixel characteristic of correspondence value is defined as 1, when the gray-scale value of described pixel is less than described mean value, described pixel characteristic of correspondence value is defined as 0.
Such as, the first picture comprises n*n pixel, then by this computing, the eigenwert that each pixel obtains is 1 or 0, thus can obtain n*n eigenwert, and each eigenwert is 1 or 0.
S23: corresponding every pictures, forms the eigenwert of described picture by each pixel characteristic of correspondence value step-by-step in described picture.
Such as, can the step-by-step arrangement of line by line or by column pixel, the eigenwert that n*n pixel characteristic of correspondence value forms picture can be obtained.
Such as, suppose the n=6 of the first picture, then the eigenwert of the first picture can be:
000001100011000110011100111001100111
S24: by the eigenwert of bit comparison picture to be compared, obtain not identical number.
Such as, as implied above, can obtain the eigenwert of the first picture, this eigenwert is made up of 36 binary numbers.Similar, the eigenwert of second picture also can be expressed as and be made up of 36 binary numbers.
Therefore, compare for two pictures, by these two groups of binary numbers of bit comparison, can obtain not identical number, such as, the 1st of the eigenwert of the first picture is 0, if the 1st of the eigenwert of second picture the is 1, then show not identical, if the 1st of the eigenwert of second picture the is 0, then show identical.
S25: by the ratio of the total number of pixel of not identical number and every pictures, be defined as user supplied video content using fingerprints.
Suppose that not identical number represents with m, then user supplied video content using fingerprints contentFinger=m/ (n*n).
In some embodiments, see Fig. 3, described colouring information is the rgb value of picture, described according to described colouring information generation color fingerprint, comprising:
S31: the every pictures in picture corresponding to be compared, carries out dimensionality reduction mapping to the rgb value of each pixel in every pictures, obtains new rgb value.
Wherein, described new rgb value be the rgb value before dimensionality reduction is mapped backward divided by preset value under round after the numerical value that obtains, wherein, described preset value be greater than 1 numerical value.
Optionally, described preset value is 64.
Such as, obtain the thumbnail of n*n, each pixel in this picture is made up of RGB, and the numerical value of R, G, B is all 0 ~ 255, therefore, can generate the vector of 256*256*256 length, and computational complexity can be very high, is difficult to use in engineering project.
Can dimension-reduction treatment in order to reduce operand, such as, be mapped as 0 ~ 3 by 0 ~ 255, the dimension of rgb value new so has just dropped to 4*4*4, and relative to 256*256*256, computation complexity reduces a lot.
Concrete, be 64 for preset value, dimensionality reduction mapping equation can be expressed as:
Wherein, newRed, newGreen, newBlue are the value in new rgb value in R, G, B dimension respectively, and red, green, blue are the value in the initial rgb value before mapping in R, G, B dimension respectively,represent downward rounding operation.
Suppose that initial rgb value is respectively: red=62, green=85, blue=69, then through dimensionality reduction map after, new rgb value respectively:
newRed=0,newGreen=1,newBlue=1。
S32: corresponding every pictures, according to the new rgb value of each pixel, adds up the number of pixels be mapped in the dimension at each new rgb value place, and using the number of pixels in each dimension as an element, the vector of the corresponding every pictures of composition.
Using the dimension at each new rgb value place as an element, can the vector of a total 4*4*4=64 element composed as follows:
[000,001,002,003,010,011,012,013,…,330,331,332,333]
In every pictures, then according to the new rgb value of each pixel, the number of pixels in each dimension in above-mentioned vector can be added up.Such as, new rgb value=011 of a pixel in above-mentioned example, then, when adding up, the number of the pixel in 011 this dimension can add 1.
In every pictures, through statistics, can obtain new rgb value is respectively 000,001,002 ... the number of pixel, suppose to use m1 respectively, m2 ... mn represents, then these values can form the vector of one 64 dimension, such as corresponding first picture, and this vector representation is:
n1=[m1,m2,m3,…mn]。
Similar, the vector that second picture is corresponding can represent with n2, and n2 is also the vector of one 64 dimension.
S33: the vectorial cosine between vector corresponding for picture to be compared is defined as color fingerprint.
Such as, for two vectors that two pictures are corresponding, color fingerprint is formulated as:
colorFinger=(n1*n2')/(|n1|*|n2|)
Wherein, colorFinger represents color fingerprint, and n2' represents the transposition of n2, || represent modulo operation, * represents multiplication operation.
S13: according to described user supplied video content using fingerprints and described color fingerprint, generates mixed-fingerprint.
Such as, following computing formula can be adopted, generate mixed-fingerprint:
mixtureFinger=k1*contentFinger+k2*colorFinger
Wherein, mixtureFinger represents mixed-fingerprint, and contentFinger represents user supplied video content using fingerprints, and colorFinger represents color fingerprint, k1 and k2 default is more than or equal to 0, is less than or equal to the value of 1, and k1+k2=1.
S14: according to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures.
In some embodiments, see Fig. 4, described according to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures, comprising:
S41: when described mixed-fingerprint is less than or equal to default threshold value, judges that described picture is similar pictures.
Such as, compare for two pictures, during mixtureFinger>k3, show that two pictures are dissimilar pictures, during mixtureFinger<=k3, show that two pictures are similar pictures.
Wherein, k3 is predetermined threshold value, can be k3<=1.
In some embodiments, the method can also comprise:
The storage space obtaining the electronic equipment at described similar pictures place uses information; And
According to described use information prompting user, cleaning operation is carried out to described similar pictures.
Such as, when this use information is greater than preset value, to the message of user's display for pointing out cleaning, thus when similar pictures takies larger space, can point out the similar pictures of user's Delete superfluous.
In some embodiments, the method can also comprise:
The size of all similar pictures in calculating electronic equipment, obtains similar pictures total amount information;
When getting the file clean-up request of user for described electronic equipment, in docuterm for clearance, show described total amount information.
Such as, the total amount information that can obtain similar pictures in mobile phone is how many M etc., and in text item for clearance, show this total amount information, thus user can be facilitated to know the total quantity of similar pictures, clears up as required or does not clear up unnecessary similar pictures.
In the present embodiment, by obtaining content information and colouring information, and generate mixed-fingerprint according to content information and colouring information, similar pictures is determined whether according to mixed-fingerprint, content and color can be considered when similar pictures identification, relative to the mode of single consideration color histogram, the recognition accuracy of similar pictures can be improved.
Fig. 5 is the structural representation of the recognition device of the similar pictures that another embodiment of the present invention proposes, and be applied to electronic equipment, this device 50 comprises:
Acquisition module 51, for obtaining content information and the colouring information of picture to be compared;
For the comparison of two pictures, suppose that two pictures to be compared are called the first picture and second picture, then can obtain content information and the colouring information of the first picture respectively, and obtain content information and the colouring information of second picture.
In some embodiments, content information is such as gray-scale value, and colouring information is such as rgb value.
For the first picture, suppose the first picture to be pixel be the thumbnail of n*n, then this thumbnail can be converted to the gray-scale value of n*n, thus obtain content information.In addition, the rgb value of the thumbnail of all right extracting directly n*n, thus obtain colouring information.
First generation module 52, for according to described content information generating content fingerprint, generates color fingerprint according to described colouring information;
In some embodiments, see Fig. 6, described content information is the gray-scale value of picture, and described first generation module 52 comprises: for the first module 521 according to described content information generating content fingerprint, described first module 521 specifically for:
Every pictures in picture corresponding to be compared, according to the gray-scale value calculating mean value of each pixel in every pictures;
For the first picture, because the first picture comprises n*n pixel, and S11 can obtain the gray-scale value of each pixel, therefore, by calculating the mean value that can obtain the gray-scale value of n*n pixel.
Each pixel in corresponding every pictures, when the gray-scale value of described pixel is more than or equal to described mean value, described pixel characteristic of correspondence value is defined as 1, when the gray-scale value of described pixel is less than described mean value, described pixel characteristic of correspondence value is defined as 0;
Such as, the first picture comprises n*n pixel, then by this computing, the eigenwert that each pixel obtains is 1 or 0, thus can obtain n*n eigenwert, and each eigenwert is 1 or 0.
Corresponding every pictures, forms the eigenwert of described picture by each pixel characteristic of correspondence value step-by-step in described picture;
Such as, can the step-by-step arrangement of line by line or by column pixel, the eigenwert that n*n pixel characteristic of correspondence value forms picture can be obtained.
Such as, suppose the n=6 of the first picture, then the eigenwert of the first picture can be:
000001100011000110011100111001100111
By the eigenwert of bit comparison picture to be compared, obtain not identical number;
Such as, as implied above, can obtain the eigenwert of the first picture, this eigenwert is made up of 36 binary numbers.Similar, the eigenwert of second picture also can be expressed as and be made up of 36 binary numbers.
Therefore, compare for two pictures, by these two groups of binary numbers of bit comparison, can obtain not identical number, such as, the 1st of the eigenwert of the first picture is 0, if the 1st of the eigenwert of second picture the is 1, then show not identical, if the 1st of the eigenwert of second picture the is 0, then show identical.
By the ratio of the total number of pixel of not identical number and every pictures, be defined as user supplied video content using fingerprints;
Suppose that not identical number represents with m, then user supplied video content using fingerprints contentFinger=m/ (n*n).
In some embodiments, see Fig. 6, described colouring information is the rgb value of picture, and described first generation module 52 comprises the second unit 522 for generating color fingerprint according to described colouring information, described second unit 522 specifically for:
Every pictures in picture corresponding to be compared, carries out dimensionality reduction mapping to the rgb value of each pixel in every pictures, obtains new rgb value;
Wherein, described new rgb value be the rgb value before dimensionality reduction is mapped backward divided by preset value under round after the numerical value that obtains, wherein, described preset value be greater than 1 numerical value.
Optionally, described preset value is 64.
Such as, obtain the thumbnail of n*n, each pixel in this picture is made up of RGB, and the numerical value of R, G, B is all 0 ~ 255, therefore, can generate the vector of 256*256*256 length, and computational complexity can be very high, is difficult to use in engineering project.
Can dimension-reduction treatment in order to reduce operand, such as, be mapped as 0 ~ 3 by 0 ~ 255, the dimension of rgb value new so has just dropped to 4*4*4, and relative to 256*256*256, computation complexity reduces a lot.
Concrete, be 64 for preset value, dimensionality reduction mapping equation can be expressed as:
Wherein, newRed, newGreen, newBlue are the value in new rgb value in R, G, B dimension respectively, and red, green, blue are the value in the initial rgb value before mapping in R, G, B dimension respectively,represent downward rounding operation.
Suppose that initial rgb value is respectively: red=62, green=85, blue=69, then through dimensionality reduction map after, new rgb value respectively:
newRed=0,newGreen=1,newBlue=1。
Corresponding every pictures, according to the new rgb value of each pixel, adds up the number of pixels be mapped in the dimension at each new rgb value place, and using the number of pixels in each dimension as an element, the vector of the corresponding every pictures of composition;
Using the dimension at each new rgb value place as an element, can the vector of a total 4*4*4=64 element composed as follows:
[000,001,002,003,010,011,012,013,…,330,331,332,333]
In every pictures, then according to the new rgb value of each pixel, the number of pixels in each dimension in above-mentioned vector can be added up.Such as, new rgb value=011 of a pixel in above-mentioned example, then, when adding up, the number of the pixel in 011 this dimension can add 1.
In every pictures, through statistics, can obtain new rgb value is respectively 000,001,002 ... the number of pixel, suppose to use m1 respectively, m2 ... mn represents, then these values can form the vector of one 64 dimension, such as corresponding first picture, and this vector representation is:
n1=[m1,m2,m3,…mn]。
Similar, the vector that second picture is corresponding can represent with n2, and n2 is also the vector of one 64 dimension.
Vectorial cosine between vector corresponding for picture to be compared is defined as color fingerprint;
Such as, for two vectors that two pictures are corresponding, color fingerprint is formulated as:
colorFinger=(n1*n2')/(|n1|*|n2|)
Wherein, colorFinger represents color fingerprint, and n2' represents the transposition of n2, || represent modulo operation, * represents multiplication operation.
Second generation module 53, for according to described user supplied video content using fingerprints and described color fingerprint, generates mixed-fingerprint;
Such as, described second generation module 53 generates mixed-fingerprint specifically for adopting following formula:
Mixed-fingerprint=k1* user supplied video content using fingerprints+k2* color fingerprint;
Wherein, k1 and k2 default is more than or equal to 0, is less than or equal to the value of 1, and k1+k2=1.
Judge module 54, for according to described mixed-fingerprint and the threshold value preset, judges whether described picture is similar pictures.
Such as, described judge module 54 specifically for:
When described mixed-fingerprint is less than or equal to default threshold value, judge that described picture is similar pictures.
Such as, compare for two pictures, during mixtureFinger>k3, show that two pictures are dissimilar pictures, during mixtureFinger<=k3, show that two pictures are similar pictures.
Wherein, k3 is predetermined threshold value, can be k3<=1.
In some embodiments, see Fig. 6, also comprise:
Cleaning module 54, uses information for the storage space obtaining the electronic equipment at described similar pictures place; And, according to described use information prompting user, cleaning operation is carried out to described similar pictures.
Such as, when this use information is greater than preset value, to the message of user's display for pointing out cleaning, thus when similar pictures takies larger space, can point out the similar pictures of user's Delete superfluous.
In some embodiments, see Fig. 6, also comprise:
Display module 55, for the size of similar pictures all in calculating electronic equipment, obtains similar pictures total amount information; When getting the file clean-up request of user for described electronic equipment, in docuterm for clearance, show described total amount information.
Such as, the total amount information that can obtain similar pictures in mobile phone is how many M etc., and in text item for clearance, show this total amount information, thus user can be facilitated to know the total quantity of similar pictures, clears up as required or does not clear up unnecessary similar pictures.
In the present embodiment, by obtaining content information and colouring information, and generate mixed-fingerprint according to content information and colouring information, similar pictures is determined whether according to mixed-fingerprint, content and color can be considered when similar pictures identification, relative to the mode of single consideration color histogram, the recognition accuracy of similar pictures can be improved.
The embodiment of the present invention also proposed a kind of electronic equipment, and this electronic equipment is such as mobile device, as mobile phone etc., can also be PC (PersonalComputer, PC) etc.See Fig. 7, this electronic equipment 70 comprises: housing 71, processor 72, storer 73, circuit board 74 and power circuit 75, and wherein, circuit board 74 is placed in the interior volume that housing 71 surrounds, and processor 72 and storer 73 arrange on circuit boards; Power circuit 74, for powering for each circuit of electronic equipment or device; Storer 73 is for stores executable programs code; Processor 72 runs the program corresponding with executable program code by reading the executable program code stored in storer 73, for execution following steps:
S11 ': the content information and the colouring information that obtain picture to be compared.
For the comparison of two pictures, suppose that two pictures to be compared are called the first picture and second picture, then can obtain content information and the colouring information of the first picture respectively, and obtain content information and the colouring information of second picture.
In some embodiments, content information is such as gray-scale value, and colouring information is such as rgb value.
For the first picture, suppose the first picture to be pixel be the thumbnail of n*n, then this thumbnail can be converted to the gray-scale value of n*n, thus obtain content information.In addition, the rgb value of the thumbnail of all right extracting directly n*n, thus obtain colouring information.
S12 ': according to described content information generating content fingerprint, generates color fingerprint according to described colouring information.
In some embodiments, described content information is the gray-scale value of picture, described according to described content information generating content fingerprint, comprising:
S21 ': the every pictures in picture corresponding to be compared, according to the gray-scale value calculating mean value of each pixel in every pictures.
For the first picture, because the first picture comprises n*n pixel, and S11 can obtain the gray-scale value of each pixel, therefore, by calculating the mean value that can obtain the gray-scale value of n*n pixel.
S22 ': each pixel in corresponding every pictures, when the gray-scale value of described pixel is more than or equal to described mean value, described pixel characteristic of correspondence value is defined as 1, when the gray-scale value of described pixel is less than described mean value, described pixel characteristic of correspondence value is defined as 0.
Such as, the first picture comprises n*n pixel, then by this computing, the eigenwert that each pixel obtains is 1 or 0, thus can obtain n*n eigenwert, and each eigenwert is 1 or 0.
S23 ': corresponding every pictures, forms the eigenwert of described picture by each pixel characteristic of correspondence value step-by-step in described picture.
Such as, can the step-by-step arrangement of line by line or by column pixel, the eigenwert that n*n pixel characteristic of correspondence value forms picture can be obtained.
Such as, suppose the n=6 of the first picture, then the eigenwert of the first picture can be:
000001100011000110011100111001100111
S24 ': by the eigenwert of bit comparison picture to be compared, obtain not identical number.
Such as, as implied above, can obtain the eigenwert of the first picture, this eigenwert is made up of 36 binary numbers.Similar, the eigenwert of second picture also can be expressed as and be made up of 36 binary numbers.
Therefore, compare for two pictures, by these two groups of binary numbers of bit comparison, can obtain not identical number, such as, the 1st of the eigenwert of the first picture is 0, if the 1st of the eigenwert of second picture the is 1, then show not identical, if the 1st of the eigenwert of second picture the is 0, then show identical.
S25 ': by the ratio of the total number of pixel of not identical number and every pictures, be defined as user supplied video content using fingerprints.
Suppose that not identical number represents with m, then user supplied video content using fingerprints contentFinger=m/ (n*n).
In some embodiments, described colouring information is the rgb value of picture, described according to described colouring information generation color fingerprint, comprising:
S31 ': the every pictures in picture corresponding to be compared, carries out dimensionality reduction mapping to the rgb value of each pixel in every pictures, obtains new rgb value.
Wherein, described new rgb value be the rgb value before dimensionality reduction is mapped backward divided by preset value under round after the numerical value that obtains, wherein, described preset value be greater than 1 numerical value.
Optionally, described preset value is 64.
Such as, obtain the thumbnail of n*n, each pixel in this picture is made up of RGB, and the numerical value of R, G, B is all 0 ~ 255, therefore, can generate the vector of 256*256*256 length, and computational complexity can be very high, is difficult to use in engineering project.
Can dimension-reduction treatment in order to reduce operand, such as, be mapped as 0 ~ 3 by 0 ~ 255, the dimension of rgb value new so has just dropped to 4*4*4, and relative to 256*256*256, computation complexity reduces a lot.
Concrete, be 64 for preset value, dimensionality reduction mapping equation can be expressed as:
Wherein, newRed, newGreen, newBlue are the value in new rgb value in R, G, B dimension respectively, and red, green, blue are the value in the initial rgb value before mapping in R, G, B dimension respectively,represent downward rounding operation.
Suppose that initial rgb value is respectively: red=62, green=85, blue=69, then through dimensionality reduction map after, new rgb value respectively:
newRed=0,newGreen=1,newBlue=1。
S32 ': corresponding every pictures, according to the new rgb value of each pixel, adds up the number of pixels be mapped in the dimension at each new rgb value place, and using the number of pixels in each dimension as an element, the vector of the corresponding every pictures of composition.
Using the dimension at each new rgb value place as an element, can the vector of a total 4*4*4=64 element composed as follows:
[000,001,002,003,010,011,012,013,…,330,331,332,333]
In every pictures, then according to the new rgb value of each pixel, the number of pixels in each dimension in above-mentioned vector can be added up.Such as, new rgb value=011 of a pixel in above-mentioned example, then, when adding up, the number of the pixel in 011 this dimension can add 1.
In every pictures, through statistics, can obtain new rgb value is respectively 000,001,002 ... the number of pixel, suppose to use m1 respectively, m2 ... mn represents, then these values can form the vector of one 64 dimension, such as corresponding first picture, and this vector representation is:
n1=[m1,m2,m3,…mn]。
Similar, the vector that second picture is corresponding can represent with n2, and n2 is also the vector of one 64 dimension.
S33 ': the vectorial cosine between vector corresponding for picture to be compared is defined as color fingerprint.
Such as, for two vectors that two pictures are corresponding, color fingerprint is formulated as:
colorFinger=(n1*n2')/(|n1|*|n2|)
Wherein, colorFinger represents color fingerprint, and n2' represents the transposition of n2, || represent modulo operation, * represents multiplication operation.
S13 ': according to described user supplied video content using fingerprints and described color fingerprint, generates mixed-fingerprint.
Such as, following computing formula can be adopted, generate mixed-fingerprint:
mixtureFinger=k1*contentFinger+k2*colorFinger
Wherein, mixtureFinger represents mixed-fingerprint, and contentFinger represents user supplied video content using fingerprints, and colorFinger represents color fingerprint, k1 and k2 default is more than or equal to 0, is less than or equal to the value of 1, and k1+k2=1.
S14 ': according to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures.
In some embodiments, described according to described mixed-fingerprint and the threshold value preset, judge whether described picture is similar pictures, comprising:
S41 ': when described mixed-fingerprint is less than or equal to default threshold value, judges that described picture is similar pictures.
Such as, compare for two pictures, during mixtureFinger>k3, show that two pictures are dissimilar pictures, during mixtureFinger<=k3, show that two pictures are similar pictures.
Wherein, k3 is predetermined threshold value, can be k3<=1.
In some embodiments, the method can also comprise:
The storage space obtaining the electronic equipment at described similar pictures place uses information; And
According to described use information prompting user, cleaning operation is carried out to described similar pictures.
Such as, when this use information is greater than preset value, to the message of user's display for pointing out cleaning, thus when similar pictures takies larger space, can point out the similar pictures of user's Delete superfluous.
In some embodiments, the method can also comprise:
The size of all similar pictures in calculating electronic equipment, obtains similar pictures total amount information;
When getting the file clean-up request of user for described electronic equipment, in docuterm for clearance, show described total amount information.
Such as, the total amount information that can obtain similar pictures in mobile phone is how many M etc., and in text item for clearance, show this total amount information, thus user can be facilitated to know the total quantity of similar pictures, clears up as required or does not clear up unnecessary similar pictures.
In the present embodiment, by obtaining content information and colouring information, and generate mixed-fingerprint according to content information and colouring information, similar pictures is determined whether according to mixed-fingerprint, content and color can be considered when similar pictures identification, relative to the mode of single consideration color histogram, the recognition accuracy of similar pictures can be improved.
It should be noted that, in describing the invention, term " first ", " second " etc. only for describing object, and can not be interpreted as instruction or hint relative importance.In addition, in describing the invention, except as otherwise noted, the implication of " multiple " refers at least two.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by embodiments of the invention person of ordinary skill in the field.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, revises, replace and modification.