Special effect image processing method and device, electronic equipment and storage medium

By determining the brush model to be rendered and rendering lines according to the drawing parameters, a special effects image consistent with reality is generated, solving the problem of low realism in AR brush drawing effects and improving the user experience.

CN114419238BActive Publication Date: 2026-03-31FACE CUTE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-24
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies do not take into account real-world factors when creating video effects using AR brushes, resulting in significant differences between the effects and real-world scenes, which reduces the realism of the effects and the user experience.

Method used

By acquiring the image to be processed, determining the corresponding brush model to be rendered, and rendering the lines to be rendered according to the drawing parameters, a special effects image consistent with reality is generated.

Benefits of technology

It improves the realism of special effects images and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419238B_ABST
    Figure CN114419238B_ABST
Patent Text Reader

Abstract

The method comprises: acquiring a to-be-processed image, determining a to-be-rendered brush model corresponding to the to-be-processed image; and performing rendering processing on each to-be-rendered line in the to-be-rendered brush model according to drawing parameters, to obtain a special effect image corresponding to the to-be-processed image. The technical scheme of the present disclosure solves the technical problem that the actual factors are not considered when a view is drawn based on an AR brush in the prior art, which causes a large difference between the drawn view and the actual view, resulting in poor special effect image effect and poor user experience. The to-be-rendered lines in the to-be-rendered brush model are rendered according to the drawing parameters, to obtain a corresponding special effect image, thereby improving the realism of the special effect image and further improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to a special effects image processing method, apparatus, electronic device and storage medium. Background Technology

[0002] With the development of various video shooting software, video shooting has become mainstream. During the video shooting process, in order to enhance the entertainment value of the video content, various special effects are usually added.

[0003] Currently, the added effects can be views drawn using AR brushes. However, when drawing with AR brushes, actual factors are not taken into account, resulting in many added effects that differ significantly from the actual images in real-world scenes. This leads to low realism and poor visual appeal of the rendered effects, resulting in an extremely poor user experience. Summary of the Invention

[0004] This invention provides a special effects image processing method, apparatus, electronic device, and storage medium to process images into special effects images that are consistent with the actual drawing effect, thereby improving not only the realism of the special effects images but also the user experience.

[0005] In a first aspect, embodiments of the present invention provide a special effects image processing method, the method comprising:

[0006] Obtain the image to be processed;

[0007] Determine the brush model to be rendered corresponding to the image to be processed;

[0008] The lines to be rendered in the brush model are rendered according to the drawing parameters to obtain a special effects image corresponding to the image to be processed.

[0009] Secondly, embodiments of the present invention also provide a special effects image processing apparatus, the apparatus comprising:

[0010] The image acquisition module is used to acquire the image to be processed.

[0011] The model determination module is used to determine the brush model to be rendered corresponding to the image to be processed.

[0012] The special effects image determination module is used to render the lines to be rendered in the brush model to be rendered according to the drawing parameters, so as to obtain a special effects image corresponding to the image to be processed.

[0013] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:

[0014] One or more processors;

[0015] Storage device for storing one or more programs.

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the special effects image processing method as described in any embodiment of the present invention.

[0017] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the special effects image processing method as described in any of the embodiments of the present invention.

[0018] The technical solution of this disclosure, after obtaining the image to be processed, can determine the brush model to be rendered corresponding to the image to be processed, and render the corresponding lines to be rendered in the brush model to be rendered based on the predetermined drawing parameters, so as to obtain a special effect image consistent with the actual sugar painting effect, and can display the special effect image on the display interface. This solves the technical problem in the prior art that when drawing a view based on AR brush, the actual factors are not considered, resulting in the drawn view being far from reality, leading to poor special effect image effect and extremely poor user experience. It realizes the rendering of the lines to be rendered in the brush model to be rendered according to the drawing parameters, thereby obtaining the corresponding special effect image, improving the realism of the special effect image, and thus improving the user experience. Attached Figure Description

[0019] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. 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 originals and elements are not necessarily drawn to scale.

[0020] Figure 1 This is a schematic flowchart of a special effects image processing method provided in Embodiment 1 of this disclosure;

[0021] Figure 2 This is a schematic diagram of the structure of a special effects image processing device provided in Embodiment 3 of this disclosure;

[0022] Figure 3 This is a schematic diagram of an electronic device structure provided in Embodiment 4 of this disclosure. Detailed Implementation

[0023] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure may be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0024] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0025] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "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". Definitions of other terms will be given in the description below.

[0026] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0027] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0028] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0029] Before introducing this technical solution, an illustrative application scenario can be provided. This disclosed technical solution can be applied to any scenario requiring special effects, such as video calls, live streaming, and short video shooting where special effects need to be added. Based on the content disclosed in this technical solution, corresponding applications can be developed, or it can be used as a special effects prop in video shooting scenarios to achieve the corresponding special effects display. During the special effects creation process, corresponding special effects images can be drawn using an AR pen. The drawing material used by the AR pen is syrup. Syrup can be understood as solid sugar obtained after heating. When drawing images based on syrup, different syrup thicknesses correspond to different sugar color depths. The technical solution provided in this disclosure can be applied to situations where special effects images matching the festive atmosphere are drawn using an AR pen and displayed. The festive atmosphere can be the Spring Festival atmosphere, and the festive special effects can be sugar painting effects. The specific content of the sugar painting can be determined by a pre-set template or can be an image freely drawn according to the user's preferences. The festive atmosphere can be the Spring Festival atmosphere, etc. Alternatively, the captured image can be processed into a corresponding sugar painting image, that is, a special effects image can be drawn on the image to be processed using syrup as the drawing material.

[0030] Example 1

[0031] Figure 1 This is a schematic flowchart of a special effects image processing method provided in Embodiment 1 of this disclosure. This embodiment is applicable to any image display scenario supported by the Internet, used to process an image to be processed into a corresponding special effects image and display it. This method can be executed by a special effects image processing device, which can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server. Scenarios of arbitrary image display are typically implemented through cooperation between a client and a server. The method provided in this embodiment can be executed by the server, the client, or through cooperation between the client and the server.

[0032] like Figure 1 As shown, the specific steps of the method provided in this embodiment are as follows:

[0033] S110. Obtain the image to be processed.

[0034] The image to be processed can be an image requiring special effects transformation. Optionally, it can be an image captured in real-time by a camera device. The image to be processed includes at least one target object, which can be a user, pet, landscape, etc. Alternatively, it can be a pre-defined target object requiring special effects processing; after acquiring the image to be processed, the target object is automatically identified and the special effects are applied to it. Another option is for the user to trigger an image upload control to upload an image, which is then used as the image to be processed.

[0035] It should be noted that the image to be processed can be an image captured in real time by a camera device, or an image uploaded by the user. The specific type of image can be set according to actual needs. It should also be noted that this technical solution can be integrated into a corresponding application, and the camera device can be a terminal device integrated into the application.

[0036] S120. Determine the brush model to be rendered corresponding to the image to be processed.

[0037] The brush model to be rendered is the model obtained after processing the image. The brush model to be rendered corresponds to the contour in the image. The lines corresponding to the contour can have corresponding width and grayscale values, so as to determine the corresponding sugar painting drawing parameters based on the width and grayscale values, and then render the brush model to be rendered based on the sugar painting drawing parameters.

[0038] Specifically, after acquiring the image to be processed, the contour information of the target object in the image can be determined. Simultaneously, the width value corresponding to the contour information can be determined to obtain the brush model to be rendered corresponding to the image. Alternatively, the body contour and individual limb contours of the target object in the image can be determined, and the width information of the contour lines can be determined. The width information of the contour lines can be that the line width value is larger at inflection points and smaller further away from inflection points. At the same time, the grayscale values ​​of the pixels in the contour lines are determined, and the sugar painting drawing parameters are determined based on the grayscale values ​​and width values.

[0039] In this embodiment, there are two ways to determine the brush model to be rendered corresponding to the image to be processed. The following details the two methods for determining the brush model to be rendered corresponding to the image to be processed.

[0040] The first implementation method may be: determining the brush model to be rendered based on the image to be processed and the target comparison view.

[0041] The target comparison view can be a view with a preset grayscale value. Optionally, the preset grayscale value can be 0, meaning the target comparison view is a pure black view, or a solid color view with a grayscale value close to 0. By overlaying the target comparison view with the image to be processed, a contour map corresponding to the image to be processed can be obtained. At the same time, the width value of the contour map lines can be determined according to the clarity of the contour map. Optionally, the higher the clarity value, the higher the corresponding width value.

[0042] After obtaining the width information, the grayscale value of the corresponding pixel in the outline image can be determined. Based on this grayscale value, the corresponding rendering parameters can be retrieved to render the brush model, thus obtaining the brush model to be rendered. In other words, the brush model to be rendered is...

[0043] In other words, if the image to be processed is a real-time image captured by a camera device or an image uploaded by a user, the contour information corresponding to the image to be processed can be determined based on the target comparison view, and then the contour information can be processed to obtain the brush model to be rendered.

[0044] The second implementation method may be: determining the brush model to be rendered corresponding to the image to be processed includes: using the drawing trajectory on the display interface as the image to be processed; obtaining two adjacent pause points in the drawing trajectory, and determining the brush model to be rendered based on the pause point attributes and the image to be processed; wherein, the pause point attributes include the pause duration and pause time of the pause point.

[0045] In practical applications, when a user draws an image to be processed, an image including the drawing content can be recorded using a camera device. The drawn content is mostly determined by the movement of corresponding key points. Optionally, key points can be key points on the face of the target object in the image, such as the tip of the nose, and the drawing content is drawn based on the movement of the nose tip. Alternatively, an image drawn based on the movement of a finger on the display interface can also be used as the image to be processed. That is, a corresponding motion trajectory can be drawn, and this motion trajectory can be used as the drawing trajectory. Correspondingly, the image corresponding to the drawing trajectory is used as the image to be processed. When drawing a trajectory based on key points, there are corresponding pause points. The pause point attributes include pause duration and pause time. The pause duration is the duration of stay at a certain pause point, and the pause time can be the specific time of the pause. The advantage of determining the pause time is that it is possible to determine the thickness information of the trajectory line between two adjacent pause points, i.e., the width information. The advantage of determining the stay duration is that it is possible to determine the sugar content information at that pause point. Based on the above information, the brush model to be rendered corresponding to the drawing trajectory in the image to be processed can be determined.

[0046] In this embodiment, determining the brush model to be rendered based on the above information can specifically be as follows: The image to be processed is generated based on a drawing trajectory. During the drawing process, data corresponding to the drawing trajectory is received, which may include the motion trajectory and pause point information. Adjacent pause points are determined based on the pause time of each pause point. The thickness and size of the paint at each pause point are determined based on the pause duration of adjacent pause points. Simultaneously, the trajectory width between two adjacent pause points can be determined based on the pause time and trajectory of adjacent pause points, thereby obtaining the brush model to be rendered corresponding to the image to be processed.

[0047] In this embodiment, in addition to obtaining the trajectory width, to further determine the final rendering effect, after obtaining the width information of the image to be processed, the grayscale value corresponding to the corresponding pixel in the outline map can also be determined, thereby simulating a sugar painting diagram in a real environment. For example, in real-world scenes, images of pets, people, green mountains, etc., drawn with boiled sugar can be drawn with different thicknesses, sugar color depths, and thicknesses based on the duration of stay at a certain position or the speed of movement.

[0048] To simulate the above effect, the following approach can be taken: Determine the grayscale values ​​of the corresponding pixels in the lines to be rendered within the brush model. Based on the line width information in the brush model, determine the line width variation rate; based on the normal vectors of the pixels in the brush model and the corresponding camera normal vectors, determine the Fresnel values ​​of the pixels; based on the Fresnel values ​​and the corresponding width variation rate, determine the grayscale information of the pixels in the brush model; and based on the grayscale information, determine the sugar painting drawing parameters.

[0049] The width change rate is determined based on the line width information of the previous and next time steps. The model to be rendered corresponds to a contour map, which is composed of multiple pixels. At this point, the normal map corresponding to the contour map can be determined. For each pixel, the Fresnel value can be determined based on the pixel's normal information and the camera normal vector. The Fresnel value is the reflectivity in the Fresnel effect. The magnitude of this reflectivity value characterizes the amount of reflected content, i.e., the brightness of the image. Optionally, the higher the reflectivity value, the brighter the image; the lower the reflectivity, the lower the image brightness. Taking a sphere as an example, there is less reflection in the center and more reflection at the edges. A contour image is composed of lines, and lines are composed of multiple pixels. The Fresnel value can be understood as an intermediate transition rate. The brightness of the image can be characterized based on the Fresnel value. Based on the Fresnel value and the corresponding change rate, the grayscale value corresponding to the pixel in the line to be rendered can be determined. Simultaneously, the light intensity information corresponding to the lines to be rendered can be determined. Based on the light intensity information and the corresponding grayscale values, the sugar painting drawing parameters for the corresponding pixels can be retrieved, and the lines to be rendered can be drawn accordingly based on these parameters. The sugar painting drawing parameters include the depth of the syrup, the thickness at that pixel, and the brightness, etc.

[0050] S130. Render the lines to be rendered in the brush model to be rendered according to the drawing parameters to obtain the special effects image corresponding to the image to be processed.

[0051] The drawing parameters include drawing paint and paint parameters. The drawing paint is a liquid paint, which may include ink or syrup. The paint parameters include the paint's color depth and the amount of light reflected by the paint, consistent with the reflected light information. This embodiment uses sugar painting as an example. The corresponding drawing parameters are mainly sugar painting drawing parameters. These parameters include at least one of sugar color depth information, syrup thickness information, and syrup brightness information. It can be understood that the sugar painting drawing parameters include at least one of the three attributes mentioned above, and the attribute values ​​corresponding to different attributes also have certain differences. The attribute values ​​corresponding to different attributes can be determined separately. Based on the grayscale information corresponding to each pixel in the brush model to be rendered, the corresponding sugar painting drawing parameters can be retrieved for rendering, thereby obtaining the special effects image.

[0052] It should be noted that different sugar painting drawing parameters produce different effects. For example, areas with smaller line widths have lighter, more translucent colors, while areas with larger line widths have darker, less translucent colors. Furthermore, since sugar painting involves heating, the sugar changes from a solid to a liquid state, resulting in a reddish-brown, translucent texture with reflective and refractive effects. Therefore, this technical solution can determine the sugar painting drawing parameters based on these parameters. In this embodiment, the rendering of the lines to be rendered in the brush model is processed according to the sugar painting drawing parameters to obtain a special effects image corresponding to the image to be processed. This includes: determining the grayscale values ​​of the pixels in the lines to be rendered and the lighting parameters corresponding to the image to be processed; retrieving the corresponding sugar painting drawing parameters based on the grayscale values ​​and lighting parameters; and rendering the corresponding pixels based on the sugar painting drawing parameters to obtain the special effects image.

[0053] Specifically, the contour map corresponding to the image to be processed can be determined. Simultaneously, the line width is set thicker in areas of higher clarity and thinner in areas of lower clarity. Alternatively, the width of the line to be rendered can be determined based on the pause points of the drawing trajectory. After determining the above information, the width change rate of the line to be rendered can be determined, along with the Fresnel value of each pixel. Based on the width change rate and Fresnel value, the corresponding grayscale information can be determined. The thickest line to be rendered corresponds to the highest grayscale value, i.e., black. Interpolation is performed outwards from the black area as the center point to obtain the grayscale value of the corresponding pixel in the line to be rendered. Based on the grayscale value and the light intensity information of the image to be processed, the corresponding sugar painting drawing parameters for each pixel can be retrieved to render the corresponding pixel, thereby obtaining the special effects image.

[0054] The technical solution of this disclosure, after obtaining the image to be processed, can determine the brush model to be rendered corresponding to the image to be processed, and render the corresponding lines to be rendered in the brush model to be rendered based on the predetermined sugar painting drawing parameters, so as to obtain a special effect image consistent with the actual sugar painting effect, and can display the special effect image on the display interface. This solves the technical problem in the prior art that when drawing a view based on AR brushes, the actual factors are not considered, resulting in the drawn view being far from reality, leading to poor special effect image effect and extremely poor user experience. It realizes the rendering of the lines to be rendered in the brush model to be rendered according to the drawing parameters, thereby obtaining the corresponding special effect image, improving the realism of the special effect image, and thus improving the user experience.

[0055] Example 2

[0056] Based on the above embodiments, the sugar painting drawing parameters can be determined first. For details, please refer to the detailed description of this technical solution. Technical terms that are the same as or corresponding to those in the above embodiments will not be repeated here.

[0057] Based on the above scheme, the brush model to be processed can be obtained first, and then the sugar painting drawing parameters corresponding to the grayscale information can be determined according to the brush model. In this embodiment, determining the brush model to be processed can be: determining the line width change ratio according to the line width information in the brush model; determining the Fresnel value of the pixel according to the normal vector of the pixel in the brush model and the camera normal vector corresponding to the brush model; determining the grayscale information of the pixel in the brush model according to the Fresnel value of the pixel and the corresponding width change rate; and determining the drawing parameters according to the grayscale information.

[0058] The brush model to be processed can be a pre-drawn image of a certain shape. The line widths of this image can be the same or different. Of course, to simulate the actual effect, the line widths can be different. The step size for adjusting the line change rate can be set. Based on the adjustment step size, the width information of the previous and next points can be determined, and the width change rate can be determined based on the width information. The Fresnel value is the numerical information obtained by multiplying the normal information corresponding to the pixel and the camera normal vector of the brush model to be processed. The Fresnel value is determined by calculating the dot product of the normal vector information of each pixel and the camera normal vector. The Fresnel value is used to characterize the brightness information of the corresponding line. Based on the Fresnel value and the width change rate of the corresponding pixel, the grayscale information of the corresponding pixel in the brush model to be processed can be determined. Sugar painting parameters can be drawn based on the grayscale information. The sugar painting parameters include sugar color depth information and reflection brightness information.

[0059] In this embodiment, determining the grayscale information of the pixels in the brush model to be processed based on the Fresnel value of the pixel and the corresponding width change rate includes: determining the grayscale value of the corresponding pixel by multiplying the width change rate and the corresponding Fresnel value.

[0060] Specifically, the Fresnel value of the corresponding pixel and the width change rate of the line to which the pixel belongs can be calculated to perform a dot product operation, and the gray value of the corresponding pixel can be determined based on the dot product operation result, and its gray value is used as the gray information.

[0061] Based on the above technical solution, the drawing parameters of the sugar painting are determined according to the grayscale information, including: determining the dark area and the light area according to the grayscale value, and obtaining the first drawing parameter to be merged corresponding to the dark area and the second drawing parameter to be merged corresponding to the light area; processing the first drawing parameter to be merged and the second drawing parameter to be merged based on interpolation operation to determine the drawing parameters corresponding to the corresponding grayscale values.

[0062] The first parameter to be merged can be understood as the color parameters for drawing dark areas, which may include color depth. Typically, dark areas have a deeper color depth, meaning a larger color depth value. The second parameter to be merged can be understood as the color parameters for drawing light areas. The depth and light areas are determined based on pre-defined grayscale values. Optionally, the area composed of pixels with grayscale values ​​higher than a first preset grayscale threshold is considered a dark area, typically corresponding to the area containing inflection points in the image. The area corresponding to pixels with grayscale values ​​lower than a second preset grayscale threshold is considered a light area, typically corresponding to areas far from inflection points in the image. The color parameters for both dark and light areas can be pre-determined and used as the parameters to be merged. Based on the parameters to be merged, interpolation can be performed on the grayscale values ​​of the depth and light areas to determine the color drawing parameters for pixels on the line between the dark and light areas. The determined color drawing parameters can be bound to the corresponding grayscale values ​​for use during image rendering.

[0063] Based on the above technical solution, the sugar color reflection light amount information corresponding to the grayscale information under different lighting parameters is determined; the sugar color reflection light amount information is used to update the sugar painting drawing parameters corresponding to the grayscale information.

[0064] In practical applications, the reflected brightness value of syrup varies under different brightness conditions. To simulate the most realistic effect, the reflected light amount information of syrup under different lighting parameters can be determined. These lighting parameters can be light intensity and light angle. A virtual light source is controlled to illuminate the rendering model under these lighting parameters to obtain the corresponding reflected light amount information. The reflected light amount information of the sugar color corresponding to different grayscale values ​​is then updated in the corresponding sugar painting drawing parameters for later use.

[0065] The technical solution of this disclosure embodiment can determine the grayscale information of the corresponding pixels in the lines to be rendered before rendering the lines in the brush model. Based on the grayscale information, the matching sugar painting drawing parameters can be retrieved. Based on the sugar painting drawing parameters, the corresponding pixels can be rendered to obtain the special effect image corresponding to the image to be processed. This achieves the technical effect of making the special effect image most compatible with the actual situation, thereby improving the user experience.

[0066] Example 3

[0067] Figure 2 This is a schematic diagram of the structure of a special effects image processing device provided in Embodiment 3 of this disclosure, as shown below. Figure 2 As shown, the device includes: an image acquisition module 210, a model determination module 220, and a special effects image determination module 230.

[0068] The image acquisition module 210 is used to acquire the image to be processed; the model determination module 220 is used to determine the brush model to be rendered corresponding to the image to be processed; and the special effects image determination module 230 is used to render the lines to be rendered in the brush model to be rendered according to the drawing parameters to obtain the special effects image corresponding to the image to be processed.

[0069] Based on the above technical solution, the model determination module is further configured to determine the brush model to be rendered based on the image to be processed and the target comparison view.

[0070] Based on the above technical solution, the model determination module includes:

[0071] An image determination unit is used to determine the drawing trajectory on the display interface as the image to be processed.

[0072] The model determination unit is used to obtain two adjacent pause points in the drawing trajectory, and determine the brush model to be rendered based on the pause point attributes and the image to be processed; wherein, the pause point attributes include the pause duration and pause time of the pause point.

[0073] Based on the above technical solution, the device includes:

[0074] The rate of change determination module is used to determine the rate of change of line width based on the line width information in the brush model to be processed.

[0075] The Fresnel value determination module is used to determine the Fresnel value of a pixel based on the normal vector of the pixel in the brush model to be processed and the camera normal vector corresponding to the brush model to be processed.

[0076] The grayscale information determination module is used to determine the grayscale information of the pixels in the brush model to be processed based on the Fresnel value of the pixel and the corresponding width change rate.

[0077] The drawing parameter determination module is used to determine the drawing parameters based on the grayscale information.

[0078] Based on the above technical solution, the grayscale information determination module is further used to: determine the grayscale information of the corresponding pixel by performing a dot product operation on the width change rate and the corresponding Fresnel value.

[0079] Based on the above technical solution, the grayscale information determination unit includes:

[0080] The drawing parameter retrieval subunit is used to determine the dark and light regions based on the grayscale values, and to obtain the first drawing parameters to be merged corresponding to the dark region and the second drawing parameters to be merged corresponding to the light region.

[0081] The drawing parameter fusion subunit is used to process the first drawing parameter to be fused and the second drawing parameter to be fused based on interpolation operations to determine the drawing parameters corresponding to the corresponding gray values.

[0082] Based on the above technical solution, the device further includes:

[0083] The light quantity information determination module is used to determine the reflected light quantity information corresponding to grayscale information under different illumination parameters;

[0084] The drawing parameter determination module is used to update the drawing parameters corresponding to the grayscale information based on the sugar color reflection light amount information.

[0085] Based on the above technical solution, the drawing parameters include drawing paint and paint parameters. The drawing paint is a liquid paint, which includes ink or syrup. The paint parameters include the color of the liquid paint and the amount of light reflected by the paint that is consistent with the reflected light information.

[0086] Based on the above technical solution, the special effects image determination module includes:

[0087] The parameter determination unit is used to determine the grayscale value of the pixel in the line to be rendered and the illumination parameters corresponding to the image to be processed.

[0088] The parameter retrieval unit is used to retrieve the corresponding drawing paint and paint parameters based on the grayscale value and lighting parameters;

[0089] The special effects image determination unit is used to render and process the corresponding pixels based on the drawing paint and paint parameters to obtain the special effects image.

[0090] The technical solution of this disclosure, after obtaining the image to be processed, can determine the brush model to be rendered corresponding to the image to be processed, and render the corresponding lines to be rendered in the brush model to be rendered based on the predetermined sugar painting drawing parameters, so as to obtain a special effect image consistent with the actual sugar painting effect, and can display the special effect image on the display interface. This solves the technical problem in the prior art that when drawing a view based on AR brushes, the actual factors are not considered, resulting in the drawn view being far from reality, leading to poor special effect image effect and extremely poor user experience. It realizes the rendering of the lines to be rendered in the brush model to be rendered according to the drawing parameters, thereby obtaining the corresponding special effect image, improving the realism of the special effect image, and thus improving the user experience.

[0091] The image processing apparatus provided in this disclosure can execute the special effects image processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0092] It is worth noting that the units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.

[0093] Example 4

[0094] Figure 3 This is a schematic diagram of an electronic device structure provided in Embodiment 4 of this disclosure. Refer to the following... Figure 3 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 3 The diagram below shows the structure of the terminal device or server 300. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0095] like Figure 3As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 30308 into a random access memory (RAM) 303. The RAM 303 also stores programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An edit / output (I / O) interface 305 is also connected to the bus 304.

[0096] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 303-308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 having such devices is shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.

[0097] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 306, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of embodiments of this disclosure.

[0098] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0099] The electronic device provided in this embodiment and the special effects image processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0100] Example 5

[0101] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the special effects image processing method provided in the above embodiments.

[0102] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. 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 thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0103] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0104] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0105] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to:

[0106] Obtain the image to be processed;

[0107] Determine the brush model to be rendered corresponding to the image to be processed;

[0108] The lines to be rendered in the brush model are rendered according to the drawing parameters to obtain a special effects image corresponding to the image to be processed.

[0109] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as 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, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via 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., via the Internet using an Internet service provider).

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

[0111] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0112] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0113] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction 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 be, 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 machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0114] According to one or more embodiments of this disclosure, [Example 1] provides a special effects image processing method, the method comprising:

[0115] Obtain the image to be processed;

[0116] Determine the brush model to be rendered corresponding to the image to be processed;

[0117] The lines to be rendered in the brush model are rendered according to the drawing parameters to obtain a special effects image corresponding to the image to be processed.

[0118] According to one or more embodiments of this disclosure, [Example 2] provides a special effects image processing method, which further includes:

[0119] Optionally, determining the brush model to be rendered corresponding to the image to be processed includes:

[0120] The brush model to be rendered is determined based on the image to be processed and the target comparison view.

[0121] According to one or more embodiments of this disclosure, [Example 3] provides a special effects image processing method, which further includes:

[0122] Optionally, determining the brush model to be rendered corresponding to the image to be processed includes:

[0123] The drawing trajectory on the display interface will be used as the image to be processed;

[0124] Obtain two adjacent pause points in the drawing trajectory, and determine the brush model to be rendered based on the pause point attributes and the image to be processed;

[0125] The pause point attributes include the pause duration and pause time at the pause point.

[0126] According to one or more embodiments of this disclosure, [Example 4] provides a special effects image processing method, which further includes:

[0127] Optionally, the line width variation rate can be determined based on the line width information in the brush model to be processed;

[0128] The Fresnel value of a pixel is determined based on the normal vector of the pixel in the brush model to be processed and the camera normal vector corresponding to the brush model to be processed.

[0129] The grayscale information of the pixels in the brush model to be processed is determined based on the Fresnel value of the pixel and the corresponding width change rate.

[0130] Based on the grayscale information, the drawing parameters are determined.

[0131] According to one or more embodiments of this disclosure, [Example 5] provides a special effects image processing method, which further includes:

[0132] Optionally, determining the grayscale information of pixels in the brush model to be processed based on the Fresnel value of the pixel and the corresponding width change rate includes:

[0133] The grayscale information of the corresponding pixel is determined by multiplying the width change rate and the corresponding Fresnel value.

[0134] According to one or more embodiments of this disclosure, [Example Six] provides a special effects image processing method, which further includes:

[0135] Optionally, dark and light regions are determined based on grayscale values, and a first rendering parameter to be merged corresponding to the dark region and a second rendering parameter to be merged corresponding to the light region are obtained in advance.

[0136] The first and second drawing parameters to be merged are processed based on interpolation to determine the drawing parameters corresponding to the corresponding grayscale values.

[0137] According to one or more embodiments of this disclosure, [Example Seven] provides a special effects image processing method, which further includes:

[0138] Optionally, determine the amount of reflected light corresponding to the grayscale information under different illumination parameters;

[0139] The drawing parameters corresponding to the grayscale information are updated based on the sugar color reflection light amount information.

[0140] According to one or more embodiments of this disclosure, [Example Eight] provides a special effects image processing method, which further includes:

[0141] Optionally, the drawing parameters include drawing paint and paint parameters. The drawing paint is a liquid paint, which may include ink or syrup. The paint parameters include the color of the liquid paint and the amount of light reflected by the paint, which is consistent with the reflected light information.

[0142] According to one or more embodiments of this disclosure, [Example Nine] provides a special effects image processing method, which further includes:

[0143] Optionally, the step of rendering the lines to be rendered in the brush model according to the sugar painting drawing parameters to obtain a special effects image corresponding to the image to be processed includes:

[0144] Determine the grayscale values ​​of the pixels in the lines to be rendered and the lighting parameters corresponding to the image to be processed;

[0145] Based on the grayscale value and lighting parameters, retrieve the corresponding sugar painting drawing parameters;

[0146] The special effect image is obtained by rendering the corresponding pixels based on the sugar painting drawing parameters.

[0147] According to one or more embodiments of this disclosure, [Example 10] provides a special effects image processing apparatus, the apparatus comprising:

[0148] The image acquisition module is used to acquire the image to be processed.

[0149] The model determination module is used to determine the brush model to be rendered corresponding to the image to be processed.

[0150] The special effects image determination module is used to render the lines to be rendered in the brush model to be rendered according to the drawing parameters, so as to obtain a special effects image corresponding to the image to be processed.

[0151] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0152] Furthermore, although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, a feature described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0153] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A special effect image processing method characterized by, The method comprises: acquiring a to-be-processed image; determining a to-be-rendered brush model corresponding to the to-be-processed image; rendering a to-be-rendered line in the to-be-rendered brush model according to a drawing parameter to obtain a special effect image corresponding to the to-be-processed image; wherein the drawing parameter is determined based on gray information of at least one pixel point in the to-be-rendered brush model, and the gray information is related to a width change rate of the to-be-rendered line and a Fresnel value of the pixel point in the to-be-rendered brush model.

2. The method of claim 1, wherein, The method comprises: determining the to-be-rendered brush model according to the to-be-processed image and a target comparison view.

3. The method of claim 1, wherein, The method comprises: taking a drawing track on a display interface as the to-be-processed image; acquiring two adjacent pause points in the drawing track, and determining the to-be-rendered brush model according to a pause point attribute and the to-be-processed image; wherein the pause point attribute comprises a pause duration and a pause time at the pause point.

4. The method of claim 1, wherein, The method further comprises: determining a line width change rate according to width information of a line in a to-be-processed brush model; determining a Fresnel value of a pixel point according to a normal vector of the pixel point in the to-be-processed brush model and a camera normal vector corresponding to the to-be-processed brush model; determining gray information of the pixel point in the to-be-processed brush model according to the Fresnel value of the pixel point and the corresponding width change rate; determining a drawing parameter according to the gray information.

5. The method of claim 4, wherein, The method comprises: determining the gray information of the corresponding pixel point by multiplying the width change rate and the corresponding Fresnel value.

6. The method of claim 4, wherein, The method comprises: determining a dark color region and a light color region according to the gray value, and acquiring a first to-be-fused drawing parameter corresponding to the dark color region and a second to-be-fused drawing parameter corresponding to the light color region; processing the first to-be-fused drawing parameter and the second to-be-fused drawing parameter based on an interpolation operation to determine a drawing parameter corresponding to the corresponding gray value.

7. The method of claim 6, wherein, The method further comprises: determining reflection light amount information corresponding to the gray information under different light parameters; updating the drawing parameter corresponding to the corresponding gray information based on the reflection light amount information.

8. The method according to any one of claims 1 to 7, characterized in that, The drawing parameter comprises a drawing paint and a paint parameter, the drawing paint is a liquid paint, the liquid paint comprises ink or syrup, and the paint parameter comprises a paint dark color of the liquid paint and a paint reflection light amount consistent with the reflection light amount information.

9. The method of claim 8, wherein, The method comprises: determining a gray value of a pixel point in the to-be-rendered line and a light parameter corresponding to the to-be-processed image; calling a corresponding drawing paint and a paint parameter according to the gray value and the light parameter; rendering the corresponding pixel point based on the drawing paint and the paint parameter to obtain the special effect image.

10. A special effect image processing apparatus characterized by comprising: The method comprises: An image acquisition module is configured to acquire a to-be-processed image; A model determination module is configured to determine a to-be-rendered brush model corresponding to the to-be-processed image; An effect image determination module is configured to perform rendering processing on a to-be-rendered line in the to-be-rendered brush model according to drawing parameters, to obtain an effect image corresponding to the to-be-processed image. The drawing parameters are determined based on gray information of at least one pixel point in the to-be-rendered brush model, and the gray information is related to a width change rate of the to-be-rendered line and a Fresnel value of the pixel point in the to-be-rendered brush model.

11. An electronic device, comprising: The electronic device includes: One or more processors; A storage device configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the effect image processing method according to any one of claims 1-9.

12. A storage medium containing computer-executable instructions for performing the effect image processing method according to any one of claims 1-9 when executed by a computer processor.

Citation Information

Patent Citations

  • Drawing control method, apparatus and mobile terminal

    CN103403650A

  • Pencil style processing method of 3D scene

    CN105869203A