Image processing method, apparatus and electronic device

By identifying areas of difference in an image and generating a target layer, the problem of complex operation of image editing tools is solved, achieving a simple and effective image editing method and improving the user experience.

CN114119392BActive Publication Date: 2025-11-11VIVO MOBILE COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111318308.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-09
Publication Date
2025-11-11
Estimated Expiration
2041-11-09

AI Technical Summary

Technical Problem

Existing photo editing tools are complex to operate, difficult for ordinary users to master, and do not provide an intuitive understanding of their functions, resulting in low user engagement.

Method used

By acquiring the image to be processed and a reference image, identifying the regions of difference between the images and generating the corresponding target layer, users can directly transfer the target layer to the image to be processed, achieving simple and effective image retouching operations.

Benefits of technology

It simplifies the photo editing process, allowing users to intuitively select specific layers to achieve the desired editing effect, thus improving editing efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119392B_ABST
    Figure CN114119392B_ABST
Patent Text Reader

Abstract

This application discloses an image processing method, apparatus, and electronic device, belonging to the field of image processing. The solution of this application includes: acquiring an image to be processed and a reference image, wherein the reference image is an image that has undergone image retouching; determining regions in the reference image that differ from the image to be processed, and the corresponding retouching operations for each region; generating a corresponding target layer based on the retouching operations; and, upon receiving a request for migration of the target layer, migrating the operations corresponding to the target layer to the image to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing, and specifically relates to an image processing method, apparatus and electronic device. Background Technology

[0002] Photo editing tools are popular because they allow for various modifications to original images. However, the sheer number of operations involved means that ordinary users often need to learn a specific software or seek professional help. Learning a particular editing software is time-consuming and not easy to master. Users often don't know which editing functions are used to alter an image or what effects they can achieve, making the process difficult and discouraging. Seeking professional help also presents certain inconveniences. Summary of the Invention

[0003] The purpose of this application is to provide an image processing method, apparatus, and electronic device that can solve the problem of complex operation in existing image retouching methods.

[0004] In a first aspect, embodiments of this application provide an image processing method, the method comprising:

[0005] Acquire the image to be processed and a reference image, wherein the reference image is an image that has undergone image retouching;

[0006] Identify the regions in the reference image that differ from the image to be processed, and the corresponding image retouching operations for each region;

[0007] Generate the corresponding target layer based on the image retouching operation;

[0008] Upon receiving a request for migration of the target layer, the operation corresponding to the target layer is migrated to the image to be processed.

[0009] Secondly, embodiments of this application provide an image processing apparatus, the apparatus comprising:

[0010] The acquisition module is used to acquire the image to be processed and the reference image, wherein the reference image is the image after image retouching.

[0011] The determination module is used to determine each region in the reference image that has image differences from the image to be processed, and the corresponding image retouching operation for each region;

[0012] The generation module is used to generate the corresponding target layer based on the image retouching operation;

[0013] The migration module is used to migrate the operation corresponding to the target layer to the image to be processed when a migration for the target layer is received.

[0014] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0015] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0016] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0017] In this embodiment, by acquiring an image to be processed and a reference image, wherein the reference image is an image that has undergone image retouching; determining each region in the reference image that differs from the image to be processed, and the corresponding retouching operation for each region; generating a corresponding target layer based on the retouching operation; and upon receiving a request to migrate the target layer, migrating the operation corresponding to the target layer to the image to be processed, thereby acquiring each retouching operation of the reference image, generating multiple layers corresponding to multiple retouching operations, which allows users to combine the retouching effect of the reference image and select a specific layer to perform the desired retouching on the image to be processed. The retouching method is simple, effective, time-saving, and labor-saving. Attached Figure Description

[0018] Figure 1 This is a schematic flowchart of the image processing method according to an embodiment of this application.

[0019] Figure 2a and Figure 2b This is a schematic diagram of the image pixel value matrix according to an embodiment of this application.

[0020] Figure 3 This is a schematic diagram comparing pixel values ​​of different regions of an image according to an embodiment of this application.

[0021] Figure 4 This is a schematic diagram of the area where there are image differences in the embodiments of this application.

[0022] Figure 5 This is a user interface diagram of the image processing method according to an embodiment of this application.

[0023] Figure 6 This is a structural block diagram of the image processing apparatus according to an embodiment of this application.

[0024] Figure 7This is a structural block diagram of an electronic device according to an embodiment of this application.

[0025] Figure 8 This is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0028] The image processing method, apparatus, and electronic device provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0029] Figure 1 This is a flowchart illustrating the image processing method according to an embodiment of this application, as shown below. Figure 1 As shown, the image processing method of this application embodiment includes the following steps 102 to 108.

[0030] Step 102: Obtain the image to be processed and the reference image, wherein the reference image is the image after image retouching.

[0031] The reference image is an image that has undergone image retouching, and the corresponding retouching steps are identified and determined through subsequent steps.

[0032] Step 104: Determine the regions in the reference image that differ from the image to be processed, and the corresponding image retouching operations for each region.

[0033] Image differences include significant, visually perceptible changes between the image to be processed and the reference image; these can be termed macroscopic differences. Examples include differences in fixed objects within an image, differences in background color or the color of local areas, and differences in text within the image.

[0034] The image differences described above are all macroscopic changes visible to the naked eye. Regions with image differences, such as the area occupied by a fixed object in an image, can be divided into regions of one or more pixels in size when the image is divided into areas with image differences.

[0035] In this embodiment, the differences between two images can be identified using Optical Character Recognition (OCR) technology, thereby determining the corresponding image difference regions. For example, OCR technology can be used to identify differences in the region where the target face is located in the image to be processed and the reference image.

[0036] Image differences also include subtle, invisible changes between the image to be processed and the reference image, which can be called micro-differences. These include adjustments to grayscale, brightness and darkness, edge blurring, color, timeline, filters, face slimming, and so on.

[0037] For operations where changes are not obvious, OCR technology used for macroscopic difference recognition cannot accurately identify the corresponding image difference regions.

[0038] Therefore, in order to improve the recognition accuracy of regions with image differences between the image to be processed and the reference image, in one embodiment of this application, optionally, determining each region in the reference image that has image differences from the image to be processed, and the corresponding retouching operation for each region, includes: generating a first pixel value of the image to be processed and a second pixel value of the reference image based on the unit pixels of the corresponding regions of the image to be processed and the reference image; determining the target region with pixel differences in the reference image and the pixel difference value corresponding to the target region by comparing the first pixel value and the second pixel value; and determining the retouching operation corresponding to the target region in the reference image based on the pixel difference value.

[0039] In this embodiment, regardless of the degree of retouching or the size of the retouched area in the two images, it is expressed through the difference of each pixel value in the two images, or in other words, the change in pixel value.

[0040] Using pixels as the unit, the image to be processed and the reference image are divided into multiple unit pixel regions based on the image size and the size corresponding to each unit pixel. The pixel value of each unit pixel region in the image to be processed is obtained based on the local grayscale values ​​of the unit pixel regions. Similarly, the pixel value of each unit pixel region in the reference image is obtained based on the local grayscale values ​​of the unit pixel regions. An example of a pixel value matrix of the image to be processed is obtained according to the position of the unit pixel regions in their respective images, for example... Figure 2aAs shown, an example of obtaining the pixel value matrix of the reference image is given, for example... Figure 2b As shown.

[0041] By comparing the first pixel value of the image to be processed with the second pixel value of the reference image, the pixel differences between the regions in the reference image where pixel differences exist and the corresponding pixel differences in the target region can be determined. The pixel difference corresponding to the target region can reflect the pixel changes in the corresponding regions of the image to be processed and the reference image.

[0042] Here, we introduce the concept of pixel conversion formula. Pixel conversion formula is a conversion formula that represents the effect of retouching the target area of ​​the image to be processed into the corresponding area of ​​the reference image. It is calculated based on the pixel value changes of each unit pixel area within the corresponding area.

[0043] For example Figure 2a and Figure 2b As shown, Figure 2a The pixel value in the first row and first column changes from "1" to Figure 2b The pixel value in the first row and first column is "3", and the pixel value in the first row and second column changes from "2" to... Figure 2b The pixel value in the first row and second column is "6", and the pixel value in the fourth row and first column changes from "16" to... Figure 2b The pixel value in the 4th row and 1st column is "48", and the pixel value in the 5th row and 1st column changes from "21" to... Figure 2b The pixel value in the 5th row and 1st column is "63".

[0044] Then by comparison Figure 2a pixel value matrix and Figure 2b The pixel value matrix determines that the pixels in the aforementioned unit pixel region of the image to be processed exhibit a 3x pixel value amplification transformation relationship, meaning that the pixel values ​​in the aforementioned region undergo a linear change with a 3x amplification. The corresponding pixel transformation formula is y = 3x, where y is the pixel value of the aforementioned region in the reference image, and x is the corresponding pixel value of the aforementioned region in the image to be processed.

[0045] In addition, as shown in the figure, Figure 2a The pixel value in the 1st row and 3rd column changes from "3" to Figure 2b The pixel value "10" in the first row and third column. Figure 2a The pixel value in the 1st row and 4th column changes from "4" to Figure 2b The pixel value "13" in the first row and fourth column. Figure 2a The pixel value in the 1st row and 5th column changes from "5" to Figure 2b The pixel value in the 1st row and 5th column is "16".

[0046] Then by comparison Figure 2a pixel value matrix and Figure 2bThe pixel value matrix allows us to determine that the pixels in the aforementioned unit pixel region of the image to be processed exhibit a transformation relationship of pixel value multiplied by 3 and then increased by 1. The corresponding pixel transformation formula is y = 3x + 1, where y is the pixel value of the aforementioned region in the reference image, and x is the corresponding pixel value of the aforementioned region in the image to be processed.

[0047] Therefore, by comparing the pixel value matrix of the image to be processed with the pixel value matrix of the reference image in turn, the pixel conversion formula corresponding to each unit pixel region in the image to be processed can be determined.

[0048] like Figure 3 As illustrated in the example, in one embodiment, a small window corresponding to a unit pixel size can be slid from left to right and from top to bottom to scan the pixel values ​​of unit pixel regions comparing the image to be processed and the reference image, while simultaneously generating the corresponding pixel transformation formula. For example, Figure 3 As shown, some unit pixel regions correspond to Formula 1, and some unit pixel regions correspond to Formula 3, or Formula n.

[0049] These unit pixel regions, corresponding to the same pixel transformation formula, constitute a region in the image to be processed that exhibits the same pixel changes. For example... Figure 4 As shown, region 1, enclosed by a solid black line, contains multiple unit pixel areas. The pixel value changes within region 1 correspond to the same pixel transformation formula, such as Formula 1. Region 2, enclosed by a dashed black line, contains multiple unit pixel areas. The pixel value changes within region 2 correspond to the same pixel transformation formula, such as Formula 2. Region 3, enclosed by a dotted black line, contains multiple unit pixel areas. The pixel value changes within region 3 correspond to the same pixel transformation formula, such as Formula 3.

[0050] Different pixel conversion formulas indicate that the pixels in the corresponding area have different changes, which means that the reference image for the corresponding area may have undergone different retouching operations.

[0051] In one embodiment, regions corresponding to different pixel transformation formulas may overlap. For example... Figure 3 The area shown, 2, partially overlaps with area 1, indicating that two different image editing operations exist in area 2 simultaneously.

[0052] In this embodiment, one pixel conversion formula corresponds to one image retouching operation. To avoid the obtained pixel conversion formula failing to accurately and truthfully reflect its corresponding image retouching operation, it is necessary to remove the influence of the image retouching operation corresponding to another pixel conversion formula on that area when calculating the pixel conversion formula for the overlapping region.

[0053] Optionally, in one embodiment, determining each region in the reference image that differs from the image to be processed, and the corresponding retouching operation for each region, further includes: classifying the target region according to the area of ​​the target region; removing the retouching operation corresponding to the target region corresponding to the first category based on the pixel difference of the target region corresponding to the first category in the reference image to obtain a first reference sub-image; and determining each region in the first reference sub-image that differs from the image to be processed, and the corresponding retouching operation for each region based on the pixel difference between the first reference sub-image and the image to be processed.

[0054] In this embodiment, the target regions in the reference image are regions with the same pixel changes, i.e., regions corresponding to the same pixel transformation formula. Based on the target regions corresponding to different pixel transformation formulas, target regions with different areas can be obtained. The first category of target regions is regions in the reference image that overlap with other target regions and whose area is larger than the area of ​​the overlapping target region.

[0055] For example, if the regions where pixel changes are determined to include regions 1, 2, and 3, the region occupying the largest area of ​​the entire image and having the same pixel changes (i.e., the same pixel transformation formula) is first identified. This region, for example... Figure 4 Region 1 uses the pixel conversion formula 1, and its area is larger than that of regions 2 and 3. Applying the same retouching operation (using formula 1) to region 1 of the image to be processed will change the pixel values ​​of region 1 in the image to the pixel values ​​of region 1 in the reference image.

[0056] Then, the pixel value changes corresponding to Formula 1 need to be removed from the entire reference image. That is, before determining Formula 2 corresponding to region 2, the influence of the retouching operation corresponding to Formula 1 on region 2 in the reference image needs to be eliminated first, and then the pixel change formula is calculated for these regions 2.

[0057] For example, taking the same retouching operation corresponding to Formula 1 on the image to be processed in region 1, which is a 3x magnification of pixel values, the pixel change between the image to be processed and the reference image is a 3x magnification. Removing the influence of Formula 1 on region 2 means restoring the pixel values ​​of the reference image to their values ​​before the 3x magnification. This is achieved by subtracting the 3x magnified pixel values ​​from the current reference image pixel values ​​in region 2. After removing Formula 1, according to Formula 2, after performing a certain retouching operation on the image to be processed, region 2 changes from the image to the pixel values ​​of the reference image. Thus, by removing the retouching operation corresponding to the target region of the first category, the first reference sub-image is obtained.

[0058] Therefore, based on the pixel values ​​of the reference image after removing the influence of Formula 1 and the pixel values ​​of the image to be processed, the pixel conversion formula 2 can accurately reflect a certain retouching operation performed on region 2 of the original image to the reference image.

[0059] Similarly, for region 3, which has an area smaller than region 2, it is also necessary to remove the influence of formula 1 of region 1 and formula 2 of region 2 on a certain image retouching operation corresponding to region 3, so as to obtain an image conversion formula that reflects the image retouching operation, such as formula 3.

[0060] If it is unknown in advance whether the regions with pixel changes overlap, when calculating the pixel conversion formula for the target region, the influence of the pixel conversion formula of the region larger than that of the target region can be removed in order of the area occupied by each region.

[0061] Optionally, in one embodiment, determining each region in the reference image that differs from the image to be processed, and the corresponding retouching operation for each region, further includes: classifying the target region according to its area; removing the retouching operation for the target region corresponding to the second category in the reference image based on the pixel difference between the target region and the second category in the reference image, to obtain a second reference sub-image; determining each first region in the second reference sub-image that differs from the image to be processed, and the corresponding first retouching operation for each first region, based on the pixel difference between the second reference sub-image and the image to be processed; removing the retouching operation for the target region corresponding to the second category in the reference image without removing the pixel difference between the target region and the second category in the reference image, to obtain a third reference sub-image; determining each second region in the third reference sub-image that differs from the image to be processed, and the corresponding second retouching operation for each second region, based on the pixel difference between the third reference sub-image and the image to be processed; and determining each region in the reference image that differs from the image to be processed, and the corresponding retouching operation for each region, based on the first and second retouching operations.

[0062] In this embodiment, the second category of target regions refers to regions in the reference image whose area is larger than that of other target regions.

[0063] In cases where regions corresponding to the same pixel conversion formula have areas larger than other target regions, the retouching operation corresponding to the target region of the second category in the reference image is removed, that is, the pixel value change corresponding to the pixel conversion formula of the target region is removed, to obtain a second reference sub-image. Based on the first pixel value of the target region of the image to be processed and the pixel value of the second reference sub-image after removing the pixel value change, each first region in the second reference sub-image that has image differences from the image to be processed, and the pixel conversion formula corresponding to each first region, that is, the retouching operation corresponding to each first region, are determined.

[0064] Based on the first pixel value of the target region of the image to be processed and the pixel values ​​of the third reference sub-image (without removing the pixel value changes), the second regions in the third reference sub-image that differ from the image to be processed are determined, along with the corresponding pixel conversion formulas for each second region, i.e., the image retouching operations for each second region. Finally, based on the pixel conversion formulas for the first and second regions, the pixel conversion formulas for each region in the reference image that differs from the image to be processed are determined, i.e., the image retouching operations for each region.

[0065] In this embodiment, when the determined pixel change regions include region 1, region 2, and region 3, the region occupying the largest area of ​​the entire image and having the same pixel change is first obtained, for example... Figure 4 Region 1. Since there are no other regions in the image larger than region 1, Formula 1 can be determined directly by changing the pixel value of region 1 in the original image to the pixel value of region 1 in the reference image.

[0066] Then, when determining Formula 2 corresponding to Region 2, it is necessary to remove the pixel value changes generated by Formula 1 corresponding to Region 1, which has an area larger than Region 2, from the entire image, that is, to remove the influence of the image retouching operation corresponding to Formula 1 on Region 2.

[0067] At this point, the pixel change formula corresponding to region 2 can be calculated based on the pixel values ​​of the original image and the pixel values ​​of the reference image after removing the pixel value changes caused by formula 1, for example, formula 2-1 can be obtained.

[0068] At the same time, based on the pixel values ​​of the original image and the pixel values ​​of the reference image, the pixel change formula corresponding to region 2 is directly calculated, for example, formula 2-2 is obtained.

[0069] If region 2 overlaps with region 1, then the resulting formula 2-1, after removing the pixel value changes caused by formula 1, is different from formula 2-2, which is directly calculated based on the pixel values ​​of the original image and the reference image.

[0070] If region 2 does not overlap with region 1, then the resulting formula 2-1, after removing the pixel value changes caused by formula 1, is the same as formula 2-2, which is directly calculated based on the pixel values ​​of the original image and the reference image.

[0071] At this point, if Formula 2-1 and Formula 2-2 are different, Formula 2-1 will be determined as the pixel conversion formula for region 2. If Formula 2-1 and Formula 2-2 are the same, either Formula 2-1 or Formula 2-2 will be determined as the pixel conversion formula for region 2.

[0072] Repeat the above steps until the entire image to be processed and the reference image have been traversed, and the pixel conversion formula for all regions has been determined, then the process ends.

[0073] In addition to identifying the regions in the image to be processed and the reference image where there are image differences, it is also necessary to determine the corresponding retouching operations for each region where there are image differences.

[0074] Determining the retouching operation corresponding to each region where there are image differences includes: determining the target retouching operation corresponding to the target region based on the pixel conversion formula determined according to the pixel differences of the target region.

[0075] Typically, a specific pixel conversion formula corresponds to a specific retouching operation. For example, if the pixel conversion formula is y = 3x + 1, it means that the area corresponding to this formula has undergone a retouching operation that increases the brightness by 3 times.

[0076] Therefore, after obtaining the pixel conversion formula for the target area, the corresponding retouching operation can be roughly determined. Taking region 1 as an example, if according to pixel conversion formula 1, the overall brightness of region 1 is increased by 3 times, so the corresponding retouching operation can be recorded as "overall brightness enhancement". If according to pixel conversion formula 1, region 1 has undergone filter processing, then the corresponding retouching operation can be recorded as "local filter".

[0077] Optionally, generating a corresponding target layer based on the image retouching operation includes: matching the image retouching operation with the preset image database to obtain the process steps of the image retouching operation corresponding to the effect of the target image retouching operation; and determining the layer corresponding to the target area based on the process steps of the image retouching operation.

[0078] Image databases store data on various image retouching operations, including macro-level operations such as replacing fixed objects, changing colors, and adding text, as well as micro-level operations such as brightness adjustment, edge blurring, color adjustment, filters, and face slimming. This data can be pre-collected and categorized for storage in the image database. Each entry includes, for example, the name of the retouching operation, its effect, and the operation flow. The image database stores the corresponding operation flow in text format.

[0079] Regarding the process steps of image retouching, taking overall brightness enhancement as an example, if the image retouching operation corresponding to the original image is an overall brightness enhancement of 23%, the corresponding image retouching operation includes the following steps: (1) Select the brightness adjustment function; (2) Slide the brightness adjustment slider in the image retouching tool to adjust the brightness to 23%.

[0080] Taking local filters as an example, if the local noise reduction operation is used to transform the original image into a reference image, the corresponding retouching operation includes the following steps: (1) Select the filter menu; (2) Select the noise reduction function and use the brush to brush the area that needs to be processed.

[0081] The above constitutes a knowledge graph corresponding to different image retouching operations, which can be used to generate layers corresponding to image retouching operations in each area of ​​the application.

[0082] By matching image retouching operations with knowledge graphs in a knowledge graph database, corresponding data with the desired effect can be found. This allows us to obtain the retouching operation name for that data record. Based on the retouching operation name, the corresponding operation steps can be determined. In other words, it identifies the retouching operation corresponding to the target region in the reference image that has pixel differences from the image to be processed.

[0083] The above embodiments describe how to use a map database and pixel changes in the target region corresponding to microscopic differences to determine the retouching operation corresponding to the target region.

[0084] Similarly, for the pixel changes in the target region corresponding to the macroscopic differences in the embodiments of this application, the image retouching operation corresponding to the target region can also be determined using a graph database.

[0085] As mentioned above, OCR technology can identify the areas of difference between two images. It can also detect retouching effects on these areas, such as face swapping and local color adjustments.

[0086] Similar to determining the retouching operation corresponding to the target area with micro-differences, by matching the retouching operation effect with the knowledge graph in the graph database, the corresponding retouching operation name in the graph database can be found, and finally the operation steps corresponding to the target area with micro-image differences can be determined.

[0087] Image retouching operations include the operation name and corresponding steps. Each step of the corresponding retouching operation is automatically generated in a new layer.

[0088] In other words, the retouching process for a single image retouching operation is integrated into a single layer using software. This way, the text-based workflow corresponding to a particular retouching operation in the image database will be directly and visually displayed in this generated layer.

[0089] After identifying the multiple retouching operations required to convert the original image into a reference image, multiple layers are generated accordingly, each corresponding to one of the retouching operations. Different retouching operations can be achieved by overlaying different layers.

[0090] The generated multiple layers can be saved corresponding to a reference image, serving as an image editing tool that uses the reference image as a case study for image editing operations.

[0091] Step 108: Upon receiving a request for migration of the target layer, migrate the operation corresponding to the target layer to the image to be processed.

[0092] When a user views a reference image as a retouching example, if they wish to retouch the image to be processed based on the visual effect presented by the reference image, they can obtain the multiple layers generated corresponding to the reference image, retouch the image to be processed, and thus obtain a retouched image with the same retouching effect as the reference image.

[0093] If a user wants a specific area of ​​the image to be processed to have a certain retouching effect as a reference image, such as a local filter, they can directly select the layer corresponding to the local filter and perform the retouching operation on only that layer of the image to be processed.

[0094] In actual operation, when a user requests the migration of a target layer, for example, by dragging the target layer to the background layer of the image to be processed, the image retouching operation corresponding to a certain layer can be applied with one click, and the operation corresponding to the target layer can be migrated to the corresponding area in the image to be processed.

[0095] If a user wants the entire image to be processed to have the same retouching effect as the reference image, they can select each layer of the reference image in sequence and perform the retouching operations corresponding to all layers on the image to be processed.

[0096] In actual operation, when receiving the user's sequential input operations on each layer, such as dragging the target layer to the background layer of the target image that needs to be modified, the image retouching operation corresponding to each layer is completed.

[0097] If a user wants to learn how a specific retouching operation is performed on a reference image, they can directly click on the corresponding layer. For example... Figure 5As shown, based on user actions, the layer interface for the overall retouching workflow corresponding to the reference image is opened. This workflow includes layers 1 to 5 for each retouching operation of the reference image. Users can drag and drop the image to be processed into this layer interface and click according to the operation order of the layers generated on the right to generate a specific workflow for retouching the image to obtain the reference image.

[0098] In the image processing method of this application embodiment, an image to be processed and a reference image are obtained, wherein the reference image is an image after image retouching; each region in the reference image that differs from the image to be processed is determined, and the corresponding retouching operation for each region is identified; a corresponding target layer is generated based on the retouching operation; upon receiving a request to migrate the target layer, the operation corresponding to the target layer is migrated to the image to be processed. This allows for the acquisition of various retouching operations of the reference image. Multiple layers generated through multiple retouching operations facilitate users in selecting a specific layer to perform desired retouching on the image to be processed, based on the retouching effect of the reference image. The retouching method is simple, effective, time-saving, and labor-saving.

[0099] For users who want to learn the image editing workflow, the system allows them to view the detailed steps of each editing operation, facilitating a better and more intuitive learning experience. If a user is interested in the editing style of a particular image, they can directly access all the layers involved in that editing process, save them, and apply them to the editing of multiple other target images, thus enhancing the user experience.

[0100] Furthermore, the image retouching method in this application embodiment can also collect user feedback and automatically learn and update the image retouching method.

[0101] If a user finds their retouching of a reference image's target layer unsatisfactory—for example, increasing brightness by a factor of 3 (changing the pixel value of the corresponding area in the original image from 1 to 3) but the final image doesn't look good—then submitting feedback through the suggestion box to provide suggestions for improving filter-based retouching techniques.

[0102] Upon receiving user feedback, the system automatically generates two comparison images: one is the result image generated according to the operation steps corresponding to the target layer in this application, and the other is the result image generated according to the retouching operation steps based on the user's feedback. If it is determined that the image generated based on the user's feedback is better than the image generated based on the target layer, for example, by comprehensively considering the color contrast and pixel values ​​of the entire image, the system continuously improves the generated result of the target layer based on the operation process based on the user's feedback, thereby improving the accuracy of the retouching operation steps and enhancing the user experience.

[0103] It should be noted that the image processing method provided in this application embodiment can be executed by an image processing device or a control module within that image processing device for executing the image processing method. This application embodiment uses an image processing device executing the image processing method as an example to illustrate the image processing device provided in this application embodiment.

[0104] like Figure 6 As shown, the image processing apparatus 800 of this application embodiment includes:

[0105] The acquisition module 820 is used to acquire the image to be processed and the reference image, wherein the reference image is the image after image retouching.

[0106] The determination module 840 is used to determine each region in the reference image that has image differences from the image to be processed, and the corresponding image retouching operation for each region;

[0107] The generation module 860 is used to generate a corresponding target layer based on the image editing operation;

[0108] The migration module 880 is used to migrate the operation corresponding to the target layer to the image to be processed when a migration for the target layer is received.

[0109] Optionally, the determining module 840 specifically includes:

[0110] A generation submodule is used to generate a first pixel value of the image to be processed and a second pixel value of the reference image based on the unit pixels of the corresponding regions of the image to be processed and the reference image, respectively.

[0111] The comparison submodule is used to determine the target region with pixel differences in the reference image and the pixel difference corresponding to the target region by comparing the first pixel value and the second pixel value; and to determine the retouching operation corresponding to the target region in the reference image based on the pixel difference.

[0112] Optionally, the determining module 840 is further configured to:

[0113] The target regions are classified according to their area.

[0114] Based on the pixel difference of the target region corresponding to the first category in the reference image, the image editing operation corresponding to the target region corresponding to the first category is removed to obtain the first reference sub-image;

[0115] Based on the pixel difference between the first reference sub-image and the image to be processed, determine each region in the first reference sub-image that has image differences from the image to be processed, and the corresponding image retouching operation for each region.

[0116] Optionally, the determining module 840 is further configured to:

[0117] The target regions are classified according to their area.

[0118] Based on the pixel difference of the target region corresponding to the second category in the reference image, the image editing operation corresponding to the target region corresponding to the second category is removed to obtain the second reference sub-image;

[0119] Based on the pixel difference between the second reference sub-image and the image to be processed, determine each first region in the second reference sub-image that has an image difference from the image to be processed, and the first image retouching operation corresponding to each first region;

[0120] Based on the pixel difference of the target region corresponding to the second category in the reference image, without removing the retouching operation corresponding to the target region corresponding to the second category, a third reference sub-image is obtained;

[0121] Based on the pixel difference between the third reference sub-image and the image to be processed, determine each second region in the third reference sub-image that has an image difference from the image to be processed, and the second image retouching operation corresponding to each second region;

[0122] Based on the first image retouching operation and the second image retouching operation, determine the regions in the reference image that have image differences from the image to be processed, and the corresponding image retouching operations for each region.

[0123] Optionally, the generation module 860 specifically includes:

[0124] The acquisition submodule is used to match the image retouching operation with the preset image database and obtain the process steps of the image retouching operation corresponding to the target image retouching operation effect;

[0125] The determination submodule is used to determine the layer corresponding to the target area according to the process steps of the image retouching operation.

[0126] In the image processing apparatus of this application embodiment, by acquiring an image to be processed and a reference image, wherein the reference image is an image after image retouching; determining each region in the reference image that has image differences from the image to be processed, and the corresponding retouching operation for each region; generating a corresponding target layer based on the retouching operation; and, upon receiving a request to migrate the target layer, migrating the operation corresponding to the target layer to the image to be processed, thereby acquiring each retouching operation of the reference image, and generating multiple layers through multiple retouching operations, it is convenient for users to combine the retouching effect of the reference image and select a specific layer to perform the desired retouching processing on the image to be processed. The retouching method is simple, effective, time-saving, and labor-saving.

[0127] The image processing device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0128] The image processing device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.

[0129] The image processing device provided in this application embodiment can achieve... Figures 1 to 5 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0130] Optional, such as Figure 7 As shown, this application embodiment also provides an electronic device 900, including a processor 940, a memory 920, and a program or instructions stored in the memory 920 and executable on the processor 940. When the program or instructions are executed by the processor 940, they implement the various processes of the above-described image processing method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0131] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0132] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0133] The electronic device 1000 includes, but is not limited to, components such as: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.

[0134] Those skilled in the art will understand that the electronic device 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0135] The processor 1010 is used to acquire the image to be processed and the reference image, wherein the reference image is the image after image retouching.

[0136] Identify the regions in the reference image that differ from the image to be processed, and the corresponding image retouching operations for each region;

[0137] Generate the corresponding target layer based on the image retouching operation;

[0138] Upon receiving a request for migration of the target layer, the operation corresponding to the target layer is migrated to the image to be processed.

[0139] In this embodiment, by acquiring an image to be processed and a reference image, wherein the reference image is an image that has undergone image retouching; determining each region in the reference image that differs from the image to be processed, and the corresponding retouching operation for each region; generating a corresponding target layer based on the retouching operation; and upon receiving a request to migrate the target layer, migrating the operation corresponding to the target layer to the image to be processed, thereby acquiring each retouching operation of the reference image, and generating multiple layers through multiple retouching operations, users can conveniently combine the retouching effect of the reference image to select a specific layer for desired retouching of the image to be processed. The retouching method is simple, effective, time-saving, and labor-saving.

[0140] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here. The memory 1009 can be used to store software programs and various data, including but not limited to applications and operating systems. Processor 1010 can integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 1010.

[0141] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described image processing method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0142] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0143] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described image processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0144] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0145] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0147] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An image processing method, characterized in that, include: Acquire the image to be processed and a reference image, wherein the reference image is an image that has undergone image retouching; Based on the unit pixels of the corresponding regions of the image to be processed and the reference image, the first pixel value of the image to be processed and the second pixel value of the reference image are generated respectively. By comparing the first pixel value and the second pixel value, the target region in the reference image where there is a pixel difference is determined; The target regions are classified according to their area. Based on the pixel difference of the target region corresponding to the first category in the reference image, the image editing operation corresponding to the target region corresponding to the first category is removed to obtain the first reference sub-image; Based on the pixel difference between the first reference sub-image and the image to be processed, determine each region in the first reference sub-image that has image differences from the image to be processed, and the corresponding image retouching operation for each region; Generate the corresponding target layer based on the image retouching operation; Upon receiving a request for migration of the target layer, the operation corresponding to the target layer is migrated to the image to be processed.

2. The method according to claim 1, characterized in that, After classifying the target region according to its area, the method further includes: Based on the pixel difference of the target region corresponding to the second category in the reference image, the image editing operation corresponding to the target region corresponding to the second category is removed to obtain the second reference sub-image; Based on the pixel difference between the second reference sub-image and the image to be processed, determine each first region in the second reference sub-image that has an image difference from the image to be processed, and the first image retouching operation corresponding to each first region; Based on the pixel difference of the target region corresponding to the second category in the reference image, without removing the retouching operation corresponding to the target region corresponding to the second category, a third reference sub-image is obtained; Based on the pixel difference between the third reference sub-image and the image to be processed, determine each second region in the third reference sub-image that has an image difference from the image to be processed, and the second image retouching operation corresponding to each second region; Based on the first image retouching operation and the second image retouching operation, determine the regions in the reference image that have image differences from the image to be processed, and the corresponding image retouching operations for each region.

3. The method according to any one of claims 1 to 2, characterized in that, The image retouching operation generates a corresponding target layer, including: The image retouching operation is matched with a preset image database to obtain the process steps of the image retouching operation corresponding to the target image retouching effect; Based on the steps of the image retouching operation, determine the layer corresponding to the target area.

4. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the image to be processed and the reference image, wherein the reference image is the image after image retouching. A generation submodule is used to generate a first pixel value of the image to be processed and a second pixel value of the reference image based on the unit pixels of the corresponding regions of the image to be processed and the reference image, respectively. The comparison submodule is used to determine the target region in the reference image where there are pixel differences by comparing the first pixel value and the second pixel value; The determination module is used to classify the target region based on its area. Based on the pixel difference of the target region corresponding to the first category in the reference image, the image editing operation corresponding to the target region corresponding to the first category is removed to obtain the first reference sub-image; Based on the pixel difference between the first reference sub-image and the image to be processed, determine each region in the first reference sub-image that has image differences from the image to be processed, and the corresponding image retouching operation for each region; The generation module is used to generate the corresponding target layer based on the image retouching operation; The migration module is used to migrate the operation corresponding to the target layer to the image to be processed when a migration for the target layer is received.

5. The apparatus according to claim 4, characterized in that, The determining module is further configured to: The target regions are classified according to their area. Based on the pixel difference of the target region corresponding to the second category in the reference image, the image editing operation corresponding to the target region corresponding to the second category is removed to obtain the second reference sub-image; Based on the pixel difference between the second reference sub-image and the image to be processed, determine each first region in the second reference sub-image that has an image difference from the image to be processed, and the first image retouching operation corresponding to each first region; Based on the pixel difference of the target region corresponding to the second category in the reference image, without removing the retouching operation corresponding to the target region corresponding to the second category, a third reference sub-image is obtained; Based on the pixel difference between the third reference sub-image and the image to be processed, determine each second region in the third reference sub-image that has an image difference from the image to be processed, and the second image retouching operation corresponding to each second region; Based on the first image retouching operation and the second image retouching operation, determine the regions in the reference image that have image differences from the image to be processed, and the corresponding image retouching operations for each region.

6. The apparatus according to any one of claims 4 to 5, characterized in that, The generation module specifically includes: The acquisition submodule is used to match the image retouching operation with a preset image database to obtain the process steps of the image retouching operation corresponding to the target image retouching operation effect. The determination submodule is used to determine the layer corresponding to the target area according to the process steps of the image retouching operation.

7. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the image processing method as described in any one of claims 1-3.

8. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image processing method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Intelligent picture retouching method and terminal

    CN107169920A

  • Method and device for generating expression image

    CN108846881A

  • Image processing method, skin beautification model training method and related devices

    CN111583154A