Image processing method and device

Through the clustering method and dynamic classification threshold technology, the problem of low image processing efficiency in the existing technology is solved, fast and real-time image retrieval and classification are achieved, and the user experience and clustering efficiency are improved.

CN112445922BActive Publication Date: 2024-09-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910798295.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-27
Publication Date
2024-09-10
Estimated Expiration
2039-08-27

AI Technical Summary

Technical Problem

In existing image processing technology, classification and retrieval efficiency of comparing feature vectors one by one is low, image retrieval results cannot be obtained in real time, and new classifications and indexes cannot be quickly created based on newly added photos, resulting in poor user experience.

Method used

Through the clustering method, the similarity distance between the newly added picture and the center points of multiple picture collections is obtained, the collection to which it belongs is determined, and the classification threshold is dynamically adjusted based on the similar distance to avoid one-by-one comparison and achieve fast and real-time picture clustering and Create a new collection to improve the efficiency and accuracy of image classification.

Benefits of technology

It achieves fast, real-time image retrieval and classification, improves user experience, simplifies the clustering process of newly added images, reduces the amount of calculation, and improves the efficiency and accuracy of image clustering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112445922B
    Figure CN112445922B
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for image processing, which relates to the field of terminal technology. Through artificial intelligence technology, the problem of low efficiency of image classification and retrieval and poor user experience caused by comparing feature vectors one by one is solved. The specific scheme includes: the electronic device clusters multiple images to obtain multiple image sets; obtains the similarity distance between the newly added image and the center points of the multiple image sets, and determines the first image set with the smallest similarity distance to the newly added image from the multiple image sets; if the similarity distance between the newly added image and the center point of the first image set is less than or equal to the classification threshold of the first image set, it is determined that the newly added image belongs to the first image set; if the similarity distance between the newly added image and the center point of the first image set is greater than the classification threshold of the first image set, a new second image set is created, and the newly added image belongs to the second image set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method and device for image processing. Background Art

[0002] Currently, smart terminal devices store a massive amount of user photos. Therefore, how to classify user photos and then search for all photos that meet specific conditions from a large number of user photos in real time and quickly has become an urgent problem to be solved.

[0003] Existing image collection and retrieval technologies are based on face recognition, neural networks and clustering algorithms. That is, the smart terminal device performs face recognition on the image, obtains the feature vector of the image through the neural network algorithm, compares the feature vectors of all photos in the gallery of the smart terminal device one by one, and performs image clustering; thus, based on the one-to-one comparison results, the image with the closest feature vector to the retrieved image can be searched as the image retrieval result.

[0004] The above-mentioned one-by-one comparison of picture collection and retrieval technology results in low picture retrieval efficiency and inability to obtain picture retrieval results in real time; moreover, it is impossible to quickly create new categories and indexes in real time based on newly added pictures, resulting in a poor user experience. Summary of the invention

[0005] The present application provides an image processing method and device, which solves the problems in the prior art that the classification and retrieval efficiency of comparing feature vectors one by one is too low, the image retrieval results cannot be obtained in real time, and new classifications and indexes cannot be created in real time and quickly according to newly added photos.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, a method for processing an image is provided, which is applied to an electronic device, and the method includes: the electronic device clusters multiple images to obtain multiple image sets; the electronic device obtains a similarity distance between a newly added image and the center points of the multiple image sets, and determines a first image set with the smallest similarity distance to the newly added image from the multiple image sets, wherein the smaller the similarity distance, the higher the similarity; the center point is the average value of feature vectors of all images in the image set; if the similarity distance between the newly added image and the center point of the first image set is less than or equal to a classification threshold of the first image set, the electronic device determines that the newly added image belongs to the first image set; if the similarity distance between the newly added image and the center point of the first image set is greater than the classification threshold of the first image set, the electronic device creates a second image set, and the newly added image belongs to the second image set.

[0008] In an embodiment of the present application, the electronic device can be a smart terminal device. The electronic device calculates the similarity distance between the newly added pictures and the center points of the multiple picture sets obtained through clustering, and selects the picture set with the smallest similarity distance as the archiving result of the newly added pictures, thereby avoiding comparing the feature vectors of the newly added pictures and the original pictures one by one, so that the newly added pictures can be clustered quickly and in real time, and a new picture set can be established for the pictures that are not successfully clustered, thereby improving the efficiency of picture clustering and improving the user experience.

[0009] In a possible design, an electronic device clusters multiple pictures to obtain multiple picture sets, specifically including: according to the similarity distance between each picture and the feature vectors of multiple pictures, obtain the first K similarity distances corresponding to each picture sorted from small to large, where K is a positive integer greater than or equal to 1; perform differential operations on the K similarity distances corresponding to each picture to obtain outliers in the K similarity distances corresponding to each picture, and the similarity distances corresponding to the outliers are the classification thresholds corresponding to each picture; for the similarity distances between each picture and the feature vectors of multiple pictures, mark the pictures with similarity distances less than or equal to the classification threshold as a picture set to obtain a picture set corresponding to each picture; merge the generated multiple picture sets to obtain multiple picture sets. In the above possible implementation, the electronic device clusters multiple pictures using an artificial intelligence algorithm to automatically calculate the classification threshold, that is, to cluster pictures by classifying each group of pictures through the automatic threshold, thereby avoiding the inaccuracy of classifying a large number of pictures with large differences in similarity distances using a fixed threshold, and improving the flexibility and accuracy of picture clustering.

[0010] In a possible design, before performing differential operations on the K similarity distances corresponding to each image, the method further includes: for any image in each image, if the mth similarity distance among the first K similarity distances corresponding to any image is greater than the second threshold, then marking any image as a set of images, where m is a positive integer greater than or equal to 1. In the above possible implementation, before the electronic device classifies the images according to the classification threshold, it removes the discrete points, reduces the amount of subsequent calculations, and improves the efficiency of image clustering.

[0011] In a possible design, merging the generated multiple picture sets to obtain multiple picture sets includes: obtaining the center point of the picture set corresponding to each picture; if the similarity distance between the center points of any two picture sets is less than the classification threshold of any one of the two picture sets, merging the two picture sets into one picture set. In the above possible implementation, the electronic device merges the picture sets with high similarity between classes according to the similarity distance between the center points corresponding to the picture sets, which can improve the efficiency and accuracy of picture clustering.

[0012] In one possible design, the electronic device obtains the similarity distance between the newly added pictures and the center points of multiple picture sets, specifically including: if the number of newly added pictures is at least two, clustering the newly added pictures to obtain multiple newly added picture sets corresponding to the newly added pictures; calculating the similarity distance between each newly added picture set and the center points of the multiple picture sets. In the above possible implementation, the multiple newly added pictures are first clustered to generate multiple newly added picture sets, and then the similarity distance is calculated based on the newly added picture sets and the pre-stored picture clustering results, so as to perform clustering, thereby speeding up the efficiency of picture archiving, realizing real-time and rapid clustering of newly added pictures, and improving the efficiency of picture clustering.

[0013] According to a second aspect, an electronic device is provided, which includes a processor and a memory connected to the processor, the memory being used to store instructions. When the instructions are executed by the processor, the electronic device is used to execute: clustering multiple pictures to obtain multiple picture sets; obtaining the similarity distance between the newly added picture and the center points of the multiple picture sets, and determining a first picture set with the smallest similarity distance to the newly added picture from the multiple picture sets, wherein the smaller the similarity distance, the higher the similarity; the center point is the average value of the feature vectors of all pictures in the picture set; if the similarity distance between the newly added picture and the center point of the first picture set is less than or equal to the classification threshold of the first picture set, it is determined that the newly added picture belongs to the first picture set; if the similarity distance between the newly added picture and the center point of the first picture set is greater than the classification threshold of the first picture set, a second picture set is created, and the newly added picture belongs to the second picture set.

[0014] In a possible design, multiple pictures are clustered to obtain multiple picture sets, specifically including: according to the similarity distances between each picture and the feature vectors of the multiple pictures, the top K similarity distances corresponding to each picture, which are sorted from small to large, are obtained, wherein K is a positive integer greater than or equal to 1; a difference operation is performed on the K similarity distances corresponding to each picture to obtain an outlier in the K similarity distances corresponding to each picture, wherein the similarity distance corresponding to the outlier is a classification threshold corresponding to each picture; for the similarity distances between each picture and the feature vectors of the multiple pictures, pictures whose similarity distances are less than or equal to the classification threshold are marked as a picture set to obtain a picture set corresponding to each picture; and the generated multiple picture sets are merged to obtain multiple picture sets.

[0015] In one possible design, before performing a differential operation on the K similarity distances corresponding to each picture, the electronic device is further used to execute: for any picture in each picture, if the mth similarity distance among the first K similarity distances corresponding to any picture is greater than a second threshold, then any picture is marked as a picture set, where m is a positive integer greater than or equal to 1.

[0016] In a possible design, the generated multiple picture sets are merged to obtain multiple picture sets, including: obtaining the center point of the picture set corresponding to each picture; if the similarity distance between the center points of any two picture sets is less than the classification threshold of any one of the two picture sets, merging the two picture sets into one picture set.

[0017] In one possible design, the similarity distance between the newly added pictures and the center points of multiple picture sets is obtained, specifically including: if the number of newly added pictures is at least two, clustering the newly added pictures to obtain multiple newly added picture sets corresponding to the newly added pictures; calculating the similarity distance between each newly added picture set and the center points of the multiple picture sets.

[0018] In a third aspect, a chip system is provided, characterized in that the chip system is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the method of the first aspect and any possible design method thereof.

[0019] In a fourth aspect, a readable storage medium is provided, characterized in that instructions are stored in the readable storage medium, and when the readable storage medium runs on an electronic device, the electronic device executes the method of the first aspect and any possible design thereof.

[0020] According to a fifth aspect, a computer program product is provided, characterized in that when the computer program product is run on a computer, the computer is caused to execute the method of the first aspect and any possible design thereof.

[0021] It can be understood that any of the above-mentioned electronic devices, chip systems, readable storage media and computer program products for image processing are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the first aspect above and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0023] Figure 2 A software system architecture diagram of an electronic device provided in an embodiment of the present application;

[0024] Figure 3 A schematic diagram of a process flow of an image processing method provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a process for an electronic device to obtain a feature vector corresponding to a picture provided by an embodiment of the present application;

[0026] Figure 5 A schematic diagram of a process for an electronic device to obtain outliers in a similarity list of an image provided by an embodiment of the present application;

[0027] Figure 6 A schematic diagram of similarity distance distribution in a picture clustering result provided in an embodiment of the present application;

[0028] Figure 7 A schematic diagram of a flow chart of another image processing method provided in an embodiment of the present application;

[0029] Figure 8 A schematic diagram of the effect of another image processing method provided in an embodiment of the present application;

[0030] Fig. 9 A schematic diagram of a flow chart of another image processing method provided in an embodiment of the present application;

[0031] Fig.10 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0033] The embodiment of the present application provides a method for image processing, which can be applied to the process of electronic devices classifying and displaying images, or retrieving user photos, especially the classification and retrieval of photos of people on electronic devices. Through this method, the electronic device can quickly perform image retrieval in real time, and can quickly classify according to newly added images, or create new classifications and indexes, which can improve the user experience.

[0034] Exemplarily, the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) or virtual reality (VR) device, etc., which can display pictures. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

[0035] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings. Figure 1 A schematic structural diagram of an electronic device 100 is shown.

[0036] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0037] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0038] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0039] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0040] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0041] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0042] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0043] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0044] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0045] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0046] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0047] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0048] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0049] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0050] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0051] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0052] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.

[0053] The application layer can include a series of application packages. Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0054] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0055] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0056] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0057] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0058] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0059] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0060] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0061] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0062] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library contains two parts: one is the function that the Java language needs to call, and the other is the Android core library.

[0063] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0064] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0065] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0066] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG or PNG, etc.

[0067] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

[0068] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0069] The methods in the following embodiments can all be implemented in the electronic device 100 having the above hardware structure and software structure. In the following embodiments, only the electronic device 100 is a mobile phone as an example to illustrate the methods in the embodiments of the present application.

[0070] There are many pictures stored in the gallery application on the mobile phone, which can be pictures taken by the mobile phone camera or pictures obtained by other applications on the mobile phone. Through this method, all pictures in the gallery can be classified. For example, according to the content of the pictures, the pictures in the gallery can be divided into picture collections such as people, natural scenery, animals, landmark buildings, things, etc.; further, there can be detailed classification, for example, people photos can be classified according to different people, for example, according to the photos of the mobile phone owner himself, the mother's photos, the daughter's photos and the photos of a friend, etc.; there can also be more detailed classification, the photos of the same person can be classified according to the age of the person in the photo, into childhood, adolescence and middle age, etc.

[0071] The following embodiments of the present application only take the classification according to different people as an example, cluster the pictures of the same person into a picture set through a full clustering algorithm, and mark all the pictures in the picture set with a classification label for user viewing convenience.

[0072] Furthermore, the embodiment of the present application also supports image retrieval. The user can search based on an existing image, or search based on a keyword, or use the camera application of the mobile phone to take a photo in real time for retrieval, and the mobile phone can return all images belonging to the same image set based on the search image, for example, all images of the same person in the search image.

[0073] The present application embodiment provides a method for processing an image. Figure 3 As shown, the method may include:

[0074] 301: The electronic device performs face detection on the image to obtain coordinate information of the face frame.

[0075] Among them, face detection technology is used to quickly detect facial information in pictures, return the position of the face frame, locate the facial features and contour key points, accurately identify multiple facial attributes, and return the coordinate information of the obtained face frame.

[0076] For example, Figure 4 As shown, electronic equipment Figure 4 The image shown in (a) is used for face detection. After the face detection recognizes the object in the image, the face image is divided and output Figure 4 The face frame shown in (b) and the coordinate information of the face frame image.

[0077] 302: Extract features according to the coordinate information of the face frame to obtain a feature vector corresponding to the image.

[0078] The facial feature extraction technology can be used to extract features from the facial image in the face frame. Specifically, a high-dimensional feature vector can be extracted using the deep learning technology of the neural network. For example, Figure 4 As shown, according to Figure 4 From the face frame obtained by face detection, a high-dimensional feature vector such as (13, 423, 3...190) is extracted.

[0079] Furthermore, the electronic device obtains and stores the feature vector corresponding to each image, so as to perform subsequent comparison calculations between the feature vectors.

[0080] 303: Calculate the similarity distance between each image and the feature vectors of multiple images, wherein the smaller the similarity distance is, the higher the similarity is.

[0081] According to the feature vector of each picture and any picture, the similarity distance between the two is calculated. The similarity distance can be used to indicate the similarity between the two pictures. The larger the similarity distance, the smaller the similarity between the two pictures, and the more dissimilar they are. The smaller the similarity distance, the greater the similarity between the two pictures, and the more similar they are.

[0082] Specifically, the algorithm for calculating the similarity distance can be expressed by calculating the Euclidean distance or cosine distance of the feature vectors corresponding to the two images. The present application embodiment does not specifically limit this calculation algorithm, and the specific algorithm for calculating the similarity distance using the cosine distance is only exemplified below.

[0083] The eigenvector corresponding to the image A1 is A1={x1, x2, x3, ...x n}, the feature vector corresponding to image A2 is A2 = {y1, y2, y3, ...y n}, the cosine distance between image A1 and image A2 is:

[0084]

[0085] Then the similarity distance between picture A1 and picture A2 is: S=1-cosθ.

[0086] Further optionally, before calculating the similarity distance, the feature vector corresponding to the image may be normalized, that is, the feature vector may be transformed so that the length value of the normalized feature vector after the data transformation is 1, or it can be said that the modulus of the normalized feature vector is 1. Data normalization can be used to reduce the amount of calculation and speed up the efficiency of data calculation and processing.

[0087] 304: Get the similarity list corresponding to each image.

[0088] Specifically, the similarity list corresponding to each image may be generated by sorting the similarity distances between each image and the feature vectors of multiple images from small to large and taking the first K similarity distances, where K is a positive integer greater than or equal to 1.

[0089] For example, there are N pictures A1, A2, A3...AN in the gallery, then the similarity distances are calculated between the feature vectors corresponding to the N pictures including itself, and the calculated similarity distances are arranged in ascending order, and the first K similarity distance values ​​are taken to form the similarity list corresponding to A1. For example, the similarity distance calculated between picture A1 and itself is 0, which should be the smallest and the first similarity distance in the similarity list, that is, Top1=0 for A1.

[0090] Each image has a corresponding similarity list, that is, there are N similarity lists, each similarity list has K similarity distances sorted from small to large, that is, a N*K similarity matrix is ​​formed. Among them, K can be pre-set by those skilled in the art according to the number of images in the gallery, the accuracy of the clustering algorithm and other parameters. For example, in the embodiment of the present application, K can be set to 50.

[0091] 305: If the mth similarity distance among the first K similarity distances corresponding to a certain picture is greater than a preset threshold, the picture is marked as a picture set.

[0092] Wherein, m is a positive integer greater than or equal to 1. Exemplarily, m can be taken as 3, that is, at least three pictures are marked as a picture set. Therefore, when the third similarity distance in the similarity list of a picture, that is, Top3, is less than a preset threshold, that is, there are less than three pictures with the closest similarity to the picture, which is not enough to be classified into one category, the picture is marked as a discrete point where clustering fails, and the discrete point is removed; or the picture is taken as a separate category and marked with a label.

[0093] The preset threshold is used to indicate the similarity distance threshold at which three pictures can be clustered into one picture set, and can be pre-set by those skilled in the art according to the number of pictures in the picture library, the accuracy of the clustering algorithm and other parameters. For example, in the embodiment of the present application, the preset threshold can be set to 0.2. That is, when the Top3 in the similarity list of a certain picture is less than 0.2, the picture is marked as a separate category and is not clustered with other pictures temporarily.

[0094] Further, when the subsequent step 307 is executed and the merging judgment between the picture sets is performed, it can be determined whether the picture meets the conditions for inter-class merging with other picture sets. If the conditions for inter-class merging are not met or the number of pictures in the merged picture set is still less than 3, the picture is marked as not clustered successfully yet, and when there are new pictures in the future, the picture can continue to participate in clustering to determine whether there are new pictures that can be clustered with it into a picture set.

[0095] 306: Obtain a classification threshold of the images according to the similarity list, and mark the images in the similarity list whose similarity distance is less than or equal to the classification threshold as a set of images.

[0096] Specifically, the classification threshold corresponding to each picture is obtained according to the similarity distance between each picture and multiple pictures, and for the similarity distance between each picture and multiple pictures, pictures whose similarity distance is less than or equal to the classification threshold are marked as a picture set.

[0097] Furthermore, the classification threshold can be calculated by performing a differential operation on the K similarity distances corresponding to each image to obtain the outliers in the K similarity distances corresponding to each image, and the similarity distance corresponding to the outlier of each image is the classification threshold corresponding to each image.

[0098] Among them, outliers refer to extremely large values ​​and extremely small values ​​in a numerical sequence that are far away from the general level of the sequence. Specifically, outliers can be obtained through differential operations. For example, K similarity distances are differentially operated to obtain a differential function, and the similarity distance corresponding to the maximum peak of the differential function is the outlier.

[0099] For example, Figure 5 According to the similarity list of a certain picture, the similarity distance distribution function shown in the left figure is obtained, and the difference operation is performed on the similarity distance distribution function to obtain the difference function shown in the right figure. The maximum peak value of the difference function can be represented as an outlier in the similarity list of the picture, and the similarity distance corresponding to the outlier can be set as the classification threshold.

[0100] Next, the pictures in the classification list corresponding to the similarity distances less than or equal to the classification threshold can be marked as a picture set.

[0101] Through the setting of the classification threshold, different picture sets have different classification thresholds, which are dynamically generated based on the similarity distance between each picture in the picture set. Adding a new picture or deleting a picture in the picture set may affect the size of the classification threshold. Therefore, it is not a fixed threshold, but is obtained based on the artificial intelligence algorithm, so that the threshold can be dynamically selected based on the similarity between pictures in different picture sets, which can improve the accuracy of the picture set.

[0102] For example Figure 6 If the age span of multiple photos of a certain person in the gallery is large, the similarity distance between the multiple photos of the person is relatively high. If the multiple photos of another person have a single scene, similar age, and little difference in expression and other factors, it can be predicted that the similarity distance between the multiple photos is overall low. In this case, if a fixed similarity threshold is used as a standard to distinguish whether the characters in different photos are different characters, it is difficult to avoid clustering errors. However, the clustering method with the dynamic threshold of the above embodiment of the present application can dynamically and intelligently perform image aggregation.

[0103] 307: Determine whether the multiple picture sets can be merged, and merge the generated multiple picture sets.

[0104] Specifically, the center point of the picture set corresponding to each picture can be obtained, where the center point is the average value of the feature vectors corresponding to all pictures in the picture set. If the similarity distance between the center points of any two picture sets is less than the classification threshold of any one of the two picture sets, the two picture sets can be merged into one picture set.

[0105] It should be noted that the center point can be used to represent the average value of the feature vectors in the picture set. Therefore, the relationship between the center point and the classification threshold of the picture set can be used to determine whether the two picture sets can be merged between classes, and the picture sets with higher similarity can be merged to update a new picture set.

[0106] For example, the center point of picture set X is calculated as X_1, and the automatic threshold is 0.5; the center point of picture set Y is Y_1, and the automatic threshold is 0.6; the similarity distance between X_1 and Y_1 is calculated as 0.55, and if 0.55 is less than 0.5, picture set X and picture set Y are merged into one category. Then the center point corresponding to the picture set and the K value corresponding to the picture set are updated.

[0107] 308: Determine whether there are still picture sets that need to be merged.

[0108] Specifically, it can be determined whether there are still picture sets that can be merged according to the above inter-class merging conditions. If there are no picture sets that need to be merged, step 310 is executed; if there are still picture sets that need to be merged, step 309 is executed.

[0109] Furthermore, the termination condition of the inter-class merging may also include: if the second similarity distance in the similarity list of a picture set is greater than a preset threshold, the picture set is not merged with any other picture set.

[0110] Among them, the preset threshold is used to indicate that the similarity between the picture set and other picture sets is too low, and there is no need to perform inter-class merging. It can be pre-set by technical personnel in this field based on parameters such as the number of pictures in the gallery and the accuracy of the clustering algorithm. The embodiments of the present application do not make specific limitations on this.

[0111] 309: Update the center point of the picture set, and update the number K of pictures in the picture set.

[0112] As can be seen from the above, after the picture sets are merged, the center point of the merged new picture set may change, so the center point of the picture set needs to be updated.

[0113] Furthermore, after the picture sets are merged, the number of pictures in the picture sets will also change, so it is necessary to update the value of the number of pictures K in the picture sets, and execute step 306 to update and calculate the classification threshold of the picture sets.

[0114] 310: Complete the image clustering and output multiple image sets.

[0115] When it is determined that there is no picture set that can be merged, it means that the termination condition of clustering is met, and the full clustering processing of all pictures in the gallery is completed. According to the result of picture clustering, for example, N pictures are clustered into n picture sets, which are displayed in the gallery application of the electronic device. Specifically, it can be a way to display the labels of picture sets in the gallery application, for example, one label represents one picture set, and the user clicks the label to view all pictures and part of the pictures in the picture set.

[0116] The above embodiment automatically calculates the classification threshold through artificial intelligence, realizes the clustering of all user pictures, and can perform different classification standards according to the similarity of different user pictures, thereby improving the accuracy of picture classification. The picture clustering realized by this solution has a smaller similarity distance between pictures in a picture set than that between different picture sets, and can quickly create different albums for the photos on the user's mobile phone according to the photos of different people, and establish classification labels.

[0117] Furthermore, the mobile phone can store information such as the center points of the multiple generated picture sets, the number of pictures in the picture set, or the labels of the picture set in the mobile phone's memory, so that when additional picture clustering is performed subsequently, there is no need to cluster the already clustered pictures again. Instead, comparison calculations can be performed based on the information of the picture sets stored in the memory, thereby quickly performing picture classification and picture retrieval.

[0118] During actual use, when the electronic device obtains a batch of new photos, it can use the incremental clustering algorithm to quickly cluster the newly added pictures with the original picture collection, that is, archive them into the existing picture collection; if the newly added photos cannot be archived with the existing picture collection and meet the conditions for adding a new picture collection, the electronic device can create a new picture collection based on the newly added photos.

[0119] The specific incremental clustering process may include the following two processes. First, similarity distances are calculated between the newly added M pictures and the original picture set one by one, and the picture set with the smallest similarity distance is taken as the set to which the picture belongs.

[0120] Specifically, it can be: calculating the similarity distance between the newly added picture and the center point of each picture set in the original multiple picture sets, and the picture set with the smallest similarity distance is, for example, the first picture set; if the similarity distance between the newly added picture and the first picture set is less than or equal to the classification threshold of the first picture set, the electronic device determines that the newly added picture belongs to the first picture set; if the similarity distance between the newly added picture and the first picture set is greater than the classification threshold of the first picture set, the electronic device creates a second picture set, and the newly added picture belongs to the second picture set.

[0121] The second method is to first perform full clustering on the newly added M pictures. The specific full clustering process can be implemented as in the above steps 301-310 to generate m picture sets. Then calculate the similarity distance between the center points of the m picture sets and the n picture sets generated above, and perform inter-class merging. The picture set with the smallest similarity distance and less than the classification threshold of any picture set is taken as the set to which the picture belongs, and the two picture sets are merged; or, when the similarity distance is the smallest and greater than the classification threshold of the two picture sets, and the number of pictures in the picture set is greater than or equal to 3, a new classification is created based on the newly added picture set.

[0122] The second incremental clustering method has a smaller amount of calculation and a better algorithm. The following embodiment of the present application only takes the second incremental clustering method as an example. The specific process can be as follows: Figure 7 , achieved through the following steps:

[0123] 701: The electronic device extracts a feature vector of the newly added image.

[0124] The specific process can be referred to the above steps 301 and 302, which will not be described again here.

[0125] The electronic device obtains the feature vector corresponding to each newly added picture and saves it for subsequent comparison and calculation between the feature vectors.

[0126] 702: Calculate the similarity between the newly added image and multiple image sets, and remove discrete points.

[0127] The similarity can be expressed by the similarity distance. The specific calculation of the similarity distance and the elimination of discrete points can be referred to the above steps 303, 304 and 305, which will not be described in detail here.

[0128] 703: Cluster the newly added pictures to obtain multiple newly added picture sets corresponding to the newly added pictures.

[0129] The specific process can be referred to above steps 306-310, which will not be described in detail here. For example, all the newly added M pictures are clustered to generate m newly added picture sets.

[0130] 704: Calculate the similarity distance between each newly added picture set and the center points of multiple picture sets, and perform inter-class merging.

[0131] The similarity distance is used to indicate the similarity between the newly added picture set and the original picture set, and the picture set with the highest similarity is obtained.

[0132] The center point is the average value of the feature vectors of all pictures in the newly added picture set or the original picture set.

[0133] If the similarity distance between the newly added picture set and the first picture set is less than or equal to the classification threshold of any picture set, it is determined that the newly added picture belongs to the first picture set, and the newly added picture set is merged with the first picture set to update into one picture set. If the similarity distance between the newly added picture and the first picture set is greater than the classification threshold of the two picture sets, the electronic device creates a second picture set, and the newly added picture set belongs to the second picture set.

[0134] Furthermore, the condition for the electronic device to create a new second picture set may also include that if the number of pictures in the newly added picture set is greater than or equal to m, then a new picture set is created. For example, in an embodiment of the present application, if there are less than three pictures and they are not enough to be classified into one category, then m can be set to 3.

[0135] 705: Determine whether there are still picture sets that need to be merged.

[0136] Specifically, it can be determined whether there are still picture sets that can be merged according to the above-mentioned inter-class merging conditions. If there are no picture sets that need to be merged, step 707 is executed; if there are still picture sets that need to be merged, step 706 is executed.

[0137] Furthermore, the termination condition of the inter-class merging may also include: if the second similarity distance in the similarity list of a picture set is greater than a preset threshold, the picture set is not merged with any other picture set.

[0138] Among them, the preset threshold is used to indicate that the similarity between the picture set and other picture sets is too low, and there is no need to perform a similarity distance threshold for inter-class merging. It can be pre-set by technical personnel in this field based on parameters such as the number of pictures in the gallery and the accuracy of the clustering algorithm. The embodiments of the present application do not make specific limitations on this.

[0139] 706: Update the center point of the picture set, and update the number K of pictures in the picture set.

[0140] As can be seen from the above, after the picture sets are merged, the center point of the merged new picture set may change, so the center point of the picture set needs to be updated.

[0141] Furthermore, after the picture sets are merged, the number of pictures in the picture sets will also change, so it is necessary to update the value of the number of pictures K and update the classification threshold for calculating the picture set.

[0142] 707: Complete the image clustering and output multiple image sets.

[0143] When it is determined that there is no picture set that can be merged, it means that the termination condition of clustering is met, and the incremental clustering processing of the newly added pictures is completed. The pictures can be displayed in the gallery application of the electronic device according to the results of picture clustering.

[0144] For example, Figure 8 As shown in Figure 1, the three newly added pictures are classified into different picture sets after incremental clustering. Figure 8 The picture shown in (a) is classified into the picture set of label 1. Figure 8 The picture shown in (b) is classified into the picture set of label 2. Figure 8 If the image shown in (c) in the figure fails to be classified, the interface may display the failure of the image classification, or may display that no images of the same category have been retrieved. The user may view the above-mentioned album intelligently classified image collection by clicking on the mobile phone, and may view all images in the image collection by viewing the image classification label.

[0145] The above embodiment realizes the rapid clustering processing of one or more newly added pictures. By comparing and calculating the class centers of the newly added pictures with the original clustering results, the picture set to which the newly added pictures belong is determined or a new picture set is quickly created, which simplifies the clustering process of the newly added pictures, improves the clustering efficiency, and optimizes the user experience.

[0146] In actual application scenarios, when a user opens a gallery application on an electronic device and needs the electronic device to search based on a face image, the image retrieval process performed by the electronic device is similar to the above-mentioned incremental clustering process. For example, Fig. 9 As shown, the process of the electronic device obtaining the search result according to the newly added face image may include:

[0147] 901: The electronic device obtains a face image.

[0148] The electronic device can obtain the face picture by selecting one or more pictures locally or on the Internet, or by using a camera to obtain real-time pictures.

[0149] 902: Extract features from the acquired face image to obtain a feature vector; if there are multiple images, cluster the multiple images first to obtain a newly added image set.

[0150] 903: Calculate the similarity distance between the center points of the newly added picture set and the original picture set, and the picture set with the smallest similarity distance that is smaller than the classification threshold is output as the search result.

[0151] Furthermore, similarity distances between center points of multiple newly added picture sets and the original picture sets are calculated to determine whether the inter-class merging condition is met, and then the newly added picture sets are merged with the original picture sets.

[0152] Specifically, the conditions for merging between classes refer to step 307 of the above embodiment, which will not be described in detail here.

[0153] After merging the image collections, update the classification labels of the newly added images, update the class centers of the original image collections, the number of images K in the corresponding image collections, and other corresponding parameters.

[0154] 904: If the smallest similarity distance is greater than the classification threshold, create a new picture set according to the picture set.

[0155] Furthermore, the newly added picture sets whose similarity distances with the center points of the original picture sets are greater than the classification threshold can be marked as new picture sets, and the relevant parameters of the picture sets can be updated.

[0156] The above-mentioned embodiments of the present application use incremental clustering to store the existing photo processing results, such as face clustering results, or scene, time and other information in a database cache and set an index. When a new photo is searched, there is no need to repeat the comparison process for each previous photo, and the stored clustering results can be directly called to achieve real-time search. The above-mentioned embodiments of the present application use incremental clustering technology to directly call the cached clustering results in the gallery, avoiding the comparison and calculation of the feature vectors of the photos one by one. In addition, the clustering method using dynamic thresholds can increase the accuracy of face clustering when the sample distribution is irregular, thereby improving the user experience.

[0157] It should be noted that the electronic device in the above-mentioned embodiment can also be implemented as a cloud device such as a cloud server.

[0158] Some other embodiments of the present application provide an electronic device, which may include: a memory and one or more processors, wherein the memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device may perform each function or step in the above method embodiment.

[0159] The present application also provides a chip system, such as Fig.10As shown, the chip system includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1002 can be used to send signals to other devices (such as processor 1001). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the electronic device can perform the various functions or steps performed by the electronic device in the above-mentioned embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0160] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.

[0161] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step in the above method embodiment.

[0162] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0163] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0164] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0165] 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-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0167] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A picture processing method, applied to an electronic device, characterized in that: The method comprises: The electronic device clusters the multiple images to obtain multiple image sets; The electronic device obtains a similarity distance between the newly added picture and the center point of the multiple picture sets, and determines a first picture set having the smallest similarity distance with the newly added picture from the multiple picture sets, wherein the smaller the similarity distance, the higher the similarity; the center point is the average value of the feature vectors of all pictures in the picture set; If the similarity distance between the newly added picture and the center point of the first picture set is less than or equal to the classification threshold of the first picture set, the electronic device determines that the newly added picture belongs to the first picture set; If the similarity distance between the newly added picture and the center point of the first picture set is greater than the classification threshold of the first picture set, the electronic device creates a new second picture set, and the newly added picture belongs to the second picture set; The electronic device obtains the similarity distance between the newly added picture and the center point of the multiple picture sets, specifically including: if the number of the newly added pictures is at least two, clustering the newly added pictures to obtain multiple newly added picture sets corresponding to the newly added pictures; Calculate the similarity distance between each newly added picture set and the center points of the multiple picture sets respectively; The electronic device clusters the multiple pictures to obtain multiple picture sets, specifically including: According to the similarity distances between each image and the feature vectors of the multiple images, obtain the top K similarity distances corresponding to each image sorted from small to large, where K is a positive integer greater than or equal to 1; Performing a differential operation on the K similarity distances corresponding to each image to obtain an outlier in the K similarity distances corresponding to each image, wherein the similarity distance corresponding to the outlier is the classification threshold corresponding to each image; Among the similarity distances between each picture and the feature vectors of the multiple pictures, pictures whose similarity distances are less than or equal to the classification threshold are marked as a picture set, to obtain a picture set corresponding to each picture; The generated multiple picture sets are merged to obtain the multiple picture sets.

2. The method according to claim 1, characterized in that Before performing a differential operation on the K similarity distances corresponding to each image, the method further includes: For any picture in each picture, if the mth similarity distance among the first K similarity distances corresponding to the any picture is greater than a preset threshold, the any picture is marked as a picture set, where m is a positive integer greater than or equal to 1.

3. The method according to claim 1 or 2, characterized in that: The generated multiple picture sets are merged, so that the multiple picture sets include: Get the center point of the picture set corresponding to each picture; If the similarity distance between the center points of any two picture sets is smaller than the classification threshold of any one of the any two picture sets, the any two picture sets are merged into one picture set.

4. An electronic device, characterized in that: The electronic device includes a processor and a memory connected to the processor, wherein the memory is used to store instructions. When the instructions are executed by the processor, the electronic device is used to execute: Cluster multiple pictures to obtain multiple picture sets; Obtaining a similarity distance between the newly added picture and the center points of the multiple picture sets, and determining a first picture set having the smallest similarity distance with the newly added picture from the multiple picture sets, wherein the smaller the similarity distance, the higher the similarity; the center point is the average value of the feature vectors of all pictures in the picture set; If the similarity distance between the newly added picture and the center point of the first picture set is less than or equal to the classification threshold of the first picture set, determining that the newly added picture belongs to the first picture set; If the similarity distance between the newly added picture and the center point of the first picture set is greater than the classification threshold of the first picture set, a second picture set is created, and the newly added picture belongs to the second picture set; The obtaining of the similarity distance between the newly added picture and the center points of the multiple picture sets specifically includes: if the number of the newly added pictures is at least two, clustering the newly added pictures to obtain multiple newly added picture sets corresponding to the newly added pictures; Calculate the similarity distance between each newly added picture set and the center points of the multiple picture sets respectively; The clustering of multiple pictures to obtain multiple picture sets specifically includes: According to the similarity distances between each image and the feature vectors of the multiple images, obtain the top K similarity distances corresponding to each image sorted from small to large, where K is a positive integer greater than or equal to 1; Performing a differential operation on the K similarity distances corresponding to each image to obtain an outlier in the K similarity distances corresponding to each image, wherein the similarity distance corresponding to the outlier is the classification threshold corresponding to each image; Among the similarity distances between each picture and the feature vectors of the multiple pictures, pictures whose similarity distances are less than or equal to the classification threshold are marked as a picture set, to obtain a picture set corresponding to each picture; The generated multiple picture sets are merged to obtain the multiple picture sets.

5. The electronic device according to claim 4, characterized in that: Before performing differential operations on the K similarity distances corresponding to each image, the electronic device is further used to perform: For any picture in each picture, if the mth similarity distance among the first K similarity distances corresponding to the any picture is greater than a preset threshold, the any picture is marked as a picture set, where m is a positive integer greater than or equal to 1.

6. The electronic device according to claim 4 or 5, characterized in that: The generated multiple picture sets are merged, so that the multiple picture sets include: Get the center point of the picture set corresponding to each picture; If the similarity distance between the center points of any two picture sets is smaller than the classification threshold of any one of the any two picture sets, the any two picture sets are merged into one picture set.

7. A chip system, characterized in that: The chip system is applied to an electronic device; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, the signal including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the image processing method as described in any one of claims 1 to 3.

8. A readable storage medium, characterized in that: The readable storage medium stores instructions, and when the readable storage medium is run on an electronic device, the electronic device executes the image processing method according to any one of claims 1 to 3.

9. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to execute the image processing method according to any one of claims 1 to 3.