Picture processing method and device and electronic equipment
The image processing method improves output efficiency by dividing images into sub-pictures and processing them individually to generate multiple target images.
Patent Information
- Application Number
- CN202310642685.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
Existing image capture devices can only collect one picture at a time, leading to low picture output efficiency.
An image processing method that divides an image into multiple sub-pictures, each corresponding to a target area, applies specific processing methods to these sub-pictures, and outputs multiple target images.
Enhances picture output efficiency by allowing simultaneous processing and output of multiple images from a single captured image.
Smart Images

Figure CN119071653A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to an image processing method, device and electronic device. Background Art
[0002] When the electronic device is equipped with a camera, the camera can be used to collect pictures and output the collected pictures. However, the camera can only collect one picture each time when collecting pictures, resulting in low picture output efficiency. Summary of the invention
[0003] In view of the above problems, the present application proposes an image processing method, device and electronic device to improve the above problems.
[0004] In a first aspect, the present application provides an image processing method, the method comprising: obtaining an image to be processed; obtaining multiple sub-images from the image to be processed, wherein the content of each sub-image corresponds to the content of a target area in the image to be processed, and different sub-images correspond to different target areas; based on the image content of each of the multiple sub-images, obtaining respective processing methods for the multiple sub-images; processing the contents of the multiple sub-images based on the respective processing methods of the multiple sub-images to obtain multiple target images; and outputting the multiple target images.
[0005] In a second aspect, the present application provides an image processing device, comprising: an image acquisition unit, used to acquire an image to be processed; a sub-image acquisition unit, used to acquire multiple sub-images from the image to be processed, wherein the content of each sub-image corresponds to the content of a target area in the image to be processed, and different sub-images correspond to different target areas; a processing method determination unit, used to obtain respective processing methods for the multiple sub-images based on the respective image contents of the multiple sub-images; a processing unit, used to process the contents of the multiple sub-images based on the respective processing methods of the multiple sub-images to obtain multiple target images; and an output unit, used to output the multiple target images.
[0006] In a third aspect, the present application provides an electronic device, which includes at least a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium having program code stored therein, wherein the above method is executed when the program code is executed by a processor.
[0008] The present application provides a method, device and electronic device for image processing. After obtaining a picture to be processed, multiple sub-pictures can be obtained from the picture to be processed, wherein the content of each sub-picture corresponds to the content of a target area in the picture to be processed, and different sub-pictures correspond to different target areas. Then, based on the picture contents of each of the multiple sub-pictures, the processing methods of the multiple sub-pictures are obtained, and then the contents of the multiple sub-pictures are processed based on the processing methods of the multiple sub-pictures to obtain multiple target pictures, so as to output the multiple target pictures. Thus, through the above method, when a picture to be processed is obtained, multiple sub-pictures can be further obtained from the picture to be processed, and the multiple sub-pictures can be processed and output, so that the electronic device can synchronously output multiple target pictures according to the picture to be processed, thereby improving the output efficiency of the picture. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic diagram showing an application scenario of the image processing method proposed in an embodiment of the present application;
[0011] Figure 2 A schematic diagram showing another application scenario of the image processing method proposed in an embodiment of the present application;
[0012] Figure 3 A flowchart of a picture processing method proposed in an embodiment of the present application is shown;
[0013] Figure 4 A schematic diagram showing sub-region division of a picture to be processed in an embodiment of the present application is shown;
[0014] Figure 5 A schematic diagram showing a method of obtaining a corresponding target area based on multiple sub-areas in an embodiment of the present application is shown;
[0015] Figure 6 A schematic diagram showing a method of obtaining a corresponding target area based on multiple sub-areas in an embodiment of the present application is shown;
[0016] Figure 7 A schematic diagram showing a method of obtaining a corresponding target area based on multiple sub-areas in an embodiment of the present application is shown;
[0017] Figure 8A schematic diagram showing a method of obtaining a corresponding target area based on multiple sub-areas in an embodiment of the present application is shown;
[0018] Fig. 9 A schematic diagram showing a method of obtaining a corresponding target area based on multiple sub-areas in an embodiment of the present application is shown;
[0019] Fig.10 A schematic diagram of adding a mark to a picture in an embodiment of the present application is shown;
[0020] Fig.11 A schematic diagram of a dialogue interface in an embodiment of the present application is shown;
[0021] Fig.12 A schematic diagram showing triggering a display menu in a dialog interface in an embodiment of the present application is shown;
[0022] Fig.13 A flowchart of a picture processing method proposed in another embodiment of the present application is shown;
[0023] Fig.14 A flowchart of a picture processing method proposed in another embodiment of the present application is shown;
[0024] Fig.15 A flowchart of a picture processing method proposed in another embodiment of the present application is shown;
[0025] Fig.16 A structural block diagram of a picture processing device proposed in an embodiment of the present application is shown;
[0026] Fig.17 A structural block diagram of another electronic device for executing the image processing method according to an embodiment of the present application is shown;
[0027] Fig.18 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the image processing method according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] When the electronic device is equipped with a camera, the camera can be used to collect pictures and output the collected pictures. However, the camera can only collect one picture each time when collecting pictures, resulting in low picture output efficiency.
[0030] Therefore, after the inventors discovered the above problems in their research, they proposed a picture processing method, device, and electronic device in the present application that can improve the above problems. In the picture processing method provided in the embodiment of the present application, after obtaining the picture to be processed, multiple sub-pictures can be obtained from the picture to be processed, wherein the content of each sub-picture corresponds to the content of the target area in the picture to be processed, and different sub-pictures correspond to different target areas. Then, based on the picture content of each of the multiple sub-pictures, the processing methods of each of the multiple sub-pictures are obtained, and then the contents of the multiple sub-pictures are processed based on the processing methods of each of the multiple sub-pictures to obtain multiple target pictures, so as to output the multiple target pictures.
[0031] Therefore, through the above method, when a picture to be processed is obtained, multiple sub-pictures can be further obtained from the picture to be processed, and the multiple sub-pictures are processed and output, so that the electronic device can synchronously output multiple target pictures according to the picture to be processed, thereby improving the output efficiency of the picture.
[0032] Before further describing the embodiments of the present application in detail, an application environment involved in the embodiments of the present application is introduced.
[0033] The following first introduces the application scenarios involved in the embodiments of the present application.
[0034] In the embodiment of the present application, the image processing method provided can be executed by an electronic device. In this mode of being executed by an electronic device, all steps in the image processing method provided by the embodiment of the present application can be executed by the electronic device. For example, Figure 1 As shown, in the case where all steps in the image processing method provided in the embodiment of the present application can be executed by an electronic device, all steps can be executed by the processor of the electronic device 100.
[0035] Furthermore, the image processing method provided in the embodiment of the present application can also be executed by a server. Correspondingly, in this mode of execution by the server, the server can start executing the steps in the image processing method provided in the embodiment of the present application in response to a trigger instruction. The trigger instruction can be sent by an electronic device used by the user, or can be triggered locally by the server in response to some automation events.
[0036] In addition, the image processing method provided in the embodiment of the present application can also be executed by the electronic device and the server in collaboration. In this way, some steps of the image processing method provided in the embodiment of the present application are executed by the electronic device, while other steps are executed by the server. For example, Figure 2As shown, the electronic device 100 can perform the image processing method including: obtaining the image to be processed, and then the server 200 executes to obtain multiple sub-images from the image to be processed, wherein the content of each sub-image corresponds to the content of the target area in the image to be processed, and different sub-images correspond to different target areas; based on the image content of each of the multiple sub-images, the processing methods of the multiple sub-images are obtained. Afterwards, the server 200 returns the processing methods of the multiple sub-images to the electronic device 100, so that the electronic device 100 processes the contents of the multiple sub-images based on the processing methods of the multiple sub-images, obtains multiple target images, and outputs the multiple target images.
[0037] It should be noted that in this method of collaborative execution by the electronic device and the server, the steps respectively executed by the electronic device and the server are not limited to the methods introduced in the above examples. In actual applications, the steps respectively executed by the electronic device and the server can be dynamically adjusted according to actual conditions.
[0038] It should be noted that the electronic device 100 is Figure 1 and Figure 2 In addition to the smartphone shown in , it can also be a tablet computer, a smart watch, an intelligent voice assistant and other devices. Server 200 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud computing, cloud storage, network services, cloud communications, middleware services, CDN (Content Delivery Network), and artificial intelligence platforms. Among them, in the case where the image processing method provided in the embodiment of the present application is executed by a server cluster or a distributed system composed of multiple physical servers, different steps in the image processing method can be executed by different physical servers respectively, or can be executed in a distributed manner by a server built based on a distributed system.
[0039] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0040] See also Figure 3 , an image processing method provided in an embodiment of the present application, the method comprising:
[0041] S110: Obtain the image to be processed.
[0042] In the embodiment of the present application, the to-be-processed picture can be understood as a picture to be processed. In addition, in the embodiment of the present application, there can be multiple ways to obtain the to-be-processed picture.
[0043] As a method, the picture collected by the camera of the electronic device can be used as the picture to be processed. Optionally, the electronic device can collect pictures in response to a shooting instruction, and use the collected pictures as pictures to be processed. Among them, the electronic device can use the pictures collected by the camera in a specified mode (for example, AI mode) as pictures to be processed. In this case, after the electronic device starts the image acquisition program, it can switch to the specified mode in response to the mode switching operation. If a shooting instruction is received in the specified mode, the picture can be collected by the camera, and the collected picture can be used as a picture to be processed.
[0044] As another way, pictures transmitted from other devices can be used as pictures to be processed. Optionally, the electronic device can send a picture acquisition request to the server to request pictures from the server. After receiving the picture acquisition request, the server can return the picture requested by the electronic device to the electronic device, and after receiving the picture returned by the server, the picture returned by the server can be used as the picture to be processed. Optionally, the electronic device can also use pictures sent from other users' electronic devices as pictures to be processed.
[0045] S120: Acquire multiple sub-pictures from the picture to be processed, wherein the content of each sub-picture corresponds to the content of the target area in the picture to be processed, and different sub-pictures correspond to different target areas.
[0046] After obtaining the image to be processed, multiple sub-images can be obtained from the image to be processed. The content in the sub-image is the content of a part of the image to be processed, and the content of each sub-image is the content corresponding to the target area in the image to be processed, and different sub-images correspond to different target areas. In the embodiment of the present application, there can be multiple ways to obtain multiple sub-images.
[0047] As a method, obtaining multiple sub-images from the image to be processed may include: dividing the image to be processed into multiple sub-regions, obtaining multiple target regions based on the multiple sub-regions, wherein each target region is obtained by combining multiple adjacent sub-regions, and obtaining multiple sub-images based on the contents of the multiple target regions. Among the multiple adjacent sub-regions combined into the target region, each sub-region is adjacent to at least one other sub-region in the same target region.
[0048] For example, Figure 4 As shown, for Figure 4 The picture shown can be divided into 5×5 areas, that is, Figure 4The picture shown is divided into 25 regions. The divided regions include 25 regions such as region P1, region P2, region P3, ... region P25, and the 25 regions can be understood as a sub-region. In this case, multiple target regions can be obtained by combining the 25 sub-regions. For example, Figure 5 As shown in , the 9 sub-regions in the upper left corner of the image to be processed can be combined to obtain the target region T1. Figure 6 As shown in , the 9 sub-regions in the upper right corner of the image to be processed can be combined to obtain the target region T2. Figure 7 As shown in , the 9 sub-regions in the middle part of the image to be processed can be combined to obtain the target region T3. Figure 8 As shown in , the 9 sub-regions in the lower left corner of the image to be processed can be combined to obtain the target region T4. Fig. 9 As shown, the 9 sub-regions in the lower right corner of the image to be processed can be combined to obtain the target region T5.
[0049] Furthermore, the content in the target area T1 can be used as a sub-picture, the content in the target area T2 can be used as a sub-picture, the content in the target area T3 can be used as a sub-picture, the content in the target area T4 can be used as a sub-picture, and the content in the target area T5 can be used as a sub-picture to obtain multiple sub-pictures.
[0050] It should be noted that the above-mentioned method of dividing the image to be processed into sub-regions is only exemplary, and the number of sub-regions obtained by dividing the image to be processed and the size of each sub-region are not specifically limited. For example, the electronic device can determine the number of sub-regions obtained by dividing according to the complexity of the content of the image to be processed. It should be noted that, when the content complexity of the image to be processed is higher, the content or meaning that can be expressed in the image to be processed may be more, and then by dividing more sub-regions, it can be possible to divide the image to be processed into sub-images in a more fine-grained manner. Correspondingly, when the content complexity of the image to be processed is low, the image to be processed can be divided into sub-images without dividing the image to be processed into more sub-regions. Among them, the electronic device can also determine the number of sub-regions obtained by dividing according to the complexity of the content of the image to be processed when the upper limit of the number of sub-regions of the combined target region remains unchanged. It should be noted that when the upper limit of the number of sub-regions of the combined target region remains unchanged, the more sub-regions obtained by dividing, the more target regions generated subsequently, and the more target images obtained in the end, so that the image to be processed can be divided into more fine-grained, and the output efficiency of the target image can be further improved.
[0051] As a method, a correspondence between content complexity and the number of sub-regions can be pre-established. After determining the content complexity of the image to be processed, the number of sub-regions to be divided can be determined based on the correspondence between content complexity and the number of sub-regions. Optionally, the correspondence between content complexity and the number of sub-regions can be shown in the following table:
[0052] ID Content complexity Number of sub-areas 1 D1 X 2 D2 Y 3 D3 Z
[0053] As shown in the above table, if the content complexity of the image to be processed is determined to be D2, the number of sub-regions determined is Y, and the image to be processed can be divided into Y parts.
[0054] In the embodiment of the present application, there are multiple ways to determine the complexity of the image to be processed.
[0055] As a method, the content complexity of the image to be processed can be determined according to the number of target objects included in the image to be processed. Among them, the target objects may include objects such as animals, people, buildings, and plants. In this way, the more target objects included in the image to be processed, the higher the content complexity of the image to be processed. Optionally, the correspondence between the number of target objects and the content complexity can be stored in the electronic device, and then, after determining the number of target objects in the image to be processed, the corresponding content complexity can be determined according to the correspondence between the number of target objects and the content complexity. Exemplarily, the correspondence between the number of target objects and the content complexity can be shown in the following table:
[0056] ID Content complexity The number of target objects 1 D1 N1 2 D2 N2 3 D3 N3
[0057] As shown in the above table, if the number of target objects in the image to be processed is determined to be N3, the content complexity can be determined to be D3.
[0058] As another way, the corresponding complexity can be determined according to the distribution of color values in the image to be processed. It should be noted that when the color values in the image to be processed are distributed more concentratedly, it means that the content in the image to be processed is relatively simple. Correspondingly, when the color values in the image to be processed are more dispersed, it means that the content in the image to be processed is relatively complex. The color value of the image to be processed may include the color value of each pixel in the image to be processed.
[0059] In addition, in the process of combining sub-regions to obtain a target region, the number of sub-regions included in each target region is not specifically limited in the embodiment of the present application. Moreover, the number of sub-regions included in each of the obtained multiple target regions may also be different.
[0060] S130: Based on the picture contents of each of the multiple sub-pictures, obtain respective processing methods for the multiple sub-pictures.
[0061] In an embodiment of the present application, the processing method includes at least one of cropping and color adjustment. Among them, the determined processing methods can be used to process the sub-image to change the visual experience brought to the user by the sub-image. Among them, cropping the sub-image can change the composition of the sub-image, and then change the visual experience from the composition dimension. Adjusting the color of the sub-image can change the saturation, contrast, etc. of the sub-image, and then change the visual experience from the color dimension.
[0062] In addition, in some cases, if the current composition or color of the sub-image is relatively reasonable, the sub-image may not be processed. In this case, the processing method corresponding to the sub-image may be no processing.
[0063] S140: Process the contents of the multiple sub-pictures based on the respective processing methods of the multiple sub-pictures to obtain multiple target pictures.
[0064] As a method, processing the contents of the plurality of sub-pictures based on the respective processing methods of the plurality of sub-pictures to obtain the plurality of target pictures may include: processing the contents of the target areas corresponding to the plurality of sub-pictures in the to-be-processed picture based on the respective processing methods of the plurality of sub-pictures to obtain the plurality of target pictures. If the processing method corresponding to a sub-picture is not to be processed, the content of the sub-picture is the same as the content of the corresponding target picture.
[0065] S150: Output multiple target images.
[0066] In the embodiments of the present application, there are multiple ways to output the target image.
[0067] As an output method, the multiple target images can be output to an album of the electronic device. After the multiple target images are output to the album, the user can view the output multiple target images through the album.
[0068] As shown in the foregoing, the image to be processed can be an image captured by a camera of an electronic device, wherein the image captured by the camera can also be stored in an album of the electronic device. As a method, when multiple target images are output to the album, the multiple target images can be arranged adjacent to the image to be processed. As another method, a folder corresponding to the image to be processed can be separately established to store the multiple target images separately in the folder, so that the multiple target images generated corresponding to different images to be processed can be stored separately, which is also convenient for users to view.
[0069] It should be noted that when a user operates an electronic device to take pictures, sometimes only a few pictures are taken intermittently, and sometimes multiple pictures are taken continuously at a relatively fast speed. For the multiple pictures taken continuously, the user may want to check them continuously. In this case, if the corresponding multiple target pictures are still arranged next to each collected picture (picture to be processed), it may affect the user's need to check the taken pictures continuously. Then as an improvement method, the electronic device can detect whether there is a picture camera operation within a specified time period from the start of picture shooting when taking a picture. If so, it is determined that the user is taking pictures continuously, and then the multiple target pictures generated corresponding to each picture to be processed can be stored separately in a folder. If not, it is determined that the user is not taking pictures continuously, and the multiple target pictures obtained based on the picture to be processed can be directly arranged adjacent to the picture to be processed.
[0070] In addition, the user can also pre-configure the storage locations of multiple target images according to their needs. In this case, after obtaining multiple target images, the electronic device can store the multiple target images according to the locations configured by the user. The locations configured by the user for outputting the multiple target images can be arranged adjacent to the images to be processed, or stored in a separately established folder.
[0071] As a method, a mark may be displayed in the album for a to-be-processed picture that corresponds to multiple target pictures output, so as to remind the user that the to-be-processed picture corresponds to multiple target pictures output. Fig.10 As shown, in Fig.10 In the album interface 30 shown, 6 pictures are displayed, and a plurality of target pictures are outputted corresponding to a picture 31 of the 6 pictures. In this case, a mark 311 is also displayed on the picture 31.
[0072] As another output method, multiple target images can be output to other devices. In one method, the image to be processed can be an image sent from other devices. In this case, after the image sent from other devices is used as the image to be processed and multiple corresponding target images are generated, the multiple target images can be returned to the other devices. For example, Fig.11 As shown, in Fig.11 In the dialogue interface shown, a picture 41 sent by a dialogue user named Xiaolan can be processed by the electronic device as a picture to be processed. Fig.12As shown, if the user of the electronic device long presses the picture 41, a menu 42 can be triggered. In the menu 42, operation options are displayed. If the option named "disassemble the picture" is selected, the electronic device can process the picture 41 as a to-be-processed picture, and directly return the multiple target pictures obtained by the processing to the dialogue user named Xiaolan.
[0073] The present embodiment provides a method for processing an image. After obtaining the image to be processed, multiple sub-images can be obtained from the image to be processed, wherein the content of each sub-image corresponds to the content of the target area in the image to be processed, and different sub-images correspond to different target areas. Then, based on the image content of each of the multiple sub-images, the processing methods of the multiple sub-images are obtained, and then the contents of the multiple sub-images are processed based on the processing methods of the multiple sub-images to obtain multiple target images, so as to output the multiple target images. Thus, through the above method, when a picture to be processed is obtained, multiple sub-images can be further obtained from the picture to be processed, and the multiple sub-images can be processed and output, so that the electronic device can synchronously output multiple target images according to the picture to be processed, thereby improving the output efficiency of the picture.
[0074] See also Fig.13 , an image processing method provided in an embodiment of the present application, the method comprising:
[0075] S210: Obtain the image to be processed.
[0076] S220: Acquire multiple sub-pictures from the picture to be processed, wherein the content of each sub-picture corresponds to the content of the target area in the picture to be processed, and different sub-pictures correspond to different target areas.
[0077] S230: Preprocessing the multiple sub-images to obtain the multiple preprocessed sub-images, wherein the preprocessing includes at least one of normalizing the color values of the sub-images and adjusting the size of the sub-images to a target size.
[0078] It should be noted that preprocessing the multiple sub-images can make the processed sub-images meet the input requirements of the aesthetic composition model, and then the aesthetic composition model can smoothly output the respective processing methods of the multiple sub-images.
[0079] S240: Inputting the pre-processed multiple sub-images into the aesthetic composition model to obtain respective processing methods of the multiple sub-images output by the aesthetic composition model.
[0080] In the embodiment of the present application, the aesthetic composition model can be deployed locally on the electronic device or in the cloud.
[0081] S250: Process the contents of the multiple sub-pictures based on the respective processing methods of the multiple sub-pictures to obtain multiple target pictures.
[0082] S260: Output multiple target images.
[0083] The present embodiment provides a method for processing an image, so that in the case of obtaining a picture to be processed, multiple sub-images can be further obtained from the picture to be processed through the above method, and the multiple sub-images are processed and output, so that the electronic device can synchronously output multiple target images according to the picture to be processed, thereby improving the output efficiency of the image. In addition, in the present embodiment, multiple sub-images can be pre-processed and then input into the aesthetic composition model to obtain the processing methods of the multiple sub-images through the aesthetic composition model, which is conducive to obtaining the processing methods more quickly and effectively.
[0084] See also Fig.14 , an image processing method provided in an embodiment of the present application, the method comprising:
[0085] S310: Obtain the image to be processed.
[0086] S320: Acquire multiple sub-pictures from the picture to be processed, wherein the content of each sub-picture corresponds to the content of the target area in the picture to be processed, and different sub-pictures correspond to different target areas.
[0087] S330: Based on the picture contents of each of the multiple sub-pictures, obtain respective processing methods for the multiple sub-pictures.
[0088] S340: Process the contents of the multiple sub-images based on the respective processing methods of the multiple sub-images to obtain multiple target images.
[0089] S350: Obtain scores of each of the multiple target images.
[0090] In the embodiment of the present application, there are multiple ways to score the processed pictures. As one way, multiple target pictures can be scored from the composition dimension. As another way, multiple target pictures can be scored from the color dimension or clarity.
[0091] The electronic device may also determine the method for subsequently scoring the target image based on the processing method adopted for the sub-image. Optionally, if the processing method of the multiple sub-images determined by the electronic device includes cropping the multiple sub-images, the multiple target images may be scored from the dimension of composition. If the processing method of the multiple sub-images determined by the electronic device includes color adjustment, the multiple target icons may also be scored from the dimension of color.
[0092] S360: Outputting the multiple target images based on the scores of the multiple target images.
[0093] As a method, obtaining scores of each of the multiple target images includes: preprocessing the multiple target images to obtain multiple preprocessed target images, wherein the preprocessing includes at least one of normalizing the color values of the sub-images and adjusting the size of the sub-images to the target size; inputting the preprocessed multiple target images into a scoring model to obtain scores of each of the multiple target images output by the scoring model.
[0094] The present embodiment provides a method for processing an image, so that in the above manner, when a picture to be processed is obtained, multiple sub-pictures can be further obtained from the picture to be processed, and the multiple sub-pictures are processed and output, so that the electronic device can synchronously output multiple target pictures according to the picture to be processed, thereby improving the output efficiency of the picture. In addition, in the present embodiment, after obtaining multiple target pictures, the multiple target pictures are also scored, and the target pictures are output based on the scores, so that the user can more intuitively understand the situation of the multiple target pictures.
[0095] See also Fig.15 , and then pass Fig.15 A process involved in an embodiment of the present application is described below.
[0096] The application layer (e.g., image acquisition program) can first call the SDK (Software Development Kit) through the region of interest splitting API (Application Programming Interface) to trigger the SDK to control the region of interest splitting module to split the region of interest on the image to be processed. The region of interest splitting module can return the region of interest frame based on the splitting result. Each region of interest frame represents a target area.
[0097] Then, the application layer can call the SDK through the aesthetic composition API to trigger the SDK to control the AI aesthetic composition module to output the aesthetic composition frame of each area of interest. Among them, the aesthetic composition frame represents how to crop the corresponding target area to obtain the corresponding target image.
[0098] Afterwards, the application layer can call the SDK to score the obtained target image, and then select the best composition from multiple target images for output according to the score. In addition, the score of each target image can be output synchronously.
[0099] See also Fig.16, an image processing device 400 provided in an embodiment of the present application, the device 400 includes:
[0100] The picture acquisition unit 410 is used to acquire the picture to be processed.
[0101] As a method, the picture acquisition unit 410 is specifically used to acquire a picture captured by a camera of the electronic device as a picture to be processed.
[0102] The sub-image acquisition unit 420 is used to acquire multiple sub-images from the image to be processed, wherein the content of each sub-image corresponds to the content of the target area in the image to be processed, and different sub-images correspond to different target areas.
[0103] The processing mode determining unit 430 is used to obtain the processing mode of each of the plurality of sub-images based on the image content of each of the plurality of sub-images.
[0104] The processing unit 440 is used to process the contents of the multiple sub-pictures based on the respective processing methods of the multiple sub-pictures to obtain multiple target pictures.
[0105] The output unit 450 is used to output multiple target pictures.
[0106] As a method, the processing unit 440 is specifically used to process the content of the target area corresponding to each of the multiple sub-pictures in the image to be processed based on the processing methods of each of the multiple sub-pictures to obtain multiple target pictures. Optionally, the processing unit 440 is specifically used to process at least one of cropping and color adjustment.
[0107] As a method, the processing method determination unit 430 is specifically used to preprocess multiple sub-images to obtain multiple preprocessed sub-images, wherein the preprocessing includes at least one of normalizing the color values of the sub-images and adjusting the size of the sub-images to a target size; the multiple preprocessed sub-images are input into the aesthetic composition model to obtain the processing methods of the multiple sub-images output by the aesthetic composition model.
[0108] As a method, the sub-image acquisition unit 420 is specifically used to divide the image to be processed into multiple sub-regions; obtain multiple target regions based on the multiple sub-regions, wherein each target region is obtained by combining multiple adjacent sub-regions; and obtain multiple sub-images based on the contents of the multiple target regions.
[0109] As a method, the output unit 450 is specifically used to obtain the scores of each of the multiple target images; and output the multiple target images based on the scores of each of the multiple target images.
[0110] Optionally, the output unit 450 is specifically used to preprocess the multiple target images to obtain multiple preprocessed target images, wherein the preprocessing includes at least one of normalizing the color values of the sub-images and adjusting the size of the sub-images to the target size; the preprocessed multiple target images are input into the scoring model to obtain scores of the multiple target images output by the scoring model.
[0111] The present embodiment provides an image processing device, so that when a picture to be processed is obtained, multiple sub-pictures can be further obtained from the picture to be processed, and the multiple sub-pictures are processed and then output, so that the electronic device can synchronously output multiple target pictures according to the picture to be processed, thereby improving the output efficiency of the picture.
[0112] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.
[0113] The following will be combined Fig.17 An electronic device provided by the present application is described.
[0114] See also Fig.17 Based on the above-mentioned image processing method and device, the embodiment of the present application also provides another electronic device 100 that can execute the above-mentioned image processing method. The electronic device 100 includes one or more (only one is shown in the figure) processors 102, a memory 104 and a network module 106 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above-mentioned embodiment, and the processor 102 can execute the program stored in the memory 104.
[0115] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.
[0116] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the terminal 100 during use.
[0117] The network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as communicating with an audio playback device. The network module 106 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. The network module 106 may communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices via wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. For example, the network module 106 may exchange information with a base station.
[0118] Please refer to Fig.18 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0119] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.
[0120] In summary, the present application provides a method, device and electronic device for image processing. After obtaining the image to be processed, multiple sub-images can be obtained from the image to be processed, wherein the content of each sub-image corresponds to the content of the target area in the image to be processed, and different sub-images correspond to different target areas. Then, based on the image content of each of the multiple sub-images, the processing methods of the multiple sub-images are obtained, and then the contents of the multiple sub-images are processed based on the processing methods of the multiple sub-images to obtain multiple target images, so as to output the multiple target images. Therefore, through the above method, when a picture to be processed is obtained, multiple sub-images can be further obtained from the picture to be processed, and the multiple sub-images can be processed and output, so that the electronic device can synchronously output multiple target images according to the picture to be processed, thereby improving the output efficiency of the picture.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing an image, characterized in that: The method comprises: Get the image to be processed; Acquire multiple sub-images from the image to be processed, wherein the content of each sub-image corresponds to the content of the target area in the image to be processed, and different sub-images correspond to different target areas; Based on the picture contents of each of the multiple sub-pictures, obtaining respective processing methods of the multiple sub-pictures; Processing the contents of the multiple sub-images based on the respective processing methods of the multiple sub-images to obtain multiple target images; The multiple target images are output.
2. The method according to claim 1, characterized in that: The processing of the contents of the plurality of sub-pictures based on the respective processing modes of the plurality of sub-pictures to obtain the plurality of target pictures includes: Based on the respective processing methods of the plurality of sub-pictures, the contents in the target areas corresponding to the plurality of sub-pictures in the picture to be processed are processed to obtain a plurality of target pictures.
3. The method according to claim 2, characterized in that The processing method includes at least one of cropping and color adjustment.
4. The method according to claim 1, characterized in that: The obtaining respective processing methods of the plurality of sub-pictures based on the respective picture contents of the plurality of sub-pictures comprises: Preprocessing the multiple sub-images to obtain multiple preprocessed sub-images, wherein the preprocessing includes at least one of normalizing color values of the sub-images and adjusting the size of the sub-images to a target size; The preprocessed multiple sub-images are input into the aesthetic composition model to obtain respective processing methods of the multiple sub-images output by the aesthetic composition model.
5. The method according to claim 1, characterized in that The obtaining a plurality of sub-pictures from the picture to be processed comprises: Divide the image to be processed into multiple sub-regions; Based on the multiple sub-regions, multiple target regions are obtained, wherein each target region is obtained by combining multiple adjacent sub-regions; Based on the contents of each of the multiple target areas, multiple sub-images are obtained.
6. The method according to claim 1, characterized in that The outputting the multiple target images includes: Get the scores of multiple target images; The plurality of target images are output based on their respective scores.
7. The method according to claim 6, characterized in that The obtaining of scores of the plurality of target images includes: Preprocessing the multiple target images to obtain multiple preprocessed target images, wherein the preprocessing includes at least one of normalizing the color values of the sub-images and adjusting the size of the sub-images to the target size; The preprocessed multiple target images are input into a scoring model to obtain scores of the multiple target images output by the scoring model.
8. The method according to claim 1, characterized in that The step of obtaining the image to be processed includes: A picture captured by a camera of an electronic device is obtained as a picture to be processed.
9. A picture processing device, characterized in that: The device comprises: A picture acquisition unit, used to acquire the picture to be processed; A sub-image acquisition unit, configured to acquire a plurality of sub-images from the image to be processed, wherein the content of each sub-image corresponds to the content of a target area in the image to be processed, and different sub-images correspond to different target areas; A processing mode determining unit, configured to obtain a processing mode for each of the plurality of sub-images based on the image content of each of the plurality of sub-images; A processing unit, configured to process the contents of the plurality of sub-pictures based on respective processing methods of the plurality of sub-pictures to obtain a plurality of target pictures; An output unit is used to output the multiple target images.
10. An electronic device, characterized in that: The method comprises a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement any one of the methods of claims 1-9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 9 is executed.
