Brush stroke simulation method and device based on physical interaction

Through the brush stroke simulation method based on physical interaction, the problem of poor brush stroke simulation effect in traditional digital brush writing is solved, and more natural and continuous virtual brush strokes are achieved, which enhances the expressiveness of digital calligraphy and painting creation.

CN119378282BActive Publication Date: 2025-03-28BEIJING INSTITUTE FOR GENERAL ARTIFICIAL INTELLIGENCE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411977308.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-28
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the digital processing of traditional brush writing, the brushstroke simulation effect is poor and the ink rendering method is limited.

Method used

Using a brush stroke simulation method based on physical interaction, the brush stroke pattern rendered by detecting the interactive actions of the touch device, obtaining force feedback parameters, generating initial brush stroke paths, and adjusting the ink penetration parameters and brush stroke texture characteristics to obtain the rendered brush stroke pattern.

Benefits of technology

It realizes a more natural and continuous virtual brush strokes, and improves the artistic expression and cultural communication effect of digital calligraphy and painting creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378282B_ABST
    Figure CN119378282B_ABST
Patent Text Reader

Abstract

The present disclosure provides a brush stroke simulation method and device, equipment, medium and product based on physical interaction, which relates to the field of graphics processing technology. The specific implementation scheme includes: in response to the detected interactive action generated based on the touch device, obtaining the force feedback parameters of the interactive action; generating an initial stroke trajectory according to the force feedback parameters and a preset brush tip model; adjusting the ink penetration parameters and / or stroke texture characteristics of the initial stroke trajectory to obtain a rendered brush stroke graphic; and controlling the presentation of the brush stroke graphic on the display screen of the touch device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of graphics processing technology, and in particular to a brush stroke simulation method based on physical interaction. Background Art

[0002] With the development of graphics processing technology and human-computer interaction technology, digital calligraphy and painting creation has gradually become an important way of artistic expression and cultural communication.

[0003] However, in the digital processing of traditional brush writing, there are problems such as poor brushstroke simulation and limited ink rendering methods. Summary of the invention

[0004] The present invention provides a method and device for simulating brush strokes based on physical interaction.

[0005] According to one aspect of the present disclosure, a method for simulating brush strokes based on physical interaction is provided, comprising: in response to a detected interactive action generated based on a touch device, obtaining force feedback parameters of the interactive action; generating an initial brush stroke trajectory according to the force feedback parameters and a preset brush tip model; adjusting the ink penetration parameters and / or brush stroke texture features of the initial brush stroke trajectory to obtain a rendered brush stroke graphic; and controlling the presentation of the brush stroke graphic on a display screen of the touch device.

[0006] In some embodiments, in response to a detected interaction action generated based on a touch device, obtaining a force feedback parameter of the interaction action includes: in response to the detected interaction action, obtaining at least one of the following parameters of the interaction action as the force feedback parameter: current movement speed, pressure value parameter, interaction position parameter, and interaction angle parameter.

[0007] In some embodiments, generating an initial brush stroke trajectory according to the force feedback parameters and a preset brush tip model includes: based on a pre-constructed inverted cone model, determining the inverted cone direction and the cone vertex position according to the interaction position parameters and the interaction angle parameters; determining the area radius of the brush stroke area formed by the projection of the inverted cone on the paper according to the pressure value parameters; and generating the initial brush stroke trajectory according to the inverted cone direction, the cone vertex position and the area radius of the brush stroke area.

[0008] In some embodiments, the ink penetration parameters include ink transparency, and the ink penetration parameters of the initial brush stroke trajectory are adjusted to obtain a rendered brush stroke graphic, including: for any target trajectory point in the initial brush stroke trajectory, according to the distance between the target trajectory point and the center of the brush stroke area and the pressure value at the target trajectory point, calculating the ink transparency that matches the target trajectory point; and according to the ink transparency that matches any target trajectory point, rendering the initial brush stroke trajectory to obtain the rendered brush stroke graphic.

[0009] In some embodiments, the ink penetration parameters include ink diffusion, and the ink penetration parameters of the initial brush stroke trajectory are adjusted to obtain a rendered brush stroke graphic, including: calculating the grayscale value gradient amplitude of each pixel point in the initial brush stroke trajectory; binarizing the grayscale value gradient amplitude to obtain a binary mask matching the corresponding pixel point; and adjusting the ink diffusion matching the corresponding pixel point according to the binary mask to obtain the rendered brush stroke graphic.

[0010] In some embodiments, the ink diffusion degree matching the corresponding pixel point is adjusted according to the binary mask to obtain the rendered brush stroke graphic, including: adjusting the ink diffusion degree matching the corresponding pixel point according to the binary mask and at least one of the following parameters to obtain the rendered brush stroke graphic, dynamic noise density, ink diffusion range, ink solubility and paper density constant.

[0011] In some embodiments, the ink penetration parameters of the initial brush stroke trajectory are adjusted to obtain a rendered brush stroke graphic, including: using a dynamic noise generation algorithm to control the random boundaries of the initial brush stroke trajectory to obtain the rendered brush stroke graphic.

[0012] In some embodiments, the stroke texture features of the initial stroke trajectory are adjusted to obtain a rendered brush stroke graphic, including: performing trajectory contour detection on the initial stroke trajectory to obtain an internal colored area of ​​the initial stroke trajectory; and superimposing a preset stroke texture map on the internal colored area of ​​the initial stroke trajectory to obtain the brush stroke graphic with an erosion effect.

[0013] In some embodiments, the performing of trajectory contour detection on the initial brush stroke trajectory to obtain the internal colored area of ​​the initial brush stroke trajectory includes: for any trajectory point in the initial brush stroke trajectory, calculating the vector dot product of the vertex normal vector of the corresponding trajectory point and a preset viewing direction vector; and identifying the internal colored area of ​​the initial brush stroke trajectory based on the absolute value of the vector dot product.

[0014] In some embodiments, the method of superimposing a preset brush stroke texture map on the internal colored area of ​​the initial brush stroke trajectory to obtain the brush stroke graphic with an erosion effect includes: sampling the brush stroke texture map based on any area point in the internal colored area to obtain a target sampling map that matches the corresponding area point; superimposing the target sampling map on the position of the corresponding area point to obtain an initial erosion effect value based on the corresponding area point; adjusting the initial erosion effect value using a power exponent to obtain an erosion effect value after sharpness adjustment; scaling the erosion effect value after sharpness adjustment to obtain a target erosion effect value based on the corresponding area point; and applying the target erosion effect value to the corresponding area point in the internal colored area to obtain the brush stroke graphic with an erosion effect.

[0015] In some embodiments, the erosion effect value after sharpness adjustment is scaled to obtain a target erosion effect value based on a corresponding area point, including: scaling the erosion effect value after sharpness adjustment to obtain a transition erosion effect value; limiting the output value of the transition erosion effect value within a preset range to obtain a smooth erosion effect value; and performing threshold inversion processing on the smooth erosion effect value based on a preset threshold inversion parameter to obtain the target erosion effect value based on the corresponding area point.

[0016] In some embodiments, adjusting the brush stroke texture features of the initial brush stroke trajectory to obtain a rendered brush stroke graphic also includes: adjusting the pixel coordinates corresponding to the brush stroke texture map to achieve displacement, rotation and scaling operations on the brush stroke texture map.

[0017] In some embodiments, the method further comprises: in response to the detected interaction action, persisting the brush stroke graphic matching the interaction action into the memory of a storage device.

[0018] According to another aspect of the present disclosure, a brush stroke simulation device is provided, comprising: a first processing module, for acquiring force feedback parameters of an interactive action detected based on a touch device in response to the interactive action generated; a second processing module, for generating an initial stroke trajectory according to the force feedback parameters and a preset brush tip model; a third processing module, for adjusting the ink penetration parameters and / or stroke texture features of the initial stroke trajectory to obtain a rendered brush stroke graphic; and a fourth processing module, for controlling the presentation of the brush stroke graphic on a display screen of the touch device.

[0019] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned brush stroke simulation method.

[0020] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned brush stroke simulation method.

[0021] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned brush stroke simulation method when executed by a processor.

[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0024] Figure 1 The system architecture of the brush stroke simulation method and device according to the embodiment of the present disclosure is schematically shown;

[0025] Figure 2 A flowchart of a brush stroke simulation method according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 3 A schematic diagram of an inverted cone model according to an embodiment of the present disclosure is schematically shown;

[0027] Figure 4 A schematic diagram schematically shows an initial stroke trajectory according to an embodiment of the present disclosure;

[0028] Figure 5 The schematic diagram schematically shows a process of rendering an initial brush stroke trajectory according to an embodiment of the present disclosure.

[0029] Figure 6 A schematic diagram schematically shows a brushstroke texture map according to an embodiment of the present disclosure;

[0030] Figure 7 A schematic diagram schematically shows a brush stroke graphic of an embodiment of the present disclosure;

[0031] Figure 8A block diagram of a brush stroke simulation device according to an embodiment of the present disclosure is schematically shown;

[0032] Fig. 9 A block diagram of an electronic device for performing brush stroke simulation according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0034] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0035] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0036] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0037] With the development of graphics processing technology and human-computer interaction technology, digital calligraphy and painting creation has gradually become an important way of artistic expression and cultural communication.

[0038] However, in the process of digital processing of traditional brush writing, there may be poor brushstroke simulation effects and limited ink rendering methods. For example, existing painting software supports the generation of simulated brush strokes of varying thicknesses by relying on pressure sensing devices, but it is insufficient in terms of brushstroke direction, ink thickness, and dynamic ink diffusion, which results in poor brushstroke simulation effects.

[0039] The disclosed embodiments provide a method, device and computer-readable storage medium for simulating brush strokes based on physical interaction. The brush stroke simulation device can be integrated into an electronic device, and the electronic device can be a terminal device or a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal device can be a mobile phone, a computer, a tablet computer, a smart screen, a smart home appliance, a car terminal, etc.

[0040] The disclosed embodiment provides a brush stroke simulation method. The method includes: in response to a detected interactive action generated based on a touch device, obtaining force feedback parameters of the interactive action. Then, generating an initial stroke trajectory based on the force feedback parameters and a preset brush tip model. Next, adjusting the ink penetration parameters and / or the stroke texture features of the initial stroke trajectory to obtain a rendered brush stroke graphic, and controlling the presentation of the brush stroke graphic on a display screen of the touch device.

[0041] The following description will be made by taking the integration of a brush stroke simulation device into a server as an example. Figure 1 The system architecture of the brush stroke simulation method and device according to an embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0042] The system architecture 100 according to this embodiment may include a touch device 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the touch device 101 and the server 103. The network 102 may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The server 103 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud computing, network services, and middleware services.

[0043] The touch device 101 interacts with the server 103 via the network 102 to receive or send data, etc. The touch device 101 is used, for example, to obtain force feedback parameters of the interaction action in response to detecting an interaction action triggered by a user, and send the force feedback parameters to the server 103 via the network 102 .

[0044] For example, a user can interact with a touch device through physical media such as a stylus, a mouse, a keyboard, a virtual reality (VR) device, an augmented reality (AR) device, etc. The interactive action triggered by the user can be, for example, writing, drawing, image processing, etc. on the display screen of the touch device, which is not limited in the embodiments of the present disclosure.

[0045] The server 103 may be a server that provides various services, for example, a server that performs brush stroke simulation according to force feedback parameters provided by the touch device 101 (only an example).

[0046] For example, the server 103 generates an initial brush stroke trajectory according to the force feedback parameters and a preset brush tip model in response to the acquired force feedback parameters uploaded by the touch control device 101. The server 103 can also be used to adjust the ink penetration parameters and / or brush stroke texture features of the initial brush stroke trajectory to obtain a rendered brush stroke graphic. The server 103 can send the rendered brush stroke graphic to the touch control device 101 so that the touch control device 101 can display the rendered brush stroke graphic.

[0047] It should be noted that the brush stroke simulation method provided in the embodiment of the present disclosure can be executed by the server 103. Accordingly, the brush stroke simulation device provided in the embodiment of the present disclosure can be set in the server 103. The brush stroke simulation method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 103 and can communicate with the touch device 101 and / or the server 103. Accordingly, the brush stroke simulation device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 103 and can communicate with the touch device 101 and / or the server 103.

[0048] It should be understood that Figure 1 The number of touch devices, networks and servers in the embodiment is only for illustration. Any number of touch devices, networks and servers may be provided according to implementation requirements.

[0049] The present disclosure provides a brush stroke simulation method. Figure 1 The system architecture of Figure 2~Figure 9 The brush stroke simulation method according to the exemplary embodiment of the present disclosure is described below. The brush stroke simulation method according to the exemplary embodiment of the present disclosure can be, for example, Figure 1 The server 103 shown is used for execution.

[0050] Figure 2 The flowchart of the brush stroke simulation method according to an embodiment of the present disclosure is schematically shown.

[0051] like Figure 2As shown, the brush stroke simulation method 200 of the embodiment of the present disclosure may include, for example, operations S210 to S240.

[0052] In operation S210, in response to a detected interaction action generated based on a touch control device, a force feedback parameter of the interaction action is acquired.

[0053] In operation S220, an initial brush stroke trajectory is generated according to the force feedback parameters and a preset brush tip model.

[0054] In operation S230, the ink penetration parameter and / or the brush stroke texture feature of the initial brush stroke trajectory are adjusted to obtain a rendered brush stroke graphic.

[0055] In operation S240 , the control is to present a brush stroke graphic on a display screen of the touch-controlled device.

[0056] The following example illustrates the example process of each operation of the brush stroke simulation method of this embodiment.

[0057] Exemplarily, in response to the detected interactive action generated based on the touch device, at least one of the following parameters of the interactive action is obtained as a force feedback parameter: current movement speed, pressure value parameter, interactive position parameter and interactive angle parameter. The force feedback parameter of the interactive action will affect the morphological change of the brush stroke.

[0058] Next, the initial stroke trajectory is generated based on the force feedback parameters and the pre-built brush tip model. For example, a parameterized inverted cone model can be used to simulate the brush tip, and the brush stroke can be composed of multiple inverted cones. Multiple inverted cones are superimposed and covered on each other to form a brush stroke trajectory that matches the interactive action.

[0059] Figure 3 A schematic diagram of an inverted cone model of an embodiment of the present disclosure is schematically shown. Figure 3 As shown, the inverted cone parameters include, for example, the vertex (O) position parameter, the base radius parameter R, and the cone angle parameter α of the inverted cone.

[0060] As an example, based on a pre-built inverted cone model, the inverted cone direction and the cone vertex position can be determined according to the interaction position parameter and the interaction angle parameter. According to the pressure value parameter, the area radius of the stroke area formed by the projection of the inverted cone on the paper surface can be determined. And, according to the inverted cone direction, the cone vertex position and the area radius of the stroke area, an initial stroke trajectory is generated.

[0061] In the process of the user triggering the physical interaction with the touch device, the contact position between the physical device and the touch device constitutes the interaction position parameter of the interaction action. The inverted cone direction can be determined according to the interaction position parameter and the interaction angle parameter of the interaction action. Assume that the first position parameter of the interaction action is , the second position parameter is , the direction of the inverted cone can be expressed using formula (1):

[0062] Formula (1)

[0063] in, , , P represents the original vector, represents the rotated vector, Indicates the rotation angle, which can be the contact angle between the physical device and the touch device display.

[0064] The position of the cone vertex of the inverted cone can be determined according to the interaction position parameter and the interaction angle parameter of the interaction action. For example, the position of the vertex of the bottom circle of the inverted cone can be determined according to the interaction position parameter and the interaction angle parameter. For example, the position of the vertex of the bottom circle of the inverted cone is expressed by formula (2):

[0065] Formula (2)

[0066] Among them, Vertex(i,t) represents the vertex position of the inverted cone bottom circle, P(t) represents the center position of the inverted cone bottom circle at time t, R(t) represents the radius of the cone bottom at P(t), h(t) represents the cone height, and N(t) represents the normal direction at P(t). For each center point P(t), the tangent direction T(t), normal direction N(t), and binormal direction B(t) at P(t) can be calculated.

[0067] Exemplarily, based on the interaction position parameters at the target time t, for example, the center position parameters P(t) of the bottom circle of the inverted cone. The tangent direction T(t), the normal direction N(t) and the binormal direction B(t) at P(t) can be calculated based on the interaction angle parameters at the target time t, for example, the cone angle parameters α constituting the inverted cone.

[0068] The area radius of the brush stroke area formed by the projection of the inverted cone on the paper surface can be determined according to the pressure value parameter. For example, the area radius of the brush stroke area formed by the projection of the inverted cone can be expressed by formula (3):

[0069] R=F / k Formula (3)

[0070] Among them, F represents the pressure value, k represents the adjustment factor, and its value can be obtained through experiments. R represents the radius of the inverted cone, and the value range of R is [R1, R2], where R1 represents the preset minimum radius of contact between the pen and the paper surface, and R2 represents the preset maximum radius of contact between the pen and the paper surface.

[0071] The projections of the multiple inverted cones on the touch device display screen form a pen stroke area, and the pen stroke area is filled along the pen diameter direction to form a pen path, so as to obtain an initial pen stroke trajectory matching the user's interactive action.

[0072] Figure 4 A schematic diagram of an initial brush stroke trajectory of an embodiment of the present disclosure is schematically shown. When a user triggers an interactive action based on the display screen of a touch-controlled device, the brush stroke trajectory is generated in real time according to the force feedback parameters such as the position, speed and angle of the interactive action in three-dimensional space, and a parameterized curve is used to smoothly describe the brush stroke trajectory. This is conducive to enhancing the naturalness and continuity of the virtual brush strokes and improving the interactive experience of virtual brush writing.

[0073] After obtaining the initial stroke trajectory, the ink penetration parameters and / or stroke texture characteristics of the initial stroke trajectory can be adjusted to obtain a brush stroke graphic that matches the interactive action, and control the presentation of the brush stroke graphic on the display screen of the touch device.

[0074] Figure 5 The schematic diagram schematically shows the process of rendering the initial brush stroke trajectory according to an embodiment of the present disclosure.

[0075] like Figure 5 As shown, operation S502 and / or operation S503 may be performed on the initial stroke trajectory 501 to obtain a brush stroke graphic 504 .

[0076] Operation S502 : adjusting the ink penetration parameter of the initial stroke trajectory 501 .

[0077] Operation S503 : adjusting the brush stroke texture feature of the initial brush stroke track 501 .

[0078] The following is an example flow of each operation of this embodiment.

[0079] Exemplarily, the ink penetration parameter may include ink transparency. The ink penetration parameter of the initial brush stroke trajectory is adjusted to obtain a rendered brush stroke graphic, including: for any target track point in the initial brush stroke trajectory, according to the distance between the target track point and the center of the brush stroke area and the pressure value at the target track point, calculating the ink transparency matching the target track point. According to the ink transparency matching any target track point, the initial brush stroke trajectory is rendered to obtain a rendered brush stroke graphic.

[0080] The color of the ink changes with the ink concentration. During the ink diffusion process, some ink particles float on the surface of the ink, and some ink particles flow with the ink. The ink color of the ink diffusion part is lighter, with an ink-wash effect.

[0081] For example, the initial brush stroke trajectory can be shaded by transparency interpolation to obtain a brush stroke graphic. Taking any target trajectory point (i, j) in the initial brush stroke trajectory as an example, assuming that the distance from the target trajectory point to the center of the brush stroke area is D (i, j), and the pressure value at the target trajectory point is F (i, j), the ink transparency T (i, j) matching the target trajectory point can be expressed by formula (4):

[0082] T(i,j)=K(F(i,j)-D(i,j)) Formula (4)

[0083] K represents the transparency constant, and the value range of T(i,j) is [0,1]. The ink transparency T(i,j) will be dynamically interpolated and updated with the change of time and ink diffusion range, which represents the process of the ink edge gradually fading.

[0084] Exemplarily, the ink penetration parameters may also include ink diffusion, and the ink penetration parameters of the initial brush stroke trajectory are adjusted to obtain a rendered brush stroke graphic, including: calculating the grayscale value gradient amplitude of each pixel point in the initial brush stroke trajectory; binarizing the grayscale value gradient amplitude to obtain a binary mask that matches the corresponding pixel point; and adjusting the ink diffusion that matches the corresponding pixel point according to the binary mask to obtain a rendered brush stroke graphic.

[0085] In the process of adjusting the ink diffusion degree matching the corresponding pixel point according to the binary mask, the ink diffusion degree matching the corresponding pixel point can be adjusted according to the binary mask and at least one of the following parameters to obtain a rendered brush stroke graphic: dynamic noise density, ink diffusion range, ink solubility and paper density constant.

[0086] The Sobel operator is an edge detection algorithm in image processing that can operate based on the local gradient of image pixels. By calculating the gradient of the image in the horizontal and vertical directions, the Sobel operator can effectively detect the edges of objects in the image.

[0087] The image can be convolved to calculate the gradient values ​​of the image in the x and y directions. For example, a horizontal convolution kernel can be used Convolve the image to get the horizontal gradient . You can use a vertical convolution kernel Convolve the image to get the vertical gradient .

[0088] Horizontal convolution kernel used by the Sobel operator as follows:

[0089] Vertical convolution kernel used by the Sobel operator as follows:

[0090] Horizontal gradient , vertical gradient ,

[0091] Where I represents the gray value matrix of the image, Represents a convolution operation.

[0092] According to the horizontal gradient of each pixel point in the initial stroke trajectory and vertical gradient , calculate the gray value gradient amplitude of the corresponding pixel , and the gray value gradient direction of the corresponding pixel .

[0093] As an example, the grayscale gradient amplitude of each pixel in the initial stroke trajectory can be normalized to the range of [0, 1] by setting a threshold T, and a mask can be generated by a binarization operation. The binarization process can be expressed by equation (5):

[0094] Formula (5)

[0095] M(i,j) represents the binary mask at the pixel point (i,j). The ink diffusion at the pixel point (i,j) can be adjusted according to M(i,j) to obtain the rendered brush stroke graphic.

[0096] For example, the ink diffusion degree D(i, j) at the pixel point (i, j) can be expressed by equation (6):

[0097] Formula (6)

[0098] Among them, K represents the paper density constant, N (i, j) represents the dynamic noise density, R (i, j) represents the ink diffusion range, and S (i, j) represents the ink solubility.

[0099] By adjusting the ink penetration parameters N(i,j), R(i,j), and S(i,j), simulation applications of different paper types and ink environments can be supported, providing great flexibility and scalability for digital ink rendering.

[0100] As an optional method, a dynamic noise generation algorithm can be used to control the random boundaries of the initial stroke trajectory to obtain a rendered brush stroke graphic. The dynamic noise generation algorithm in the material shader can further enhance the blur effect and natural transition effect of the ink edge, making the ink diffusion form closer to the ink absorption characteristics of real paper. For example, the dynamic noise generation function Perlin (N) can be used to control the random boundaries of the initial stroke trajectory.

[0101] In the process of adjusting the stroke texture feature of the initial stroke trajectory, the initial stroke trajectory can be subjected to trajectory contour detection to obtain the internal colored area of ​​the initial stroke trajectory, and the preset stroke texture map is superimposed on the internal colored area of ​​the initial stroke trajectory to obtain a brush stroke graphic with an erosion effect.

[0102] In the process of detecting the contour of the initial stroke trajectory, for any trajectory point in the initial stroke trajectory, the vector dot product of the vertex normal vector of the corresponding trajectory point and the preset viewing direction vector can be calculated. According to the absolute value of the vector dot product, the internal colored area of ​​the initial stroke trajectory is identified.

[0103] Figure 6 A schematic diagram of a brushstroke texture map of an embodiment of the present disclosure is schematically shown. In the process of superimposing the brushstroke texture map on the internal colored area of ​​the initial brushstroke trajectory, the brushstroke texture map can be sampled based on any area point in the internal colored area to obtain a target sampling map that matches the corresponding area point. The target sampling map is superimposed on the location of the corresponding area point to obtain an initial erosion effect value based on the corresponding area point. The initial erosion effect value is adjusted using a power exponent to obtain an erosion effect value after sharpness adjustment. The erosion effect value after sharpness adjustment is scaled to obtain a target erosion effect value based on the corresponding area point. And, the target erosion effect value is applied to the corresponding area point in the internal colored area to obtain a brush stroke graphic with an erosion effect.

[0104] In the process of scaling the erosion effect value after sharpness adjustment to obtain the target erosion effect value based on the corresponding regional point, the erosion effect value after sharpness adjustment can be scaled to obtain the transition erosion effect value. The output value of the transition erosion effect value is limited to a preset range to obtain a smooth erosion effect value. And, based on a preset threshold inversion parameter, the smooth erosion effect value is threshold inverted to obtain the target erosion effect value based on the corresponding regional point.

[0105] By overlaying the stroke texture map on the inner colored area of ​​the initial stroke trajectory, it is helpful to show erosion or hidden effect on the edge of the object, and can achieve reverse edge erosion effect, which can be used for special ink brush rendering style.

[0106] For example, for any pixel point (i, j) in the initial stroke trajectory, assume that N (i, j) represents the vertex normal vector at the pixel point (i, j), C represents the preset viewing direction vector, and T represents the preset threshold. In the case of , the corresponding pixel point (i, j) is located at the contour position of the initial stroke trajectory. In the case of , it indicates that the corresponding pixel point (i, j) is located in the inner colored area of ​​the initial stroke trajectory.

[0107] For example, in In this case, the stroke texture map is not superimposed on the contour position of the initial stroke trajectory, and the initial erosion effect value E(i,j)=0.

[0108] exist In the case of , the stroke texture map is superimposed on the internal colored area of ​​the initial stroke trajectory to obtain the initial erosion effect value E (i, j).

[0109] Optionally, based on any region point (i, j) in the internal shading area, the brush stroke texture map is sampled to obtain a target sample map that matches the corresponding region point . Sample the target texture Superimpose on the location of the corresponding regional point to obtain the initial erosion effect value based on the corresponding regional point .

[0110] The initial erosion effect value is adjusted using the power exponent to obtain the erosion effect value after sharpness adjustment. For example, the initial erosion effect value E(i,j) is adjusted using the power exponent n to obtain the erosion effect value after sharpness adjustment. .

[0111] The erosion effect value after sharpness adjustment is scaled to obtain the target erosion effect value based on the corresponding area point. For example, the erosion effect value after sharpness adjustment is scaled by the scaling factor k. Scale to get the transition erosion effect value .

[0112] The output value of the transition erosion effect value is limited to a preset range to obtain a smooth erosion effect value. For example, using the Clamp(x,0,1) function, The output value is limited to the range of [0,1] to obtain a smooth erosion effect value .

[0113] Optionally, based on a preset threshold inversion parameter, the smooth erosion effect value is threshold inverted to obtain a target erosion effect value based on the corresponding area point. For example, based on a preset threshold inversion parameter s, the smooth erosion effect value is inverted using the Step(a,x) function. Perform threshold inversion processing to obtain the target erosion effect value based on the corresponding area point Among them, the Step(a,x) function is used to output 1 when x≥a, otherwise it outputs 0.

[0114] Next, the target erosion effect value is applied to the corresponding area points in the internal colored area to obtain a brush stroke graphic with an erosion effect.

[0115] Optionally, the pixel coordinates corresponding to the brushstroke texture map may be adjusted to achieve displacement, rotation and scaling operations on the brushstroke texture map to obtain a brushstroke graphic.

[0116] Figure 7 The schematic diagram of a brush stroke graphic of the embodiment of the present disclosure is schematically shown. The brush stroke graphic generated by the brush stroke simulation method of the embodiment of the present disclosure can more realistically restore the ink diffusion effect, which is conducive to solving the problem of static ink marks lacking dynamic changes in traditional rendering methods, and is conducive to achieving a highly interactive and expressive brush creation solution while ensuring high-resolution rendering.

[0117] It is worth noting that the initial stroke trajectory can be adjusted only by ink penetration parameters, or only by brush texture features, or both by ink penetration parameters and brush texture features. The intermediate stroke graph obtained by adjusting the ink penetration parameters can be used as input data for the brush texture feature adjustment operation. The intermediate stroke graph obtained by adjusting the brush texture features can also be used as input data for the ink penetration parameter adjustment operation. This embodiment does not limit this.

[0118] After the brush stroke graphic is obtained, the brush stroke graphic is controlled to be presented on the display screen of the touch device.

[0119] As an optional manner, in response to the detected interactive action, the brush stroke graphic matching the interactive action may be persisted in the memory of the storage device.

[0120] Figure 8 A block diagram of a brush stroke simulation device according to an embodiment of the present disclosure is schematically shown.

[0121] like Figure 8 As shown, the brush stroke simulation device 800 of the embodiment of the present disclosure includes, for example, a first processing module 810 , a second processing module 820 , a third processing module 830 and a fourth processing module 840 .

[0122] The first processing module 810 is used to obtain force feedback parameters of the interactive action in response to the detected interactive action generated based on the touch device; the second processing module 820 is used to generate an initial brush stroke trajectory based on the force feedback parameters and a preset brush tip model; the third processing module 830 is used to adjust the ink penetration parameters and / or brush stroke texture characteristics of the initial brush stroke trajectory to obtain a rendered brush stroke graphic; the fourth processing module 840 is used to control the presentation of the brush stroke graphic on the display screen of the touch device.

[0123] The brush stroke graphics generated by the brush stroke simulation method of the disclosed embodiment can more realistically restore the ink diffusion effect, which is conducive to solving the problem of lack of dynamic changes in static ink marks in traditional rendering methods, and is conducive to achieving a highly interactive and expressive brush creation solution while ensuring high-resolution rendering.

[0124] According to an embodiment of the present disclosure, the first processing module includes: a first processing sub-module, used to obtain at least one of the following parameters of the interaction action in response to the detected interaction action as the force feedback parameter: current movement speed, pressure value parameter, interaction position parameter and interaction angle parameter.

[0125] According to an embodiment of the present disclosure, the second processing module includes: a second processing sub-module, used to determine the direction of the inverted cone and the position of the cone vertex based on the pre-constructed inverted cone model according to the interaction position parameter and the interaction angle parameter; a third processing sub-module, used to determine the area radius of the stroke area formed by the projection of the inverted cone on the paper surface according to the pressure value parameter; and a fourth processing sub-module, used to generate the initial stroke trajectory according to the inverted cone direction, the cone vertex position and the area radius of the stroke area.

[0126] According to an embodiment of the present disclosure, the ink penetration parameter includes ink transparency, and the third processing module includes: a fifth processing sub-module, for calculating, for any target trajectory point in the initial brush stroke trajectory, the ink transparency that matches the target trajectory point according to the distance between the target trajectory point and the center of the brush stroke area and the pressure value at the target trajectory point; and a sixth processing sub-module, for rendering the initial brush stroke trajectory according to the ink transparency that matches any target trajectory point to obtain the rendered brush stroke graphic.

[0127] According to an embodiment of the present disclosure, the ink penetration parameters include ink diffusion, and the third processing module also includes: a seventh processing sub-module, used to calculate the grayscale value gradient amplitude of each pixel point in the initial brush stroke trajectory; an eighth processing sub-module, used to binarize the grayscale value gradient amplitude to obtain a binary mask matching the corresponding pixel point; and a ninth processing sub-module, used to adjust the ink diffusion matching the corresponding pixel point according to the binary mask to obtain the rendered brush stroke graphic.

[0128] According to an embodiment of the present disclosure, the ninth processing submodule includes: a first processing unit, used to adjust the ink diffusion matching the corresponding pixel point according to the binary mask and at least one of the following parameters, to obtain the rendered brush stroke graphic, dynamic noise density, ink diffusion range, ink solubility and paper density constant.

[0129] According to an embodiment of the present disclosure, the third processing module further includes: a tenth processing submodule, which is used to control the random boundary of the initial brush stroke trajectory by using a dynamic noise generation algorithm to obtain the rendered brush stroke graphic.

[0130] According to an embodiment of the present disclosure, the third processing module also includes: an eleventh processing sub-module, used to perform trajectory contour detection on the initial brush stroke trajectory to obtain the internal colored area of ​​the initial brush stroke trajectory; and a twelfth processing sub-module, used to superimpose a preset brush stroke texture map on the internal colored area of ​​the initial brush stroke trajectory to obtain the brush stroke graphic with an erosion effect.

[0131] According to an embodiment of the present disclosure, the eleventh processing submodule includes: a second processing unit, used to calculate the vector dot product of the vertex normal vector based on the corresponding trajectory point and the preset viewing direction vector for any trajectory point in the initial brush stroke trajectory; and a third processing unit, used to identify the internal colored area of ​​the initial brush stroke trajectory based on the absolute value of the vector dot product.

[0132] According to an embodiment of the present disclosure, the twelfth processing submodule includes: a fourth processing unit, which is used to sample the brush stroke texture map based on any area point in the internal colored area to obtain a target sampling map that matches the corresponding area point; a fifth processing unit, which is used to superimpose the target sampling map on the position of the corresponding area point to obtain an initial erosion effect value based on the corresponding area point; a sixth processing unit, which is used to adjust the initial erosion effect value using a power exponent to obtain an erosion effect value after sharpness adjustment; a seventh processing unit, which is used to scale the erosion effect value after sharpness adjustment to obtain a target erosion effect value based on the corresponding area point; and an eighth processing unit, which is used to apply the target erosion effect value to the corresponding area point in the internal colored area to obtain the brush stroke graphic with erosion effect.

[0133] According to an embodiment of the present disclosure, the seventh processing unit includes: a first processing sub-unit, used to scale the erosion effect value after sharpness adjustment to obtain a transition erosion effect value; a second processing sub-unit, used to limit the output value of the transition erosion effect value within a preset range to obtain a smooth erosion effect value; and a third processing sub-unit, used to perform threshold inversion processing on the smooth erosion effect value based on a preset threshold inversion parameter to obtain the target erosion effect value based on the corresponding area point.

[0134] According to an embodiment of the present disclosure, the third processing module further includes: a thirteenth processing submodule, which is used to adjust the pixel coordinates corresponding to the brushstroke texture map to achieve displacement, rotation and scaling operations on the brushstroke texture map.

[0135] According to an embodiment of the present disclosure, the brush stroke simulation device further includes: a fifth processing module, configured to persist the brush stroke graphic matching the interactive action into the memory of a storage device in response to the detected interactive action.

[0136] It should be noted that the information collection, storage, use, processing, transmission, provision and disclosure involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0137] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0138] Fig. 9 A block diagram of an electronic device for executing a brush stroke simulation method according to an embodiment of the present disclosure is schematically shown.

[0139] Fig. 9A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 900 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0140] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0141] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0142] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the brush stroke simulation method. For example, in some embodiments, the brush stroke simulation method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the brush stroke simulation method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the brush stroke simulation method in any other appropriate manner (e.g., by means of firmware).

[0143] Various embodiments of the systems and techniques described above may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] The program code based on the method for implementing the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable brush stroke simulation device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine or completely on a remote machine or server.

[0145] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0146] To provide interaction with an object, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the object; and a keyboard and pointing device (e.g., a mouse or trackball) through which the object can provide input to the computer. Other types of devices can also be used to provide interaction with an object; for example, the feedback provided to the object can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the object can be received in any form (including acoustic input, voice input, or tactile input).

[0147] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data server), or a computing system that includes a middleware component (e.g., an application server), or a computing system that includes a frontend component (e.g., an object computer having a graphical object interface or a web browser through which the object can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0148] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0149] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0150] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A brush stroke simulation method based on physical interaction, characterized in that: The method comprises: In response to the detected interactive action generated based on the touch device, obtaining a force feedback parameter of the interactive action; Generate an initial brush stroke trajectory according to the force feedback parameters and a preset brush tip model; Adjusting the brush stroke texture feature of the initial brush stroke trajectory to obtain a rendered brush stroke graphic; and Controlling the presentation of the brush stroke graphic on the display screen of the touch-control device, The step of adjusting the brush stroke texture feature of the initial brush stroke trajectory to obtain a rendered brush stroke graphic includes: Performing trajectory contour detection on the initial stroke trajectory to obtain an inner colored area of ​​the initial stroke trajectory; Based on any area point in the internal colored area, the brushstroke texture map is sampled to obtain a target sampling map matching the corresponding area point; The target sampling map is superimposed on the location of the corresponding regional point to obtain an initial erosion effect value based on the corresponding regional point; The initial erosion effect value is adjusted by using a power exponent to obtain an erosion effect value after sharpness adjustment; Scaling the erosion effect value after the sharpness adjustment to obtain a target erosion effect value based on the corresponding area point; and The target erosion effect value is applied to corresponding area points in the internal colored area to obtain the brush stroke graphic with erosion effect.

2. The method according to claim 1, characterized in that The step of obtaining force feedback parameters of the interaction action in response to the detected interaction action generated based on the touch device includes: In response to the detected interaction action, at least one of the following parameters of the interaction action is obtained as the force feedback parameter: Current moving speed, pressure value parameter, interaction position parameter and interaction angle parameter.

3. The method according to claim 2, characterized in that The generating of the initial brush stroke trajectory according to the force feedback parameter and the preset brush tip model comprises: Based on the pre-constructed inverted cone model, the inverted cone direction and the cone vertex position are determined according to the interaction position parameter and the interaction angle parameter; Determining the radius of the brush stroke area formed by the projection of the inverted cone on the paper surface according to the pressure value parameter; and The initial brush stroke trajectory is generated according to the inverted cone direction, the cone vertex position and the area radius of the brush stroke area.

4. The method according to claim 1, characterized in that: The method further comprises: The ink penetration parameter of the initial brush stroke trajectory is adjusted to obtain a rendered brush stroke graphic.

5. The method according to claim 4, characterized in that The ink penetration parameter includes ink transparency, and the ink penetration parameter of the initial brush stroke trajectory is adjusted to obtain a rendered brush stroke graphic, including: For any target track point in the initial stroke track, according to the distance between the target track point and the center of the stroke area and the pressure value at the target track point, calculate the ink transparency matching the target track point; and The initial brush stroke trajectory is rendered according to the ink transparency matched with any target trajectory point to obtain the rendered brush stroke graphic.

6. The method according to claim 4, characterized in that The ink penetration parameter includes ink diffusion, and the ink penetration parameter of the initial brush stroke trajectory is adjusted to obtain a rendered brush stroke graphic, including: Calculating the grayscale gradient amplitude of each pixel point in the initial brush stroke trajectory; Binarizing the grayscale gradient amplitude to obtain a binary mask that matches the corresponding pixel point; and According to the binary mask, the ink diffusion degree matching the corresponding pixel point is adjusted to obtain the rendered brush stroke graphic.

7. The method according to claim 6, characterized in that The step of adjusting the ink diffusion degree matching the corresponding pixel point according to the binary mask to obtain the rendered brush stroke graphic comprises: According to the binary mask and at least one of the following parameters, the ink diffusion degree matching the corresponding pixel point is adjusted to obtain the rendered brush stroke graphic, Dynamic noise density, ink spread range, ink solubility, and paper density constants.

8. The method according to claim 4, characterized in that The step of adjusting the ink penetration parameter of the initial brush stroke trajectory to obtain a rendered brush stroke graphic comprises: A dynamic noise generation algorithm is used to control the random boundary of the initial brush stroke trajectory to obtain the rendered brush stroke graphic.

9. The method according to claim 1, characterized in that The performing trajectory contour detection on the initial stroke trajectory to obtain an internal colored area of ​​the initial stroke trajectory includes: For any track point in the initial stroke track, calculating a vector dot product between a vertex normal vector of the corresponding track point and a preset viewing angle direction vector; and The inner colored area of ​​the initial stroke trajectory is identified according to the absolute value of the vector dot product.

10. The method according to claim 1, characterized in that Scaling the erosion effect value after the sharpness adjustment to obtain a target erosion effect value based on a corresponding area point includes: Scaling the erosion effect value after the sharpness adjustment to obtain a transition erosion effect value; Limiting the output value of the transition erosion effect value to a preset range to obtain a smooth erosion effect value; and Based on a preset threshold inversion parameter, the smoothed erosion effect value is subjected to threshold inversion processing to obtain the target erosion effect value based on the corresponding area point.

11. The method according to claim 1, characterized in that: The step of adjusting the brush stroke texture feature of the initial brush stroke trajectory to obtain a rendered brush stroke graphic further includes: The pixel coordinates corresponding to the brushstroke texture map are adjusted to achieve displacement, rotation and scaling operations on the brushstroke texture map.

12. The method according to claim 1, characterized in that The method further comprises: In response to the detected interaction action, the brush stroke graphic matching the interaction action is persisted in the memory of a storage device.

13. A brush stroke simulation device based on physical interaction, characterized in that: include: A first processing module, configured to obtain a force feedback parameter of the interaction action in response to a detected interaction action generated based on a touch control device; A second processing module is used to generate an initial brush stroke trajectory according to the force feedback parameters and a preset brush tip model; A third processing module is used to adjust the brush stroke texture feature of the initial brush stroke trajectory to obtain a rendered brush stroke graphic; as well as The fourth processing module is used to control the presentation of the brush stroke graphic on the display screen of the touch control device. Wherein, the third processing module is used for: Performing trajectory contour detection on the initial stroke trajectory to obtain an inner colored area of ​​the initial stroke trajectory; Based on any area point in the internal colored area, the brushstroke texture map is sampled to obtain a target sampling map matching the corresponding area point; The target sampling map is superimposed on the location of the corresponding regional point to obtain an initial erosion effect value based on the corresponding regional point; The initial erosion effect value is adjusted by using a power exponent to obtain an erosion effect value after sharpness adjustment; Scaling the erosion effect value after the sharpness adjustment to obtain a target erosion effect value based on the corresponding area point; and The target erosion effect value is applied to corresponding area points in the internal colored area to obtain the brush stroke graphic with erosion effect.

14. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the brush stroke simulation method according to any one of claims 1 to 12.

15. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the brush stroke simulation method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Generation method and device of stylized hand drawing effect, storage medium and electronic device

    CN117911600A

  • Method and system for measuring text-rendering quality

    US20100303306A1