Image processing method, device, electronic device and storage medium

By performing blur operations and fusion on images after the game scene is rendered, the problem of cumbersome screen centripetal stretch blur effect processing and high computational consumption in the existing technology is solved, achieving more efficient image processing and better effects.

CN111784811BActive Publication Date: 2024-09-27BEIJING PIXEL SOFTWARE TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010487067.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-01
Publication Date
2024-09-27
Estimated Expiration
2040-06-01

AI Technical Summary

Technical Problem

When the existing technology realizes the centripetal stretching blur effect of the screen, the processing process is cumbersome and the calculation consumption is too large, resulting in insufficient hardware computing power to achieve the effect.

Method used

After the rendering of the game scene is completed, the first image is generated by obtaining the image to be processed of the current frame, and blur operation and fusion are performed according to the preset parameters. Image fusion technology is used to achieve a centripetal stretching blur effect and reduce the computing pressure of the device.

Benefits of technology

It simplifies the processing difficulty, reduces the computing pressure of the device, and improves the presentation quality of the centripetal stretch blur effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111784811B
    Figure CN111784811B
Patent Text Reader

Abstract

The present application provides an image processing method, device, electronic device and storage medium. The method includes: after the rendering of the game scene is completed, obtaining the image to be processed of the current frame; based on the image to be processed, generating a first image; performing a blur operation on the first image according to a first preset parameter; wherein the first preset parameter includes a central texture point and an image stretching strength; according to a second preset parameter, the first image is fused with the image to be processed so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes an image fusion strength. Compared with the prior art, by performing post-effect processing on a single-frame image after the rendering of the game scene is completed, the processing difficulty can be reduced and the computing pressure of the device can be reduced. In addition, the image fusion technology can make the presentation effect of the centripetal stretch blur of the image to be processed better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application 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] With the rapid development of the gaming industry, the requirements for game graphics are getting higher and higher. Developers usually use some post-production effects to enrich the game plot, such as the centripetal stretch blur effect of the screen. The centripetal stretch blur effect of the screen refers to the blur effect that spreads out from the center of the screen. For the realization of the centripetal stretch blur effect of the screen, the commonly used method is to blur the static image multiple times in different parts and directions. This method is mainly used in the rendering of game scenes, and is realized by inserting animations. The processing process of this method is very cumbersome and the calculation consumption is too large. If the hardware computing power is too low, the centripetal stretch blur effect of the screen cannot be achieved. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an image processing method, device, electronic device and storage medium to improve the problem that "the current method for implementing the centripetal stretching blur effect of the screen has a very cumbersome processing process and consumes too much calculation."

[0004] The present invention is achieved in that:

[0005] In a first aspect, an embodiment of the present application provides an image processing method, comprising: after the rendering of a game scene is completed, obtaining an image to be processed of the current frame; generating a first image based on the image to be processed; performing a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength; and fusing the first image with the image to be processed according to second preset parameters so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameters include an image fusion strength.

[0006] In an embodiment of the present application, after the game scene rendering is completed, the image to be processed of the current frame is obtained; based on the image to be processed, a first image is generated, and then a blur operation is performed on the first image according to a first preset parameter, and finally the first image is fused with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect. Compared with the prior art, by performing post-effect processing on a single frame image after the game scene rendering is completed, the processing difficulty can be reduced and the computing pressure of the device can be reduced. In addition, the image fusion technology can make the presentation effect of the centripetal stretch blur of the image to be processed better.

[0007] In combination with the technical solution provided in the first aspect above, in some possible implementation methods, the blurring operation on the first image according to the first preset parameters includes: obtaining a first pixel point on the first image; obtaining the distance between the first pixel point and the central texture point; performing color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength; obtaining a target color based on the sampling result, and using the target color as the color of the first pixel point.

[0008] In the embodiment of the present application, fuzzy operation is performed by color sampling, which is simple and efficient and can reduce the computing pressure of the device.

[0009] In combination with the technical solution provided in the first aspect above, in some possible implementations, the color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength includes: constructing a vector between the first pixel point and the central texture point; performing color sampling at a first offset distance in the same direction as the first pixel point and the vector, and performing color sampling at the first offset distance in the opposite direction of the first pixel point and the vector; wherein the first offset distance is the product of the distance between the first pixel point and the central texture point and the image stretching strength.

[0010] In the embodiment of the present application, by constructing a vector between the first pixel point and the central texture point, the directions of two opposite color samplings can be determined by the direction of the vector, which facilitates subsequent blur processing.

[0011] In combination with the technical solution provided in the first aspect above, in some possible implementations, the color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength includes: constructing a vector between the first pixel point and the central texture point; normalizing the vector based on the distance between the first pixel point and the central texture point to obtain a unit vector; performing color sampling at a second offset distance in the same direction as the first pixel point and the unit vector, and performing color sampling at the second offset distance in the opposite direction of the first pixel point and the unit vector; wherein the second offset distance is the product of the unit vector and the image stretching strength.

[0012] In the embodiment of the present application, by constructing the vector of the first pixel point and the central texture point, the directions of two opposite color samples can be determined by the direction of the vector, which is convenient for subsequent blur processing. At the same time, the amount of calculation during sampling can be reduced through normalization processing.

[0013] In combination with the technical solution provided in the first aspect above, in some possible implementation methods, the second preset parameter also includes a blur-free area, the central texture point is the exact center of the blur-free area, and the fusing of the first image with the image to be processed according to the second preset parameter includes: determining whether the first pixel is within the blur-free area; if so, keeping the pixel to be processed on the image to be processed unchanged; wherein the first pixel corresponds to the pixel to be processed; if not, fusing the first pixel with the pixel to be processed on the image to be processed according to the image fusion strength.

[0014] In an embodiment of the present application, in order to highlight areas such as characters and buildings, a blur-free area is set, the pixels in the blur-free area remain unchanged, and the pixels in the non-blur-free area are blurred, thereby improving the effect of the game screen.

[0015] In combination with the technical solution provided in the first aspect above, in some possible implementation methods, the first pixel point is fused with the pixel point to be processed on the image to be processed according to the image fusion strength, including: taking the product of the distance between the first pixel point and the central texture point and the image fusion strength as the weight value of the image to be processed; based on the weight value of the image to be processed and the Lagrange interpolation formula, the first pixel point is fused with the pixel point to be processed on the image to be processed.

[0016] In an embodiment of the present application, the product of the distance between the first pixel point and the central texture point and the image fusion strength is used as the weight value of the image to be processed, and then the first pixel point is fused with the pixel point to be processed on the image to be processed through the weight value, so that the farther the first pixel point is from the central texture point, the greater the weight value, the blurrier the first pixel point, thereby improving the centripetal blur stretching effect of the screen.

[0017] In combination with the technical solution provided in the first aspect above, in some possible implementations, generating a first image based on the image to be processed includes: copying the image to be processed, reducing the copied image to be processed according to a preset ratio, and generating the first image; correspondingly, fusing the first image with the image to be processed according to a second preset parameter so that the image to be processed presents a centripetal stretching blur effect, includes: enlarging the first image according to a preset ratio; fusing the enlarged first image with the image to be processed according to the second preset parameter so that the image to be processed presents a centripetal stretching blur effect.

[0018] In the embodiment of the present application, by reducing the copied image to be processed according to a preset ratio to generate a first image, the processing operation pressure of subsequent devices for the first image can be reduced and the amount of calculation can be reduced.

[0019] In the second aspect, an embodiment of the present application provides an image processing device, including: an acquisition module, used to acquire the image to be processed of the current frame after the game scene rendering is completed; a generation module, used to generate a first image based on the image to be processed; a processing module, used to perform a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength; a fusion module, used to fuse the first image with the image to be processed according to second preset parameters, so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameters include image fusion strength.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the processor and the memory are connected; the memory is used to store programs; the processor is used to call the programs stored in the memory to execute the method provided in the above-mentioned first aspect embodiment and / or in combination with some possible implementation methods of the above-mentioned first aspect embodiment.

[0021] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, executes a method provided in the embodiment of the first aspect above and / or in combination with some possible implementations of the embodiment of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 A structural block diagram of an electronic device provided in an embodiment of the present application.

[0024] Figure 2 A flowchart of the steps of an image processing method provided in an embodiment of the present application.

[0025] Figure 3 A flowchart of the steps of another image processing method provided in an embodiment of the present application.

[0026] Figure 4 A schematic diagram of a first image including a blur-free area provided in an embodiment of the present application.

[0027] Figure 5 A module block diagram of an image processing device provided in an embodiment of the present application.

[0028] Icon: 100 - electronic device; 110 - processor; 120 - memory; 200 - image processing device; 201 - acquisition module; 202 - generation module; 203 - processing module; 204 - fusion module. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0030] The current common method for achieving the centripetal stretch blur effect of the screen is to blur the static image multiple times in different parts and directions. This method is mainly used in game scene rendering and is achieved by inserting animations, which makes the processing process very cumbersome and consumes too much calculation. If the hardware computing power is too low, the centripetal stretch blur effect of the screen cannot be achieved.

[0031] In view of the above problems, the inventors of the present application have proposed the following embodiments to solve the above problems after research and exploration.

[0032] See also Figure 1 , is a schematic structural block diagram of an electronic device 100 to which an image processing method and apparatus are applied provided in an embodiment of the present application. In the embodiment of the present application, the electronic device 100 may be, but is not limited to, a smart phone, a tablet computer, a desktop computer, a laptop computer, etc. Structurally, the electronic device 100 may include a processor 110 and a memory 120.

[0033] The processor 110 is electrically connected to the memory 120 directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The image processing device includes at least one software module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 110 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the image processing device, to implement the image processing method. The processor 110 can execute the computer program after receiving the execution instruction.

[0034] Among them, the processor 110 can be an integrated circuit chip with signal processing capabilities. The processor 110 can also be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a discrete gate or transistor logic device, and a discrete hardware component. It can implement or execute the disclosed methods, steps, and logic block diagrams in the embodiments of the present application. In addition, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0035] Optionally, in an embodiment of the present application, the processor 110 includes a main processor and an image processor. The main processor is mainly used for running the game, such as running the game and rendering the game scene; the main processor is also used to obtain the image to be processed of the current frame after the rendering of the game scene is completed; based on the image to be processed, a first image is generated; and the first image is sent to the image processor. The image processor is mainly used to process the image in the game, such as the image processor is used to perform a blur operation on the first image according to a first preset parameter; wherein the first preset parameter includes a central texture point and an image stretching strength; and is used to fuse the first image with the image to be processed according to a second preset parameter so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes an image fusion strength. In an embodiment of the present application, the processing pressure of the main processor can be reduced by performing a blur operation through the image processor. That is, in the embodiment of the present application, a special image processor performs a screen centripetal blur stretching effect on the image to be processed, which releases the processing pressure of the main processor.

[0036] Of course, in other implementations, the image processor may also be used to obtain the image to be processed of the current frame after the game scene rendering is completed; and generate the first image based on the image to be processed.

[0037] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), and an electric erasable programmable read-only memory (EEPROM). The memory 120 is used to store a program, and the processor 110 executes the program after receiving an execution instruction.

[0038] It should be understood that Figure 1 The structure shown is for illustration only. The electronic device 100 provided in the embodiment of the present application may also have Figure 1 Fewer or more components, or with Figure 1 In addition, Figure 1 The components shown may be implemented by software, hardware or a combination thereof.

[0039] See also Figure 2 , Figure 2 A flowchart of the steps of the image processing method provided in the embodiment of the present application, the method is applied to Figure 1 It should be noted that the image processing method provided in the embodiment of the present application is not based on Figure 2 The order shown below is a limitation. The method comprises: step S101 to step S104.

[0040] Step S101: After the game scene rendering is completed, the image to be processed of the current frame is obtained.

[0041] Step S102: Generate a first image based on the image to be processed.

[0042] Step S103: performing a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength.

[0043] Step S104: fusing the first image with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes image fusion strength.

[0044] In an embodiment of the present application, after the game scene rendering is completed, the image to be processed of the current frame is obtained; based on the image to be processed, a first image is generated, and then a blur operation is performed on the first image according to a first preset parameter, and finally the first image is fused with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect. Compared with the prior art, by performing post-effect processing on a single frame image after the game scene rendering is completed, the processing difficulty can be reduced and the computing pressure of the device can be reduced. In addition, the image fusion technology can make the presentation effect of the centripetal stretch blur of the image to be processed better.

[0045] The above steps are explained below with reference to specific examples.

[0046] Step S101: After the game scene rendering is completed, the image to be processed of the current frame is obtained.

[0047] After entering the game interface, after the game has finished rendering the scene objects seen by the camera, the image to be processed of the current frame is obtained, which is recorded as mainImage. mainImage represents a picture. It should be noted that the camera here refers to the perspective in the game. Generally speaking, the perspective in the game is the perspective of the user or player.

[0048] Step S102: Generate a first image based on the image to be processed.

[0049] Wherein, generating the first image based on the image to be processed may be to copy the image to be processed to generate the first image, that is, by copying the image to be processed, a first image having the same size, dimension and content as the image to be processed is obtained.

[0050] The first image may be generated based on the image to be processed, or the image to be processed may be copied and the copied image may be reduced according to a preset ratio to generate the first image.

[0051] In this embodiment, the preset ratio is one-quarter, that is, after the image to be processed is copied, the copied image is reduced to one-quarter of the original image, thereby obtaining a first image, which is recorded as QuarterImage. For example, the size of the image to be processed is 1024*1024 (in pixels). In this step, the 1024*1024 image to be processed is copied and then reduced to one-quarter of the original image, thereby obtaining a 256*256 first image.

[0052] In other embodiments, the preset ratio may be one-half, one-eighth; the preset ratio may also be 85%, 40%, etc., which is not limited in this application.

[0053] In the embodiment of the present application, by reducing the copied image to be processed according to a preset ratio to generate a first image, the processing operation pressure of subsequent devices for the first image can be reduced and the amount of calculation can be reduced.

[0054] Optionally, based on the image to be processed, generating the first image may also be to copy the image to be processed, crop the copied image according to a preset rule, and use the cropped image as the first image. The preset rule may be to crop the image to half of the original image, such as cropping with the center of the copied image as a reference, extending outward from the center to form a rectangle, and when the size of the rectangle is half of the copied image, the remaining part is cropped, and the rectangular part is retained as the first image. The preset rule may also be to crop the image to one-third of the original image, etc., which is not limited in this application.

[0055] Step S103: performing a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength.

[0056] It should be explained that the central texture point O is the central point of the image, and the image stretching strength P is the blurriness of the image.

[0057] The following is an explanation of the specific fuzzy operation. Figure 3 The specific process of fuzzy operation includes: step S201-step S204.

[0058] Step S201: Acquire a first pixel point on a first image.

[0059] The first pixel is any pixel on the first image. The fuzzy operation of the first image is realized by performing a fuzzy operation on each pixel on the first image. The coordinates of the center texture point O in the first preset parameter are (X1, X2), and the coordinates of the first pixel A are (Y1, Y2).

[0060] Step S202: Obtain the distance between the first pixel point and the central texture point.

[0061] The distance between the first pixel and the center texture point is calculated using the distance formula between two points. The formula is: Where |OA| represents the distance between the first pixel point A and the central texture point O.

[0062] Step S203: performing color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength.

[0063] The color sampling based on the distance between the first pixel and the central texture point and the image stretching strength may be: constructing a vector between the first pixel and the central texture point; performing color sampling at a first offset distance in the same direction as the first pixel and the vector, and performing color sampling at a first offset distance in the opposite direction of the first pixel and the vector. The first offset distance is the product of the distance between the first pixel and the central texture point and the image stretching strength.

[0064] Since a vector is a quantity with magnitude and direction, after constructing the vector between the first pixel and the center texture point, two directions based on the first pixel A can be determined, namely, the positive direction of the vector and the negative direction of the vector. When the constructed vector is (with the center texture point O as the starting point and the first pixel point A as the end point), The positive direction of the vector is the direction from the center texture point O to the first pixel point A. The reverse direction of the vector is the direction from the first pixel point A to the center texture point O. Of course, the constructed vector can also be (The first pixel point A is taken as the starting point and the central texture point O is taken as the end point). This application does not limit this. Then, color sampling is performed at a first offset distance between the first pixel point and the vector in the positive direction and at a first offset distance between the first pixel point and the vector in the reverse direction. The first offset distance is |OA|·P.

[0065] In the embodiment of the present application, by constructing a vector between the first pixel point and the central texture point, the directions of two opposite color samplings can be determined by the direction of the vector, which facilitates subsequent blur processing.

[0066] Among them, color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength can also be: constructing a vector between the first pixel point and the central texture point; normalizing the vector based on the distance between the first pixel point and the central texture point to obtain a unit vector; performing color sampling at a second offset distance in the same direction of the first pixel point and the unit vector, and performing color sampling at a second offset distance in the opposite direction of the first pixel point and the unit vector; wherein the second offset distance is the product of the unit vector and the image stretching strength.

[0067] It should be noted that the process of constructing the vector has been described in the above embodiment, and in order to avoid redundancy, it will not be repeated here. Then, the vector Divide by the distance between the first pixel and the center texture point |OA| to obtain a normalized unit vector. Since the unit vector represents 1, the second offset distance is 1·P.

[0068] In the embodiment of the present application, by constructing the vector of the first pixel point and the central texture point, the directions of two opposite color samples can be determined by the direction of the vector, which is convenient for subsequent blur processing. At the same time, the amount of calculation during sampling can be reduced through normalization processing.

[0069] Optionally, color sampling based on the distance between the first pixel and the central texture point and the image stretching strength can also be performed by taking the direction of the coordinate axis of the coordinate system as the sampling direction. For example, when the first pixel on the first image is obtained in step S201, the coordinates of the central texture point O are obtained based on the coordinate system as (X1, X2), and the coordinates of the first pixel A are obtained as (Y1, Y2). Therefore, the direction of the coordinate axis of the coordinate system can be used as the sampling direction, that is, color sampling is performed at the third offset distance in the same direction of the first pixel and the X-axis, and color sampling is performed at the third offset distance in the opposite direction of the first pixel and the X-axis. Of course, color sampling can also be performed at the third offset distance in the same direction of the first pixel and the Y-axis, and color sampling can be performed at the third offset distance in the opposite direction of the first pixel and the Y-axis. Of course, color sampling can also be performed in four directions of the first pixel A at the same time, that is, color sampling is performed at the third offset distance in the same direction and the opposite direction of the first pixel A and the Y-axis, and at the third offset distance in the same direction and the opposite direction of the first pixel and the Y-axis. The third offset distance may be the product of the distance between the first pixel point and the central texture point and the image stretching strength, which is not limited in the present application.

[0070] Step S204: based on the sampling result, a target color is obtained, and the target color is used as the color of the first pixel.

[0071] After obtaining the color sampling results of multiple directions of the first pixel point A, the sampling results are accumulated and divided by the number of directions, and the average value is the target color ColorResult. For example, after obtaining the color sampling results of two directions of the first pixel point A, the sampling results are accumulated and divided by 2 to obtain the target color ColorResult. For another example, after obtaining the color sampling results of four directions of the first pixel point A, the sampling results are accumulated and divided by 4 to obtain the target color ColorResult. After obtaining the target color ColorResult, the target color ColorResult is used as the color of the first pixel point. Then the fuzzy operation of the point is realized.

[0072] Step S104: fusing the first image with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes image fusion strength.

[0073] The image fusion strength can be understood as the fusion ratio of the image to be processed and the first image. For example, the image fusion strength can be 0.6, 40%, etc. When the image fusion strength is 0.6, the weight of the image to be processed is 0.6, and the weight of the first image is 1-0.6=0.4. Then, the first image is fused with the image to be processed according to the weight, so that the image to be processed presents a centripetal stretch blur effect.

[0074] Optionally, the second preset parameter also includes a blur-free area, and the central texture point is the exact center of the blur-free area. The above-mentioned fusing the first image with the image to be processed according to the second preset parameter may include: determining whether the first pixel point is within the blur-free area; if so, keeping the pixel point to be processed on the image to be processed unchanged; wherein the first pixel point corresponds to the pixel point to be processed; if not, fusing the first pixel point with the pixel point to be processed on the image to be processed according to the image fusion strength.

[0075] Combine the following Figure 4 To illustrate, assume Figure 4 The middle area is the non-blurring area. The non-blurring area is a circular area with a radius of R. The non-blurring area refers to a pre-set area that does not need to be blurred, such as characters and buildings that you want to highlight in the game.

[0076] The method for determining whether the first pixel point A is within the blur-free area may be to determine whether the distance |OA| between the first pixel point and the central texture point is less than the radius R of the blur-free area. If the distance |OA| between the first pixel point and the central texture point is less than the radius R of the blur-free area, it means that the first pixel point A is within the blur-free area. Correspondingly, the pixel to be processed on the image to be processed corresponding to the first pixel point A on the first image is also within the blur-free area. Therefore, the pixel to be processed on the image to be processed remains unchanged. If the distance |OA| between the first pixel point and the central texture point is greater than the radius R of the blur-free area, it means that the first pixel point A is not within the blur-free area. Correspondingly, the pixel to be processed on the image to be processed corresponding to the first pixel point A on the first image is also not within the blur-free area. Therefore, according to the image fusion strength, the first pixel point is fused with the pixel to be processed on the image to be processed so that the pixel to be processed on the image to be processed produces a blur effect.

[0077] like Figure 4As shown, if the distance |OA1| between the first pixel point A1 and the central texture point is less than the radius R of the blur-free area, it means that the first pixel point A1 is within the blur-free area. Correspondingly, the pixel to be processed on the image to be processed corresponding to the first pixel point A1 on the first image is also within the blur-free area. Therefore, the pixel to be processed on the image to be processed is kept unchanged. If the distance |OA2| between the first pixel point A2 and the central texture point O is greater than the radius R of the blur-free area, it means that the first pixel point A2 is not within the blur-free area. Correspondingly, the pixel to be processed on the image to be processed corresponding to the first pixel point A2 on the first image is also not within the blur-free area. Therefore, according to the image fusion strength, the first pixel point A2 is fused with the pixel to be processed on the image to be processed to produce a blur effect on the pixel to be processed on the image to be processed.

[0078] Optionally, according to the image fusion strength, the first pixel point is fused with the pixel point to be processed on the image to be processed, including: taking the product of the distance between the first pixel point and the central texture point and the image fusion strength as the weight value of the image to be processed; based on the weight value of the image to be processed and the Lagrange interpolation formula, the first pixel point is fused with the pixel point to be processed on the image to be processed.

[0079] Among them, the Lagrangian interpolation formula is color=colorA·(1-K)+colorB·K; wherein K represents the product of the distance |OA| between the first pixel and the central texture point and the image fusion strength B, that is, K=|OA|·B; colorA is the color of the first pixel, that is, the ColorResult obtained in step S204; colorB is the color of the pixel to be processed on the image to be processed mainImage corresponding to the first pixel; color is the color of the pixel to be processed on the image to be processed corresponding to the first pixel calculated by the Lagrangian interpolation formula.

[0080] In the embodiment of the present application, the product of the distance between the first pixel point and the central texture point and the image fusion strength is used as the weight value of the image to be processed, and then the first pixel point is fused with the pixel point to be processed on the image to be processed by the weight value, so that the farther the first pixel point is from the central texture point, the greater the weight value, the more blurred the first pixel point is, thereby improving the centripetal blur stretching effect of the screen. Figure 4 As shown, |OA3| is greater than |OA2|. Therefore, the distance between the first pixel point A3 and the central texture point is farther than the distance between the first pixel point A2 and the central texture point. The weight value corresponding to the first pixel point A3 is larger, so that the final correlation presented on the image to be processed is that the first pixel point A3 is blurrier than the first pixel point A2, thereby improving the centripetal blur stretching effect of the screen.

[0081] It is understandable that when the first image is generated based on the image to be processed in step S102, if the first image is obtained by reducing the copied image to be processed, then in step S104, the reduced first image needs to be enlarged to its original size, that is, the first image is enlarged according to a preset ratio, and then the enlarged first image is fused with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect. In this way, it can be ensured that the first pixel on the first image can correspond to the pixel on the image to be processed.

[0082] The above scheme is explained below with a specific example. After entering the game interface, after the game finishes rendering the scene objects seen by the camera, obtain the image to be processed of the current frame, recorded as mainImage. Copy the image to be processed mainImage, reduce the copied image to one-fourth of the original image, and generate the first image QuarterImage. Then perform a blur operation on the first image QuarterImage according to the first preset parameters. The first preset parameters include the center texture point O and the image stretching strength P. The specific blur operation includes: obtaining the first pixel point A on the first image QuarterImage. Obtaining the distance |OA| between the first pixel point A and the center texture point O. Constructing the vector between the first pixel point A and the center texture point Vector Divide by the distance |OA| between the first pixel and the central texture point to obtain the normalized unit vector. Perform color sampling at the second offset distance (the product of the unit vector and the image stretching strength, i.e. 1·P) in the same direction as the first pixel and the unit vector, and perform color sampling at the second offset distance in the opposite direction of the first pixel and the unit vector. Accumulate the sampling results and divide by 2 to obtain the target color ColorResult. Use the target color ColorResult as the color of the first pixel A. Then, the first image is fused with the image to be processed according to the second preset parameters so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameters include the blur-free area and the image fusion strength B. The specific fusion process is: determine whether the distance |OA| between the first pixel A and the central texture point O is less than the radius R of the blur-free area. If |OA| is less than R, keep the pixel to be processed on the image to be processed unchanged. If |OA| is greater than R, the product of the distance |OA| between the first pixel point A and the central texture point O and the image fusion strength B is used as the weight value K of the image to be processed; based on the weight value K of the image to be processed and the Lagrange interpolation formula color=colorA·(1-K)+colorB·K, the first pixel point is fused with the pixel point to be processed on the image to be processed, thereby achieving a centripetal stretching blur effect of the image to be processed.

[0083] See also Figure 5 Based on the same inventive concept, the embodiment of the present application also provides an image processing device 200, including: an acquisition module 201, a generation module 202, a processing module 203 and a fusion module 204.

[0084] The acquisition module 201 is used to acquire the image to be processed of the current frame after the game scene rendering is completed.

[0085] The generating module 202 is configured to generate a first image based on the image to be processed.

[0086] The processing module 203 is used to perform a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength.

[0087] The fusion module 204 is used to fuse the first image with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes image fusion strength.

[0088] Optionally, the processing module 203 is specifically used to obtain a first pixel point on the first image; obtain the distance between the first pixel point and the central texture point; perform color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength; based on the sampling result, obtain a target color, and use the target color as the color of the first pixel point.

[0089] Optionally, the processing module 203 is also specifically used to construct a vector between the first pixel point and the central texture point; perform color sampling at a first offset distance in the same direction as the first pixel point and the vector, and perform color sampling at the first offset distance in the opposite direction of the first pixel point and the vector; wherein the first offset distance is the product of the distance between the first pixel point and the central texture point and the image stretching strength.

[0090] Optionally, the processing module 203 is also specifically used to construct a vector between the first pixel point and the central texture point; normalize the vector based on the distance between the first pixel point and the central texture point to obtain a unit vector; perform color sampling at a second offset distance in the same direction as the first pixel point and the unit vector, and perform color sampling at the second offset distance in the opposite direction between the first pixel point and the unit vector; wherein the second offset distance is the product of the unit vector and the image stretching strength.

[0091] Optionally, the second preset parameter also includes a blur-free area, the central texture point is the exact center of the blur-free area, and the fusion module 204 is specifically used to determine whether the first pixel point is within the blur-free area; if so, the pixel point to be processed on the image to be processed is kept unchanged; wherein, the first pixel point corresponds to the pixel point to be processed; if not, the first pixel point is fused with the pixel point to be processed on the image to be processed according to the image fusion strength.

[0092] Optionally, the fusion module 204 is also specifically used to take the product of the distance between the first pixel point and the central texture point and the image fusion strength as the weight value of the image to be processed; based on the weight value of the image to be processed and the Lagrange interpolation formula, the first pixel point is fused with the pixel point to be processed on the image to be processed.

[0093] Optionally, the generating module 202 is further specifically configured to copy the image to be processed, reduce the copied image to be processed according to a preset ratio, and generate a first image. Correspondingly, the fusion module is further specifically configured to enlarge the first image according to a preset ratio; and fuse the enlarged first image with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect.

[0094] It should be noted that, since technicians in the relevant field can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0095] Based on the same inventive concept, an embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed, the method provided in the above embodiment is executed.

[0096] The storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).

[0097] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0098] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0099] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0100] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0101] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An image processing method, characterized in that: include: After the game scene rendering is completed, obtain the image to be processed of the current frame; Based on the image to be processed, generating a first image; Performing a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength; The first image is fused with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes image fusion strength.

2. The image processing method according to claim 1, characterized in that: The performing a blur operation on the first image according to the first preset parameter includes: Acquire a first pixel point on the first image; Obtaining the distance between the first pixel point and the central texture point; Performing color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength; Based on the sampling result, a target color is obtained, and the target color is used as the color of the first pixel.

3. The image processing method according to claim 2, characterized in that: The color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength includes: Constructing a vector between the first pixel point and the central texture point; Color sampling is performed at a first offset distance in the same direction as the first pixel point and the vector, and color sampling is performed at the first offset distance in the opposite direction of the first pixel point and the vector; wherein the first offset distance is the product of the distance between the first pixel point and the central texture point and the image stretching strength.

4. The image processing method according to claim 2, characterized in that: The color sampling based on the distance between the first pixel point and the central texture point and the image stretching strength includes: Constructing a vector between the first pixel point and the central texture point; Normalizing the vector based on the distance between the first pixel point and the central texture point to obtain a unit vector; Color sampling is performed at a second offset distance in the same direction as the first pixel and the unit vector, and color sampling is performed at the second offset distance in the opposite direction of the first pixel and the unit vector; wherein the second offset distance is the product of the unit vector and the image stretching strength.

5. The image processing method according to claim 2, characterized in that: The second preset parameter also includes a blur-free area, the central texture point is the exact center of the blur-free area, and the fusing of the first image with the image to be processed according to the second preset parameter includes: Determine whether the first pixel is within the blur-free area; If yes, keep the pixel to be processed on the image to be processed unchanged; wherein the first pixel corresponds to the pixel to be processed; If not, the first pixel point is fused with the pixel point to be processed on the image to be processed according to the image fusion strength.

6. The image processing method according to claim 5, characterized in that: The step of fusing the first pixel with the pixel to be processed on the image to be processed according to the image fusion strength includes: Taking the product of the distance between the first pixel point and the central texture point and the image fusion strength as the weight value of the image to be processed; Based on the weight value of the image to be processed and the Lagrange interpolation formula, the first pixel point is fused with the pixel point to be processed on the image to be processed.

7. The image processing method according to claim 1, characterized in that: The step of generating a first image based on the image to be processed includes: Copying the image to be processed, and reducing the copied image to be processed according to a preset ratio to generate a first image; Correspondingly, the step of fusing the first image with the image to be processed according to the second preset parameter so that the image to be processed presents a centripetal stretch blur effect includes: enlarging the first image according to a preset ratio; The enlarged first image is fused with the image to be processed according to a second preset parameter, so that the image to be processed presents a centripetal stretching blur effect.

8. An image processing device, characterized in that: include: The acquisition module is used to obtain the image to be processed of the current frame after the game scene rendering is completed; A generating module, configured to generate a first image based on the image to be processed; A processing module, configured to perform a blur operation on the first image according to first preset parameters; wherein the first preset parameters include a central texture point and an image stretching strength; A fusion module is used to fuse the first image with the image to be processed according to a second preset parameter so that the image to be processed presents a centripetal stretch blur effect; wherein the second preset parameter includes image fusion strength.

9. An electronic device, characterized in that: include: A processor and a memory, the processor and the memory being connected; The memory is used to store programs; The processor is configured to run a program stored in the memory to execute the method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Method and system for enhancement processing of beautified image and shooting terminal

    CN105023252A

  • Image processing method and device, storage medium and processor

    CN108305228A

  • A method and apparatus for generating portrait beard

    CN109410121A

  • Image processing apparatus and method of the same

    JP2012048579A

  • Portable pet scanner for imaging of a portion of the body

    US20120068076A1