WO2019137259A1 - Image processing method and apparatus, storage medium, and electronic device - Google Patents
Image processing method and apparatus, storage medium, and electronic device Download PDFInfo
- Publication number
- WO2019137259A1 WO2019137259A1 PCT/CN2018/125451 CN2018125451W WO2019137259A1 WO 2019137259 A1 WO2019137259 A1 WO 2019137259A1 CN 2018125451 W CN2018125451 W CN 2018125451W WO 2019137259 A1 WO2019137259 A1 WO 2019137259A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- classification
- keyword
- library
- entity
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/5866—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72469—User interfaces specially adapted for cordless or mobile telephones for operating the device by selecting functions from two or more displayed items, e.g. menus or icons
- H04M1/72472—User interfaces specially adapted for cordless or mobile telephones for operating the device by selecting functions from two or more displayed items, e.g. menus or icons wherein the items are sorted according to specific criteria, e.g. frequency of use
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/725—Cordless telephones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/32—Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/32—Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
- H04N1/32101—Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
- H04N1/32144—Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
- H04N1/32149—Methods relating to embedding, encoding, decoding, detection or retrieval operations
- H04N1/32267—Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
- H04N1/32277—Compression
Definitions
- the present application relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, storage medium, and electronic device.
- the picture exists in the storage space of the smart phone. Due to the current camera resolution of the smart phone and the screen display resolution, the resolution corresponding to the picture is increased. It is also getting higher and higher, and the storage space is also getting larger and larger, resulting in excessive storage space and lowering the running speed of the smartphone.
- the embodiment of the present application provides an image processing method, device, storage medium, and electronic device, which can improve the utilization efficiency of the storage space of the electronic device.
- an embodiment of the present application provides an image processing method, including:
- the resolution of the image in the classification library is compressed according to a preset rule.
- an image processing apparatus provided by the embodiment of the present application includes:
- An analyzing unit configured to acquire an image in an album, and perform image analysis on the image
- a label determining unit configured to determine a sample label corresponding to the image according to the image analysis result
- a moving unit configured to perform classification processing on the image based on the sample label, and move the image into a corresponding classification library
- a processing unit configured to perform compression processing on a resolution of the image in the classification library according to a preset rule.
- a storage medium provided by an embodiment of the present application has a computer program stored thereon, and when the computer program is run on a computer, the computer is caused to perform an image processing method according to any embodiment of the present application.
- an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory has a computer program, and the processor is configured to perform the steps by calling the computer program:
- the resolution of the image in the classification library is compressed according to a preset rule.
- FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
- FIG. 2 is another schematic flowchart of an image processing method provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of an application scenario of an image processing method according to an embodiment of the present disclosure.
- FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
- FIG. 5 is another schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
- FIG. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
- the embodiment of the present application provides an image processing method, and the execution body of the image processing method may be an image processing device provided by an embodiment of the present application, or an electronic device integrated with the image processing device, where the image processing device may adopt hardware or The way the software is implemented.
- the electronic device may be a device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
- An embodiment of the present invention provides an image processing method, including:
- the resolution of the image in the classification library is compressed according to a preset rule.
- the step of acquiring an image in an album and performing image analysis on the image may include: acquiring an image in the album, and extracting a plurality of features of the image by using a convolutional neural network; The plurality of features generate a corresponding plurality of entity words; the plurality of features and the plurality of entity words are embedded and processed to generate a corresponding entity description.
- the step of determining a sample tag corresponding to the image according to the image analysis result may include: performing an intelligent reorganization of the entity description corresponding to the image, generating a recombined entity description; and describing the reorganized entity Analyze and determine the corresponding sample label.
- the step of classifying the image based on the sample label, and moving the image to the corresponding classification library may include: acquiring a keyword indicated by the sample label; and obtaining a corresponding indication of the classification library Sorting a keyword; determining whether the keyword matches the classified keyword; and when determining that the keyword matches the classified keyword, moving the image into the classified library.
- the method may further include: when determining that the keyword does not match the classified keyword, generating prompt information to prompt the user to The image is classified; or when it is determined that the keyword does not match the classified keyword, the similarity between the keyword and the classified keyword is obtained, and the image is moved to the classification database with the highest similarity.
- the method may further include: acquiring an image in the classification library, and generating a thumbnail image of all the images and performing a list. Displaying; generating prompt information for indicating whether the user performs compression processing on the image; receiving an operation instruction input by the user according to the prompt information, the operation instruction indicating a target image that needs to be subjected to compression processing.
- the step of compressing the resolution of the image in the classification library according to the preset rule may include: compressing the resolution of the target image in the classification library according to a preset rule.
- FIG. 1 is a schematic flowchart diagram of an image processing method according to an embodiment of the present application.
- the specific process of the image processing method provided by the embodiment of the present application may be as follows:
- the image analysis mentioned in the embodiment is technically completed based on Image Caption, which is a comprehensive problem of integrating computer vision, natural language processing and machine learning. Describe the image as accurately as possible.
- the image in the album includes all images stored by the electronic device, and the image may be an image in multiple formats, such as Bmp, jpg, png, tiff, gif, pcx, tga, exif, fpx, svg, psd, cdr, Pdd, dxf, ufo, eps, ai, raw, WMF and other formats.
- CNN Convolutional Neural Network
- the features of the image are acquired by the convolutional neural network, and corresponding entity words are generated according to the features, for example, the convolutional neural network acquires the features of the characters in the image, and the entity words can be generated according to the characteristics of the characters. For people.
- the features and entity words obtained by the convolutional neural network are embedded in the same space, and then the optimal description is selected to generate an entity description.
- the image can be initially recognized so that the image can be classified later.
- the sample label is a general description of the image, and the function of the image can be known through the sample label.
- the entity description in step 201 may be reorganized through a certain grammar database to generate a grammatically fluent entity description to summarize the sample tags of the image.
- a sample tag in which the keyword is determined is extracted.
- a plurality of classification libraries may be established, and each classification library corresponds to a different classification keyword.
- the character classification library, the classification keywords corresponding to the character classification library are people, faces, eyes, and the body.
- the file type classification library, the classification keywords corresponding to the file type classification library are characters, files, formulas, and the like.
- the classification library can also include multiple types, which are not described here.
- the prompt information may be generated to prompt the user to manually classify the image, or may be based on keywords.
- the similarity is matched, and the image is moved to a classification library with the highest keyword similarity matching value.
- the resolution of the images in different classification libraries is compressed, which can save a lot of storage space.
- the character class classification library needs to have a higher resolution as the shooting of the portrait is better. Therefore, the pixels of the image in the character class classification library are not compressed, and the file class classification library generally stores the characters, files, and formulas, so the pixels of the image in the file class classification library can be Appropriate amount of compression, such as compression of 70%, due to the reduction of the pixels of the image, can reduce the storage size of the image, thereby saving the storage space of the electronic device.
- the embodiment of the present application determines the sample tags corresponding to the image by performing feature analysis on the image in the album, and classifies the image based on the sample tags, moves the image into the corresponding classification library, and according to the preset rule
- the resolution of the image in the classification library is compressed, and the corresponding compression operation is performed on the pixels of different types of images, which saves the storage space of the electronic device and improves the utilization efficiency of the storage space of the electronic device.
- extracting the feature information of the image based on the convolutional neural network can improve the accuracy of the image feature recognition and is more suitable for the user's usage habits.
- the image processing method may include:
- the electronic device analyzes the edge and shape of the image, extracts the overall visual effect, finds different recognition features, and extracts it to find the features in the image that are different from the surrounding environment.
- an image 101 is displayed on the display screen of the electronic device 100 in the first step 1, and a plurality of features of the image 101 are extracted by a convolutional neural network, such as 1011 and 1012 distinguished from the surrounding environment. .
- the entity word corresponding to each feature can be obtained by further analyzing the extracted multiple features, and the entity word is used to summarize the feature.
- the electronic device analyzes the features 1011 and 1012 to determine that the entity word of the feature 1011 is a person, and the entity word of 1012 is a car.
- the corresponding entity description may be generated according to the correspondence between the multiple features in the image and the plurality of entity words, and the image may be initially recognized by the entity description, as shown in FIG. 3, according to the feature 1011 and the feature 1012.
- the location relationship, and the entity words corresponding to the feature 1011 and the feature 1012, are embedded, and the corresponding entity description can be "person and car”.
- a grammar database may be loaded in the electronic device, the grammar database including rules for combining sentences described by the entities.
- the intelligent reorganization of the description in the entity description is performed based on the grammar database, so that the reorganized entity description grammar logic is fluent, so that the sample label of the image can be better summarized, for example, the entity description is “person and car”. Intelligent reorganization, the entity that can be reorganized is described as "people standing next to the car to take pictures"
- the keyword is extracted as a sample tag of the image.
- the keywords "person”, “car” and “photograph” can be extracted.
- a plurality of classification libraries may be established, and each classification library corresponds to a different classification keyword.
- the character classification library, the classification keywords corresponding to the character classification library are people, faces, eyes, photographs, and the body.
- the file type classification library, the classification keywords corresponding to the file type classification library are characters, files, formulas, and the like.
- the keyword indicated by the sample label of the image is obtained, for example, the keywords for obtaining the sample label are “person”, “car” and “photograph”.
- the classification keywords corresponding to the classification library are obtained, for example, the classification keywords corresponding to the character classification library are people, faces, eyes, photographs, and bodies, and the classification keywords corresponding to the file type classification library are characters, files, and formulas.
- step 309 is performed; when it is determined that the keyword does not match the classification keyword, the process returns to step 307 to acquire the classification keyword corresponding to the other classification library.
- the prompt information may be generated to prompt the user to perform manual classification processing on the image.
- the movement in this embodiment is a cutting operation, that is, cutting the storage location of the image into a corresponding storage location in the classification library.
- all the images in the classification library are displayed in the form of thumbnails between compression processing operations.
- the thumbnail further includes a check button.
- the check button When the check button is selected, the image needs to be compressed.
- the check button When the check button is not selected, the image does not need to be compressed.
- the default checkmarks on the thumbnails of all images are selected.
- the prompt information is used to indicate whether the user performs compression processing on the image.
- the user can manually cancel the image that does not need to be compressed, for example, the user can manually cancel the selected state on the thumbnail of the image.
- an operation instruction is generated corresponding to the target image that needs to be subjected to compression processing.
- the flexible compression processing of the image can avoid batch processing and also compress some images that do not need to be processed by the pixel, so that the user may be affected by the pixel due to the low pixel.
- different compression rules can be set for different classification libraries.
- the character class classification library requires a higher resolution as the shooting of the portrait, so the compression rule is not compression
- the file class classification library It is generally used to capture text, files, and formulas, so the pixels of the image in the file class classification library can be compressed in an appropriate amount, such as a compression rule of 70%. Based on this, an image that is not particularly high in pixel requirements can be compressed in an appropriate amount, and the storage space occupied by the image can be greatly saved while ensuring that the user is not affected.
- the user may also recover the resolution before the target image is compressed by the recall operation.
- the embodiment of the present application determines the sample tags corresponding to the image by performing feature analysis on the image in the album, and classifies the image based on the sample tags, moves the image into the corresponding classification library, and according to the preset rule
- the resolution of the image in the classification library is compressed, and the corresponding compression operation is performed on the pixels of different types of images, which saves the storage space of the electronic device and improves the utilization efficiency of the storage space of the electronic device.
- extracting the feature information of the image based on the convolutional neural network can improve the accuracy of the image feature recognition and is more suitable for the user's usage habits.
- An embodiment of the present invention provides an image processing apparatus, including:
- An analyzing unit configured to acquire an image in an album, and perform image analysis on the image
- a label determining unit configured to determine a sample label corresponding to the image according to the image analysis result
- a mobile unit configured to classify the image based on the sample label, and move the image to a corresponding classification library
- a processing unit configured to perform compression processing on the resolution of the image in the classification library according to a preset rule.
- the analyzing unit may include: an extracting subunit, configured to acquire an image in the album, and extract a plurality of features of the image by using a convolutional neural network; and generate a subunit for using the plurality of The feature generates a plurality of corresponding entity words; the embedded subunit is configured to embed the plurality of features and the plurality of entity words to generate a corresponding entity description.
- the label determining unit may include: a recombining subunit, configured to perform intelligent reorganization of the entity description corresponding to the image, generate a reorganized entity description, and determine a subunit for the reorganized entity The description is analyzed to determine the corresponding sample label.
- the mobile unit is specifically configured to: obtain a keyword indicated by the sample tag; acquire a classification keyword corresponding to the classification library; determine whether the keyword matches the classification keyword; and determine the key When the word matches the category keyword, the image is moved to the classification library.
- the mobile unit is further configured to: obtain a keyword indicated by the sample tag; acquire a classification keyword corresponding to the classification library; determine whether the keyword matches the classification keyword; and determine the When the keyword matches the classification keyword, the image is moved into the classification library; when it is determined that the keyword does not match the classification keyword, the prompt information is generated to prompt the user to classify the image; or When it is determined that the keyword does not match the classification keyword, the similarity between the keyword and the classification keyword is obtained, and the image is moved to the classification database with the highest similarity.
- FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application. Wherein the image processing apparatus is applied to an electronic device, the image processing apparatus comprising an analyzing unit 401, a label determining unit 402, a moving unit 403, and a processing unit 404, as follows:
- the analyzing unit 401 is configured to acquire an image in an album, and perform image analysis on the image;
- the analyzing unit 401 acquires the features of the image through the convolutional neural network, and then generates corresponding entity words according to the features, such as the convolutional neural network acquiring the features of the characters in the image, and then generating the entity words according to the characteristics of the characters. For people.
- the analyzing unit 401 embeds the feature and the entity word acquired through the convolutional neural network into the same space, and then selects the optimal description to generate an entity description. Through the description of the entity, the image can be initially recognized so that the image can be classified later.
- the label determining unit 402 is configured to determine a sample label corresponding to the image according to the image analysis result.
- the tag determining unit 402 may reorganize the entity description through a certain grammar database to generate a grammatical logic compliant entity description to summarize the sample tags of the image.
- the tag determining unit 402 extracts a sample tag in which the keyword determines the image by analyzing the reorganized entity description.
- the moving unit 403 is configured to perform classification processing on the image based on the sample label, and move the image into a corresponding classification library.
- the mobile unit 403 determines whether the two are matched by respectively acquiring the keyword indicated by the sample tag and the classification keyword corresponding to the classification library, and when the two are matched, the image is moved to the classification library. When it is determined that the two do not match, the classification keyword corresponding to the indication of another classification library is continuously obtained.
- the processing unit 404 is configured to perform compression processing on the resolution of the image in the classification library according to a preset rule.
- the processing unit 404 compresses the resolution of the images in different classification libraries according to the preset rule, which can save a large amount of storage space.
- the character classification library needs to be higher because it is for shooting a portrait.
- the better the resolution the pixels of the image in the character class classification library are not compressed, and the file class classification library generally stores the characters, files and formulas, so the file class classification library can be used.
- the pixels of the image are compressed by an appropriate amount, such as 70% compression. Due to the reduction of the pixels of the image, the storage size of the image can be correspondingly reduced, thereby saving the storage space of the electronic device.
- the analyzing unit 401 may include:
- An extracting subunit 4011 configured to acquire an image in the album, and extract a plurality of features of the image by using a convolutional neural network
- a generating subunit 4012 configured to generate a corresponding plurality of entity words according to the plurality of features
- the embedding sub-unit 4013 is configured to perform embedding processing on the plurality of features and the plurality of entity words to generate a corresponding entity description.
- the label determining unit 402 may include:
- the recombination sub-unit 4021 is configured to perform intelligent reorganization on the entity description corresponding to the image to generate a reorganized entity description.
- the determining sub-unit 4022 is configured to analyze the reorganized description of the entity to determine a corresponding sample tag.
- the steps performed by each unit in the image processing apparatus may refer to the method steps described in the foregoing method embodiments.
- the image processing device can be integrated in an electronic device such as a mobile phone, a tablet, or the like.
- the foregoing various units may be implemented as an independent entity, and may be implemented in any combination, and may be implemented as the same entity or a plurality of entities.
- the foregoing units refer to the foregoing embodiments, and details are not described herein again.
- the electronic device 500 includes a processor 501 and a memory 502.
- the processor 501 is electrically connected to the memory 502.
- the processor 500 is a control center of the electronic device 500, which connects various parts of the entire electronic device using various interfaces and lines, and executes by running or loading a computer program stored in the memory 502 and calling data stored in the memory 502.
- the various functions of the electronic device 500 and processing of the data enable overall monitoring of the electronic device 500.
- the memory 502 can be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running computer programs and modules stored in the memory 502.
- the memory 502 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a computer program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of electronic devices, etc.
- memory 502 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 502 can also include a memory controller to provide processor 501 access to memory 502.
- the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and is stored in the memory 502 by the processor 501.
- the computer program in which to implement various functions, as follows:
- the resolution of the image in the classification library is compressed according to a preset rule.
- the processor 501 when acquiring an image in an album and performing image analysis on the image, the processor 501 may specifically perform the following steps:
- the plurality of features and the plurality of entity words are embedded in a process to generate a corresponding entity description.
- the processor 501 when determining the sample tag corresponding to the image according to the image analysis result, the processor 501 may specifically perform the following steps:
- the reorganized description of the entity is analyzed to determine the corresponding sample label.
- the processor 501 may specifically perform the following steps:
- the image is moved into the classification library.
- the processor 501 may further perform the following steps:
- the similarity between the keyword and the classification keyword is obtained, and the image is moved to the classification database with the highest similarity.
- the processor 501 may further perform the following steps:
- the prompt information is used to indicate whether the user performs compression processing on the image
- the operation instruction indicating a target image that needs to be subjected to compression processing
- the compression processing of the image in the classification library according to a preset rule includes:
- the resolution of the target image in the classification library is compressed according to a preset rule.
- the processor 501 may specifically perform the following steps:
- the resolution of the target image in the classification library is compressed according to a preset rule.
- the electronic device 500 may further include: a display 503, a radio frequency circuit 504, an audio circuit 505, and a power source 506.
- the display 503, the radio frequency circuit 504, the audio circuit 505, and the power source 506 are electrically connected to the processor 501, respectively.
- the display 503 can be used to display information entered by a user or information provided to a user, as well as various graphical user interfaces, which can be composed of graphics, text, icons, video, and any combination thereof.
- the display 503 can include a display panel.
- the display panel can be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
- LCD liquid crystal display
- OLED organic light-emitting diode
- the radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices through wireless communication, and to transmit and receive signals with network devices or other electronic devices.
- the audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker, a microphone.
- the power source 506 can be used to power various components of the electronic device 500.
- the power source 506 can be logically coupled to the processor 501 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
- the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
- the embodiment of the present application further provides a storage medium storing a computer program, when the computer program is run on a computer, causing the computer to execute the image processing method in any of the above embodiments, for example, acquiring an image in the album. And performing image analysis on the image; determining a sample label corresponding to the image according to the image analysis result; classifying the image based on the sample label, moving the image to a corresponding classification library; The resolution of the image in the classification library is compressed.
- the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM).
- ROM read only memory
- RAM random access memory
- the computer program may be stored in a computer readable storage medium, such as in a memory of the electronic device, and executed by at least one processor within the electronic device, and may include, for example, an image processing method during execution.
- the storage medium may be a magnetic disk, an optical disk, a read only memory, a random access memory, or the like.
- each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module.
- the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
- the integrated module if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Software Systems (AREA)
- Library & Information Science (AREA)
- Processing Or Creating Images (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Disclosed is an image processing method. The method comprises: acquiring an image in an album, and performing image analysis on the image; determining a sample label corresponding to the image according to the image analysis result; classifying the image on the basis of the sample label, and moving the image to a corresponding classification library; and compressing the resolution of the image in the classification library according to a preset rule. Thus, the utilization efficiency of the storage space of an electronic device is improved.
Description
本申请要求于2018年01月10日提交中国专利局、申请号为201810024319.6、发明名称为“一种图像处理方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201810024319.6, entitled "Image Processing Method, Apparatus, Storage Medium and Electronic Equipment", filed on January 10, 2018, the entire contents of which are hereby incorporated by reference. The citations are incorporated herein by reference.
本申请涉及图像处理技术领域,具体涉及一种图像处理方法、装置、存储介质及电子设备。The present application relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, storage medium, and electronic device.
目前,随着终端技术的高速发展,如智能手机越来越深入人们的生活之中,用户往往会在智能手机上安装大量的应用,如拍照应用、游戏应用、地图应用等等。At present, with the rapid development of terminal technologies, such as smart phones more and more people's lives, users often install a large number of applications on smartphones, such as camera applications, game applications, map applications and so on.
其中,用户在通过拍照应用拍摄图片或者保存其他应用中的图片后,图片都存在智能手机的存储空间中,由于当前智能手机的摄像头分辨率以及屏幕显示分辨率的不断提升,图片对应的分辨率也越来越高,占用的存储空间也越来越大,导致占用过量的存储空间,降低智能手机的运行速度。After the user takes a picture through the camera application or saves the picture in other applications, the picture exists in the storage space of the smart phone. Due to the current camera resolution of the smart phone and the screen display resolution, the resolution corresponding to the picture is increased. It is also getting higher and higher, and the storage space is also getting larger and larger, resulting in excessive storage space and lowering the running speed of the smartphone.
发明内容Summary of the invention
本申请实施例提供了一种图像处理方法、装置、存储介质及电子设备,能够提升电子设备的存储空间的利用效率。The embodiment of the present application provides an image processing method, device, storage medium, and electronic device, which can improve the utilization efficiency of the storage space of the electronic device.
第一方面,本申请实施例了提供了的一种图像处理方法,包括:In a first aspect, an embodiment of the present application provides an image processing method, including:
获取相册中的图像,并对所述图像进行图像分析;Acquiring images in the album and performing image analysis on the images;
根据图像分析结果确定所述图像对应的样本标签;Determining a sample label corresponding to the image according to an image analysis result;
基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中;Performing classification processing on the image based on the sample tag, and moving the image into a corresponding classification library;
根据预设规则对所述分类库中的图像的分辨率进行压缩处理。The resolution of the image in the classification library is compressed according to a preset rule.
第二方面,本申请实施例了提供了的一种图像处理装置,包括:In a second aspect, an image processing apparatus provided by the embodiment of the present application includes:
分析单元,用于获取相册中的图像,并对所述图像进行图像分析;An analyzing unit, configured to acquire an image in an album, and perform image analysis on the image;
标签确定单元,用于根据图像分析结果确定所述图像对应的样本标签;a label determining unit, configured to determine a sample label corresponding to the image according to the image analysis result;
移动单元,用于基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中;a moving unit, configured to perform classification processing on the image based on the sample label, and move the image into a corresponding classification library;
处理单元,用于根据预设规则对所述分类库中的图像的分辨率进行压缩处理。And a processing unit, configured to perform compression processing on a resolution of the image in the classification library according to a preset rule.
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请任一实施例提供的图像处理方法。In a third aspect, a storage medium provided by an embodiment of the present application has a computer program stored thereon, and when the computer program is run on a computer, the computer is caused to perform an image processing method according to any embodiment of the present application.
第四方面,本申请实施例提供一种电子设备,包括处理器和存储器,所述存储器有计算机程序,所述处理器通过调用所述计算机程序,用于执行步骤:In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory has a computer program, and the processor is configured to perform the steps by calling the computer program:
获取相册中的图像,并对所述图像进行图像分析;Acquiring images in the album and performing image analysis on the images;
根据图像分析结果确定所述图像对应的样本标签;Determining a sample label corresponding to the image according to an image analysis result;
基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中;Performing classification processing on the image based on the sample tag, and moving the image into a corresponding classification library;
根据预设规则对所述分类库中的图像的分辨率进行压缩处理。The resolution of the image in the classification library is compressed according to a preset rule.
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other drawings can also be obtained from those skilled in the art based on these drawings without paying any creative effort.
图1是本申请实施例提供的图像处理方法的一个流程示意图。FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
图2是本申请实施例提供的图像处理方法的另一个流程示意图。FIG. 2 is another schematic flowchart of an image processing method provided by an embodiment of the present application.
图3为本申请实施例提供的图像处理方法的应用场景示意图。FIG. 3 is a schematic diagram of an application scenario of an image processing method according to an embodiment of the present disclosure.
图4是本申请实施例提供的图像处理装置的一个结构示意图。FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
图5是本申请实施例提供的图像处理装置的另一结构示意图。FIG. 5 is another schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
图6是本申请实施例提供的电子设备的一个结构示意图。FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
图7是本申请实施例提供的电子设备的另一结构示意图。FIG. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Referring to the drawings, wherein like reference numerals represent the same components, the principles of the present application are illustrated by the implementation in a suitable computing environment. The following description is based on the specific embodiments of the present invention as illustrated, and should not be construed as limiting the specific embodiments that are not described herein.
本申请实施例提供一种图像处理方法,该图像处理方法的执行主体可以是 本申请实施例提供的图像处理装置,或者集成了该图像处理装置的电子设备,其中该图像处理装置可以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等设备。The embodiment of the present application provides an image processing method, and the execution body of the image processing method may be an image processing device provided by an embodiment of the present application, or an electronic device integrated with the image processing device, where the image processing device may adopt hardware or The way the software is implemented. The electronic device may be a device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
本发明实施例提供一种图像处理方法,包括:An embodiment of the present invention provides an image processing method, including:
获取相册中的图像,并对该图像进行图像分析;Obtain an image in the album and perform image analysis on the image;
根据图像分析结果确定该图像对应的样本标签;Determining a sample label corresponding to the image according to the image analysis result;
基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中;And classifying the image based on the sample label, and moving the image to a corresponding classification library;
根据预设规则对该分类库中的图像的分辨率进行压缩处理。The resolution of the image in the classification library is compressed according to a preset rule.
在一种实施方式中,该获取相册中的图像,并对该图像进行图像分析的步骤,可以包括:获取相册中的图像,并通过卷积神经网络提取该图像的多个特征;根据该多个特征生成对应的多个实体词;将该多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。In an embodiment, the step of acquiring an image in an album and performing image analysis on the image may include: acquiring an image in the album, and extracting a plurality of features of the image by using a convolutional neural network; The plurality of features generate a corresponding plurality of entity words; the plurality of features and the plurality of entity words are embedded and processed to generate a corresponding entity description.
在一种实施方式中,该根据图像分析结果确定该图像对应的样本标签的步骤,可以包括:对该图像对应的实体描述进行智能重组,生成重组后的实体描述;对重组后的该实体描述进行分析,确定对应的样本标签。In an embodiment, the step of determining a sample tag corresponding to the image according to the image analysis result may include: performing an intelligent reorganization of the entity description corresponding to the image, generating a recombined entity description; and describing the reorganized entity Analyze and determine the corresponding sample label.
在一种实施方式中,该基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中的步骤,可以包括:获取该样本标签指示的关键词;获取分类库对应指示的分类关键词;判断该关键词与该分类关键词是否匹配;当判断出该关键词与该分类关键词匹配时,将该图像移动到该分类库中。In an embodiment, the step of classifying the image based on the sample label, and moving the image to the corresponding classification library may include: acquiring a keyword indicated by the sample label; and obtaining a corresponding indication of the classification library Sorting a keyword; determining whether the keyword matches the classified keyword; and when determining that the keyword matches the classified keyword, moving the image into the classified library.
在一种实施方式中,该判断该关键词与该分类关键词是否匹配的步骤之后,还可以包括:当判断出该关键词与该分类关键词不匹配时,生成提示信息,以提示用户对该图像进行分类处理;或当判断出该关键词与该分类关键词不匹配时,获取该关键词与该分类关键词的相似度,将该图像移动到相似度最高的分类库中。In an embodiment, after the step of determining whether the keyword matches the classified keyword, the method may further include: when determining that the keyword does not match the classified keyword, generating prompt information to prompt the user to The image is classified; or when it is determined that the keyword does not match the classified keyword, the similarity between the keyword and the classified keyword is obtained, and the image is moved to the classification database with the highest similarity.
在一种实施方式中,该根据预设规则对该分类库中的图像的分辨率进行压缩处理的步骤之前,还可以包括:获取分类库中的图像,并生成全部图像对应缩略图并进行列表显示;生成提示信息,该提示信息用于指示用户是否对图像进行压缩处理;接收用户根据该提示信息输入的操作指令,该操作指令指示需要进行压缩处理的目标图像。In an embodiment, before the step of compressing the resolution of the image in the classification library according to the preset rule, the method may further include: acquiring an image in the classification library, and generating a thumbnail image of all the images and performing a list. Displaying; generating prompt information for indicating whether the user performs compression processing on the image; receiving an operation instruction input by the user according to the prompt information, the operation instruction indicating a target image that needs to be subjected to compression processing.
在一种实施方式中,该根据预设规则对该分类库中的图像的分辨率进行压 缩处理的步骤,可以包括:根据预设规则对该分类库中的目标图像的分辨率进行压缩处理。In an embodiment, the step of compressing the resolution of the image in the classification library according to the preset rule may include: compressing the resolution of the target image in the classification library according to a preset rule.
请参阅图1,图1为本申请实施例提供的图像处理方法的流程示意图。本申请实施例提供的图像处理方法的具体流程可以如下:Please refer to FIG. 1. FIG. 1 is a schematic flowchart diagram of an image processing method according to an embodiment of the present application. The specific process of the image processing method provided by the embodiment of the present application may be as follows:
201、获取相册中的图像,并对图像进行图像分析。201. Acquire an image in the album and perform image analysis on the image.
其中,本实施例中所提到的图像分析是基于Image Caption(自动生成图像标题)技术上完成的,该自动生成图像标题技术是一个融合计算机视觉、自然语言处理和机器学习的综合问题,用尽可能准确的用语来描述图像。The image analysis mentioned in the embodiment is technically completed based on Image Caption, which is a comprehensive problem of integrating computer vision, natural language processing and machine learning. Describe the image as accurately as possible.
其中,该相册中的图像包括电子设备存储的所有图像,该图像可以为多种格式的图像,如Bmp、jpg、png、tiff、gif、pcx、tga、exif、fpx、svg、psd、cdr、pcd、dxf、ufo、eps、ai、raw、WMF等格式。The image in the album includes all images stored by the electronic device, and the image may be an image in multiple formats, such as Bmp, jpg, png, tiff, gif, pcx, tga, exif, fpx, svg, psd, cdr, Pdd, dxf, ufo, eps, ai, raw, WMF and other formats.
需要说明的是,卷积神经网络(Convolutional Neural Network,CNN)是一种前馈神经网络,它的人工神经元可以响应一部分覆盖范围内的周围单元,对于大型图像处理有出色表现。It should be noted that the Convolutional Neural Network (CNN) is a feedforward neural network whose artificial neurons can respond to surrounding units in a part of coverage and have excellent performance for large image processing.
在一实施方式中,通过卷积神经网络获取图像的特征,然后根据这些特征生成对应的实体词,如卷积神经网络获取到图像中的人物的特征,那么根据该人物的特征可以生成实体词为人。In an embodiment, the features of the image are acquired by the convolutional neural network, and corresponding entity words are generated according to the features, for example, the convolutional neural network acquires the features of the characters in the image, and the entity words can be generated according to the characteristics of the characters. For people.
进一步的,将通过卷积神经网络获取的特征和实体词嵌入到同一空间,然后选择最优描述,以生成实体描述。通过该实体描述,可以对图像进行初步的认知,以便后期对该图像进行分类操作。Further, the features and entity words obtained by the convolutional neural network are embedded in the same space, and then the optimal description is selected to generate an entity description. Through the description of the entity, the image can be initially recognized so that the image can be classified later.
202、根据图像分析结果确定图像对应的样本标签。202. Determine a sample label corresponding to the image according to the image analysis result.
其中,该样本标签为对图像的概括性描述,通过该样本标签可以知道该图像的功能作用。The sample label is a general description of the image, and the function of the image can be known through the sample label.
在一实施方式中,可以通过一定的语法数据库对步骤201中的实体描述进行重组,以生成语法逻辑通顺的实体描述,以便对该图像的样本标签进行概括。In an embodiment, the entity description in step 201 may be reorganized through a certain grammar database to generate a grammatically fluent entity description to summarize the sample tags of the image.
进一步的,通过对重组后的实体描述进行分析,提取其中关键词确定该图像的样本标签。Further, by analyzing the reorganized entity description, a sample tag in which the keyword is determined is extracted.
203、基于样本标签对图像进行分类处理,将图像移动到对应的分类库中。203. Perform classification processing on the image based on the sample label, and move the image to the corresponding classification library.
在一实施方式中,可以建立多个分类库,每一分类库中对应不同的分类关键词。如人物类分类库,人物分类库对应的分类关键词为人、面部、眼睛以及 身体等。以及文件型分类库,文件型分类库对应的分类关键词为文字、文件以及公式等。该分类库还可以包括多种类型,此处不作一一赘述。In an embodiment, a plurality of classification libraries may be established, and each classification library corresponds to a different classification keyword. For example, the character classification library, the classification keywords corresponding to the character classification library are people, faces, eyes, and the body. And the file type classification library, the classification keywords corresponding to the file type classification library are characters, files, formulas, and the like. The classification library can also include multiple types, which are not described here.
其中,通过分别获取样本标签指示的关键词以及分类库对应指示的分类关键词,判断两者是否匹配,当判断出两者匹配时,将该图像移动到该分类库中,当判断出两者不匹配时,继续获取另一分类库对应指示的分类关键词。Wherein, by respectively obtaining the keyword indicated by the sample tag and the classification keyword corresponding to the classification library, it is determined whether the two match, and when it is determined that the two match, the image is moved into the classification library, and when the two are determined If there is no match, continue to obtain the classification keyword corresponding to the other classification library.
在一实施方式中,当检测到样本标签指示的关键词与所有分类库对应指示的分类关键词都不匹配时,可以生成提示信息,提示用户对该图像进行手动分类处理,或者可以根据关键词相似度匹配,将该图像移动到关键词相似度匹配值最高的分类库中。In an embodiment, when it is detected that the keyword indicated by the sample label does not match the classification keyword indicated by all the classification libraries, the prompt information may be generated to prompt the user to manually classify the image, or may be based on keywords. The similarity is matched, and the image is moved to a classification library with the highest keyword similarity matching value.
204、根据预设规则对分类库中的图像的分辨率进行压缩处理。204. Perform compression processing on the resolution of the image in the classification library according to a preset rule.
可以理解的是,有些图像由于用途的原因,不必使用过于高的分辨率,如文字类图像,只需要用户可以看清楚图像中的文字即可以。Understandably, some images do not have to use too high resolution due to the purpose of use, such as text-like images, only the user can see the text in the image.
其中,根据预设规则对不同分类库中的图像的分辨率进行压缩处理,可以节省出大量的存储空间,比如,人物类分类库因为其中为对人像的拍摄,需要越高的分辨率越好,所以可对该人物类分类库中图像的像素不进行压缩处理,而文件类分类库中保存的一般为对文字、文件以及公式的拍摄,所以可对该文件类分类库中的图像的像素进行适量的压缩,如压缩百分之七十,由于图像的像素的降低,可以使得图像的存储大小相应减小,进而节省出电子设备的存储空间。Among them, according to the preset rule, the resolution of the images in different classification libraries is compressed, which can save a lot of storage space. For example, the character class classification library needs to have a higher resolution as the shooting of the portrait is better. Therefore, the pixels of the image in the character class classification library are not compressed, and the file class classification library generally stores the characters, files, and formulas, so the pixels of the image in the file class classification library can be Appropriate amount of compression, such as compression of 70%, due to the reduction of the pixels of the image, can reduce the storage size of the image, thereby saving the storage space of the electronic device.
由上可知,本申请实施例通过对相册中的图像进行特征分析,确定图像对应的样本标签,并基于样本标签对图像进行分类,将图像移动到对应的分类库中,并根据预设规则对分类库中的图像的分辨率进行压缩处理,实现了对不同类别的图像的像素进行对应的压缩操作,节省了电子设备的存储空间,提升了电子设备的存储空间的利用效率。It can be seen from the above that the embodiment of the present application determines the sample tags corresponding to the image by performing feature analysis on the image in the album, and classifies the image based on the sample tags, moves the image into the corresponding classification library, and according to the preset rule The resolution of the image in the classification library is compressed, and the corresponding compression operation is performed on the pixels of different types of images, which saves the storage space of the electronic device and improves the utilization efficiency of the storage space of the electronic device.
进一步地,基于卷积神经网络提取图像的特征信息,可以提升图像特征识别的准确性,且更贴合用户的使用习惯。Further, extracting the feature information of the image based on the convolutional neural network can improve the accuracy of the image feature recognition and is more suitable for the user's usage habits.
下面将在上述实施例描述的方法基础上,对本申请的分类方法做进一步介绍。参考图2,该图像处理方法可以包括:The classification method of the present application will be further described below based on the method described in the above embodiments. Referring to FIG. 2, the image processing method may include:
301、获取相册中的图像,并通过卷积神经网络提取图像的多个特征。301. Acquire an image in an album and extract a plurality of features of the image through a convolutional neural network.
其中,电子设备通过对图像的边缘以及形状的情况进行分析,抽取出整体 的视觉效果,找出其中不同的识别特征,将之提取出来以便找到图像中与周边环境区别出来的特征。The electronic device analyzes the edge and shape of the image, extracts the overall visual effect, finds different recognition features, and extracts it to find the features in the image that are different from the surrounding environment.
如图3所示,在第一步1中电子设备100的显示屏上显示了图像101,通过卷积神经网络提取该图像101的多个特征,如与周边环境区别出来的特征为1011以及1012。As shown in FIG. 3, an image 101 is displayed on the display screen of the electronic device 100 in the first step 1, and a plurality of features of the image 101 are extracted by a convolutional neural network, such as 1011 and 1012 distinguished from the surrounding environment. .
302、根据多个特征生成对应的多个实体词。302. Generate corresponding multiple entity words according to multiple features.
其中,通过对提取出来的多个特征进行进一步分析,可以得出每一特征对应的实体词,该实体词用于对该特征进行概述。The entity word corresponding to each feature can be obtained by further analyzing the extracted multiple features, and the entity word is used to summarize the feature.
如图3所示,在第二步中电子设备通过对特征1011以及1012进行分析,确定特征1011的实体词为人,1012的实体词为车。As shown in FIG. 3, in the second step, the electronic device analyzes the features 1011 and 1012 to determine that the entity word of the feature 1011 is a person, and the entity word of 1012 is a car.
303、将多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。303. Perform embedding processing on multiple features and multiple entity words to generate a corresponding entity description.
其中,可以根据多个特征在图像中的对应关系以及多个实体词,生成对应的实体描述,通过该实体描述,可以对图像进行初步的认知,如图3中,根据特征1011以及特征1012的位置关系,和特征1011以及特征1012对应的实体词,进行嵌入处理,生成对应的实体描述可以为“人和车”。The corresponding entity description may be generated according to the correspondence between the multiple features in the image and the plurality of entity words, and the image may be initially recognized by the entity description, as shown in FIG. 3, according to the feature 1011 and the feature 1012. The location relationship, and the entity words corresponding to the feature 1011 and the feature 1012, are embedded, and the corresponding entity description can be "person and car".
304、对图像对应的实体描述进行智能重组,生成重组后的实体描述。304. Perform intelligent reorganization on the entity description corresponding to the image, and generate a reorganized entity description.
在一实施方式中,可以在电子设备中加载语法数据库,该语法数据库中包括对实体描述的句子进行组合的规则。In an embodiment, a grammar database may be loaded in the electronic device, the grammar database including rules for combining sentences described by the entities.
其中,基于该语法数据库对实体描述中的描述进行智能重组,使得重组后的实体描述语法逻辑通顺,以便可以对该图像的样本标签更好的概述,如对实体描述为“人和车”进行智能重组,可以得到重组后的实体描述为“人站在车旁边拍照”The intelligent reorganization of the description in the entity description is performed based on the grammar database, so that the reorganized entity description grammar logic is fluent, so that the sample label of the image can be better summarized, for example, the entity description is “person and car”. Intelligent reorganization, the entity that can be reorganized is described as "people standing next to the car to take pictures"
305、对重组后的实体描述进行分析,确定对应的样本标签。305. Analyze the reorganized entity description to determine a corresponding sample label.
其中,通过对重组后的实体描述进行分析,提取出关键字,作为该图像的样本标签。Among them, by analyzing the reorganized entity description, the keyword is extracted as a sample tag of the image.
比如,对重组后的实体描述为“人站在车旁边拍照”进行关键字提取,可以提取出关键字“人”、“车”以及“拍照”。For example, if the reorganized entity is described as "people standing next to the car taking pictures" for keyword extraction, the keywords "person", "car" and "photograph" can be extracted.
在一实施方式中,可以建立多个分类库,每一分类库中对应不同的分类关键词。如人物类分类库,人物分类库对应的分类关键词为人、面部、眼睛、拍照以及身体等。以及文件型分类库,文件型分类库对应的分类关键词为文字、 文件以及公式等。In an embodiment, a plurality of classification libraries may be established, and each classification library corresponds to a different classification keyword. For example, the character classification library, the classification keywords corresponding to the character classification library are people, faces, eyes, photographs, and the body. And the file type classification library, the classification keywords corresponding to the file type classification library are characters, files, formulas, and the like.
306、获取样本标签指示的关键词。306. Obtain a keyword indicated by the sample label.
其中,获取图像的样本标签指示的关键词,如获取样本标签的关键词为“人”、“车”以及“拍照”。The keyword indicated by the sample label of the image is obtained, for example, the keywords for obtaining the sample label are “person”, “car” and “photograph”.
307、获取分类库对应指示的分类关键词。307. Obtain a classification keyword corresponding to the classification library.
其中,获取分类库对应指示的分类关键词,如人物类分类库对应的分类关键词为人、面部、眼睛、拍照以及身体等,文件型分类库对应的分类关键词为文字、文件以及公式等。The classification keywords corresponding to the classification library are obtained, for example, the classification keywords corresponding to the character classification library are people, faces, eyes, photographs, and bodies, and the classification keywords corresponding to the file type classification library are characters, files, and formulas.
308、判断关键词与分类关键词是否匹配。308. Determine whether the keyword matches the classification keyword.
其中,当判断出关键词与分类关键词匹配时,执行步骤309;当判断出关键词与分类关键词不匹配时,返回执行步骤307,获取另一分类库对应指示的分类关键词。When it is determined that the keyword matches the classification keyword, step 309 is performed; when it is determined that the keyword does not match the classification keyword, the process returns to step 307 to acquire the classification keyword corresponding to the other classification library.
在一实施方式中,当检测到样本标签指示的关键词与所有分类库对应指示的分类关键词都不匹配时,可以生成提示信息,提示用户对该图像进行手动分类处理。In an embodiment, when it is detected that the keyword indicated by the sample label does not match the classification keyword indicated by all the classification libraries, the prompt information may be generated to prompt the user to perform manual classification processing on the image.
309、将图像移动到分类库中。309. Move the image to the classification library.
其中,当判断出关键词与分类关键词匹配时,说明该图像对应的使用功能用途符合分类库的要求,将该图像移动到分类库中。需要特别说明的是,本实施例中的移动为剪切操作,即将图像的存储位置剪切到分类库中对应的存储位置中。Wherein, when it is determined that the keyword matches the classification keyword, it indicates that the usage function corresponding to the image meets the requirements of the classification library, and the image is moved into the classification library. It should be particularly noted that the movement in this embodiment is a cutting operation, that is, cutting the storage location of the image into a corresponding storage location in the classification library.
310、获取分类库中的图像,并生成全部图像对应缩略图并进行列表显示。310. Acquire images in the classification library, and generate thumbnail images of all images and display the list.
其中,为了避免错误的将一些图像进行压缩处理,在压缩处理操作之间,会将分类库中的全部图像以缩略图的形式进行列表显示。Among them, in order to avoid erroneously compressing some images, all the images in the classification library are displayed in the form of thumbnails between compression processing operations.
在一实施方式中,该缩略图上还包括勾选按钮,当勾选按钮为选中状态时,需要对图像进行压缩处理,当勾选按钮不为选中状态时,不需要对图像进行压缩处理。默认的全部图像的缩略图上的勾选按钮都为选中状态。In an embodiment, the thumbnail further includes a check button. When the check button is selected, the image needs to be compressed. When the check button is not selected, the image does not need to be compressed. The default checkmarks on the thumbnails of all images are selected.
311、生成提示信息,并接收用户根据提示信息输入的操作指令。311. Generate prompt information, and receive an operation instruction input by the user according to the prompt information.
其中,生成提示信息,该提示信息用于指示用户是否对图像进行压缩处理,此时,用户可以手动取消不需要进行压缩处理的图像,如用户可以手动取消某图像的缩略图上的选中状态。并当用户确认后,会对应生成操作指令,该操作 指令指示需要进行压缩处理的目标图像。基于此,灵活的对图像进行压缩处理,可以避免批量处理将一些不需要进行像素的处理的图像也进行压缩处理,使得后期由于像素过低导致影响用户观看的情况。The prompt information is used to indicate whether the user performs compression processing on the image. At this time, the user can manually cancel the image that does not need to be compressed, for example, the user can manually cancel the selected state on the thumbnail of the image. And when the user confirms, an operation instruction is generated corresponding to the target image that needs to be subjected to compression processing. Based on this, the flexible compression processing of the image can avoid batch processing and also compress some images that do not need to be processed by the pixel, so that the user may be affected by the pixel due to the low pixel.
312、根据预设规则对分类库中的目标图像的分辨率进行压缩处理。312. Perform compression processing on a resolution of the target image in the classification library according to a preset rule.
其中,对于不同的分类库可以设置不同的压缩规则,比如,人物类分类库因为其中为对人像的拍摄,需要越高的分辨率越好,所以压缩规则为不进行压缩,而文件类分类库中保存的一般为对文字、文件以及公式的拍摄,所以可对该文件类分类库中的图像的像素进行适量的压缩,如压缩规则为百分之七十。基于此,可以将一些像素要求不是特别高的图像进行适量压缩,在保证不影响用户使用的情况下,又可极大节省图像占用的存储空间。Among them, different compression rules can be set for different classification libraries. For example, the character class classification library requires a higher resolution as the shooting of the portrait, so the compression rule is not compression, and the file class classification library It is generally used to capture text, files, and formulas, so the pixels of the image in the file class classification library can be compressed in an appropriate amount, such as a compression rule of 70%. Based on this, an image that is not particularly high in pixel requirements can be compressed in an appropriate amount, and the storage space occupied by the image can be greatly saved while ensuring that the user is not affected.
在一些实施方式中,在对目标图像的分辨率进行压缩处理后,用户还可以通过撤回操作恢复目标图像压缩之前的分辨率。In some embodiments, after compressing the resolution of the target image, the user may also recover the resolution before the target image is compressed by the recall operation.
由上可知,本申请实施例通过对相册中的图像进行特征分析,确定图像对应的样本标签,并基于样本标签对图像进行分类,将图像移动到对应的分类库中,并根据预设规则对分类库中的图像的分辨率进行压缩处理,实现了对不同类别的图像的像素进行对应的压缩操作,节省了电子设备的存储空间,提升了电子设备的存储空间的利用效率。It can be seen from the above that the embodiment of the present application determines the sample tags corresponding to the image by performing feature analysis on the image in the album, and classifies the image based on the sample tags, moves the image into the corresponding classification library, and according to the preset rule The resolution of the image in the classification library is compressed, and the corresponding compression operation is performed on the pixels of different types of images, which saves the storage space of the electronic device and improves the utilization efficiency of the storage space of the electronic device.
进一步地,基于卷积神经网络提取图像的特征信息,可以提升图像特征识别的准确性,且更贴合用户的使用习惯。Further, extracting the feature information of the image based on the convolutional neural network can improve the accuracy of the image feature recognition and is more suitable for the user's usage habits.
本发明实施例提供一种图像处理装置,包括:An embodiment of the present invention provides an image processing apparatus, including:
分析单元,用于获取相册中的图像,并对该图像进行图像分析;An analyzing unit, configured to acquire an image in an album, and perform image analysis on the image;
标签确定单元,用于根据图像分析结果确定该图像对应的样本标签;a label determining unit, configured to determine a sample label corresponding to the image according to the image analysis result;
移动单元,用于基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中;a mobile unit, configured to classify the image based on the sample label, and move the image to a corresponding classification library;
处理单元,用于根据预设规则对该分类库中的图像的分辨率进行压缩处理。And a processing unit, configured to perform compression processing on the resolution of the image in the classification library according to a preset rule.
在一种实施方式中,该分析单元,可以包括:提取子单元,用于获取相册中的图像,并通过卷积神经网络提取该图像的多个特征;生成子单元,用于根据该多个特征生成对应的多个实体词;嵌入子单元,用于将该多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。In an embodiment, the analyzing unit may include: an extracting subunit, configured to acquire an image in the album, and extract a plurality of features of the image by using a convolutional neural network; and generate a subunit for using the plurality of The feature generates a plurality of corresponding entity words; the embedded subunit is configured to embed the plurality of features and the plurality of entity words to generate a corresponding entity description.
在一种实施方式中,标签确定单元,可以包括:重组子单元,用于对该图 像对应的实体描述进行智能重组,生成重组后的实体描述;确定子单元,用于对重组后的该实体描述进行分析,确定对应的样本标签。In an embodiment, the label determining unit may include: a recombining subunit, configured to perform intelligent reorganization of the entity description corresponding to the image, generate a reorganized entity description, and determine a subunit for the reorganized entity The description is analyzed to determine the corresponding sample label.
在一种实施方式中,移动单元,具体用于:获取该样本标签指示的关键词;获取分类库对应指示的分类关键词;判断该关键词与该分类关键词是否匹配;当判断出该关键词与该分类关键词匹配时,将该图像移动到该分类库中。In an embodiment, the mobile unit is specifically configured to: obtain a keyword indicated by the sample tag; acquire a classification keyword corresponding to the classification library; determine whether the keyword matches the classification keyword; and determine the key When the word matches the category keyword, the image is moved to the classification library.
在一种实施方式中,移动单元,具体还用于:获取该样本标签指示的关键词;获取分类库对应指示的分类关键词;判断该关键词与该分类关键词是否匹配;当判断出该关键词与该分类关键词匹配时,将该图像移动到该分类库中;当判断出该关键词与该分类关键词不匹配时,生成提示信息,以提示用户对该图像进行分类处理;或当判断出该关键词与该分类关键词不匹配时,获取该关键词与该分类关键词的相似度,将该图像移动到相似度最高的分类库中。In an embodiment, the mobile unit is further configured to: obtain a keyword indicated by the sample tag; acquire a classification keyword corresponding to the classification library; determine whether the keyword matches the classification keyword; and determine the When the keyword matches the classification keyword, the image is moved into the classification library; when it is determined that the keyword does not match the classification keyword, the prompt information is generated to prompt the user to classify the image; or When it is determined that the keyword does not match the classification keyword, the similarity between the keyword and the classification keyword is obtained, and the image is moved to the classification database with the highest similarity.
在一实施例中还提供了一种图像处理装置。请参阅图4,图4为本申请实施例提供的图像处理装置的结构示意图。其中该图像处理装置应用于电子设备,该图像处理装置包括分析单元401、标签确定单元402、移动单元403、和处理单元404,如下:An image processing apparatus is also provided in an embodiment. Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application. Wherein the image processing apparatus is applied to an electronic device, the image processing apparatus comprising an analyzing unit 401, a label determining unit 402, a moving unit 403, and a processing unit 404, as follows:
该分析单元401,用于获取相册中的图像,并对该图像进行图像分析;The analyzing unit 401 is configured to acquire an image in an album, and perform image analysis on the image;
其中,该分析单元401通过卷积神经网络获取图像的特征,然后根据这些特征生成对应的实体词,如卷积神经网络获取到图像中的人物的特征,那么根据该人物的特征可以生成实体词为人。The analyzing unit 401 acquires the features of the image through the convolutional neural network, and then generates corresponding entity words according to the features, such as the convolutional neural network acquiring the features of the characters in the image, and then generating the entity words according to the characteristics of the characters. For people.
进一步的,该分析单元401将通过卷积神经网络获取的特征和实体词嵌入到同一空间,然后选择最优描述,以生成实体描述。通过该实体描述,可以对图像进行初步的认知,以便后期对该图像进行分类操作。Further, the analyzing unit 401 embeds the feature and the entity word acquired through the convolutional neural network into the same space, and then selects the optimal description to generate an entity description. Through the description of the entity, the image can be initially recognized so that the image can be classified later.
该标签确定单元402,用于根据图像分析结果确定该图像对应的样本标签。The label determining unit 402 is configured to determine a sample label corresponding to the image according to the image analysis result.
其中,该标签确定单元402可以通过一定的语法数据库对实体描述进行重组,以生成语法逻辑通顺的实体描述,以便对该图像的样本标签进行概括。The tag determining unit 402 may reorganize the entity description through a certain grammar database to generate a grammatical logic compliant entity description to summarize the sample tags of the image.
进一步的,该标签确定单元402通过对重组后的实体描述进行分析,提取其中关键词确定该图像的样本标签。Further, the tag determining unit 402 extracts a sample tag in which the keyword determines the image by analyzing the reorganized entity description.
该移动单元403,用于基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中。The moving unit 403 is configured to perform classification processing on the image based on the sample label, and move the image into a corresponding classification library.
其中,该移动单元403通过分别获取样本标签指示的关键词以及分类库对 应指示的分类关键词,判断两者是否匹配,当判断出两者匹配时,将该图像移动到该分类库中,当判断出两者不匹配时,继续获取另一分类库对应指示的分类关键词。The mobile unit 403 determines whether the two are matched by respectively acquiring the keyword indicated by the sample tag and the classification keyword corresponding to the classification library, and when the two are matched, the image is moved to the classification library. When it is determined that the two do not match, the classification keyword corresponding to the indication of another classification library is continuously obtained.
该处理单元404,用于根据预设规则对该分类库中的图像的分辨率进行压缩处理。The processing unit 404 is configured to perform compression processing on the resolution of the image in the classification library according to a preset rule.
其中,该处理单元404根据预设规则对不同分类库中的图像的分辨率进行压缩处理,可以节省出大量的存储空间,比如,人物类分类库因为其中为对人像的拍摄,需要越高的分辨率越好,所以可对该人物类分类库中图像的像素不进行压缩处理,而文件类分类库中保存的一般为对文字、文件以及公式的拍摄,所以可对该文件类分类库中的图像的像素进行适量的压缩,如压缩百分之七十,由于图像的像素的降低,可以使得图像的存储大小相应减小,进而节省出电子设备的存储空间。The processing unit 404 compresses the resolution of the images in different classification libraries according to the preset rule, which can save a large amount of storage space. For example, the character classification library needs to be higher because it is for shooting a portrait. The better the resolution, the pixels of the image in the character class classification library are not compressed, and the file class classification library generally stores the characters, files and formulas, so the file class classification library can be used. The pixels of the image are compressed by an appropriate amount, such as 70% compression. Due to the reduction of the pixels of the image, the storage size of the image can be correspondingly reduced, thereby saving the storage space of the electronic device.
在一实施例中,参考图5,该分析单元401,可以包括:In an embodiment, referring to FIG. 5, the analyzing unit 401 may include:
提取子单元4011,用于获取相册中的图像,并通过卷积神经网络提取该图像的多个特征;An extracting subunit 4011, configured to acquire an image in the album, and extract a plurality of features of the image by using a convolutional neural network;
生成子单元4012,用于根据该多个特征生成对应的多个实体词;a generating subunit 4012, configured to generate a corresponding plurality of entity words according to the plurality of features;
嵌入子单元4013,用于将该多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。The embedding sub-unit 4013 is configured to perform embedding processing on the plurality of features and the plurality of entity words to generate a corresponding entity description.
在一实施例中,参考图5,该该标签确定单元402,可以包括:In an embodiment, referring to FIG. 5, the label determining unit 402 may include:
重组子单元4021,用于对该图像对应的实体描述进行智能重组,生成重组后的实体描述;The recombination sub-unit 4021 is configured to perform intelligent reorganization on the entity description corresponding to the image to generate a reorganized entity description.
确定子单元4022,用于对重组后的该实体描述进行分析,确定对应的样本标签。The determining sub-unit 4022 is configured to analyze the reorganized description of the entity to determine a corresponding sample tag.
其中,图像处理装置中各单元执行的步骤可以参考上述方法实施例描述的方法步骤。该图像处理装置可以集成在电子设备中,如手机、平板电脑等。The steps performed by each unit in the image processing apparatus may refer to the method steps described in the foregoing method embodiments. The image processing device can be integrated in an electronic device such as a mobile phone, a tablet, or the like.
具体实施时,以上各个单元可以作为独立的实体实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单位的具体实施可参见前面的实施例,在此不再赘述。In the specific implementation, the foregoing various units may be implemented as an independent entity, and may be implemented in any combination, and may be implemented as the same entity or a plurality of entities. For the specific implementation of the foregoing units, refer to the foregoing embodiments, and details are not described herein again.
本申请实施例还提供一种电子设备。请参阅图6,电子设备500包括处理器501以及存储器502。其中,处理器501与存储器502电性连接。An embodiment of the present application further provides an electronic device. Referring to FIG. 6, the electronic device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
该处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据,从而对电子设备500进行整体监控。The processor 500 is a control center of the electronic device 500, which connects various parts of the entire electronic device using various interfaces and lines, and executes by running or loading a computer program stored in the memory 502 and calling data stored in the memory 502. The various functions of the electronic device 500 and processing of the data enable overall monitoring of the electronic device 500.
该存储器502可用于存储软件程序以及模块,处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供处理器501对存储器502的访问。The memory 502 can be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running computer programs and modules stored in the memory 502. The memory 502 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a computer program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of electronic devices, etc. Moreover, memory 502 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 502 can also include a memory controller to provide processor 501 access to memory 502.
在本申请实施例中,电子设备500中的处理器501会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器502中,并由处理器501运行存储在存储器502中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 501 in the electronic device 500 loads the instructions corresponding to the process of one or more computer programs into the memory 502 according to the following steps, and is stored in the memory 502 by the processor 501. The computer program in which to implement various functions, as follows:
获取相册中的图像,并对该图像进行图像分析;Obtain an image in the album and perform image analysis on the image;
根据图像分析结果确定该图像对应的样本标签;Determining a sample label corresponding to the image according to the image analysis result;
基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中;And classifying the image based on the sample label, and moving the image to a corresponding classification library;
根据预设规则对该分类库中的图像的分辨率进行压缩处理。The resolution of the image in the classification library is compressed according to a preset rule.
在某些实施方式中,在获取相册中的图像,并对该图像进行图像分析时,处理器501可以具体执行以下步骤:In some embodiments, when acquiring an image in an album and performing image analysis on the image, the processor 501 may specifically perform the following steps:
获取相册中的图像,并通过卷积神经网络提取该图像的多个特征;Acquiring an image in the album and extracting a plurality of features of the image through a convolutional neural network;
根据该多个特征生成对应的多个实体词;Generating a corresponding plurality of entity words according to the plurality of features;
将该多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。The plurality of features and the plurality of entity words are embedded in a process to generate a corresponding entity description.
在某些实施方式中,在根据图像分析结果确定该图像对应的样本标签时,处理器501可以具体执行以下步骤:In some embodiments, when determining the sample tag corresponding to the image according to the image analysis result, the processor 501 may specifically perform the following steps:
对该图像对应的实体描述进行智能重组,生成重组后的实体描述;Performing intelligent reorganization on the entity description corresponding to the image to generate a reorganized entity description;
对重组后的该实体描述进行分析,确定对应的样本标签。The reorganized description of the entity is analyzed to determine the corresponding sample label.
在某些实施方式中,在基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中时,处理器501可以具体执行以下步骤:In some embodiments, when the image is classified based on the sample tag, and the image is moved to the corresponding classification library, the processor 501 may specifically perform the following steps:
获取该样本标签指示的关键词;Obtaining keywords indicated by the sample tag;
获取分类库对应指示的分类关键词;Obtaining a classification keyword corresponding to the classification library;
判断该关键词与该分类关键词是否匹配;Determining whether the keyword matches the classified keyword;
当判断出该关键词与该分类关键词匹配时,将该图像移动到该分类库中。When it is determined that the keyword matches the classified keyword, the image is moved into the classification library.
某些实施方式中,在判断该关键词与该分类关键词是否匹配之后,处理器501还可以具体执行以下步骤:In some embodiments, after determining whether the keyword matches the classified keyword, the processor 501 may further perform the following steps:
当判断出该关键词与该分类关键词不匹配时,生成提示信息,以提示用户对该图像进行分类处理;或When it is determined that the keyword does not match the classified keyword, generating prompt information to prompt the user to classify the image; or
当判断出该关键词与该分类关键词不匹配时,获取该关键词与该分类关键词的相似度,将该图像移动到相似度最高的分类库中。When it is determined that the keyword does not match the classification keyword, the similarity between the keyword and the classification keyword is obtained, and the image is moved to the classification database with the highest similarity.
在某些实施方式中,在根据预设规则对该分类库中的图像的分辨率进行压缩处理之前,处理器501还可以具体执行以下步骤:In some embodiments, before compressing the resolution of the image in the classification library according to a preset rule, the processor 501 may further perform the following steps:
获取分类库中的图像,并生成全部图像对应缩略图并进行列表显示;Obtain images in the classification library, and generate thumbnail images of all images and display the list;
生成提示信息,该提示信息用于指示用户是否对图像进行压缩处理;Generating prompt information, the prompt information is used to indicate whether the user performs compression processing on the image;
接收用户根据该提示信息输入的操作指令,该操作指令指示需要进行压缩处理的目标图像;Receiving an operation instruction input by the user according to the prompt information, the operation instruction indicating a target image that needs to be subjected to compression processing;
该根据预设规则对该分类库中的图像的分辨率进行压缩处理,包括:The compression processing of the image in the classification library according to a preset rule includes:
根据预设规则对该分类库中的目标图像的分辨率进行压缩处理。The resolution of the target image in the classification library is compressed according to a preset rule.
在某些实施方式中,在根据预设规则对该分类库中的图像的分辨率进行压缩处理时,处理器501可以具体执行以下步骤:In some embodiments, when the resolution of the image in the classification library is compressed according to a preset rule, the processor 501 may specifically perform the following steps:
根据预设规则对该分类库中的目标图像的分辨率进行压缩处理。The resolution of the target image in the classification library is compressed according to a preset rule.
请一并参阅图7,在某些实施方式中,电子设备500还可以包括:显示器503、射频电路504、音频电路505以及电源506。其中,其中,显示器503、射频电路504、音频电路505以及电源506分别与处理器501电性连接。Referring to FIG. 7 together, in some embodiments, the electronic device 500 may further include: a display 503, a radio frequency circuit 504, an audio circuit 505, and a power source 506. The display 503, the radio frequency circuit 504, the audio circuit 505, and the power source 506 are electrically connected to the processor 501, respectively.
该显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 503 can be used to display information entered by a user or information provided to a user, as well as various graphical user interfaces, which can be composed of graphics, text, icons, video, and any combination thereof. The display 503 can include a display panel. In some embodiments, the display panel can be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
该射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其 他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices through wireless communication, and to transmit and receive signals with network devices or other electronic devices.
该音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker, a microphone.
该电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理***与处理器501逻辑相连,从而通过电源管理***实现管理充电、放电、以及功耗管理等功能。The power source 506 can be used to power various components of the electronic device 500. In some embodiments, the power source 506 can be logically coupled to the processor 501 through a power management system to enable functions such as managing charging, discharging, and power management through the power management system.
尽管图7中未示出,电子设备500还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown in FIG. 7, the electronic device 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
本申请实施例还提供一种存储介质,该存储介质存储有计算机程序,当该计算机程序在计算机上运行时,使得该计算机执行上述任一实施例中的图像处理方法,比如:获取相册中的图像,并对该图像进行图像分析;根据图像分析结果确定该图像对应的样本标签;基于该样本标签对该图像进行分类处理,将该图像移动到对应的分类库中;根据预设规则对该分类库中的图像的分辨率进行压缩处理。The embodiment of the present application further provides a storage medium storing a computer program, when the computer program is run on a computer, causing the computer to execute the image processing method in any of the above embodiments, for example, acquiring an image in the album. And performing image analysis on the image; determining a sample label corresponding to the image according to the image analysis result; classifying the image based on the sample label, moving the image to a corresponding classification library; The resolution of the image in the classification library is compressed.
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)、或者随机存取记忆体(Random Access Memory,RAM)等。In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM).
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
需要说明的是,对本申请实施例的图像处理方法而言,本领域普通测试人员可以理解实现本申请实施例的图像处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如图像处理方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that, for the image processing method of the embodiment of the present application, a common tester in the art can understand all or part of the process of implementing the image processing method of the embodiment of the present application, which can be completed by controlling the related hardware through a computer program. The computer program may be stored in a computer readable storage medium, such as in a memory of the electronic device, and executed by at least one processor within the electronic device, and may include, for example, an image processing method during execution. The flow of the embodiment. The storage medium may be a magnetic disk, an optical disk, a read only memory, a random access memory, or the like.
对本申请实施例的图像处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。For the image processing apparatus of the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. The integrated module, if implemented in the form of a software functional module and sold or used as a standalone product, may also be stored in a computer readable storage medium, such as a read only memory, a magnetic disk or an optical disk, etc. .
以上对本申请实施例所提供的一种图像处理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The image processing method, device, storage medium and electronic device provided by the embodiments of the present application are described in detail. The principles and implementations of the present application are described in the specific examples. The description of the above embodiments is only The method for understanding the present application and its core idea; at the same time, those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiment and the scope of application, in summary, the present specification The content should not be construed as limiting the application.
Claims (20)
- 一种图像处理方法,其中,包括:An image processing method, comprising:获取相册中的图像,并对所述图像进行图像分析;Acquiring images in the album and performing image analysis on the images;根据图像分析结果确定所述图像对应的样本标签;Determining a sample label corresponding to the image according to an image analysis result;基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中;Performing classification processing on the image based on the sample tag, and moving the image into a corresponding classification library;根据预设规则对所述分类库中的图像的分辨率进行压缩处理。The resolution of the image in the classification library is compressed according to a preset rule.
- 如权利要求1所述的图像处理方法,其中,获取相册中的图像,并对所述图像进行图像分析,包括:The image processing method according to claim 1, wherein the acquiring an image in the album and performing image analysis on the image comprises:获取相册中的图像,并通过卷积神经网络提取所述图像的多个特征;Acquiring images in the album and extracting a plurality of features of the image through a convolutional neural network;根据所述多个特征生成对应的多个实体词;Generating a corresponding plurality of entity words according to the plurality of features;将所述多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。The plurality of features and the plurality of entity words are embedded in a process to generate a corresponding entity description.
- 如权利要求2所述的图像处理方法,其中,根据图像分析结果确定所述图像对应的样本标签,包括:The image processing method according to claim 2, wherein determining the sample tag corresponding to the image according to the image analysis result comprises:对所述图像对应的实体描述进行智能重组,生成重组后的实体描述;Performing intelligent reorganization on the entity description corresponding to the image to generate a reorganized entity description;对重组后的所述实体描述进行分析,确定对应的样本标签。The reorganized description of the entity is analyzed to determine a corresponding sample tag.
- 如权利要求1所述的图像处理方法,其中,基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中,包括:The image processing method according to claim 1, wherein the image is classified based on the sample tag, and the image is moved to a corresponding class library, including:获取所述样本标签指示的关键词;Obtaining keywords indicated by the sample label;获取分类库对应指示的分类关键词;Obtaining a classification keyword corresponding to the classification library;判断所述关键词与所述分类关键词是否匹配;Determining whether the keyword matches the classification keyword;当判断出所述关键词与所述分类关键词匹配时,将所述图像移动到所述分类库中。When it is determined that the keyword matches the classification keyword, the image is moved into the classification library.
- 如权利要求4所述的图像处理方法,其中,判断所述关键词与所述分类关键词是否匹配之后,还包括:The image processing method according to claim 4, wherein after determining whether the keyword matches the classification keyword, the method further comprises:当判断出所述关键词与所述分类关键词不匹配时,生成提示信息,以提示用户对所述图像进行分类处理;或When it is determined that the keyword does not match the classification keyword, generating prompt information to prompt the user to classify the image; or当判断出所述关键词与所述分类关键词不匹配时,获取所述关键词与所述分类关键词的相似度,将所述图像移动到相似度最高的分类库中。When it is determined that the keyword does not match the classification keyword, the similarity between the keyword and the classification keyword is obtained, and the image is moved to a classification database with the highest similarity.
- 如权利要求4所述的图像处理方法,其中,根据预设规则对所述分类 库中的图像的分辨率进行压缩处理之前,还包括:The image processing method according to claim 4, wherein before the compression of the resolution of the image in the classification library is performed according to a preset rule, the method further includes:获取分类库中的图像,并生成全部图像对应缩略图并进行列表显示;Obtain images in the classification library, and generate thumbnail images of all images and display the list;生成提示信息,所述提示信息用于指示用户是否对图像进行压缩处理;Generating prompt information, the prompt information is used to indicate whether the user performs compression processing on the image;接收用户根据所述提示信息输入的操作指令,所述操作指令指示需要进行压缩处理的目标图像。Receiving an operation instruction input by the user according to the prompt information, the operation instruction indicating a target image that needs to be subjected to compression processing.
- 如权利要求6所述的图像处理方法,其中,根据预设规则对所述分类库中的图像的分辨率进行压缩处理,包括:The image processing method according to claim 6, wherein the compressing the resolution of the image in the classification library according to a preset rule comprises:根据预设规则对所述分类库中的目标图像的分辨率进行压缩处理。The resolution of the target image in the classification library is compressed according to a preset rule.
- 一种图像处理装置,其中,包括:An image processing apparatus, comprising:分析单元,用于获取相册中的图像,并对所述图像进行图像分析;An analyzing unit, configured to acquire an image in an album, and perform image analysis on the image;标签确定单元,用于根据图像分析结果确定所述图像对应的样本标签;a label determining unit, configured to determine a sample label corresponding to the image according to the image analysis result;移动单元,用于基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中;a moving unit, configured to perform classification processing on the image based on the sample label, and move the image into a corresponding classification library;处理单元,用于根据预设规则对所述分类库中的图像的分辨率进行压缩处理。And a processing unit, configured to perform compression processing on a resolution of the image in the classification library according to a preset rule.
- 如权利要求8所述的图像处理装置,其中,所述分析单元包括:The image processing device according to claim 8, wherein said analyzing unit comprises:提取子单元,用于获取相册中的图像,并通过卷积神经网络提取所述图像的多个特征;Extracting a subunit for acquiring an image in an album, and extracting a plurality of features of the image by a convolutional neural network;生成子单元,用于根据所述多个特征生成对应的多个实体词;Generating a subunit, configured to generate a corresponding plurality of entity words according to the plurality of features;嵌入子单元,用于将所述多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。An embedding sub-unit is configured to embed the plurality of features and the plurality of entity words to generate a corresponding entity description.
- 如权利要求9所述的图像处理装置,其中,所述标签确定单元包括:The image processing device according to claim 9, wherein said label determining unit comprises:重组子单元,用于对所述图像对应的实体描述进行智能重组,生成重组后的实体描述;a recombination subunit, configured to perform intelligent reorganization on the entity description corresponding to the image, and generate a reorganized entity description;确定子单元,用于对重组后的所述实体描述进行分析,确定对应的样本标签。Determining a subunit for analyzing the reorganized entity description to determine a corresponding sample tag.
- 如权利要求8所述的图像处理装置,其中,所述移动单元,具体用于:The image processing device according to claim 8, wherein the mobile unit is specifically configured to:获取所述样本标签指示的关键词;Obtaining keywords indicated by the sample label;获取分类库对应指示的分类关键词;Obtaining a classification keyword corresponding to the classification library;判断所述关键词与所述分类关键词是否匹配;Determining whether the keyword matches the classification keyword;当判断出所述关键词与所述分类关键词匹配时,将所述图像移动到所述分类库中。When it is determined that the keyword matches the classification keyword, the image is moved into the classification library.
- 如权利要求8所述的图像处理装置,其中,所述移动单元,具体还用于:The image processing device according to claim 8, wherein the mobile unit is further configured to:获取所述样本标签指示的关键词;Obtaining keywords indicated by the sample label;获取分类库对应指示的分类关键词;Obtaining a classification keyword corresponding to the classification library;判断所述关键词与所述分类关键词是否匹配;Determining whether the keyword matches the classification keyword;当判断出所述关键词与所述分类关键词匹配时,将所述图像移动到所述分类库中;When it is determined that the keyword matches the classification keyword, moving the image into the classification library;当判断出所述关键词与所述分类关键词不匹配时,生成提示信息,以提示用户对所述图像进行分类处理;或When it is determined that the keyword does not match the classification keyword, generating prompt information to prompt the user to classify the image; or当判断出所述关键词与所述分类关键词不匹配时,获取所述关键词与所述分类关键词的相似度,将所述图像移动到相似度最高的分类库中。When it is determined that the keyword does not match the classification keyword, the similarity between the keyword and the classification keyword is obtained, and the image is moved to a classification database with the highest similarity.
- 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1所述的图像处理方法。A storage medium having stored thereon a computer program, wherein when the computer program is run on a computer, the computer is caused to perform the image processing method according to claim 1.
- 一种电子设备,包括处理器和存储器,所述存储器有计算机程序,其中,所述处理器通过调用所述计算机程序,用于执行步骤:An electronic device comprising a processor and a memory, the memory having a computer program, wherein the processor is configured to perform the steps by calling the computer program:获取相册中的图像,并对所述图像进行图像分析;Acquiring images in the album and performing image analysis on the images;根据图像分析结果确定所述图像对应的样本标签;Determining a sample label corresponding to the image according to an image analysis result;基于所述样本标签对所述图像进行分类处理,将所述图像移动到对应的分类库中;Performing classification processing on the image based on the sample tag, and moving the image into a corresponding classification library;根据预设规则对所述分类库中的图像的分辨率进行压缩处理。The resolution of the image in the classification library is compressed according to a preset rule.
- 如权利要求14所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:The electronic device of claim 14 wherein said processor is operative to perform the steps by invoking said computer program:获取相册中的图像,并通过卷积神经网络提取所述图像的多个特征;Acquiring images in the album and extracting a plurality of features of the image through a convolutional neural network;根据所述多个特征生成对应的多个实体词;Generating a corresponding plurality of entity words according to the plurality of features;将所述多个特征以及多个实体词进行嵌入处理,生成对应的实体描述。The plurality of features and the plurality of entity words are embedded in a process to generate a corresponding entity description.
- 如权利要求15所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:The electronic device of claim 15 wherein said processor is operative to perform the steps by invoking said computer program:对所述图像对应的实体描述进行智能重组,生成重组后的实体描述;Performing intelligent reorganization on the entity description corresponding to the image to generate a reorganized entity description;对重组后的所述实体描述进行分析,确定对应的样本标签。The reorganized description of the entity is analyzed to determine a corresponding sample tag.
- 如权利要求14所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:The electronic device of claim 14 wherein said processor is operative to perform the steps by invoking said computer program:获取所述样本标签指示的关键词;Obtaining keywords indicated by the sample label;获取分类库对应指示的分类关键词;Obtaining a classification keyword corresponding to the classification library;判断所述关键词与所述分类关键词是否匹配;Determining whether the keyword matches the classification keyword;当判断出所述关键词与所述分类关键词匹配时,将所述图像移动到所述分类库中。When it is determined that the keyword matches the classification keyword, the image is moved into the classification library.
- 如权利要求17所述的电子设备,其中,所述处理器通过调用所述计算机程序,还用于执行步骤:The electronic device of claim 17 wherein said processor is further operative to perform the steps by invoking said computer program:当判断出所述关键词与所述分类关键词不匹配时,生成提示信息,以提示用户对所述图像进行分类处理;或When it is determined that the keyword does not match the classification keyword, generating prompt information to prompt the user to classify the image; or当判断出所述关键词与所述分类关键词不匹配时,获取所述关键词与所述分类关键词的相似度,将所述图像移动到相似度最高的分类库中。When it is determined that the keyword does not match the classification keyword, the similarity between the keyword and the classification keyword is obtained, and the image is moved to a classification database with the highest similarity.
- 如权利要求17所述的电子设备,其中,所述处理器通过调用所述计算机程序,还用于执行步骤:The electronic device of claim 17 wherein said processor is further operative to perform the steps by invoking said computer program:获取分类库中的图像,并生成全部图像对应缩略图并进行列表显示;Obtain images in the classification library, and generate thumbnail images of all images and display the list;生成提示信息,所述提示信息用于指示用户是否对图像进行压缩处理;Generating prompt information, the prompt information is used to indicate whether the user performs compression processing on the image;接收用户根据所述提示信息输入的操作指令,所述操作指令指示需要进行压缩处理的目标图像。Receiving an operation instruction input by the user according to the prompt information, the operation instruction indicating a target image that needs to be subjected to compression processing.
- 如权利要求19所述的电子设备,其中,所述处理器通过调用所述计算机程序,用于执行步骤:The electronic device of claim 19, wherein said processor is operative to perform the steps by invoking said computer program:根据预设规则对所述分类库中的目标图像的分辨率进行压缩处理。The resolution of the target image in the classification library is compressed according to a preset rule.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810024319.6A CN110022397B (en) | 2018-01-10 | 2018-01-10 | Image processing method, image processing device, storage medium and electronic equipment |
CN201810024319.6 | 2018-01-10 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019137259A1 true WO2019137259A1 (en) | 2019-07-18 |
Family
ID=67188183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/125451 WO2019137259A1 (en) | 2018-01-10 | 2018-12-29 | Image processing method and apparatus, storage medium, and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110022397B (en) |
WO (1) | WO2019137259A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112749292A (en) * | 2019-10-31 | 2021-05-04 | 深圳云天励飞技术有限公司 | User label generation method and device, computer device and storage medium |
CN116127108A (en) * | 2023-02-20 | 2023-05-16 | 广东德融汇科技有限公司 | Album generation method and device based on image recognition and storage medium |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112906730B (en) * | 2020-08-27 | 2023-11-28 | 腾讯科技(深圳)有限公司 | Information processing method, device and computer readable storage medium |
CN113590609A (en) * | 2021-06-22 | 2021-11-02 | 北京旷视科技有限公司 | Database partitioning method and device, storage medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2345400A (en) * | 1998-10-27 | 2000-07-05 | Hewlett Packard Co | Compression of low detail areas of a digital image |
CN101075348A (en) * | 2006-11-30 | 2007-11-21 | 腾讯科技(深圳)有限公司 | Method and device for compressing image |
CN101751404A (en) * | 2008-12-12 | 2010-06-23 | 金宝电子工业股份有限公司 | Classification method of multimedia files |
CN102957906A (en) * | 2011-08-29 | 2013-03-06 | 广州九游信息技术有限公司 | Method and system for image classifying compression |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104615769B (en) * | 2015-02-15 | 2018-10-19 | 小米科技有限责任公司 | Picture classification method and device |
US10055846B2 (en) * | 2016-01-26 | 2018-08-21 | The Boeing Company | Normalized probability of change algorithm for image processing |
CN105740402B (en) * | 2016-01-28 | 2018-01-02 | 百度在线网络技术(北京)有限公司 | The acquisition methods and device of the semantic label of digital picture |
CN106060382A (en) * | 2016-05-27 | 2016-10-26 | 北京金山安全软件有限公司 | Image processing method and device and electronic equipment |
CN106446782A (en) * | 2016-08-29 | 2017-02-22 | 北京小米移动软件有限公司 | Image identification method and device |
CN107515950A (en) * | 2017-09-14 | 2017-12-26 | 深圳天珑无线科技有限公司 | A kind of image processing method, device, terminal and computer-readable recording medium |
-
2018
- 2018-01-10 CN CN201810024319.6A patent/CN110022397B/en active Active
- 2018-12-29 WO PCT/CN2018/125451 patent/WO2019137259A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2345400A (en) * | 1998-10-27 | 2000-07-05 | Hewlett Packard Co | Compression of low detail areas of a digital image |
CN101075348A (en) * | 2006-11-30 | 2007-11-21 | 腾讯科技(深圳)有限公司 | Method and device for compressing image |
CN101751404A (en) * | 2008-12-12 | 2010-06-23 | 金宝电子工业股份有限公司 | Classification method of multimedia files |
CN102957906A (en) * | 2011-08-29 | 2013-03-06 | 广州九游信息技术有限公司 | Method and system for image classifying compression |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112749292A (en) * | 2019-10-31 | 2021-05-04 | 深圳云天励飞技术有限公司 | User label generation method and device, computer device and storage medium |
CN112749292B (en) * | 2019-10-31 | 2024-05-03 | 深圳云天励飞技术有限公司 | User tag generation method and device, computer device and storage medium |
CN116127108A (en) * | 2023-02-20 | 2023-05-16 | 广东德融汇科技有限公司 | Album generation method and device based on image recognition and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110022397B (en) | 2021-02-19 |
CN110022397A (en) | 2019-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111368893B (en) | Image recognition method, device, electronic equipment and storage medium | |
WO2019137259A1 (en) | Image processing method and apparatus, storage medium, and electronic device | |
CN109189950B (en) | Multimedia resource classification method and device, computer equipment and storage medium | |
US20190188222A1 (en) | Thumbnail-Based Image Sharing Method and Terminal | |
JP5947131B2 (en) | Search input method and system by region selection method | |
US9665598B2 (en) | Method and apparatus for storing image file in mobile terminal | |
CN111465918B (en) | Method for displaying service information in preview interface and electronic equipment | |
US20220350842A1 (en) | Video tag determination method, terminal, and storage medium | |
WO2021258797A1 (en) | Image information input method, electronic device, and computer readable storage medium | |
RU2643464C2 (en) | Method and apparatus for classification of images | |
WO2019105457A1 (en) | Image processing method, computer device and computer readable storage medium | |
US20140293069A1 (en) | Real-time image classification and automated image content curation | |
CN108898082B (en) | Picture processing method, picture processing device and terminal equipment | |
WO2018171047A1 (en) | Photographing guide method, device and system | |
CN108961267B (en) | Picture processing method, picture processing device and terminal equipment | |
US10152540B2 (en) | Linking thumbnail of image to web page | |
JP2022088304A (en) | Method for processing video, device, electronic device, medium, and computer program | |
CN111859893B (en) | Image-text typesetting method, device, equipment and medium | |
US10185724B2 (en) | Method for sorting media content and electronic device implementing same | |
CN108174270B (en) | Data processing method, data processing device, storage medium and electronic equipment | |
CN109408659B (en) | Image retrieval method, device, computing equipment and medium based on small world network | |
WO2024051730A1 (en) | Cross-modal retrieval method and apparatus, device, storage medium, and computer program | |
CN108062405B (en) | Picture classification method and device, storage medium and electronic equipment | |
CN112417197B (en) | Sorting method, sorting device, machine readable medium and equipment | |
CN110362703B (en) | Picture arranging method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18899563 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18899563 Country of ref document: EP Kind code of ref document: A1 |