Image processing method, device, electronic device and storage medium
By acquiring the processing parameters of the original image and the target image, image distortion processing is performed based on the texture map coordinate map, which solves the problem of high complexity of image distortion processing in the prior art, and achieves efficient image distortion deformation.
Patent Information
- Application Number
- CN202210339738.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-04-01
AI Technical Summary
In the prior art, the development complexity and time-consuming process of image distortion are difficult to achieve irregular image distortion and deformation, and the development volume of the graphics distortion process is large and the efficiency is low.
By acquiring the original image and the target image, determining the target processing parameters corresponding to the image processing, processing the texture map coordinate diagram based on the target processing parameters, obtaining the image coordinate offset information map, and then exerting the image to be processed to achieve distortion and deformation of the image.
The development amount of image distortion processing is reduced, the efficiency of image distortion processing is improved, the processing steps are reduced, and efficient image distortion deformation is achieved.
Smart Images

Figure CN114820348B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art
[0002] Currently, with the continuous updating and iteration of electronic devices, the camera capabilities of electronic devices have been greatly improved, and the computing performance when processing images has also been greatly improved. For example, when performing image distortion processing (liquefaction processing, fisheye effect processing) on an image, it is necessary to distort the coordinates corresponding to the screen. Specifically, the image is distorted by using code programming and some mathematical formulas to perform a geometric transformation on the image. The position of each pixel point in the original image is mapped to the corresponding position through a certain function to change the position of the pixel points in the original image, thereby achieving image distortion.
[0003] However, the aforementioned methods often require complex image distortion, making it difficult to intuitively apply mathematical methods. For example, when an image is distorted, the distortion is irregular, and implementing image distortion through code and mathematical formulas is difficult and time-consuming. Consequently, these methods are difficult to implement, and image distortion processing requires extensive and complex development. Summary of the Invention
[0004] The present disclosure provides an image processing method, device, electronic device, and storage medium that can reduce the development effort of image distortion processing, reduce the steps of image distortion processing, and further improve the efficiency of image distortion processing. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of the present disclosure, an image processing method is provided, the method comprising: acquiring an original image and a target image; the target image being a special effect image obtained by performing image processing on the original image; determining target processing parameters corresponding to the image processing based on the original image and the target image; the target processing parameters being used to indicate the coordinate offset of a pixel point on the target image relative to a corresponding pixel point on the original image; processing a texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image; the image coordinate offset information map being used to indicate the coordinate offset corresponding to each coordinate point; performing offset processing on pixel points at corresponding coordinate positions on the image to be processed based on the image coordinate offset information map to obtain a target processed image.
[0006] As can be seen from the above, when image processing is required on one or more images to be processed, the original image and the special effect image (target image) obtained by image processing the original image can be first obtained, and the target processing parameters corresponding to the image processing can be determined based on the original image and the target image; then, the texture map coordinate map can be further processed based on the target processing parameters to obtain the image coordinate offset information map corresponding to the special effect image. Finally, image processing can be performed on one or more images to be processed based on the image coordinate offset information map to obtain the target processed images corresponding to the one or more images to be processed. Through this implementation method, the same special effect image processing can be performed on a large number of images based on the target processing parameters corresponding to a special effect image to obtain the corresponding processed images. This eliminates the need to process the image through code programming and some mathematical formulas to perform geometric transformations on the image to achieve image distortion and deformation processing. This can reduce the development effort of image distortion processing, reduce the steps of image distortion processing, and further improve the efficiency of image distortion processing.
[0007] Optionally, the above-mentioned method of "determining target processing parameters corresponding to image processing based on the original image and the target image" specifically includes: determining the coordinates of each first pixel point in the original image, and determining the coordinates of the second pixel point corresponding to the first pixel point in the target image; the second pixel point is the pixel point obtained by offsetting the corresponding first pixel point; calculating the coordinate difference between the coordinates of the second pixel point and the coordinates of the first pixel point, and obtaining the coordinate offset between the coordinates of the second pixel point relative to the coordinates of the first pixel point; and determining the coordinate offset as the target processing parameter corresponding to the image processing.
[0008] As can be seen from the above, by determining the coordinates of each first pixel in the original image and the coordinates of the second pixel corresponding to each first pixel in the target image, the coordinate offset between the coordinates of the second pixel and the coordinates of the first pixel can be calculated based on the coordinates of the first pixel and the second pixel; and the coordinate offset can be determined as the target processing parameter corresponding to the image processing. Through this implementation, a specific method for determining the coordinate offset corresponding to a pixel is provided, which can accurately determine the coordinate offset corresponding to the pixel.
[0009] Optionally, the above-mentioned method of "performing image processing on the texture map coordinate map based on target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image" specifically includes: performing offset processing on each coordinate point included in the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map; each coordinate point included in the image coordinate offset information map corresponds to a coordinate offset.
[0010] As can be seen from the above, after determining the target processing parameters corresponding to the image processing, each coordinate point included in the texture map coordinate map can be offset based on the target processing parameters to obtain an image coordinate offset information map. Through this implementation, a method is provided to indicate the coordinate offset corresponding to each coordinate point through the image coordinate offset information map, which can accurately determine the coordinate offset corresponding to each coordinate point.
[0011] Optionally, the above-mentioned method of "offsetting pixel points at corresponding coordinate positions on the image to be processed based on the image coordinate offset information map to obtain a target processed image" specifically includes: based on the image coordinate offset information map, offsetting pixel points included in the image to be processed whose coordinate positions match the coordinates in the image coordinate offset information map to obtain a target processed image corresponding to the image to be processed.
[0012] As can be seen from the above, based on the coordinate offset corresponding to each coordinate point indicated in the image coordinate offset information map, pixel points included in the image to be processed whose coordinate positions match the coordinates in the image coordinate offset information map can be offset to obtain a target processed image corresponding to the image to be processed. Through this implementation, a specific method for performing image processing on one or more images to be processed based on the image coordinate offset information map is provided, which can improve the efficiency of image processing.
[0013] Optionally, the above-mentioned method of "based on the image coordinate offset information map, offsetting the pixel points included in the image to be processed, whose coordinate positions match the coordinates in the image coordinate offset information map, to obtain the target processed image corresponding to the image to be processed" specifically includes: calculating the sum of the coordinates of the pixel points included in the image to be processed and the corresponding coordinate offsets, to obtain the offset coordinates of the pixel points included in the image to be processed; the coordinate offset is the coordinate offset corresponding to each coordinate point indicated in the image coordinate offset information map; sampling the texture information corresponding to the image to be processed according to the offset coordinates of the pixel points included in the image to be processed, to obtain the target processed image corresponding to the image to be processed.
[0014] As can be seen from the above, the offset coordinates of the pixels in the image to be processed can be calculated by summing the coordinates of the pixels in the image to be processed and the corresponding coordinate offsets. Consequently, the texture information corresponding to the image to be processed can be sampled based on the offset coordinates of the pixels in the image to be processed, resulting in a target processed image corresponding to the image to be processed. This implementation provides a method for sampling the texture information corresponding to the image to be processed, which can improve the efficiency of image processing.
[0015] Optionally, the above-mentioned method of "obtaining the original image and the target image" specifically includes: obtaining the original image and starting a preset application; in response to the user object's processing operation on the original image through the preset application, performing image processing on the original image to obtain the target image.
[0016] As can be seen from the above, the target image is obtained by pre-processing the original image using a preset application program. Through this implementation, a method for obtaining the original image and the target image is provided, which can improve the efficiency of image acquisition.
[0017] According to a second aspect of the present disclosure, an image processing device is provided, which includes: an acquisition unit, a determination unit and a processing unit; the acquisition unit is configured to acquire an original image and a target image; the target image is a special effect image obtained by performing image processing on the original image; the determination unit is configured to determine target processing parameters corresponding to the image processing based on the original image and the target image; the target processing parameters are used to indicate the coordinate offset of the pixel points on the target image relative to the corresponding pixel points on the original image; the processing unit is configured to process the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image; the image coordinate offset information map is used to indicate the coordinate offset corresponding to each coordinate point; the processing unit is further configured to perform offset processing on the pixel points at the corresponding coordinate positions on the image to be processed based on the image coordinate offset information map to obtain a target processed image.
[0018] Optionally, the determination unit is configured to determine the coordinates of each first pixel point in the original image, and determine the coordinates of the second pixel point corresponding to the first pixel point in the target image; the second pixel point is a pixel point obtained by offsetting the corresponding first pixel point; the determination unit is also configured to calculate the coordinate difference between the coordinates of the second pixel point and the coordinates of the first pixel point, to obtain the coordinate offset between the coordinates of the second pixel point relative to the coordinates of the first pixel point; and determine the coordinate offset as the target processing parameter corresponding to the image processing.
[0019] Optionally, the processing unit is configured to perform offset processing on each coordinate point included in the texture map coordinate map based on target processing parameters to obtain an image coordinate offset information map; each coordinate point included in the image coordinate offset information map corresponds to a coordinate offset.
[0020] Optionally, the processing unit is configured to perform offset processing based on the image coordinate offset information map on the pixel points included in the image to be processed, whose coordinate positions match the coordinates in the image coordinate offset information map, to obtain a target processed image corresponding to the image to be processed.
[0021] Optionally, the processing unit is configured to calculate the sum of the coordinates of the pixel points included in the image to be processed and the corresponding coordinate offsets to obtain the offset coordinates of the pixel points included in the image to be processed; the coordinate offset is the coordinate offset corresponding to each coordinate point indicated in the image coordinate offset information diagram; the processing unit is also configured to perform sampling processing on the texture information corresponding to the image to be processed according to the offset coordinates of the pixel points included in the image to be processed to obtain a target processed image corresponding to the image to be processed.
[0022] Optionally, the acquisition unit is configured to acquire the original image and start a preset application; the processing unit is configured to execute image processing on the original image in response to the user object's processing operation on the original image through the preset application to obtain a target image.
[0023] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device including:
[0024] A processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement any one of the optional image processing methods in the first aspect above.
[0025] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any one of the optional image processing methods in the first aspect above.
[0026] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising instructions, which, when executed by a processor of an electronic device, enable the electronic device to perform any one of the optional image processing methods in the first aspect.
[0027] According to a sixth aspect of the present disclosure, the present disclosure provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement any optional image processing method as described in the first aspect.
[0028] The technical solution provided by the present disclosure brings at least the following beneficial effects:
[0029] Based on any of the above aspects, in the present disclosure, when it is necessary to perform image processing on one or more images to be processed, the original image and the special effect image (target image) obtained by image processing the original image can be first obtained, so as to determine the target processing parameters corresponding to the image processing based on the original image and the target image; and then the texture map coordinate map can be further processed based on the target processing parameters to obtain the image coordinate offset information map corresponding to the special effect image. Finally, one or more images to be processed can be image processed based on the image coordinate offset information map to obtain the target processing images corresponding to the one or more images to be processed. Through this implementation method, a large number of images can be subjected to the same special effect image processing based on the target processing parameters corresponding to a special effect image to obtain the corresponding processed images. There is no need to process the image by using code programming and some mathematical formulas to perform geometric transformation on the image, thereby achieving image distortion and deformation processing. This can reduce the amount of development of image distortion processing, reduce the steps of image distortion processing, and further improve the efficiency of image distortion processing.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0032] Figure 1 is a schematic diagram of an image processing system according to an embodiment of the present disclosure;
[0033] Figure 2 is a flowchart illustrating an image processing method according to an embodiment of the present disclosure;
[0034] Figure 3 is a schematic diagram of an image effect corresponding to an image processing method according to an embodiment of the present disclosure;
[0035] Figure 4 is a schematic diagram of a coordinate diagram corresponding to an image processing method according to an embodiment of the present disclosure;
[0036] Figure 5 is a schematic diagram of a coordinate diagram corresponding to another image processing method according to an embodiment of the present disclosure;
[0037] Figure 6 is a flowchart of another image processing method according to an embodiment of the present disclosure;
[0038] Figure 7is a flowchart illustrating another image processing method according to an embodiment of the present disclosure;
[0039] Figure 8 is a flowchart illustrating another image processing method according to an embodiment of the present disclosure;
[0040] Figure 9 is a flowchart illustrating another image processing method according to an embodiment of the present disclosure;
[0041] Figure 10 is a flowchart illustrating another image processing method according to an embodiment of the present disclosure;
[0042] Figure 11 is a structural diagram of an image processing device according to an embodiment of the present disclosure;
[0043] Figure 12 It is a structural diagram of another image processing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0045] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0046] First, the application scenarios of the embodiments of the present disclosure are introduced. In the existing technical solutions, with the continuous updating and iteration of smart electronic devices, not only the ability of electronic devices to take pictures has been greatly improved, but also the performance of computing and taking pictures has been greatly improved. On this basis, users will encounter some needs for image distortion processing (screen liquefaction processing) of images displayed in electronic devices, such as obtaining images with the effect of distorting the texture mapping coordinates (UV coordinates) such as fisheye effects. Currently, image distortion processing is to liquefy the screen using code and mathematical formulas. In this way, the liquefaction requirements are relatively complex and may not involve very intuitive mathematical methods. Therefore, it is difficult to develop through code, it is time-consuming and long-lasting, and the efficiency of image distortion development and processing is low.
[0047] In order to solve the above problems, the embodiment of the present disclosure provides an image processing method. When image processing is required for one or more images to be processed, the original image and the special effect image (target image) obtained by image processing the original image can be first obtained to determine the target processing parameters corresponding to the image processing based on the original image and the target image; and then the texture map coordinate map is further processed based on the target processing parameters to obtain the image coordinate offset information map corresponding to the special effect image. Finally, image processing can be performed on one or more images to be processed based on the image coordinate offset information map to obtain the target processing images corresponding to the one or more images to be processed. Through this implementation method, the same special effect image processing can be performed on a large number of images based on the target processing parameters corresponding to a special effect image to obtain the corresponding processed images. There is no need to process the image by using code programming and some mathematical formulas to perform geometric transformation on the image, thereby achieving image distortion and deformation processing. This can reduce the amount of development of image distortion processing, reduce the steps of image distortion processing, and further improve the efficiency of image distortion processing.
[0048] The content display method provided by the embodiment of the present disclosure is exemplarily described below with reference to the accompanying drawings:
[0049] Figure 1 is a schematic diagram of an image processing system provided by an embodiment of the present disclosure, such as Figure 1 As shown, the image processing system may include a server 11 and a client 12 ( Figure 1 Only one client 12 is shown as an example, and more clients may be provided in a specific implementation. A communication connection may be established between the server 11 and the client 12. The server 11 and the client 12 may be connected in a wired manner or in a wireless manner, which is not limited in the present embodiment.
[0050] For example, server 11 is configured to receive image processing instructions and data from client 12, and process the image based on the received instructions and data to generate a processed image. Client 12 is configured to interact with the user, send the acquired image and instructions to server 11, and receive the processed image generated by server 11.
[0051] Alternatively, the client 12 is used to interact with the user and perform image processing on the image to generate a processed image.
[0052] In one practicable manner, the server 11 may be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. The server 11 may include a processor, a memory, a network interface, and the like.
[0053] In one embodiment, the client 12 is used to provide voice and / or data connectivity services to users. The client 12 may have different names, such as UE, terminal unit, terminal station, mobile station, mobile station, remote station, remote terminal, mobile device, wireless communication device, vehicle user equipment, terminal agent or terminal device.
[0054] Optionally, the client 12 may be any handheld device, vehicle-mounted device, wearable device, or computer with communication capabilities, which is not limited in the present embodiment. For example, the handheld device may be a smartphone. The vehicle-mounted device may be a vehicle navigation system. The wearable device may be a smart bracelet. The computer may be a personal digital assistant (PDA), a tablet computer, or a laptop computer.
[0055] The image processing method provided by the embodiment of the present disclosure can be applied to the aforementioned Figure 1 The server 11 and client 12 in the image processing system shown. The electronic device involved in the present disclosure can be the server 11 or the client 12. Taking the image processing method of the present disclosure applied to an electronic device in the process of executing a business as an example, the image processing method provided by the embodiment of the present disclosure is described in detail.
[0056] After introducing the application scenarios and image processing system of the embodiment of the present disclosure, Figure 1 The image processing system shown is used to introduce the image processing method provided by the embodiment of the present disclosure in detail.
[0057] like Figure 2 FIG. 1 is a flowchart of an image processing method according to an exemplary embodiment, which is applied to an electronic device. The image processing method may include S201 to S204.
[0058] S201: Acquire an original image and a target image.
[0059] The target image is a special effect image obtained by performing image processing on the original image, and the image processing may be image distortion processing.
[0060] The disclosed embodiments are applicable to scenarios where image warping is performed on one or more images to be processed to obtain corresponding distorted images. Specifically, before performing image warping on the one or more images to be processed, target processing parameters need to be determined based on the original image and a target image obtained by performing image warping on the original image, and then image warping is performed on the one or more images to be processed based on the determined target processing parameters.
[0061] Optionally, in the embodiment of the present disclosure, it is necessary to first determine the target processing parameters based on the target image obtained after image distortion processing and the original image before distortion processing. Specifically, the target processing parameters can be obtained from the process of image distortion processing of the original image.
[0062] It can be understood that the above-mentioned original image and target image are images stored in the electronic device, and the target image is obtained by processing the original image through some image processing software (such as Photoshop, PS).
[0063] S202: Determine target processing parameters corresponding to image processing based on the original image and the target image.
[0064] The target processing parameter is used to indicate the coordinate offset of a pixel point on the target image relative to a corresponding pixel point on the original image.
[0065] Optionally, during the process of performing image distortion processing on the original image, the offset corresponding to each pixel point in the original image may be obtained, thereby determining the offset corresponding to each pixel point as a target processing parameter.
[0066] Optionally, a first coordinate map indicating the coordinates of each pixel point in the original image and a second coordinate map indicating the coordinates of each pixel point in the target image may be obtained, and the first coordinate map and the second coordinate map are two-dimensional plane maps.
[0067] It should be noted that image distortion processing is also called liquefaction operation, which is a processing method of image transformation. Image distortion is one of the more basic parts of digital image processing. Its core is to perform geometric transformation on the image, that is, to map the position of each pixel point of the source image to the corresponding position in the target image through a certain function. In short, it is to change the position of the pixel points in the original image to achieve image distortion.
[0068] It can be understood that the distorted image obtained through image warping is similar to the fisheye effect, that is, a barrel distortion effect achieved using a fisheye lens. Since the image displayed on the screen is composed of two variables: the image texture and the coordinates of each pixel in the image, the liquefaction operation is actually a change in the pixel coordinates in the image, which causes the displayed image to deform and flow. We only need to obtain the motion vector information of the pixel coordinates during the liquefaction operation. Then, when using the image texture and image coordinates to form an image, we can offset the image coordinates according to this motion vector information.
[0069] For example, Figure 3As shown, in the process of processing the original image 10 by some image processing software (such as PS) to obtain the target image 11, the original image 10 is subjected to a liquefaction operation (i.e., a distortion process) in PS to obtain the desired target image 11. The specific processing process is to perform image distortion processing on the image area 12 in the original image 10, and obtain the target processing parameters corresponding to the liquefaction operation during the processing.
[0070] S203 : Process the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image.
[0071] The image coordinate offset information graph is used to indicate the coordinate offset corresponding to each coordinate point.
[0072] Optional, such as Figure 4 As shown, the above texture map coordinate diagram is a UV diagram, wherein the horizontal coordinate of the UV diagram can indicate red, and the vertical coordinate can indicate green. That is, the coordinates of the lower left corner of the first coordinate diagram are (0, 0), the coordinates of the upper left corner are (0, 1) representing green, the coordinates of the lower right corner are (1, 0) representing red, and the coordinates of the upper right corner are (1, 1) representing yellow.
[0073] It can be understood that the abscissa and ordinate of the UV map are any two colors determined from the three primary colors (i.e., RGB) to determine the coordinates of the pixel points in the image. That is, the abscissa of the UV map can also indicate blue and the ordinate indicates red; or the abscissa of the UV map can also indicate blue and the ordinate indicates green; or the abscissa of the UV map can also indicate green and the ordinate indicates blue, etc.
[0074] UV coordinates refer to the fact that all images are two-dimensional planes, with the horizontal direction represented by U and the vertical direction represented by V. Through this planar, two-dimensional coordinate system, any pixel on the image can be located. The UV map corresponding to the UV coordinates can display the UV coordinates on the screen in the form of colors. This map with coordinate information is called a UV map. In the embodiment of the present disclosure, the kaleidoscope function is realized by using a UV map with red as the horizontal direction and green as the vertical direction.
[0075] Optional, such as Figure 5 As shown, the above-mentioned image coordinate offset information map can be a FlowMap map, which is a UV map offset sampling map. That is, a map obtained by offsetting the pixels in the UV map. The FlowMap map is used to indicate the coordinate offset value information map corresponding to the image effect obtained after the image distortion process, that is, Figure 5 The area 20 in FIG. 1 is the area where the pixel points are offset (the other pixel points outside the area 20 are not offset).
[0076] S204 , performing offset processing on the pixel points at corresponding coordinate positions on the image to be processed based on the image coordinate offset information map to obtain a target processed image.
[0077] Optionally, after processing the texture map coordinate map according to the target processing parameters to obtain an image coordinate offset information map, image distortion processing can be performed on one or more images to be processed based on the image coordinate offset information map to obtain multiple distorted images (target processed images) having the same display effect (image distortion effect) as the target image.
[0078] That is, according to the coordinate offset corresponding to each pixel point in the original image and the target image, the textures corresponding to one or more images to be processed are sampled respectively, thereby obtaining multiple distorted images with image distortion effects.
[0079] It should be noted that when the image size (or resolution, pixel density) of one or more images to be processed is different from the image size of the target image, one or more images to be processed can be processed first to obtain one or more images to be processed with the same image size as the target image.
[0080] The technical solutions provided by the above embodiments provide at least the following beneficial effects: When image processing is required on one or more images to be processed, the original image and the special effect image (target image) obtained by image processing the original image can be first obtained, and then target processing parameters corresponding to the image processing can be determined based on the original image and the target image. The texture map coordinate map can then be further processed based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image. Finally, image processing can be performed on one or more images to be processed based on the image coordinate offset information map to obtain target processed images corresponding to the one or more images to be processed. Through this implementation, the same special effect image processing can be performed on a large number of images based on the target processing parameters corresponding to a special effect image to obtain corresponding processed images. This eliminates the need to process images using code programming and mathematical formulas to perform geometric transformations on the images, thereby achieving image distortion and deformation processing. This reduces the amount of development required for image distortion processing, reduces the number of steps required for image distortion processing, and further improves the efficiency of image distortion processing.
[0081] In one practicable manner, combining Figure 2 ,like Figure 6 As shown, the method in the above S202 may specifically include S301-S302.
[0082] S301: Determine the coordinates of each first pixel point in the original image, and determine the coordinates of a second pixel point corresponding to the first pixel point in the target image.
[0083] The second pixel point is a pixel point obtained by offsetting the corresponding first pixel point, and the corresponding first pixel point and the second pixel point have the same feature information.
[0084] Optionally, after acquiring the target image, a coordinate system can be established based on the lower left corner of the target image to determine the coordinates of each first pixel point included in the original image; similarly, after acquiring the target image, a coordinate system can be established based on the lower left corner of the target image to determine the coordinates of each second pixel point included in the target image.
[0085] It should be noted that the first pixel point on the original image corresponds to the second pixel point on the target image after the image distortion processing. The second pixel point corresponding to each first pixel point in the above-mentioned target image can be understood as: a certain pixel point in the target image and a certain pixel point in the original image are used to represent the same object or the same content, such as both representing the object of the nose tip on the face. For example, a certain pixel point in the target image and a certain pixel point in the original image have the same feature information or the same mark, and the feature information or mark is used to indicate the object or content represented by the pixel point. For example, the feature information can be color value, contrast, grayscale value, etc.
[0086] For example, the pixel points used to display the finger of a person in the original image and the pixel points used to display the finger of a person in the target image are corresponding pixel points.
[0087] It can be understood that in the process of processing the original image, each first pixel point included in the original image can be marked differently, so that after the original image is distorted to obtain the target image, the corresponding pixel points in the two images can be determined.
[0088] S302. Calculate the coordinate difference between the coordinates of the second pixel point and the coordinates of the first pixel point to obtain a coordinate offset between the coordinates of the second pixel point relative to the coordinates of the first pixel point; and determine the coordinate offset as a target processing parameter corresponding to the image processing.
[0089] Furthermore, after determining the coordinates of each first pixel point in the original image and the coordinates of the second pixel point corresponding to each first pixel point in the target image, the coordinate offset corresponding to each second pixel point corresponding to each first pixel point in the target image can be determined.
[0090] Specifically, after determining the coordinates of each first pixel point and each second pixel point, the coordinates of a second pixel point may be subtracted from the coordinates of the corresponding first pixel point to calculate and determine the offset corresponding to each first pixel point.
[0091] The technical solution provided by the above embodiment brings at least the following beneficial effects: by determining the coordinates of each first pixel point in the original image and the coordinates of the second pixel point corresponding to each first pixel point in the target image, the coordinate offset between the coordinates of the second pixel point and the coordinates of the first pixel point can be calculated based on the coordinates of the first pixel point and the second pixel point; and the coordinate offset can be determined as the target processing parameter corresponding to the image processing. Through this implementation, a specific method for determining the coordinate offset corresponding to a pixel point is provided, which can accurately determine the coordinate offset corresponding to the pixel point.
[0092] In one practicable manner, combining Figure 2 ,like Figure 7 As shown, the method in the above S203 may specifically include S2031.
[0093] S2031. Perform offset processing on each coordinate point included in the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map.
[0094] Each coordinate point included in the image coordinate offset information map corresponds to a coordinate offset.
[0095] Optionally, each pixel point in the texture map coordinate map can also be offset according to the target processing parameters. Specifically, based on the coordinates of each pixel point in the texture map coordinate map, the offset corresponding to a pixel point with the same coordinates as each pixel point in the target processing parameters is determined, and each pixel point in the texture map coordinate map is offset according to the offset to obtain an image coordinate offset information map.
[0096] It can be understood that a mapping function can be determined based on the target processing parameters, and the mapping function can be indicated by an image coordinate offset information graph, that is, the target mapping function is used to indicate the correspondence between the coordinates of the pixel point before offset, the offset corresponding to the pixel point, and the coordinates of the pixel point after offset.
[0097] Specifically, the above-mentioned target mapping function may include the correspondence between the coordinates before pixel offset, the pixel offset, and the coordinates after pixel offset, so that in the process of distorting the image to be processed, a corresponding coordinate after pixel offset can be determined based on the coordinates of each pixel in the image to be processed and the target mapping function.
[0098] Furthermore, pixel points included in each of the one or more images to be processed may be offset based on the target mapping function to obtain distorted images corresponding to the one or more images to be processed.
[0099] Specifically, according to the coordinates of each pixel point in the image to be processed, the coordinates of the pixel point before offset that are the same as the coordinates of the pixel point are determined based on the target mapping function, thereby determining the pixel point offset corresponding to the coordinates or the coordinates after the pixel point offset, and performing offset processing on each pixel point in the image to be processed according to the determined pixel point offset or the coordinates after the pixel point offset, to obtain one or more distorted images corresponding to the image to be processed.
[0100] The technical solution provided by the above embodiment provides at least the following beneficial effects: after determining the target processing parameters corresponding to image processing, each coordinate point included in the texture map coordinate map can be offset based on the target processing parameters to obtain an image coordinate offset information map. This implementation provides a method for indicating the coordinate offset corresponding to each coordinate point using the image coordinate offset information map, enabling accurate determination of the coordinate offset corresponding to each coordinate point.
[0101] In one practicable manner, combining Figure 6 ,like Figure 8 As shown, the method in the above S204 may specifically include S2041.
[0102] S2041. Based on the image coordinate offset information map, offset processing is performed on the pixel points included in the image to be processed, whose coordinate positions match the coordinates in the image coordinate offset information map, to obtain a target processed image corresponding to the image to be processed.
[0103] Optionally, after determining the image coordinate offset information map corresponding to the target image (i.e., indicating the target processing parameters corresponding to each second pixel point in the target image), image distortion processing can be performed on one or more images to be processed according to the image coordinate offset information map.
[0104] Specifically, for an image to be processed, a coordinate system can be established based on the lower left corner of the image to be processed to determine the coordinates of each pixel point included in the image to be processed, thereby determining the offset of the pixel point in the image to be processed that is located at the same coordinate position as the multiple first pixel points, which is the offset corresponding to the first pixel point located at the same coordinate position, thereby performing offset processing on the pixel points in the image to be processed through the corresponding offset.
[0105] Optionally, the image coordinate offset information map can also be used to indicate the offset coordinates corresponding to each pixel point, that is, the coordinates corresponding to each pixel point in the image coordinate offset information map can be directly determined as the adjusted coordinates corresponding to the pixel points in one or more images to be processed.
[0106] It can be understood that each pixel point in the image coordinate offset information map corresponds to a coordinate before adjustment (offset) and a coordinate after adjustment. According to the current coordinates of the pixel point in each image to be processed, a pixel point with the same coordinates before adjustment can be determined from the image coordinate offset information map, thereby determining the adjusted coordinates of the pixel point, and the adjusted coordinates are determined as the adjusted coordinates corresponding to the pixel point in the image to be processed.
[0107] Optionally, the coordinates corresponding to each pixel in the image coordinate offset information map can be the actual coordinates corresponding to the pixel after the offset, that is, the coordinates determined by the sum of the pixel's coordinates before the offset and the offset. Each pixel in the image coordinate offset information map corresponds to a coordinate before the offset and a coordinate after the offset.
[0108] Specifically, in the process of performing image distortion processing on one or more images to be processed through the image coordinate offset information map, first, according to the coordinates of each pixel point included in each image to be processed, a corresponding pixel point is determined from the image coordinate offset information map (the coordinates of the corresponding pixel point before offset are the same as the coordinates of the pixel point in the image to be processed), so as to offset the pixel point in the image to be processed by the corresponding offset.
[0109] The technical solution provided by the above embodiment provides at least the following beneficial effects: Based on the coordinate offset corresponding to each coordinate point indicated in the image coordinate offset information map, pixel points included in the image to be processed whose coordinate positions match the coordinates in the image coordinate offset information map can be offset processed to obtain a target processed image corresponding to the image to be processed. This implementation provides a specific method for performing image processing on one or more images to be processed based on the image coordinate offset information map, thereby improving the efficiency of image processing.
[0110] In one practicable manner, combining Figure 8 ,like Figure 9 As shown, the method in the above S2041 may specifically include S401-S402.
[0111] S401 : Calculate the sum of the coordinates of the pixel points included in the image to be processed and the corresponding coordinate offsets to obtain the offset coordinates of the pixel points included in the image to be processed.
[0112] The coordinate offset is the coordinate offset corresponding to each coordinate point indicated in the image coordinate offset information diagram.
[0113] Optionally, the coordinate positions of the pixel points included in the image to be processed and the offset corresponding to each pixel point indicated by the image coordinate offset information diagram can be determined based on the coordinate graph, and image distortion processing can be performed on one or more images to be processed to obtain distorted images corresponding to one or more images to be processed.
[0114] Optionally, the coordinates of each pixel in each image to be processed may be determined based on a preset coordinate diagram indicating the coordinate positions of the pixels in each image to be processed, without establishing a coordinate system for each image to be processed to determine the coordinates of each pixel in the image.
[0115] Optionally, the coordinates of each pixel point in the image to be processed indicated by the preset coordinate diagram can be added to the offset corresponding to each pixel point indicated by the image coordinate offset information diagram to obtain the offset coordinates corresponding to the pixel point in each image to be processed, and then the pixel point in each image to be processed can be offset according to the offset coordinates to obtain a distorted image corresponding to one or more images to be processed.
[0116] Specifically, when the coordinates corresponding to each pixel point in the image coordinate offset information map are used to indicate the offset of each pixel point, the offset coordinates corresponding to the pixel point in each image to be processed can be determined by adding the coordinates of the pixel point in each image to be processed to the coordinates of the corresponding pixel point in the image coordinate offset information map.
[0117] S402 : Sampling texture information corresponding to the image to be processed according to the offset coordinates of the pixels included in the image to be processed to obtain a target processed image corresponding to the image to be processed.
[0118] Optionally, after obtaining the offset coordinates of the pixels included in the image to be processed, the texture of the image to be processed may be sampled based on the offset coordinates to obtain a target processed image.
[0119] It should be noted that the image displayed on the screen is composed of two variables: image texture and image coordinates. Liquefaction is actually a change in image coordinates, which causes the displayed image to deform. It is a flowing effect. It is necessary to determine the movement vector information of the coordinates. Then, when using the image texture and image coordinates to form an image, the image coordinates can be offset according to the movement vector information.
[0120] The technical solution provided by the above embodiment provides at least the following beneficial effects: by calculating the sum of the coordinates of the pixels included in the image to be processed and the corresponding coordinate offset, the offset coordinates of the pixels included in the image to be processed can be obtained; thus, based on the offset coordinates of the pixels included in the image to be processed, the texture information corresponding to the image to be processed can be sampled and processed to obtain a target processed image corresponding to the image to be processed. This implementation provides a method for sampling and processing the texture information corresponding to the image to be processed, which can improve the efficiency of image processing.
[0121] In one practicable manner, combining Figure 2 ,like Figure 10 As shown, before the method in S201 above, S501-S502 may be specifically included.
[0122] S501: Acquire an original image and start a preset application.
[0123] S502 : In response to the processing operation of the user object on the original image through the preset application program, perform image processing on the original image to obtain a target image.
[0124] Optionally, the original image is an image that needs to be processed to obtain a special effect image, and the original image can be processed with special effects by a preset application program to obtain a target image.
[0125] Exemplarily, the preset application program may be image processing software (such as Photoshop, PS), so as to process the original image through the image processing software to obtain the target image.
[0126] The technical solution provided by the above embodiment brings at least the following beneficial effects: the target image is obtained by pre-processing the original image through a preset application program. Through this implementation, a method for obtaining the original image and the target image is provided, which can improve the efficiency of image acquisition.
[0127] In combination with the above examples, it can be seen that the present disclosure proposes to directly use image processing tools to generate a FlowMap corresponding to the offset value of the UV coordinate map to achieve the screen liquefaction effect. The overall implementation is relatively simple. The original coordinates of the image are added to the offset coordinates of the read FlowMap map to obtain the coordinates to achieve the effect, and finally the final distortion effect map is sampled. It can solve the problem of large production and development of complex liquefaction effect images. By using the coordinate offset map corresponding to the UV map generated by the image processing tool, the screen liquefaction effect is achieved by offset sampling during image post-processing, thereby improving the efficiency of image distortion processing.
[0128] It is understandable that the above method can be implemented by an image processing device. In order to implement the above functions, the image processing device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure.
[0129] The embodiments of the present disclosure can divide the functional modules of the above-mentioned image processing device, etc. according to the above-mentioned method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present disclosure is schematic and is only a logical functional division. In actual implementation, there may be other division methods.
[0130] Figure 11 FIG. 1 is a structural diagram of an image processing device according to an exemplary embodiment. Figure 11 The image processing device 100 may include: an acquisition unit 1001, a determination unit 1002 and a processing unit 1003.
[0131] The acquisition unit 1001 is configured to acquire an original image and a target image; the target image is a special effect image obtained by image processing the original image; for example, the acquisition unit 1001 can be used to execute Figure 2 The steps in step 201 in .
[0132] The determining unit 1002 is configured to determine target processing parameters corresponding to image processing based on the original image and the target image; the target processing parameters are used to indicate the coordinate offset of the pixel point on the target image relative to the corresponding pixel point on the original image; for example, the determining unit 1002 can be used to perform Figure 2 The steps in step 202 in .
[0133] The processing unit 1003 is configured to process the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image; the image coordinate offset information map is used to indicate the coordinate offset corresponding to each coordinate point; for example, the processing unit 1003 can be used to perform Figure 2 The steps in step 203 in .
[0134] The processing unit 1003 is further configured to perform an offset process on the pixel points at the corresponding coordinate positions on the image to be processed based on the image coordinate offset information map to obtain a target processed image. For example, the processing unit 1003 can be used to perform Figure 2 The steps in step 204 in .
[0135] Optionally, the determining unit 1002 is configured to determine the coordinates of each first pixel point in the original image, and determine the coordinates of a second pixel point corresponding to the first pixel point in the target image; the second pixel point is a pixel point obtained by offsetting the corresponding first pixel point; for example, the determining unit 1002 can be used to perform Figure 6 The steps in step 301 in .
[0136] The determining unit 1002 is further configured to calculate the coordinate difference between the coordinates of the second pixel point and the coordinates of the first pixel point to obtain the coordinate offset between the coordinates of the second pixel point relative to the coordinates of the first pixel point; and determine the coordinate offset as the target processing parameter corresponding to the image processing. For example, the determining unit 1002 can be used to perform Figure 6 The steps in step 302 in .
[0137] Optionally, the processing unit 1003 is configured to perform an offset process on each coordinate point included in the texture map coordinate map based on the target processing parameter to obtain an image coordinate offset information map; each coordinate point included in the image coordinate offset information map corresponds to a coordinate offset. For example, the processing unit 1003 can be used to perform Figure 7 The steps in step 2031 in.
[0138] Optionally, the processing unit 1003 is configured to perform an offset process on the pixel points included in the image to be processed, whose coordinate positions match the coordinates in the image coordinate offset information map, based on the image coordinate offset information map, to obtain a target processed image corresponding to the image to be processed. For example, the processing unit 1003 can be used to perform Figure 8 The steps in step 2041 in.
[0139] Optionally, the processing unit 1003 is configured to calculate the sum of the coordinates of the pixel points included in the image to be processed and the corresponding coordinate offsets to obtain the offset coordinates of the pixel points included in the image to be processed; the coordinate offset is the coordinate offset corresponding to each coordinate point indicated in the image coordinate offset information diagram; for example, the processing unit 1003 can be used to perform Figure 9 The steps in step 401 in.
[0140] The processing unit 1003 is further configured to perform sampling processing on the texture information corresponding to the image to be processed according to the offset coordinates of the pixel points included in the image to be processed, so as to obtain a target processed image corresponding to the image to be processed. For example, the processing unit 1003 can be used to perform Figure 9 The steps in step 402 in .
[0141] Optionally, the acquisition unit 1001 is configured to acquire the original image and start a preset application; for example, the acquisition unit 1001 can be used to execute Figure 10 The steps in step 501 in .
[0142] The processing unit 1003 is configured to execute image processing on the original image in response to the processing operation of the user object through the preset application program to obtain the target image. For example, the processing unit 1003 can be used to execute Figure 10 The steps in step 502 in .
[0143] As described above, the embodiment of the present disclosure can divide the functional modules of the electronic device according to the above method example. Among them, the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, it should be noted that the division of modules in the embodiment of the present disclosure is schematic and is only a logical functional division. There may be other division methods in actual implementation. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module.
[0144] Regarding the image processing apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0145] Figure 12 Schematic diagram of the structure of an image processing device 60 provided by the present disclosure. Figure 12 The image processing apparatus 60 may include at least one processor 601 and a memory 603 for storing instructions executable by the processor 601. The processor 601 is configured to execute the instructions in the memory 603 to implement the image processing method in the above embodiment.
[0146] In addition, the image processing device 60 may further include a communication bus 602 and at least one communication interface 604 .
[0147] The processor 601 may be a GPU, a microprocessing unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the disclosed solution.
[0148] The communication bus 602 may include a pathway for transmitting information between the aforementioned components.
[0149] The communication interface 604 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0150] The memory 603 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit via a bus. The memory may also be integrated with the processing unit and be a volatile storage medium in the GPU.
[0151] The memory 603 is used to store instructions for executing the solution of the present disclosure, and the execution is controlled by the processor 601. The processor 601 is used to execute the instructions stored in the memory 603, thereby realizing the functions of the method of the present disclosure.
[0152] In a specific implementation, as an embodiment, the processor 601 may include one or more GPUs, such as Figure 12 GPU0 and GPU1 in .
[0153] In a specific implementation, as an embodiment, the image processing device 60 may include multiple processors, such as Figure 12 6 and 607. Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-GPU) processor. A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0154] In a specific implementation, as an embodiment, the image processing apparatus 60 may further include an output device 605 and an input device 606. The output device 605 communicates with the processor 601 and can display information in a variety of ways. For example, the output device 605 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 606 communicates with the processor 601 and can receive user input in a variety of ways. For example, the input device 606 can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0155] Those skilled in the art will understand that Figure 12 The structure shown in the figure does not constitute a limitation on the image processing device 60, and the image processing device 60 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0156] The present disclosure further provides a computer-readable storage medium having instructions stored thereon. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the group communication method provided in the above-mentioned embodiment of the present disclosure.
[0157] The embodiments of the present disclosure also provide a computer program product containing instructions, which, when executed on an electronic device, enables the electronic device to execute the image processing method provided by the embodiments of the present disclosure.
[0158] The present disclosure also provides a communication system. Figure 1 As shown, the system includes a server 11 and a client 12. The server 11 and the client 12 are respectively used to execute the corresponding steps in the above-mentioned embodiments of the present disclosure, so that the communication system solves the technical problems solved by the embodiments of the present disclosure and achieves the technical effects achieved by the embodiments of the present disclosure, which will not be repeated here.
[0159] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0160] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire an original image and a target image; the target image is a special effect image obtained by performing image processing on the original image; Determining target processing parameters corresponding to the image processing based on the original image and the target image; the target processing parameters are used to indicate the coordinate offset of a pixel point on the target image relative to a corresponding pixel point on the original image; Processing the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image; the image coordinate offset information map is used to indicate the coordinate offset corresponding to each coordinate point, and the image coordinate offset information map is obtained by offset sampling the texture map coordinate map; The pixel points at the corresponding coordinate positions on the to-be-processed image are offset based on the image coordinate offset information graph to obtain a target processed image, which has the same display effect as the target image.
2. The method according to claim 1, characterized in that The determining, based on the original image and the target image, target processing parameters corresponding to the image processing includes: Determine the coordinates of each first pixel point in the original image, and determine the coordinates of a second pixel point in the target image corresponding to the first pixel point; the second pixel point is a pixel point obtained by offsetting the corresponding first pixel point; Calculate the coordinate difference between the coordinates of the second pixel point and the coordinates of the first pixel point to obtain the coordinate offset between the coordinates of the second pixel point relative to the coordinates of the first pixel point; and determine the coordinate offset as the target processing parameter corresponding to the image processing.
3. The method according to claim 1, characterized in that The performing image processing on the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image includes: An offset process is performed on each coordinate point included in the texture map coordinate map based on the target processing parameters to obtain the image coordinate offset information map; each coordinate point included in the image coordinate offset information map corresponds to a coordinate offset.
4. The method according to claim 2, characterized in that The performing offset processing on pixel points at corresponding coordinate positions on the to-be-processed image based on the image coordinate offset information graph to obtain a target processed image includes: Based on the image coordinate offset information map, pixel points included in the image to be processed whose coordinate positions match the coordinates in the image coordinate offset information map are offset to obtain the target processed image corresponding to the image to be processed.
5. The method according to claim 4, characterized in that The step of performing offset processing on pixel points included in the image to be processed, whose coordinate positions match the coordinates in the image coordinate offset information map, based on the image coordinate offset information map, to obtain the target processed image corresponding to the image to be processed includes: Calculating the sum of the coordinates of the pixel points included in the image to be processed and the corresponding coordinate offsets to obtain the offset coordinates of the pixel points included in the image to be processed; the coordinate offsets are the coordinate offsets corresponding to each coordinate point indicated in the image coordinate offset information graph; According to the offset coordinates of the pixel points included in the image to be processed, the texture information corresponding to the image to be processed is sampled to obtain the target processed image corresponding to the image to be processed.
6. The method according to claim 1, wherein The obtaining of the original image and the target image includes: Acquire the original image and start a preset application; In response to a processing operation of the user object on the original image through the preset application, the image processing is performed on the original image to obtain the target image.
7. An image processing device, characterized in that include: An acquisition unit, configured to acquire an original image and a target image; The target image is a special effect image obtained by performing image processing on the original image; a determining unit configured to determine target processing parameters corresponding to the image processing based on the original image and the target image; The target processing parameter is used to indicate the coordinate offset of a pixel point on the target image relative to a corresponding pixel point on the original image; a processing unit configured to process the texture map coordinate map based on the target processing parameters to obtain an image coordinate offset information map corresponding to the special effect image; the image coordinate offset information map is used to indicate the coordinate offset corresponding to each coordinate point, and the image coordinate offset information map is obtained by offset sampling the texture map coordinate map; The processing unit is further configured to perform offset processing on pixel points at corresponding coordinate positions on the image to be processed based on the image coordinate offset information map to obtain a target processed image, and the target processed image has the same display effect as the target image.
8. The image processing device according to claim 7, wherein The determining unit is configured to determine the coordinates of each first pixel point in the original image and determine the coordinates of a second pixel point in the target image corresponding to the first pixel point; the second pixel point is a pixel point obtained by offsetting the corresponding first pixel point; The determination unit is further configured to calculate the coordinate difference between the coordinates of the second pixel point and the coordinates of the first pixel point to obtain the coordinate offset between the coordinates of the second pixel point relative to the coordinates of the first pixel point; and determine the coordinate offset as the target processing parameter corresponding to the image processing.
9. The image processing device according to claim 7, wherein: The processing unit is configured to perform offset processing on each coordinate point included in the texture map coordinate map based on the target processing parameters to obtain the image coordinate offset information map; each coordinate point included in the image coordinate offset information map corresponds to a coordinate offset.
10. The image processing device according to claim 8, wherein The processing unit is configured to perform offset processing on the pixel points included in the image to be processed, whose coordinate positions match the coordinates in the image coordinate offset information map, based on the image coordinate offset information map, to obtain the target processed image corresponding to the image to be processed.
11. The image processing device according to claim 10, wherein The processing unit is configured to calculate the sum of the coordinates of the pixel points included in the image to be processed and the corresponding coordinate offsets to obtain the offset coordinates of the pixel points included in the image to be processed; the coordinate offsets are the coordinate offsets corresponding to each coordinate point indicated in the image coordinate offset information map; The processing unit is further configured to perform sampling processing on texture information corresponding to the image to be processed according to the offset coordinates of the pixel points included in the image to be processed, so as to obtain the target processed image corresponding to the image to be processed.
12. The image processing device according to claim 7, wherein The acquisition unit is configured to acquire the original image and start a preset application; The processing unit is configured to execute, in response to a processing operation of the user object on the original image through the preset application, the image processing on the original image to obtain the target image.
13. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image processing method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the image processing method according to any one of claims 1 to 6.
15. A computer program product, characterized in that The apparatus comprises instructions, which, when executed by a processor of an electronic device, implement the image processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Water ripple special effect video generation method and device, electronic equipment and storage medium
CN113645414A
Image processing method and device, electronic equipment and storage medium
CN114187167A