CN108460065A - Photo method for cleaning, device and terminal device - Google Patents

Photo method for cleaning, device and terminal device Download PDF

Info

Publication number
CN108460065A
CN108460065A CN201710707329.5A CN201710707329A CN108460065A CN 108460065 A CN108460065 A CN 108460065A CN 201710707329 A CN201710707329 A CN 201710707329A CN 108460065 A CN108460065 A CN 108460065A
Authority
CN
China
Prior art keywords
photo
scoring
value
mentioned
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710707329.5A
Other languages
Chinese (zh)
Other versions
CN108460065B (en
Inventor
刘灿尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710707329.5A priority Critical patent/CN108460065B/en
Publication of CN108460065A publication Critical patent/CN108460065A/en
Application granted granted Critical
Publication of CN108460065B publication Critical patent/CN108460065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Library & Information Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

A kind of photo method for cleaning of the application offer, device and terminal device, above-mentioned photo method for cleaning include:Obtain the photo preserved in user equipment;The fuzziness scoring, noise scoring and shake for calculating the photo are scored, and score the fuzziness scoring of the photo, noise and shake scoring is weighted averagely, obtain the scoring of the photo;The user using the user equipment is given in scoring more than or equal to the photo display of predetermined threshold value in the photo that the user equipment is preserved;Delete the photo that the user selects in the photo of displaying.The application may be implemented more intelligently to distinguish useless photo, in addition to the fuzzy photo in identification continuous shooting, fuzzy photo caused by can also identifying that out of focus, noise in daily shooting is excessive and/or shake etc., after intelligently selecting useless photo, user is showed to carry out selection cleaning, so as to which when the memory space of user equipment is in short supply, valuable memory space is vacateed for user.

Description

Photo method for cleaning, device and terminal device
Technical field
This application involves a kind of picture Processing Technique field more particularly to photo method for cleaning, device and terminal devices.
Background technology
It is existing that the memory space of user equipment is increasing in the related technology, but with the use of user, unavoidably It generates many system rubbish, using data and multi-medium data, causes the use space of user insufficient.And wherein multi-medium data A maximum part in the use space of user is occupied again, and user picture occupies a part big absolutely in multi-medium data.Institute Useless resource can be effectively discharged with the cleaning to useless photo, saves user's space.It, can not during user takes pictures Generate many blurred image with avoiding.These blurred image Producing reasons may include out of focus, shooting at night noise mistake Shake etc. when more and/or shooting.These photos can be determined as the photo useless to user.
It is existing in the related technology, the automatic liquidating plan based on similar photo array is provided, by continuous photo Similitude identifies, allows user that photo extra or useless in similar collection of photographs is selected to delete, but said program can only When processing is continuously shot, the scene of similar photo array, applicable scene is relatively single, the cleaning to useless photo in user equipment Effect is poor, and user experience is not high.
Invention content
To overcome the problems in correlation technique, a kind of photo method for cleaning of the application offer, device and terminal device.
In order to achieve the above objectives, embodiments herein adopts the following technical scheme that:
In a first aspect, the embodiment of the present application provides a kind of photo method for cleaning, including:Obtain the photograph preserved in user equipment Piece;The fuzziness scoring, noise scoring and shake scoring for calculating the photo, comment the fuzziness scoring of the photo, noise Divide and shake scoring is weighted averagely, obtains the scoring of the photo;It scores in the photo that the user equipment is preserved big In or equal to predetermined threshold value photo display give using the user equipment user;The user is deleted in the photo of displaying The photo of selection.
In above-mentioned photo method for cleaning, after obtaining the photo preserved in user equipment, the fuzziness of above-mentioned photo is calculated Then scoring, noise scoring and shake scoring score to the scoring of the fuzziness of above-mentioned photo, noise and shake scoring are weighted It is average, the scoring of above-mentioned photo is obtained, photograph of the scoring more than or equal to predetermined threshold value in the photo that above-mentioned user equipment is preserved Piece shows the user using above-mentioned user equipment, finally deletes the photo that above-mentioned user selects in the photo of displaying, to It may be implemented more intelligently to distinguish useless photo, in addition to the fuzzy photo in identification continuous shooting, moreover it is possible to identify daily shooting In fuzzy photo caused by out of focus, noise is excessive and/or shake etc., after intelligently selecting useless photo, show user into Row selection cleaning, so as to which when the memory space of user equipment is in short supply, valuable memory space is vacateed for user.
Second aspect, the embodiment of the present application provide a kind of photo cleaning plant, including:Acquisition module, for obtaining user The photo preserved in equipment;Computing module, fuzziness scoring, noise scoring for calculating the photo that the acquisition module obtains With shake scoring, scores the fuzziness scoring of the photo, noise and shake scoring is weighted averagely, obtain the photo Scoring;Display module, photo exhibition of the scoring more than or equal to predetermined threshold value in the photo for preserving the user equipment Show to the user for using the user equipment;Removing module, the photo shown in the display module for deleting the user The photo of middle selection.
In above-mentioned photo cleaning plant, after acquisition module obtains the photo preserved in user equipment, computing module calculates Above-mentioned photo fuzziness scoring, noise scoring and shake scoring, then to the fuzziness of above-mentioned photo scoring, noise scoring and Shake scoring is weighted average, obtains the scoring of above-mentioned photo, and display module will be commented in photo that above-mentioned user equipment preserves Dividing the photo display more than or equal to predetermined threshold value, last removing module deletes above-mentioned use to the user using above-mentioned user equipment The photo that family selects in the photo of displaying more intelligently distinguishes useless photo so as to realize, in addition to identification connects Fuzzy photo in bat, moreover it is possible to fuzzy photo caused by identifying that out of focus, noise in daily shooting is excessive and/or shake etc., After intelligence selects useless photo, user is showed to carry out selection cleaning, it is in short supply so as to the memory space in user equipment When, valuable memory space is vacateed for user.
The third aspect, the embodiment of the present application provide a kind of terminal device, including memory, processor and are stored in described deposit On reservoir and the computer program that can run on the processor, when the processor executes the computer program, realize Method as described above.
Fourth aspect, the embodiment of the present application provide a kind of non-transitorycomputer readable storage medium, are stored thereon with meter Calculation machine program, the computer program realize method as described above when being executed by processor.
5th aspect, the embodiment of the present application provides a kind of computer program product, when in the computer program product When instruction is executed by processor, method as described above is executed.
It should be understood that above general description and following detailed description is only exemplary and explanatory, not The application can be limited.
Description of the drawings
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the application Example, and the principle together with specification for explaining the application.
Fig. 1 is the flow chart of the application photo method for cleaning one embodiment;
Fig. 2 is the flow chart of another embodiment of the application photo method for cleaning;
Fig. 3 is the flow chart of the application photo method for cleaning further embodiment;
Fig. 4 is the flow chart of the application photo method for cleaning further embodiment;
Fig. 5 is the flow chart of the application photo method for cleaning further embodiment;
Fig. 6 is the structural schematic diagram of the application photo cleaning plant one embodiment;
Fig. 7 is the structural schematic diagram of the application terminal device one embodiment;
Fig. 8 is the structural schematic diagram of 10 interior section one embodiment of the application mobile phone.
Through the above attached drawings, it has been shown that the specific embodiment of the application will be hereinafter described in more detail.These attached drawings It is not intended to limit the range of the application design in any manner with verbal description, but is by referring to specific embodiments Those skilled in the art illustrate the concept of the application.
Specific implementation mode
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended The example of consistent device and method of some aspects be described in detail in claims, the application.
Fig. 1 is the flow chart of the application photo method for cleaning one embodiment, as shown in Figure 1, above-mentioned photo method for cleaning May include:
Step 101, the photo preserved in user equipment is obtained.
Specifically, the photo preserved in user equipment can be obtained by automatically scanning.
Step 102, the fuzziness scoring, noise scoring and shake scoring for calculating above-mentioned photo, obscure above-mentioned photo It spends scoring, noise scoring and shake scoring to be weighted averagely, obtains the scoring of above-mentioned photo.
Specifically, it scores the scoring of the fuzziness of above-mentioned photo, noise and shake scoring is weighted averagely, obtain above-mentioned The scoring of photo can be:
The scoring of above-mentioned photo is calculated according to formula (1):
M=(a1M1+a2M2+a3M3)/3; (1)
In formula (1), M is the scoring of above-mentioned photo, M1It scores for the fuzziness of above-mentioned photo, M2For the noise of above-mentioned photo Scoring, M3It scores for the shake of above-mentioned photo, a1For the weighted value of M1, a2For M2Weighted value, a3For M3Weighted value.
Wherein, above-mentioned a1、a2And a3Size can specific implementation when, according to system performance and/or realization demand etc. from Row setting, the present embodiment is to a1、a2And a3Size be not construed as limiting, and a1, a2, a3 can partly take 0, and representative only takes part Scoring, can accept or reject scoring algorithm according to system and equipment performance.
Step 103, in the photo above-mentioned user equipment preserved scoring more than or equal to predetermined threshold value photo display to Use the user of above-mentioned user equipment.
Step 104, the photo that above-mentioned user selects in the photo of displaying is deleted.
In the present embodiment, photo of the scoring more than or equal to predetermined threshold value in the photo that above-mentioned user equipment can be preserved It is output to photo list to select for user, and after user chooses the photo for needing to clear up, the photo that user chooses is carried out One key is cleared up.
In above-mentioned photo method for cleaning, after obtaining the photo preserved in user equipment, the fuzziness of above-mentioned photo is calculated Then scoring, noise scoring and shake scoring score to the scoring of the fuzziness of above-mentioned photo, noise and shake scoring are weighted It is average, the scoring of above-mentioned photo is obtained, photograph of the scoring more than or equal to predetermined threshold value in the photo that above-mentioned user equipment is preserved Piece shows the user using above-mentioned user equipment, finally deletes the photo that above-mentioned user selects in the photo of displaying, to It may be implemented more intelligently to distinguish useless photo, in addition to the fuzzy photo in identification continuous shooting, moreover it is possible to identify daily shooting In fuzzy photo caused by out of focus, noise is excessive and/or shake etc., after intelligently selecting useless photo, show user into Row selection cleaning, so as to which when the memory space of user equipment is in short supply, valuable memory space is vacateed for user.
Fig. 2 is the flow chart of another embodiment of the application photo method for cleaning, as shown in Fig. 2, real shown in the application Fig. 1 Apply in example, step 102 fall into a trap count in stating photo fuzziness scoring may include:
Step 201, gray proces are carried out to above-mentioned photo, obtains the gray-scale map of above-mentioned photo.
Step 202, according to the gray-scale map of above-mentioned photo, calculate above-mentioned photo maximum perpendicular gradient and above-mentioned photo most Big horizontal gradient, and calculate the tonal range of above-mentioned photo.
Specifically, according to the gray-scale map of above-mentioned photo, calculate above-mentioned photo maximum perpendicular gradient and above-mentioned photo most Big horizontal gradient can be:According to the gray-scale map of above-mentioned photo, arbitrary phase in the vertical direction of the gray-scale map of above-mentioned photo is calculated The difference of the gray value of adjacent two pixels, to calculate the maximum value in the difference obtained as the maximum perpendicular ladder of above-mentioned photo Degree;And the gray-scale map according to above-mentioned photo, calculate arbitrary two neighboring pixel in the horizontal direction of the gray-scale map of above-mentioned photo The difference of the gray value of point, to calculate the maximum value in the difference obtained as the maximum horizontal gradient of above-mentioned photo.
Specifically, according to the gray-scale map of above-mentioned photo, calculating the tonal range of above-mentioned photo can be:According to above-mentioned photo Gray-scale map, count the number of each gray value corresponding pixel in the gray-scale map of above-mentioned photo;In corresponding pixel Number be 0 gray value in, according to the gray value of the first predetermined ratio of sequential selection of gray value from big to small, to above-mentioned The number of the gray value of first predetermined ratio and the corresponding pixel of gray value of above-mentioned first predetermined ratio is weighted averagely, Obtain the maximum value of the gray value of above-mentioned photo;Corresponding pixel number be 0 gray value in, according to gray value from The small gray value to big the second predetermined ratio of sequential selection, gray value and above-mentioned second to above-mentioned second predetermined ratio make a reservation for The number of the corresponding pixel of gray value of ratio is weighted averagely, obtains the minimum value of the gray value of above-mentioned photo;According to The minimum value of the gray value of the maximum value of the gray value of above-mentioned photo and above-mentioned photo calculates the gray scale model for obtaining above-mentioned photo It encloses.
Wherein, above-mentioned first predetermined ratio can be equal or different with the second predetermined ratio, above-mentioned first predetermined ratio and The size of second predetermined ratio can be in specific implementation according to the sets itselfs such as system performance and/or realization demand, this implementation Example is not construed as limiting this, for example, above-mentioned first predetermined ratio and above-mentioned second predetermined ratio can be 5%.
The mode of the tonal range to calculating above-mentioned photo describes in detail below:
1) number of each gray value corresponding pixel in the gray-scale map of above-mentioned photo in 256 gray values is counted, The gray value array hist [256] that a length is 256 is generated, each of array value is ash of the gray value in above-mentioned photo Spend the number of corresponding pixel in figure;
2) darkestValue and whitestValue is calculated;Wherein, darkestValue is in corresponding pixel Number is not in 0 gray value, according to the gray value of the second predetermined ratio of sequential selection of gray value from small to large, to above-mentioned the The number of the gray value of two predetermined ratios and the corresponding pixel of gray value of above-mentioned second predetermined ratio is weighted averagely, is obtained The minimum value of the gray value of the above-mentioned photo obtained;WhitestValue be corresponding pixel number be not 0 gray value In, according to the gray value of the second predetermined ratio of sequential selection of gray value from small to large, to the gray scale of above-mentioned second predetermined ratio The number of the corresponding pixel of gray value of value and above-mentioned second predetermined ratio is weighted average, the ash of the above-mentioned photo of acquisition The minimum value of angle value.
The pseudocode of the calculation of darkestValue and whitestValue can be as follows:
sum←0
sum1←0
sum2←0
thresh←0.05
for k←0 to 256
sum1←sum1+hist[k]*k
sum2←sum2+hist[k]
if((sum2/imSize)>thresh)break
if(sum2>0)
darkestValue←(int)((float)sum1/sum2)
sum1←0
sum2←0
for k←256 to 0
sum1←sum1+hist[k]*k
sum2←sum2+hist[k]
if(sum2/imSize)>thresh)break
if(sum2>0)
WhitestValue=(int) ((float) sum1/sum2);
3) according to the minimum value of the maximum value of the gray value of above-mentioned photo and the gray value of above-mentioned photo, it is above-mentioned to calculate acquisition The tonal range of photo, as shown in formula (2).
GrayRange=max (whitestValue-darkestValue, 0); (2)
In formula (2), grayRange is the tonal range of above-mentioned photo.
Step 203, according to the maximum horizontal gradient and above-mentioned photograph of the maximum perpendicular gradient of above-mentioned photo and above-mentioned photo The tonal range of piece calculates the fuzziness scoring of above-mentioned photo.
Specifically, according to the maximum horizontal gradient and above-mentioned photograph of the maximum perpendicular gradient of above-mentioned photo and above-mentioned photo The tonal range of piece calculate above-mentioned photo fuzziness scoring can be:
The fuzziness scoring of above-mentioned photo is calculated according to formula (3):
In formula (3), Score is that the fuzziness of above-mentioned photo scores, and maxHoriGradient is that the maximum of above-mentioned photo is hung down Vertical ladder degree, maxVertGraident are the maximum horizontal gradient of above-mentioned photo, and grayRange is the tonal range of above-mentioned photo.
Fig. 3 is the flow chart of the application photo method for cleaning further embodiment, as shown in figure 3, real shown in the application Fig. 1 Apply in example, step 102 fall into a trap count in stating photo noise scoring may include:
Step 301, processing is carried out to above-mentioned photo using median filter and generates comparison photo.
Step 302, the mean square error for calculating above-mentioned comparison photo and above-mentioned photo calculates above-mentioned according to above-mentioned mean square error The Y-PSNR of photo.
Specifically, the Y-PSNR of above-mentioned photo can be calculated according to formula (4) according to above-mentioned mean square error:
In formula (4), psnr is the Y-PSNR of above-mentioned photo, and mse is the square of above-mentioned comparison photo and above-mentioned photo Error.
Step 303, the noise for the Y-PSNR of above-mentioned photo being mapped as to above-mentioned photo scores.
Specifically, the noise that the Y-PSNR of above-mentioned photo can be mapped as to above-mentioned photo according to formula (5) scores.
In formula (5), score ' is that the noise of above-mentioned photo scores.
Fig. 4 is the flow chart of the application photo method for cleaning further embodiment, as shown in figure 4, real shown in the application Fig. 1 Apply in example, step 102 fall into a trap count in stating photo shake scoring may include:
Step 401, above-mentioned photo is handled using bilateral filtering and impact filtering, generates filtering picture.
Step 402, the gradient magnitude image of the gradient magnitude image and above-mentioned filtering picture of above-mentioned photo is calculated.
Step 403, mould is calculated according to the gradient magnitude image of the gradient magnitude image of above-mentioned photo and above-mentioned filtering picture Paste core discreet value.
Specifically, fuzzy core discreet value can be calculated according to formula (6):
In formula (6), F () and F-1() represents Fourier transformation and inverse Fourier transform,Represent complex conjugate behaviour Make,For the gradient magnitude image of above-mentioned photo,For the gradient magnitude image of above-mentioned filtering picture, k estimates for fuzzy core Value.
Step 404, above-mentioned fuzzy core discreet value is normalized, and calculates the fuzzy core of normalized acquisition The norm of discreet value, the shake as above-mentioned photo are scored.
Specifically, after fuzzy core discreet value is normalized, the fuzzy of normalized acquisition can be calculated 2 norms of core discreet value, the shake as above-mentioned photo are scored.
Fig. 5 is the flow chart of the application photo method for cleaning further embodiment, as shown in figure 5, real shown in the application Fig. 1 It applies example, after step 104, can also include:
Step 501, if above-mentioned user equipment is progress photo cleaning for the first time, photograph of the above-mentioned user in displaying is being deleted After the photo selected in piece, reports the number of pictures finally cleared up for the first time to background server and preserved in above-mentioned user equipment The sum of photo.
In the present embodiment, the initial value of above-mentioned predetermined threshold value is that background server determines based on experience value;
The total of the number of pictures finally cleared up for the first time and the photo preserved in above-mentioned user equipment is reported to background server After number, the end value of above-mentioned predetermined threshold value is the corresponding threshold value of optimal cleaning effect, after above-mentioned optimal cleaning effect is Platform server calculates above-mentioned user according to the sum of the photo preserved in the number of pictures and above-mentioned user equipment finally cleared up for the first time After the corresponding cleaning effect of equipment, according to the corresponding cleaning effect of above-mentioned user equipment to the initial value of above-mentioned predetermined threshold value into Row adjustment obtains.
That is, in order to enable cleaning effect is best, it is desirable to enough useless photos are scanned as much as possible, and User selects photo as much as possible in the photo for showing user and is finally cleared up, that is, wishes finally to clear up photograph for the first time The number of pictures for the piece number/scan is as big as possible, and the sum of the photo preserved in the photo/user equipment shown is as far as possible Greatly, above-mentioned two ratio is multiplied, it is finally to clear up the photograph preserved in number of pictures/user equipment for the first time that can define cleaning effect The sum of piece, this ratio is bigger, illustrates that cleaning effect is better.
In background server according to the sum of the photo preserved in the number of pictures and above-mentioned user equipment finally cleared up for the first time It, can be according to the corresponding cleaning effect of above-mentioned user equipment to above-mentioned pre- after calculating the corresponding cleaning effect of above-mentioned user equipment If the initial value of threshold value is adjusted, the other users equipment in addition to above-mentioned user equipment is then observed again, after adjustment Predetermined threshold value photo cleaning effect for the first time, the corresponding threshold value of the optimal cleaning effect of final choice, as above-mentioned default threshold The end value of value.
Above-mentioned photo method for cleaning can more intelligently distinguish useless photo, in addition to the fuzzy photograph in identification continuous shooting Piece, moreover it is possible to fuzzy photo caused by identifying that out of focus, noise in daily shooting is excessive and/or shake etc. is useless intelligently selecting After photo, user is showed to carry out selection cleaning, so as to when the memory space of user equipment is in short supply, be risen for user Go out valuable memory space.
Fig. 6 is the structural schematic diagram of the application photo cleaning plant one embodiment, and the photo in the embodiment of the present application is clear Manage device can as the application installed in terminal, such as:Photograph album house keeper realizes photo cleaning side provided by the embodiments of the present application Method.As shown in fig. 6, above-mentioned photo cleaning plant may include:Acquisition module 61, computing module 62, display module 63 and deletion Module 64;
Wherein, acquisition module 61, for obtaining the photo preserved in user equipment;Specifically, acquisition module 61 can lead to Automatically scanning is crossed, the photo preserved in user equipment is obtained.
Computing module 62, fuzziness scoring, noise scoring and the shake of the photo for calculating the acquisition of acquisition module 61 are commented Point, scoring the fuzziness scoring, noise scoring and shake of above-mentioned photo, it is average to be weighted, and obtains the scoring of above-mentioned photo; Specifically, computing module 62 can score to the fuzziness scoring of above-mentioned photo, noise according to formula (1) and shake scoring adds Weight average obtains the scoring of above-mentioned photo.
Display module 63, photo of the scoring more than or equal to predetermined threshold value in the photo for preserving above-mentioned user equipment Show the user using above-mentioned user equipment;
Removing module 64, the photo selected in the photo that display module 63 is shown for deleting above-mentioned user.
Scoring, which is greater than or equal to, in the present embodiment, in the photo that display module 63 can preserve above-mentioned user equipment presets The photo of threshold value is output to photo list and is selected for user, and after user chooses the photo for needing to clear up, removing module 64 is right The photo that user chooses carries out a key cleaning.
In the present embodiment, computing module 62 is specifically used for carrying out gray proces to above-mentioned photo, obtains the ash of above-mentioned photo Degree figure, according to the gray-scale map of above-mentioned photo, calculates the maximum perpendicular gradient of above-mentioned photo and the maximum horizontal gradient of above-mentioned photo, And the tonal range of above-mentioned photo is calculated, according to the maximum perpendicular gradient of above-mentioned photo and the maximum horizontal of above-mentioned photo ladder The tonal range of degree and above-mentioned photo calculates the fuzziness scoring of above-mentioned photo.
In specific implementation, computing module 62 can calculate the gray-scale map of above-mentioned photo according to the gray-scale map of above-mentioned photo Vertical direction on arbitrary two neighboring pixel gray value difference, to calculate the maximum value in the difference obtained as upper State the maximum perpendicular gradient of photo;And the gray-scale map according to above-mentioned photo, calculate the horizontal direction of the gray-scale map of above-mentioned photo The difference of the gray value of upper arbitrary two neighboring pixel, most using the maximum value in the difference of calculating acquisition as above-mentioned photo Big horizontal gradient.
Computing module 62 can count each gray value in the gray-scale map of above-mentioned photo according to the gray-scale map of above-mentioned photo The number of corresponding pixel;In the number of corresponding pixel is not 0 gray value, according to gray value from big to small suitable Sequence selects the gray value of the first predetermined ratio, the gray scale of gray value and above-mentioned first predetermined ratio to above-mentioned first predetermined ratio The number for being worth corresponding pixel is weighted averagely, obtains the maximum value of the gray value of above-mentioned photo;In corresponding pixel Number be 0 gray value in, according to the gray value of the second predetermined ratio of sequential selection of gray value from small to large, to above-mentioned The number of the gray value of second predetermined ratio and the corresponding pixel of gray value of above-mentioned second predetermined ratio is weighted averagely, Obtain the minimum value of the gray value of above-mentioned photo;According to the gray value of the maximum value of the gray value of above-mentioned photo and above-mentioned photo Minimum value calculates the tonal range for obtaining above-mentioned photo.
Wherein, above-mentioned first predetermined ratio can be equal or different with the second predetermined ratio, above-mentioned first predetermined ratio and The size of second predetermined ratio can be in specific implementation according to the sets itselfs such as system performance and/or realization demand, this implementation Example is not construed as limiting this, for example, above-mentioned first predetermined ratio and above-mentioned second predetermined ratio can be 5%.
The mode for calculating computing module 62 tonal range of above-mentioned photo below describes in detail:
1) number of each gray value corresponding pixel in the gray-scale map of above-mentioned photo in 256 gray values is counted, The gray value array hist [256] that a length is 256 is generated, each of array value is ash of the gray value in above-mentioned photo Spend the number of corresponding pixel in figure;
2) darkestValue and whitestValue is calculated;Wherein, darkestValue is in corresponding pixel Number is not in 0 gray value, according to the gray value of the second predetermined ratio of sequential selection of gray value from small to large, to above-mentioned the The number of the gray value of two predetermined ratios and the corresponding pixel of gray value of above-mentioned second predetermined ratio is weighted averagely, is obtained The minimum value of the gray value of the above-mentioned photo obtained;WhitestValue be corresponding pixel number be not 0 gray value In, according to the gray value of the second predetermined ratio of sequential selection of gray value from small to large, to the gray scale of above-mentioned second predetermined ratio The number of the corresponding pixel of gray value of value and above-mentioned second predetermined ratio is weighted average, the ash of the above-mentioned photo of acquisition The minimum value of angle value.
The pseudocode of the calculation of darkestValue and whitestValue can be as follows:
sum←0
sum1←0
sum2←0
thresh←0.05
for k←0 to 256
sum1←sum1+hist[k]*k
sum2←sum2+hist[k]
if((sum2/imSize)>thresh)break
if(sum2>0)
darkestValue←(int)((float)sum1/sum2)
sum1←0
sum2←0
for k←256 to 0
sum1←sum1+hist[k]*k
sum2←sum2+hist[k]
if(sum2/imSize)>thresh)break
if(sum2>0)
WhitestValue=(int) ((float) sum1/sum2);
3) according to the minimum value of the maximum value of the gray value of above-mentioned photo and the gray value of above-mentioned photo, it is above-mentioned to calculate acquisition The tonal range of photo, as shown in formula (2).
In specific implementation, the fuzziness that computing module 62 can calculate above-mentioned photo according to formula (3) scores.
In the present embodiment, computing module 62, specifically for carrying out processing generation pair to above-mentioned photo using median filter According to piece, the mean square error of above-mentioned comparison photo and above-mentioned photo is calculated, the peak of above-mentioned photo is calculated according to above-mentioned mean square error It is worth signal-to-noise ratio, the noise that the Y-PSNR of above-mentioned photo is mapped as to above-mentioned photo scores.
In specific implementation, computing module 62 can calculate the peak of above-mentioned photo according to formula (4) according to above-mentioned mean square error It is worth signal-to-noise ratio, the noise that the Y-PSNR of above-mentioned photo is mapped as to above-mentioned photo according to formula (5) scores.
In the present embodiment, computing module 62, at using bilateral filtering and impact filtering to above-mentioned photo Reason generates filtering picture;Calculate the gradient magnitude image of the gradient magnitude image and above-mentioned filtering picture of above-mentioned photo;According to upper The gradient magnitude image of the gradient magnitude image and above-mentioned filtering picture of stating photo calculates fuzzy core discreet value, to above-mentioned fuzzy core Discreet value is normalized, and calculates the norm of the fuzzy core discreet value of normalized acquisition, as above-mentioned photo Shake scoring.
In specific implementation, computing module 62 can calculate fuzzy core discreet value according to formula (6), to fuzzy core discreet value After being normalized, 2 norms of the fuzzy core discreet value of normalized acquisition can be calculated, as trembling for above-mentioned photo Dynamic scoring.
Further, above-mentioned photo cleaning plant can also include:
Reporting module 65, for when above-mentioned user equipment is to carry out photo cleaning for the first time, being opened up deleting above-mentioned user After the photo selected in the photo shown, reported to background server in the number of pictures finally cleared up for the first time and above-mentioned user equipment The sum of the photo of preservation.
In the present embodiment, the initial value of above-mentioned predetermined threshold value is that background server determines based on experience value;
The total of the number of pictures finally cleared up for the first time and the photo preserved in above-mentioned user equipment is reported to background server After number, the end value of above-mentioned predetermined threshold value is the corresponding threshold value of optimal cleaning effect, after above-mentioned optimal cleaning effect is Platform server calculates above-mentioned user according to the sum of the photo preserved in the number of pictures and above-mentioned user equipment finally cleared up for the first time After the corresponding cleaning effect of equipment, according to the corresponding cleaning effect of above-mentioned user equipment to the initial value of above-mentioned predetermined threshold value into Row adjustment obtains.
That is, in order to enable cleaning effect is best, it is desirable to enough useless photos are scanned as much as possible, and User selects photo as much as possible in the photo for showing user and is finally cleared up, that is, wishes finally to clear up photograph for the first time The number of pictures for the piece number/scan is as big as possible, and the sum of the photo preserved in the photo/user equipment shown is as far as possible Greatly, above-mentioned two ratio is multiplied, it is finally to clear up the photograph preserved in number of pictures/user equipment for the first time that can define cleaning effect The sum of piece, this ratio is bigger, illustrates that cleaning effect is better.
In background server according to the sum of the photo preserved in the number of pictures and above-mentioned user equipment finally cleared up for the first time It, can be according to the corresponding cleaning effect of above-mentioned user equipment to above-mentioned pre- after calculating the corresponding cleaning effect of above-mentioned user equipment If the initial value of threshold value is adjusted, the other users equipment in addition to above-mentioned user equipment is then observed again, after adjustment Predetermined threshold value photo cleaning effect for the first time, the corresponding threshold value of the optimal cleaning effect of final choice, as above-mentioned default threshold The end value of value.
In above-mentioned photo cleaning plant, after acquisition module 61 obtains the photo preserved in user equipment, computing module 62 The fuzziness scoring, noise scoring and shake scoring for calculating above-mentioned photo, then comment the scoring of the fuzziness of above-mentioned photo, noise Divide and shake scoring is weighted averagely, obtains the scoring of above-mentioned photo, the photograph that display module 63 preserves above-mentioned user equipment Scoring gives the user using above-mentioned user equipment, last removing module 64 to delete more than or equal to the photo display of predetermined threshold value in piece Except the photo that above-mentioned user selects in the photo of displaying, useless photo is more intelligently distinguished so as to realize, is removed Fuzzy photo in identification continuous shooting, moreover it is possible to be obscured caused by identifying that the out of focus, noise in daily shooting is excessive and/or shake etc. Photo shows user to carry out selection cleaning, so as in the memory space of user equipment after intelligently selecting useless photo When in short supply, valuable memory space is vacateed for user.
Fig. 7 is the structural schematic diagram of the application terminal device one embodiment, and the terminal device in the present embodiment can wrap It includes memory, processor and is stored in the computer program that can be run on above-mentioned memory and on above-mentioned processor, above-mentioned place When managing device execution above computer program, photo method for cleaning provided by the embodiments of the present application may be implemented.
Wherein, above-mentioned terminal device can be the intelligent terminals such as smart mobile phone, tablet computer or smartwatch, this reality Example is applied to be not construed as limiting the form of above-mentioned terminal device.
The present embodiment is illustrated so that above-mentioned terminal device is smart mobile phone as an example.
It should be understood that mobile phone 10 shown in Fig. 7 is only an example of above-mentioned terminal device, and mobile phone 10 can With than more or less components shown in Fig. 7, two or more components can be combined, or can have There is different component configurations.Various parts shown in Fig. 7 can be including one or more signal processings and/or special collection It is realized in combination at hardware, software or hardware and software including circuit.
It is now that an example is specifically described with mobile phone 10.As shown in fig. 7, the mobile phone 10 may include memory 11, central processing unit (Central Processing Unit;Hereinafter referred to as:CPU) 12, Peripheral Interface 13, radio frequency (Radio Frequency;Hereinafter referred to as:RF) circuit 14, voicefrequency circuit 15, loud speaker 16, power-supply system 17, input/output (Input Output;Hereinafter referred to as:I/O) subsystem 18, other input/control devicess 19 and outside port 20, these components pass through one A or multiple communication bus or signal wire 21 communicate.
Mobile phone provided in this embodiment is described in detail below.
Memory 11:The memory 11 can be wrapped by the access such as CPU12, Peripheral Interface 13, the memory 11 High-speed random access memory is included, can also include nonvolatile memory, such as one or more disk memories, flash memory Device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of mobile phone 10 can be connected to CPU12 and storage by Peripheral Interface 13, the Peripheral Interface Device 11.
I/O subsystems 18:The I/O subsystems 18 can be by the input/output peripheral on mobile phone 10, such as touch screen 22 With other input/control devicess 19, it is connected to Peripheral Interface 13.I/O subsystems 18 may include display controller 181 and be used for Control one or more input controllers 182 of other input/control devicess 19.Wherein, one or more input controllers 182 Electric signal is received from other input/control devicess 19 or sends electric signal to other input/control devicess 19, other inputs/ Control device 19 may include physical button (such as:Press button or rocker buttons etc.), dial, slide switch, control stick Or click idler wheel.It is worth noting that input controller 182 can with it is following any one connect:Keyboard, infrared port, USB connect The indicating equipment of mouth and such as mouse.
Touch screen 22:The touch screen 22 is the input interface and output interface between mobile phone 10 and user, will be visual defeated Go out to be shown to user, visual output may include figure, text, icon, video etc..
Display controller 181 in I/O subsystems 18 receives electric signal from touch screen 22 or sends electricity to touch screen 22 Signal.Touch screen 22 detects the contact on touch screen, and the contact detected is converted to and including touching by display controller 181 The interaction of user interface object on screen 22, that is, realize human-computer interaction, and being shown in user interface object on touch screen 22 can be with It is the icon of running game, is networked to the icon etc. of corresponding network.It is worth noting that mobile phone 10 can also include light mouse, light Mouse is the extension for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuits 14 are mainly used for establishing the communication of mobile phone 10 and wireless network (i.e. network side), realize mobile phone 10 and nothing The data receiver of gauze network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuits 14 receive and send RF Signal, RF signals are also referred to as electromagnetic signal, and RF circuits 14 convert electrical signals to electromagnetic signal or electromagnetic signal is converted to electricity Signal, and communicated with communication network and other equipment by the electromagnetic signal.RF circuits 14 may include for holding The known circuit of these functions of row comprising but be not limited to antenna system, RF transceivers, one or more amplifier, tuner, One or more oscillators, digital signal processor, coder (Coder Decoder;Hereinafter referred to as:CODEC) chipset, Subscriber Identity Module (Subscriber Identity Module;Hereinafter referred to as:SIM) etc..
Voicefrequency circuit 15 is mainly used for receiving audio data from Peripheral Interface 13, which is converted to electric signal, And the electric signal is sent to loud speaker 16.
Loud speaker 16, the voice signal for receiving mobile phone 10 from wireless network by RF circuits 14, is reduced to sound And play the sound to user.
Power-supply system 17, the hardware for being connected by CPU12, I/O subsystem 18 and Peripheral Interface 13 be powered and Power management.Power-supply system 17 may include power-supply management system, one or more power supplys (such as:Battery or alternating current), then Charging system, power failure detection circuit, power supply changeover device or inverter, power supply status indicator (such as:Light emitting diode), And it generated with the power supply in portable equipment, manage and be distributed other associated any components.
Fig. 8 is the structural schematic diagram of 10 interior section one embodiment of the application mobile phone.In the embodiment of the present application, it stores The software component stored in device 11 may include operating system 1001, communication module 1002, contact/mobile module 1003, figure mould Block 1004, function module 1005.
Operating system 1001 (such as:Darwin, RTXC, LINUX, UNIX, OS X, WINDOWS or such as VxWorks Embedded OS) include for controlling and managing general system task (for example, the control of memory management, storage device, electricity Power management etc.) various software components and/or driver, and convenient for communication between various hardware and software component.
Communication module 1002 is convenient for communicating with other equipment by one or more outside ports 20, and further includes being used for Handle the various software components of the data received by RF circuits 14 and/or outside port 20.
Contact/mobile module 1003 can detect sensitive with touch screen 22 (in conjunction with display controller 181) and other touches The contact of equipment (for example, touch tablet or physics click idler wheel).Contact/mobile module 1003 includes being contacted with detection for executing The various software components of relevant various operations, the operation example is if any determining whether to be in contact, determine whether the contact Have mobile and tracks the movement on touch screen 22 and determine whether the already off contact (i.e., if contact is Through stopping).Determine the movement of contact point can include determining that the rate (amplitude) of contact point, speed (amplitude and direction) and/or Acceleration (variation in amplitude and/or direction).These operations can be applied to single contact (for example, a finger contact) or answer It uses multiple while contacting (for example, " multi-touch "/more fingers contact).In some embodiments, contact/mobile module 1003 The contact on touch tablet is also detected with display controller 181.
Figure module 1004 includes the various known software components for showing figure on touch screen 22, including is used to change Become the component of the shading value of shown figure.Such as the instruction of CPU12 is received, the figure of various softwares is shown in touch screen 22 Shape user interface etc..
Function module 1005 is stored in the program in memory 11 by operation, to perform various functions application and number According to processing, such as realize photo method for cleaning provided by the present application.
RF circuits 14 receive the message that network side or other equipment are sent, which includes Email or short message or i.e. When information, which can be specifically the message in the application Fig. 1~embodiment illustrated in fig. 5.It is understood that RF circuits 14 The message of reception can also be other kinds of message, not limit in the embodiment of the present application.Skilled person will appreciate that The data of numerous types of data can be carried in the message received.Can there was only a kind of data of data type, it can also There are two types of or two or more data types data.
When CPU12 execution stores the program in memory 11, photo method for cleaning provided by the embodiments of the present application is realized. In the above-described embodiments, CPU12 can be specifically Pentium class processor or Itanium processor of Intel company's production etc..
The embodiment of the present application also provides a kind of non-transitorycomputer readable storage medium, the meter in above-mentioned storage medium Calculation machine executable instruction by computer processor when being executed, for executing photo method for cleaning provided by the embodiments of the present application.
Appointing for one or more computer-readable media may be used in above-mentioned non-transitorycomputer readable storage medium Meaning combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.Computer can It reads storage medium and for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device Or device, or the arbitrary above combination.The more specific example (non exhaustive list) of computer readable storage medium includes: Electrical connection, portable computer diskette, hard disk, random access memory (RAM), read-only storage with one or more conducting wires Device (Read Only Memory;Hereinafter referred to as:ROM), erasable programmable read only memory (Erasable Programmable Read Only Memory;Hereinafter referred to as:EPROM) or flash memory, optical fiber, portable compact disc are read-only deposits Reservoir (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer Readable storage medium storing program for executing, which can be any, includes or the tangible medium of storage program, which can be commanded execution system, device Either device use or in connection.
Computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated, Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including --- but It is not limited to --- electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be Any computer-readable medium other than computer readable storage medium, which can send, propagate or Transmission for by instruction execution system, device either device use or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited In --- wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
Can with one or more programming languages or combinations thereof come write for execute the application operation computer Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++, Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion Divide and partly executes or executed on a remote computer or server completely on the remote computer on the user computer. It is related in the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (Local Area Network;Hereinafter referred to as:) or wide area network (Wide Area Network LAN;Hereinafter referred to as:WAN) it is connected to user Computer, or, it may be connected to outer computer (such as being connected by internet using ISP).
The embodiment of the present application also provides a kind of computer program product, when the instruction in above computer program product by When managing device execution, photo method for cleaning provided by the embodiments of the present application is executed.
It should be noted that in the description of the present application, term " first ", " second " etc. are used for description purposes only, without It can be interpreted as indicating or implying relative importance.In addition, in the description of the present application, unless otherwise indicated, the meaning of " multiple " It is two or more.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the application includes other realization, wherein can not press shown or discuss suitable Sequence, include according to involved function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be by the application Embodiment person of ordinary skill in the field understood.
It should be appreciated that each section of the application can be realized with hardware, software, firmware or combination thereof.Above-mentioned In embodiment, software that multiple steps or method can in memory and by suitable instruction execution system be executed with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit application-specific integrated circuit, programmable gate array (Programmable Gate Array;Hereinafter referred to as:PGA), field programmable gate array (Field Programmable Gate Array;Hereinafter referred to as:FPGA) etc..
Those skilled in the art are appreciated that realize all or part of step that above-described embodiment method carries Suddenly it is that relevant hardware can be instructed to complete by program, the program can be stored in a kind of computer-readable storage medium In matter, which includes the steps that one or a combination set of embodiment of the method when being executed.
In addition, each function module in each embodiment of the application can be integrated in a processing module, can also be Modules physically exist alone, can also two or more modules be integrated in a module.Above-mentioned integrated module Both the form that hardware may be used is realized, can also be realized in the form of software function module.If the integrated module It is realized in the form of software function module and when sold or used as an independent product, can also be stored in a computer can It reads in storage medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is contained at least one embodiment or example of the application.In the present specification, schematic expression of the above terms are not Centainly refer to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be any One or more embodiments or example in can be combined in any suitable manner.
Although embodiments herein has been shown and described above, it is to be understood that above-described embodiment is example Property, it should not be understood as the limitation to the application, those skilled in the art within the scope of application can be to above-mentioned Embodiment is changed, changes, replacing and modification.

Claims (13)

1. a kind of photo method for cleaning, which is characterized in that including:
Obtain the photo preserved in user equipment;
The fuzziness scoring, noise scoring and shake scoring for calculating the photo, comment the fuzziness scoring of the photo, noise Divide and shake scoring is weighted averagely, obtains the scoring of the photo;
Scoring gives more than or equal to the photo display of predetermined threshold value and uses the user in the photo that the user equipment is preserved The user of equipment;
Delete the photo that the user selects in the photo of displaying.
2. according to the method described in claim 1, it is characterized in that, the fuzziness scoring for calculating the photo includes:
Gray proces are carried out to the photo, obtain the gray-scale map of the photo;
According to the gray-scale map of the photo, the maximum perpendicular gradient of the photo and the maximum horizontal gradient of the photo are calculated, And calculate the tonal range of the photo;
According to the tonal range of the maximum horizontal gradient and the photo of the maximum perpendicular gradient of the photo and the photo Calculate the fuzziness scoring of the photo.
3. according to the method described in claim 2, it is characterized in that, the gray-scale map according to the photo, calculates the photograph The maximum perpendicular gradient of piece and the maximum horizontal gradient of the photo include:
According to the gray-scale map of the photo, arbitrary two neighboring pixel in the vertical direction of the gray-scale map of the photo is calculated The difference of gray value, to calculate the maximum value in the difference obtained as the maximum perpendicular gradient of the photo;And
According to the gray-scale map of the photo, arbitrary two neighboring pixel in the horizontal direction of the gray-scale map of the photo is calculated The difference of gray value, to calculate the maximum value in the difference obtained as the maximum horizontal gradient of the photo.
4. according to the method described in claim 2, it is characterized in that, the gray-scale map according to the photo, calculates the photograph The tonal range of piece includes:
According to the gray-scale map of the photo, of each gray value corresponding pixel in the gray-scale map of the photo is counted Number;
It is predetermined according to the sequential selection first of gray value from big to small in the number of corresponding pixel is not 0 gray value The gray value of ratio, the corresponding pixel of gray value of gray value and first predetermined ratio to first predetermined ratio Number be weighted average, obtain the maximum value of the gray value of the photo;
It is predetermined according to the sequential selection second of gray value from small to large in the number of corresponding pixel is not 0 gray value The gray value of ratio, the corresponding pixel of gray value of gray value and second predetermined ratio to second predetermined ratio Number be weighted average, obtain the minimum value of the gray value of the photo;
According to the minimum value of the maximum value of the gray value of the photo and the gray value of the photo, calculates and obtain the photo Tonal range.
5. according to the method described in claim 2, it is characterized in that, the maximum perpendicular gradient according to the photo and described The maximum horizontal gradient of photo and the tonal range of the photo calculate the photo fuzziness scoring include:
The fuzziness scoring of the photo is calculated according to following formula:
Wherein, Score is that the fuzziness of the photo scores, and maxHoriGradient is the maximum perpendicular gradient of the photo, MaxVertGraident is the maximum horizontal gradient of the photo, and grayRange is the tonal range of the photo.
6. according to the method described in claim 1, it is characterized in that, the noise scoring for calculating the photo includes:
Processing is carried out to the photo using median filter and generates comparison photo;
The mean square error of the comparison photo and the photo is calculated, the peak value that the photo is calculated according to the mean square error is believed It makes an uproar ratio;
The Y-PSNR of the photo is mapped as to the noise scoring of the photo.
7. according to the method described in claim 1, it is characterized in that, the shake scoring for calculating the photo includes:
The photo is handled using bilateral filtering and impact filtering, generates filtering picture;
Calculate the gradient magnitude image of the gradient magnitude image and the filtering picture of the photo;
Fuzzy core discreet value is calculated according to the gradient magnitude image of the gradient magnitude image of the photo and the filtering picture;
The fuzzy core discreet value is normalized, and calculates the model of the fuzzy core discreet value of normalized acquisition Number, the shake as the photo are scored.
8. according to the method described in claim 1, it is characterized in that, further including:
If the user equipment is progress photo cleaning for the first time, selected in the photo of displaying in the deletion user Photo after, the total of the number of pictures finally cleared up for the first time and the photo preserved in the user equipment is reported to background server Number.
9. according to the method described in claim 8, it is characterized in that, the initial value of the predetermined threshold value is the background server It determines based on experience value;
The sum that the number of pictures finally cleared up for the first time and the photo preserved in the user equipment are reported to background server Later, the end value of the predetermined threshold value is the corresponding threshold value of optimal cleaning effect, and the optimal cleaning effect is described Background server calculates the use according to the sum of the photo preserved in the number of pictures and the user equipment finally cleared up for the first time After the corresponding cleaning effect of family equipment, according to the corresponding cleaning effect of the user equipment to the initial value of the predetermined threshold value It is adjusted acquisition.
10. a kind of photo cleaning plant, which is characterized in that including:
Acquisition module, for obtaining the photo preserved in user equipment;
Computing module, fuzziness scoring, noise scoring and shake scoring for calculating the photo that the acquisition module obtains are right Fuzziness scoring, noise scoring and the shake scoring of the photo are weighted averagely, obtain the scoring of the photo;
Display module, in the photo for preserving the user equipment scoring more than or equal to predetermined threshold value photo display to Use the user of the user equipment;
Removing module, the photo selected in the photo that the display module is shown for deleting the user.
11. a kind of terminal device, which is characterized in that including memory, processor and be stored on the memory and can be in institute The computer program run on processor is stated, when the processor executes the computer program, is realized as in claim 1-9 Any method.
12. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, which is characterized in that the meter The method as described in any in claim 1-9 is realized when calculation machine program is executed by processor.
13. a kind of computer program product, which is characterized in that when the instruction in the computer program product is executed by processor When, execute the method as described in any in claim 1-9.
CN201710707329.5A 2017-08-17 2017-08-17 Photo cleaning method and device and terminal equipment Active CN108460065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710707329.5A CN108460065B (en) 2017-08-17 2017-08-17 Photo cleaning method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710707329.5A CN108460065B (en) 2017-08-17 2017-08-17 Photo cleaning method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN108460065A true CN108460065A (en) 2018-08-28
CN108460065B CN108460065B (en) 2020-10-16

Family

ID=63221010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710707329.5A Active CN108460065B (en) 2017-08-17 2017-08-17 Photo cleaning method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN108460065B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727810A (en) * 2019-10-15 2020-01-24 联想(北京)有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN110795579A (en) * 2019-10-29 2020-02-14 Oppo广东移动通信有限公司 Picture cleaning method and device, terminal and storage medium
CN111480158A (en) * 2018-10-12 2020-07-31 华为技术有限公司 File management method and electronic equipment
CN113360600A (en) * 2021-06-03 2021-09-07 中国科学院计算机网络信息中心 Method and system for screening enterprise performance prediction indexes based on signal attenuation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102509285A (en) * 2011-09-28 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Processing method and system for shot fuzzy picture and shooting equipment
CN104408061A (en) * 2014-10-29 2015-03-11 深圳市中兴移动通信有限公司 Photo album management method and device
US9147262B1 (en) * 2014-08-25 2015-09-29 Xerox Corporation Methods and systems for image processing
CN105512671A (en) * 2015-11-02 2016-04-20 北京蓝数科技有限公司 Picture management method based on blurred picture recognition
CN106155593A (en) * 2016-08-01 2016-11-23 惠州Tcl移动通信有限公司 A kind of method and system deleting photo based on shooting quality

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102509285A (en) * 2011-09-28 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Processing method and system for shot fuzzy picture and shooting equipment
US9147262B1 (en) * 2014-08-25 2015-09-29 Xerox Corporation Methods and systems for image processing
CN104408061A (en) * 2014-10-29 2015-03-11 深圳市中兴移动通信有限公司 Photo album management method and device
CN105512671A (en) * 2015-11-02 2016-04-20 北京蓝数科技有限公司 Picture management method based on blurred picture recognition
CN106155593A (en) * 2016-08-01 2016-11-23 惠州Tcl移动通信有限公司 A kind of method and system deleting photo based on shooting quality

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111480158A (en) * 2018-10-12 2020-07-31 华为技术有限公司 File management method and electronic equipment
CN110727810A (en) * 2019-10-15 2020-01-24 联想(北京)有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN110795579A (en) * 2019-10-29 2020-02-14 Oppo广东移动通信有限公司 Picture cleaning method and device, terminal and storage medium
CN113360600A (en) * 2021-06-03 2021-09-07 中国科学院计算机网络信息中心 Method and system for screening enterprise performance prediction indexes based on signal attenuation

Also Published As

Publication number Publication date
CN108460065B (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN108460065A (en) Photo method for cleaning, device and terminal device
CN107590461B (en) Face recognition method and related product
JP7106687B2 (en) Image generation method and device, electronic device, and storage medium
CN109346061B (en) Audio detection method, device and storage medium
CN107589963B (en) A kind of image processing method, mobile terminal and computer readable storage medium
CN109951595A (en) Intelligence adjusts method, apparatus, storage medium and the mobile terminal of screen intensity
CN108304758A (en) Facial features tracking method and device
CN110109878A (en) Photograph album management method, device, storage medium and electronic equipment
CN108846767B (en) Social group feature acquisition method and device
CN110149517B (en) Video processing method and device, electronic equipment and computer storage medium
CN104281833A (en) Method and device for recognizing pornographic images
CN109582475A (en) A kind of sharing method and terminal
CN108228029A (en) The method for sorting and mobile terminal of a kind of icon
WO2021179856A1 (en) Content recognition method and apparatus, electronic device, and storage medium
CN108053371A (en) A kind of image processing method, terminal and computer readable storage medium
CN107968890A (en) theme setting method, device, terminal device and storage medium
CN110825897A (en) Image screening method and device and mobile terminal
CN108600544A (en) A kind of Single-hand control method and terminal
CN110166696A (en) Image pickup method, device, terminal device and computer readable storage medium
CN107479744A (en) Adjust method, apparatus, terminal and the storage medium of touch-screen dispatching priority
CN110197459B (en) Image stylization generation method and device and electronic equipment
CN108171667A (en) A kind of image processing method, terminal and computer readable storage medium
CN111643901A (en) Method and device for intelligently rendering cloud game interface
CN109684526A (en) A kind of data processing method and mobile terminal
CN109510897A (en) A kind of expression picture management method and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant