Image processing method and device

By displaying the blur parameter setting interface in image processing, determining the weight attenuation coefficient and radial blur center, performing radial blur sampling, and calculating the weight coefficient and color value of the sampling points, the problem of weak adjustability of radial blur processing is solved, and flexible adjustment of the radial light effect is achieved.

CN121169745APending Publication Date: 2025-12-19BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410797252.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

The adjustableness of radial blur processing in existing technologies is weak, making it difficult to meet the flexible adjustment requirements of the radial light effect in editing scenes.

Method used

An image processing method is provided, which displays a blur parameter setting interface, determines the weight attenuation coefficient and radial blur center according to user operation, performs radial blur sampling, calculates the weight coefficient and color value of the sampling point, generates radial blur color value, realizes the radial blur color value of pixel, generates radial blur color value, generates radial blur color value, generates radial blur color value, generates radial blur color value, generates radial blur color value, and obtains the radial light effect image corresponding to the initial image.

Benefits of technology

It expands the adjustability of radial blur processing, meeting the flexible adjustment needs of editing scenes for radial light effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169745A_ABST
    Figure CN121169745A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method and device, and relates to the technical field of image processing. Comprises: displaying a fuzzy parameter setting interface; determining a weight attenuation coefficient and a radial fuzzy center of the initial image according to an operation of a user in the fuzzy parameter setting interface; performing radial fuzzy sampling on the first pixel point according to the radial fuzzy center to obtain a color value of at least one sampling point; the first pixel point is any pixel point; determining and acquiring the weight coefficient of each sampling point according to the initial weight coefficient and the weight attenuation coefficient; obtaining a radial fuzzy color value of the first pixel point according to the weight coefficient of each sampling point and the color value of each sampling point; and assigning the first pixel point as a radial fuzzy color value corresponding to the first pixel point. The embodiment of the invention is used for expanding the adjustability of radial fuzzy processing so as to meet the requirement of the editing scene for flexible adjustment of the radiation light effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image processing method and apparatus. Background Technology

[0002] The radiating effect in an image is a visual presentation effect, specifically the effect produced by light rays or beams radiating outward from a specific center point of an image. Because it can give an image a clear center point and add vitality and dynamism, it has been widely used in poster design, logo design, user interface design, game development, and film and television special effects.

[0003] Radial light effects in images are generally achieved by applying radial blur. However, the adjustability of radial blur is currently very limited, making it difficult to meet the flexible adjustment requirements of editing scenarios for radial light effects. Summary of the Invention

[0004] In view of this, embodiments of this application provide an image processing method and apparatus for expanding the adjustability of radial blur processing, thereby meeting the need for flexible adjustment of radial light effects in editing scenes.

[0005] To achieve the above objectives, the technical solutions provided in this application are as follows:

[0006] In a first aspect, embodiments of this application provide an image processing method, including:

[0007] Displays a fuzzy parameter setting interface;

[0008] Based on the user's operation in the blur parameter setting interface, determine the weight attenuation coefficient and the radial blur center of the initial image;

[0009] Radial blur sampling is performed on the first pixel based on the radial blur center to obtain the color value of at least one sampling point; the first pixel is any pixel of the initial image;

[0010] The weight coefficients of each sampling point are obtained based on the initial weight coefficients and the weight decay coefficients.

[0011] The radial blur color value of the first pixel is obtained based on the weight coefficient of each sampling point and the color value of each sampling point;

[0012] The first pixel is assigned the radial blur color value of the first pixel.

[0013] As an optional implementation of this application, obtaining the weight coefficients of each sampling point based on the initial weight coefficients and the weight decay coefficients includes:

[0014] The weighting coefficient for each sampling point is calculated using the following formula:

[0015] w i =w0*D i-1

[0016] Among them, w i Let w0 be the weight coefficient for the i-th sampling point, w0 be the initial weight coefficient, and D be the weight decay coefficient.

[0017] As an optional implementation of this application, obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color values ​​of each sampling point includes:

[0018] Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point;

[0019] Sum the weighted color values ​​of each sampling point to obtain the total color value;

[0020] Sum the weight coefficients of each sampling point to obtain the total weight coefficient;

[0021] Calculate the ratio of the total color value to the total weight coefficient to obtain the radial blur color value of the first pixel.

[0022] As an optional implementation of this application, the method further includes: determining a nonlinear adjustment parameter based on the user's operation in the fuzzy parameter setting interface;

[0023] The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes:

[0024] Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point;

[0025] Sum the weighted color values ​​of each sampling point to obtain the total color value;

[0026] Sum the weight coefficients of each sampling point to obtain the total weight coefficient;

[0027] Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value;

[0028] The nonlinear adjustment parameter of the first color value is raised to a power that determines the radial blur color value of the first pixel.

[0029] As an optional implementation of this application, the method further includes: determining nonlinear adjustment parameters and scale parameters based on the user's operation in the fuzzy parameter setting interface;

[0030] The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes:

[0031] Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point;

[0032] Sum the weighted color values ​​of each sampling point to obtain the total color value;

[0033] Sum the weight coefficients of each sampling point to obtain the total weight coefficient;

[0034] Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value;

[0035] Calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value;

[0036] The product of the second color value and the scale parameter is determined as the radial blur color value of the first pixel.

[0037] As an optional implementation of this application, the method further includes: determining nonlinear adjustment parameters, scale parameters, and offset parameters based on the user's operation in the fuzzy parameter setting interface;

[0038] The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes:

[0039] Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point;

[0040] Sum the weighted color values ​​of each sampling point to obtain the total color value;

[0041] Sum the weight coefficients of each sampling point to obtain the total weight coefficient;

[0042] Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value;

[0043] Calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value;

[0044] Calculate the product of the second color value and the scale parameter to obtain the third color value;

[0045] The sum of the third color value and the offset parameter is determined as the radial blur color value of the first pixel.

[0046] As an optional implementation of this application, the method further includes: determining the scale parameter based on the user's operation in the fuzzy parameter setting interface;

[0047] The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes:

[0048] Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point;

[0049] Sum the weighted color values ​​of each sampling point to obtain the total color value;

[0050] Sum the weight coefficients of each sampling point to obtain the total weight coefficient;

[0051] Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value;

[0052] The product of the first color value and the scale parameter is determined as the radial blur color value of the first pixel.

[0053] As an optional implementation of this application, the method further includes:

[0054] Obtain the radially blurred image corresponding to the initial image, and assign one pixel in the radially blurred image corresponding to the initial image the corresponding radially blurred color value;

[0055] The radially blurred image corresponding to the initial image is superimposed and fused with the initial image to obtain the radial light effect image corresponding to the initial image.

[0056] Secondly, embodiments of this application provide an image processing apparatus, including:

[0057] The display unit is used to display the fuzzy parameter setting interface;

[0058] The determining unit is used to determine the weight attenuation coefficient and the radial blur center of the initial image based on the user's operation in the blur parameter setting interface.

[0059] A sampling unit is used to perform radial blur sampling on a first pixel based on the radial blur center to obtain the color value of at least one sampling point; the first pixel is any pixel of the initial image;

[0060] The processing unit obtains the weight coefficients of each sampling point based on the initial weight coefficients and the weight decay coefficients.

[0061] The blur unit is used to obtain the radial blur color value of the first pixel based on the weight coefficient of each sampling point and the color value of each sampling point;

[0062] The generation unit is used to assign the radial blur color value of the first pixel to the first pixel.

[0063] As an optional implementation of this application, the processing unit is specifically used to calculate the weight coefficient of each sampling point using the following formula:

[0064] w i =w0*D i-1

[0065] Among them, w i Let w0 be the weight coefficient for the i-th sampling point, w0 be the initial weight coefficient, and D be the weight decay coefficient.

[0066] As an optional implementation of this application, the blurring unit is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; and calculate the ratio of the total color value to the total weight coefficient to obtain the radial blurring color value of the first pixel.

[0067] As an optional implementation of this application, the determining unit is further configured to determine the nonlinear adjustment parameter based on the user's operation in the fuzzy parameter setting interface;

[0068] The fuzzing unit is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; and determine the radial fuzzy color value of the first pixel by powering the nonlinear adjustment parameter of the first color value.

[0069] As an optional implementation of this application, the determining unit is further configured to determine the nonlinear adjustment parameter and the scale parameter based on the user's operation in the fuzzy parameter setting interface.

[0070] The fuzzing unit is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value; and determine the product of the second color value and the scale parameter as the radial fuzzy color value of the first pixel.

[0071] As an optional implementation of this application, the determining unit is further configured to determine the nonlinear adjustment parameter, the scale parameter, and the offset parameter based on the user's operation in the fuzzy parameter setting interface.

[0072] The blurring unit is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value; calculate the product of the second color value and the scale parameter to obtain the third color value; and determine the sum of the third color value and the offset parameter as the radial blur color value of the first pixel.

[0073] As an optional implementation of this application, the determining unit is further configured to determine the scale parameter based on the user's operation in the fuzzy parameter setting interface;

[0074] The blurring unit is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; and determine the product of the first color value and the scale parameter as the radial blur color value of the first pixel.

[0075] As an optional implementation of this application, the generating unit is further configured to obtain a radially blurred image corresponding to the initial image, wherein one pixel in the radially blurred image corresponding to the initial image is assigned a corresponding radially blurred color value; and to superimpose and fuse the radially blurred image corresponding to the initial image and the initial image to obtain a radial light effect image corresponding to the initial image.

[0076] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program and the processor is used to cause the electronic device to implement the image processing method described in any of the above embodiments when executing the computer program.

[0077] Fourthly, embodiments of this application provide a computer-readable storage medium that, when executed by a computing device, causes the computing device to implement the image processing method described in any of the above embodiments.

[0078] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, enables the computer to implement the image processing method described in any of the above embodiments.

[0079] The image processing method provided in this application first displays a blur parameter setting interface, and determines the weight attenuation coefficient and the radial blur center of the initial image based on the user's operation in the blur parameter setting interface. Then, it performs radial blur sampling on the first pixel based on the radial blur center to obtain the color value of at least one sampling point. Furthermore, it obtains the weight coefficients of each sampling point based on the initial weight coefficient and the weight attenuation coefficient. Finally, it obtains the radial blur color value of the first pixel based on the weight coefficients and color values ​​of each sampling point, and then assigns the first pixel the radial blur color value. Since the image processing method provided in this application allows users to set the weight attenuation coefficient and radial blur center in the blur parameter settings, and can perform radial blur processing on the initial image based on the weight attenuation coefficient and radial blur center set by the user, this application can expand the adjustability of radial blur processing, thereby meeting the need for flexible adjustment of the shape of radial light effects in editing scenes. Attached Figure Description

[0080] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0081] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings that need to be called in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0082] Figure 1 A flowchart illustrating the steps of the image processing method provided in this application embodiment;

[0083] Figure 2One of the schematic diagrams of the fuzzy parameter setting interface provided in the embodiments of this application;

[0084] Figure 3 A second schematic diagram of the fuzzy parameter setting interface provided in the embodiments of this application;

[0085] Figure 4 A third schematic diagram of the fuzzy parameter setting interface provided in the embodiments of this application;

[0086] Figure 5 Fourth schematic diagram of the fuzzy parameter setting interface provided in the embodiments of this application;

[0087] Figure 6 This is a schematic diagram of the structure of the image processing apparatus provided in the embodiments of this application;

[0088] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0089] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0090] Many specific details are set forth in the following description in order to provide a full understanding of this application, but this application may also be implemented in other ways different from those described herein. Obviously, the embodiments in the specification are only some embodiments of this application, and not all embodiments.

[0091] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Furthermore, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0092] The image processing method provided in this application can be executed by an image processing device, which includes, but is not limited to, mobile phones, tablets, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smartwatches, smart bracelets, and other terminal devices.

[0093] This application provides an image processing method, referring to... Figure 1 As shown, the image processing method includes the following steps:

[0094] S101. Display the fuzzy parameter setting interface.

[0095] The blur parameter setting interface in this embodiment refers to the interface provided by the image processing device for setting or adjusting blur parameters. The blur parameter setting interface may include controls for adjusting at least one of the following: weight attenuation coefficient, radial blur center, blur radius, nonlinear adjustment parameter, scale parameter, and offset parameter.

[0096] For example, refer to Figure 2 As shown, Figure 2 The fuzzy parameter setting interface 200 includes a first control 201 for setting the weight attenuation coefficient and a second control 202 for selecting the radial fuzzy center. Users can operate the first control 201 to set the weight attenuation coefficient and the second control 202 to select the radial fuzzy center.

[0097] S102. Based on the user's operation in the blur parameter setting interface, determine the weight attenuation coefficient and the radial blur center of the initial image.

[0098] In this embodiment, the weight decay coefficient is the ratio of the weight coefficient of the next sampling point to the weight coefficient of the current sampling point, and the radial blur center is the center position of the blur effect after radial blurring of the image.

[0099] In some embodiments, the fuzzy parameter setting interface includes a weight attenuation coefficient input box for inputting weight attenuation coefficients. Determining the weight attenuation coefficient based on the user's operation in the fuzzy parameter setting interface includes: receiving the weight attenuation coefficient input by the user in the weight attenuation coefficient input box.

[0100] In some implementations, the blur parameter setting interface includes a preview image of the initial image. Determining the radial blur center of the initial image based on the user's operation in the blur parameter setting interface includes: receiving a click operation input by the user in the preview image of the initial image, and determining the click position of the click operation as the radial blur center of the initial image.

[0101] S103. Perform radial blur sampling on the first pixel based on the radial blur center to obtain the color value of at least one sampling point.

[0102] Wherein, the first pixel is any pixel of the initial image.

[0103] In some embodiments, radial blur sampling of the first pixel based on the radial blur center includes: determining the line connecting the radial blur center and the first pixel, and sampling along the line connecting the radial blur center and the first pixel.

[0104] In some embodiments, the sampling step size can be determined based on the length of the line connecting the radial blur center and the first pixel and the preset number of sampling points. Starting from the first pixel or the radial blur center, sampling is performed along the line connecting the radial blur center and the first pixel based on the sampling step size, thereby determining at least one sampling point and obtaining the color value of at least one sampling point.

[0105] S104. Obtain the weight coefficient of each sampling point based on the initial weight coefficient and the weight decay coefficient.

[0106] In some embodiments, obtaining the weight coefficients of each sampling point based on the initial weight coefficients and the weight decay coefficients includes:

[0107] The weighting coefficient for each sampling point is calculated using the following formula:

[0108] w i =w0*D i-1

[0109] Among them, w i Let w0 be the weight coefficient for the i-th sampling point, w0 be the initial weight coefficient, and D be the weight decay coefficient.

[0110] For example, if the initial weight coefficient is 1 and the weight decay coefficient is 0.98, then the weight coefficient of the third sampling point is 0.98. 2 .

[0111] S105. Obtain the radial blur color value of the first pixel based on the weight coefficient of each sampling point and the color value of each sampling point.

[0112] In some embodiments, the radial blur color value of the first pixel is obtained based on the weight coefficients of each sampling point and the color value of each sampling point, including the following steps a to d:

[0113] Step a: Calculate the product of the weight coefficient and the color value of each sampling point to obtain the weight color value of the sampling point.

[0114] Let w represent the weight coefficient of the i-th sampling point. i The i-th sampling point is represented by the color value I. i The weighted color value of the i-th sampling point is represented as Then we have:

[0115]

[0116] Step b: Sum the weighted color values ​​of each sampling point to obtain the total color value.

[0117] The total color value is represented as I. A Then we have:

[0118]

[0119] Step c: Sum the weight coefficients of each sampling point to obtain the total weight coefficient.

[0120] Let the total weight coefficient be w. A Then we have:

[0121]

[0122] Step d: Calculate the ratio of the total color value to the total weight coefficient to obtain the radial blur color value of the first pixel.

[0123] Let the radial blur color value of the first pixel be represented as I. B Then we have:

[0124]

[0125] S106. Assign the radial blur color value of the first pixel to the first pixel.

[0126] In some embodiments, each pixel in the initial image can be traversed and the above steps S103 to S105 can be executed to obtain the radial blur color value of each pixel in the initial image. Then, the color value of each pixel in the initial image is assigned to the corresponding radial blur color value to generate the radial blur image corresponding to the initial image.

[0127] In other embodiments, the pixels in the initial image that meet the preset conditions can be traversed, and the above steps S103 to S105 can be executed to obtain the radial blur color values ​​of the pixels in the initial image that meet the preset conditions. Then, the color values ​​of the pixels that meet the preset conditions are assigned as the corresponding radial blur color values ​​to generate the radial blur image corresponding to the initial image.

[0128] For example, the preset pixel can be a pixel of a specified object in the initial image or a pixel within a specified range.

[0129] The image processing method provided in this application first displays a blur parameter setting interface, and determines the weight attenuation coefficient and the radial blur center of the initial image based on the user's operation in the blur parameter setting interface. Then, it performs radial blur sampling on the first pixel based on the radial blur center to obtain the color value of at least one sampling point. Furthermore, it obtains the weight coefficients of each sampling point based on the initial weight coefficient and the weight attenuation coefficient. Finally, it obtains the radial blur color value of the first pixel based on the weight coefficients and color values ​​of each sampling point, and then assigns the first pixel the radial blur color value. Since the image processing method provided in this application allows users to set the weight attenuation coefficient and radial blur center in the blur parameter settings, and can perform radial blur processing on the initial image based on the weight attenuation coefficient and radial blur center set by the user, this application can expand the adjustability of radial blur processing, thereby meeting the need for flexible adjustment of the shape of radial light effects in editing scenes.

[0130] In some embodiments, the image processing method described above further includes: determining a nonlinear adjustment parameter based on the user's operation in the blur parameter setting interface.

[0131] For example, refer to Figure 3 As shown, Figure 2 Based on the fuzzy parameter setting interface shown, the fuzzy parameter setting interface 200 also includes a third control 203 for setting nonlinear adjustment parameters. Users can operate the third control 203 to set the weight attenuation coefficient.

[0132] Step S105 above (obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point) includes the following steps 1 to 5:

[0133] Step 1: Calculate the product of the weight coefficient and the color value of each sampling point to obtain the weight color value of the sampling point.

[0134] Step 2: Sum the weighted color values ​​of each sampling point to obtain the total color value.

[0135] Step 3: Sum the weight coefficients of each sampling point to obtain the total weight coefficient.

[0136] Step 4: Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value.

[0137] The implementation methods of steps 1 to 4 above can refer to the implementation methods of steps a to d above. The only difference is that the calculation results of steps 1 to 4 are directly used as the radial blur color value of the first pixel, while the calculation results of steps a to d need to be processed by nonlinear adjustment parameters before they can be used as the radial blur color value of the first pixel.

[0138] Step 5: Determine the radial blur color value of the first pixel by exponentiation of the nonlinear adjustment parameter of the first color value.

[0139] Let the radial blur color value of the first pixel be represented as I. B The first color value is represented as I. 1 If the nonlinear adjustment parameter is denoted as gamma, then:

[0140]

[0141] Since the above embodiments also determine the nonlinear adjustment parameters based on the user's operation in the blur parameter setting interface, and perform nonlinear adjustment on the radial blur color value through the nonlinear adjustment parameters, the above embodiments can more easily make targeted adjustments to a part of the color range of the image, thereby making the radial blur effect more harmonious.

[0142] In some embodiments, the image processing method described above further includes: determining nonlinear adjustment parameters and scale parameters based on the user's operation in the blur parameter setting interface.

[0143] For example, refer to Figure 4 As shown, Figure 2 Based on the fuzzy parameter setting interface shown, the fuzzy parameter setting interface 200 further includes a third control 203 for setting nonlinear adjustment parameters and a fourth control 204 for setting scale parameters. Users can operate the third control 203 to set nonlinear adjustment parameters and the fourth control 204 to set scale parameters.

[0144] Step S105 above (obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point) includes the following steps ① to ⑥:

[0145] Step 1: Calculate the product of the weight coefficient and the color value of each sampling point to obtain the weight color value of the sampling point.

[0146] Step 2: Sum the weighted color values ​​of each sampling point to obtain the total color value.

[0147] Step 3: Sum the weight coefficients of each sampling point to obtain the total weight coefficient.

[0148] Step 4: Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value.

[0149] Step 5: Calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value.

[0150] The implementation methods of steps ① to ⑤ above can refer to the implementation methods of steps 1 to 5 above. The only difference is that the calculation results of steps 1 to 5 will be directly used as the radial blur color value of the first pixel, while the calculation results of steps ① to ⑤ need to be processed by the scale parameter before they can be used as the radial blur color value of the first pixel.

[0151] Step 6: The product of the second color value and the scale parameter is determined as the radial blur color value of the first pixel.

[0152] Let the radial blur color value of the first pixel be represented as I. B The first color value is represented as I. 1 The second color value is represented as I. 2 Let the nonlinear adjustment parameter be denoted as gamma and the scaling parameter as scale, then we have:

[0153]

[0154] In some embodiments, the image processing method described above further includes: determining nonlinear adjustment parameters, scale parameters, and offset parameters based on the user's operation in the blur parameter setting interface.

[0155] For example, refer to Figure 5 As shown, Figure 2 Based on the fuzzy parameter setting interface shown, the fuzzy parameter setting interface 200 further includes a third control 203 for setting nonlinear adjustment parameters, a fourth control 204 for setting scale parameters, and a fifth control 205 for setting offset parameters. Users can operate the third control 203 to set nonlinear adjustment parameters, the fourth control 204 to set scale parameters, and the fifth control 205 to set offset parameters.

[0156] Step S105 above (obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point) includes the following steps (1) to (7):

[0157] Step (1): Calculate the product of the weight coefficient and the color value of each sampling point to obtain the weight color value of the sampling point.

[0158] Step 2: Sum the weighted color values ​​of each sampling point to obtain the total color value.

[0159] Step 3: Sum the weight coefficients of each sampling point to obtain the total weight coefficient.

[0160] Step 4: Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value.

[0161] Step 5: Calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value.

[0162] Step 6: Calculate the product of the second color value and the scale parameter to obtain the third color value.

[0163] The implementation methods of steps (1) to (6) above can refer to the implementation methods of steps (1) to (6) above. The only difference is that the calculation results of steps (1) to (6) will be directly used as the radial blur color value of the first pixel, while the calculation results of steps (1) to (6) need to be processed by the offset parameter before they can be used as the radial blur color value of the first pixel.

[0164] Step 7: The sum of the third color value and the offset parameter is determined as the radial blur color value of the first pixel.

[0165] Let the radial blur color value of the first pixel be represented as I. B The first color value is represented as I. 1 The second color value is represented as I. 2 The third color value is represented as I. 3 Let the nonlinear adjustment parameter be denoted as gamma, the scale parameter as scale, and the offset parameter as offset. Then we have:

[0166]

[0167] In some embodiments, the image processing method described above further includes: determining a scale parameter based on the user's operation in the blur parameter setting interface.

[0168] Step S105 above (obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point) includes the following steps I, II, III, IV to V:

[0169] Step 1: Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point.

[0170] Step II: Sum the weighted color values ​​of each sampling point to obtain the total color value.

[0171] Step III: Sum the weight coefficients of each sampling point to obtain the total weight coefficient.

[0172] Step IV: Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value.

[0173] The implementation methods of steps 1 to 4 above can refer to the implementation methods of steps a to d above. The only difference is that the calculation results of steps 1 to 4 are directly used as the radial blur color value of the first pixel, while the calculation results of steps a to d need to be processed by the scale parameter before they can be used as the radial blur color value of the first pixel.

[0174] Step V: The product of the first color value and the scale parameter is determined as the radial blur color value of the first pixel.

[0175] Let the radial blur color value of the first pixel be represented as I. B The first color value is represented as I. 1 If the scale parameter is denoted as sclae, then:

[0176]

[0177] In some embodiments, the image processing method provided in the above embodiments further includes: obtaining a radially blurred image corresponding to the initial image, wherein one pixel in the radially blurred image corresponding to the initial image is assigned a corresponding radially blurred color value;

[0178] The radially blurred image corresponding to the initial image is superimposed and fused with the initial image to obtain the radial light effect image corresponding to the initial image.

[0179] For example, the radially blurred image corresponding to the initial image and the initial image are superimposed and fused to obtain the radial light effect image corresponding to the initial image. This can be achieved by weighting the pixel values ​​of pixels with the same pixel coordinates in the radially blurred image and the initial image according to a preset weight, so as to obtain the pixel values ​​of the radial light effect image.

[0180] Based on the same inventive concept, as an implementation of the above method, this application also provides an image processing device. This embodiment corresponds to the aforementioned method embodiment. For ease of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the image processing device in this embodiment can implement all the contents of the aforementioned method embodiment.

[0181] This application provides an image processing apparatus. Figure 6 This is a schematic diagram of the image processing device, as shown below. Figure 6 As shown, the image processing apparatus 600 includes:

[0182] Display unit 61 is used to display the fuzzy parameter setting interface;

[0183] The determining unit 62 is used to determine the weight attenuation coefficient and the radial blur center of the initial image based on the user's operation in the blur parameter setting interface.

[0184] The sampling unit 63 is used to sample along the line connecting the radial blur center and the first pixel of the initial image to obtain the color value of at least one sampling point; the first pixel is any pixel of the initial image.

[0185] Processing unit 64 obtains the weight coefficient of each sampling point based on the initial weight coefficient and the weight decay coefficient;

[0186] The blurring unit 65 is used to obtain the radial blurring color value of the first pixel based on the weight coefficient of each sampling point and the color value of each sampling point;

[0187] The generation unit 66 is used to assign the color value of each pixel of the initial image to the corresponding radial blur color value to generate a radial blur image corresponding to the initial image.

[0188] As an optional implementation of this application, the processing unit 64 is specifically used to calculate the weight coefficient of each sampling point using the following formula:

[0189] w i =w0*D i-1

[0190] Among them, w i Let w0 be the weight coefficient for the i-th sampling point, w0 be the initial weight coefficient, and D be the weight decay coefficient.

[0191] As an optional implementation of this application, the blurring unit 65 is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; and calculate the ratio of the total color value to the total weight coefficient to obtain the radial blur color value of the first pixel.

[0192] As an optional implementation of this application, the determining unit 62 is further configured to determine the nonlinear adjustment parameter based on the user's operation in the fuzzy parameter setting interface;

[0193] The fuzzing unit 65 is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; and determine the radial fuzzy color value of the first pixel by powering the nonlinear adjustment parameter of the first color value.

[0194] As an optional implementation of this application, the determining unit 62 is further configured to determine the nonlinear adjustment parameter and the scale parameter based on the user's operation in the fuzzy parameter setting interface.

[0195] The fuzzing unit 65 is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value; and determine the product of the second color value and the scale parameter as the radial fuzzy color value of the first pixel.

[0196] As an optional implementation of this application, the determining unit 62 is further configured to determine the nonlinear adjustment parameter, the scale parameter, and the offset parameter based on the user's operation in the fuzzy parameter setting interface.

[0197] The blurring unit 65 is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value; calculate the product of the second color value and the scale parameter to obtain the third color value; and determine the sum of the third color value and the offset parameter as the radial blur color value of the first pixel.

[0198] As an optional implementation of this application, the determining unit 62 is further configured to determine the scale parameter based on the user's operation in the fuzzy parameter setting interface;

[0199] The blurring unit 65 is specifically used to calculate the product of the weight coefficient and the color value of each sampling point to obtain the weighted color value of the sampling point; sum the weighted color values ​​of each sampling point to obtain the total color value; sum the weight coefficients of each sampling point to obtain the total weight coefficient; calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; and determine the product of the first color value and the scale parameter as the radial blur color value of the first pixel.

[0200] As an optional implementation of this application, the generation unit 66 is further configured to obtain a radially blurred image corresponding to the initial image, wherein one pixel in the radially blurred image corresponding to the initial image is assigned a corresponding radially blurred color value; and to superimpose and fuse the radially blurred image corresponding to the initial image and the initial image to obtain a radial light effect image corresponding to the initial image.

[0201] The image processing apparatus provided in this application embodiment can execute the image processing method provided in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0202] Based on the same inventive concept, embodiments of this application also provide an electronic device. Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 7 As shown, the electronic device provided in this embodiment includes a memory 701 and a processor 702. The memory 701 is used to store a computer program, and the processor 702 is used to execute the image processing method provided in the above embodiment when executing the computer program.

[0203] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the computing device to implement the image processing method provided in the above embodiments.

[0204] Based on the same inventive concept, this application also provides a computer program product that, when run on a computer, enables the computing device to implement the image processing method provided in the above embodiments.

[0205] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.

[0206] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0207] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0208] Computer-readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media can store information using any method or technology; the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include transient computer-readable media, such as modulated data signals and carrier waves.

[0209] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. An image processing method, characterized in that, include: Displays a fuzzy parameter setting interface; Based on the user's operation in the blur parameter setting interface, determine the weight attenuation coefficient and the radial blur center of the initial image; Radial blur sampling is performed on the first pixel based on the radial blur center to obtain the color value of at least one sampling point; the first pixel is any pixel of the initial image; The weight coefficients of each sampling point are obtained based on the initial weight coefficients and the weight decay coefficients. The radial blur color value of the first pixel is obtained based on the weight coefficient of each sampling point and the color value of each sampling point; The first pixel is assigned the radial blur color value of the first pixel.

2. The method according to claim 1, characterized in that, The step of obtaining the weight coefficients for each sampling point based on the initial weight coefficients and the weight decay coefficients includes: The weighting coefficient for each sampling point is calculated using the following formula: w i =0* i-1 Among them, w i Let w0 be the weight coefficient for the i-th sampling point, w0 be the initial weight coefficient, and D be the weight decay coefficient.

3. The method according to claim 1, characterized in that, The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes: Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point; Sum the weighted color values ​​of each sampling point to obtain the total color value; Sum the weight coefficients of each sampling point to obtain the total weight coefficient; Calculate the ratio of the total color value to the total weight coefficient to obtain the radial blur color value of the first pixel.

4. The method according to claim 1, characterized in that, The method further includes: determining nonlinear adjustment parameters based on the user's operation in the fuzzy parameter setting interface; The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes: Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point; Sum the weighted color values ​​of each sampling point to obtain the total color value; Sum the weight coefficients of each sampling point to obtain the total weight coefficient; Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; The nonlinear adjustment parameter of the first color value is raised to a power that determines the radial blur color value of the first pixel.

5. The method according to claim 1, characterized in that, The method further includes: determining nonlinear adjustment parameters and scaling parameters based on the user's operation in the fuzzy parameter setting interface; The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes: Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point; Sum the weighted color values ​​of each sampling point to obtain the total color value; Sum the weight coefficients of each sampling point to obtain the total weight coefficient; Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; Calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value; The product of the second color value and the scale parameter is determined as the radial blur color value of the first pixel.

6. The method according to claim 1, characterized in that, The method further includes: determining nonlinear adjustment parameters, scale parameters, and offset parameters based on the user's operation in the fuzzy parameter setting interface; The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes: Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point; Sum the weighted color values ​​of each sampling point to obtain the total color value; Sum the weight coefficients of each sampling point to obtain the total weight coefficient; Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; Calculate the power of the nonlinear adjustment parameter of the first color value to obtain the second color value; Calculate the product of the second color value and the scale parameter to obtain the third color value; The sum of the third color value and the offset parameter is determined as the radial blur color value of the first pixel.

7. The method according to claim 1, characterized in that, The method further includes: determining the scale parameter based on the user's operation in the fuzzy parameter setting interface; The step of obtaining the radial blur color value of the first pixel based on the weight coefficients of each sampling point and the color value of each sampling point includes: Calculate the product of the weight coefficient and the color value for each sampling point to obtain the weighted color value of the sampling point; Sum the weighted color values ​​of each sampling point to obtain the total color value; Sum the weight coefficients of each sampling point to obtain the total weight coefficient; Calculate the ratio of the total color value to the total weight coefficient to obtain the first color value; The product of the first color value and the scale parameter is determined as the radial blur color value of the first pixel.

8. The method according to any one of claims 1-7, characterized in that, The method further includes: Obtain the radially blurred image corresponding to the initial image, and assign one pixel in the radially blurred image corresponding to the initial image the corresponding radially blurred color value; The radially blurred image corresponding to the initial image is superimposed and fused with the initial image to obtain the radial light effect image corresponding to the initial image.

9. An image processing apparatus, characterized in that, include: The display unit is used to display the fuzzy parameter setting interface; The determining unit is used to determine the weight attenuation coefficient and the radial blur center of the initial image based on the user's operation in the blur parameter setting interface. A sampling unit is used to perform radial blur sampling on a first pixel based on the radial blur center to obtain the color value of at least one sampling point; the first pixel is any pixel of the initial image; The processing unit obtains the weight coefficients of each sampling point based on the initial weight coefficients and the weight decay coefficients. The blur unit is used to obtain the radial blur color value of the first pixel based on the weight coefficient of each sampling point and the color value of each sampling point; The generation unit is used to assign the value of the first pixel to the radial blur color value of the first pixel.

10. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store a computer program and the processor being used to cause the electronic device to implement the image processing method according to any one of claims 1-8 when executing the computer program.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to implement the image processing method according to any one of claims 1-8.

12. A computer program product, characterized in that, When the computer program product is run on a computer, the computer enables the computer to implement the image processing method according to any one of claims 1-8.