Virtual brush implementation method, device and computer readable storage medium

By capturing real-world scenes through the camera of a terminal device and forming virtual brush stroke areas, the problem of high cost and complex operation of existing virtual brush devices is solved, and a simple virtual brush painting effect is achieved.

CN111862349BActive Publication Date: 2025-12-16DOUYIN VISION CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN201910345745.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-26
Publication Date
2025-12-16
Estimated Expiration
2039-04-26

AI Technical Summary

Technical Problem

Existing virtual paintbrush devices are expensive and the painting process is complex, requiring operation in front of a camera.

Method used

The system captures the real-world scene using the camera on the terminal device, creates a virtual brushstroke area within the scene based on user input, and then merges the brushstrokes with the real-world scene for display, thus enabling virtual brush painting.

Benefits of technology

Virtual brush painting can be achieved without the need for hardware virtual brushes, reducing the computational complexity of the painting process and making painting simpler.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111862349B_ABST
    Figure CN111862349B_ABST
Patent Text Reader

Abstract

The present disclosure provides a virtual brush implementation method, a virtual brush implementation device, a virtual brush implementation hardware device and a computer readable storage medium. The virtual brush implementation method comprises: acquiring a real shooting scene through a camera of a terminal device; forming a handwriting area of a virtual brush in the real shooting scene according to an operation on the terminal device; and forming handwriting of the virtual brush according to the handwriting area; wherein the handwriting is fused with the real shooting scene, and the fused picture is displayed on the terminal device. The present disclosure can realize the virtual brush drawing function without using a hardware virtual brush, and the present disclosure performs virtual brush drawing in the real shooting scene acquired by the camera, thereby reducing the calculation complexity in the drawing process and making the virtual brush drawing easier to implement.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of augmented reality technology, and in particular, to an augmented reality virtual brush implementation method, device and computer readable storage medium. BACKGROUND

[0002] Virtual technology is a technology that calculates the position and angle of a camera image in real time and adds corresponding images, videos and 3D models. The goal of this technology is to overlay a virtual world on the real world on a screen and interact with it.

[0003] With the further development of virtual technology, in order to meet people's imagination of virtual creation, a virtual brush has appeared on the market. The virtual brush is a hardware device. As long as the virtual brush is waved in front of the camera of a terminal device, the user's idea can be seen slowly taking shape in front of the user.

[0004] However, the existing virtual brush is a physical virtual brush. The brush is not only expensive, but also needs to be painted in front of the camera, which makes the implementation more complex. SUMMARY

[0005] The technical problem solved by the present disclosure is to provide a virtual brush implementation method to at least partially solve the technical problem of inaccurate existing video classification. In addition, a virtual brush implementation device, a virtual brush implementation hardware device, a computer readable storage medium and a virtual brush implementation terminal are also provided.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present disclosure, the following technical solution is provided:

[0007] A virtual brush implementation method, comprising:

[0008] acquiring a real shooting scene through a camera of a terminal device;

[0009] forming a pen trail area of a virtual brush in the real shooting scene according to an operation acting on the terminal device;

[0010] forming a pen trail of the virtual brush according to the pen trail area;

[0011] wherein the pen trail is integrated with the real shooting scene, and the integrated picture is displayed on the terminal device.

[0012] Further, the forming of the pen trail area of the virtual brush in the real shooting scene according to the operation acting on the terminal device comprises:

[0013] determining at least one point formed by the virtual brush in the real shooting scene according to the operation acting on the terminal device;

[0014] According to the at least one point, a stroke area of a virtual brush is formed.

[0015] Further, the stroke area of the virtual brush formed according to the at least one point comprises:

[0016] When the number of points is multiple, the multiple points are connected according to a preset rule in the real shooting scene.

[0017] According to the connection, a stroke area of a virtual brush is formed.

[0018] Further, the at least one point formed by the operation acting on the terminal device in the real shooting scene comprises:

[0019] A three-dimensional coordinate system is established in the real shooting scene, and an origin of the three-dimensional coordinate is determined.

[0020] A reference axis is selected from three axes of the three-dimensional coordinate system, and at least one point formed in the real shooting scene is determined along the reference axis according to the operation acting on the terminal device.

[0021] Further, when the number of points is multiple, the multiple points are connected according to a preset rule in the real shooting scene, comprising:

[0022] When the number of points is multiple, the multiple points are connected in the three-dimensional coordinate system in the real shooting scene along the positive direction or the negative direction of the reference axis.

[0023] Further, the stroke area of the virtual brush formed according to the connection comprises:

[0024] According to the connection, a first line segment is obtained, the first line segment comprises at least one sub-line segment, and the end points of the sub-line segment are composed of points in the multiple points;

[0025] For each sub-line segment, a perpendicular line segment of the sub-line segment is obtained according to the end point, and multiple perpendicular line segments are obtained.

[0026] According to the positional relationship, the end points of the multiple perpendicular line segments are divided into two categories, and each category of end points is connected into a line to obtain a second line segment and a third line segment.

[0027] The stroke area of the virtual brush is formed by the sub-line segment corresponding to the first point, the sub-line segment corresponding to the last point, the second line segment and the third line segment.

[0028] Further, the stroke of the virtual brush formed according to the stroke area comprises:

[0029] Respective ends of the handwriting area are formed with elongated areas of preset shapes as starting and ending points of the virtual brush;

[0030] The handwriting of the virtual brush is formed by the handwriting area and the elongated areas.

[0031] Further, the handwriting of the virtual brush formed according to the handwriting area comprises:

[0032] The handwriting of the virtual brush is formed by filling the handwriting area with colors or materials.

[0033] Further, the method further comprises:

[0034] Detecting a moving direction and a tilt angle of the terminal device;

[0035] Determining a direction of a plane on which the handwriting of the virtual brush is formed according to the moving direction and the tilt angle;

[0036] According to the direction, the plane on which the handwriting of the virtual brush is formed faces the screen.

[0037] Further, the method further comprises:

[0038] Detecting a moving operation of the terminal device, taking the moving operation as an operation acting on the terminal device; or, detecting a gesture action generated on the screen of the terminal device, taking the gesture action as an operation acting on the terminal device.

[0039] A virtual brush implementation device comprises:

[0040] A real scene acquisition module is configured to acquire a real shooting scene through a camera of a terminal device;

[0041] A handwriting area forming module is configured to form a handwriting area of a virtual brush in the real shooting scene according to an operation acting on the terminal device;

[0042] A handwriting forming module is configured to form handwriting of the virtual brush according to the handwriting area;

[0043] A fusion module is configured such that the handwriting is fused with the real shooting scene, and a fused picture is displayed on the terminal device.

[0044] Further, the handwriting area forming module comprises:

[0045] A point forming unit is configured to determine at least one point formed by the virtual brush in the real shooting scene according to the operation acting on the terminal device;

[0046] The handwriting area forming unit is configured to form a handwriting area of a virtual brush according to the at least one point.

[0047] Further, the handwriting area forming unit is specifically configured to, when the number of points is multiple, connect the multiple points according to a preset rule in the real shooting scene; and form a handwriting area of a virtual brush according to the connection.

[0048] Further, the point forming unit is specifically configured to establish a three-dimensional coordinate system in the real shooting scene, and determine an origin of the three-dimensional coordinate; select a reference axis from three axes of the three-dimensional coordinate system, and determine at least one point formed in the real shooting scene along the reference axis according to an operation acting on the terminal device.

[0049] Further, the handwriting area forming unit is specifically configured to, when the number of points is multiple, connect the multiple points in the three-dimensional coordinate system in the real shooting scene along a positive direction or a negative direction of the reference axis in sequence.

[0050] Further, the handwriting area forming unit is specifically configured to: obtain a first line segment according to the connection, the first line segment comprising at least one sub-line segment, endpoints of the sub-line segment being composed of points in the multiple points; for each sub-line segment, obtain a plurality of perpendicular line segments by drawing a perpendicular line segment of the sub-line segment according to the endpoints; divide the endpoints of the plurality of perpendicular line segments into two categories according to a position relationship, and connect each category of endpoints into a line to obtain a second line segment and a third line segment; and form a handwriting area of a virtual brush by a sub-line segment corresponding to a first point, a sub-line segment corresponding to a last point, the second line segment and the third line segment.

[0051] Further, the handwriting forming module is specifically configured to form an extension area of a preset shape at both ends of the handwriting area as a starting point and an ending point of the virtual brush; and form a handwriting of the virtual brush by the handwriting area and the extension area.

[0052] Further, the handwriting forming module is specifically configured to fill a color or a material in the handwriting area to form a handwriting of the virtual brush.

[0053] Further, the apparatus further comprises:

[0054] The handwriting forming plane determining module is configured to detect a moving direction and an inclination angle of the terminal device; determine a direction of a handwriting forming plane of the virtual brush according to the moving direction and the inclination angle; and make the handwriting forming plane of the virtual brush face the screen according to the direction.

[0055] Further, the handwriting area forming module is further configured to: detect a movement operation of the terminal device, and take the movement operation as the operation acting on the terminal device; or, detect a gesture action generated on a screen of the terminal device, and take the gesture action as the operation acting on the terminal device.

[0056] To achieve the above object, according to another aspect of the present disclosure, the following technical solutions are further provided:

[0057] An electronic device comprises:

[0058] a memory configured to store non-transitory computer-readable instructions; and

[0059] a processor configured to execute the computer-readable instructions, so that the processor implements the steps described in any of the virtual brush implementation method technical solutions when executed.

[0060] To achieve the above object, according to another aspect of the present disclosure, the following technical solutions are further provided:

[0061] A computer-readable storage medium configured to store non-transitory computer-readable instructions, which, when executed by a computer, cause the computer to perform the steps described in any of the virtual brush implementation method technical solutions.

[0062] To achieve the above object, according to another aspect of the present disclosure, the following technical solutions are further provided:

[0063] A virtual brush implementation terminal comprises any of the virtual brush implementation devices.

[0064] The present disclosure obtains a real shooting scene through a camera of a terminal device, forms a handwriting area of a virtual brush in the real shooting scene according to an operation acting on the terminal device, and forms handwriting of the virtual brush according to the handwriting area; wherein the handwriting is fused with the real shooting scene, and the fused picture is displayed on the terminal device, so that the virtual brush drawing function can be realized without using a hardware virtual brush, and the present disclosure realizes the virtual brush drawing in the real shooting scene obtained by the camera, reduces the calculation complexity in the drawing process, and makes the virtual brush drawing easier to realize.

[0065] The above description is only a summary of the technical solutions of the present disclosure, in order to more clearly understand the technical means of the present disclosure, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the following preferred embodiments are described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS

[0066] Figure 1a a flowchart of a method for implementing a virtual brush according to an embodiment of the present disclosure;

[0067] Figure 1b a flowchart of a method for implementing a virtual brush according to another embodiment of the present disclosure;

[0068] Figure 1c a schematic diagram of a virtual brush dot formed in a method for implementing a virtual brush according to an embodiment of the present disclosure;

[0069] Figure 1d a schematic diagram of a stroke area of a virtual brush formed in a method for implementing a virtual brush according to an embodiment of the present disclosure;

[0070] Figure 1e a schematic diagram of an extended area of a stroke area of a virtual brush formed in a method for implementing a virtual brush according to an embodiment of the present disclosure;

[0071] Figure 2 a structural schematic diagram of an apparatus for implementing a virtual brush according to an embodiment of the present disclosure;

[0072] Figure 3 a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0073] The present disclosure will be described with specific reference to particular embodiments thereof, but it is to be understood that no limitation of the scope of the disclosure is intended. It should be noted that the description of the embodiments is intended to be illustrative, and not be used to limit or define the scope of the disclosure. Various modifications made to the embodiments described herein will be readily apparent to those of ordinary skill in the art, and the generic principles recommended by the embodiments described herein can be applied to other embodiments without departing from the scope of the disclosure. The scope of the disclosure is defined by the appended claims. The following examples are given to illustrate the embodiments of the present disclosure. It should be noted that the following examples are only used to illustrate the embodiments of the present disclosure, and are not intended to limit or define the scope of the disclosure. The details in the specification can be modified or changed based on different views and applications, without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present disclosure.

[0074] It is important to note that the various aspects described herein are illustrative only and are not intended to limit the scope of examples within the scope of the appended claims. One skilled in the art will readily recognize from the disclosure herein, that alternative aspects from those described and illustrated herein can be employed without departing from the scope of examples described herein.

[0075] It is also important to note that the construction herein described and illustrated in the accompanying drawings is shown by way of illustration only. As will be realized by those of ordinary skill in the art, the present disclosure is capable of modification in various obvious respects, all without departing from the spirit and scope of the present disclosure. Accordingly, the drawings and description are to be regarded as illustrative in nature, and explanations in this context no way limits the scope of the disclosure.

[0076] Additionally, in the following description, numerous specific details are provided for a thorough understanding of examples. One skilled in the relevant art will recognize, however, that the aspects described herein can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth.

[0077] To solve the technical problem of the existing virtual brush implementation, the embodiment of the present disclosure provides a virtual brush implementation method. As shown in the figure, the virtual brush implementation method mainly includes the following steps S1 to S4. Among them: Figure 1a As shown in the figure, the virtual brush implementation method mainly includes the following steps S1 to S4. Among them:

[0078] Step S1: acquiring a real shooting scene through the camera of the terminal device.

[0079] The terminal device can be a mobile terminal (such as a smart phone, an iPhone, a smart camera, a tablet computer, etc.), or a notebook or fixed terminal device (such as a desktop computer).

[0080] For example, the camera of the terminal device can be started through an application software (such as a short video) supporting a virtual brush. Specifically, when using the virtual brush function of the application software, the camera start button is opened in the display interface of the application software, and the user can start the camera of the terminal device by clicking the camera start button to enter the shooting interface, and the real shooting scene is displayed in the shooting interface. In addition, the virtual brush option can also be set in the shooting interface of the application software for the user to select to start the virtual brush function, and after the user starts the virtual brush function, the virtual brush implementation method of the present disclosure can be realized.

[0081] Step S2: forming a stroke area of the virtual brush in the real shooting scene according to the operation on the terminal device.

[0082] The operation can be self-defined, and can be a movement operation of the terminal device or a gesture action generated on the screen of the terminal device.

[0083] The stroke area can be a closed area with a fixed shape. For example, the fixed shape can be a rectangle, a polygon, a triangle, a circle, a human shape, or an animal shape.

[0084] Step S3: forming a stroke of the virtual brush according to the stroke area; wherein the stroke is fused with the real shooting scene, and the fused picture is displayed on the terminal device.

[0085] For example, the stroke of the virtual brush can be formed by filling the stroke area with colors or materials, so as to complete the virtual drawing.

[0086] For example, assuming that the real shooting scene obtained by the camera includes a table, the user can form a stroke of the virtual brush by operating the terminal device, the stroke can form an apple pattern, and then the apple is placed on the table in the real shooting scene by fusion, and then displayed on the screen of the terminal device, so as to achieve the effect of placing an apple on the table in the real shooting scene.

[0087] The embodiment obtains the real shooting scene by the camera of the terminal device, forms a stroke area of the virtual brush in the real shooting scene according to the operation on the terminal device, and forms a stroke of the virtual brush according to the stroke area, wherein the stroke is fused with the real shooting scene, and the fused picture is displayed on the terminal device. The virtual brush drawing function can be realized without using a hardware virtual brush, and the virtual brush drawing is performed in the real shooting scene obtained by the camera, so as to reduce the calculation complexity in the drawing process and make the virtual brush drawing easier to implement.

[0088] In an optional embodiment, as shown in Figure 1b Step S2 specifically includes:

[0089] Step S21: determining at least one point of the virtual brush formed in the real shooting scene according to the operation on the terminal device.

[0090] For example, the movement of the terminal device can be detected, the position of the terminal device in the real shooting scene is determined according to the movement of the terminal device (specifically, a Simultaneous Localization And Mapping (SLAM) algorithm in the prior art can be used), and the position is taken as a point. When the terminal device moves one position, one point is formed, and when the terminal device moves multiple positions, multiple points are formed. Specifically, the position of the terminal device in the real shooting scene obtained when the application software for implementing the virtual brush function is opened can be taken as the starting point of the virtual brush or the origin of the three-dimensional coordinates in the real shooting scene.

[0091] Or at least one point can be formed according to the gesture action of the user on the screen of the terminal device. For example, one click or double click on the screen of the terminal device forms one point, and multiple clicks or double clicks form multiple points. Alternatively, the sliding operation of the user on the screen of the terminal device is detected, and multiple points are formed according to the trajectory of the sliding operation.

[0092] Step S22: forming a stroke area of the virtual brush according to the at least one point.

[0093] For example, when one point is formed, the point can be taken as the center to form an area with a fixed shape, and the area with the fixed shape is the stroke area of the virtual brush. For example, the fixed shape can be a rectangle, a polygon, a triangle, a circle, a human shape, or an animal shape. When multiple points are formed, the stroke area of the virtual brush can be formed according to the multiple points. Then, the stroke of the virtual brush is formed according to the stroke area.

[0094] In an optional embodiment, step S22 includes:

[0095] Step S221: when the number of points is multiple, the multiple points are connected according to a preset rule in the real shooting scene.

[0096] The connection line can be a straight line or a curve.

[0097] The preset rule can be the time sequence of the generation of the points or the front-back sequence of the spatial positions of the points.

[0098] Step S222: forming a stroke area of the virtual brush according to the connection line.

[0099] When the connection is performed according to the time sequence of the generation of the points, a fixed shape such as a triangle, a circle, a polygon, a sphere, a cube, a human shape, or an animal shape can be formed, and the area corresponding to the fixed shape is taken as the stroke area of the virtual brush. When the connection is performed according to the front-back sequence of the spatial positions of the points, multiple line segments can be formed, and the stroke area of the virtual brush is formed according to the multiple line segments.

[0100] In an optional embodiment, step S21 comprises:

[0101] establishing a three-dimensional coordinate system in the real shooting scene, and determining the origin of the three-dimensional coordinate;

[0102] selecting a reference axis from the three axes of the three-dimensional coordinate system, and determining at least one point formed in the real shooting scene along the reference axis according to the operation acting on the terminal device.

[0103] Specifically, any one of the X, Y, and Z axes can be selected as the reference axis.

[0104] Among them, at least one point formed in the real shooting scene can be determined along the positive direction or the negative direction of the reference axis in sequence.

[0105] Further, step S221 comprises:

[0106] When the number of points is multiple, in the three-dimensional coordinate system in the real shooting scene, the multiple points are sequentially connected along the positive direction or the negative direction of the reference axis.

[0107] In an optional embodiment, step S222 comprises:

[0108] Step S2221: obtaining a first line segment according to the connection, the first line segment comprising at least one sub-line segment, the end points of the sub-line segment being composed of points in the multiple points.

[0109] In this paper, in order to distinguish different line segments, the first appearing line segment is called the first line segment, and the subsequent appearing line segments are called the second line segment and the third line segment in sequence.

[0110] Step S2222: for each sub-line segment, a perpendicular line segment of the sub-line segment is obtained according to the end point.

[0111] Step S2223: according to the position relationship, the end points of the multiple perpendicular line segments are divided into two categories, and each category of end points is connected into a line to obtain the second line segment and the third line segment.

[0112] Among them, the end points of the perpendicular line segments located on the same side of the first line segment are classified into one category. For example, if the end points are located on the upper and lower sides of the first line segment, the end points on the upper side are classified into one category, and the end points on the lower side are classified into one category, respectively obtaining the second line segment and the third line segment.

[0113] Step S2224: the pen trail area of the virtual brush is formed by the sub-line segment corresponding to the first point, the sub-line segment corresponding to the last point, the second line segment, and the third line segment.

[0114] The following embodiment is described in detail taking the mobile operation of the terminal device as a trigger condition. The current position of the terminal device in the real shooting scene can be recognized by the SLAM algorithm, and the current position can be set as the coordinate (0, 0, 0). When the terminal device moves, the point of the virtual brush can be determined in the negative direction of the Z axis (the Z axis is selected as the reference axis) each time, as shown in FIG. 2. According to the order of the positions of the points, the plurality of points are connected to form a line segment composed of a plurality of sub-line segments. For each point on the sub-line segment, a perpendicular segment is formed on the front sub-line segment of the point, and two end points are formed on the two sides of the perpendicular segment. The end points on the two sides are connected to form a line, and the trace area of the virtual brush is obtained, as shown in FIG. 3. Figure 1c Figure 1d

[0115] In an optional embodiment, step S3 comprises:

[0116] Step S31: forming an extended area of a preset shape at each end of the trace area as a starting point and an ending point of the virtual brush.

[0117] Specifically, in order to make the two ends of the trace have a fixed shape, the preset shape can be, for example, a sawtooth shape or a burr. The corresponding extended area needs to be formed at each end of the trace area. As shown in FIG. 4, a sawtooth-shaped rectangle is extended at each of the front and rear ends of the trace area shown in FIG. 3 as the starting point and the ending point of the virtual brush. Figure 1e Figure 1d

[0118] Step S32: forming the trace of the virtual brush from the trace area and the extended area.

[0119] In an optional embodiment, the method of the present disclosure further comprises:

[0120] Step S4: detecting the moving direction and the tilt angle of the terminal device;

[0121] Step S5: determining the direction of the plane on which the trace of the virtual brush is formed according to the moving direction and the tilt angle.

[0122] Step S6: making the plane on which the trace of the virtual brush is formed face the screen according to the direction.

[0123] Specifically, there are two ways to observe the finally formed trace of the virtual brush. One is that the formed trace is fixed and does not change. When the observation angle changes, the trace can be observed to have a thick-thin change in the terminal device screen. The other is that when the observation angle changes, each frame of image captured by the camera of the terminal device is recalculated to make the trace of the virtual brush always face the screen. In this way, no matter how the angle of the terminal device changes, the thickness of the trace does not change.

[0124] For example, according to the formula ​​​​Seek vector Wherein is the observation angle, is the displacement of the terminal device, which can be obtained by the SLAM algorithm, and through the product of the vector, the vector which is perpendicular to and perpendicular to can be obtained. The vector is taken as the direction of the surface of the handwriting, so that the handwriting uses the screen-oriented surface.

[0125] Those skilled in the art should understand that, on the basis of the above various embodiments, obvious modifications (for example, combining the enumerated modes) or equivalent replacements can also be made.

[0126] In the foregoing, although the steps in the virtual brush implementation method embodiment are described in the above order, those skilled in the art should understand that the steps in the present disclosure embodiment do not necessarily be executed in the above order, but can also be executed in reverse order, in parallel, in cross order, and other orders, and those skilled in the art can also add other steps on the basis of the above steps, and these obvious modifications or equivalent replacements should also be included in the protection scope of the present disclosure, and will not be described here.

[0127] The following is a device embodiment of the present disclosure, which can be used to execute the steps implemented by the method embodiments of the present disclosure. For ease of illustration, only the parts related to the embodiments of the present disclosure are shown, and the specific technical details not disclosed are referred to the method embodiments of the present disclosure.

[0128] In order to solve the technical problem of how to improve the efficiency and real-time performance of the virtual brush implementation, the present disclosure embodiment provides a virtual brush implementation device. The device can execute the steps in the virtual brush implementation method embodiments described above. As shown in the figure, the device mainly includes: a real scene acquisition module 21, a handwriting area forming module 22, and a handwriting forming module 23; wherein, Figure 2

[0129] The real scene acquisition module 21 is used to acquire a real shooting scene through the camera of the terminal device.

[0130] The handwriting area forming module 22 is used to form a handwriting area of a virtual brush in the real shooting scene according to the operation acting on the terminal device.

[0131] The handwriting forming module 23 is used to form handwriting of the virtual brush according to the handwriting area; wherein the handwriting is integrated with the real shooting scene, and the integrated picture is displayed on the terminal device.

[0132] Further, the handwriting area forming module 22 includes: a point forming unit 221 and a handwriting area forming unit 222; wherein,​

[0133] The point forming unit 221 is configured to determine at least one point formed by a virtual brush in the real shooting scene according to an operation performed on the terminal device.

[0134] The handwriting area forming unit 222 is configured to form a handwriting area of the virtual brush according to the at least one point.

[0135] Further, the handwriting area forming unit 222 is specifically configured to, when the number of points is a plurality, connect the plurality of points according to a preset rule in the real shooting scene, and form a handwriting area of the virtual brush according to the connection.

[0136] Further, the point forming unit 221 is specifically configured to establish a three-dimensional coordinate system in the real shooting scene, determine an origin of the three-dimensional coordinate, select a reference axis from three axes of the three-dimensional coordinate system, and determine at least one point formed in the real shooting scene along the reference axis according to the operation performed on the terminal device.

[0137] Further, the handwriting area forming unit 222 is specifically configured to, when the number of points is a plurality, sequentially connect the plurality of points along a positive direction or a negative direction of the reference axis in the three-dimensional coordinate system in the real shooting scene.

[0138] Further, the handwriting area forming unit 222 is specifically configured to obtain a first line segment according to the connection, the first line segment includes at least one sub-line segment, and an end point of the sub-line segment is composed of a point in the plurality of points; for each sub-line segment, a perpendicular line segment of the end point is obtained, a plurality of perpendicular line segments are obtained; end points of the plurality of perpendicular line segments are divided into two categories according to a position relationship, each category of end points is connected into a line to obtain a second line segment and a third line segment; a handwriting area of the virtual brush is formed by a sub-line segment corresponding to a first point, a sub-line segment corresponding to a last point, the second line segment, and the third line segment.

[0139] Further, the handwriting forming module 23 is specifically configured to form an extension area of a preset shape at both ends of the handwriting area as a starting point and an ending point of the virtual brush, and form a handwriting of the virtual brush by the handwriting area and the extension area.

[0140] Further, the handwriting forming module 23 is specifically configured to fill a color or a material in the handwriting area to form a handwriting of the virtual brush.

[0141] Further, the apparatus further includes a handwriting forming plane determining module 24; wherein,

[0142] The handwriting forming plane determining module 24 is configured to detect a moving direction and a tilt angle of the terminal device, determine a direction of a handwriting forming plane of the virtual pen according to the moving direction and the tilt angle, and make the handwriting forming plane of the virtual pen face the screen according to the direction.

[0143] Further, the handwriting area forming module 22 is also configured to detect a moving operation of the terminal device, and take the moving operation as an operation acting on the terminal device, or detect a gesture action generated on the screen of the terminal device, and take the gesture action as an operation acting on the terminal device.

[0144] The working principle and technical effects of the virtual pen implementation device embodiment are the same as those of the virtual pen implementation method embodiment, which will not be repeated here.

[0145] Reference will be made to the following description Figure 3 , which shows a structural schematic diagram of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a vehicle terminal (such as a vehicle navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. Figure 3 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0146] As shown in Figure 3 , the electronic device can include a processing device (such as a central processor, a graphics processor, etc.) 301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or loaded into a random access memory (RAM) 303 from a storage device 308. In the RAM 303, various programs and data required for the operation of the electronic device are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0147] Generally, the following devices can be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, and the like; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; a storage device 308 including, for example, a magnetic tape, a hard disk, and the like; and a communication device 309. The communication device 309 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3Electronic devices with various apparatuses are shown, but it should be understood that not all of the illustrated apparatuses are required, and that some embodiments can implement or have fewer, or different, apparatuses.

[0148] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication apparatus 309, or installed from the storage apparatus 308, or installed from the ROM 302. When the computer program is executed by the processing apparatus 301, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.

[0149] It should be noted that the computer readable medium described above in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as part of a carrier wave, in which the computer readable program code is carried. Such a propagated data signal can take any of a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport 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 by any suitable medium, including but not limited to wire, cable, RF, etc., or any suitable combination thereof.

[0150] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and not be assembled into the electronic device.

[0151] The computer readable medium carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device is caused to: acquire a real shooting scene through a camera of the terminal device; form a stroke area of a virtual brush in the real shooting scene according to an operation acting on the terminal device; and form a stroke of the virtual brush according to the stroke area; wherein the stroke is fused with the real shooting scene, and a fused picture is displayed on the terminal device.

[0152] Alternatively, the computer readable medium carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device is caused to: acquire a real shooting scene through a camera of the terminal device; form a stroke area of a virtual brush in the real shooting scene according to an operation acting on the terminal device; and form a stroke of the virtual brush according to the stroke area; wherein the stroke is fused with the real shooting scene, and a fused picture is displayed on the terminal device.

[0153] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0154] The computer program product of the first aspect can include a computer readable storage medium. The computer readable storage medium can include instructions. The instructions can include one or both of: instructions for causing a computer to implement a method as described above; and instructions for causing a computer to operate based on the described embodiments. The computer readable storage medium can include one or more of: a magnetic disk; a magnetic tape; a compact disk; a semiconductor memory; and an optical disk.

[0155] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of a unit does not constitute a limitation on the unit itself. For example, a first obtaining unit can also be described as a unit that obtains at least two Internet protocol addresses.

[0156] The above description is merely illustrative of the principles of the present disclosure. Depending upon the implementation, those skilled in the art will appreciate programming modifications, changes, and alterations to the details described herein and equivalents thereof. Therefore, the full scope of the embodiments of the present disclosure should be determined by sensible scope of the following claims, and the embodiments of the present disclosure should cover the most generic claims that include all the permutations of elements to each other. The embodiments of the present disclosure described herein that include the features should be construed as specific implementations of the generic claims. The recitation of narrow claims should not be understood as excluding broader claims that can be supported by this application.

Claims

1. A virtual brush implementation method, characterized in that, The method comprises the following steps: obtaining a real shooting scene through a camera of a terminal device; detecting a movement operation of the terminal device, and forming a stroke area of a virtual brush in the real shooting scene according to the movement operation of the terminal device; forming a stroke of the virtual brush according to the stroke area; wherein the stroke is integrated with the real shooting scene, and the integrated picture is displayed on the terminal device; detecting a moving direction and an inclination angle of the terminal device; determining a direction of a plane in which the stroke of the virtual brush is formed according to the moving direction and the inclination angle; and making the plane in which the stroke of the virtual brush is formed face the screen according to the direction; wherein the step of forming the stroke area of the virtual brush in the real shooting scene according to the movement operation of the terminal device comprises the following steps: determining at least one point in the real shooting scene at which the virtual brush is formed according to the movement operation of the terminal device; and forming the stroke area of the virtual brush according to the at least one point; 2. The method of claim 1, wherein, wherein the step of determining at least one point in the real shooting scene at which the virtual brush is formed according to the movement operation of the terminal device comprises the following steps:

3. The method of claim 2, wherein, establishing a three-dimensional coordinate system in the real shooting scene, and determining an origin of the three-dimensional coordinate; selecting a reference axis from three axes of the three-dimensional coordinate system, and determining at least one point in the real shooting scene along the reference axis according to the movement operation of the terminal device. the step of forming the stroke area of the virtual brush according to the at least one point comprises the following steps:

4. The method of claim 2, wherein, when the number of points is more than one, connecting the points according to a preset rule in the real shooting scene; and forming the stroke area of the virtual brush according to the connection. when the number of points is more than one, connecting the points according to a preset rule in the real shooting scene, comprising the following steps: when the number of points is more than one, connecting the points along the positive direction or the negative direction of the reference axis in the three-dimensional coordinate system in the real shooting scene. the step of forming the stroke area of the virtual brush according to the connection comprises the following steps: obtaining a first line segment from the connection, wherein the first line segment comprises at least one sub-line segment, and the end points of the sub-line segment are composed of points in the plurality of points; 5. The method according to any one of claims 1 to 4, characterized in that, for each sub-line segment, a plurality of perpendicular line segments are obtained by drawing a perpendicular line segment of the sub-line segment according to the end point; end points of the plurality of perpendicular line segments are divided into two categories according to the position relationship, and each category of end points is connected into a line to obtain a second line segment and a third line segment; a stroke area of the virtual brush is formed by a sub-line segment corresponding to the first point, a sub-line segment corresponding to the last point, the second line segment and the third line segment.

6. The method according to any one of claims 1 to 4, characterized in that, the step of forming the stroke of the virtual brush according to the stroke area comprises the following steps: forming an extension area of a preset shape at both ends of the stroke area as a starting point and an ending point of the virtual brush; 7. A virtual paintbrush implementation device, characterized in that, forming the stroke of the virtual brush from the stroke area and the extension area. the step of forming the stroke of the virtual brush according to the stroke area comprises the following steps: filling the stroke area with a color or a material to form the stroke of the virtual brush. The method comprises the following steps: a real scene obtaining module is configured to obtain a real shooting scene through a camera of a terminal device; a handwriting area forming module configured to detect a movement operation of the terminal device, and form a handwriting area of a virtual brush in the real shooting scene according to the movement operation of the terminal device; a handwriting forming module configured to form a handwriting of the virtual brush according to the handwriting area; wherein the handwriting is fused with the real shooting scene, and the fused picture is displayed on the terminal device; a plane determining module configured to detect a moving direction and an inclination angle of the terminal device, determine a direction of a plane on which the handwriting of the virtual brush is formed according to the moving direction and the inclination angle, and make the plane on which the handwriting of the virtual brush is formed face the screen according to the direction; wherein the forming of the handwriting area of the virtual brush in the real shooting scene according to the movement operation of the terminal device comprises: determining at least one point in the real shooting scene where the virtual brush is formed according to the movement operation of the terminal device, and forming the handwriting area of the virtual brush according to the at least one point; wherein the determining of the at least one point in the real shooting scene where the virtual brush is formed according to the movement operation of the terminal device comprises: establishing a three-dimensional coordinate system in the real shooting scene, and determining an origin of the three-dimensional coordinate; selecting a reference axis from three axes of the three-dimensional coordinate system, and determining at least one point in the real shooting scene along the reference axis according to the movement operation of the terminal device. 8.An electronic device, comprising: a memory configured to store non-transitory computer-readable instructions; and a processor configured to execute the computer-readable instructions, so that the processor implements the virtual brush implementation method according to any one of claims 1-6 when executed. 9.A computer-readable storage medium configured to store non-transitory computer-readable instructions, which, when executed by a computer, cause the computer to implement the virtual brush implementation method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Photo processing device and method

    CN106331482A

  • Method and device for image displaying

    CN107291266A

  • Real-time aliasing rendering method for 3D VR video and virtual three-dimensional scene

    WO2019041351A1

  • Video image processing method and device and terminal

    CN107888845A

  • Method for drawing handwritten handwriting, computing device and computer storage medium

    CN108597006A