Embodiment
Below in conjunction with the accompanying drawing in the present invention, clear, complete description is carried out to the technical scheme in the present invention, is shown
So, described embodiment is a part of embodiment of the present invention, rather than whole embodiments.Based on the implementation in the present invention
Example, all other embodiment that those of ordinary skill in the art are obtained on the premise of creative work is not made all belongs to
In the scope of protection of the invention.
As shown in figure 1, the flow of the method for image re-scheduling provided in an embodiment of the present invention, specifically includes following steps:
Step 101, server obtains Target Photo and the characteristic value of at least one reference base picture.
When user user terminal input search keyword, and click on beginning search button when, terminal will be searched for accordingly
Keyword is sent to server, and server then carries out corresponding picture searching according to search keyword.When searching second figure
During piece, image re-scheduling processing just is carried out using the second pictures as Target Photo, reference base picture now is first searched
Pictures.When searching three pictures, image re-scheduling processing, base now are carried out using the 3rd pictures as Target Photo
Quasi- picture can be the first pictures and the second pictures (if the second pictures are not excluded).In this manner, often search
Rope is to a pictures, then using this picture as Target Photo, and is used as base using the picture remained is handled by re-scheduling before
Quasi- picture (can be the whole pictures retained before, can also as the case may be selected section picture), is arrived to new search
Picture carries out image re-scheduling processing.
Specifically, server can be empty in pre-set color according to pixel in picture (including Target Photo and reference base picture)
Between in different components intensity, determine the characteristic value of picture.Color space is by multiple passages (generally three or four) group
Into each passage correspondence one is used to describe the parameter that pixel shows feature, for the pixel in picture, by each
The corresponding parameter of passage carries out corresponding value, it may be determined that the display characteristic of pixel, and the corresponding parameter of each passage can be described as
The component (or display component) of the pixel is shown, corresponding value can be described as the intensity of the component (between usually 0-255
One numerical value).Pixel color therein can be divided into multiple components according to different color spaces per pictures.Example
Such as, most common RGB (Red Green Blue, RGB) color space, R (red), G (green), B are divided into by color space
Pixel in (indigo plant) three passages, the picture defined according to RGB color is by tri- components of R, G, B according to different intensity
Composition.In another example, HSV (Hue Saturation Value, color, saturation degree, lightness) color space divides color space
For H (color), S (saturation degree), three passages of V (lightness), according to the pixel in the picture of hsv color definition space by H, S,
Tri- components of V are constituted according to different intensity.
It is pointed out that pre-set color space can arbitrarily be selected as the case may be, Target Photo and reference base picture
Identical pre-set color space is selected, with the intensity according to pixel different components in the pre-set color space, it is determined that figure
The characteristic value of piece.
It is preferred that, the characteristic value of picture can be determined in accordance with the following steps.
Step one, server can be directed to the different passages in pre-set color space, be drawn respectively on picture by preset rules
Separate at least one region.Wherein, the shape in region can be square, circular or other shapes, and the quantity in region can be any,
There may be gap between region, can also be overlapping.
For example, as shown in Fig. 2 picture can be marked off into 4 × 4 blockages on G passages, by picture on R passages
3 × 3 blockages are marked off, picture is marked off into 2 × 2 blockages in channel B.
During image re-scheduling is carried out, Target Photo uses identical preset rules dividing regions with each reference base picture
Domain.Specifically, can be in Target Photo and division numbers identical region, the size of each corresponding region, center in reference base picture
Position is identical, so divides, for the different picture of size (resolution ratio), even if image content is identical, can also be identified
For unduplicated picture.Alternatively, it is also possible at the picture zoning different to size, divide the region of identical quantity
Meanwhile, according to the ratio of two pictures sizes, the size of corresponding region is subjected to equal proportion scaling, so divided, for size
Different and image content very close to picture, it will be identified as the picture repeated.For example, Target Photo size is 20 × 20
Pixel, reference base picture size is 40 × 40, at coordinate (5,5) place centered on certain region in Target Photo, and radius is 5 circle
At coordinate (10,10) place centered on corresponding region is answered in region, reference base picture, radius is 10 border circular areas.
When different passages are respectively the different Color Channel (passages of corresponding color parameter, for example, in RGB color
R, G, channel B correspond to different color parameters respectively, it is possible to be referred to as Color Channel) when, it is higher for visual sensitivity
The corresponding Color Channel of color, the region quantity divided on picture is more.For example, the visual sensitivity of green is higher than red
Visual sensitivity, the visual sensitivity of red visual sensitivity higher than blueness, then can on G passages zoning number
Amount is most, and the quantity of zoning is taken second place on R passages, and channel B is third.
Step 2, server determines the feature of the picture according to the intensity of respective component in each region on different passages
Value.Wherein, in region certain component intensity, can be the summation or average value of the intensity of each pixel component in region.
Specifically, the characteristic value determination process of picture can surface current journey as follows, below in conjunction with the example of RGB color
It is described in detail.
Step a, for each passage, according to the intensity of respective component in each region, determines average strength.
For example, on G passages, N is marked off in picturegIndividual lattice, for each lattice, is calculated in the range of it respectively
The intensity summation of the green component of all pixels, result of calculation is designated as G respectively1, G2, G3..., GNg;On R passages, drawn in picture
Separate NrIndividual grid, for each lattice, calculates the intensity summation of the red component of all pixels in the range of it respectively, calculates
As a result R is designated as respectively1, R2, R3..., RNr;On R passages, N is marked off in picturebIndividual grid, for each lattice, difference
The intensity summation of the blue component of all pixels in the range of it is calculated, result of calculation is designated as B respectively1, B2, B3..., BNb。
Average strength is that the intensity on the average value of respective component intensity in each region on the passage, each passage is put down
Average, is the summation of respective component intensity in all regions on the passage, divided by zoning number, R, G, in channel B
Average strength can be respectively:
Step b, according to the intensity of respective component in each region on each passage, determines intensity overall average.
Intensity overall average can for the intensity of respective component in all regions on all passages summation, it is divided by all logical
The summation of the number of regions divided on road, is specifically as follows:
Following c, Step d, are the processes that previously obtained average strength is carried out to binary conversion treatment.
Step c, for each passage, the intensity of respective component in each region is compared with average strength, if less than
Average strength, it is determined that the characteristic value in the region is 0, otherwise, it determines the characteristic value in the region is 1.The characteristic value in each region
It can be obtained according to such as minor function:
Step d, the average strength of each passage is compared with intensity overall average, if less than intensity overall average, then
The characteristic value for determining the passage is 0, otherwise, it determines the characteristic value of the passage is 1.The characteristic value of each passage can be according to following letter
Number is obtained:
Step e, on each passage in the characteristic value in each region and the characteristic value of each passage, acquisition preset number (assuming that
For p) characteristic value, and the characteristic value of the preset number is sequentially connected with to the feature for obtaining the picture according to preset order
Value.For example, obtaining characteristic value f1, f2..., fp, then it be sequentially merged into the binary number of one p according to formula below
F。
Above-mentioned preset number can arbitrarily be set as the case may be, but be set for Target Photo and reference base picture
Identical preset number, i.e. Target Photo are identical with the characteristic value digit of reference base picture.Above-mentioned preset order can be according to specific
Situation is arbitrarily set, but to set identical preset order for Target Photo and reference base picture.
The calculating of above-mentioned average strength and intensity overall average, is only that by taking arithmetic average as an example, can also use several
The calculations such as what average value, median, mode are obtained.
Step 102, server is according to the characteristic value of acquisition, judge Target Photo whether the feature value difference with each reference base picture
Different degree is both greater than predetermined threshold value, if it is, performing step 103, otherwise, performs step 104.Wherein, Target Photo and benchmark
The characteristic value diversity factor of picture, can be Target Photo characteristic value and reference base picture characteristic value Hamming distances.
It is preferred that, in order to improve treatment effeciency, above-mentioned deterministic process can be carried out by way of setting up Hash bucket, such as
Shown in Fig. 3, specific handling process is as follows:
Step 1021, by point of the feature value division of picture (including Target Photo and each reference base picture) for preset group number
Group.Wherein, preset group number is more than predetermined threshold value.The length being respectively grouped can be selected arbitrarily as the case may be;The number of packet
Mesh can also be selected arbitrarily as the case may be, as long as more than predetermined threshold value, and no more than the digit of picture feature value.Target figure
Piece and each reference base picture will be grouped in the same fashion.
It is preferred that, in order to improve treatment effeciency, preset group number can add 1 for predetermined threshold value, the packet of digit identical
Number is at least preset group number and subtracts 1.For example, setting characteristic value F digit as p, predetermined threshold value is q, and characteristic value F is divided into q+
1 packet, and the digit of preceding q packet is w, w can be rounded by p/ (q+1) Jia 1 and obtains, and last digit being grouped is p-
Wq, a kind of in particular cases p-wq is equally likely to w, and at this moment the digit of all packets is all w.
Step 1022, as shown in figure 4, for each packet, using the characteristic value fragment in packet as key, and will remove
Characteristic value after this feature value fragment sets up Hash bucket, and will each be grouped corresponding Hash bucket composition Hash bucket as value
Set.The Hash bucket set of q+1 packet can be denoted as H={ H1, H2, H3..., Hq+1}。
Step 1023, the key in the packets corresponding with each reference base picture of the key in each packet of Target Photo is compared
Compared with, and identical key is judged whether, if it is present performing step 1024, otherwise perform step 1026.
Step 1024, judge whether the corresponding value of identical key Hamming distances are less than or equal to predetermined threshold value, such as
Fruit is then to perform step 1025, if the corresponding value of all identical key Hamming distances are both greater than predetermined threshold value, hold
Row step 1026.
Step 1025, the characteristic value diversity factor no more than predetermined threshold value of Target Photo and corresponding reference base picture is determined.
Step 1026, the characteristic value diversity factor both greater than predetermined threshold value of Target Photo and each reference base picture is determined.
For example, the key during can first Target Photo characteristic value first be grouped is grouped with each reference base picture characteristic value first
In key compare, if not having identical key, the key in second packet is compared, by that analogy, if finding phase
With key, it is determined that the corresponding value of two identical key Hamming distances, if less than or equal to threshold value q, then illustrate target
The Hamming distances of picture reference base picture corresponding with the key are less than threshold value q, if greater than threshold value q, then continue to search for identical
Key, if all values corresponding to identical key found Hamming distances both greater than q, or would not do not find identical
Key, then illustrate that Target Photo and the Hamming distances person of each reference base picture are more than threshold value q.
Step 103, server determines that Target Photo is not repeated with reference base picture, and retains this Target Photo.Target Photo
Do not repeated with the sufficiently high explanation Target Photo of characteristic value diversity factor of each reference base picture with reference base picture, it is possible to by target
Picture is remained into search result, is sent to terminal.Moreover, server can increase to this Target Photo in reference base picture,
During re-scheduling for next pictures judges.Server can using by re-scheduling handle the picture as reference base picture,
Therefrom reference base picture can be used as by selected section picture
Step 104, server determines that the Target Photo and the reference base picture are repeated, and abandons the Target Photo,
Carry out the re-scheduling processing of next Target Photo.The characteristic value diversity factor of Target Photo and reference base picture is not high enough, illustrates with being somebody's turn to do
Reference base picture is quite similar, and Target Photo is considered as repetitive picture, can be abandoned, is not put into search result.
In embodiments of the invention, server obtains the characteristic value of Target Photo and at least one reference base picture, according to obtaining
The characteristic value taken, and judge whether the Target Photo is both greater than default threshold with the characteristic value diversity factor of each reference base picture
Value;If it is, determining that the Target Photo is not repeated with the reference base picture, and retain the Target Photo;Otherwise, it determines
The Target Photo is repeated with the reference base picture, and abandons the Target Photo.It is thus possible to reduce repetitive picture appearance
May, improve the utilization ratio of system resource.
Based on identical technical concept, the embodiment of the present invention additionally provides a kind of image re-scheduling device, as shown in figure 5, bag
Include:
Acquisition module 510, the characteristic value for obtaining Target Photo and at least one reference base picture;
Re-scheduling module 520, for the characteristic value according to acquisition, judge the Target Photo whether with each reference base picture
Characteristic value diversity factor be both greater than predetermined threshold value;
If it is, determining that the Target Photo is not repeated with the reference base picture, and retain the Target Photo;It is no
Then, determine that the Target Photo is repeated with the reference base picture, and abandon the Target Photo.
It is preferred that, the acquisition module 510, specifically for:
According to the intensity of the different components in pre-set color space of pixel in picture, the characteristic value of picture is determined;Wherein,
The picture includes the Target Photo and each reference base picture.
It is preferred that, the acquisition module 510, specifically for:
For the different passages in the pre-set color space, at least one area is respectively divided out on picture by preset rules
Domain;
According to the intensity of respective component in each region on different passages, the characteristic value of the picture is determined.
It is preferred that, the passage is specially Color Channel;
The acquisition module 510, specifically for for the corresponding Color Channel of the higher color of visual sensitivity, in picture
The region quantity of upper division is more.
It is preferred that, the acquisition module 510, specifically for:
For each passage, according to the intensity of respective component in each region, average strength is determined;And according on each passage
The intensity of respective component in each region, determines intensity overall average;
For each passage, the intensity of respective component in each region is compared with average strength, it is flat if less than intensity
Average, it is determined that the characteristic value in the region is 0, otherwise, it determines the characteristic value in the region is 1;
The average strength of each passage is compared with the intensity overall average, if less than intensity overall average, then really
The characteristic value of the fixed passage is 0, otherwise, it determines the characteristic value of the passage is 1;
On each passage in the characteristic value in each region and the characteristic value of each passage, the characteristic value of preset number is obtained, and will
The characteristic value of the preset number is sequentially connected with the characteristic value for obtaining the picture according to preset order, and this feature value is binary system
Number.
It is preferred that, the Target Photo and the characteristic value diversity factor of the reference base picture, specially described Target Photo
The Hamming distances of characteristic value and the characteristic value of the reference base picture.
It is preferred that, the re-scheduling module 520, specifically for:
By the packet that the feature value division of picture is preset group number, wherein, the preset group number is more than described default
Threshold value, the picture includes the Target Photo and each reference base picture;
For each packet, using the characteristic value fragment in packet as key, and the feature after this feature value fragment will be removed
Value sets up Hash bucket, and will each be grouped corresponding Hash bucket composition Hash bucket set as value;
Key in key in each packet of Target Photo packets corresponding with each reference base picture is compared;If deposited
In identical key, then judge whether the corresponding value of identical key Hamming distances are less than or equal to the default threshold
Value;If it is, determining that the Target Photo is not more than the predetermined threshold value with the characteristic value diversity factor of corresponding reference base picture;
If there is no identical key, or, the corresponding value of all identical key Hamming distances are both greater than the default threshold
Value, it is determined that the Target Photo and the characteristic value diversity factor of each reference base picture are both greater than the predetermined threshold value.
It is preferred that,
The preset group number is specially that the predetermined threshold value plus 1;
The number of digit identical packet is at least the preset group number and subtracts 1.
In embodiments of the invention, server obtains the characteristic value of Target Photo and at least one reference base picture, according to obtaining
The characteristic value taken, and judge whether the Target Photo is both greater than default threshold with the characteristic value diversity factor of each reference base picture
Value;If it is, determining that the Target Photo is not repeated with the reference base picture, and retain the Target Photo;Otherwise, it determines
The Target Photo is repeated with the reference base picture, and abandons the Target Photo.It is thus possible to reduce repetitive picture appearance
May, improve the utilization ratio of system resource.
It will be appreciated by those skilled in the art that the module in device in embodiment can be divided according to embodiment description
It is distributed in the device of embodiment, respective change can also be carried out and be disposed other than in one or more devices of the present embodiment.On
The module for stating embodiment can be merged into a module, can also be further split into multiple submodule.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be by
Software adds the mode of required general hardware platform to realize, naturally it is also possible to which by hardware, but in many cases, the former is more
Good embodiment.Understood based on such, what technical scheme substantially contributed to prior art in other words
Part can be embodied in the form of software product, and the computer software product is stored in a storage medium, if including
Dry instruction is to cause a station terminal equipment (can be mobile phone, personal computer, server, or network equipment etc.) to perform sheet
Invent the method described in each embodiment.
Described above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
Depending on protection scope of the present invention.