An image processing method, apparatus, device and medium

By performing blur processing and region determination based on the fluid shape image on the density image, the problem of unnatural foam transition in the prior art is solved, and a more natural density transition and better picture display effect is achieved.

CN114170341BActive Publication Date: 2025-06-17BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111509375.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2025-06-17
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

When rendering the foam effect on the fluid surface, the transition part is too tough, and large areas of foam are prone to appear in the center of the wave, which is not in line with expectations.

Method used

By acquiring density images and fluid shape images, blurring density images based on fluid shape images, determining transition areas, fluid areas and ordinary areas in the blurred image, and rendering these areas to generate a target image.

Benefits of technology

This makes the density transition smoother and more natural, avoids large bubbles in the center of the waves, and improves the image display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170341B_ABST
    Figure CN114170341B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to an image processing method, apparatus, device, and medium. The method includes: obtaining a density image and a fluid shape image; performing blurring processing on the density image based on the fluid shape image to obtain a blurred image; determining a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval; and rendering the transition region, the fluid region, and the normal region to generate a target image. By adopting the above technical solution, the blurring processing of the density image is assisted by the fluid shape image, so that the density transition in the blurred image is smoother and more natural, and the image display effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, device, and medium. Background Art

[0002] Currently, there are more and more application scenarios where two-dimensional fluid particles are used to render the fluid surface. Generally, the density of the fluid does not gradually change uniformly from the inside to the outside of the fluid. There is a very small gradual change in the particle density inside the fluid, while a relatively obvious large numerical jump occurs when reaching the edge part of the fluid.

[0003] In related technologies, the density of fluid particles is directly used to render the foam effect on the fluid surface, so it is easy to make the transition between the foam and the ordinary fluid very hard. At the same time, in the part where large waves are splashing, large areas of foam appear in the center of the waves due to the sparse particle density, which does not meet the expectations. Summary of the Invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, apparatus, device, and medium.

[0005] An embodiment of the present disclosure provides an image processing method, the method including:

[0006] Obtain a density image and a fluid shape image;

[0007] Perform blur processing on the density image based on the fluid shape image to obtain a blurred image;

[0008] Determine a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval;

[0009] Render the transition region, the fluid region, and the normal region to generate a target image.

[0010] An embodiment of the present disclosure further provides an image processing apparatus, the apparatus including:

[0011] A drawing module, configured to obtain a density image and a fluid shape image;

[0012] A blur processing module, configured to perform blur processing on the density image based on the fluid shape image to obtain a blurred image;

[0013] A region determination module, configured to determine a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval;

[0014] A rendering generation module, configured to render the transition region, the fluid region, and the normal region to generate a target image.

[0015] The embodiments of the present disclosure further provide an electronic device, which includes: a processor; a memory for storing executable instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the image processing method provided by the embodiments of the present disclosure.

[0016] The embodiments of the present disclosure further provide a computer-readable storage medium, which stores a computer program for executing the image processing method provided by the embodiments of the present disclosure.

[0017] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art: The image processing solution provided by the embodiments of the present disclosure obtains a density image and a fluid shape image, blurs the density image based on the fluid shape image to obtain a blurred image, determines a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval, and finally renders the transition region, the fluid region, and the normal region to generate a target image. By adopting the above technical solution, the blurring process of the density image is assisted by the fluid shape image, making the density transition in the blurred image smoother and more natural, and improving the image display effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale.

[0019] Figure 1a It is an exemplary diagram of rendering a fluid surface with two-dimensional fluid particles provided by the embodiments of the present disclosure;

[0020] Figure 1b It is an exemplary diagram of rendering a foam effect on a fluid surface provided by the embodiments of the present disclosure;

[0021] Figure 2 It is a schematic flowchart of an image processing method provided by the embodiments of the present disclosure;

[0022] Figure 3 It is a schematic flowchart of another image processing method provided by the embodiments of the present disclosure;

[0023] Figure 4a It is a schematic diagram of a fluid particle provided by the embodiments of the present disclosure;

[0024] Figure 4b It is a schematic diagram of a density image provided by the embodiments of the present disclosure;

[0025] Figure 4c Schematic diagram of a fluid shape image provided by an embodiment of the present disclosure;

[0026] Figure 5a Schematic diagram of a blurred image provided by an embodiment of the present disclosure;

[0027] Figure 5b Schematic diagram of a transition region, a fluid region, and a normal region provided by an embodiment of the present disclosure;

[0028] Figure 6 Schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;

[0029] Figure 7 Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0030] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0031] It should be understood that the steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0032] As used herein, the term "including" and its variants are open-ended, i.e., "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules, or units, and are not used to limit the order of the functions executed by these devices, modules, or units or their interdependent relationships.

[0034] It should be noted that the modifications of "one" and "plural" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are for illustrative purposes only and are not used to limit the scope of these messages or information.

[0036] In practical applications, directly using the density of fluid particles to render the foam effect on the fluid surface makes it easy to make the transition between the foam and the ordinary fluid very hard. For example, Figure 1a the boundary between the transition region A, the fluid region B, and the ordinary region C is obvious, and the picture display effect is relatively poor. At the same time, in the part where large waves splash, due to the sparse particle density, large areas of foam appear in the center of the waves. For example, Figure 1b as shown, it does not meet the expectations.

[0037] To address the above problems, the present disclosure proposes an image processing method, which includes obtaining a density image and a fluid shape image; performing blurring processing on the density image based on the fluid shape image to obtain a blurred image; determining the transition region, the fluid region, and the ordinary region in the blurred image based on a preset density threshold interval; and rendering the transition region, the fluid region, and the ordinary region to generate a target image.

[0038] Thus, by using the fluid shape image to assist in the blurring processing of the density image, the density transition in the blurred image becomes smoother and more natural, and when the fluid splashes with large waves, the particle density does not become sparse, avoiding the appearance of large areas of foam, meeting the user's usage requirements, and improving the picture display effect.

[0039] Figure 2 FIG. is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure. This method can be executed by an image processing device, where the device can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 2 shown, this method includes:

[0040] Step 101, obtain a density image and a fluid shape image.

[0041] Among them, the density image refers to an image formed by superimposing multiple fluid particles of different sizes, and the fluid shape image refers to an image that can represent which regions in the image have fluid and which regions do not have fluid, that is, an image that can directly determine the fluid region. Among them, the density image and the fluid shape image can be two separate images respectively, or can be in different channels of the same image. For example, the density image is in the R (Red) channel of Image 1, and the flow shape image is in the G (Green) channel of Image 1; among them, the density values of the same pixel point in the density image and the fluid shape image are different.

[0042] In some embodiments, obtaining the density image and the fluid shape image includes: obtaining the density image and the fluid shape image according to a preset drawing algorithm and the drawing data corresponding to the drawing algorithm.

[0043] In other embodiments, obtaining the density image and the fluid shape image includes: respectively setting different image generation parameters according to a preset image generation model and inputting the image generation model to generate the density image and the fluid shape image.

[0044] The above two ways of obtaining the density image and the fluid shape image are only examples, and the present disclosure does not specifically limit the ways of obtaining the density image and the fluid shape image.

[0045] It should be noted that the sizes of the density image and the fluid shape image may not be exactly the same. The overall shape of the fluid is determined by the fluid shape image, and the part of the density image that exceeds the fluid shape image may not be rendered.

[0046] Step 102: Blur the density image based on the fluid shape image to obtain a blurred image.

[0047] Among them, blurring processing refers to smoothing the density value of each pixel point in the density image, thereby generating a blurred effect on the density image, losing details at the middle points, and obtaining a blurred image. In the embodiments of the present disclosure, the blurring processing may include one or more of mean blurring processing, Gaussian blurring processing, etc., and is specifically set according to application needs.

[0048] In some embodiments, blurring the density image based on the fluid shape image to obtain a blurred image includes: using the pixel points in the fluid shape image as the center points, sampling at the positions of the pixel points corresponding to the center points in the density image to obtain a plurality of pixel points, calculating based on the weight values and density values of the center points and the plurality of pixel points to obtain the blurred value of the center point, and obtaining the blurred image based on the blurred value of each center point.

[0049] In other embodiments, blurring the density image based on the fluid shape image to obtain a blurred image includes: using the pixel points in the fluid shape image as the center points, obtaining a plurality of pixel points in the density image, calculating the average value based on the density values of the center points and the plurality of pixel points to obtain the blurred value of the center point, and obtaining the blurred image based on the blurred value of each center point.

[0050] The above two ways of blurring the density image based on the fluid shape image to obtain a blurred image are only examples, and the present disclosure does not specifically limit the ways of blurring the density image based on the fluid shape image to obtain a blurred image.

[0051] Step 103: Determine the transition region, fluid region, and ordinary region in the blurred image based on a preset density threshold range.

[0052] Step 104: Render the transition region, fluid region, and ordinary region to generate a target image.

[0053] Among them, the preset density threshold range can be selected and set according to the application scenario. The embodiments of the present disclosure do not limit the value of the preset density threshold range, and the preset density threshold range is usually selected between the values of 0.4 - 0.9.

[0054] In the embodiments of the present disclosure, after obtaining the blurred image, determining the transition region, fluid region, and ordinary region in the blurred image based on the preset density threshold range includes: obtaining the maximum density value and the minimum density value in the preset density threshold range, comparing the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively, and obtaining the pixel points whose density value is less than the maximum density value and greater than the minimum density value as the transition region in the blurred image.

[0055] In the embodiments of the present disclosure, after determining the transition region, fluid region, and ordinary region in the blurred image, different color mixtures are set for rendering according to the data corresponding to each region to generate a target image. Thus, in the part of the density image where the density is sparsely and unevenly distributed in the middle, after the density image is blurred based on the fluid shape image, the density of the pixel points in the blurred image is smoother and more natural. Therefore, the transition region determined based on the blurred image is more accurate, and the rendered target image better meets the user's usage requirements, improving the image display effect.

[0056] The image processing solution provided by the embodiments of the present disclosure includes: obtaining a density image and a fluid shape image; blurring the density image based on the fluid shape image to obtain a blurred image; determining the transition region, fluid region, and ordinary region in the blurred image based on a preset density threshold range; and rendering the transition region, fluid region, and ordinary region to generate a target image. By adopting the above technical solution, the blurring process of the density image is assisted by drawing the fluid shape image, making the density transition in the blurred image smoother and more natural. Moreover, when the fluid splashes large waves, the particle density will not become sparse, avoiding the appearance of large areas of foam, meeting the user's usage requirements, and improving the picture display effect.

[0057] In some embodiments, obtaining the density image and the fluid shape image includes: obtaining the density image and the fluid shape image according to a preset drawing algorithm and the drawing data corresponding to the drawing algorithm.

[0058] Among them, different drawing algorithms can be selected for drawing according to the application scenario, and different drawing algorithms correspond to different drawing data, so as to generate corresponding density images and fluid shape images.

[0059] In some embodiments, point plotting is performed according to a preset first plotting algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles. The density values corresponding to the plurality of first fluid particles are superimposed based on the positions of each of the first fluid particles to obtain a density image. Point plotting is performed according to a preset second plotting algorithm and a preset constant value to generate a plurality of second fluid particles. The density values corresponding to the plurality of second fluid particles are superimposed based on the positions of each of the second fluid particles to obtain a fluid shape image.

[0060] Among them, the first plotting algorithm and the second plotting algorithm can be different plotting formulas. For example, the preset plotting formula is R = a × r b , where a and b are adjustable coefficients, r is the radius of the fluid particle, and the present disclosure embodiment does not limit the values of a, b, and r. b is usually selected between the values 2-6.

[0061] Among them, the fluid particle refers to the smallest component of a flowing substance that can exist in a free state; the first fluid particle density value refers to the density value of the first fluid particle used to represent the density of the fluid at the plotting position. The superimposing process means that the density values of different fluid particles can be superimposed when they coincide (at the same position). The denser the fluid particles are, the more they coincide with each other, and thus the original density value of each pixel point in the final density image will be larger. Among them, the preset constant value can be selected and set according to the application scenario, and the present disclosure embodiment does not limit the value of the constant value.

[0062] Among them, the positions of the first fluid particles and the second fluid particles correspond one by one. The positions of the first fluid particles and the second fluid particles can be preset according to the application scenario requirements, so as to determine the fluid area in the target image.

[0063] It can be understood that first fluid particles with different density values can be generated by different first plotting algorithms and different first fluid particle density values.

[0064] In other embodiments, point plotting is performed according to a preset third plotting algorithm and a preset second fluid particle density value to generate a plurality of third fluid particles. The density values corresponding to the plurality of third fluid particles are superimposed based on the positions of each of the third fluid particles, and the image data plotted on the first specified channel of the target image is the density image. Point plotting is performed according to the third plotting algorithm and a preset constant value to generate a plurality of fourth fluid particles. The plurality of fourth fluid particles are superimposed based on the positions of each of the fourth fluid particles, and the image data plotted on the second specified channel of the target image is the fluid shape image.

[0065] Among them, the specified channels refer to the four channels of RGBA (Red, Green, Blue, and Alpha) corresponding to the image format. Thus, the image data corresponding to the density image and the fluid shape image are directly stored in different channels of an image, further improving the processing efficiency and thus enhancing the image display efficiency.

[0066] Figure 3 The flowchart of another image processing method provided by an embodiment of the present disclosure further optimizes the above image processing method on the basis of the above embodiment.

[0067] As Figure 3 shown, the method includes:

[0068] Step 201: Perform point drawing according to a preset first drawing algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles, and perform superposition processing on the density values corresponding to the plurality of first fluid particles based on the positions of each first fluid particle to obtain a density image.

[0069] Step 202: Perform point drawing according to a preset second drawing algorithm and a preset constant value to generate a plurality of second fluid particles, and perform superposition processing on the density values corresponding to the plurality of second fluid particles based on the positions of each second fluid particle to obtain a fluid shape image.

[0070] Among them, the preset first drawing algorithm and the preset second drawing algorithm may be the same or different. The first fluid particles are set according to the first drawing algorithm and the corresponding drawing data. The positions of each first fluid particle in the image to be drawn can be preset, so as to generate corresponding first fluid particles at the set positions. Each first fluid particle will diffuse outward from the center of the circle, and the density value gradually decreases. For example, Figure 4a as shown in the fluid particle example diagram below. Similarly, the radius of the fluid particle is selected and set according to the application scenario, and the present disclosure does not limit this here.

[0071] Among them, when the preset first drawing algorithm remains unchanged, if the preset first fluid particle density values are different, the density values of the drawn first fluid particles are different. When different first fluid particles coincide, the density values of the first fluid particles can be superimposed on each other to generate a density image. For example, Figure 4b shown.

[0072] Similarly, the second fluid particles are set according to the second rendering algorithm and the corresponding rendering data. The positions of each second fluid particle in the image to be rendered can be preset, so as to generate corresponding second fluid particles at the set positions. Each second fluid particle will diffuse from the center outwards with a gradually decreasing density, and the preset constant value remains unchanged. Therefore, when the preset second rendering algorithm remains unchanged, the density values of the rendered second fluid particles are the same, and when different second fluid particles overlap, the density values of the second fluid particles can be superimposed on each other to generate a fluid shape image. For example Figure 4c as shown. That is to say, the density values of each fluid particle in the fluid shape image are the same, only indicating whether there are fluid particles in that area, that is, indicating which areas in the image have fluid and which areas do not have fluid, that is, an image of the fluid area can be directly determined. For example Figure 4c in , the area X is the fluid area, and the density values of each fluid particle in the fluid area are the same.

[0073] Thus, the density image and the fluid shape image can be two separate images respectively, enabling the fluid particles in both the density image and the fluid shape image to use the optimal size, thereby improving the subsequent blurring effect and ultimately enhancing the image display effect.

[0074] Step 203: Use the pixel points in the fluid shape image as the center points, sample at the positions of the pixel points corresponding to the center points in the density image to obtain the target pixel points, calculate based on the weight value and the center density value of the center point, the weight value and the target density value of the target pixel point to obtain the blurring value of the center point, and obtain the blurred image based on the blurring values of each center point.

[0075] It can be understood that some fluid particles in the density image have relatively low density, and if directly rendered, there will be a large area of foam. Therefore, the density values of each fluid particle in the fluid area are the same. Use the pixel points in the fluid shape image as the center points, sample at the positions of the pixel points corresponding to the center points in the density image to obtain the target pixel points, and calculate based on the weight values and density values of the center point and the target pixel point to obtain the blurring value of the center point, and obtain the blurred image based on the blurring values of each center point.

[0076] For example Figure 4b taking the density image of Figure 4c and the fluid shape image of Figure 4c as an example, take each pixel point in the fluid shape image of Figure 4b as the center point and sample it in the density image of Figure 4c in Figure 4b , for example, point A1 in Figure 4c is the pixel point in the fluid shape image as the center point, in Figure 4bThe black pixel points are the pixel points corresponding to the position of A1. Sampling the black pixel points to obtain A2, A3, A4, A5, A6, A7, A8, and A9 as target pixel points. According to the weight value and central density value of A1, and the weight values and target density values of A2, A3, A4, A5, A6, A7, A8, and A9, weighted calculation is performed to obtain the blur value of point A1.

[0077] Among them, the calculation formula can be selected and set according to the application scenario. For example, the blur value of point A1 is:

[0078] ω1×A1 + ω2×A2 + ω3×A3 + ω4×A4 + ω5×A5 + ω6×A6 + ω7×A7 + ω8×A8 + ω9×A9

[0079] Among them, ω1 + ω2 + ω3 + ω4 + ω5 + ω6 + ω7 + ω8 + ω9 = 1.

[0080] Thus, taking Figure 4b the density image shown and Figure 4c the fluid shape image as an example, after blurring processing, the obtained blurred image is as shown in Figure 5a .

[0081] It can be understood that the larger the sampling range, the better the blurring effect. In some embodiments, the pixel point position corresponding to the center point in the density image can be obtained, the diagonal of the pixel point position can be obtained, sampling is performed on the diagonal to obtain target pixel points, and by sampling target pixel points on the diagonal, the sampling range is expanded, thereby saving performance while improving the blurring effect.

[0082] In some embodiments, the original density value corresponding to each target pixel point in the drawn density image may not be limited to the interval [0, 1]. For example, when the density image is stored in any one of the RGB channels, the part greater than 1 and less than 0 will be lost. To further ensure the effect, the original density value corresponding to each target pixel point is calculated with a preset coefficient to obtain the target density value corresponding to each target pixel point, thereby ensuring the blurring effect and improving the subsequent picture display effect.

[0083] Step 204: Obtain the maximum density value and the minimum density value in the preset density threshold interval, and compare the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively.

[0084] In the embodiments of the present disclosure, the preset density threshold interval can be selected and set according to application requirements. The present disclosure does not specifically limit the value range of the preset density threshold interval, and it can generally be set between 0.5 and 0.9. Among them, if the preset density threshold interval is relatively small, the transition region will be relatively narrow; if the preset density threshold interval is relatively large, the transition region will be relatively wide.

[0085] Exemplarily, the preset density threshold interval is [0.5 - 0.8], the maximum density value is 0.8, and the minimum density value is 0.5. The density value of each pixel point in the blurred image is respectively compared with the maximum density value of 0.8 and the minimum density value of 0.5.

[0086] Step 205, set the density value of the pixel points with density values greater than the maximum density value to a first value, set the density value of the pixel points with density values greater than the minimum density value to a second value, and calculate the density value of the pixel points with density values less than the maximum density value and greater than the minimum density value through a preset calculation formula; wherein, the first value is greater than the second value.

[0087] In the embodiments of the present disclosure, the first value and the second value can be selected and set according to application requirements, and the first value is greater than the second value. The present disclosure does not specifically limit the value range of the preset density threshold interval. Generally, the second value is set to 0, and the first value is set between 0.5 and 1.

[0088] Exemplarily, the second value is set to 0, the first value is set to 1. The density value of each pixel point in the blurred image is 0.9, and the density value of this pixel point is set to the first value 1. The density value of each pixel point in the blurred image is 0.2, and the density value of this pixel point is set to the first value 0. The density value of each pixel point in the blurred image is 0.6, and the density value of this pixel point is determined by calculating according to the ratio of 0.6 between the first value and the second value.

[0089] Step 206, obtain the pixel points with density values less than the first value and greater than the second value as the transition region in the blurred image, the pixel points with density values less than the second value as the ordinary region, and the pixel points with density values greater than the first value as the fluid region, and render the transition region, the fluid region, and the ordinary region to generate the target image.

[0090] In the embodiments of the present disclosure, the pixel points with density values less than the first value and greater than the second value are used as the transition region in the blurred image, the pixel points with density values less than the second value are used as the ordinary region, and the pixel points with density values greater than the first value are used as the fluid region. Render the transition region, the fluid region, and the ordinary region to generate the target image. Taking Figure 5a as an example, as Figure 5b shown, the transition region R, the fluid region S, and the ordinary region T can be seenFigure 5b The middle transition region is smoother and more natural, and the image display effect is better.

[0091] Therefore, on the basis of the blurred image, the density values of the fluid particles in the preset density threshold interval are mapped to the range of the first numerical value and the second numerical value, further improving the accuracy of determining the transition region, thereby enhancing the image display effect.

[0092] The image processing solution provided by the embodiments of the present disclosure performs point drawing according to a preset first drawing algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles, superimposes and processes the density values corresponding to the plurality of first fluid particles based on the positions of each first fluid particle to obtain a density image, performs point drawing according to a preset second drawing algorithm and a preset constant value to generate a plurality of second fluid particles, superimposes and processes the density values corresponding to the plurality of second fluid particles based on the positions of each second fluid particle to obtain a fluid shape image, samples at the pixel point position corresponding to the center point in the density image with the pixel point in the fluid shape image as the center point to obtain a target pixel point, calculates the blur value of the center point based on the weight value and the center density value of the center point, the weight value and the target density value of the target pixel point, obtains a blurred image based on the blur value of each center point, obtains the maximum density value and the minimum density value in the preset density threshold interval, compares the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively, sets the density value of the pixel point with the density value greater than the maximum density value to the first numerical value, sets the density value of the pixel point with the density value greater than the minimum density value to the second numerical value, and calculates the density value of the pixel point with the density value less than the maximum density value and greater than the minimum density value through a preset calculation formula; wherein, the first numerical value is greater than the second numerical value, obtains the pixel points with the density value less than the first numerical value and greater than the second numerical value as the transition region in the blurred image, the pixel points with the density value less than the second numerical value as the ordinary region, and the pixel points with the density value greater than the first numerical value as the fluid region, and renders the transition region, the fluid region and the ordinary region to generate a target image. By adopting the above technical solution, the blurred processing of the density image is assisted by drawing the fluid shape image, so that the density transition in the blurred image is smoother and more natural, and the particle density does not become sparse when the fluid splashes up large waves, avoiding the appearance of large bubbles, meeting the user's usage requirements, and enhancing the image display effect.

[0093] Figure 6 It is a schematic structural diagram of an image processing device provided by the embodiments of the present disclosure. The device can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 6 shown, the device includes:

[0094] A drawing module 301, configured to obtain a density image and a fluid shape image.

[0095] The blurring module 302 is configured to blur the density image based on the fluid shape image to obtain a blurred image.

[0096] The determining region module 303 is configured to determine a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval.

[0097] The rendering generation module 304 is configured to render the transition region, the fluid region, and the normal region to generate a target image.

[0098] Optionally, the drawing module 301 is specifically configured to:

[0099] Obtain the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm.

[0100] Optionally, the drawing module 301 is specifically configured to:

[0101] Perform point drawing according to a preset first drawing algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles;

[0102] Perform superposition processing on the density values corresponding to the plurality of first fluid particles based on the positions of each first fluid particle to obtain a density image;

[0103] Perform point drawing according to a preset second drawing algorithm and a preset constant value to generate a plurality of second fluid particles;

[0104] Perform superposition processing on the density values corresponding to the plurality of second fluid particles based on the positions of each second fluid particle to obtain a fluid shape image.

[0105] Optionally, the drawing module 301 is specifically configured to:

[0106] Perform point drawing according to a preset third drawing algorithm and a preset second fluid particle density value to generate a plurality of third fluid particles;

[0107] Perform superposition processing on the density values corresponding to the plurality of third fluid particles based on the positions of each third fluid particle, and draw the image data on the first specified channel of the target image as the density image;

[0108] Perform point drawing according to the third drawing algorithm and a preset constant value to generate a plurality of fourth fluid particles;

[0109] Perform superposition processing on the plurality of fourth fluid particles based on the positions of each fourth fluid particle, and draw the image data on the second specified channel of the target image as the fluid shape image.

[0110] Optionally, the blurring module 302 is specifically configured to:

[0111] Taking the pixel points in the fluid shape image as the center points, sampling at the positions of the pixel points corresponding to the center points in the density image to obtain target pixel points;

[0112] Calculating based on the weight value and the central density value of the center point, and the weight value and the target density value of the target pixel point to obtain the blur value of the center point;

[0113] Based on the blur value of each center point, obtaining a blurred image.

[0114] Optionally, the blurring processing module 302 is further specifically configured to:

[0115] Obtaining the positions of the pixel points corresponding to the center points in the density image;

[0116] Obtaining the diagonal of the pixel point positions, sampling on the diagonal to obtain the target pixel points.

[0117] Optionally, the device further includes an acquisition calculation module, configured to:

[0118] Obtaining the original density value corresponding to each target pixel point in the density image, and calculating the original density value corresponding to each target pixel point with a preset coefficient to obtain the target density value corresponding to each target pixel point.

[0119] Optionally, the determining area module 303 is specifically configured to

[0120] Obtaining the maximum density value and the minimum density value in the preset density threshold interval;

[0121] Comparing the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively;

[0122] Setting the density value of the pixel points whose density value is greater than the maximum density value to a first value, setting the density value of the pixel points whose density value is greater than the minimum density value to a second value, and calculating the density value of the pixel points whose density value is less than the maximum density value and greater than the minimum density value through a preset calculation formula; wherein, the first value is greater than the second value;

[0123] Obtaining the pixel points whose density value is less than the first value and greater than the second value as the transition area in the blurred image, the pixel points whose density value is less than the second value as the ordinary area, and the pixel points whose density value is greater than the first value as the fluid area.

[0124] The image processing device provided by the embodiments of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0125] Embodiments of the present disclosure also provide a computer program product, including computer programs / instructions, which, when executed by a processor, implement the image processing method provided by any embodiment of the present disclosure.

[0126] Figure 7 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. Specifically, refer to Figure 7 , which shows a schematic structural diagram of an electronic device 400 suitable for implementing embodiments of the present disclosure. The electronic device 400 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.

[0127] As Figure 7 shown, the electronic device 400 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 401, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0128] Generally, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or wirelesly to exchange data. Although Figure 7 shows the electronic device 400 having various devices, it should be understood that it is not required to implement or include all the shown devices. More or fewer devices may be implemented or included alternatively.

[0129] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-described functions defined in the image processing method of the embodiments of the present disclosure are performed.

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

[0131] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0132] The above computer-readable medium can be included in the above electronic device; or can exist separately without being assembled into the electronic device.

[0133] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to: during the playback of a video, receive a user's information display trigger operation; obtain at least two target information associated with the video; display a first target information among the at least two target information in an information display area of the video playback page, where the size of the information display area is smaller than the size of the playback page; receive a first switching trigger operation from the user, and switch the first target information displayed in the information display area to a second target information among the at least two target information.

[0134] Computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).

[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0136] The units involved in the embodiments described in the present disclosure can be implemented in software or in hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.

[0137] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0138] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0139] According to one or more embodiments of the present disclosure, the present disclosure provides an image processing method, including:

[0140] Obtaining a density image and a fluid shape image;

[0141] Blur the density image based on the fluid shape image to obtain a blurred image;

[0142] Determine the transition region, fluid region, and normal region in the blurred image based on a preset density threshold interval;

[0143] Render the transition region, fluid region, and normal region to generate a target image.

[0144] According to one or more embodiments of the present disclosure, the obtaining the density image and the fluid shape image includes:

[0145] Obtain the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm.

[0146] According to one or more embodiments of the present disclosure, in the image processing method provided by the present disclosure, the obtaining the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm includes:

[0147] Perform point drawing according to a preset first drawing algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles;

[0148] Perform superposition processing on the density values corresponding to the plurality of first fluid particles based on the position of each first fluid particle to obtain the density image;

[0149] Perform point drawing according to a preset second drawing algorithm and a preset constant value to generate a plurality of second fluid particles;

[0150] Perform superposition processing on the density values corresponding to the plurality of second fluid particles based on the position of each second fluid particle to obtain the fluid shape image.

[0151] According to one or more embodiments of the present disclosure, in the image processing method provided by the present disclosure, the obtaining the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm includes:

[0152] Perform point drawing according to a preset third drawing algorithm and a preset second fluid particle density value to generate a plurality of third fluid particles;

[0153] Perform superposition processing on the density values corresponding to the plurality of third fluid particles based on the position of each third fluid particle, and draw the image data of the first specified channel of the target image as the density image;

[0154] Perform point drawing according to the third drawing algorithm and a preset constant value to generate a plurality of fourth fluid particles;

[0155] Superimpose the multiple fourth fluid particles based on the position of each of the fourth fluid particles, and draw the image data of the second specified channel of the target image as the fluid shape image.

[0156] According to one or more embodiments of the present disclosure, in the image processing method provided by the present disclosure, the blurring the density image based on the fluid shape image to obtain a blurred image includes:

[0157] Taking the pixel point in the fluid shape image as the center point, sampling at the position of the pixel point corresponding to the center point in the density image to obtain a target pixel point;

[0158] Calculating based on the weight value and the central density value of the center point, the weight value and the target density value of the target pixel point to obtain the blurring value of the center point;

[0159] Obtain the blurred image based on the blurring value of each of the center points.

[0160] According to one or more embodiments of the present disclosure, in the image processing method provided by the present disclosure, the sampling at the position of the pixel point corresponding to the center point in the density image to obtain a target pixel point includes:

[0161] Obtain the position of the pixel point corresponding to the center point in the density image;

[0162] Obtain the diagonal line of the pixel point position, and sample on the diagonal line to obtain the target pixel point.

[0163] According to one or more embodiments of the present disclosure, the image processing method provided by the present disclosure further includes:

[0164] Obtain the original density value corresponding to each target pixel point in the density image;

[0165] Calculate the original density value corresponding to each target pixel point with a preset coefficient to obtain the target density value corresponding to each target pixel point.

[0166] According to one or more embodiments of the present disclosure, in the image processing method provided by the present disclosure, the determining the transition region, the fluid region, and the normal region in the blurred image based on a preset density threshold interval includes:

[0167] Obtain the maximum density value and the minimum density value in the preset density threshold interval;

[0168] Compare the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively;

[0169] Set the density value of the pixel points with density values greater than the maximum density value to a first value, set the density value of the pixel points with density values greater than the minimum density value to a second value, and calculate the density value of the pixel points with density values less than the maximum density value and greater than the minimum density value through a pre-designed calculation formula; wherein, the first value is greater than the second value;

[0170] Obtain the pixel points with density values less than the first value and greater than the second value as the transition region in the blurred image, the pixel points with density values less than the second value as the normal region, and the pixel points with density values greater than the first value as the fluid region.

[0171] According to one or more embodiments of the present disclosure, the present disclosure provides an image processing apparatus, including:

[0172] A drawing module, configured to obtain a density image and a fluid shape image;

[0173] A blur processing module, configured to perform blur processing on the density image based on the fluid shape image to obtain a blurred image;

[0174] A region determination module, configured to determine a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval;

[0175] A rendering generation module, configured to render the transition region, the fluid region, and the normal region to generate a target image.

[0176] According to one or more embodiments of the present disclosure, in the image processing apparatus provided by the present disclosure, the drawing module is specifically configured to:

[0177] Obtain the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm.

[0178] According to one or more embodiments of the present disclosure, in the image processing apparatus provided by the present disclosure, the drawing module is specifically configured to:

[0179] Perform point drawing according to a preset first drawing algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles;

[0180] Perform superposition processing on the density values corresponding to the plurality of first fluid particles based on the positions of each first fluid particle to obtain a density image;

[0181] Perform point drawing according to a preset second drawing algorithm and a preset constant value to generate a plurality of second fluid particles;

[0182] Superimpose the density values corresponding to a plurality of second fluid particles based on the position of each second fluid particle to obtain a fluid shape image.

[0183] According to one or more embodiments of the present disclosure, in the image processing apparatus provided by the present disclosure, the drawing module is specifically configured to:

[0184] Perform point drawing according to a preset third drawing algorithm and a preset second fluid particle density value to generate a plurality of third fluid particles;

[0185] Superimpose the density values corresponding to the plurality of third fluid particles based on the position of each third fluid particle, and draw the image data of the first specified channel of the target image as a density image;

[0186] Perform point drawing according to the third drawing algorithm and a preset constant value to generate a plurality of fourth fluid particles;

[0187] Superimpose the plurality of fourth fluid particles based on the position of each fourth fluid particle, and draw the image data of the second specified channel of the target image as a fluid shape image.

[0188] According to one or more embodiments of the present disclosure, in the image processing apparatus provided by the present disclosure, the blurring processing module is specifically configured to:

[0189] Use the pixel points in the fluid shape image as the center points, sample at the positions of the pixel points corresponding to the center points in the density image to obtain target pixel points;

[0190] Calculate based on the weight value and center density value of the center point, and the weight value and target density value of the target pixel point to obtain the blurring value of the center point;

[0191] Obtain the blurred image based on the blurring value of each center point.

[0192] According to one or more embodiments of the present disclosure, in the image processing apparatus provided by the present disclosure, the blurring processing module is specifically configured to:

[0193] Obtain the original density value corresponding to each target pixel point in the density image;

[0194] Calculate the original density value corresponding to each target pixel point with a preset coefficient to obtain the target density value corresponding to each target pixel point.

[0195] According to one or more embodiments of the present disclosure, in the image processing apparatus provided by the present disclosure, the determining region module is specifically configured to:

[0196] Obtain the maximum density value and the minimum density value in the preset density threshold interval;

[0197] Compare the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively;

[0198] Set the density value of the pixel point whose density value is greater than the maximum density value to a first value, set the density value of the pixel point whose density value is greater than the minimum density value to a second value, and calculate the density value of the pixel point whose density value is less than the maximum density value and greater than the minimum density value through a pre-designed calculation formula; wherein, the first value is greater than the second value;

[0199] Obtain the pixel points whose density values are less than the first value and greater than the second value as the transition region in the blurred image, the pixel points whose density values are less than the second value as the ordinary region, and the pixel points whose density values are greater than the first value as the fluid region.

[0200] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:

[0201] A processor;

[0202] A memory for storing the executable instructions of the processor;

[0203] The processor is configured to read the executable instructions from the memory and execute the instructions to implement any one of the image processing methods provided by the present disclosure.

[0204] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium, and the storage medium stores a computer program, and the computer program is used to execute any one of the image processing methods provided by the present disclosure.

[0205] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0206] Moreover, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the foregoing discussion, these should not be construed as limitations on the scope of the present disclosure. Certain features that are described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment may also be implemented separately or in any suitable subcombination in multiple embodiments.

[0207] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. An image processing method, characterized in that, Including: Obtaining a density image and a fluid shape image; Performing blurring processing on the density image based on the fluid shape image to obtain a blurred image; Determining a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval; Rendering the transition region, the fluid region, and the normal region to generate a target image; The determining the transition region, the fluid region, and the normal region in the blurred image based on a preset density threshold interval includes: obtaining a maximum density value and a minimum density value in the preset density threshold interval; comparing the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively; setting the density value of the pixel point with a density value greater than the maximum density value to a first value, setting the density value of the pixel point with a density value greater than the minimum density value to a second value, and calculating the density value of the pixel point with a density value less than the maximum density value and greater than the minimum density value through a preset calculation formula; wherein, the first value is greater than the second value; obtaining the pixel points with a density value less than the first value and greater than the second value as the transition region in the blurred image, the pixel points with a density value less than the second value as the normal region, and the pixel points with a density value greater than the first value as the fluid region.

2. The image processing method according to claim 1, characterized in that, The obtaining the density image and the fluid shape image includes: Obtaining the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm.

3. The image processing method according to claim 2, characterized in that, The obtaining the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm includes: Performing point drawing according to a preset first drawing algorithm and a preset first fluid particle density value to generate a plurality of first fluid particles; Performing superposition processing on the density values corresponding to the plurality of first fluid particles based on the position of each first fluid particle to obtain the density image; Performing point drawing according to a preset second drawing algorithm and a preset constant value to generate a plurality of second fluid particles; Performing superposition processing on the density values corresponding to the plurality of second fluid particles based on the position of each second fluid particle to obtain the fluid shape image.

4. The image processing method according to claim 2, characterized in that, The obtaining the density image and the fluid shape image according to a preset drawing algorithm and drawing data corresponding to the drawing algorithm includes: Performing point drawing according to a preset third drawing algorithm and a preset second fluid particle density value to generate a plurality of third fluid particles; Performing superposition processing on the density values corresponding to the plurality of third fluid particles based on the position of each third fluid particle, and the image data drawn on the first specified channel of the target image is the density image; Performing point drawing according to the third drawing algorithm and a preset constant value to generate a plurality of fourth fluid particles; Performing superposition processing on the plurality of fourth fluid particles based on the position of each fourth fluid particle, and the image data drawn on the second specified channel of the target image is the fluid shape image.

5. The image processing method according to claim 1, characterized in that, Performing blurring processing on the density image based on the fluid shape image to obtain a blurred image, including: Using the pixel points in the fluid shape image as the center points, sampling at the positions of the pixel points corresponding to the center points in the density image to obtain target pixel points; Calculating based on the weight value and central density value of the center point, and the weight value and target density value of the target pixel point to obtain the blurring value of the center point; Obtaining the blurred image based on the blurring values of each center point.

6. The image processing method according to claim 5, characterized in that, The sampling at the positions of the pixel points corresponding to the center points in the density image to obtain target pixel points includes: Obtaining the positions of the pixel points corresponding to the center points in the density image; Obtaining the diagonals of the pixel point positions, and sampling on the diagonals to obtain the target pixel points.

7. The image processing method according to claim 5, characterized in that, Further including: Obtaining the original density value corresponding to each target pixel point in the density image; Calculating the original density value corresponding to each target pixel point with a preset coefficient to obtain the target density value corresponding to each target pixel point.

8. An image processing apparatus, characterized in that, Including: A drawing module, configured to obtain a density image and a fluid shape image; A blurring processing module, configured to perform blurring processing on the density image based on the fluid shape image to obtain a blurred image; A determining region module, configured to determine a transition region, a fluid region, and a normal region in the blurred image based on a preset density threshold interval; A rendering generation module, configured to render the transition region, the fluid region, and the normal region to generate a target image; Wherein, the determining region module is specifically configured to: obtain the maximum density value and the minimum density value in the preset density threshold interval; compare the density value of each pixel point in the blurred image with the maximum density value and the minimum density value respectively; set the density value of the pixel point with a density value greater than the maximum density value to a first value, set the density value of the pixel point with a density value greater than the minimum density value to a second value, and calculate the density value of the pixel point with a density value less than the maximum density value and greater than the minimum density value through a preset calculation formula; wherein, the first value is greater than the second value; obtain the pixel points with density values less than the first value and greater than the second value as the transition region in the blurred image, the pixel points with density values less than the second value as the normal region, and the pixel points with density values greater than the first value as the fluid region.

9. An electronic device, characterized in that, The electronic device includes: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the image processing method according to any one of claims 1-7 above.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is used to execute the image processing method according to any one of claims 1-7 above.

Citation Information

Patent Citations

  • Computer modelling of fallen snow

    CA2314333A1

  • Image processing method and device, electronic equipment and storage medium

    CN113096231A