Image processing method and device and electronic equipment

By generating an auxiliary layer based on the relative offset information of pixels, the problem of jagged edges in image deformation processing is solved, improving the deformation effect and user experience.

CN120997033APending Publication Date: 2025-11-21BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410627842.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing technologies, image deformation processing can easily lead to jagged edges, which affects the user experience.

Method used

By acquiring the deformation operation information of the original image, determining the relative offset information of the pixels, generating an auxiliary layer, and performing deformation processing based on this layer, the target image is obtained.

Benefits of technology

It solves the problem of jagged edges in images, improves image distortion effects, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997033A_ABST
    Figure CN120997033A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device and electronic equipment. A specific implementation mode of the method comprises the steps of obtaining an original image; determining relative offset information of pixel points of the original image and pixel points of a target image based on the operation information of the deformation operation on the original image; determining an auxiliary image layer for processing the original image based on the relative offset information; and based on the auxiliary image layer, performing deformation processing on the original image to obtain a target image. According to the embodiment, the problem that sawteeth appear on the edge in the image is solved, the deformation effect of the image is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and in particular, to an image processing method and device and electronic equipment. BACKGROUND

[0002] With the increasingly wide application of digital images, the types of digital image processing technology have become increasingly rich and diverse, providing more convenience for people to modify and process images. Modification of images can include adding various special effects and filters to images, etc., which can achieve fine-tuning and beautification of images, making images more lively and interesting. For example, a powerful morphing tool is included in the filters added to images, which can achieve image morphing, reshaping and modification, etc. At present, a scheme is needed to improve the morphing effect. SUMMARY

[0003] The present disclosure provides an image processing method, device and electronic equipment.

[0004] According to a first aspect, an image processing method is provided, the method comprising:

[0005] obtaining an original image;

[0006] determining relative offset information of a pixel point of the original image and a pixel point of a target image based on operation information of a morphing operation on the original image;

[0007] determining an auxiliary layer for processing the original image based on the relative offset information;

[0008] performing morphing processing on the original image based on the auxiliary layer to obtain a target image.

[0009] According to a second aspect, an image processing device is provided, the device comprising:

[0010] an obtaining module configured to obtain an original image;

[0011] a first determining module configured to determine relative offset information of a pixel point of the original image and a pixel point of a target image based on operation information of a morphing operation on the original image;

[0012] a second determining module configured to determine an auxiliary layer for processing the original image based on the relative offset information;

[0013] a processing module configured to perform morphing processing on the original image based on the auxiliary layer to obtain a target image.

[0014] According to a third aspect, a computer readable storage medium is provided, the storage medium storing a computer program which, when executed by a processor, implements the method of any one of the first aspect.

[0015] According to a fourth aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of the first aspect when executing the program.

[0016] Embodiments of the present disclosure provide technical solutions that can include the following beneficial effects:

[0017] Embodiments of the present disclosure provide an image processing method and device, which determines relative offset information of pixel points of an original image and pixel points of a target image according to operation information of a user performing a deformation operation on the original image on a screen, determines an auxiliary layer based on the relative offset information, and performs deformation processing on the original image based on the auxiliary layer to obtain the target image. Thus, the problem of jagged edges in an image is solved, the deformation effect of the image is improved, and user experience is improved.

[0018] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.

[0020] Figure 1 is a schematic diagram of the effect of image deformation processing in a related art shown by the present disclosure;

[0021] Figure 2 is a schematic diagram of an image processing application scenario shown by the present disclosure according to an exemplary embodiment;

[0022] Figure 3 is a flowchart of an image processing method shown by the present disclosure according to an exemplary embodiment;

[0023] Figure 4A is a schematic diagram of an image processing scenario shown by the present disclosure according to an exemplary embodiment;

[0024] Figure 4B is another schematic diagram of an image processing scenario shown by the present disclosure according to an exemplary embodiment;

[0025] Figure 4C is a schematic diagram of an image processing effect according to an example embodiment of the present disclosure;

[0026] Figure 5 is a block diagram of an image processing apparatus according to an example embodiment of the present disclosure;

[0027] Figure 6 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure. DETAILED DESCRIPTION

[0028] In order to enable persons skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in conjunction with the drawings in the specification. Obviously, the described embodiments are only some of the embodiments of the specification, not all the embodiments. Based on the embodiments in the specification, all other embodiments obtained by persons skilled in the art without creative labor should be within the scope of protection of the specification.

[0029] The following description refers to the accompanying drawings. Unless otherwise indicated, same numbers in different drawings indicate same or similar elements. The following example embodiments described are not meant to represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0030] The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used in the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0031] It should be understood that, although the terms first, second, third, etc. can be employed in this disclosure to describe various information, these information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon" or "in response to determining".

[0032] With the increasingly wide application of digital images, the types of digital image processing technologies become more and more rich and diverse, providing more convenience for people to modify and process images. The modification of images can include adding various special effects and filters to images, etc., which can realize fine tuning and beautification of images, and make images more lively and interesting. For example, a powerful deformation processing tool is included in the filters added to images, which can realize deformation, reshaping and modification of images, etc. For example, through the deformation processing tool, some areas in the image can be pushed, stretched, reduced, inflated, rotated, twisted and deformed, etc.

[0033] In the related art, the image selected by the user is displayed on the screen, and the user can perform deformation operation on the image on the screen, and the image can be grid split, and the deformation effect of the image can be realized in combination with the operation track of the user on the screen. However, if the deformation is complex, since the image is grid split to realize the deformation of the image, the edges in the image are prone to appear jagged. As shown in Figure 1 , the image 101 is an original image to be processed, and the image 102 is an image obtained by deforming the image 101 by using the related art.

[0034] The image processing method provided by the present disclosure determines the relative offset information of the pixel points of the original image and the pixel points of the target image according to the operation information of the user performing deformation operation on the original image to be processed on the screen, determines the auxiliary layer based on the relative offset information, and deforms the original image based on the auxiliary layer to obtain the target image. Thus, the problem of jagged edges in the image is solved, the deformation effect of the image is improved, and the user experience is improved.

[0035] Referring to Figure 2 , an image processing application scenario according to an example embodiment is shown.

[0036] As Figure 2As shown, the specific application scenario of the embodiment can be that the terminal device held by the user is installed with an application program for processing images. First, the user can open the operation page of the application program and input the image A to be processed into the application program, so that the application program displays the image A on the screen. Then, the user selects a morphing processing type (such as push, stretch, shrink, restore, inflate, brush size, rotation or twist, etc.) from the morphing operation toolbar and performs morphing operation on the image A on the screen. The morphing can also be defined as “liquefaction morphing” or “liquefaction”. In addition, the application program can generate a layer B in an initial state for the image A, and the layer B has the same size as the image A, so that the layer B and the pixels in the image A correspond one by one in position. For example, the resolution of the image A is MxN, and the resolution of the layer B is also MxN. The pixel value of each pixel point of the layer B in the initial state can be a uniform default value, and the embodiment does not limit the specific value of the default value.

[0037] The terminal device can continuously monitor the operation track of the user on the screen, and calculate the offset value of each pixel point in the image A in the horizontal coordinate direction and the offset value in the vertical coordinate direction according to the captured operation track and the selected morphing processing type. The relative offset information between the pixel points of the image A and the pixel points of the morphed image can be determined according to the offset value of each pixel point in the image A in the horizontal coordinate and the offset value in the vertical coordinate. The pixel value of the layer B is updated by using the relative offset information. For example, the relative offset information can be recorded through the color channel of the pixel point in the layer B.

[0038] Then, the GPU in the terminal device can be used to analyze and process the image A and the layer B, and determine the pixel value of each pixel point in the morphed image C according to the image A and the layer B. The image C is displayed on the screen of the terminal device based on the pixel value of each pixel point in the image C. It should be noted that since the operation of the user is continuous, the relative offset information of the pixel points can be continuously calculated, the pixel value of the layer B can be continuously updated, and the generated image C can be continuously updated.

[0039] Additionally, during a user's transformation operation, if a preset state node storage event is triggered, the current layer B can be stored as a state node layer in the state node layer sequence. This sequence stores multiple state node layers in chronological order, with each layer corresponding to a sequence number. The state node layer sequence can be used to undo / replay operations and prevent the loss of operation information. For example, if the latest state node layer corresponds to sequence number n, the user can undo the operation and retrieve the state node layer with sequence number n-1 for use. The user can also replay the operation to retrieve the state node layer with sequence number n and continue using it. When the user leaves the page where the transformation operation occurred and re-enters the page, the latest state node layer in the sequence can be retrieved and used again.

[0040] The present disclosure will now be described in detail with reference to specific embodiments.

[0041] Figure 3 This is a flowchart illustrating an image processing method according to an exemplary embodiment. The method can be applied to a terminal device. In this embodiment, for ease of understanding, it is illustrated in conjunction with a terminal device capable of installing third-party applications for image processing. Those skilled in the art will understand that the terminal device may include, but is not limited to, mobile terminal devices such as smartphones, smart wearable devices, tablets, and desktop computers. The method may include the following steps:

[0042] like Figure 3 As shown, in step 301, the original image is acquired; in step 302, the relative offset information of the pixels of the original image and the pixels of the target image is determined based on the operation information of the deformation operation on the original image; and in step 303, an auxiliary layer for processing the original image is determined based on the above operation information.

[0043] In this embodiment, the user can select the original image to be processed from the image library of the terminal device or from the cloud database, and input the original image into the application used for image processing. Alternatively, a frame can be directly captured as the original image through the shooting interface provided by the application used for image processing. Then, the application can display the original image on the screen through the image processing page, which provides various image processing operation tools. The user can select the deformation processing type from the deformation operation toolbar provided on the screen. The deformation processing type may include, but is not limited to, pushing, stretching, shrinking, restoring, expanding, brush size adjustment, rotation, or distortion. Different deformation processing types can produce different image processing effects.

[0044] Then, the user can perform a deformation operation on the original image through the screen. The terminal device can constantly monitor the operation of the user on the screen, and obtain operation information of the deformation operation on the original image based on the operation of the user on the screen. For example, the operation information can include the deformation processing type selected by the user and the operation trajectory of the user on the screen.

[0045] In this embodiment, after the original image is displayed on the screen, an initial layer can be generated according to the resolution of the original image, and the pixel value of each pixel point of the initial layer is set to a default value, and the specific value of the default value is not limited in this embodiment. Then, after the user performs a deformation operation on the original image through the screen, the initial layer can be updated by using the obtained operation information to obtain an auxiliary layer. If the user continuously performs a deformation operation on the original image, the auxiliary layer can be constantly updated according to the operation information of the user.

[0046] Specifically, the target processing algorithm corresponding to the selected deformation processing type can be determined first, and then the relative offset information between the pixel points of the original image and the pixel points of the target image is calculated according to the operation trajectory of the original image by using the target processing algorithm, and the auxiliary layer is determined according to the relative offset information. The relative offset information between the pixel points of the original image and the pixel points of the target image can be the offset value of the first pixel point of the original image in the horizontal coordinate and the offset value in the vertical coordinate when the first pixel point of the original image is mapped into the target image with the first pixel point of the original image as a reference. Or it can be the offset value of the second pixel point of the target image in the horizontal coordinate and the offset value in the vertical coordinate when the second pixel point of the target image is mapped into the original image with the second pixel point of the target image as a reference. The first pixel point of the original image can be a pixel point that is offset under the influence of the user operation. The second pixel point of the target image can be a pixel point of the region covered by the offset pixel point under the influence of the user operation.

[0047] For example, as shown in FIG. 4, the user can perform a deformation operation on the original image through the screen. The terminal device can constantly monitor the operation of the user on the screen, and obtain operation information of the deformation operation on the original image based on the operation of the user on the screen. For example, the operation information can include the deformation processing type selected by the user and the operation trajectory of the user on the screen. Figure 4AAs shown, image 401 is an original image to be processed, and image 402 is a target image after processing. Region 403 in image 401 is a region in which pixel points are shifted under the influence of user operation when the user operates image 401, and thus the pixel points in region 403 are first pixel points of the original image. Region 404 in image 402 is a region covered by the shifted first pixel points under the influence of user operation after the user operates image 401, and thus the pixel points in region 404 are second pixel points of the target image. Taking pixel point d in region 403 as an example, the coordinates of pixel point d in image 401 are (x1, y1), and the coordinates of pixel point d in image 402 are (x2, y2) under the influence of user operation, which causes the shift of pixel point d. The shift of pixel point d from image 401 to image 402, i.e., (x2-x1, y2-y1), can be used as relative shift information between the pixel points of image 401 and the pixel points of image 402. Alternatively, the shift of pixel point d from image 402 to image 401, i.e., (x1-x2, y1-y2), can be used as relative shift information between the pixel points of image 401 and the pixel points of image 402.

[0048] In an implementation, the pixel difference between the pixel points of the original image and the pixel points of the target image can be recorded by the pixel values of the pixel points in the auxiliary layer. For example, based on the relative shift information, the coordinates of each pixel point in the target image in the original image can be determined to determine the pixel values of each pixel point in the target image. The difference data between the pixel values of each pixel point in the target image and the pixel values of each pixel point in the original image can be calculated, and the pixel values of the pixel points in the auxiliary layer can be updated based on the difference data.

[0049] In another implementation, the relative shift information between the pixel points of the original image and the pixel points of the target image can also be recorded by the color channels of the pixel points in the auxiliary layer. Specifically, there are various color spaces for representing the colors of an image, and different color spaces have different color channels. Generally, the color channels of a color space can correspond to at least two color components. In this embodiment, the color channels of an image can be divided into two groups (i.e., a first group and a second group), each group of color channels corresponds to at least one color component, and the color components corresponding to the two groups of color channels are different, but the number of the color components corresponding to the two groups of color channels is the same.

[0050] For example, taking the most common color space RGBA as an example, the color space RGBA has four channels of R, G, B, and A, and the four channels can be divided into two groups of channels, i.e., a first channel and a second channel. The first channel corresponds to color component R and color component G, and the second channel corresponds to color component B and color component A. For another example, taking the color space CMYK as an example, the color space CMYK has four channels of C, M, Y, and K, and the four channels can be divided into two groups of channels, i.e., a first channel and a second channel. The first channel corresponds to color component C and color component M, and the second channel corresponds to color component Y and color component K. For yet another example, taking the color space Lab as an example, the color space Lab has three channels of brightness, a, and b, and a first channel and a second channel can be selected from the three channels. The first channel can correspond to color component a, and the second channel can correspond to color component b.

[0051] Then, based on the above relative offset information, the offset value on the horizontal coordinate and the offset value on the vertical coordinate can be determined. Then, based on the offset value on the horizontal coordinate and the offset value on the vertical coordinate, the pixel value of the pixel point in the auxiliary layer is updated. Specifically, the offset value on the horizontal coordinate can be mapped to the value of the first channel of the pixel point in the auxiliary layer according to a preset mapping rule, and the offset value on the vertical coordinate can be mapped to the value of the second channel of the pixel point in the auxiliary layer. The color channel of the pixel point in the obtained auxiliary layer records the above relative offset information. Figure 4B The image 410 is an auxiliary layer obtained by recording the above relative offset information. It should be noted that the preset mapping rule can be any rule that can reasonably map the offset value on the coordinate to the color channel of the pixel point in the auxiliary layer. The embodiment is not limited in terms of the specific content of the mapping rule.

[0052] For example, in an implementation manner, the coordinate of the pixel point p in the original image is (u1, v1), and the position of the pixel point p is offset under the influence of the user operation, so that the coordinate of the pixel point p in the target image becomes (u2, v2). (u2-u1, v2-v1) is calculated as the relative offset information between the pixel point of the original image and the pixel point of the target image. When the auxiliary layer is updated by using the relative offset information, u2-u1 is mapped to the value of the first channel corresponding to the pixel point with the coordinate (u1, v1) in the auxiliary layer, and v2-v1 is mapped to the value of the second channel corresponding to the pixel point with the coordinate (u1, v1) in the auxiliary layer.

[0053] In another implementation, the coordinate of the pixel p in the original image is (u1, v1), and the position of the pixel p is offset under the influence of the user operation, so that the coordinate of the pixel p in the target image becomes (u2, v2). The (u1-u2, v1-v2) is calculated as the relative offset information between the pixel in the original image and the pixel in the target image. When the auxiliary layer is updated by using the relative offset information, u1-u2 is mapped to the value of the first channel corresponding to the pixel with the coordinate (u2, v2) in the auxiliary layer, and v1-v2 is mapped to the value of the second channel corresponding to the pixel with the coordinate (u2, v2) in the auxiliary layer.

[0054] Since the relative offset information is recorded by using the color channels corresponding to the pixels in the auxiliary layer in the embodiment, the space occupied by the intermediate data is reduced, and the GPU is more conducive to the deformation processing of the image, so that the effect of the deformation processing is improved, and the efficiency of the deformation processing is improved.

[0055] In step 304, the original image is deformed based on the auxiliary layer to obtain a target image.

[0056] In the embodiment, the pixel value of each pixel in the target image can be determined based on the auxiliary layer and the original image, and the target image is rendered based on the pixel value of each pixel in the target image. For example, the corresponding position of each pixel in the target image in the original image can be determined based on the auxiliary layer, and the pixel value of each pixel in the target image is obtained based on the corresponding position of each pixel in the original image and the pixel value of the pixel in the original image. As shown in FIG. 4, the image 411 is an image obtained by deforming the original image to be processed by using the scheme of the disclosure. Figure 4C

[0057] If the pixel at the position t1 in the original image is offset to the position t2 in the target image under the influence of the user operation, and the position t2 in the target image only corresponds to the pixel at the position t1 in the original image, the pixel value of the pixel at the position t1 in the original image is taken as the pixel value of the pixel at the position t2 in the target image.

[0058] ​It should be noted that in some complex cases, if the pixel point at position t1 and the pixel point at position t3 in the original image are both shifted to position t2 in the target image under the influence of the user operation, the pixel value of the pixel point at position t1 and the pixel value of the pixel point at position t3 in the original image are taken, and the pixel value of the pixel point at position t2 in the target image is calculated based on a preset algorithm (for example, a weighted average algorithm).

[0059] If the pixel point at position t2 in the original image is shifted under the influence of the user operation, and no pixel point at other positions in the original image is shifted to position t2 in the target image, the pixel value of the pixel point at position t2 in the target image can be taken as the pixel value of the pixel point at position t2 in the original image by a preset algorithm.

[0060] In addition, in some embodiments, in response to occurrence of a first trigger event, the current auxiliary layer can be stored as a state node layer, and the state node layer is stored in a state node layer sequence arranged in time sequence. The first trigger event can be an event that the user stops the gesture operation, or an event that a preset button in the screen is clicked, and the like. The specific setting of the first trigger event is not limited in this embodiment. In response to occurrence of a second trigger event, the undo / replay operation can be performed based on the state node layer sequence.

[0061] The image processing method provided by the present disclosure determines the relative shift information of the pixel points of the original image and the pixel points of the target image according to the operation information of the user performing the deformation operation on the original image on the screen, determines the auxiliary layer based on the relative shift information, and performs the deformation processing on the original image based on the auxiliary layer to obtain the target image. Thus, the problem of jagged edges in the image is solved, the deformation effect of the image is improved, and the user experience is improved.

[0062] It should be noted that although the operations of the method of the embodiments of the present disclosure are described in a specific order in the above-described embodiments, this does not require or imply that the operations must be performed in this specific order, or that all of the shown operations must be performed to achieve the desired result. On the contrary, the steps depicted in the flowcharts can change the order of execution. Additionally or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps.

[0063] Corresponding to the foregoing image processing method embodiments, the present disclosure also provides embodiments of an image processing device.

[0064] As Figure 5 shown, Figure 5is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure, which can include an obtaining module 501, a first determining module 502, a second determining module 503 and a processing module 504.

[0065] The obtaining module 501 is configured to obtain an original image.

[0066] The first determining module 502 is configured to determine relative offset information of a pixel point of the original image and a pixel point of a target image based on operation information of a deformation operation on the original image.

[0067] The second determining module 503 is configured to determine an auxiliary layer for processing the original image based on the relative offset information.

[0068] The processing module 504 is configured to perform a deformation operation on the original image based on the auxiliary layer to obtain the target image.

[0069] In some embodiments, the operation information includes a selected deformation processing type and an operation track on the original image.

[0070] In other embodiments, the first determining module 502 includes a determining sub-module and a calculating sub-module (not shown in the figure).

[0071] The determining sub-module is configured to determine a target processing algorithm corresponding to the selected deformation processing type.

[0072] The calculating sub-module is configured to calculate the relative offset information according to the operation track on the original image by using the target processing algorithm.

[0073] In other embodiments, the relative offset information can include any one of the following: offset information of a first pixel point in the original image when the first pixel point is mapped to the target image; and offset information of a second pixel point in the target image when the second pixel point is mapped to the original image.

[0074] In other embodiments, the relative offset information is recorded in a color channel corresponding to a pixel point in the auxiliary layer.

[0075] In other embodiments, the color channel includes a first channel corresponding to at least one color component and a second channel having the same number of color components, and the color components corresponding to the first channel and the second channel are different. The second determining module 503 is configured to determine offset information on a horizontal coordinate and offset information on a vertical coordinate based on the relative offset information, map the offset information on the horizontal coordinate to a value of the first channel and map the offset information on the vertical coordinate to a value of the second channel according to a preset mapping rule, to obtain the auxiliary layer.

[0076] In some embodiments, the processing module 504 is configured to determine the pixel value of the pixel point in the target image based on the auxiliary image layer and the original image, and obtain the target image based on the pixel value of the pixel point in the target image.

[0077] In some embodiments, the apparatus can further include a storage module and an operation module (not shown in the figure).

[0078] The storage module is configured to, in response to a first trigger event, store the current auxiliary image layer as a state node layer to obtain a state node layer sequence, the state node layer sequence including a plurality of state node layers arranged in time sequence.

[0079] The operation module is configured to, in response to a second trigger event, perform undo / replay operation based on the state node layer sequence.

[0080] For the apparatus embodiment, since it basically corresponds to the method embodiment, the related parts are described in the part of the method embodiment. The apparatus embodiment described above is only illustrative, and the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Some or all of the modules can be selected to achieve the purpose of the embodiment of the present disclosure according to actual needs. Those skilled in the art can understand and implement it without creative labor.

[0081] Some embodiments of the present disclosure provide an electronic device. The electronic device includes a processor and a memory, which can be used to implement a client or a server. The memory is used to non-transiently store computer executable instructions (for example, one or more computer program modules). The processor is used to run the computer executable instructions, which can execute one or more steps of the image processing method described above when run by the processor, and thus implement the image processing method described above. The memory and the processor can be interconnected through a bus system and / or other forms of connection mechanism (not shown).

[0082] For example, the processor can be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capability and / or program execution capability. For example, the central processing unit (CPU) can be X86 or ARM architecture, etc. The processor can be a general-purpose processor or a special-purpose processor, which can control other components in the electronic device to perform desired functions.

[0083] For example, the memory can include any combination of one or more computer program products which can include various forms of computer-readable storage media, for example, volatile memory and / or non-volatile memory. Volatile memory, for example, can include random access memory (RAM), and / or cache memory, etc. Non-volatile memory, for example, can include read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), compact disc read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules can be stored on the computer-readable storage media, and the processor can execute the one or more computer program modules to implement various functions of the electronic device. Various application programs and various data used and / or generated by the application programs, etc. can also be stored in the computer-readable storage media.

[0084] It should be noted that, in the embodiments of the present disclosure, the specific functions and technical effects of the electronic device can refer to the description of the image processing method in the foregoing description, which will not be repeated here.

[0085] Figure 6 A schematic block diagram of an electronic device is provided for some embodiments of the present disclosure. The electronic device 920 is suitable for implementing the image processing method provided by the embodiments of the present disclosure, for example. The electronic device 920 can be a terminal device, etc., and can be used to implement a client or a server. The electronic device 920 can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a vehicle terminal (such as a vehicle navigation terminal), a wearable electronic device, etc., and a fixed terminal such as a digital TV, a desktop computer, a smart home device, etc. It should be noted that, Figure 6 The electronic device 920 shown is only an example, which does not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0086] As Figure 6 shown, the electronic device 920 can include a processing device (such as a central processing unit, a graphics processing unit, etc.) 921, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 922 or programs loaded from a storage device 928 into a random access memory (RAM) 923. Various programs and data required for the operation of the electronic device 920 are also stored in the RAM 923. The processing device 921, the ROM 922, and the RAM 923 are connected to each other through a bus 924. An input / output (I / O) interface 925 is also connected to the bus 924.

[0087] In general, the following devices can be connected to the I / O interface 925: input devices 926, including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 927, including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 928, including, for example, a magnetic tape, a hard disk, and the like; and communication devices 929. The communication devices 929 can allow the electronic device 920 to communicate wirelessly or wiredly with other electronic devices to exchange data. Although Figure 6 The electronic device 920 is shown with various devices, but it is understood that not all of the shown devices are required to be implemented or present, and the electronic device 920 can instead be implemented or present more or fewer devices.

[0088] For example, according to embodiments of the present disclosure, the image processing method described above can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer readable medium, the computer program including program code for executing the image processing method described above. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 929, or installed from the storage devices 928, or installed from the ROM 922. When the computer program is executed by the processing devices 921, the functions defined in the image processing method provided by embodiments of the present disclosure can be implemented.

[0089] Some embodiments of the present disclosure provide a storage medium. For example, the storage medium can be a non-transitory computer readable storage medium for storing non-transitory computer executable instructions. When the non-transitory computer executable instructions are executed by a processor, the image processing method described by embodiments of the present disclosure can be implemented, for example, when the non-transitory computer executable instructions are executed by a processor, one or more steps of the image processing method described above can be performed.

[0090] For example, the storage medium can be applied in the electronic device described above, for example, the storage medium can include a memory in the electronic device.

[0091] For example, the storage medium can include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM), a compact disc read only memory (CD-ROM), a flash memory, or any combination of the above storage mediums, or other applicable storage medium.

[0092] For example, the description about the storage medium can refer to the description about the memory in the embodiment of the electronic device, and the repeated parts will not be described herein. The specific functions and technical effects of the storage medium can refer to the description about the image processing method in the foregoing, and will not be described herein.

[0093] It should be noted that, in the context of the present disclosure, the computer-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, a RF (radio frequency), or the like, or any suitable combination of the above.

[0094] Other embodiments of the present disclosure will be apparent to those skilled in the art upon consideration of the specification and practice of the principles disclosed herein. The present disclosure is intended to include any variations of the present disclosure following the principles of the present disclosure and including any known or customary practice in the art not specifically disclosed. The specification and examples are to be considered exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.

[0095] It should be understood that the present disclosure is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, the method comprising: Obtain the original image; Based on the operation information of the deformation operation on the original image, the relative offset information of the pixels of the original image and the pixels of the target image is determined; Based on the relative offset information, an auxiliary layer is determined for processing the original image; Based on the auxiliary layer, the original image is deformed to obtain the target image.

2. The method according to claim 1, wherein, The operation information includes: the selected deformation processing type and the operation trajectory of the original image.

3. The method according to claim 2, wherein, The step of determining the relative offset information between pixels in the original image and pixels in the target image based on the operation information of the deformation operation on the original image includes: Determine the target processing algorithm corresponding to the selected deformation processing type; Using the target processing algorithm, the relative offset information is calculated based on the operation trajectory of the original image.

4. The method according to claim 1, wherein, The relative offset information includes any of the following: When mapping the first pixel in the original image to the target image, the offset information of the first pixel; The offset information of the second pixel when mapping the second pixel in the target image to the original image.

5. The method according to claim 1, wherein, The relative offset information is recorded in the color channel corresponding to the pixel in the auxiliary layer.

6. The method according to claim 5, wherein, The color channel includes a first channel corresponding to at least one color component and a second channel having the same number of color components; The first channel and the second channel correspond to different color components; wherein, determining the auxiliary layer for processing the original image based on the relative offset information includes: Based on the relative offset information, the offset information on the horizontal axis and the offset information on the vertical axis are determined; According to the preset mapping rules, the offset information on the horizontal axis is mapped to the value of the first channel, and the offset information on the vertical axis is mapped to the value of the second channel to obtain the auxiliary layer.

7. The method according to claim 1, wherein, The process of deforming the original image based on the auxiliary layer to obtain the target image includes: Based on the auxiliary layer and the original image, determine the pixel values ​​of the pixels in the target image; The target image is obtained based on the pixel values ​​of the pixels in the target image.

8. The method according to claim 1, further comprising: In response to the first trigger event, the current auxiliary layer is stored as a state node layer, resulting in a sequence of state node layers; The state node layer sequence includes multiple state node layers arranged in chronological order; In response to the second triggering event, an undo / replay operation is performed based on the state node layer sequence.

9. An image processing apparatus, the apparatus comprising: The acquisition module is used to acquire the original image; The first determining module is used to determine the relative offset information between the pixels of the original image and the pixels of the target image based on the operation information of the deformation operation on the original image; The second determining module is used to determine an auxiliary layer for processing the original image based on the relative offset information; The processing module is used to perform deformation processing on the original image based on the auxiliary layer to obtain the target image.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-8.

11. An electronic device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-8.