CN105488074B - Photo clustering method and device - Google Patents

Photo clustering method and device Download PDF

Info

Publication number
CN105488074B
CN105488074B CN201410509608.7A CN201410509608A CN105488074B CN 105488074 B CN105488074 B CN 105488074B CN 201410509608 A CN201410509608 A CN 201410509608A CN 105488074 B CN105488074 B CN 105488074B
Authority
CN
China
Prior art keywords
photo
photos
group
shooting
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410509608.7A
Other languages
Chinese (zh)
Other versions
CN105488074A (en
Inventor
余军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201410509608.7A priority Critical patent/CN105488074B/en
Publication of CN105488074A publication Critical patent/CN105488074A/en
Application granted granted Critical
Publication of CN105488074B publication Critical patent/CN105488074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The disclosure relates to a method and a device for clustering photos. The method comprises the following steps: acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture; clustering the photos into at least one photo group according to the shooting position information; and displaying the photos according to the photo group. The photos are clustered according to the shooting position information of the photos, and the photos are presented to the user in a clustered photo group mode, so that the user can conveniently browse and search the photos in different categories, and the user experience is improved.

Description

Photo clustering method and device
Technical Field
The present disclosure relates to the field of image processing, and in particular, to a method and an apparatus for clustering photos.
Background
With the popularization of intelligent terminals, the use of terminals to take pictures and browse pictures on the terminals through photo management application software has become a part of people's daily life. Due to the large amount of photos stored on the terminal, the photos need to be classified and displayed. In the related art, some photo management application software can only classify and display photos according to the photographing date, for example, putting photos newly taken today together as one cluster, and photos taken yesterday are taken as another cluster.
However, this method of clustering photos by date alone still cannot achieve effective clustering of photos. First, the granularity of clustering may be too large, and when a user takes more photos on the same date, photos cannot be effectively clustered for the user, but all photos on the date are in one cluster, which is inconvenient for the user to look over or search. Secondly, the granularity of the clustering is not flexible enough, the method for clustering photos is based on the date without considering other factors, such as the place of taking photos, when a user takes photos in the same or similar place on two dates far away from each other, the photos are clustered in different groups and far away from each other due to different dates, so that the user cannot continuously view the two groups of photos, and when the user wants to switch to another group of photos, the photos can be viewed only through complicated operations, which is very inconvenient and reduces the experience of the user.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method and an apparatus for clustering photos.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for photo clustering, including:
acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture;
clustering the photos into at least one photo group according to the shooting position information;
and displaying the photos according to the photo group.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the photos are clustered according to the shooting position information of the photos, and the photos are presented to the user in a clustered photo group mode, so that the user can conveniently browse and search the photos in different categories, and the user experience is improved.
Optionally, the shooting information further includes shooting time of the photo;
the clustering the photos into at least one photo group according to the shooting position information includes:
sorting the photos according to the shooting time to obtain N sorted photos, wherein N is an integer greater than 1;
starting from the second photo in the ordered photos, calculating the distance between the ordered nth photo and the shooting positions of all the photos or photo groups before the ordered nth photo according to the shooting position information of the photos until all the photos are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
according to the calculation result, determining a first photo or a first photo group with the minimum distance from the shooting position of the n-th sequenced photo;
and when the distance between the sequenced nth picture and the shooting position of the first picture or the first picture group is smaller than or equal to a preset distance, determining that the nth picture and the first picture belong to the same picture group or the first picture group.
In the alternative scheme, the photos are sequenced according to the shooting time, the photos are clustered into the photo group closest to the photos according to the shooting position information of the photos, and the photos are presented to the user in the clustered photo group mode, so that the user can conveniently browse and search the photos in different categories, and the user experience is improved.
Optionally, after clustering the photos into at least one photo group according to the shooting location information, the method further includes:
sorting the photos in the kth photo group according to the shooting time, wherein k is an integer greater than or equal to 1;
when the number of the photos in the kth photo group is larger than a first preset threshold value, acquiring the shooting time interval of a first photo and a last photo in the kth photo group;
and when the shooting time interval is smaller than a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting position information of the photos in the kth photo group.
In an alternative scheme, for the clustered photo groups, if the number of the photos in one of the photo groups is still large, the photos are further clustered by judging the shooting time interval of the photos in the photo group, and when the shooting time of the photos in the photo group is concentrated, the photos are subdivided according to the shooting positions of the photos, so that the clustering of the photos is more accurate and detailed, a user can conveniently browse and search the photos in different categories, and the user experience is improved.
Optionally, when the number of photos in the kth photo group is greater than a first preset threshold, after the shooting time interval between the first photo and the last photo in the kth photo group is obtained, the method further includes:
and when the shooting time interval is greater than or equal to a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group.
In an alternative scheme, for the clustered photo groups, if the number of photos in one of the photo groups is still large, the photos are further clustered by judging the shooting time interval of the photos in the photo group, and when the shooting time of the photos in the photo group is dispersed, the photos are firstly subdivided according to the shooting time of the photos, so that the clustering of the photos is more accurate and detailed, a user can conveniently browse and search the photos in different categories, and the user experience is improved.
Optionally, the method further includes:
and when the number of the photos in the mth sub-photo big group is larger than a second preset threshold value, clustering the photos in the mth sub-photo big group into at least two sub-photo small groups according to the shooting position information of the photos in the mth sub-photo big group, wherein m is an integer larger than or equal to 1.
In an alternative scheme, when the number of the photos in the big sub-photo group is still large, the photos can be continuously clustered according to the shooting position information of the photos, so that the clustered photo group is more accurate and detailed, a user can conveniently browse and search the photos in different categories, and the user experience is improved.
Optionally, the shooting location information includes a shooting location of the photo and GPS coordinate information of the shooting location, and displaying the photo according to the photo group includes:
selecting the central position of the shooting position of the photo in each photo group according to the GPS coordinate information of the shooting position;
acquiring the position name of the central position as a label of each photo group;
and displaying the label corresponding to each picture group.
In an alternative scheme, the center position name of the shooting position of the photo in each photo group is used as a tag of the photo group to be presented to a user, so that the user can know the information of the photo group according to the tag, the photos can be browsed and searched more conveniently and quickly, and the experience degree of the user is improved.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for photo clustering, including:
the first acquisition module is used for acquiring the shooting information of each picture, and the shooting information comprises the shooting position information of the picture;
the first clustering module is used for clustering the photos into at least one photo group according to the shooting position information;
and the display module is used for displaying the photos according to the photo group.
Optionally, the first clustering module includes:
the sorting submodule is used for sorting the photos according to the shooting time to obtain N sorted photos, wherein N is an integer larger than 1;
the calculation sub-module is used for calculating the distance between the N-th sequenced picture and the shooting positions of all the previous pictures or the picture groups according to the shooting position information of the pictures from the second picture in the sequenced pictures until all the pictures are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
the first determining submodule is used for determining a first photo or a first photo group with the minimum distance from the shooting position of the sequenced nth photo according to the calculation result;
and the second determining sub-module is used for determining that the nth photo and the first photo belong to the same photo group or the first photo group when the distance between the sequenced nth photo and the shooting position of the first photo or the first photo group is smaller than or equal to a preset distance.
Optionally, the apparatus further comprises:
the sorting module is used for sorting the photos in the kth photo group according to the shooting time after clustering the photos into at least one photo group according to the shooting position information, wherein k is an integer greater than or equal to 1;
the second obtaining module is used for obtaining the shooting time interval between the first picture and the last picture in the kth picture group when the number of pictures in the kth picture group is larger than a first preset threshold value;
and the second clustering module is used for clustering the photos in the kth photo group into at least two big sub-photo groups according to the shooting position information of the photos in the kth photo group when the shooting time interval is smaller than a preset time interval.
Optionally, the apparatus further comprises:
and the third clustering module is used for clustering the photos in the kth photo group into at least two big sub-photo groups according to the shooting time of the photos in the kth photo group when the shooting time interval is greater than or equal to a preset time interval.
Optionally, the apparatus further comprises:
and the fourth clustering module is used for clustering the photos in the mth sub-photo big group into at least two sub-photo groups according to the shooting position information of the photos in the mth sub-photo big group when the number of the photos in the mth sub-photo big group is larger than a second preset threshold, wherein m is an integer larger than or equal to 1.
Optionally, the display module includes:
the selecting submodule is used for selecting the central position of the shooting position of the photo in each photo group according to the GPS coordinate information of the shooting position;
the obtaining submodule is used for obtaining the position name of the central position as a label of each photo group;
and the display submodule is used for displaying the corresponding label of each picture group.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for photo clustering, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture;
clustering the photos into at least one photo group according to the shooting position information;
and displaying the photos according to the photo group.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a method of photo clustering in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of photo clustering in accordance with another exemplary embodiment;
FIG. 3 is a flow chart illustrating a method of photo clustering according to yet another exemplary embodiment;
FIG. 4 is a block diagram illustrating an apparatus for photo clustering in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a first clustering module in an apparatus for photo clustering according to an example embodiment;
FIG. 6 is a block diagram illustrating an apparatus for photo clustering in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating a display module in an apparatus for photo clustering according to an example embodiment;
FIG. 8 is a block diagram illustrating an apparatus in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a method of photo clustering according to an exemplary embodiment, and as shown in fig. 1, a method of photo clustering is used in a terminal, including the following steps S11-S13:
step S11, acquiring the shooting information of each picture, wherein the shooting information comprises the shooting position information of the picture;
step S12, clustering the photos into at least one photo group according to the shooting position information;
in step S13, photos are displayed in groups of photos.
The technical scheme provided by the embodiment can have the following beneficial effects: the photos are clustered according to the shooting position information of the photos, and the photos are presented to the user in a clustered photo group mode, so that the user can conveniently browse and search the photos in different categories, and the user experience is improved.
Optionally, the shooting information further includes the shooting time of the photo, and step S12 can be implemented as the following steps S121-124:
step S121, ordering the photos according to shooting time to obtain N ordered photos, wherein N is an integer greater than 1; that is, the photos are sorted from old to new;
step S122, starting from the second photo in the sequenced photos, calculating the distance between the sequenced nth photo and the shooting positions of all the photos or photo groups before the nth photo according to the shooting position information of the photos until all the photos are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
step S123, determining a first photo or a first photo group with the minimum distance from the shooting position of the sequenced nth photo according to the calculation result;
step S124, when the distance between the sequenced nth picture and the first picture or the shooting position of the first picture group is smaller than or equal to the preset distance, determining that the nth picture and the first picture belong to the same picture group or the first picture group.
In step S122, the distance between the nth picture and the shooting position of all previous pictures or groups of pictures can be calculated according to the GPS coordinate information in the shooting position information of the pictures, wherein the GPS coordinate information can be acquired by a Global Positioning System (GPS) on the terminal. When the distance between the nth picture and the shooting position of the picture group is calculated, the distance between the nth picture and the shooting position of all the pictures in the picture group can be calculated respectively, and then the minimum value is selected from all the distance values in the calculation result to be used as the distance between the nth picture and the shooting position of the picture group; or selecting a photo corresponding to the center position of the photo group according to the GPS coordinate information in the shooting position information, and calculating the distance between the nth photo and the shooting position of the photo corresponding to the center position, namely the distance between the nth photo and the shooting position of the photo group.
In the above method, with respect to step S124, when the distance between the sorted nth photo and the first photo or the shooting position of the first photo group is greater than the preset distance, the nth photo does not belong to any photo group before the nth photo, nor belongs to the same group as any photo group before the nth photo.
For example, 500 photos are arranged in time sequence, the preset threshold is 500 meters, and when the value of n is 100, the first 99 photos are clustered as follows: the 1 st to 20 th photos belong to the 1 st photo group, the 21 st photo is a single photo (i.e. not belonging to any photo group), the 22 nd to 40 th photos belong to the 3 rd photo group, the 41 th to 60 th photos belong to the 4 th photo group, and the 61 st to 99 th photos belong to the 5 th photo group. Respectively calculating the distances between the 100 th picture and the 21 st picture and the shooting positions of the 1 st, 3 rd, 4 th and 5 th picture groups, wherein in the calculation result, if the distance between the 100 th picture and the shooting position of the 4 th picture group is the minimum, if the distance value is less than or equal to a preset threshold value of 500 meters, the 100 th picture is determined to belong to the 4 th picture group, and if the distance value is greater than the preset threshold value of 500 meters, the 100 th picture is a single picture; and if the distance between the shooting positions of the 100 th picture and the 21 st picture is minimum and is less than a preset threshold value of 500 meters, determining that the 100 th picture and the 21 st picture belong to the same picture group (2 nd picture group).
Optionally, after step S12, the method further includes the following steps a11-a 13:
step A11, sorting the photos in the kth photo group according to the shooting time, wherein k is an integer greater than or equal to 1;
step A12, when the number of photos in the kth photo group is larger than a first preset threshold value, acquiring the shooting time interval between the first photo and the last photo in the kth photo group;
step A13, when the shooting time interval is smaller than the preset time interval, clustering the photos in the kth photo group into at least two big sub-photo groups according to the shooting position information of the photos in the kth photo group.
After step a12, when the shooting time interval between the first photo and the last photo in the obtained kth group of photos is greater than or equal to the preset time interval, step a13 in the method may be implemented as the following step a 130:
step A130, when the shooting time interval is greater than or equal to the preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group.
When the shooting time interval between the first photo and the last photo in the kth photo group is greater than or equal to the preset time interval, after step a130 is implemented, if the number of photos in the sub-photo group is still large, the following step a131 may be implemented:
step A131, when the number of the photos in the mth sub-photo big group is larger than a second preset threshold, clustering the photos in the mth sub-photo big group into at least two sub-photo small groups according to the shooting position information of the photos in the mth sub-photo big group, wherein m is an integer larger than or equal to 1.
Optionally, the method further includes the following steps S14-S16:
step S14, selecting the center position of the shooting position of the photo in each photo group according to the GPS coordinate information of the shooting position;
step S15, obtaining the position name of the central position as the label of each photo group;
and step S16, displaying the corresponding label of each photo group.
In step S15, the name of the center position, such as the geographical name of the attraction or the building, can be found from the geographic information system according to the GPS coordinate information of the center position. The position name of the central position is used as the label of the photo group to be presented to the user, so that the user can know the information of the photo group according to the label, the photo group can be browsed and searched more conveniently and quickly, and the experience degree of the user is improved.
The following describes a method for clustering photos according to the present disclosure with specific embodiments.
Example one
In this embodiment, the number of photos on the terminal is 1000 in total, and all photos are clustered into 5 photo groups according to the shooting position information of the 1000 photos. Fig. 2 is a flowchart illustrating a method for clustering photos according to the embodiment, which includes the following steps S201 to S208:
step S201, acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture;
step S202, ordering the photos according to the shooting time;
step S203, starting from the second picture in the sorted pictures, calculating the distance between the nth picture and the shooting positions of all the previous pictures or picture groups according to the GPS coordinate information of the shooting positions until all the pictures are traversed;
step S204, determining the picture or the group of pictures with the minimum distance from the shooting position of the nth picture according to the calculation result; for example, the 1 st picture group where the 1 st to 200 th pictures are located is closest to the shooting position of the nth (n is more than 200) picture;
step S205, judging whether the distance between the nth picture and the picture or the shooting position of the picture group closest to the nth picture is smaller than a preset threshold value; for example, the preset threshold is 500 meters; if the distance between the nth picture and the shooting position of the picture or the picture group closest to the nth picture is less than 500 meters, executing the step S206; if the distance between the nth picture and the shooting position of the picture or the group of pictures closest to the nth picture is not less than 500 meters, executing the step S207;
step S206, determining that the nth photo and the photo closest to the nth photo belong to the same group or the group of photos closest to the nth photo; continuing to execute step S203 until all the photos are traversed;
step S207, determining that the nth photo does not belong to the same group as any previous photo and does not belong to any previous photo group; continuing to execute step S203 until all the photos are traversed;
and step S208, displaying the clustered photo groups.
By adopting the technical scheme of the embodiment, the photos in the same place can be clustered together, so that the user can check the photos more conveniently, for example, the photos shot by the user returning to the old can be clustered in the same group as the photos shot by the user returning to the old today, and the photos can be presented to the user at the same time, so that the user does not need to perform multiple operations when wanting to look over the photos shot by the user returning to the old, the user can browse conveniently, and the user experience is improved.
Example two
In this embodiment, the number of photos on the terminal is 1000 in total, and all photos are clustered into 5 photo groups according to the shooting position information of the 1000 photos. In addition, in the 5 clustered photo groups, when the number of photos in one photo group is large, the photos can be continuously clustered according to the shooting information. Fig. 3 is a flowchart illustrating a method for clustering photos according to the embodiment, which includes the following steps S301 to S311:
step S301, acquiring shooting information of each photo, wherein the shooting information comprises shooting position information of the photo;
step S302, ordering the photos according to the shooting time;
step S303, clustering all the photos into at least one photo group according to the shooting position information;
step S304, sequentially judging whether the photos in each photo group are larger than a first preset threshold value; in this embodiment, the first preset threshold is 500, and if the number of photos in one of the photo groups is greater than 500, step S305 is executed; if none of the 5 photo groups is greater than 500 photos, executing step S310; for example, the number of photos in the 3 rd photo group is 600, and the number of photos in the remaining 4 photo groups is less than 500;
step S305, ordering the photos in the photo group according to the shooting time;
step S306, acquiring the shooting time interval of the first picture and the last picture in the picture group;
step S307, judging whether the shooting time interval of the first picture and the last picture in the picture group is larger than a preset time interval; in this embodiment, the preset time interval is 1 day, and if the shooting time interval between the first photo and the last photo in the 3 rd photo group is greater than 1 day, step S308 is executed; if the shooting time interval between the first picture and the last picture in the 3 rd picture group is less than or equal to 1 day, returning to the step S303;
step S308, clustering the photos in the photo group into at least two sub-photo groups according to the shooting time of the photos in the photo group; in this embodiment, the 3 rd photo group includes the photo taken yesterday and the photo taken today, so that the photos taken yesterday can be clustered into one sub-photo group, and the photos taken today can be clustered into another sub-photo group;
step S309, sequentially judging whether the number of the photos in the sub-photo group is greater than a second preset threshold value; in this embodiment, the second preset threshold is 300, and if the number of photos in one of the sub-photo groups is greater than 300, the process returns to step S303; if the number of photos in the 2 sub-photo groups is less than or equal to 300, executing step S310;
step S310, the clustered photo groups are displayed.
In this embodiment, if step S303 needs to be performed circularly, the values of the preset distances may be sequentially decreased. For example, when 1000 photos are clustered, the photos are clustered into 5 photo groups according to a preset distance of 50 kilometers, wherein the photos in the 3 rd photo group are larger than the first preset threshold of 300 photos, the shooting time is concentrated, and the photos are shot in the same day, and then clustering needs to be performed again according to the shooting position information of the photos, at this time, the preset distance can be set to 10 kilometers, and so on until the number of the clustered photos in the photo group or the clustered sub-photo group is appropriate.
The technical scheme provided by the embodiment can have the following beneficial effects: the method includes the steps that photos are clustered according to shooting position information of the photos, for the clustered photo groups, if the number of the photos in one photo group is still large, the photos are further clustered by judging the shooting time interval of the photos in the photo group, when the shooting time of the photos in the photo group is dispersed, the photos are firstly subdivided according to the shooting time of the photos, the clustering of the photos is accurate and fine, the user can conveniently browse and search the photos according to different categories, and the user experience is improved.
FIG. 4 is a block diagram illustrating an apparatus for photo clustering according to an example embodiment. Referring to fig. 4, the apparatus includes:
a first obtaining module 41, configured to obtain shooting information of each picture, where the shooting information includes shooting location information of the picture;
the first clustering module 42 is configured to cluster the photos into at least one photo group according to the shooting location information;
and a display module 43 for displaying the photos according to the photo group.
Optionally, the first clustering module 42 includes the following sub-modules, as shown in fig. 5:
the sorting submodule 421 is configured to sort the photos according to the shooting time to obtain N sorted photos, where N is an integer greater than 1;
the calculating sub-module 422 is configured to calculate, from the second picture in the sorted pictures, the distance between the sorted nth picture and the shooting position of all the previous pictures or picture groups according to the shooting position information of the pictures until all the pictures are traversed, where N is an integer greater than 1 and less than or equal to N;
the first determining submodule 423 is used for determining a first photo or a first photo group with the smallest distance to the shooting position of the sequenced nth photo according to the calculation result;
the second determining sub-module 424 is configured to determine that the nth photo and the first photo belong to the same photo group or the first photo group when a distance between the sorted nth photo and the first photo or a shooting position of the first photo group is smaller than or equal to a preset distance.
Optionally, the apparatus further includes the following modules, as shown in fig. 6:
the sorting module 44 is configured to sort the photos in the kth photo group according to the shooting time after clustering the photos into at least one photo group according to the shooting position information, where k is an integer greater than or equal to 1;
the second obtaining module 45 is configured to obtain a shooting time interval between a first photo and a last photo in a kth photo group when the number of photos in the kth photo group is greater than a first preset threshold;
a second clustering module 46, configured to cluster the photos in the kth photo group into at least two sub-photo large groups according to the shooting position information of the photos in the kth photo group when the shooting time interval is smaller than the preset time interval;
a third clustering module 47, configured to cluster the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group when the shooting time interval is greater than or equal to the preset time interval;
and a fourth clustering module 48, configured to cluster the photos in the mth sub-photo large group into at least two sub-photo small groups according to the shooting position information of the photos in the mth sub-photo large group when the number of the photos in the mth sub-photo large group is greater than a second preset threshold, where m is an integer greater than or equal to 1.
Optionally, the display module 43 includes the following sub-modules, as shown in fig. 7:
the selecting submodule 431 is used for selecting the central position of the shooting position of each photo in each photo group according to the GPS coordinate information of the shooting position;
an obtaining submodule 432, configured to obtain a location name of the center location as a tag of each photo group;
and the display submodule 433 is configured to display a tag corresponding to each photo group.
The technical scheme provided by the embodiment can have the following beneficial effects: the photos are clustered according to the shooting position information of the photos, and the photos are presented to the user in a clustered photo group mode, so that the user can conveniently browse and search the photos in different categories, and the user experience is improved.
In an exemplary embodiment, the present disclosure also provides an apparatus for photo clustering, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture;
clustering the photos into at least one photo group according to the shooting position information;
and displaying the photos according to the photo group.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 8 is a block diagram illustrating an apparatus 800 for photo clustering according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 806 provides power to the various components of device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform a method of photo clustering, the method comprising:
acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture;
clustering the photos into at least one photo group according to the shooting position information;
and displaying the photos according to the photo group.
The shooting information also comprises the shooting time of the photo;
the clustering the photos into at least one photo group according to the shooting position information includes:
sorting the photos according to the shooting time to obtain N sorted photos, wherein N is an integer greater than 1;
starting from the second photo in the ordered photos, calculating the distance between the ordered nth photo and the shooting positions of all the photos or photo groups before the ordered nth photo according to the shooting position information of the photos until all the photos are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
according to the calculation result, determining a first photo or a first photo group with the minimum distance from the shooting position of the n-th sequenced photo;
and when the distance between the sequenced nth picture and the shooting position of the first picture or the first picture group is smaller than or equal to a preset distance, determining that the nth picture and the first picture belong to the same picture group or the first picture group.
After the clustering the photos into at least one photo group according to the shooting position information, the method further comprises:
sorting the photos in the kth photo group according to the shooting time, wherein k is an integer greater than or equal to 1;
when the number of the photos in the kth photo group is larger than a first preset threshold value, acquiring the shooting time interval of a first photo and a last photo in the kth photo group;
and when the shooting time interval is smaller than a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting position information of the photos in the kth photo group.
When the number of photos in the kth photo group is greater than a first preset threshold, after the shooting time interval between the first photo and the last photo in the kth photo group is obtained, the method further includes:
and when the shooting time interval is greater than or equal to a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group.
The method further comprises the following steps:
and when the number of the photos in the mth sub-photo big group is larger than a second preset threshold value, clustering the photos in the mth sub-photo big group into at least two sub-photo small groups according to the shooting position information of the photos in the mth sub-photo big group, wherein m is an integer larger than or equal to 1.
The shooting position information includes a shooting position of the photo and GPS coordinate information of the shooting position, and the displaying the photo according to the photo group includes:
selecting the central position of the shooting position of the photo in each photo group according to the GPS coordinate information of the shooting position;
acquiring the position name of the central position as a label of each photo group;
and displaying the label corresponding to each picture group.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A method of photo clustering, comprising:
acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture; the shooting information also comprises the shooting time of the photo;
clustering the photos into at least one photo group according to the shooting position information;
sequentially judging whether the number of the photos in each photo group is greater than a first preset threshold value;
when the number of the photos in the kth photo group is larger than a first preset threshold value, sorting the photos in the kth photo group according to the shooting time, wherein k is an integer larger than or equal to 1;
acquiring the shooting time interval of the first picture and the last picture in the kth picture group;
when the shooting time interval is smaller than a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting position information of the photos in the kth photo group;
when the shooting time interval is greater than or equal to a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group;
displaying the photos according to the clustered sub-photos in a large group;
the clustering the photos into at least one photo group according to the shooting position information includes:
sorting the photos according to the shooting time to obtain N sorted photos, wherein N is an integer greater than 1;
starting from the second photo in the ordered photos, calculating the distance between the ordered nth photo and the shooting positions of all the photos or photo groups before the ordered nth photo according to the shooting position information of the photos until all the photos are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
according to the calculation result, determining a first photo or a first photo group with the minimum distance from the shooting position of the n-th sequenced photo;
and when the distance between the sequenced nth picture and the shooting position of the first picture or the first picture group is smaller than or equal to a preset distance, determining that the nth picture and the first picture belong to the same picture group or the first picture group.
2. The method of claim 1, further comprising:
and when the number of the photos in the mth sub-photo big group is larger than a second preset threshold value, clustering the photos in the mth sub-photo big group into at least two sub-photo small groups according to the shooting position information of the photos in the mth sub-photo big group, wherein m is an integer larger than or equal to 1.
3. The method of claim 1, wherein the shooting location information includes a shooting location of the photo and GPS coordinate information of the shooting location, and wherein the displaying the photo by the group of photos comprises:
selecting the central position of the shooting position of the photo in each photo group according to the GPS coordinate information of the shooting position;
acquiring the position name of the central position as a label of each photo group;
and displaying the label corresponding to each picture group.
4. An apparatus for clustering photographs, comprising:
the first acquisition module is used for acquiring the shooting information of each picture, and the shooting information comprises the shooting position information of the picture; the shooting information also comprises the shooting time of the photo;
the first clustering module is used for clustering the photos into at least one photo group according to the shooting position information;
the sorting module is used for sequentially judging whether the number of the photos in each photo group is greater than a first preset threshold value; when the number of the photos in the kth photo group is larger than a first preset threshold value, sorting the photos in the kth photo group according to the shooting time, wherein k is an integer larger than or equal to 1;
the second acquisition module is used for acquiring the shooting time interval of the first picture and the last picture in the kth picture group;
the second clustering module is used for clustering the photos in the kth photo group into at least two big sub-photo groups according to the shooting position information of the photos in the kth photo group when the shooting time interval is smaller than a preset time interval;
a third clustering module, configured to cluster the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group when the shooting time interval is greater than or equal to a preset time interval;
the display module is used for displaying the photos according to the clustered sub-photos in a large group;
the first clustering module comprises:
the sorting submodule is used for sorting the photos according to the shooting time to obtain N sorted photos, wherein N is an integer larger than 1;
the calculation sub-module is used for calculating the distance between the N-th sequenced picture and the shooting positions of all the previous pictures or the picture groups according to the shooting position information of the pictures from the second picture in the sequenced pictures until all the pictures are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
the first determining submodule is used for determining a first photo or a first photo group with the minimum distance from the shooting position of the sequenced nth photo according to the calculation result;
and the second determining sub-module is used for determining that the nth photo and the first photo belong to the same photo group or the first photo group when the distance between the sequenced nth photo and the shooting position of the first photo or the first photo group is smaller than or equal to a preset distance.
5. The apparatus of claim 4, further comprising:
and the fourth clustering module is used for clustering the photos in the mth sub-photo big group into at least two sub-photo groups according to the shooting position information of the photos in the mth sub-photo big group when the number of the photos in the mth sub-photo big group is larger than a second preset threshold, wherein m is an integer larger than or equal to 1.
6. The apparatus of claim 4, wherein the display module comprises:
the selecting submodule is used for selecting the central position of the shooting position of the photo in each photo group according to the GPS coordinate information of the shooting position;
the obtaining submodule is used for obtaining the position name of the central position as a label of each photo group;
and the display submodule is used for displaying the corresponding label of each picture group.
7. An apparatus for clustering photographs, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring shooting information of each picture, wherein the shooting information comprises shooting position information of the picture; the shooting information also comprises the shooting time of the photo;
clustering the photos into at least one photo group according to the shooting position information;
sequentially judging whether the number of the photos in each photo group is greater than a first preset threshold value;
when the number of the photos in the kth photo group is larger than a first preset threshold value, sorting the photos in the kth photo group according to the shooting time, wherein k is an integer larger than or equal to 1;
acquiring the shooting time interval of the first picture and the last picture in the kth picture group;
when the shooting time interval is smaller than a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting position information of the photos in the kth photo group;
when the shooting time interval is greater than or equal to a preset time interval, clustering the photos in the kth photo group into at least two sub-photo large groups according to the shooting time of the photos in the kth photo group;
displaying the photos according to the clustered sub-photos in a large group;
the processor is further configured to:
sorting the photos according to the shooting time to obtain N sorted photos, wherein N is an integer greater than 1;
starting from the second photo in the ordered photos, calculating the distance between the ordered nth photo and the shooting positions of all the photos or photo groups before the ordered nth photo according to the shooting position information of the photos until all the photos are traversed, wherein N is an integer which is more than 1 and less than or equal to N;
according to the calculation result, determining a first photo or a first photo group with the minimum distance from the shooting position of the n-th sequenced photo;
and when the distance between the sequenced nth picture and the shooting position of the first picture or the first picture group is smaller than or equal to a preset distance, determining that the nth picture and the first picture belong to the same picture group or the first picture group.
CN201410509608.7A 2014-09-28 2014-09-28 Photo clustering method and device Active CN105488074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410509608.7A CN105488074B (en) 2014-09-28 2014-09-28 Photo clustering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410509608.7A CN105488074B (en) 2014-09-28 2014-09-28 Photo clustering method and device

Publications (2)

Publication Number Publication Date
CN105488074A CN105488074A (en) 2016-04-13
CN105488074B true CN105488074B (en) 2020-09-01

Family

ID=55675052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410509608.7A Active CN105488074B (en) 2014-09-28 2014-09-28 Photo clustering method and device

Country Status (1)

Country Link
CN (1) CN105488074B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI628626B (en) * 2017-07-18 2018-07-01 劉謹銘 Multiple image source processing methods
CN107656964A (en) * 2017-08-17 2018-02-02 深圳市万普拉斯科技有限公司 Picture management method, device, electronic equipment and readable storage medium storing program for executing
CN110413817B (en) * 2019-07-30 2023-06-16 腾讯科技(武汉)有限公司 Method and device for clustering pictures
CN112732966A (en) * 2020-12-31 2021-04-30 北京华安信联通信技术有限公司 Method for adding shooting place to photo

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609431A (en) * 2010-10-19 2012-07-25 苹果公司 Presenting media content items using geographical data
CN103945134A (en) * 2014-05-16 2014-07-23 深圳市东方拓宇科技有限公司 Method and terminal for taking and viewing photos

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101437096B (en) * 2007-11-16 2011-01-26 深圳富泰宏精密工业有限公司 System and method for classifying mobile equipment photograph
CN101510205B (en) * 2009-03-16 2013-02-27 广州市有福数码科技有限公司 Method for implementing automatically clustering photographs, apparatus and system
CN102314515A (en) * 2011-09-22 2012-01-11 宇龙计算机通信科技(深圳)有限公司 Photo classification method and device
CN103167395B (en) * 2011-12-08 2015-08-12 腾讯科技(深圳)有限公司 Based on photo localization method and the system of mobile terminal navigation feature
CN103064937B (en) * 2012-12-25 2017-10-27 广东欧珀移动通信有限公司 Based on the method and device for shooting address and shooting time preservation photo

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609431A (en) * 2010-10-19 2012-07-25 苹果公司 Presenting media content items using geographical data
CN103945134A (en) * 2014-05-16 2014-07-23 深圳市东方拓宇科技有限公司 Method and terminal for taking and viewing photos

Also Published As

Publication number Publication date
CN105488074A (en) 2016-04-13

Similar Documents

Publication Publication Date Title
CN105517112B (en) Method and device for displaying WiFi network information
US10509540B2 (en) Method and device for displaying a message
US20180121040A1 (en) Method and device for managing notification messages
US20170032219A1 (en) Methods and devices for picture processing
CN106250430B (en) Method and device for sorting intelligent device list
EP3099042A1 (en) Methods and devices for sending cloud card
KR101771153B1 (en) Method and device for determining associated user
US20170085697A1 (en) Method and device for extending call function
CN106919629B (en) Method and device for realizing information screening in group chat
CN107423386B (en) Method and device for generating electronic card
US9924334B1 (en) Message pushing method, terminal equipment and computer-readable storage medium
CN106534951B (en) Video segmentation method and device
EP3089436A1 (en) Methods and devices for calling based on cloud card
CN106572268B (en) Information display method and device
EP3026876A1 (en) Method for acquiring recommending information, terminal and server
CN105488074B (en) Photo clustering method and device
CN107402767B (en) Method and device for displaying push message
CN104850643B (en) Picture comparison method and device
CN106331328B (en) Information prompting method and device
US10229165B2 (en) Method and device for presenting tasks
CN107493366B (en) Address book information updating method and device and storage medium
CN107222576B (en) Photo album synchronization method and device
CN111177521A (en) Method and device for determining query term classification model
CN105260088B (en) Information classification display processing method and device
EP2950242A1 (en) Method and apparatus for determining position

Legal Events

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