WO2017143852A1 - Picture processing method and apparatus, and electronic device - Google Patents

Picture processing method and apparatus, and electronic device Download PDF

Info

Publication number
WO2017143852A1
WO2017143852A1 PCT/CN2016/112258 CN2016112258W WO2017143852A1 WO 2017143852 A1 WO2017143852 A1 WO 2017143852A1 CN 2016112258 W CN2016112258 W CN 2016112258W WO 2017143852 A1 WO2017143852 A1 WO 2017143852A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
pictures
duplicate
attribute value
current reference
Prior art date
Application number
PCT/CN2016/112258
Other languages
French (fr)
Chinese (zh)
Inventor
郭镇龙
Original Assignee
北京金山安全软件有限公司
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 北京金山安全软件有限公司 filed Critical 北京金山安全软件有限公司
Publication of WO2017143852A1 publication Critical patent/WO2017143852A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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
    • 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/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs

Definitions

  • the present application relates to the field of computer application technologies, and in particular, to a picture processing method, apparatus, and electronic device.
  • the method of generating repeated pictures usually includes: in order to achieve the best shooting effect, continuously adjust the angle and adjust the light to shoot the same target object, or, in order to save the storage space of the electronic device, people compress the image through some software, Or, in order to make the picture display ratio harmonious, the user can modify the resolution of the picture through some software.
  • the purpose of the embodiment of the present application is to provide a picture processing method, device, and electronic device to solve the problem of how to organize an album.
  • the specific technical solutions are as follows:
  • a picture processing method is applied to an electronic device, and the method includes:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • the filter obtains multiple sets of duplicate images, including:
  • the first predetermined condition includes: a picture that is not used as a reference picture and is not determined to match other picture features ;
  • the second predetermined condition includes at least not being used as a reference picture and not a picture that is determined to match other picture features
  • the second predetermined condition further includes: the time interval of the shooting time with the current reference picture is within a first preset threshold range.
  • the feature matching process includes:
  • the current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
  • the calculating a picture contrast of each picture in each group of repeated pictures including:
  • & i is the contrast of the picture i
  • a i is the average of the color values of the object object of the picture i
  • b i is the average value of the color values of the background object of the picture i.
  • a picture processing device is applied to an electronic device, the device comprising:
  • a screening module configured to filter, by using a preset image library, a plurality of sets of repeated pictures, wherein each picture feature in each set of repeated pictures matches;
  • a saving module configured to separately save a plurality of sets of duplicate pictures in a plurality of folders, wherein one folder corresponds to a set of duplicate pictures one by one;
  • a calculation module configured to separately calculate a picture contrast of each picture in each group of repeated pictures
  • the processing module is configured to use a picture with the highest contrast of the pictures in each group of repeated pictures as the cover picture of the corresponding folder.
  • the screening module includes:
  • a selecting unit configured to select, from the preset picture library, a picture that meets the first predetermined condition as a current reference picture, where the first predetermined condition includes: not being used as a reference picture and not determined to be other Picture matching the picture;
  • a matching unit configured to perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least a picture that is a reference picture and is not determined to match other picture features;
  • a determining unit configured to determine a current reference picture and the target picture as a duplicate picture if the matching unit has a target picture that matches the current reference picture feature, and return to trigger the selecting unit to execute the preset picture In the library, select an image that meets the first predetermined condition as The steps of the current reference picture.
  • the second predetermined condition further includes:
  • the time interval of the shooting time with the current reference picture is within the first predetermined threshold range.
  • the feature matching process includes:
  • the current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
  • the calculating module is specifically configured to:
  • & i is the contrast of the picture i
  • a i is the average of the color values of the object object of the picture i
  • b i is the average value of the color values of the background object of the picture i.
  • An electronic device comprising:
  • the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power circuit is used for the electronic
  • the memory is for storing executable program code
  • the processor runs the program corresponding to the executable program code by reading executable program code stored in the memory for performing the following steps:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • an embodiment of the present application further provides a storage medium, where the storage medium is used to store executable program code, and the executable program code is executed to execute a picture processing method described in the present application.
  • the image processing method of the present application is applied to an electronic device, and the method includes:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • an embodiment of the present application further provides an application, where the application is used to execute a picture processing method described in the present application at runtime.
  • the image processing method of the present application is applied to an electronic device, and the method includes:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
  • implementing any of the products or methods of the present application necessarily does not necessarily require all of the advantages described above to be achieved at the same time.
  • FIG. 1 is a schematic flowchart diagram of a picture processing method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a picture in a mobile phone album provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a display image of a cover picture of a duplicate picture folder according to an embodiment of the present application
  • FIG. 4( a ) is a schematic diagram of a repeating picture in a mobile phone album provided by an embodiment of the present application
  • FIG. 4(b) is a schematic diagram of viewing a repeated picture according to an embodiment of the present application.
  • FIG. 5 is another schematic flowchart of a picture processing method according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a picture processing apparatus according to an embodiment of the present disclosure.
  • FIG. 7 is another schematic structural diagram of a picture processing apparatus according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the embodiment of the present application provides a picture processing method, device, and electronic device.
  • the electronic device can be a smart phone, a tablet computer, a laptop computer, etc., which is reasonable.
  • the function software that implements a picture processing method provided by the embodiment of the present application may be a plug-in of an existing client software; or the function software may also be an independent client software for implementing picture processing.
  • a method for processing a picture may include:
  • S101 Filter multiple preset images from the preset image library.
  • each picture feature in each set of repeated pictures matches.
  • the preset picture library of the electronic device can also be stored in the preset picture library of other electronic devices, which is reasonable, and thus, there are multiple pictures in the preset picture library of the electronic device, and more There are duplicate pictures in the picture. At this time, the repeated pictures will make the preset picture library of the electronic device appear messy, and the user cannot quickly find the required picture. Therefore, it is necessary to filter the feature matching in the preset picture library. Multiple sets of duplicate pictures.
  • a plurality of sets of duplicate pictures can be selected after receiving the filtering command sent by the user, which is not limited to this one, and is not limited herein.
  • a folder corresponds to a set of duplicate pictures one by one.
  • each set of duplicate pictures filtered is saved to In the corresponding folder, the purpose of arranging the preset picture library is achieved. At this time, each folder has a set of duplicate pictures corresponding to it.
  • S104 The picture with the highest contrast of the pictures in each group of repeated pictures is used as the cover picture of the corresponding folder.
  • the selected picture is the picture with the largest contrast, and the picture is used as the cover picture of the corresponding folder, because the picture works best. It is convenient for users to know the duplicate pictures saved in this folder.
  • a duplicate picture identifier may be displayed in the lower right corner of the cover picture to prompt the user that the folder is a folder that can be opened with duplicate pictures, in the user When you click on a folder corresponding to a group of duplicate images, you can view duplicate images in that folder.
  • multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
  • Fig. 1 The method shown in Fig. 1 will be described in detail below through a specific embodiment.
  • the electronic device is a mobile phone, and there are multiple sets of duplicate photos in the album of the mobile phone.
  • multiple sets of duplicate pictures are filtered out in the album of the mobile phone, and multiple sets of duplicate pictures are saved in their corresponding folders, respectively.
  • Calculate the picture contrast of each picture in each group of repeated pictures and take the picture with the largest picture contrast in each group of repeated pictures as the cover picture of the corresponding folder as shown in Fig. 4(a), and each set of duplicate pictures is saved in the corresponding folder. After the middle, in the lower right corner of the cover image, a corner of the repeated image is shown in the lower right corner of the figure.
  • selecting multiple sets of duplicate pictures from the preset picture library (S101) may include the following steps:
  • S1011 Select, from the preset picture library, a picture that meets the first predetermined condition as the current reference picture.
  • the first predetermined condition may include: a picture that is not a reference picture and is not determined to match other picture features.
  • any picture may be used as a reference picture, and in the preset picture library, a picture that is not used as a reference picture and is not determined to match other picture features is selected as the current reference. image.
  • S1012 Perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition.
  • the second predetermined condition may include at least a picture that is not a reference picture and is not determined to match other picture features.
  • step S102 After filtering out a set of repeated pictures matching the current reference picture feature, if there is still an ungrouped picture in the preset picture library, repeating execution from the preset picture library, selecting one piece that meets the first predetermined condition The picture is used as a step of the current reference picture until all the duplicate pictures in the preset picture library are filtered out. If all the pictures in the preset picture library are grouped, step S102 is performed.
  • the second predetermined condition may further include: the time interval of the shooting time with the current reference picture is within a first preset threshold range.
  • the current reference picture and the pre-preview can be Setting a picture in the picture library other than the current reference picture that is not determined as a reference picture and is not determined to match other picture features and the time interval of the current reference picture is within a first preset threshold range Match processing.
  • the feature matching process may include:
  • the current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
  • the picture is composed of an object object and a background object, wherein the background object is the overall background of the picture when the picture is taken, the object object is the main content of the picture other than the background object, and therefore, the common point of the repeated picture can be adopted It is determined whether the object object and the background object of the picture are similar, that is, whether the shape of the pixel dense area is similar to identify a duplicate picture. Based on this processing idea, The object object and the background object in the picture may be segmented according to the gray value for each picture in the first picture and the second picture to be determined.
  • the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture may be:
  • the second object object and the second background object in the second picture are segmented according to the second dividing line.
  • the pixel calculates the pixel attribute value of the second object object, and calculates the pixel attribute value of the second background object according to the pixel point included in the second background object, which may include:
  • the color value is the feature information of the pixel point, and therefore, whether the picture content is similar can be determined based on the color value of the pixel point.
  • the average value of the color value of the object object and the average value of the color value of the background object may be calculated.
  • the color value of the pixel is the color value of the pixel, and the specific color values under different color models are different.
  • the color value of one pixel under the red, green and blue RGB color model It is a collection of three aspects of red, green and blue. Under the HSV color model, the color values of one pixel are: a set of three phases: hue, saturation and color brightness.
  • Determining whether the first picture and the second picture are mutually duplicate images according to the pixel attribute value of the first object object, the pixel attribute value of the first background object, the pixel attribute value of the second object object, and the pixel attribute value of the second background object Can include:
  • Determining whether the first type of mathematical operation value and the second type of mathematical operation value meet the preset condition if yes, determining that the first picture and the second picture are mutually repeated pictures; otherwise, determining that the first picture and the second picture are not mutually overlapping image.
  • the calculating the first type of mathematical operation value between the pixel attribute value of the first object object and the pixel attribute value of the second object object may include:
  • Determining whether the first type of mathematical operation value and the second type of mathematical operation value meet the preset condition may include:
  • calculating the first type of mathematical operation value between the pixel attribute value of the first object object and the pixel attribute value of the second object object may include:
  • Determining whether the first type of mathematical operation value and the second type of mathematical operation value meet the preset condition may include:
  • calculating the picture contrast of each picture in each group of repeated pictures may include:
  • & i is the contrast of the picture i
  • a i is the average of the color values of the object object of the picture i
  • b i is the average value of the color values of the background object of the picture i.
  • the color value of the pixel is the color value of the pixel
  • the specific color values under different color models are different, for example: red, green and blue RGB color model, red is 255, 0, 0; green 0, 255, 0,; blue is 0, 0, 255, the color value of one pixel is: red, green and blue.
  • the object object includes 3 pixel points A, B, and C, the pixel point A is black, the pixel point B is gray, and the pixel point C is red, wherein the color value of black is 0, 0, 0; the gray is 128, 128, 128; The red is 255, 0, 0, and the average of the sum of the color values of all the pixels of the object object is That is 128, 43, 43.
  • the average value of the sum of the color values of more than half of the pixel points can represent the average value of the color value of the object object or the background object, and at this time, the object can be calculated.
  • the average value of the sum of the color values of the preset number of pixels of the object, and the average value is used as the average value of the color values of the object object, and the average value of the sum of the color values of the preset number of pixel points of the background object is calculated. This average is used as the average of the color values of the background objects, which is reasonable.
  • the object object and the background object in the picture are segmented according to the gray value, and the average value of the color value of the object object of the picture and the average value of the color value of the background object are calculated.
  • the contrast of the picture is calculated.
  • the embodiment of the present application further provides a picture processing device, which should for an electronic device, as shown in FIG. 6, the device may include:
  • the screening module 601 is configured to filter, by using a preset picture library, multiple sets of duplicate pictures, where each picture feature in each set of repeated pictures matches;
  • a saving module 602 configured to separately save a plurality of sets of duplicate pictures in a plurality of folders, wherein one folder corresponds to a set of repeated pictures one by one;
  • a calculating module 603, configured to separately calculate a picture contrast of each picture in each group of repeated pictures
  • the processing module 604 is configured to use a picture with the largest picture contrast in each group of repeated pictures as a cover picture of the corresponding folder.
  • multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
  • the calculating module 603 can be specifically configured to:
  • ⁇ i 2 ⁇ a i - b i
  • ⁇ i is the contrast of the picture i
  • a i is the average value of the color values of the object object of the picture i
  • b i is the average value of the color values of the background object of the picture i.
  • the image processing device provided by the present application is applied to an electronic device, and the device may include:
  • the selecting unit 701 is configured to select, from the preset picture library, a picture that meets the first predetermined condition as the current reference picture, where the first predetermined condition includes: not being used as a reference picture and not determined to be Other pictures with matching image characteristics;
  • the matching unit 702 is configured to perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least a picture that is used as a reference picture and is not determined to match other picture features;
  • the determining unit 703 is configured to determine the current reference picture and the target picture as a duplicate picture in the case that the matching unit has a target picture that matches the current reference picture feature, and return to trigger the selection unit 701.
  • the saving module 704 is configured to save the plurality of sets of duplicate pictures in the folder, wherein the folder has a one-to-one correspondence with the repeated pictures;
  • a calculating module 705, configured to separately calculate a picture contrast of each picture in each group of repeated pictures
  • the processing module 706 is configured to use a picture with the largest picture contrast in each group of repeated pictures as a cover picture of the corresponding folder.
  • the second predetermined condition may further include: the time interval of the shooting time with the current reference picture is within a first preset threshold range.
  • the feature matching process may include:
  • the current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
  • the embodiment of the present application further provides an electronic device, where the electronic device may include:
  • the circuit board 804 is disposed inside a space enclosed by the housing, the processor 802 and the memory 803 are disposed on the circuit board 804; and the power supply circuit 805
  • the memory 803 is for storing executable program code
  • the processor 802 is configured to execute a program corresponding to the executable program code by reading the executable program code stored in the memory 803 Used to perform the following steps:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
  • the embodiment of the present application further provides a storage medium, where the storage medium is used to store executable program code, and the executable program code is executed to execute a picture processing method described in the present application.
  • the image processing method of the present application is applied to an electronic device, and the method may include:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and maps the contrast of the pictures in each group of repeated pictures.
  • the slice is used as the cover image of the corresponding folder, which is convenient for the user to quickly locate the required repeated pictures and view the repeated pictures to improve the user experience.
  • the embodiment of the present application further provides an application, where the application is used to execute a picture processing method described in the present application at runtime.
  • the image processing method of the present application is applied to an electronic device, and the method may include:
  • a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
  • the picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  • multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
  • the disclosed apparatus may be implemented in other ways.
  • the device embodiments described above are schematic, for example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Abstract

Embodiments of the present application provide a picture processing method and apparatus, and an electronic device. The method comprises: screening multiple groups of duplicate pictures out of a preset picture library, wherein the characteristics of pictures in each group of duplicate pictures match; respectively saving the multiple groups of duplicate pictures in multiple folders, wherein one folder has one-to-one correspondence to a group of duplicate pictures; separately calculating the picture contrast of each picture in each group of duplicate pictures; and using the picture having a maximum picture contrast in each group of duplicate pictures as the cover picture of a corresponding folder. In the embodiments of the present application, multiple groups of duplicate pictures are obtained by means of characteristic matching and screening, and are saved in folders, so that the problem of managing an album is solved; a picture having a maximum picture contrast in each group of duplicate pictures is used as the cover picture of a corresponding folder, making it convenient for a user to fast locate a required duplicate picture and view the duplicate picture, thereby improving user experience.

Description

一种图片处理方法、装置及电子设备Image processing method, device and electronic device
本申请要求于2016年2月26日提交中国专利局、申请号为201610108433.8发明名称为“一种图片处理方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610108433.8, entitled "A Picture Processing Method, Apparatus, and Electronic Apparatus", filed on February 26, 2016, the entire contents of which is incorporated herein by reference. In the application.
技术领域Technical field
本申请涉及计算机应用技术领域,特别是涉及一种图片处理方法、装置及电子设备。The present application relates to the field of computer application technologies, and in particular, to a picture processing method, apparatus, and electronic device.
背景技术Background technique
随着科学技术的发展,人们拍照越来越多,导致相册中包括有大量的图片。而在相册中,可能存在较多的重复图片,所谓重复图片为:用户在视觉上不能轻易分辨出图片区别的图片。其中,产生重复图片的方式通常包括:为了达到最好的拍摄效果,不断调节角度和调节光线来拍摄同一目标对象,或者,为了节省电子设备的存储空间,人们通过某种软件对图片压缩处理,或者,为了使图片显示比例和谐,用户可以通过某种软件对图片的分辨率进行修改。With the development of science and technology, people are taking more and more photos, resulting in a large number of pictures in the album. In the album, there may be more duplicate pictures. The so-called duplicate picture is: the picture that the user cannot visually distinguish the picture difference. Among them, the method of generating repeated pictures usually includes: in order to achieve the best shooting effect, continuously adjust the angle and adjust the light to shoot the same target object, or, in order to save the storage space of the electronic device, people compress the image through some software, Or, in order to make the picture display ratio harmonious, the user can modify the resolution of the picture through some software.
而对于相册中的重复图片,往往人们并没有这么多的时间去整理,重复图片使相册显得杂乱,同时使人们无法迅速查找到需要的图片。可见,如何自动整理相册,是一个亟待解决的问题。For the repeated pictures in the album, people often do not have so much time to organize, repeating the pictures makes the album appear messy, and at the same time makes people unable to quickly find the desired picture. It can be seen that how to automatically organize albums is an urgent problem to be solved.
发明内容Summary of the invention
本申请实施例的目的在于提供一种图片处理方法、装置及电子设备,以解决如何整理相册的问题。具体技术方案如下:The purpose of the embodiment of the present application is to provide a picture processing method, device, and electronic device to solve the problem of how to organize an album. The specific technical solutions are as follows:
一种图片处理方法,应用于电子设备,所述方法包括:A picture processing method is applied to an electronic device, and the method includes:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应; Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
可选的,从预设图片库中,筛选得到多组重复图片,包括:Optionally, from the preset image library, the filter obtains multiple sets of duplicate images, including:
从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片,其中,所述第一预定条件包括:未被作为参考图片且未被确定为与其他图片特征匹配的图片;Selecting, from the preset picture library, a picture that meets the first predetermined condition as a current reference picture, where the first predetermined condition includes: a picture that is not used as a reference picture and is not determined to match other picture features ;
将当前的参考图片与所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片进行特征匹配处理;其中,所述第二预定条件至少包括未被作为参考图片且未被确定为与其他图片特征匹配的图片;Performing feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least not being used as a reference picture and not a picture that is determined to match other picture features;
如果存在与当前的参考图片特征匹配的目标图片,将当前的参考图片与所述目标图片确定为重复图片,并返回执行从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片的步骤。If there is a target picture that matches the current reference picture feature, determining the current reference picture and the target picture as a duplicate picture, and returning to execute from the preset picture library, selecting a picture that meets the first predetermined condition as the current The steps of the reference picture.
可选的,所述第二预定条件还包括:与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内。Optionally, the second predetermined condition further includes: the time interval of the shooting time with the current reference picture is within a first preset threshold range.
可选的,所述特征匹配处理,包括:Optionally, the feature matching process includes:
将当前的参考图片作为第一图片,将所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片作为第二图片;The current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
根据灰度值分割出所述第一图片对应的第一物体对象和第一背景对象,以及所述第二图片对应的第二物体对象和第二背景对象;And dividing, according to the gray value, the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture;
根据所述第一物体对象所包含的像素点计算所述第一物体对象的像素属性值,以及,根据所述第一背景对象所包含的像素点计算所述第一背景对象的像素属性值,根据所述第二物体对象所包含的像素点计算所述第二物体对象的像素属性值,根据所述第二背景对象所包含的像素点计算所述第二背景对象的像素属性值;Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, Calculating a pixel attribute value of the second object object according to the pixel point included in the second object object, and calculating a pixel attribute value of the second background object according to the pixel point included in the second background object;
根据所述第一物体对象的像素属性值、所述第一背景对象的像素属性值、所述第二物体对象的像素属性值和所述第二背景对象的像素属性值,确定所述第一图片和所述第二图片是否互为重复图片,如果是,则确定所述第一图 片与所述第二图片特征匹配,如果否,则确定所述第一图片与所述第二图片特征不匹配。Determining the first according to a pixel attribute value of the first object object, a pixel attribute value of the first background object, a pixel attribute value of the second object object, and a pixel attribute value of the second background object Whether the picture and the second picture are mutually repeated pictures, and if so, determining the first picture The slice matches the second picture feature, and if not, it is determined that the first picture does not match the second picture feature.
可选的,所述分别计算各组重复图片中每一图片的图片对比度,包括:Optionally, the calculating a picture contrast of each picture in each group of repeated pictures, including:
针对各组重复图片中的每一图片,根据如下公式计算该图片的对比度:For each picture in each group of repeated pictures, calculate the contrast of the picture according to the following formula:
&i=2×ai-bi & i =2×a i -b i
其中,&i为图片i的对比度,ai为图片i的物体对象的色值平均值,bi为图片i的背景对象的色值平均值。Where & i is the contrast of the picture i, a i is the average of the color values of the object object of the picture i, and b i is the average value of the color values of the background object of the picture i.
一种图片处理装置,应用于电子设备,所述装置包括:A picture processing device is applied to an electronic device, the device comprising:
筛选模块,用于从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;a screening module, configured to filter, by using a preset image library, a plurality of sets of repeated pictures, wherein each picture feature in each set of repeated pictures matches;
保存模块,用于分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;a saving module, configured to separately save a plurality of sets of duplicate pictures in a plurality of folders, wherein one folder corresponds to a set of duplicate pictures one by one;
计算模块,用于分别计算各组重复图片中每一图片的图片对比度;a calculation module, configured to separately calculate a picture contrast of each picture in each group of repeated pictures;
处理模块,用于将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The processing module is configured to use a picture with the highest contrast of the pictures in each group of repeated pictures as the cover picture of the corresponding folder.
可选的,所述筛选模块,包括:Optionally, the screening module includes:
选择单元,用于从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片,其中,所述第一预定条件包括:未被作为参考图片且未被确定为与其他图片特征匹配的图片;a selecting unit, configured to select, from the preset picture library, a picture that meets the first predetermined condition as a current reference picture, where the first predetermined condition includes: not being used as a reference picture and not determined to be other Picture matching the picture;
匹配单元,用于将当前的参考图片与所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片进行特征匹配处理;其中,所述第二预定条件至少包括未被作为参考图片且未被确定为与其他图片特征匹配的图片;a matching unit, configured to perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least a picture that is a reference picture and is not determined to match other picture features;
确定单元,用于在匹配单元存在与当前的参考图片特征匹配的目标图片的情况下,将当前的参考图片与所述目标图片确定为重复图片,并返回触发所述选择单元执行从预设图片库中,选择符合第一预定条件的一张图片作为 当前的参考图片的步骤。a determining unit, configured to determine a current reference picture and the target picture as a duplicate picture if the matching unit has a target picture that matches the current reference picture feature, and return to trigger the selecting unit to execute the preset picture In the library, select an image that meets the first predetermined condition as The steps of the current reference picture.
可选的,所述第二预定条件还包括:Optionally, the second predetermined condition further includes:
与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内。The time interval of the shooting time with the current reference picture is within the first predetermined threshold range.
可选的,所述特征匹配处理,包括:Optionally, the feature matching process includes:
将当前的参考图片作为第一图片,将所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片作为第二图片;The current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
根据灰度值分割出所述第一图片对应的第一物体对象和第一背景对象,以及所述第二图片对应的第二物体对象和第二背景对象;And dividing, according to the gray value, the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture;
根据所述第一物体对象所包含的像素点计算所述第一物体对象的像素属性值,以及,根据所述第一背景对象所包含的像素点计算所述第一背景对象的像素属性值,根据所述第二物体对象所包含的像素点计算所述第二物体对象的像素属性值,根据所述第二背景对象所包含的像素点计算所述第二背景对象的像素属性值;Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, Calculating a pixel attribute value of the second object object according to the pixel point included in the second object object, and calculating a pixel attribute value of the second background object according to the pixel point included in the second background object;
根据所述第一物体对象的像素属性值、所述第一背景对象的像素属性值、所述第二物体对象的像素属性值和所述第二背景对象的像素属性值,确定所述第一图片和所述第二图片是否互为重复图片,如果是,则确定所述第一图片与所述第二图片特征匹配,如果否,则确定所述第一图片与所述第二图片特征不匹配。Determining the first according to a pixel attribute value of the first object object, a pixel attribute value of the first background object, a pixel attribute value of the second object object, and a pixel attribute value of the second background object Whether the picture and the second picture are mutually repeated pictures, if yes, determining that the first picture matches the second picture feature, and if not, determining that the first picture and the second picture feature are not match.
可选的,所述计算模块,具体用于:Optionally, the calculating module is specifically configured to:
针对各组重复图片中的每一图片,根据如下公式计算该图片的对比度:For each picture in each group of repeated pictures, calculate the contrast of the picture according to the following formula:
&i=2×ai-bi & i =2×a i -b i
其中,&i为图片i的对比度,ai为图片i的物体对象的色值平均值,bi为图片i的背景对象的色值平均值。Where & i is the contrast of the picture i, a i is the average of the color values of the object object of the picture i, and b i is the average value of the color values of the background object of the picture i.
一种电子设备,所述电子设备包括:An electronic device, the electronic device comprising:
壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子 设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power circuit is used for the electronic The various circuits or devices of the device are powered; the memory is for storing executable program code; the processor runs the program corresponding to the executable program code by reading executable program code stored in the memory for performing the following steps:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
为达到上述目的,本申请实施例还提供了一种存储介质,其中,该存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行本申请所述的一种图片处理方法。其中,本申请所述的一种图片处理方法,应用于电子设备,该方法包括:To achieve the above objective, an embodiment of the present application further provides a storage medium, where the storage medium is used to store executable program code, and the executable program code is executed to execute a picture processing method described in the present application. . The image processing method of the present application is applied to an electronic device, and the method includes:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
为达到上述目的,本申请实施例还提供了一种应用程序,其中,该应用程序用于在运行时执行本申请所述的一种图片处理方法。其中,本申请所述的一种图片处理方法,应用于电子设备,该方法包括:To achieve the above objective, an embodiment of the present application further provides an application, where the application is used to execute a picture processing method described in the present application at runtime. The image processing method of the present application is applied to an electronic device, and the method includes:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应; Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
本申请实施例中,通过特征匹配筛选得到多组重复图片并保存于多个文件夹中,解决了整理相册的问题,并将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片,方便用户快速定位所需的重复图片并查看重复图片,提高用户体验。当然,实施本申请的任一产品或方法必不一定需要同时达到以上所述的所有优点。In the embodiment of the present application, multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience. Of course, implementing any of the products or methods of the present application necessarily does not necessarily require all of the advantages described above to be achieved at the same time.
附图说明DRAWINGS
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application and the technical solutions of the prior art, the following description of the embodiments and the drawings used in the prior art will be briefly introduced. Obviously, the drawings in the following description are only Some embodiments of the application may also be used to obtain other figures from those of ordinary skill in the art without departing from the scope of the invention.
图1为本申请实施例提供的一种图片处理方法的流程示意图;FIG. 1 is a schematic flowchart diagram of a picture processing method according to an embodiment of the present application;
图2为本申请实施例提供的手机相册内图片的示意图;2 is a schematic diagram of a picture in a mobile phone album provided by an embodiment of the present application;
图3为本申请实施例提供的重复图片文件夹封面图片显示角标的示意图;FIG. 3 is a schematic diagram of a display image of a cover picture of a duplicate picture folder according to an embodiment of the present application; FIG.
图4(a)为本申请实施例提供的整理手机相册内重复图片后的示意图;FIG. 4( a ) is a schematic diagram of a repeating picture in a mobile phone album provided by an embodiment of the present application;
图4(b)为本申请实施例提供的查看重复图片的示意图;FIG. 4(b) is a schematic diagram of viewing a repeated picture according to an embodiment of the present application;
图5为本申请实施例提供的一种图片处理方法的另一流程示意图;FIG. 5 is another schematic flowchart of a picture processing method according to an embodiment of the present application;
图6为本申请实施例提供的一种图片处理装置的结构示意图;FIG. 6 is a schematic structural diagram of a picture processing apparatus according to an embodiment of the present disclosure;
图7为本申请实施例提供的一种图片处理装置的另一结构示意图;FIG. 7 is another schematic structural diagram of a picture processing apparatus according to an embodiment of the present disclosure;
图8为本申请实施例提供的一种电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通 技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings. It is apparent that the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments in the present application, common in the art All other embodiments obtained by the skilled person without creative efforts are within the scope of the present application.
为了解决现有技术问题,本申请实施例提供了一种图片处理方法、装置及电子设备。In order to solve the prior art problem, the embodiment of the present application provides a picture processing method, device, and electronic device.
下面首先对本申请实施例所提供的一种图片处理方法进行介绍。The following is a description of a picture processing method provided by the embodiment of the present application.
需要说明的是,本申请实施例所提供的一种图片处理方法应用于电子设备。在实际应用中,该电子设备可以为智能手机、平板电脑、笔记本电脑等,这都是合理的。It should be noted that a picture processing method provided by an embodiment of the present application is applied to an electronic device. In practical applications, the electronic device can be a smart phone, a tablet computer, a laptop computer, etc., which is reasonable.
另外,实现本申请实施例所提供的一种图片处理方法的功能软件可以为现有的客户端软件的插件;或者,该功能软件也可以为独立的用于实现图片处理的客户端软件。In addition, the function software that implements a picture processing method provided by the embodiment of the present application may be a plug-in of an existing client software; or the function software may also be an independent client software for implementing picture processing.
如图1所示,本申请实施例提供的一种图片处理方法,应用于电子设备,可以包括:As shown in FIG. 1 , a method for processing a picture, which is applied to an electronic device, may include:
S101:从预设图片库中,筛选得到多组重复图片。S101: Filter multiple preset images from the preset image library.
其中,每组重复图片中各个图片特征匹配。Among them, each picture feature in each set of repeated pictures matches.
为了达到最好的拍照效果,人们会不断调节角度或调节光线,然后重复拍摄图片,而目前的电子设备均提供较大的存储空间,所以用户在拍摄图片后会直接将图片存储到拍摄照片所用的电子设备的预设图片库中,也可以存储到其它电子设备的预设图片库中,这都是合理的,由此,电子设备的预设图片库中会存在多张图片,而在多张图片中存在重复的图片,此时,重复的图片会使电子设备的预设图片库显得杂乱,且使用户无法迅速找到需要的图片,因此,需要在预设图片库中筛选出特征匹配的多组重复图片。In order to achieve the best photo effect, people will constantly adjust the angle or adjust the light, and then repeat the picture, while the current electronic devices provide a large storage space, so the user will directly store the picture to the photo when the picture is taken. The preset picture library of the electronic device can also be stored in the preset picture library of other electronic devices, which is reasonable, and thus, there are multiple pictures in the preset picture library of the electronic device, and more There are duplicate pictures in the picture. At this time, the repeated pictures will make the preset picture library of the electronic device appear messy, and the user cannot quickly find the required picture. Therefore, it is necessary to filter the feature matching in the preset picture library. Multiple sets of duplicate pictures.
可以理解的是,可以通过接收用户发出的筛选指令后,筛选出多组重复图片,当然并不只限于此一种方式,在此不做限定。It can be understood that a plurality of sets of duplicate pictures can be selected after receiving the filtering command sent by the user, which is not limited to this one, and is not limited herein.
S102:分别将多组重复图片保存于多个文件夹中。S102: Save multiple sets of duplicate pictures in multiple folders respectively.
其中,一个文件夹与一组重复图片一一对应。Among them, a folder corresponds to a set of duplicate pictures one by one.
由于筛选出的重复图片有多组,所以将筛选出的每一组重复图片保存到 与其对应的文件夹中,达到整理预设图片库的目的,此时,每个文件夹中保存有一组与其唯一对应的重复图片。Since there are multiple groups of duplicate pictures filtered, each set of duplicate pictures filtered is saved to In the corresponding folder, the purpose of arranging the preset picture library is achieved. At this time, each folder has a set of duplicate pictures corresponding to it.
S103:分别计算各组重复图片中每一图片的图片对比度。S103: Calculate the picture contrast of each picture in each group of repeated pictures.
由于每个文件夹均无封面图片,而整理后的文件夹有多个,用户无法分辨每个文件夹中所保存的重复图片,为了达到整理预设图片库且使用户可以快速找到需要的图片的目的,将每组重复图片放置到其对应的文件夹后,分别计算每组重复图片中每一图片的图片对比度,并根据计算出的图片对比度,选择出一张图片,将该图片作为相应文件夹的封面图片。Since there is no cover image for each folder, and there are multiple folders after finishing, the user cannot distinguish the duplicate images saved in each folder, in order to organize the preset image library and enable the user to quickly find the desired image. For the purpose of placing each set of duplicate pictures into their corresponding folders, respectively calculating the picture contrast of each picture in each set of repeated pictures, and selecting a picture according to the calculated picture contrast, the picture is corresponding The cover image of the folder.
S104:将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。S104: The picture with the highest contrast of the pictures in each group of repeated pictures is used as the cover picture of the corresponding folder.
由于图片对比度越大,图片的效果越好,所以在各组重复图片中,选择出的一张图片为对比度最大的图片,将该图片作为相应文件夹的封面图片,由于此图片的效果最好,可以方便用户获知该文件夹中所保存的重复图片。Since the contrast of the picture is larger, the effect of the picture is better. Therefore, in each group of repeated pictures, the selected picture is the picture with the largest contrast, and the picture is used as the cover picture of the corresponding folder, because the picture works best. It is convenient for users to know the duplicate pictures saved in this folder.
进一步的,在每组重复图片保存于对应的文件夹中后,可以在封面图片的右下角显示一个重复图片的标识,以提示用户该文件夹为可以打开的包含重复图片的文件夹,在用户点击某组重复图片对应的文件夹时,可以查看该文件夹内的重复图片。Further, after each set of duplicate pictures is saved in the corresponding folder, a duplicate picture identifier may be displayed in the lower right corner of the cover picture to prompt the user that the folder is a folder that can be opened with duplicate pictures, in the user When you click on a folder corresponding to a group of duplicate images, you can view duplicate images in that folder.
本申请实施例中,通过特征匹配筛选得到多组重复图片并保存于多个文件夹中,解决了整理相册的问题,并将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片,方便用户快速定位所需的重复图片并查看重复图片,提高用户体验。In the embodiment of the present application, multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
下面通过一具体实施例对图1所示方法进行详细说明。The method shown in Fig. 1 will be described in detail below through a specific embodiment.
例如:电子设备为手机,手机的相册中存在多组重复照片如图2所示,在手机的相册中筛选出多组重复图片,分别将多组重复图片保存于其对应的文件夹中,分别计算各组重复图片中每一图片的图片对比度,将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片如图4(a)所示,每组重复图片保存于对应的文件夹中后,在封面图片的右下角显示一个重复图片的角标如图3右下角图标所示,在用户点击某组重复图片对应的文件夹时,可以查 看该文件夹内的重复图片如图4(b)所示,其中,4(b)给出了三张重复图片。For example, the electronic device is a mobile phone, and there are multiple sets of duplicate photos in the album of the mobile phone. As shown in FIG. 2, multiple sets of duplicate pictures are filtered out in the album of the mobile phone, and multiple sets of duplicate pictures are saved in their corresponding folders, respectively. Calculate the picture contrast of each picture in each group of repeated pictures, and take the picture with the largest picture contrast in each group of repeated pictures as the cover picture of the corresponding folder as shown in Fig. 4(a), and each set of duplicate pictures is saved in the corresponding folder. After the middle, in the lower right corner of the cover image, a corner of the repeated image is shown in the lower right corner of the figure. When the user clicks on a folder corresponding to a group of duplicate images, you can check Look at the duplicate pictures in this folder as shown in Figure 4(b), where 4(b) gives three duplicate pictures.
可以理解的是,从预设图片库中筛选得到多组重复图片的实现方式存在多种,下面进行举例介绍。It can be understood that there are various implementation methods for filtering multiple sets of duplicate pictures from the preset picture library, and an example is introduced below.
如图5所示,在一种实现方式中,从预设图片库中筛选得到多组重复图片(S101),可以包括如下步骤:As shown in FIG. 5, in an implementation manner, selecting multiple sets of duplicate pictures from the preset picture library (S101) may include the following steps:
S1011:从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片。S1011: Select, from the preset picture library, a picture that meets the first predetermined condition as the current reference picture.
其中,该第一预定条件可以包括:未被作为参考图片且未被确定为与其他图片特征匹配的图片。The first predetermined condition may include: a picture that is not a reference picture and is not determined to match other picture features.
在电子设备中的预设图片库中,任意一张图片均可作为参考图片,在预设图片库中,选择未被作为参考图片且未被确定为与其他图片特征匹配的图片作为当前的参考图片。In a preset picture library in the electronic device, any picture may be used as a reference picture, and in the preset picture library, a picture that is not used as a reference picture and is not determined to match other picture features is selected as the current reference. image.
S1012:将当前的参考图片与该预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片进行特征匹配处理。S1012: Perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition.
其中,该第二预定条件至少可以包括未被作为参考图片且未被确定为与其他图片特征匹配的图片。The second predetermined condition may include at least a picture that is not a reference picture and is not determined to match other picture features.
将当前的参考图片与该预设图片库中未分组的图片进行特征匹配,以确定与当前参考图片互为重复图片的图片。Matching the current reference picture with the ungrouped picture in the preset picture library to determine a picture that is a duplicate picture with the current reference picture.
S1013:如果存在与当前的参考图片特征匹配的目标图片,将当前的参考图片与该目标图片确定为重复图片,并判断预设图片库是否被处理完毕,如果是,执行S102,否则返回S1011。S1013: If there is a target picture that matches the current reference picture feature, the current reference picture and the target picture are determined as duplicate pictures, and it is determined whether the preset picture library is processed. If yes, execute S102; otherwise, return to S1011.
当筛选出与当前的参考图片特征匹配的一组重复图片后,如果该预设图片库中仍存在未分组的图片,则重复执行从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片的步骤,直至将预设图片库中的重复图片均筛选出来为止,如果该预设图片库中的所有图片均已分组,则执行步骤S102。 After filtering out a set of repeated pictures matching the current reference picture feature, if there is still an ungrouped picture in the preset picture library, repeating execution from the preset picture library, selecting one piece that meets the first predetermined condition The picture is used as a step of the current reference picture until all the duplicate pictures in the preset picture library are filtered out. If all the pictures in the preset picture library are grouped, step S102 is performed.
更进一步的,所述第二预定条件还可以包括:与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内。Further, the second predetermined condition may further include: the time interval of the shooting time with the current reference picture is within a first preset threshold range.
由于为了达到最好的拍照效果,人们会不断调节角度或调节光线,然后在相邻时间内重复拍摄图片,因此,重复图片的拍摄时间一般较近,因此,可以将当前的参考图片与该预设图片库中除当前的参考图片以外的未被作为参考图片且未被确定为与其他图片特征匹配且与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内的图片进行特征匹配处理。In order to achieve the best photo effect, people will constantly adjust the angle or adjust the light, and then repeat the picture in the adjacent time. Therefore, the repeated picture shooting time is generally close, so the current reference picture and the pre-preview can be Setting a picture in the picture library other than the current reference picture that is not determined as a reference picture and is not determined to match other picture features and the time interval of the current reference picture is within a first preset threshold range Match processing.
更进一步的,特征匹配处理的具体实现方式可以存在多种,下面举例介绍。Further, there may be multiple implementations of the feature matching process, which are described below.
在一种实现方式中,该特征匹配处理,可以包括:In an implementation manner, the feature matching process may include:
将当前的参考图片作为第一图片,将该预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片作为第二图片;The current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
根据灰度值分割出所述第一图片对应的第一物体对象和第一背景对象,以及所述第二图片对应的第二物体对象和第二背景对象;And dividing, according to the gray value, the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture;
根据所述第一物体对象所包含的像素点计算所述第一物体对象的像素属性值,以及,根据所述第一背景对象所包含的像素点计算所述第一背景对象的像素属性值,根据所述第二物体对象所包含的像素点计算所述第二物体对象的像素属性值,根据所述第二背景对象所包含的像素点计算所述第二背景对象的像素属性值;Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, Calculating a pixel attribute value of the second object object according to the pixel point included in the second object object, and calculating a pixel attribute value of the second background object according to the pixel point included in the second background object;
根据所述第一物体对象的像素属性值、所述第一背景对象的像素属性值、所述第二物体对象的像素属性值和所述第二背景对象的像素属性值,确定所述第一图片和所述第二图片是否互为重复图片,如果是,则确定该第一图片与该第二图片特征匹配,如果否,则确定该第一图片与该第二图片特征不匹配。Determining the first according to a pixel attribute value of the first object object, a pixel attribute value of the first background object, a pixel attribute value of the second object object, and a pixel attribute value of the second background object Whether the picture and the second picture are mutually repeated pictures, and if so, determining that the first picture matches the second picture feature, and if not, determining that the first picture does not match the second picture feature.
由于图片由物体对象及背景对象组成,其中,背景对象即为拍摄图片时的图片的整体背景,物体对象即为除背景对象外的图片的主体内容,因此,结合重复图片的共同点,可以通过判断图片的物体对象和背景对象是否均相似,也就是像素密集区域形状是否相似来识别重复图片。基于该处理思想, 可以针对待判断的第一图片和第二图片中的每张图片,根据灰度值分割出该图片中的物体对象和背景对象。Since the picture is composed of an object object and a background object, wherein the background object is the overall background of the picture when the picture is taken, the object object is the main content of the picture other than the background object, and therefore, the common point of the repeated picture can be adopted It is determined whether the object object and the background object of the picture are similar, that is, whether the shape of the pixel dense area is similar to identify a duplicate picture. Based on this processing idea, The object object and the background object in the picture may be segmented according to the gray value for each picture in the first picture and the second picture to be determined.
其中,根据灰度值分割出第一图片对应的第一物体对象和第一背景对象,以及第二图片对应的第二物体对象和第二背景对象,可以包括:The first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture may be:
计算第一图片中的每相邻两个像素点的灰度值的差,如果相邻两个像素点的灰度值的差大于第二预设阈值,则确定该两个像素点为第一图片的物体对象和背景对象的分割点;Calculating a difference of gray value values of each adjacent two pixel points in the first picture, if the difference of the gray value values of the adjacent two pixel points is greater than a second preset threshold, determining that the two pixel points are the first The segmentation point of the object object and the background object of the image;
将多个第一图片的物体对象和背景对象的分割点组成为第一分割线;Forming the object points of the plurality of first pictures and the segmentation points of the background object into a first dividing line;
根据第一分割线分割出第一图片中的第一物体对象和第一背景对象;Splitting the first object object and the first background object in the first picture according to the first dividing line;
计算第二图片中的每相邻两个像素点的灰度值的差,如果相邻两个像素点的灰度值的差大于第三预设阈值,则确定该两个像素点为第二图片的物体对象和背景对象的分割点;Calculating a difference of gray value values of each adjacent two pixel points in the second picture, if the difference of the gray value values of the adjacent two pixel points is greater than a third preset threshold, determining that the two pixel points are the second The segmentation point of the object object and the background object of the image;
将多个第二图片的物体对象和背景对象的分割点组成为第二分割线;Forming the object points of the plurality of second pictures and the segmentation points of the background object into a second dividing line;
根据第二分割线分割出第二图片中的第二物体对象和第二背景对象。The second object object and the second background object in the second picture are segmented according to the second dividing line.
根据第一物体对象所包含的像素点计算第一物体对象的像素属性值,以及,根据第一背景对象所包含的像素点计算第一背景对象的像素属性值,根据第二物体对象所包含的像素点计算第二物体对象的像素属性值,根据第二背景对象所包含的像素点计算第二背景对象的像素属性值,可以包括:Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, according to the second object object The pixel calculates the pixel attribute value of the second object object, and calculates the pixel attribute value of the second background object according to the pixel point included in the second background object, which may include:
计算第一物体对象的所有像素点的色值之和的平均值,将该平均值确定为第一物体对象的色值平均值,并将该色值平均值作为第一物体对象的像素属性值;Calculating an average value of sums of color values of all pixel points of the first object object, determining the average value as an average value of the color values of the first object object, and using the average value of the color values as the pixel attribute value of the first object object ;
计算第一背景对象的所有像素点的色值之和的平均值,将该平均值确定为第一背景对象的色值平均值,并将该色值平均值作为第一背景对象的像素属性值;Calculating an average value of sums of color values of all pixels of the first background object, determining the average value as an average value of the color values of the first background object, and using the average value of the color values as the pixel attribute value of the first background object ;
计算第二物体对象的所有像素点的色值之和的平均值,将该平均值确定为第二物体对象的色值平均值,并将该色值平均值作为第二物体对象的像素 属性值;Calculating an average value of sums of color values of all pixel points of the second object object, determining the average value as an average value of the color values of the second object object, and using the average value of the color values as the pixels of the second object object Attribute value
计算第二背景对象的所有像素点的色值之和的平均值,将该平均值确定为第二背景对象的色值平均值,并将该色值平均值作为第二背景对象的像素属性值。Calculating an average value of sums of color values of all pixels of the second background object, determining the average value as an average value of the color values of the second background object, and using the average value of the color values as the pixel attribute value of the second background object .
由于图片为像素点的集合,色值是像素点的特征信息,因此,可以基于像素点的色值来判断图片内容是否相似。基于该处理思想,为了实现重复性的识别,可以在分割出物体对象和背景对象后,计算该物体对象的色值平均值和该背景对象的色值平均值。需要强调的是,像素点的色值即为像素点的颜色值,并且,不同的颜色模型下的具体的颜色值不同,举例而言:红绿蓝RGB颜色模型下,一个像素点的颜色值为:红、绿和蓝三方面的集合,HSV颜色模型下,一个像素点的颜色值为:色相、饱和度和色明度三方面的集合。Since the picture is a set of pixel points, the color value is the feature information of the pixel point, and therefore, whether the picture content is similar can be determined based on the color value of the pixel point. Based on the processing idea, in order to realize repetitive recognition, after the object object and the background object are segmented, the average value of the color value of the object object and the average value of the color value of the background object may be calculated. It should be emphasized that the color value of the pixel is the color value of the pixel, and the specific color values under different color models are different. For example, the color value of one pixel under the red, green and blue RGB color model. It is a collection of three aspects of red, green and blue. Under the HSV color model, the color values of one pixel are: a set of three phases: hue, saturation and color brightness.
根据第一物体对象的像素属性值、第一背景对象的像素属性值、第二物体对象的像素属性值和第二背景对象的像素属性值,确定第一图片和第二图片是否互为重复图片,可以包括:Determining whether the first picture and the second picture are mutually duplicate images according to the pixel attribute value of the first object object, the pixel attribute value of the first background object, the pixel attribute value of the second object object, and the pixel attribute value of the second background object Can include:
计算第一物体对象的像素属性值与第二物体对象的像素属性值之间的第一类数学运算值;Calculating a first type of mathematical operation value between a pixel attribute value of the first object object and a pixel attribute value of the second object object;
计算第一背景对象的像素属性值与第二背景对象的像素属性值之间的第二类数学运算值;Calculating a second type of mathematical operation value between a pixel attribute value of the first background object and a pixel attribute value of the second background object;
判断第一类数学运算值和第二类数学运算值是否符合预设条件,如果是,确定第一图片和第二图片互为重复图片,否则,确定第一图片和第二图片不互为重复图片。Determining whether the first type of mathematical operation value and the second type of mathematical operation value meet the preset condition; if yes, determining that the first picture and the second picture are mutually repeated pictures; otherwise, determining that the first picture and the second picture are not mutually overlapping image.
其中,计算第一物体对象的像素属性值与第二物体对象的像素属性值之间的第一类数学运算值,可以包括:The calculating the first type of mathematical operation value between the pixel attribute value of the first object object and the pixel attribute value of the second object object may include:
计算第一物体对象的像素属性值与第二物体对象的像素属性值的第一差值;Calculating a first difference between a pixel attribute value of the first object object and a pixel attribute value of the second object object;
计算第一背景对象的像素属性值与第二背景对象的像素属性值之间的第二类数学运算值,可以包括: Calculating a second type of mathematical operation value between the pixel attribute value of the first background object and the pixel attribute value of the second background object may include:
计算第一背景对象的像素属性值与第二背景对象的像素属性值的第二差值;Calculating a second difference between the pixel attribute value of the first background object and the pixel attribute value of the second background object;
判断第一类数学运算值和第二类数学运算值是否符合预设条件,可以包括:Determining whether the first type of mathematical operation value and the second type of mathematical operation value meet the preset condition may include:
判断第一差值是否小于第四预设阈值且第二差值小于第五预设阈值,如果是,表明符合预设条件,否则,表明不符合预设条件。Determining whether the first difference is less than the fourth preset threshold and the second difference is less than the fifth preset threshold. If yes, indicating that the preset condition is met; otherwise, indicating that the preset condition is not met.
通过计算两张图片的物体对象的像素属性值及背景对象的像素属性值之间的差值与对应的阈值进行比较,来确定第一图片与第二图片是否为重复图片。It is determined whether the first picture and the second picture are duplicate pictures by calculating a difference between a pixel attribute value of the object object of the two pictures and a pixel attribute value of the background object and a corresponding threshold.
在另一种实现方式中,计算第一物体对象的像素属性值与第二物体对象的像素属性值之间的第一类数学运算值,可以包括:In another implementation, calculating the first type of mathematical operation value between the pixel attribute value of the first object object and the pixel attribute value of the second object object may include:
计算第一物体对象的像素属性值与第二物体对象的像素属性值的第三差值,计算第一物体对象的像素属性值与第二物体对象的像素属性值的第四算数平均值;Calculating a third difference between the pixel attribute value of the first object object and the pixel attribute value of the second object object, and calculating a fourth arithmetic mean value of the pixel attribute value of the first object object and the pixel attribute value of the second object object;
计算第一背景对象的像素属性值与第二背景对象的像素属性值之间的第二类数学运算值,可以包括:Calculating a second type of mathematical operation value between the pixel attribute value of the first background object and the pixel attribute value of the second background object may include:
计算第一背景对象的像素属性值与第二背景对象的像素属性值的第五差值,计算第一物体对象的像素属性值与第二物体对象的像素属性值的第六算数平均值;Calculating a fifth difference between the pixel attribute value of the first background object and the pixel attribute value of the second background object, and calculating a sixth arithmetic mean value of the pixel attribute value of the first object object and the pixel attribute value of the second object object;
判断第一类数学运算值和第二类数学运算值是否符合预设条件,可以包括:Determining whether the first type of mathematical operation value and the second type of mathematical operation value meet the preset condition may include:
判断第三差值是否小于第六预设阈值、第四算数平均值小于第七预设阈值、第五差值小于第八预设阈值且第六算数平均值小于第九预设阈值,如果是,表明符合预设条件,否则,表明不符合预设条件。Determining whether the third difference is less than a sixth preset threshold, the fourth average is less than a seventh preset threshold, the fifth difference is less than an eighth preset threshold, and the sixth average is less than a ninth preset threshold, if yes Indicates that the preset condition is met, otherwise it indicates that the preset condition is not met.
通过计算两张图片的物体对象的像素属性值及背景对象的像素属性值之间的差值及算数平均值并与对应的阈值进行比较,来确定第一图片与第二图片是否为重复图片。 It is determined whether the first picture and the second picture are duplicate pictures by calculating a difference between the pixel attribute value of the object object of the two pictures and the pixel attribute value of the background object and the arithmetic mean value and comparing with the corresponding threshold.
具体的,分别计算各组重复图片中每一图片的图片对比度,可以包括:Specifically, calculating the picture contrast of each picture in each group of repeated pictures may include:
针对各组重复图片中的每一图片,根据如下公式计算该图片的对比度:For each picture in each group of repeated pictures, calculate the contrast of the picture according to the following formula:
&i=2×ai-bi & I = 2 × a i -b i
其中,&i为图片i的对比度,ai为图片i的物体对象的色值平均值,bi为图片i的背景对象的色值平均值。Where & i is the contrast of the picture i, a i is the average of the color values of the object object of the picture i, and b i is the average value of the color values of the background object of the picture i.
其中,像素点的色值即为像素点的颜色值,并且,不同的颜色模型下的具体的颜色值不同,举例而言:红绿蓝RGB颜色模型下,红色为255,0,0;绿色为0,255,0,;蓝色为0,0,255,一个像素点的颜色值为:红、绿和蓝三方面的集合。求出物体对象的所有像素点的红色色值之和的平均值、绿色色值之和的平均值和蓝色色值之和的平均值作为物体对象色值平均值,求出背景对象的所有像素点的红色色值之和的平均值、绿色色值之和的平均值和蓝色色值之和的平均值作为背景对象的色值平均值。Wherein, the color value of the pixel is the color value of the pixel, and the specific color values under different color models are different, for example: red, green and blue RGB color model, red is 255, 0, 0; green 0, 255, 0,; blue is 0, 0, 255, the color value of one pixel is: red, green and blue. Finding the average of the sum of the red color values of all the pixel points of the object object, the average of the sum of the green color values, and the average of the blue color values as the average value of the object object color values, and obtaining all the pixels of the background object The average of the sum of the red color values of the dots, the average of the sum of the green color values, and the average of the blue color values are used as the average of the color values of the background object.
例如:物体对象包括3个像素点A、B和C,像素点A为黑色,像素点B为灰色,像素点C为红色,其中,黑色的色值为0,0,0;灰色为128,128,128;红色为255,0,0,则物体对象的所有像素点的色值之和的平均值为
Figure PCTCN2016112258-appb-000001
Figure PCTCN2016112258-appb-000002
即128,43,43。
For example, the object object includes 3 pixel points A, B, and C, the pixel point A is black, the pixel point B is gray, and the pixel point C is red, wherein the color value of black is 0, 0, 0; the gray is 128, 128, 128; The red is 255, 0, 0, and the average of the sum of the color values of all the pixels of the object object is
Figure PCTCN2016112258-appb-000001
Figure PCTCN2016112258-appb-000002
That is 128, 43, 43.
另外,由于一般组成物体对象或者背景对象的像素点的数量庞大,超过一半的像素点的色值之和的平均值即可代表物体对象或背景对象的色值平均值,此时,可以计算物体对象的预设数量的像素点的色值之和的平均值,将该平均值作为物体对象的色值平均值,计算背景对象的预设数量的像素点的色值之和的平均值,将该平均值作为背景对象的色值平均值,这都是合理的。In addition, since the number of pixels constituting the object object or the background object is generally large, the average value of the sum of the color values of more than half of the pixel points can represent the average value of the color value of the object object or the background object, and at this time, the object can be calculated. The average value of the sum of the color values of the preset number of pixels of the object, and the average value is used as the average value of the color values of the object object, and the average value of the sum of the color values of the preset number of pixel points of the background object is calculated. This average is used as the average of the color values of the background objects, which is reasonable.
由此,针对各组重复图片中的每一图片,根据灰度值分割出该图片中的物体对象和背景对象,根据该图片的物体对象的色值平均值和背景对象的色值平均值计算出该图片的对比度。Thus, for each picture in each group of repeated pictures, the object object and the background object in the picture are segmented according to the gray value, and the average value of the color value of the object object of the picture and the average value of the color value of the background object are calculated. The contrast of the picture.
相对于上述方法实施例,本申请实施例还提供了一种图片处理装置,应 用于电子设备,如图6所示,该装置可以包括:Compared with the foregoing method embodiment, the embodiment of the present application further provides a picture processing device, which should For an electronic device, as shown in FIG. 6, the device may include:
筛选模块601,用于从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;The screening module 601 is configured to filter, by using a preset picture library, multiple sets of duplicate pictures, where each picture feature in each set of repeated pictures matches;
保存模块602,用于分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;a saving module 602, configured to separately save a plurality of sets of duplicate pictures in a plurality of folders, wherein one folder corresponds to a set of repeated pictures one by one;
计算模块603,用于分别计算各组重复图片中每一图片的图片对比度;a calculating module 603, configured to separately calculate a picture contrast of each picture in each group of repeated pictures;
处理模块604,用于将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The processing module 604 is configured to use a picture with the largest picture contrast in each group of repeated pictures as a cover picture of the corresponding folder.
本申请实施例中,通过特征匹配筛选得到多组重复图片并保存于多个文件夹中,解决了整理相册的问题,并将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片,方便用户快速定位所需的重复图片并查看重复图片,提高用户体验。In the embodiment of the present application, multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
具体的,所述计算模块603,可以具体用于:Specifically, the calculating module 603 can be specifically configured to:
针对各组重复图片中的每一图片,根据如下公式计算该图片的对比度:For each picture in each group of repeated pictures, calculate the contrast of the picture according to the following formula:
δi=2×ai-bi δ i = 2 × a i - b i
其中,δi为图片i的对比度,ai为图片i的物体对象的色值平均值,bi为图片i的背景对象的色值平均值。Where δ i is the contrast of the picture i, a i is the average value of the color values of the object object of the picture i, and b i is the average value of the color values of the background object of the picture i.
更进一步的,如图7所示,本申请提供的一种图片处理装置,应用于电子设备,该装置可以包括:Further, as shown in FIG. 7, the image processing device provided by the present application is applied to an electronic device, and the device may include:
选择单元701,用于从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片,其中,所述第一预定条件包括:未被作为参考图片且未被确定为与其他图片特征匹配的图片;The selecting unit 701 is configured to select, from the preset picture library, a picture that meets the first predetermined condition as the current reference picture, where the first predetermined condition includes: not being used as a reference picture and not determined to be Other pictures with matching image characteristics;
匹配单元702,用于将当前的参考图片与所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片进行特征匹配处理;其中,所述第二预定条件至少包括未被作为参考图片且未被确定为与其他图片特征匹配的图片; The matching unit 702 is configured to perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least a picture that is used as a reference picture and is not determined to match other picture features;
确定单元703,用于在匹配单元存在与当前的参考图片特征匹配的目标图片的情况下,将当前的参考图片与所述目标图片确定为重复图片,并返回触发所述选择单元701。The determining unit 703 is configured to determine the current reference picture and the target picture as a duplicate picture in the case that the matching unit has a target picture that matches the current reference picture feature, and return to trigger the selection unit 701.
保存模块704,用于分别将多组重复图片保存于文件夹中,其中,文件夹与重复图片具有一一对应性;The saving module 704 is configured to save the plurality of sets of duplicate pictures in the folder, wherein the folder has a one-to-one correspondence with the repeated pictures;
计算模块705,用于分别计算各组重复图片中每一图片的图片对比度;a calculating module 705, configured to separately calculate a picture contrast of each picture in each group of repeated pictures;
处理模块706,用于将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The processing module 706 is configured to use a picture with the largest picture contrast in each group of repeated pictures as a cover picture of the corresponding folder.
具体的,所述第二预定条件还可以包括:与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内。Specifically, the second predetermined condition may further include: the time interval of the shooting time with the current reference picture is within a first preset threshold range.
具体的,所述特征匹配处理,可以包括:Specifically, the feature matching process may include:
将当前的参考图片作为第一图片,将所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片作为第二图片;The current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
根据灰度值分割出所述第一图片对应的第一物体对象和第一背景对象,以及所述第二图片对应的第二物体对象和第二背景对象;And dividing, according to the gray value, the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture;
根据所述第一物体对象所包含的像素点计算所述第一物体对象的像素属性值,以及,根据所述第一背景对象所包含的像素点计算所述第一背景对象的像素属性值,根据所述第二物体对象所包含的像素点计算所述第二物体对象的像素属性值,根据所述第二背景对象所包含的像素点计算所述第二背景对象的像素属性值;Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, Calculating a pixel attribute value of the second object object according to the pixel point included in the second object object, and calculating a pixel attribute value of the second background object according to the pixel point included in the second background object;
根据所述第一物体对象的像素属性值、所述第一背景对象的像素属性值、所述第二物体对象的像素属性值和所述第二背景对象的像素属性值,确定所述第一图片和所述第二图片是否互为重复图片,如果是,则确定所述第一图片与所述第二图片特征匹配,如果否,则确定所述第一图片与所述第二图片特征不匹配。Determining the first according to a pixel attribute value of the first object object, a pixel attribute value of the first background object, a pixel attribute value of the second object object, and a pixel attribute value of the second background object Whether the picture and the second picture are mutually repeated pictures, if yes, determining that the first picture matches the second picture feature, and if not, determining that the first picture and the second picture feature are not match.
相应地,如图8所述,本申请实施例还提供了一种电子设备,所述电子设备可以包括: Correspondingly, as shown in FIG. 8 , the embodiment of the present application further provides an electronic device, where the electronic device may include:
壳体801、处理器802、存储器803、电路板804和电源电路805,其中,电路板804安置在壳体围成的空间内部,处理器802和存储器803设置在电路板804上;电源电路805,用于为电子设备的各个电路或器件供电;存储器803用于存储可执行程序代码;处理器802通过读取存储器803中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:a housing 801, a processor 802, a memory 803, a circuit board 804, and a power supply circuit 805, wherein the circuit board 804 is disposed inside a space enclosed by the housing, the processor 802 and the memory 803 are disposed on the circuit board 804; and the power supply circuit 805 For powering various circuits or devices of the electronic device; the memory 803 is for storing executable program code; the processor 802 is configured to execute a program corresponding to the executable program code by reading the executable program code stored in the memory 803 Used to perform the following steps:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
本申请实施例中,通过特征匹配筛选得到多组重复图片并保存于多个文件夹中,解决了整理相册的问题,并将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片,方便用户快速定位所需的重复图片并查看重复图片,提高用户体验。In the embodiment of the present application, multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
相应地,本申请实施例还提供了一种存储介质,其中,该存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行本申请所述的一种图片处理方法。其中,本申请所述的一种图片处理方法,应用于电子设备,该方法可以包括:Correspondingly, the embodiment of the present application further provides a storage medium, where the storage medium is used to store executable program code, and the executable program code is executed to execute a picture processing method described in the present application. The image processing method of the present application is applied to an electronic device, and the method may include:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
本申请实施例中,通过特征匹配筛选得到多组重复图片并保存于多个文件夹中,解决了整理相册的问题,并将各组重复图片中图片对比度最大的图 片作为相应文件夹的封面图片,方便用户快速定位所需的重复图片并查看重复图片,提高用户体验。In the embodiment of the present application, multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and maps the contrast of the pictures in each group of repeated pictures. The slice is used as the cover image of the corresponding folder, which is convenient for the user to quickly locate the required repeated pictures and view the repeated pictures to improve the user experience.
相应地,本申请实施例还提供了一种应用程序,其中,该应用程序用于在运行时执行本申请所述的一种图片处理方法。其中,本申请所述的一种图片处理方法,应用于电子设备,该方法可以包括:Correspondingly, the embodiment of the present application further provides an application, where the application is used to execute a picture processing method described in the present application at runtime. The image processing method of the present application is applied to an electronic device, and the method may include:
从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
本申请实施例中,通过特征匹配筛选得到多组重复图片并保存于多个文件夹中,解决了整理相册的问题,并将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片,方便用户快速定位所需的重复图片并查看重复图片,提高用户体验。In the embodiment of the present application, multiple sets of duplicate pictures are obtained by feature matching screening and saved in multiple folders, which solves the problem of arranging albums, and the picture with the largest picture contrast in each group of repeated pictures is used as the cover picture of the corresponding folder. It is convenient for users to quickly locate the required duplicate pictures and view duplicate pictures to improve the user experience.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备、应用程序及存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例 的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the application, and the storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related embodiments are referred to the method embodiment. Part of the description can be.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the device embodiments described above are schematic, for example, the division of the unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple units or components may be combined or may be integrated. Go to another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
以上所述,以上实施例仅用以说明本申请技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,其中,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术 方案的本质脱离本申请各实施例技术方案的范围。The above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; and the modifications or replacements do not make the corresponding technologies The nature of the solution departs from the scope of the technical solutions of the embodiments of the present application.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。 The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.

Claims (13)

  1. 一种图片处理方法,其特征在于,应用于电子设备,所述方法包括:A picture processing method is characterized in that it is applied to an electronic device, and the method includes:
    从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
    分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
    分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
    将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  2. 根据权利要求1所述的方法,其特征在于,所述从预设图片库中,筛选得到多组重复图片,包括:The method according to claim 1, wherein the screening from the preset picture library to obtain a plurality of sets of duplicate pictures comprises:
    从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片,其中,所述第一预定条件包括:未被作为参考图片且未被确定为与其他图片特征匹配的图片;Selecting, from the preset picture library, a picture that meets the first predetermined condition as a current reference picture, where the first predetermined condition includes: a picture that is not used as a reference picture and is not determined to match other picture features ;
    将当前的参考图片与所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片进行特征匹配处理;其中,所述第二预定条件至少包括未被作为参考图片且未被确定为与其他图片特征匹配的图片;Performing feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least not being used as a reference picture and not a picture that is determined to match other picture features;
    如果存在与当前的参考图片特征匹配的目标图片,将当前的参考图片与所述目标图片确定为重复图片,并返回执行从预设图片库中,选择符合第一预定条件的一张图片作为当前的参考图片的步骤。If there is a target picture that matches the current reference picture feature, determining the current reference picture and the target picture as a duplicate picture, and returning to execute from the preset picture library, selecting a picture that meets the first predetermined condition as the current The steps of the reference picture.
  3. 根据权利要求2所述的方法,其特征在于,所述第二预定条件还包括:与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内。The method according to claim 2, wherein the second predetermined condition further comprises: a time interval from a shooting time of the current reference picture being within a first predetermined threshold range.
  4. 根据权利要求2所述的方法,其特征在于,所述特征匹配处理,包括:The method according to claim 2, wherein the feature matching processing comprises:
    将当前的参考图片作为第一图片,将所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片作为第二图片;The current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
    根据灰度值分割出所述第一图片对应的第一物体对象和第一背景对象,以及所述第二图片对应的第二物体对象和第二背景对象; And dividing, according to the gray value, the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture;
    根据所述第一物体对象所包含的像素点计算所述第一物体对象的像素属性值,以及,根据所述第一背景对象所包含的像素点计算所述第一背景对象的像素属性值,根据所述第二物体对象所包含的像素点计算所述第二物体对象的像素属性值,根据所述第二背景对象所包含的像素点计算所述第二背景对象的像素属性值;Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, Calculating a pixel attribute value of the second object object according to the pixel point included in the second object object, and calculating a pixel attribute value of the second background object according to the pixel point included in the second background object;
    根据所述第一物体对象的像素属性值、所述第一背景对象的像素属性值、所述第二物体对象的像素属性值和所述第二背景对象的像素属性值,确定所述第一图片和所述第二图片是否互为重复图片,如果是,则确定所述第一图片与所述第二图片特征匹配,如果否,则确定所述第一图片与所述第二图片特征不匹配。Determining the first according to a pixel attribute value of the first object object, a pixel attribute value of the first background object, a pixel attribute value of the second object object, and a pixel attribute value of the second background object Whether the picture and the second picture are mutually repeated pictures, if yes, determining that the first picture matches the second picture feature, and if not, determining that the first picture and the second picture feature are not match.
  5. 根据权利要求1所述的方法,其特征在于,所述分别计算各组重复图片中每一图片的图片对比度,包括:The method according to claim 1, wherein said calculating a picture contrast of each picture in each set of repeated pictures separately comprises:
    针对各组重复图片中的每一图片,根据如下公式计算该图片的对比度:For each picture in each group of repeated pictures, calculate the contrast of the picture according to the following formula:
    &i=2×ai-bi & i =2×a i -b i
    其中,&i为图片i的对比度,ai为图片i的物体对象的色值平均值,bi为图片i的背景对象的色值平均值。Where & i is the contrast of the picture i, a i is the average of the color values of the object object of the picture i, and b i is the average value of the color values of the background object of the picture i.
  6. 一种图片处理装置,其特征在于,应用于电子设备,所述装置包括:A picture processing device is characterized in that it is applied to an electronic device, and the device includes:
    筛选模块,用于从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;a screening module, configured to filter, by using a preset image library, a plurality of sets of repeated pictures, wherein each picture feature in each set of repeated pictures matches;
    保存模块,用于分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;a saving module, configured to separately save a plurality of sets of duplicate pictures in a plurality of folders, wherein one folder corresponds to a set of duplicate pictures one by one;
    计算模块,用于分别计算各组重复图片中每一图片的图片对比度;a calculation module, configured to separately calculate a picture contrast of each picture in each group of repeated pictures;
    处理模块,用于将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The processing module is configured to use a picture with the highest contrast of the pictures in each group of repeated pictures as the cover picture of the corresponding folder.
  7. 根据权利要求6所述的装置,其特征在于,所述筛选模块,包括:The apparatus according to claim 6, wherein the screening module comprises:
    选择单元,用于从预设图片库中,选择符合第一预定条件的一张图片作 为当前的参考图片,其中,所述第一预定条件包括:未被作为参考图片且未被确定为与其他图片特征匹配的图片;a selection unit for selecting a picture that meets the first predetermined condition from the preset picture library a current reference picture, wherein the first predetermined condition includes: a picture that is not a reference picture and is not determined to match other picture features;
    匹配单元,用于将当前的参考图片与所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片进行特征匹配处理;其中,所述第二预定条件至少包括未被作为参考图片且未被确定为与其他图片特征匹配的图片;a matching unit, configured to perform feature matching processing on the current reference picture and other pictures in the preset picture library except the current reference picture that meet the second predetermined condition; wherein the second predetermined condition includes at least a picture that is a reference picture and is not determined to match other picture features;
    确定单元,用于在匹配单元存在与当前的参考图片特征匹配的目标图片的情况下,将当前的参考图片与所述目标图片确定为重复图片,并返回触发所述选择单元。And a determining unit, configured to determine, in the case that the matching unit has a target picture that matches the current reference picture feature, the current reference picture and the target picture as a duplicate picture, and return to trigger the selection unit.
  8. 根据权利要求7所述的装置,其特征在于,所述第二预定条件还包括:The apparatus according to claim 7, wherein said second predetermined condition further comprises:
    与当前的参考图片的拍摄时间的时间间隔在第一预设阈值范围内。The time interval of the shooting time with the current reference picture is within the first predetermined threshold range.
  9. 根据权利要求7所述的装置,其特征在于,所述特征匹配处理,包括:The device according to claim 7, wherein the feature matching processing comprises:
    将当前的参考图片作为第一图片,将所述预设图片库中除当前的参考图片以外的符合第二预定条件的其他图片作为第二图片;The current reference picture is used as the first picture, and other pictures in the preset picture library that meet the second predetermined condition except the current reference picture are used as the second picture;
    根据灰度值分割出所述第一图片对应的第一物体对象和第一背景对象,以及所述第二图片对应的第二物体对象和第二背景对象;And dividing, according to the gray value, the first object object and the first background object corresponding to the first picture, and the second object object and the second background object corresponding to the second picture;
    根据所述第一物体对象所包含的像素点计算所述第一物体对象的像素属性值,以及,根据所述第一背景对象所包含的像素点计算所述第一背景对象的像素属性值,根据所述第二物体对象所包含的像素点计算所述第二物体对象的像素属性值,根据所述第二背景对象所包含的像素点计算所述第二背景对象的像素属性值;Calculating a pixel attribute value of the first object object according to the pixel point included in the first object object, and calculating a pixel attribute value of the first background object according to the pixel point included in the first background object, Calculating a pixel attribute value of the second object object according to the pixel point included in the second object object, and calculating a pixel attribute value of the second background object according to the pixel point included in the second background object;
    根据所述第一物体对象的像素属性值、所述第一背景对象的像素属性值、所述第二物体对象的像素属性值和所述第二背景对象的像素属性值,确定所述第一图片和所述第二图片是否互为重复图片,如果是,则确定所述第一图片与所述第二图片特征匹配,如果否,则确定所述第一图片与所述第二图片特征不匹配。Determining the first according to a pixel attribute value of the first object object, a pixel attribute value of the first background object, a pixel attribute value of the second object object, and a pixel attribute value of the second background object Whether the picture and the second picture are mutually repeated pictures, if yes, determining that the first picture matches the second picture feature, and if not, determining that the first picture and the second picture feature are not match.
  10. 根据权利要求6所述的装置,其特征在于,所述计算模块,具体用于: The device according to claim 6, wherein the calculation module is specifically configured to:
    针对各组重复图片中的每一图片,根据如下公式计算该图片的对比度:For each picture in each group of repeated pictures, calculate the contrast of the picture according to the following formula:
    &i=2×ai-bi & i =2×a i -b i
    其中,&i为图片i的对比度,ai为图片i的物体对象的色值平均值,bi为图片i的背景对象的色值平均值。Where & i is the contrast of the picture i, a i is the average of the color values of the object object of the picture i, and b i is the average value of the color values of the background object of the picture i.
  11. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, comprising:
    壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered; the memory is for storing executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory for performing the following steps:
    从预设图片库中,筛选得到多组重复图片,其中,每组重复图片中各个图片特征匹配;From the preset picture library, a plurality of sets of duplicate pictures are obtained by filtering, wherein each picture feature in each set of repeated pictures matches;
    分别将多组重复图片保存于多个文件夹中,其中,一个文件夹与一组重复图片一一对应;Save multiple sets of duplicate pictures in multiple folders, one of which corresponds to a set of duplicate pictures;
    分别计算各组重复图片中每一图片的图片对比度;Calculating the picture contrast of each picture in each group of repeated pictures;
    将各组重复图片中图片对比度最大的图片作为相应文件夹的封面图片。The picture with the highest contrast of the pictures in each group of duplicate pictures is used as the cover picture of the corresponding folder.
  12. 一种应用程序,其特征在于,所述应用程序用于在运行时执行权利要求1-5任一项所述的图片处理方法。An application, wherein the application is configured to perform the image processing method according to any one of claims 1-5 at runtime.
  13. 一种存储介质,其特征在于,所述存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行权利要求1-5任一项所述的图片处理方法。 A storage medium, characterized in that the storage medium is for storing executable program code, the executable program code being executed to perform the image processing method according to any one of claims 1-5.
PCT/CN2016/112258 2016-02-26 2016-12-27 Picture processing method and apparatus, and electronic device WO2017143852A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610108433.8 2016-02-26
CN201610108433.8A CN105808645B (en) 2016-02-26 2016-02-26 Picture processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
WO2017143852A1 true WO2017143852A1 (en) 2017-08-31

Family

ID=56466523

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/112258 WO2017143852A1 (en) 2016-02-26 2016-12-27 Picture processing method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN105808645B (en)
WO (1) WO2017143852A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115098026B (en) * 2022-06-27 2024-04-30 四三九九网络股份有限公司 Photo album picture non-duplication saving method based on iOS system

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808645B (en) * 2016-02-26 2019-05-10 北京金山安全软件有限公司 Picture processing method and device and electronic equipment
CN107807979A (en) * 2017-10-27 2018-03-16 朱秋华 The searching method and device of a kind of similar pictures
CN108228852A (en) * 2018-01-10 2018-06-29 上海展扬通信技术有限公司 The method, apparatus and computer readable storage medium of electron album cover generation
CN110134651B (en) * 2019-05-09 2021-10-26 北京金山安全软件有限公司 Information file processing method and device, electronic equipment and storage medium
CN112308864A (en) * 2020-10-27 2021-02-02 北京达佳互联信息技术有限公司 Image processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040218837A1 (en) * 2003-04-30 2004-11-04 Canon Kabushiki Kaisha Image processing apparatus and method therefor
CN104133917A (en) * 2014-08-15 2014-11-05 百度在线网络技术(北京)有限公司 Method and device for storing pictures in classified mode
CN104182962A (en) * 2013-05-28 2014-12-03 腾讯科技(深圳)有限公司 Picture definition evaluation method and device
CN105808645A (en) * 2016-02-26 2016-07-27 北京金山安全软件有限公司 Picture processing method and device and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576932B (en) * 2009-06-16 2012-07-04 阿里巴巴集团控股有限公司 Close-repetitive picture computer searching method and device
TWI477995B (en) * 2010-05-17 2015-03-21 Hon Hai Prec Ind Co Ltd System and method for sorting pictures
CN103559236A (en) * 2013-10-25 2014-02-05 华为终端有限公司 Image displaying method and terminal
CN104216976B (en) * 2014-09-01 2018-09-04 广东欧珀移动通信有限公司 A kind of mobile terminal picture grouping inspection method and system
CN105205181A (en) * 2015-10-28 2015-12-30 上海斐讯数据通信技术有限公司 Photo management method and management system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040218837A1 (en) * 2003-04-30 2004-11-04 Canon Kabushiki Kaisha Image processing apparatus and method therefor
CN104182962A (en) * 2013-05-28 2014-12-03 腾讯科技(深圳)有限公司 Picture definition evaluation method and device
CN104133917A (en) * 2014-08-15 2014-11-05 百度在线网络技术(北京)有限公司 Method and device for storing pictures in classified mode
CN105808645A (en) * 2016-02-26 2016-07-27 北京金山安全软件有限公司 Picture processing method and device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115098026B (en) * 2022-06-27 2024-04-30 四三九九网络股份有限公司 Photo album picture non-duplication saving method based on iOS system

Also Published As

Publication number Publication date
CN105808645A (en) 2016-07-27
CN105808645B (en) 2019-05-10

Similar Documents

Publication Publication Date Title
WO2017143852A1 (en) Picture processing method and apparatus, and electronic device
US10452905B2 (en) System and method for detecting objects in an image
US10049466B2 (en) Color name generation from images and color palettes
EP2902941B1 (en) System and method for visually distinguishing faces in a digital image
US9135719B1 (en) Color name generation from images and color palettes
WO2017197959A1 (en) Image processing method, apparatus, and device
US8837867B2 (en) Method and system to detect and select best photographs
US9076076B1 (en) Image similarity determination
CN108898082B (en) Picture processing method, picture processing device and terminal equipment
CN105243371A (en) Human face beauty degree detection method and system and shooting terminal
CN109472832B (en) Color scheme generation method and device and intelligent robot
US11886492B2 (en) Method of matching image and apparatus thereof, device, medium and program product
WO2021208633A1 (en) Method and device for determining item name, computer apparatus, and storage medium
US10331953B2 (en) Image processing apparatus
US10037615B2 (en) System and method facilitating palette-based color editing
Nguyen et al. 3D material style transfer
CN106650570A (en) Article finding method and terminal
CN112328345A (en) Method and device for determining theme color, electronic equipment and readable storage medium
WO2015196681A1 (en) Picture processing method and electronic device
KR20120121424A (en) Apparatus and method for searching image
CN110177216B (en) Image processing method, image processing device, mobile terminal and storage medium
TW201624322A (en) System and method of classifying images
JP2006221520A (en) Image feature value extraction system and method
CN105787048B (en) Picture identification method and device and electronic equipment
WO2018066344A1 (en) Image processing device, image processing method and image processing program

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16891300

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16891300

Country of ref document: EP

Kind code of ref document: A1