Image processing method and device, computer-readable storage medium, and electronic device
By obtaining the display coordinates of the faceplate model and determining the radial blur direction, the problem of difficulty in realizing radial blur and color offset superposition in local areas in the prior art is solved, and local special effects processing and efficiency improvement are achieved.
Patent Information
- Application Number
- CN202211600473.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-12-12
AI Technical Summary
In the prior art, radial blur and color shift special effects are difficult to superimpose in local areas, and the display range of effects cannot be controlled, making it difficult to realize local special effects processing in game screens.
By obtaining the display coordinates of the patch model, determining the radial blur direction, and performing radial blur and color offset processing on the image based on the patch model, local control and superposition of special effects are achieved.
Local special effects processing of images is realized, the efficiency of special effects generation is improved, and the superposition effect of radial blur and color shift can be achieved in local areas.
Smart Images

Figure CN116258780B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular, to an image processing method, an image processing device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Radial blur and color shift are common special effects technologies used in game development. Radial blur can make the game screen blur radially from the center outward, reflecting the sense of speed of the picture; color shift technology is often used in post-processing glitch art.
[0003] In related technologies, the display of the above two special effects is mostly single, and is mostly used in screen post-processing, which is to display the effects of the entire screen image. The display range of the effect cannot be controlled, and it is difficult to achieve the effect of the local area and the superposition of the above two effects in the local area.
[0004] Therefore, a new image processing method needs to be provided.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0006] The purpose of the present disclosure is to provide an image processing method, an image processing device, a computer-readable storage medium, and an electronic device, thereby overcoming, at least to a certain extent, the difficulty in achieving the superposition of two special effects when performing radial blur and color shift processing on the image to be processed due to the limitations and defects of the relevant technology.
[0007] According to one aspect of the present disclosure, there is provided an image processing method, comprising:
[0008] Acquire an image to be processed and a patch model, determine display coordinates of the patch model on a screen, and determine a radial blur direction based on the display coordinates;
[0009] Performing radial blur processing on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model;
[0010] Color shift processing is performed on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
[0011] According to one aspect of the present disclosure, there is provided an image processing apparatus, comprising:
[0012] a radial blur direction determination module, configured to obtain an image to be processed and a patch model, determine display coordinates of the patch model on the screen, and determine a radial blur direction based on the display coordinates;
[0013] a radial blur processing module, configured to perform radial blur processing on the image to be processed according to the radial blur direction, to obtain a radial blur processing result of the image to be processed based on the patch model;
[0014] The color shift processing module is used to perform color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
[0015] According to one aspect of the present disclosure, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processing unit, the image processing method described in any one of the above exemplary embodiments is implemented.
[0016] According to one aspect of the present disclosure, there is provided an electronic device, including:
[0017] processing unit; and
[0018] a storage unit, configured to store executable instructions of the processing unit;
[0019] The processing unit is configured to execute the image processing method described in any one of the above exemplary embodiments by executing the executable instructions.
[0020] An image processing method provided by an embodiment of the present disclosure obtains an image to be processed and a patch model, determines the display coordinates of the patch model on the screen, and determines a radial blur direction based on the display coordinates; performs radial blur processing on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model; and performs color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model. On the one hand, a patch model is obtained, the display coordinates of the patch model on the screen are determined, and the radial blur direction is determined based on the display coordinates of the patch model on the screen, so that the implementation of the special effects is converted to the patch model. Local processing of the image to be processed is achieved through the patch model, which solves the problem in related technologies that local special effects processing cannot be performed on the image to be processed; on the other hand, after determining the radial blur direction, radial blur processing is performed on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model, and color shift processing is performed based on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model, which realizes the superposition of the two special effects of radial blur and color shift, and at the same time improves the efficiency of generating special effects for the image to be processed.
[0021] 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 invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present invention, and together with the description, serve to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and it is clear that those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0023] Figure 1 The following schematically shows a flowchart of an image processing method according to an exemplary embodiment of the present disclosure.
[0024] Figure 2 A flowchart of a method for obtaining a patch model, determining display coordinates of the patch model on a screen, and determining a radial blur direction based on the display coordinates according to an exemplary embodiment of the present disclosure is schematically shown.
[0025] Figure 3 A flowchart of a method for determining a center point of a mesh model and obtaining the screen space coordinates of the center point of the mesh model according to an exemplary embodiment of the present disclosure is schematically shown.
[0026] Figure 4 A flowchart schematically illustrates a method for performing radial blur processing on an image to be processed according to a radial blur direction to obtain a radial blur processing result of the image to be processed based on a patch model according to an exemplary embodiment of the present disclosure.
[0027] Figure 5 A flowchart of a method for sampling an image to be processed according to radial blur coordinates of a patch model to obtain a radial blur image based on the patch model according to an exemplary embodiment of the present disclosure is schematically shown.
[0028] Figure 6 A flowchart schematically illustrates a method for performing color shift processing on a radial blur processing result to obtain a color shift processing result of an image to be processed based on a patch model according to an exemplary embodiment of the present disclosure.
[0029] Figure 7 A flowchart schematically illustrates a method for obtaining a color shift processing result based on a radially blurred image, a first color shifted image, and a second color shifted image according to an exemplary embodiment of the present disclosure.
[0030] Figure 8A flowchart schematically illustrates a method for obtaining a color shift processing result by using a first channel image, a second channel image, and a third channel image according to an exemplary embodiment of the present disclosure.
[0031] Figure 9 A flowchart schematically illustrates a method for obtaining a target special effect image based on a first special effect image according to an exemplary embodiment of the present disclosure.
[0032] Figure 10 A schematic diagram schematically illustrates a transition process for a first special effect image according to an exemplary embodiment of the present disclosure.
[0033] Figure 11 A schematic diagram schematically illustrates an image to be processed according to an exemplary embodiment of the present disclosure.
[0034] Figure 12 A schematic diagram schematically illustrates a generated target special effect image according to an exemplary embodiment of the present disclosure.
[0035] Figure 13 A block diagram schematically illustrates an image processing apparatus according to an exemplary embodiment of the present disclosure.
[0036] Figure 14 An electronic device for implementing the above-mentioned image processing method according to an exemplary embodiment of the present invention is schematically shown. DETAILED DESCRIPTION
[0037] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present invention will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solutions of the present invention may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present invention.
[0038] In addition, the accompanying drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0039] In related technologies, radial blur and color shift are often implemented separately, and both special effects are used in screen post-processing. When implementing radial blur, the radial blur area of the screen post-processing is relatively fixed, and it is difficult to adjust the blur center position. The blur center is the center point of the screen UV (0.5, 0.5), and the entire screen is sampled during screen post-processing. The display range of the effect cannot be controlled, making it difficult to achieve special effects in local areas and difficult to achieve the superposition of two special effects.
[0040] Based on one or more of the above problems, this exemplary embodiment first provides an image processing method, referring to Figure 1 As shown, the following steps may be included:
[0041] Step S110: Acquire the image to be processed and the patch model, determine the display coordinates of the patch model on the screen, and determine the radial blur direction based on the display coordinates;
[0042] Step S120. Perform radial blur processing on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model;
[0043] Step S130: Perform color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
[0044] The above-mentioned image processing method obtains the image to be processed and the patch model, determines the display coordinates of the patch model on the screen, and determines the radial blur direction based on the display coordinates; performs radial blur processing on the image to be processed according to the radial blur direction to obtain the radial blur processing result of the image to be processed based on the patch model; performs color shift processing on the radial blur processing result to obtain the color shift processing result of the image to be processed based on the patch model. On the one hand, a patch model is obtained, the display coordinates of the patch model on the screen are determined, and the radial blur direction is determined based on the display coordinates of the patch model on the screen, so that the implementation of the special effects is converted to the patch model. Local processing of the image to be processed is achieved through the patch model, which solves the problem in related technologies that local special effects processing cannot be performed on the image to be processed; on the other hand, after determining the radial blur direction, radial blur processing is performed on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model, and color shift processing is performed based on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model, which realizes the superposition of the two special effects of radial blur and color shift, and at the same time improves the efficiency of generating special effects for the image to be processed.
[0045] Hereinafter, each step involved in the image processing method according to an exemplary embodiment of the present disclosure will be explained and illustrated in detail.
[0046] First, the application scenario and purpose of the exemplary embodiment of the present disclosure are explained and illustrated. Specifically, the exemplary embodiment of the present disclosure can be used to achieve the superposition of two special effects: radial blur and color shift on the image to be processed.
[0047] In the present disclosure, the obtained patch model is taken as the basis. After the patch model is obtained, the display coordinates of the patch model and the screen are output, and the coordinates of the center point of the patch model are spatially transformed to obtain the screen space coordinates of the center point. The radial blur direction of each pixel point in the patch model is determined by the display coordinates of the patch model and the screen space coordinates of the center point. The image to be processed is radially blurred according to the radial blur direction of each pixel point to obtain the radial blur processing result of the image to be processed based on the patch model; after obtaining the radial blur processing result of the image to be processed based on the patch model, the radial blur processing result is color shifted to obtain the color shift processing result of the image to be processed, thereby realizing the superposition of the two special effects of radial blur and color shift.
[0048] Next, steps S110 to S130 are further explained and illustrated.
[0049] In step S110 , the image to be processed and the patch model are acquired, the display coordinates of the patch model on the screen are determined, and the radial blur direction is determined based on the display coordinates.
[0050] In this example embodiment, the patch model can be a model generated by an engine or a model built based on 3D software. In this example embodiment, there is no specific limitation on the patch model. The patch model is a three-dimensional model, and its thickness can be ignored. Figure 2 As shown, obtaining a patch model, determining the display coordinates of the patch model on the screen, and determining the radial blur direction based on the display coordinates may include:
[0051] Step S210: Obtain a mesh model, determine the center point of the mesh model, and obtain the screen space coordinates of the center point of the mesh model;
[0052] Step S220: Convert the coordinates of each pixel in the mesh model to obtain the display coordinates matching the mesh model with the screen;
[0053] Step S230: Determine the radial blur direction of each pixel in the patch model based on the screen space coordinates of the center point and the display coordinates.
[0054] Below, step S210-step S230 will be further explained and illustrated. Specifically, in the related art, since the radial blur processing of the image can only be applied to screen post-processing, when the image to be processed is processed, the coordinates of the center point of the image to be processed are determined as the center point of the screen coordinates, that is, (0.5, 0.5). However, in the actual processing process, the center point of the patch model will change with the movement of the model. Therefore, in this application, after obtaining the patch model, the center point of the patch model can be determined first, and the coordinates of the center point can be converted to the screen space, and the converted screen space coordinates Center can be obtained. In order to obtain the radial blur direction Dir of each pixel point in the patch model, the coordinates of each pixel point in the patch model can be converted and converted into coordinates that match the screen, that is, display coordinates. After obtaining the display coordinates, the radial blur direction Dir of each pixel in the patch model can be obtained based on the difference between the screen space coordinates Center of the patch model center point and the display coordinates ScreenUV of each pixel in the patch model, Dir = Center - ScreenUV; wherein, when converting the coordinates of each pixel in the patch model, the coordinates of each pixel in the patch model can be converted through the screen coordinate conversion node ScreenAlignedUVs in the UE engine, and the display coordinates of each pixel in the patch model that match the screen are output. The display coordinates of the patch model are the UV distribution of the patch model on the screen.
[0055] In this example embodiment, by converting the coordinates of the center point of the patch model into the screen space, the center of the radial blur is converted to the center of the patch model. Through the center of the patch model, radial blur of any position and size can be achieved based on the size and position of the patch model, that is, local special effects processing of the image to be processed can be achieved.
[0056] For further reference, Figure 3 As shown, determining the center point of the mesh model and obtaining the screen space coordinates of the center point of the mesh model may include:
[0057] Step S310: Obtain the world space coordinates of the center point of the mesh model, and convert the world space coordinates into clip space coordinates through a clip space conversion node;
[0058] Step S320: Convert the clipping space coordinates of the center point to obtain the screen space coordinates of the center point.
[0059] Below, step S310 and step S320 will be further explained and illustrated. Specifically, first, obtain the world space coordinates of the center point of the mesh model in the engine or in the 3D software, and convert the world space coordinates of the center point of the mesh model into the clip space coordinates of the camera through the clip space conversion node TransformToClipSpace in the UE engine. In the clip space, the coordinate range of the mesh model is [-1,1]; after obtaining the clip space coordinates of the mesh model, reverse the Y axis of the clip space coordinates of the mesh model through the multiplication node Multiply in the UE engine to obtain the clip space coordinates after the Y axis is reversed, and then convert the clip space coordinates after the Y axis is reversed again through the multiplication node Multiply and the addition node Add in the UE engine, and convert the clip space coordinate range [-1,1] of the clip space into the interval [0,1]. The input amount of the multiplication node can be 0.5, and the input amount of the addition node can be 0.5, then the conversion of [-1,1] is [-1,1]*0.5+0.5. After converting to the [0,1] interval, the X and Y values of the screen space coordinates of the center point of the patch model on the screen are obtained through the material Mask node.
[0060] In step S120 , radial blur processing is performed on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model.
[0061] In this example embodiment, reference Figure 4As shown, performing radial blur processing on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model may include:
[0062] Step S410. Obtain the current radial blur weight;
[0063] Step S420: radially offset the display coordinates of the patch model according to the offset blur direction of each pixel point in the patch model and the current radial blur weight to obtain the radial blur coordinates of the patch model;
[0064] Step S430: Sampling the image to be processed according to the radial blur coordinates of the patch model to obtain a radial blur image based on the patch model; wherein the radial blur processing result includes the radial blur coordinates and the radial blur image.
[0065] In the following, steps S410 to S430 will be further explained and illustrated. Specifically, when radially blurring each pixel in the patch model according to the radial blur direction of each pixel in the patch model, first, obtain the current radial blur weight, wherein the current radial blur weight can be 0.1 or 0.2. In this example embodiment, the current radial blur weight is not specifically limited. After determining the current radial blur weight, radially offset the display coordinates ScreenUV of each pixel in the patch model according to the radial blur direction Dir of each pixel and the current radial blur weight to obtain the radial blur coordinates pos of the patch model. The radial blur coordinates of the patch model can be expressed as pos=ScreenUV+Dir*Sample[i]*BlurDist, wherein ScreenUV is the display coordinates of each pixel in the patch model in screen space, Dir is the radial blur direction of each pixel in the patch model, Sample[i] is the current radial blur weight, Sample is the radial blur weight matrix, and BlurDist is used to control the radial blur direction intensity, and its value range is [0, 10]. After the radial fuzzy coordinates of the patch model are obtained, the image to be processed can be sampled according to the radial fuzzy coordinates of the patch model to obtain a radially blurred image based on the patch model.
[0066] It should be noted that after obtaining the radial blur coordinates of the patch model, it is possible to determine whether the radial blur coordinates are located between the screen coordinate range [0,1]. When the radial blur coordinates are not between [0,1], the radial blur coordinates can be restricted by the clamp function, pos = clamp(pos, float2(0.0,0.0), float2(1.0,1.0)), that is, when the value of the radial blur coordinate is less than 0, it returns 0; when the value of the radial blur coordinate is greater than 1, it returns 1; when the value of the radial blur coordinate is in the interval [0,1], it returns normally.
[0067] When implemented in the UE engine's blueprint, first, based on the UE engine's ScreenAligendUVS node, the display coordinates of all pixels in the patch model that match the screen are output. When offsetting the display coordinates of the patch model to obtain radial blur coordinates, this can be implemented based on the UE engine's Subtract node, the first Multiply node, and the second Multiply node. The Subtract node is used to obtain the difference between the screen space coordinates of the patch model's center point and the patch model's display coordinates. The first Multiply node is used to obtain the first product of the difference between the screen space coordinates of the patch model's center point and the patch model's display coordinates and the radial blur weight. The second Multiply node is used to obtain the product of the first product and the radial blur direction strength. After obtaining the radial blur coordinates, the radial blur of the patch model is limited to the [0,1] interval through the Clamp node.
[0068] In this example embodiment, the radially blurred image may also be an image generated by multiple radial blurs. Performing multiple radial blurs on the image to be processed specifically includes obtaining a predefined target blur order n, a radial blur weight matrix Sample corresponding to the target blur order, and a predefined image sum, where float sum = float4(0.0, 0.0, 0.0, 0.0). When the current radial blur round i does not reach the target blur number n, the current radial blur weight Sample[i] corresponding to the current radial blur round i is obtained. Based on the display coordinates ScreenUV of each pixel in the patch model, the offset blur direction Dir, the current radial blur weight Sample[i], and the radial blur direction strength, the radial blur coordinates for the i-th cycle are obtained. The image to be processed is sampled based on the radial blur coordinates for the i-th cycle to obtain a radially blurred image for the i-th cycle. The radially blurred image for the i-th cycle is superimposed with the predefined image sum to obtain a superimposed image. The above steps are repeated until the target blur number n is reached. In the i+1th radial blur, the radially blurred image generated during the i+1th radial blur is superimposed on the superimposed image. When the target blur number n is reached, the radially blurred images generated during the multiple superimposed cycles are averaged according to the target blur number n to obtain a radially blurred image of the image to be processed based on the patch model.
[0069] In this exemplary embodiment, after obtaining the radial fuzzy coordinates of the patch model, the image to be processed can be sampled based on the radial fuzzy coordinates. Figure 5 As shown, sampling the image to be processed according to the radial blur coordinates of the patch model to obtain a radial blur image based on the patch model may include:
[0070] Step S510: Obtaining the texture index of the image to be processed;
[0071] Step S520: Sampling the image to be processed using the radial fuzzy coordinates and the texture index of the image to be processed to obtain a radial fuzzy image of the image to be processed based on the patch model.
[0072] Below, step S510 and step S520 will be further explained and illustrated. Specifically, when sampling the image to be processed, first, the texture index of the image to be processed is obtained, wherein the texture index is the texture index of the texture of the image to be processed; then, the SceneTextureLookup method or the MobileSceneTextureLookup method in the High Level Shader Language (HLSL) is called to implement the sampling of the image to be processed. The main difference between the SceneTextureLookup method and the MobileSceneTextureLookup method is the difference in devices. Since the SceneTextureLookup method is not always supported on mobile devices, before sampling the image to be processed, it is necessary to determine whether the current device is a mobile device. If it is a mobile device, sampling is performed through the MobileSceneTextureLookup method. If it is not a mobile device, sampling is performed through the SceneTextureLookup method. The parameters in the SceneTextureLookup method or the MobileSceneTextureLookup method include: pos*ScreenMult, Texindex, and whether a filter exists. Among them, pos is the display coordinate of the patch model, ScreenMult is the texture tiling control factor, which can be 1, Texindex is the texture index of the image to be processed, and true is used to indicate when a filter exists, and false is used to indicate when no filter exists. Specifically, during sampling, the texture index of the image to be processed and the radial blur coordinates of the patch model are input into the SceneTextureLookup method or the MobileSceneTextureLookup method for sampling to obtain a radial blur image of the image to be processed, wherein the radial blur map is generated based on the patch model.
[0073] In step S130 , a color shift process is performed on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
[0074] After obtaining the radial blur processing result of the image to be processed, color shift processing can be performed based on the radial blur processing result to obtain the color shift processing result of the image to be processed. Figure 6 As shown, performing color shift processing on the radial blur processing result to obtain the color shift processing result of the image to be processed based on the patch model may include:
[0075] Step S610: Obtain radial blur coordinates, a first preset offset direction, a second preset offset direction, a first preset offset distance, and a second preset offset distance in the radial blur processing result; wherein the first preset offset direction is opposite to the second preset offset direction;
[0076] Step S620: offset the radial blurred coordinates according to the first preset offset direction and the first preset offset distance to obtain first color offset coordinates;
[0077] Step S630: offset the radial blurred coordinates according to the second preset offset direction and the second preset offset distance to obtain second color offset coordinates;
[0078] Step S640: Sample the image to be processed using the first color shift coordinates and the second color shift coordinates to obtain a first color shift image and a second color shift image;
[0079] Step S650: Obtain the color shift processing result based on the radially blurred image, the first color shifted image, and the second color shifted image.
[0080] Below, steps S610 to S650 will be further explained and illustrated. Specifically, when color shifting is performed on the radial blur processing result of the image to be processed, first, the radial blur coordinates of the patch model in the radial blur processing result, the first preset offset direction for color shifting, the second preset offset direction, the first preset offset distance, and the second preset offset distance are obtained, wherein the first preset offset direction and the second preset offset direction are opposite directions. For example, when the first preset offset direction is left, the second preset offset direction is right. In this example embodiment, the first preset offset direction is not specifically limited. The first preset offset distance and the second preset offset distance can be equal offset distances or unequal offset distances. In this example embodiment, the first preset offset distance and the second preset offset distance are specifically limited.
[0081] After obtaining the first preset offset direction, the second preset offset direction, the first preset offset distance, and the second preset offset distance of the radial blur coordinates, the radial blur coordinates are offset according to the first preset offset direction and the first preset offset distance to obtain first color-shifted coordinates. The radial blur coordinates are then offset using the second preset offset direction and the second preset offset distance to obtain second color-shifted coordinates. After obtaining the first color-shifted coordinates and the second color-shifted coordinates, the image to be processed is sampled using the first color-shifted coordinates and the second color-shifted coordinates, respectively, to obtain a first color-shifted image and a second color-shifted image. Finally, a color-shifted processing result is obtained based on the radial blur image, the first color-shifted image, and the second color-shifted image.
[0082] In the exemplary embodiments of the present disclosure, the first color-shifted image and the second color-shifted image may also be images obtained through radial blurring and color shifting. Taking the generation of the first color-shifted image as an example, the process specifically includes obtaining a predefined target blur order n, a radial blur weight matrix Sample corresponding to the target blur order, and a predefined image sum, where float sum = float4(0.0, 0.0, 0.0, 0.0). When the current radial blur round i does not reach the target blur number n, the current radial blur weight Sample[i] corresponding to the current radial blur round i is obtained. The radial blur coordinates for the i-th cycle are obtained based on the display coordinates ScreenUV of each pixel in the patch model, the offset blur direction Dir, the current radial blur weight Sample[i], and the radial blur direction strength. Based on the radial blur coordinates, the radial cycle coordinates for the i-th cycle are adjusted according to a first preset offset distance and a first preset offset direction to obtain the first color offset coordinates for the i-th cycle. The image to be processed is sampled based on the first color offset coordinates for the i-th cycle to obtain a first color offset image for the i-th cycle. The first color offset image is superimposed with a predefined image to obtain a first superimposed image. The first color offset image generated in the i+1th cycle is superimposed on the first superimposed image obtained in the i-th cycle. The above steps are repeated until the target blur number n is reached. When the target blur number is reached, the first superimposed images are averaged according to the target blur number to obtain the first color offset image. The process of generating the second color-shifted image is the same as the process of generating the first color-shifted image, and thus the process of generating the second color-shifted image is not described in detail in this exemplary embodiment.
[0083] For further reference, Figure 7 As shown, obtaining the color shift processing result based on the radially blurred image, the first color shifted image, and the second color shifted image may include:
[0084] Step S710: performing channel separation on the radial blurred image to obtain a G channel image of the radial blurred image, and determining the G channel image as a first channel image;
[0085] Step S720: performing channel separation on the first color-shifted image, obtaining an R-channel image of the first color-shifted image, and determining the R-channel image as the second channel image;
[0086] Step S730: performing channel separation on the second color-shifted image to obtain a B-channel image of the second color-shifted image, and determining the B-channel image as the third channel image;
[0087] Step S740: Obtain the color shift processing result by using the first channel image, the second channel image, and the third channel image.
[0088] Steps S710 to S740 will be further explained and illustrated below. Specifically, after obtaining the radially blurred image, the first color-shifted image, and the second color-shifted image, the radially blurred image can be color-channel separated to obtain an R channel image, a G channel image, and a B channel image of the radially blurred image. Among the three color-channel images of the radially blurred image, the G channel image can be extracted and the extracted G channel image is determined as the first channel image. The first color-shifted image can also be color-channel separated to obtain an R channel image, a G channel image, and a B channel image of the first color-shifted image. Among the three color-channel images of the first color-shifted image, the R channel image can be extracted and the extracted R channel image is determined as the second channel image. The second color-shifted image can also be color-channel separated to obtain an R channel image, a G channel image, and a B channel image of the second color-shifted image. Among the three color-channel images of the second color-shifted image, the B channel image can be extracted and the extracted B channel image is determined as the third channel image. After obtaining the first channel image, the second channel image, and the third channel image, the color shift processing result of the image to be processed can be obtained by using the first channel image, the second channel image, and the third channel image.
[0089] Further, refer to Figure 8 As shown, obtaining the color shift processing result by using the first channel image, the second channel image, and the third channel image may include:
[0090] Step S810: Merge the G channel image, the R channel image, and the B channel image to obtain a first special effect image;
[0091] Step S820: Based on the first special effect image, obtain a target special effect image, wherein the target special effect image is the color shift processing result.
[0092] Steps S810 and S820 will be further explained and illustrated below. Specifically, after extracting the G channel image from the radially blurred image, the R channel image from the first color-shifted image, and the B channel image from the first color-shifted image, the extracted G channel image, R channel image, and B channel image can be merged to obtain a first special effect image; wherein the first special effect image is an image of the image to be processed that has undergone radial blurring and color shifting; after obtaining the first special effect image, a target special effect image corresponding to the image to be processed can be obtained based on the first special effect image, and the target special effect image is the color shift processing result of the image to be processed based on the patch model.
[0093] refer to Figure 9 As shown, obtaining a target special effect image based on the first special effect image may include:
[0094] Step S910: sampling the image to be processed based on the display coordinates to obtain an initial display image;
[0095] Step S920: Obtain preset coordinates, and obtain a first distance between the preset coordinates and the display coordinates according to the preset coordinates and the display coordinates;
[0096] Step S930: Perform exponential function adjustment on the first distance to obtain a gradient value corresponding to the display coordinates; based on the gradient value, use a difference function to transition the initial display image and the first special effect image to obtain the target special effect image.
[0097] Below, steps S910 to S930 will be further explained and illustrated. Specifically, the center point of the first special effects image obtained after radial blur and color shift processing may be blurred. In order to ensure the clarity of the center point of the generated target special effects image, the first special effects image needs to be transition processed. The transition processing is specifically as follows: first, the image to be processed is sampled according to the display coordinates of the patch model to obtain an initial display image; then, the preset coordinates are obtained, where the preset coordinates can be the midpoint of the screen pixel (0.5, 0.5), that is, the center point is moved from (0, 0) to (0.5, 0.5). When the center point is moved to (0.5, 0.5), the image reference obtained is Figure 10 After obtaining the preset coordinates, the first distance between the coordinates of each pixel point in the display coordinates of the patch model and the preset coordinates is calculated, wherein the image of the first distance between the coordinates of each pixel point in the display coordinates and the preset coordinates can be referred to Figure 10 After obtaining the first distance, the first distance is adjusted by an exponential function; wherein the exponential function may be a Pow function, and an adjustment value corresponding to the coordinates of each pixel point in the display coordinates of the patch model is obtained. The visual effect formed may be a gradual change from the center of the circle to the outside. The adjustment value is reversed to obtain a gradual change value of the coordinates of each pixel point in the display coordinates of the patch model. The visual effect diagram may refer to Figure 10 As shown in (c), in the generated Figure 10 (c) Afterwards, you can Figure 10 Reversing the value in (c) yields Figure 10 (d) Finally, based on the gradient value, the interpolation function Lerp is used to transition the first special effect image and the initial display image to obtain the target special effect image. The Lerp function can be expressed as Lerp(a,b,t)=a+(ba)*t, where a is a pixel in the initial display image, b is a pixel in the first special effect image, and t is the gradient value corresponding to each pixel.
[0098] Furthermore, in this example embodiment, after the material blueprint is completed, a material example can be generated based on the material blueprint, that is, a target special effect image is generated, and the material example is assigned to the patch model. The degree of radial blur and color shift can also be achieved by controlling the parameters on the material example. Among them, the degree of color shift of the target special effect model can be controlled by the OffsetStrength color shift control factor, and the value range of OffsetStrength is [0,0.1]; the exponential value of the exponential function can be controlled by PowStrength, thereby achieving control of radial blur, and the exponential value range is [0,2]. When the image to be processed is Figure 11 When the above image processing method is used to perform radial blur and color shift on the image to be processed, the target special effect image obtained can be referred to Figure 12 As shown. Among them, Figure 11 In the image to be processed, the subject is a white ball. Figure 12 In the game, the white ball will appear blurred radiating outward from the center of the ball, and the color will be offset appropriately based on the white to achieve the effect of glitch art.
[0099] The image processing method provided by the example embodiments of the present disclosure has at least the following advantages: on the one hand, a patch model is obtained, the display coordinates of the patch model on the screen are determined, and the radial blur direction is determined based on the display coordinates of the patch model on the screen, so that the implementation of special effects is converted to the patch model, and local processing of the image to be processed is achieved through the patch model, which solves the problem in related technologies that local special effects processing cannot be performed on the image to be processed; on the other hand, after determining the radial blur direction, radial blur processing is performed on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model, and color shift processing is performed based on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model, thereby realizing the superposition of the two special effects of radial blur and color shift, and at the same time improving the efficiency of generating special effects for the image to be processed.
[0100] The exemplary embodiment of the present disclosure further provides an image processing apparatus, referring to Figure 13 As shown, it may include: a radial blur direction determination module 1310, a radial blur processing module 1320 and a color shift processing module 1330.
[0101] A radial blur direction determination module 1310 is configured to obtain an image to be processed and a patch model, determine display coordinates of the patch model on the screen, and determine a radial blur direction based on the display coordinates;
[0102] A radial blur processing module 1320 is configured to perform radial blur processing on the image to be processed according to the radial blur direction, to obtain a radial blur processing result of the image to be processed based on the patch model;
[0103] The color shift processing module 1330 is configured to perform color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
[0104] The specific details of each module in the above-mentioned image processing device have been described in detail in the corresponding image processing method, and therefore will not be repeated here.
[0105] In an exemplary embodiment of the present disclosure, obtaining a patch model, determining display coordinates of the patch model on a screen, and determining a radial blur direction based on the display coordinates include:
[0106] Obtaining a patch model, determining a center point of the patch model, and obtaining the screen space coordinates of the center point of the patch model;
[0107] Converting the coordinates of each pixel in the patch model to obtain the display coordinates matching the patch model with the screen;
[0108] The radial blur direction of each pixel point in the patch model is determined based on the screen space coordinates of the center point and the display coordinates of the patch model.
[0109] In an exemplary embodiment of the present disclosure, determining the center point of the mesh model and obtaining the screen space coordinates of the center point of the mesh model includes:
[0110] Obtaining the world space coordinates of the center point of the patch model, and converting the world space coordinates into clip space coordinates through a clip space conversion node;
[0111] The clipping space coordinates of the center point are converted to obtain the screen space coordinates of the center point.
[0112] In an exemplary embodiment of the present disclosure, performing radial blur processing on the image to be processed according to the radial blur direction to obtain a radial blur processing result of the image to be processed based on the patch model includes:
[0113] Get the current radial blur weight;
[0114] Performing radial offset on the display coordinates of the patch model according to the offset blur direction of each pixel point in the patch model and the current radial blur weight to obtain radial blur coordinates of the patch model;
[0115] The image to be processed is sampled according to the radial blur coordinates of the patch model to obtain a radial blur image based on the patch model; wherein the radial blur processing result includes the radial blur coordinates and the radial blur image.
[0116] In an exemplary embodiment of the present disclosure, sampling the image to be processed according to the radial blur coordinates of the patch model to obtain a radial blur image based on the patch model includes:
[0117] Obtaining a texture index of the image to be processed;
[0118] The image to be processed is sampled using the radial fuzzy coordinates and the texture index of the image to be processed to obtain a radial fuzzy image of the image to be processed based on the patch model.
[0119] In an exemplary embodiment of the present disclosure, performing color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model includes:
[0120] Obtaining radial blur coordinates, a first preset offset direction, a second preset offset direction, a first preset offset distance, and a second preset offset distance in the radial blur processing result; wherein the first preset offset direction is opposite to the second preset offset direction;
[0121] offsetting the radial blurred coordinates according to the first preset offset direction and the first preset offset distance to obtain first color offset coordinates;
[0122] offsetting the radial blurred coordinates according to the second preset offset direction and the second preset offset distance to obtain second color offset coordinates;
[0123] Sampling the image to be processed using the first color shift coordinates and the second color shift coordinates to obtain a first color shift image and a second color shift image;
[0124] The color shift processing result is obtained based on the radially blurred image, the first color shifted image, and the second color shifted image.
[0125] In an exemplary embodiment of the present disclosure, obtaining the color shift processing result based on the radially blurred image, the first color shifted image, and the second color shifted image includes:
[0126] performing channel separation on the radial blurred image to obtain a G channel image of the radial blurred image, and determining the G channel image as a first channel image;
[0127] performing channel separation on the first color-shifted image, obtaining an R-channel image of the first color-shifted image, and determining the R-channel image as the second channel image;
[0128] performing channel separation on the second color-shifted image, obtaining a B-channel image of the second color-shifted image, and determining the B-channel image as the third channel image;
[0129] The color shift processing result is obtained by using the first channel image, the second channel image, and the third channel image.
[0130] In an exemplary embodiment of the present disclosure, obtaining the color shift processing result by using the first channel image, the second channel image, and the third channel image includes:
[0131] Merging the G channel image, the R channel image, and the B channel image to obtain a first special effect image;
[0132] Based on the first special effect image, a target special effect image is obtained, wherein the target special effect image is the color shift processing result.
[0133] In an exemplary embodiment of the present disclosure, obtaining the target special effect image based on the first special effect image includes:
[0134] Sampling the image to be processed based on the display coordinates to obtain an initial display image;
[0135] Acquire a preset coordinate, and obtain a first distance between the preset coordinate and the display coordinate according to the preset coordinate and the display coordinate;
[0136] The first distance is adjusted by an exponential function to obtain a gradient value corresponding to the display coordinates. Based on the gradient value, a difference function is used to transition the initial display image and the first special effect image to obtain the target special effect image.
[0137] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0138] Furthermore, although the steps of the method of the present invention are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0139] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above method is also provided.
[0140] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0141] Refer to the following Figure 14 An electronic device 1400 according to this embodiment of the present invention will be described. Figure 14The electronic device 1400 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0142] like Figure 14 As shown, electronic device 1400 is implemented as a general-purpose computing device. Components of electronic device 1400 may include, but are not limited to, the aforementioned at least one processing unit 1410, the aforementioned at least one storage unit 1420, a bus 1430 connecting various system components (including storage unit 1420 and processing unit 1410), and a display unit 1440.
[0143] The storage unit stores program codes, which can be executed by the processing unit 1410, so that the processing unit 1410 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1410 can perform the following steps: Figure 1 Step S110 shown in: obtaining the image to be processed and the patch model, determining the display coordinates of the patch model on the screen, and determining the radial blur direction based on the display coordinates; S120: performing radial blur processing on the image to be processed according to the radial blur direction to obtain the radial blur processing result of the image to be processed based on the patch model; S130: performing color shift processing on the radial blur processing result to obtain the color shift processing result of the image to be processed based on the patch model.
[0144] The storage unit 1420 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 14201 and / or a cache memory unit 14202 , and may further include a read-only memory unit (ROM) 14203 .
[0145] The storage unit 1420 may also include a program / utility 14204 having a set (at least one) of program modules 14205, such program modules 14205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0146] The bus 1430 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0147] Electronic device 1400 can also communicate with one or more external devices 1500 (e.g., a keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1400, and / or any device that enables electronic device 1400 to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication can occur via input / output (I / O) interface 1450. Furthermore, electronic device 1400 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via network adapter 1460. As shown, network adapter 1460 communicates with other modules of electronic device 1400 via bus 1430. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with electronic device 1400, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0148] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present invention.
[0149] In exemplary embodiments of the present invention, a computer-readable storage medium is also provided, storing a program product capable of implementing the methods described above. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to perform the steps according to various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0150] According to an embodiment of the present invention, a program product for implementing the above-mentioned method can be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0151] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, 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 thereof.
[0152] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0153] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0154] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0155] In addition, the above drawings are only examples of the processing included in the method according to the exemplary embodiment of the present invention.
[0156] It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be
[0157] For example, executed synchronously or asynchronously in multiple modules.
[0158] Other embodiments of the invention will readily occur to those skilled in the art after consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or
[0159] Adaptive changes, these variations, uses or adaptive changes follow the general principles of the present invention and include common knowledge or conventional technical means in the field of the present invention that are not invented by the present invention.
[0160] It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
Claims
1. An image processing method, characterized in that: include: Acquire an image to be processed and a patch model, determine the display coordinates of the patch model on the screen, and determine a radial blur direction based on the display coordinates; wherein determining the radial blur direction based on the display coordinates includes: obtaining the radial blur direction based on the difference between the screen space coordinates of the center point of the patch model and the display coordinates of each pixel in the patch model; Obtaining a current radial blur weight; radially offsetting the display coordinates of the patch model according to the radial blur direction of each pixel point in the patch model and the current radial blur weight to obtain radial blur coordinates of the patch model; sampling the image to be processed according to the radial blur coordinates of the patch model to obtain a radially blurred image based on the patch model; wherein the radial blur processing result includes the radial blur coordinates and the radially blurred image; Color shift processing is performed on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
2. The image processing method according to claim 1, wherein: Acquiring a patch model, determining display coordinates of the patch model on a screen, and determining a radial blur direction based on the display coordinates, including: Obtaining a patch model, determining a center point of the patch model, and obtaining the screen space coordinates of the center point of the patch model; Converting the coordinates of each pixel in the patch model to obtain the display coordinates matching the patch model with the screen; The radial blur direction of each pixel point in the patch model is determined based on the screen space coordinates of the center point and the display coordinates of the patch model.
3. The image processing method according to claim 2, wherein: Determining the center point of the patch model and obtaining the screen space coordinates of the center point of the patch model includes: Obtaining the world space coordinates of the center point of the patch model, and converting the world space coordinates into clip space coordinates through a clip space conversion node; The clipping space coordinates of the center point are converted to obtain the screen space coordinates of the center point.
4. The image processing method according to claim 1, wherein: Sampling the image to be processed according to the radial fuzzy coordinates of the patch model to obtain a radial fuzzy image based on the patch model includes: Obtaining a texture index of the image to be processed; The image to be processed is sampled using the radial fuzzy coordinates and the texture index of the image to be processed to obtain a radial fuzzy image of the image to be processed based on the patch model.
5. The image processing method according to claim 1, wherein: Performing color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model, including: Obtaining radial blur coordinates, a first preset offset direction, a second preset offset direction, a first preset offset distance, and a second preset offset distance in the radial blur processing result; wherein the first preset offset direction is opposite to the second preset offset direction; offsetting the radial blurred coordinates according to the first preset offset direction and the first preset offset distance to obtain first color offset coordinates; offsetting the radial blurred coordinates according to the second preset offset direction and the second preset offset distance to obtain second color offset coordinates; Sampling the image to be processed using the first color shift coordinates and the second color shift coordinates to obtain a first color shift image and a second color shift image; The color shift processing result is obtained based on the radially blurred image, the first color shifted image, and the second color shifted image.
6. The image processing method according to claim 5, characterized in that Obtaining the color shift processing result based on the radially blurred image, the first color shifted image, and the second color shifted image, including: performing channel separation on the radial blurred image to obtain a G channel image of the radial blurred image, and determining the G channel image as a first channel image; performing channel separation on the first color-shifted image, obtaining an R-channel image of the first color-shifted image, and determining the R-channel image as a second channel image; performing channel separation on the second color-shifted image, obtaining a B-channel image of the second color-shifted image, and determining the B-channel image as a third channel image; The color shift processing result is obtained by using the first channel image, the second channel image, and the third channel image.
7. The image processing method according to claim 6, characterized in that: Obtaining the color shift processing result by using the first channel image, the second channel image, and the third channel image, including: Merging the G channel image, the R channel image, and the B channel image to obtain a first special effect image; Based on the first special effect image, a target special effect image is obtained, wherein the target special effect image is the color shift processing result.
8. The image processing method according to claim 7, wherein: Obtaining a target special effect image based on the first special effect image includes: Sampling the image to be processed based on the display coordinates to obtain an initial display image; Acquire a preset coordinate, and obtain a first distance between the preset coordinate and the display coordinate according to the preset coordinate and the display coordinate; The first distance is adjusted by an exponential function to obtain a gradient value corresponding to the display coordinates. Based on the gradient value, a difference function is used to transition the initial display image and the first special effect image to obtain the target special effect image.
9. An image processing device, characterized in that: include: a radial blur direction determination module, configured to obtain an image to be processed and a patch model, determine the display coordinates of the patch model on the screen, and determine a radial blur direction based on the display coordinates; wherein determining the radial blur direction based on the display coordinates includes: obtaining the radial blur direction based on the difference between the screen space coordinates of the center point of the patch model and the display coordinates of each pixel in the patch model; a radial blur processing module configured to obtain a current radial blur weight; radially offset the display coordinates of the patch model according to the radial blur direction of each pixel in the patch model and the current radial blur weight to obtain radial blur coordinates of the patch model; sample the image to be processed according to the radial blur coordinates of the patch model to obtain a radially blurred image based on the patch model; wherein the radial blur processing result includes the radial blur coordinates and the radially blurred image; The color shift processing module is used to perform color shift processing on the radial blur processing result to obtain a color shift processing result of the image to be processed based on the patch model.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing unit, the image processing method according to any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that: include: processing unit; as well as a storage unit, configured to store executable instructions of the processing unit; Wherein, the processing unit is configured to perform the image processing method according to any one of claims 1 to 8 by executing the executable instructions.
Citation Information
Patent Citations
Image processing method and device, storage medium and processor
CN108305228A
A naked-eye 3D interaction method and system for Cantonese opera
CN109068124A