Image generation method, device, electronic device and storage medium
By drawing and displaying preview drawing images according to the position change trajectory of the target object in the video captured image when the user draws an image, and updating the target drawing image when the preset conditions are met, the problem of insensible and real-time image generation in the prior art is solved, and a more intelligent and real-time image generation process is achieved.
Patent Information
- Application Number
- CN202310078801.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2043-01-17
AI Technical Summary
In the prior art, the process of drawing images by users requires the user to complete the depiction of the line image before they can view the final generated image, resulting in the image generation method being not intelligent and real-time enough.
The target track image is drawn according to the position change trajectory of the target object in the video captured image, and the preview drawn image generated by transforming the target track image is displayed in the video captured image; in response to the preview drawn image satisfying the preset drawing conditions, the preview drawn image that meets the drawing conditions is used as the target drawing image, and displayed in the captured video image.
This enables users to display the final image drawing effect in the video captured image during the drawing process, improving the intelligence and real-timeness of the image generation method.
Smart Images

Figure CN116074639B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image generating method, device, electronic device and storage medium. Background Art
[0002] With the development of image processing technology, a technology for users to draw images has emerged. Users can draw line trajectories by moving the position of body parts used for image input, such as by moving the position of hands, and then use the line trajectories to draw line images.
[0003] In the related art, the current process of drawing an image by a user requires generating a line image according to the line trajectory drawn by the user before finally forming an image formed after processing the line image, such as coloring the line image. Therefore, the final image can only be viewed after the user completes drawing the line image. Therefore, the existing image generation method is not intelligent and real-time enough. Summary of the invention
[0004] The present disclosure provides an image generation method, device, electronic device and storage medium to at least solve the problem that the existing image generation method in the related art is not intelligent enough. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image generating method, comprising:
[0006] Draw a target trajectory image according to the position change trajectory of the target object in the video captured image, and display a preview drawn image generated by transforming the target trajectory image in the video captured image;
[0007] In response to the preview drawing image satisfying a preset drawing condition, the preview drawing image satisfying the drawing condition is used as a target drawing image and is displayed in the captured video image.
[0008] In an exemplary embodiment, an image drawing area is displayed in the video capture image, and the image drawing area includes a plurality of sub-areas; drawing a target trajectory image according to a position change trajectory of a target object in the video capture image, and displaying a preview drawing image generated by transforming the target trajectory image in the video capture image, comprises: drawing the target trajectory image in the first sub-area according to the position change trajectory of the target object in the first sub-area; the first sub-area is any sub-area through which the position of the target object in the video capture image passes; transforming the target trajectory image into any one or more sub-areas in the image drawing area except the first sub-area to obtain a transformed trajectory image; generating the preview drawing image based on the target trajectory image and the transformed trajectory image, and displaying it in the video capture image.
[0009] In an exemplary embodiment, at least one line is displayed in the image drawing area, and each of the sub-areas is divided by the line; transforming the target trajectory image into any one or more sub-areas in the image drawing area except the first sub-area includes: transforming the target trajectory image into any one or more sub-areas except the first sub-area with the line as the axis of symmetry.
[0010] In an exemplary embodiment, the line includes a first line and a second line, and the first line is perpendicular to the second line; the target trajectory image is transformed to any one or more sub-areas other than the first sub-area with the line as the axis of symmetry, including: taking the first line as the axis of symmetry, performing a first transformation process on the target trajectory image drawn in the first sub-area, and drawing the first transformed trajectory image in the second sub-area; the second sub-area is a symmetric sub-area of the first sub-area with the first line as the axis of symmetry; taking the second line as the axis of symmetry, performing a second transformation process on the target trajectory image, drawing the second transformed trajectory image in the third sub-area, and performing a second transformation process on the first transformed trajectory image, and drawing a third mirrored trajectory image in the fourth sub-area; the third sub-area is a symmetric sub-area of the first sub-area with the second line as the axis of symmetry, and the fourth sub-area is a symmetric sub-area of the second sub-area with the second line as the axis of symmetry.
[0011] In an exemplary embodiment, an image template is displayed in the video capture image, and the image template includes the image drawing area and a preset basic image; generating the preview drawing image based on the target trajectory image and the transformation trajectory image includes: generating the preview drawing image based on the target trajectory image, the transformation trajectory image and the image template.
[0012] In an exemplary embodiment, the video capture image displays a drawing countdown for drawing a target drawing image; in response to the preview drawing image satisfying a preset drawing condition, the preview drawing image satisfying the drawing condition is used as the target drawing image and displayed in the captured video image, including: in response to the drawing countdown returning to zero, the preview drawing image satisfying the drawing countdown returning to zero is used as the target drawing image, and the target drawing image is displayed in the captured video image.
[0013] In an exemplary embodiment, displaying the target drawn image in the captured video image includes: identifying a target display object, and displaying the target drawn image in association with the target display object.
[0014] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories, and the target trajectory image is composed of sub-trajectory images drawn according to the multiple sub-trajectories; drawing the target trajectory image according to the position change trajectory of the target object in the video captured image includes: obtaining trajectory information of the current sub-trajectory, and obtaining the curvature of the current sub-trajectory according to the trajectory information; the current sub-trajectory is any one of the multiple sub-trajectories; based on the curvature and a preset curvature threshold, drawing a sub-trajectory image matching the current sub-trajectory; and forming the target trajectory image according to the sub-trajectory images matching the current sub-trajectories.
[0015] In an exemplary embodiment, drawing a sub-trajectory image that matches the current sub-trajectory based on the curvature and a preset curvature threshold includes: when the curvature satisfies the curvature threshold, drawing the sub-trajectory image according to the trajectory information of the current sub-trajectory; when the curvature does not satisfy the curvature threshold, correcting the trajectory information using the curvature threshold, and drawing the sub-trajectory image according to the corrected trajectory information.
[0016] In an exemplary embodiment, forming the target trajectory image according to the sub-trajectory images matched by the current sub-trajectories includes: when the distance of the current sub-trajectory is less than a preset distance threshold, deleting the sub-trajectory images matched by the current sub-trajectory, and forming the target trajectory image using the remaining sub-trajectory images.
[0017] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories; drawing the target trajectory image according to the position change trajectory of the target object in the video capture image includes: obtaining trajectory vector information of each of the sub-trajectories; based on each of the trajectory vector information, coloring the position change trajectory according to the coloring mode corresponding to the target drawing image to draw the target trajectory image.
[0018] In an exemplary embodiment, the dyeing mode includes a first dyeing mode; based on each of the trajectory vector information, the position change trajectory is dyed according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image, including: when the dyeing mode is the first dyeing mode, based on each of the trajectory vector information, the trajectory direction information of the position change trajectory is obtained; according to the trajectory direction information, the position change trajectory is dyed to draw the target trajectory image.
[0019] In an exemplary embodiment, the dyeing mode includes a second dyeing mode; based on each of the trajectory vector information, the position change trajectory is dyed according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image, including: when the dyeing mode is the second dyeing mode, based on each of the trajectory vector information, the width direction information of the position change trajectory is obtained; according to the width direction information, the position change trajectory is dyed to draw the target trajectory image.
[0020] According to a second aspect of an embodiment of the present disclosure, there is provided an image generating device, including:
[0021] A preview image display unit is configured to draw a target trajectory image according to a position change trajectory of a target object in a video captured image, and display a preview drawn image generated by transforming the target trajectory image in the video captured image;
[0022] The target image display unit is configured to execute, in response to the preview drawing image satisfying a preset drawing condition, taking the preview drawing image satisfying the drawing condition as a target drawing image and displaying it in the captured video image.
[0023] In an exemplary embodiment, an image drawing area is displayed in the video capture image, and the image drawing area includes multiple sub-areas; the preview image display unit is further configured to draw the target trajectory image in the first sub-area according to the position change trajectory of the target object in the first sub-area; the first sub-area is any sub-area through which the position of the target object in the video capture image passes; the target trajectory image is transformed into any one or more sub-areas in the image drawing area except the first sub-area to obtain a transformed trajectory image; the preview drawing image is generated based on the target trajectory image and the transformed trajectory image, and displayed in the video capture image.
[0024] In an exemplary embodiment, at least one line is displayed in the image drawing area, and each of the sub-areas is divided by the line; the preview image display unit is further configured to transform the target trajectory image with the line as the axis of symmetry to any one or more sub-areas except the first sub-area.
[0025] In an exemplary embodiment, the line includes a first line and a second line, and the first line is perpendicular to the second line; the preview image display unit is further configured to perform a first transformation process on the target trajectory image drawn in the first sub-area with the first line as the axis of symmetry, and draw the first transformed trajectory image in the second sub-area; the second sub-area is a symmetric sub-area of the first sub-area with the first line as the axis of symmetry; the target trajectory image is subjected to a second transformation process with the second line as the axis of symmetry, and a second transformed trajectory image is drawn in a third sub-area, and the first transformed trajectory image is subjected to a second transformation process, and a third mirrored trajectory image is drawn in a fourth sub-area; the third sub-area is a symmetric sub-area of the first sub-area with the second line as the axis of symmetry, and the fourth sub-area is a symmetric sub-area of the second sub-area with the second line as the axis of symmetry.
[0026] In an exemplary embodiment, an image template is displayed in the video capture image, and the image template includes the image drawing area and a preset basic image; the preview image display unit is further configured to generate the preview drawing image based on the target trajectory image, the transformation trajectory image and the image template.
[0027] In an exemplary embodiment, the video capture image displays a drawing countdown for drawing a target drawing image; the target image display unit is further configured to execute, in response to the drawing countdown returning to zero, a preview drawing image that satisfies the drawing countdown returning to zero as the target drawing image, and display the target drawing image in the captured video image.
[0028] In an exemplary embodiment, the target image display unit is further configured to identify a target display object and associate the target drawn image with the target display object for display.
[0029] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories, and the target trajectory image is composed of sub-trajectory images drawn according to the multiple sub-trajectories; the preview image display unit is further configured to execute the acquisition of trajectory information of the current sub-trajectory, and the acquisition of the curvature of the current sub-trajectory according to the trajectory information; the current sub-trajectory is any one of the multiple sub-trajectories; based on the curvature and a preset curvature threshold, the sub-trajectory image matching the current sub-trajectory is drawn; and the target trajectory image is formed according to the sub-trajectory images matching the current sub-trajectories.
[0030] In an exemplary embodiment, the preview image display unit is further configured to execute, when the curvature degree meets the curvature degree threshold, drawing the sub-trajectory image according to the trajectory information of the current sub-trajectory; when the curvature degree does not meet the curvature degree threshold, correcting the trajectory information using the curvature degree threshold, and drawing the sub-trajectory image according to the corrected trajectory information.
[0031] In an exemplary embodiment, the preview image display unit is further configured to delete the sub-trajectory image matched with the current sub-trajectory when the distance of the current sub-trajectory is less than a preset distance threshold, and use the remaining sub-trajectory images to form the target trajectory image.
[0032] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories; the preview image display unit is further configured to execute acquisition of trajectory vector information of each of the sub-trajectories; based on each of the trajectory vector information, the position change trajectory is dyed according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image.
[0033] In an exemplary embodiment, the staining mode includes a first staining mode; the preview image display unit is further configured to execute, when the staining mode is the first staining mode, obtaining the trajectory direction information of the position change trajectory based on each trajectory vector information; staining the position change trajectory according to the trajectory direction information, and drawing the target trajectory image.
[0034] In an exemplary embodiment, the dyeing mode includes a second dyeing mode; the preview image display unit is further configured to execute, when the dyeing mode is the second dyeing mode, obtaining the width direction information of the position change trajectory based on each trajectory vector information; dyeing the position change trajectory according to the width direction information, and drawing the target trajectory image.
[0035] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement an image generation method as described in any one of the embodiments of the first aspect.
[0036] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the image generation method as described in any one of the embodiments in the first aspect.
[0037] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, wherein the computer program product includes instructions, and when the instructions are executed by a processor of an electronic device, the electronic device is able to execute the image generation method as described in any one of the embodiments in the first aspect.
[0038] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0039] The target trajectory image is drawn according to the position change trajectory of the target object in the video shooting image, and the preview drawing image generated by transforming the target trajectory image is displayed in the video shooting image; in response to the preview drawing image satisfying the preset drawing conditions, the preview drawing image satisfying the drawing conditions is used as the target drawing image, and is displayed in the captured video image. The present invention draws the target trajectory image according to the position change trajectory during the target object drawing process, and simultaneously displays the preview drawing image generated by transforming the target trajectory image in real time, and displays the preview drawing image as the target drawing image after the preset drawing conditions are met. Compared with the prior art that requires the user to complete the drawing of the line image before viewing the final generated image, the present invention enables the user to display the final drawing image effect in the video shooting image during the drawing process, thereby improving the intelligence of the image generation method.
[0040] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0042] Figure 1 The figure is a flowchart of an image generating method according to an exemplary embodiment.
[0043] Figure 2The figure is a schematic diagram showing a video shooting image according to an exemplary embodiment.
[0044] Figure 3 The figure is a flowchart of displaying a preview drawing image according to an exemplary embodiment.
[0045] Figure 4 The figure is a schematic diagram showing a video shooting image according to an exemplary embodiment.
[0046] Figure 5 The figure is a schematic diagram showing a video shooting image according to an exemplary embodiment.
[0047] Figure 6 The figure is a schematic diagram showing a video shooting image according to an exemplary embodiment.
[0048] Figure 7 The figure is a schematic diagram showing a video shooting image according to an exemplary embodiment.
[0049] Figure 8 The figure is a flow chart of forming a target trajectory image according to an exemplary embodiment.
[0050] Fig. 9 The figure is a block diagram of an image generating device according to an exemplary embodiment.
[0051] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0052] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0054] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0055] Figure 1 is a flowchart of an image generating method according to an exemplary embodiment. Figure 1 As shown, the image generating method is used in a terminal and includes the following steps.
[0056] In step S101 , a target trajectory image is drawn according to a position change trajectory of a target object in a video captured image, and a preview drawn image generated by transforming the target trajectory image is displayed in the video captured image.
[0057] Among them, the target object refers to the object of drawing the image, and the user who draws the image can draw the image through the position change trajectory of the target object. For example, the user can draw the image by tracing the trajectory with his finger, and the finger can be the target object at this time. The user can also draw the image by tracing the trajectory with his nose, and the nose can be the target object at this time. The video shot image refers to the captured video image, in which the user can draw the target trajectory image through the trajectory formed by the position change of the target object, that is, the position change trajectory. The preview drawn image is the preview image displayed in the video shot image when the user completes the image drawing process. In this embodiment, when the user draws the image through the target object, the corresponding preview drawn image will also be displayed, and the preview drawn image is the image generated after the target trajectory image is transformed.
[0058] For example, the depicted image may be an image of a snowflake image, and the corresponding change mode may be a rotation change. When the user is drawing through the target object, the terminal may rotate the currently drawn target trajectory image, thereby obtaining a corresponding preview drawing image to be displayed in the video capture image. At the same time, the depicted image may also be an image of a lantern image, and the corresponding change mode may be a mirror transformation. Then, when the target object is drawing, the terminal may mirror the currently drawn target trajectory image, thereby obtaining a corresponding preview drawing image to be displayed in the video capture image.
[0059] Specifically, the user can perform a drawing operation by changing the position of the target object in the video captured image displayed in the terminal. The terminal can generate a target trajectory image based on the position change trajectory of the target object, and can also perform image transformation on the target trajectory image to generate a corresponding preview drawing image for display.
[0060] For example, Figure 2As shown, the target object can be a nose, and the user can draw the image through the nose. When the target object draws line 1 in the video image through its nose, the image corresponding to line 1 can be used as the target trajectory image. After that, the terminal can transform the image of line 1. The transformation can be a mirror transformation of line 1 to generate line 2, line 3 and line 4. After that, the terminal can use the image composed of line 2, line 3 and line 4 generated from line 1 as a preview drawing image and display it in the video image.
[0061] In step S102, in response to the preview drawing image satisfying the preset drawing condition, the preview drawing image satisfying the drawing condition is used as a target drawing image and displayed in the captured video image.
[0062] The preset drawing condition is used to characterize the condition for ending image drawing. For example, the drawing condition can be the drawing time, that is, the drawing is ended after the drawing time is met, or it can be the number of drawn lines, that is, the drawing is ended after the number of drawn lines is met. The target drawing image is the final image generated after the drawing is completed. The image can be a preview drawing image displayed in the video captured image after the drawing is completed.
[0063] Specifically, if the preview drawing image displayed during the drawing process meets a preset drawing condition, the terminal can end the drawing of the image, and use the preview drawing image as the target drawing image, that is, the image drawn by the target object, and display the target drawing image in the video captured image, that is, display the image drawn by the target object in the video captured image.
[0064] In the above-mentioned image generation method, a target trajectory image is drawn according to the position change trajectory of the target object in the video capture image, and a preview drawing image generated by transforming the target trajectory image is displayed in the video capture image; in response to the preview drawing image satisfying the preset drawing conditions, the preview drawing image satisfying the drawing conditions is used as the target drawing image and displayed in the captured video image. The present disclosure draws the target trajectory image according to the position change trajectory during the target object drawing process, and displays the preview drawing image generated by transforming the target trajectory image, and displays the preview drawing image as the target drawing image after satisfying the preset drawing conditions. Compared with the prior art that requires the user to complete the drawing of the line image before viewing the final generated image, the present disclosure enables the user to display the final drawing image effect in the video capture image during the drawing process, thereby improving the intelligence of the image generation method.
[0065] In an exemplary embodiment, an image drawing area is displayed in the video capture image, and the image drawing area includes a plurality of sub-areas; Figure 3 As shown, step S101 may further include:
[0066] In step S301, a target trajectory image is drawn in the first sub-region according to the position change trajectory of the target object in the first sub-region; the first sub-region is any sub-region through which the position of the target object passes in the video shooting image.
[0067] The image drawing area refers to an area in the video image used for drawing an image, and the image drawing area may be composed of multiple sub-areas, and the first sub-area is the sub-area that the target object passes through during the user's shooting process. Specifically, when the user depicts the image of the target object in the first sub-area of the video drawing area, the terminal may draw a target trajectory image in the first sub-area according to the position change trajectory of the target object.
[0068] In step S302, the target trajectory image is transformed into any one or more sub-regions in the image drawing region except the first sub-region to obtain a transformed trajectory image;
[0069] In step S303, a preview drawing image is generated based on the target trajectory image and the transformation trajectory image, and is displayed in the video shooting image.
[0070] The transformed trajectory image refers to the trajectory image obtained after the target trajectory image is transformed. After obtaining the target trajectory image, the terminal can also perform image transformation on the target trajectory image, and display the trajectory image obtained after the transformation in any one or more sub-areas except the first sub-area in the image drawing area, for example, it can be transformed to all sub-areas except the first sub-area in the image drawing area, or it can be a sub-area adjacent to the first sub-area, or it can be transformed to a sub-area separated from the first sub-area by a preset number of areas, so as to obtain the transformed trajectory image. After that, the terminal can further use the above-mentioned target trajectory image and the transformed trajectory image to generate a corresponding preview drawing image for display. For example, the target trajectory image and the transformed trajectory image can be directly used as preview drawing images, or the target trajectory image, the transformed trajectory image and the displayed image drawing area can be displayed as preview drawing images.
[0071] For example, Figure 4 As shown, the image drawing area can be Figure 4The diamond area displayed in the figure may include four sub-areas. The user may draw a trajectory in the upper left sub-area with his nose to form a target trajectory image, i.e., line 1. Then, the terminal may transform line 1 to generate a corresponding transformed trajectory image of line 1, i.e., line 2, line 3, and line 4, which are displayed in the remaining upper right sub-area, lower left sub-area, and lower right sub-area, respectively. Then, the preview drawing image finally displayed may be composed of line 1, line 2, line 3, line 4, and the diamond area.
[0072] In this embodiment, the terminal can display an image capturing area including multiple sub-areas in the video capturing image, so that the user can perform a drawing operation in the first sub-area in the image drawing area to obtain a target trajectory image. The terminal can then transform the target trajectory image to any one or more sub-areas except the first sub-area. Thus, through the image drawing area, the user can conveniently draw images in the corresponding image drawing area, and can also transform the drawn image to other sub-areas, thereby further improving the convenience of image drawing.
[0073] Furthermore, at least one line is displayed in the image drawing area, and each sub-area is divided by the line; step S302 may further include: transforming the target trajectory image to any one or more sub-areas except the first sub-area with the line as the axis of symmetry.
[0074] In this embodiment, at least one line for dividing each sub-area may be displayed in the image drawing area. After the terminal obtains the target trajectory image drawn by the target object in the first sub-area, the line dividing the sub-area can be used as a symmetry axis to transform the target trajectory image to any one or more sub-areas other than the first sub-area. There may be multiple ways of transformation. For example, the line may be used as the symmetry axis to copy the target trajectory image to any one or more sub-areas other than the first sub-area, or the line may be used as the symmetry axis to mirror the target trajectory image to any one or more sub-areas other than the first sub-area.
[0075] In this embodiment, the transformation of the target trajectory image can be obtained by the terminal using the lines dividing the sub-regions as the symmetry axis, so that the transformed trajectory image obtained after the transformation processing can be symmetrical with the target trajectory image, further improving the intelligence of the generated transformed trajectory image.
[0076] Further, the lines displayed in the above-mentioned image drawing area include a first line and a second line, and the first line is perpendicular to the second line; transforming the target trajectory image with the line as the axis of symmetry to any one or more sub-areas other than the first sub-area may further include: taking the first line as the axis of symmetry, performing a first transformation process on the target trajectory image drawn in the first sub-area, and drawing the first transformed trajectory image in the second sub-area; the second sub-area is a symmetric sub-area of the first sub-area with the first line as the axis of symmetry; taking the second line as the axis of symmetry, performing a second transformation process on the target trajectory image, drawing the second transformed trajectory image in the third sub-area, and performing a second transformation process on the first transformed trajectory image, and drawing a third mirror trajectory image in the fourth sub-area; the third sub-area is a symmetric sub-area of the first sub-area with the second line as the axis of symmetry, and the fourth sub-area is a symmetric sub-area of the second sub-area with the second line as the axis of symmetry.
[0077] Among them, the first line and the second line can be two mutually perpendicular lines displayed in the image drawing area and used to divide sub-areas. The above lines can be used as symmetry axes to perform transformation processing, and the transformation processing can be a mirror transformation processing. The first line is used to perform the first transformation processing, and the second line is used to perform the second transformation processing.
[0078] The first transformed trajectory image is a trajectory image obtained by performing a first transformation on the target trajectory image, and the trajectory image is used to be displayed in a symmetrical sub-region of the first sub-region with the first line as the axis of symmetry, that is, in the second sub-region. The second mirror trajectory image is a trajectory image obtained by performing a second transformation on the target trajectory image, and the trajectory image is used to be displayed in a symmetrical sub-region of the first sub-region with the second line as the axis of symmetry, that is, in the third sub-region. The third mirror trajectory image is a trajectory image obtained by performing a second transformation on the first transformed trajectory image, and the trajectory image is used to be displayed in a symmetrical sub-region of the second sub-region with the second line as the axis of symmetry, that is, in the fourth sub-region.
[0079] Specifically, after obtaining the first line and the second line, the terminal can use the first line and the second line to perform two transformation processes respectively, so as to obtain a first transformation trajectory image, a second transformation trajectory image and a third transformation trajectory image, which are displayed in the second sub-area, the third sub-area and the fourth sub-area respectively, so as to use the first mirror trajectory image and the second mirror trajectory image as transformation trajectory images.
[0080] For example, Figure 4As shown, the first line may be a horizontal dotted line in the diamond area, and the second line may be a vertical dotted line in the diamond area. When the user performs a drawing operation in the first sub-area on the diamond area to draw line 1 as the target trajectory image, the terminal may first use the horizontal dotted line as the axis of symmetry to perform a first mirror transformation on line 1, thereby generating line 3 as the first transformation trajectory image to be displayed in the second sub-area on the lower left, and then further use the vertical dotted line as the axis of symmetry to further perform a second mirror transformation on line 1 and line 3, thereby generating line 2 as the second transformation trajectory image to be displayed in the third sub-area on the upper right, and generating line 4 as the third transformation trajectory image to be displayed in the third sub-area on the lower right. Similarly, the first line can also be a vertical dotted line in the image drawing area, and the second line can be a horizontal dotted line in the diamond area. In this case, line 2 can be a first transformation trajectory image obtained by performing a first mirror transformation on line 1 using the vertical dotted line, and is displayed in the second sub-area on the upper right. Line 3 can be a second transformation trajectory image obtained by performing a second mirror transformation on line 1 using the horizontal dotted line, and is displayed in the third sub-area on the lower left. Line 4 can be a fourth transformation trajectory image obtained by performing a second mirror transformation on line 2 using the horizontal dotted line, and is displayed in the fourth sub-area on the lower right.
[0081] In this embodiment, the terminal can also display the first line and the second line that are perpendicular to each other in the image drawing area as symmetry axes and perform two mirroring processes to obtain a transformation trajectory image. In this way, the target object only needs a simple drawing operation to generate a beautiful and complex image, further improving the efficiency of the image.
[0082] In an exemplary embodiment, an image template is displayed in the video capture image, and the image template includes an image drawing area and a preset basic image; step S303 may further include: generating a preview drawing image based on the target trajectory image, the transformation trajectory image and the image template.
[0083] An image template refers to a template used to draw an image. The template may include the above-mentioned image drawing area and a base image that matches the drawn image. The base image may also be displayed in the video capture image. Therefore, after the terminal obtains the target trajectory image and the transformation trajectory image, it may obtain a preview drawing image based on the image template, the target trajectory image and the transformation trajectory image. That is, the preview drawing image may include the image template, the target trajectory image and the transformation trajectory image at the same time.
[0084] For example, Figure 5As shown, a diamond-shaped area, i.e., an image drawing area, and a circular image and a rectangular image connected to the lower vertex of the diamond-shaped area can be displayed in the video shooting image. The above-mentioned diamond-shaped area, circular image and rectangular image can constitute an image template. When the user performs a drawing operation, thereby displaying line 1 as a target trajectory image, and line 2, line 3 and line 4 as transformation trajectory images in the diamond-shaped area, the terminal can use the combination of the image template, the target trajectory image and the transformation trajectory image as a preview drawing image, i.e., the preview drawing image includes the diamond-shaped area, the circular image and the rectangular image connected to the lower vertex of the diamond-shaped area, and lines 1, line 2, line 3 and line 4 contained in the diamond-shaped area.
[0085] In this embodiment, the image template can also be displayed in the video shooting image, so that the image formed by the image template, the target trajectory image and the transformation trajectory image can be displayed as a preview drawing image. By displaying the image template, it is not necessary to draw the template content of the image, so as to reduce the image drawing operation, thereby further improving the efficiency of image drawing.
[0086] In an exemplary embodiment, the video capture image displays a drawing countdown for drawing a target drawing image; step S102 may further include: in response to the drawing countdown returning to zero, using the preview drawing image that satisfies the drawing countdown returning to zero as the target drawing image, and displaying the target drawing image in the captured video image.
[0087] In this embodiment, the drawing condition may be a drawing time condition, that is, when the drawing time satisfies the drawing time condition, the drawing of the image is terminated, and the drawing countdown is used to represent the countdown that can be used to draw the image, and the countdown can be displayed in the video shooting image, and the display method may be to directly display the countdown time, or to represent the countdown by a progress bar that continuously decreases.
[0088] Specifically, when the countdown of the display has not returned to zero, it indicates that the preview drawing image has not yet met the preset drawing conditions. At this time, the user can continue to perform the drawing operation on the image, and the terminal can continue to respond to the drawing operation to display the matching preview drawing image. If the countdown of the display returns to zero, it indicates that the preview drawing image has met the preset drawing conditions, and the terminal can use the preview drawing image displayed when the drawing countdown returns to zero as the image obtained by drawing the target object, that is, display it as the target drawing image.
[0089] like Figure 6As shown, the drawing countdown can be displayed in the form of a progress bar, and the drawing countdown can be displayed above the video shooting image. It can be seen that the current drawing countdown progress has not yet returned to zero, so the image drawing operation can continue to be executed until the drawing countdown progress returns to zero.
[0090] In this embodiment, the drawing condition can be a pre-set drawing time condition, and the drawing time condition can also be represented by a drawing countdown displayed in the video capture image. When the drawing countdown has not returned to zero, the target object can continue to perform the drawing operation to draw the image until the drawing countdown returns to zero, and the preview drawing image is used as the target drawing image, thereby realizing the display of the drawing time condition and further improving the intelligence of image drawing.
[0091] In addition, the video shooting image can be displayed on the video shooting interface in the terminal. Before the user shoots the video and obtains the video shooting image, a shooting countdown can also be displayed in the video shooting interface. The shooting countdown can be used to remind the user to perform image shooting processing. After the shooting countdown returns to zero, the user can shoot, and the image can be drawn in the video shooting image through the target object.
[0092] Furthermore, displaying the target drawn image in the captured video image includes: identifying the target display object, and displaying the target drawn image in association with the target display object.
[0093] The target display object refers to a display object in the captured video image that is used for display in association with the target drawing image, and the display object can be preset. In this embodiment, after the target drawing image is drawn, it can also be displayed in association with the display object image of the captured video image. The method of the associated display can include superimposing and rendering the target drawing image on the target display object, or displaying the target drawing image around the target display object.
[0094] For example, the target display object may be the user's hand. After the target drawing image is drawn, the terminal may recognize the user's hand from the captured video image, and thus may overlay the target drawing image on the user's hand. Figure 7 shown.
[0095] In this embodiment, after the user completes drawing the target drawing image, the user can also identify the target display object from the captured video image, and associate the target drawing image with the target display object for display, so that the target drawing image can move with the target display object, thereby further improving the diversity of the target drawing image display method.
[0096] In an exemplary embodiment, the position change trajectory is composed of a plurality of sub-trajectories, and the target trajectory image is composed of sub-trajectory images drawn according to the plurality of sub-trajectories; Figure 8 As shown, step S101 may further include:
[0097] In step S801, the trajectory information of the current sub-trajectory is obtained, and the curvature degree of the current sub-trajectory is obtained according to the trajectory information; the current sub-trajectory is any one of the multiple sub-trajectories.
[0098] In this embodiment, the position change trajectory is composed of multiple sub-trajectories, each sub-trajectory can be formed by two adjacent trajectory points. When the target object depicts the position change trajectory, the terminal can collect trajectory points from the position change trajectory at a certain set time interval, and then the terminal can form multiple sub-trajectories based on the trajectory points. The sub-trajectory image is the trajectory image drawn by each sub-trajectory, and the target trajectory image drawn by the user can be composed of the above multiple trajectory images. The current sub-trajectory refers to any one of the multiple sub-trajectories, and the trajectory information is the trajectory related information of the current sub-trajectory, for example, it may include the coordinate information of the trajectory points that constitute the current sub-trajectory, the curvature of the current sub-trajectory, and the vector information of the current sub-trajectory, etc. Specifically, after the terminal collects trajectory points from the position change trajectory at a certain set time interval, it can obtain multiple sub-trajectories based on adjacent trajectory points, and can obtain the trajectory information of each current sub-trajectory, thereby calculating the curvature degree of each current sub-trajectory.
[0099] In step S802, based on the curvature and a preset curvature threshold, a sub-track image matching the current sub-track is drawn;
[0100] In step S803, a target trajectory image is formed according to the sub-trajectory images matched by each current sub-trajectory.
[0101] The curvature threshold is a preset maximum curvature. In this embodiment, in order to make the depicted sub-trajectory image more beautiful and smooth, a maximum sub-trajectory curvature can be set in the terminal, and the size relationship between the curvature and the curvature threshold is used to draw the sub-trajectory image corresponding to the current sub-trajectory. After obtaining the sub-trajectory image of each current sub-trajectory, the terminal can combine the sub-trajectory images of each current sub-trajectory to form a target trajectory image.
[0102] In this embodiment, the terminal can also pre-set a curvature threshold, so as to use the size relationship between the curvature of each sub-track and the curvature threshold to draw the sub-track image of each sub-track. In this way, the drawn sub-track image can be more beautiful and smooth, further improving the intelligence of sub-track drawing.
[0103] Furthermore, step S602 may further include: when the curvature satisfies the curvature threshold, drawing a sub-trajectory image according to the trajectory information of the current sub-trajectory; when the curvature does not satisfy the curvature threshold, correcting the trajectory information using the curvature threshold, and drawing the sub-trajectory image according to the corrected trajectory information.
[0104] Specifically, if the degree of curvature satisfies the curvature threshold, for example, the degree of curvature may be less than or equal to the curvature threshold, the terminal may directly use the trajectory information of the current sub-trajectory to execute the drawing of the sub-trajectory image of the current sub-trajectory, and if the degree of curvature does not satisfy the curvature threshold, for example, the degree of curvature is greater than the curvature threshold, then the curvature threshold may be used to correct the trajectory information of the current sub-trajectory, for example, the degree of curvature represented by the corrected trajectory information of the current sub-trajectory may be the above-mentioned curvature threshold, thereby using the corrected trajectory information to draw the sub-trajectory image of the current sub-trajectory.
[0105] In this embodiment, when the curvature satisfies the curvature threshold, the terminal can directly use the trajectory information of the current sub-trajectory to depict the corresponding sub-trajectory image. If the curvature does not satisfy the curvature threshold, the curvature threshold can be used to correct the trajectory information of the current sub-trajectory, thereby using the corrected trajectory information to depict the sub-trajectory image, thereby achieving the correction of the sub-trajectory image by the curvature threshold and improving the accuracy of the sub-trajectory image correction.
[0106] In addition, the curvature is characterized by the slope information of the current sub-trajectory, and the curvature threshold is characterized by the slope threshold matched by the current sub-trajectory; when the curvature satisfies the curvature threshold, a sub-trajectory image is drawn according to the trajectory information of the current sub-trajectory, including: when the slope information of the current sub-trajectory satisfies the slope threshold, a sub-trajectory image is drawn according to the trajectory information of the current sub-trajectory; when the curvature does not meet the curvature threshold, the trajectory information is corrected using the curvature threshold, and a sub-trajectory image is drawn according to the corrected trajectory information, including: when the slope information of the current sub-trajectory does not meet the slope threshold, the trajectory information of the current sub-trajectory is corrected using the slope threshold, and a sub-trajectory image is drawn according to the corrected trajectory information.
[0107] In this embodiment, the curvature of the current sub-track can be represented by the slope information of the current sub-track. Similarly, the curvature threshold can also be represented by a slope threshold set in advance for the current sub-track, and the slope threshold can be predicted by other sub-tracks located before the current sub-track. Specifically, if the slope information of the current sub-track meets the slope threshold matched by the current sub-track, it can be determined that the curvature of the current sub-track meets the curvature threshold, and the terminal can directly draw the trajectory image of the current sub-track according to the trajectory information of the current sub-track. If the slope information of the current sub-track does not meet the slope threshold matched by the current sub-track, it can be determined that the curvature of the current sub-track does not meet the curvature threshold, and the slope threshold can be used to correct the trajectory information of the current sub-track, so as to draw the sub-track image using the corrected trajectory information.
[0108] In this embodiment, the curvature of the current sub-track can be represented by the slope information of the current sub-track, and the curvature threshold can also be represented by the slope information matching the current sub-track. Therefore, it is only necessary to determine whether the curvature of the current sub-track meets the curvature threshold based on the relationship between the slope information of the current sub-track and the slope threshold, thereby further improving the efficiency of sub-track image drawing.
[0109] In addition, step S803 may further include: when the distance of the current sub-trajectory is less than a preset distance threshold, deleting the sub-trajectory image matched by the current sub-trajectory, and using the remaining sub-trajectory images to form the target trajectory image.
[0110] The preset distance threshold may be a preset minimum distance of each sub-trajectory. In this embodiment, multiple sub-trajectories may be formed by multiple trajectory points collected by the terminal from the position change trajectory at a certain set time interval, so the preset distance threshold may be the minimum distance between adjacent trajectory points. If the user shakes during the drawing operation, unstable trajectory points may appear, resulting in tiny bumps in the depicted target trajectory image. In order to avoid this situation, when the terminal detects that the distance of a current sub-trajectory formed by two trajectory points is too short, that is, the distance of the current sub-trajectory is less than the preset distance threshold, the sub-trajectory image corresponding to the current sub-trajectory may be deleted, thereby only using the remaining sub-trajectory images to form the target trajectory image, to ignore the tiny bumps in the target trajectory image, to ensure the smoothness of the drawn target trajectory image.
[0111] In this embodiment, the terminal can also set a distance threshold of the sub-trajectory, so that when the distance of the current sub-trajectory is less than the preset distance threshold, the sub-trajectory image corresponding to the current sub-trajectory can be deleted, and the remaining sub-trajectory images can be used to form the target trajectory image. The above method can avoid the user from trembling during the drawing operation, which causes tiny protrusions in the target trajectory image, thereby ensuring the smoothness of the drawn target trajectory image, and further improving the neatness of the target trajectory image drawing.
[0112] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories; step S501 may further include: obtaining trajectory vector information of each sub-trajectory; based on each trajectory vector information, dyeing the position change trajectory according to the dyeing mode represented by the target drawing image, and drawing the target trajectory image.
[0113] The trajectory vector information refers to the vector information of the sub-trajectory that constitutes the position change trajectory. In this embodiment, when the user performs a drawing operation, the terminal can record the trajectory information of the position change trajectory corresponding to the drawing operation, and can obtain the trajectory vector information corresponding to each sub-trajectory based on the above trajectory information. The dyeing mode refers to the mode of dyeing the position change trajectory. Drawing different types of target drawing images can correspond to different dyeing modes. For example, for image A, its dyeing mode is from black at the starting end of the position change trajectory to grayish white at the end of the position change trajectory, while for image B, its dyeing mode can be from yellow at the outside of the position change trajectory to red at the inside of the position change trajectory. Since the trajectory vector information of the sub-trajectory can be used to characterize the trajectory direction of the position change trajectory, the terminal can realize the dyeing process from the starting end to the end of the position change trajectory based on the above trajectory direction, and can also realize the dyeing process from the outside to the inside of the position change trajectory, thereby realizing the dyeing process of multiple modes for drawing images of different targets, further improving the diversity of dyeing processing methods.
[0114] In this embodiment, the terminal can realize the coloring processing of the position change trajectory based on the trajectory vector information of each sub-trajectory that constitutes the position change trajectory and the coloring pattern represented by the target drawing image, and provides a variety of coloring patterns for position change trajectories, thereby realizing coloring processing of multiple modes for different target drawing images, further improving the diversity of coloring processing methods.
[0115] Furthermore, the dyeing mode includes a first dyeing mode; based on each trajectory vector information, the position change trajectory is dyed according to the dyeing mode represented by the target drawing image, and the target trajectory image is drawn, including: when the dyeing mode is the first dyeing mode, based on each trajectory vector information, the trajectory direction information of the position change trajectory is obtained; according to the trajectory direction information, the position change trajectory is dyed and the target trajectory image is drawn.
[0116] The first dyeing mode refers to a dyeing mode that performs dyeing processing according to the direction of the position change trajectory, that is, a dyeing mode that represents dyeing processing from the starting end to the ending end of the position change trajectory. Specifically, if the dyeing mode is the first dyeing mode, the terminal can obtain the trajectory direction information from the starting end to the ending end of the position change trajectory based on the trajectory vector information of each sub-trajectory, so that the position change trajectory can be dyed according to the trajectory direction information, for example, the target trajectory image can be drawn by gradually changing from black at the starting end of the position change trajectory to grayish white at the ending end of the position change trajectory.
[0117] In this embodiment, if the dyeing mode represented by the target image is the first dyeing mode, the terminal can determine the trajectory direction information of the position change trajectory based on the trajectory vector information of each sub-trajectory, and then dye the position change trajectory according to the trajectory direction information to realize the drawing of the target trajectory image, thereby realizing a dyeing mode of dyeing from the starting end to the ending end of the position change trajectory, thereby ensuring the diversity of dyeing methods for the target drawing image.
[0118] In addition, the dyeing mode includes a second dyeing mode; based on each trajectory vector information, the position change trajectory is dyed according to the dyeing mode represented by the target image, and the target trajectory image is drawn, including: when the dyeing mode is the second dyeing mode, based on each trajectory vector information, the width direction information of the position change trajectory is obtained; according to the width direction information, the position change trajectory is dyed and the target trajectory image is drawn.
[0119] The second dyeing mode refers to a dyeing mode that performs dyeing processing according to the width direction of the position change trajectory, that is, a direction perpendicular to the direction of the position change trajectory. For example, it can represent a dyeing mode that performs dyeing processing from the outside to the inside of the position change trajectory, or from the inside to the outside. Specifically, if the dyeing mode is the second dyeing mode, the terminal can obtain the width direction information of the position change trajectory based on the trajectory vector information of each sub-trajectory, so that the position change trajectory can be dyed according to the width direction information. For example, it can be achieved that the color gradually changes from yellow on the outside of the position change trajectory to red on the inside of the position change trajectory to draw a target trajectory image.
[0120] In this embodiment, if the dyeing mode represented by the target drawing image is the second dyeing mode, the terminal can determine the width direction information of the position change trajectory based on the trajectory vector information of each sub-trajectory, and then dye the position change trajectory according to the width direction information to realize the drawing of the target trajectory image, thereby realizing a dyeing mode of dyeing from the outside to the inside or from the inside to the outside of the position change trajectory, thereby ensuring the diversity of the dyeing methods of the target drawing image.
[0121] In an exemplary embodiment, an image drawing method is also provided, which performs mirror flipping while the user is drawing the image. The user only needs to draw one stroke to get four lines at the same time, which is simple and beautiful. The display is real-time, what you see is what you get, and the user can control the beauty of the image in real time. At the same time, the user's body recognition data is corrected to ensure that the drawn lines are smooth and round. The data with slight jitter will be filtered out to ensure the smoothness and coherence of the finished product. The generated lines record the direction field information and can be dyed and changed along the path to form a colorful image. The final generated image can also be displayed on the screen or on the body. For example, the user can stretch out his hand and the drawn image will appear on his hand. It can also be displayed on the user's clothes after the user is identified, and move with the user. The method is specifically implemented by the following steps:
[0122] Step 1: Record user input and convert it into vector information.
[0123] By identifying the user's characteristic information, such as the position of the nose and hands, as input, the system records this information and uses it as a key point. After a certain period of time, the system connects these key points into line segments and records the corresponding vector information. That is, when the nose moves on the screen, the system gradually records the points and line segments it passes through.
[0124] Step 2: Data correction and jitter filtering.
[0125] While recording points, the system will estimate the following path based on the previous two points that have been passed. When the next position to be moved to is within the estimated target range, this point will be used to calculate the curvature of the current line segment. Under a certain degree of smoothness, the corrected drawing point of the point will be solved and recorded. If a point deviates from the target slope value of the predicted path, only the maximum value that can meet the current slope will be used to record it. Therefore, when a sharp turn is made during line drawing, the system will calculate a smooth curvature instead of using the user's original route to form a line. If a point is too small from the previous recorded point, that is, the amplitude of the coordinate change is less than a certain threshold, it is considered to be an unstable jitter point. At this time, the target point on the original route will continue to be recorded. That is, when a straight line is drawn and suddenly trembles, the straight line will continue to be recorded and small bumps will be ignored to ensure the smoothness of the line.
[0126] Step 3: Record the vector field information and color it.
[0127] When recording information in step 2, the points that have been passed before are calculated, so the direction and angle of travel are also calculated at the same time. Then the direction of travel (tangential) and the turning angle (normal) of the recorded point are also recorded each time. The direction of each position in the path can be obtained later, and this information makes it convenient to color the lines. For example, the line can be changed from red to blue (tangential coloring), or the left side of the line can be red and the right side can be blue (normal coloring).
[0128] Step 4: Generate mirror symmetry lines.
[0129] While recording the key points of the user's path, draw these data on the screen to obtain line one drawn as the user moves. By marking a horizontal symmetry axis and a vertical symmetry axis on the screen. First, mirror the first original line through the horizontal symmetry axis to obtain line two. Then mirror the two lines through the vertical symmetry axis at the same time to obtain lines three and four. This operation is performed in real time, that is, if the user draws continuously, four continuous lines will be obtained. The user can get a beautiful and complex image with a small amount of drawing. The user can also control the direction of the lines in real time, deliberately separate or cross the lines, and intuitively control the final shape.
[0130] Step 5: Store the image and apply it to the interactive scene.
[0131] The image that the user has finally drawn will be stored in the system cache. The user's body features, such as palms and clothes, can be recognized again as needed, and the image will be displayed at the corresponding location. When the user moves, the image can follow the user's movement, forming the perception that the user's work exists in the real world, rather than just a picture on the screen. At the same time, because of the cache, the image can also be displayed at multiple target locations at the same time, such as multiple hands, multiple people's clothes, etc.
[0132] Through the above embodiments, data filtering anti-shake and vector field coloring are realized, which reduces user costs while increasing the beauty of the image. At the same time, even if the mobile device is unstable, smooth images can be generated, and the real-time mirroring function in four directions ensures that beautiful shapes can be generated under the simplest operation, reducing operating costs while ensuring the effect of user-generated works, and what you see is what you get. In addition, the image generation results can be displayed on the user's body and follow the user's movement to achieve interaction with the user.
[0133] It should be understood that, although the various steps in the flowchart of the present disclosure are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0134] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.
[0135] Fig. 9 is a block diagram of an image generating device according to an exemplary embodiment. Fig. 9 , the device includes a preview image display unit 901 and a target image display unit 902.
[0136] The preview image display unit 901 is configured to draw a target trajectory image according to the position change trajectory of the target object in the video captured image, and display the preview drawn image generated by transforming the target trajectory image in the video captured image;
[0137] The target image display unit 902 is configured to execute, in response to the preview drawing image satisfying the preset drawing condition, taking the preview drawing image satisfying the drawing condition as the target drawing image and displaying it in the captured video image.
[0138] In an exemplary embodiment, an image drawing area is displayed in the video capture image, and the image drawing area includes multiple sub-areas; the preview image display unit 901 is further configured to draw a target trajectory image in the first sub-area according to the position change trajectory of the target object in the first sub-area; the first sub-area is any sub-area through which the position of the target object in the video capture image passes; the target trajectory image is transformed into any one or more sub-areas in the image drawing area except the first sub-area, to obtain a transformed trajectory image; a preview drawing image is generated based on the target trajectory image and the transformed trajectory image, and displayed in the video capture image.
[0139] In an exemplary embodiment, at least one line is displayed in the image drawing area, and each sub-area is divided by the line; the preview image display unit 901 is further configured to execute the transformation of the target trajectory image with the line as the axis of symmetry to any one or more sub-areas except the first sub-area.
[0140] In an exemplary embodiment, the line includes a first line and a second line, and the first line is perpendicular to the second line; the preview image display unit 901 is further configured to perform a first transformation process on the target trajectory image drawn in the first sub-region with the first line as the axis of symmetry, and draw the first transformed trajectory image in the second sub-region; the second sub-region is a symmetric sub-region of the first sub-region with the first line as the axis of symmetry; the target trajectory image is subjected to a second transformation process with the second line as the axis of symmetry, and the second transformed trajectory image is drawn in the third sub-region, and the first transformed trajectory image is subjected to a second transformation process, and a third mirrored trajectory image is drawn in the fourth sub-region; the third sub-region is a symmetric sub-region of the first sub-region with the second line as the axis of symmetry, and the fourth sub-region is a symmetric sub-region of the second sub-region with the second line as the axis of symmetry.
[0141] In an exemplary embodiment, an image template is displayed in the video capture image, and the image template includes an image drawing area and a preset basic image; the preview image display unit 901 is further configured to generate a preview drawing image based on the target trajectory image, the transformation trajectory image and the image template.
[0142] In an exemplary embodiment, the video capture image displays a drawing countdown for drawing a target drawing image; the target image display unit 902 is further configured to execute, in response to the drawing countdown returning to zero, a preview drawing image that satisfies the drawing countdown returning to zero as a target drawing image, and display the target drawing image in the captured video image.
[0143] In an exemplary embodiment, the target image display unit 902 is further configured to identify a target display object from the captured video image, and associate the target drawing image with the target display object for display.
[0144] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories, and the target trajectory image is composed of sub-trajectory images drawn according to the multiple sub-trajectories; the preview image display unit 901 is further configured to execute the acquisition of trajectory information of the current sub-trajectory, and the acquisition of the curvature of the current sub-trajectory according to the trajectory information; the current sub-trajectory is any one of the multiple sub-trajectories; based on the curvature and a preset curvature threshold, the sub-trajectory image matching the current sub-trajectory is drawn; and the target trajectory image is formed according to the sub-trajectory images matching each current sub-trajectory.
[0145] In an exemplary embodiment, the preview image display unit 901 is further configured to execute, when the degree of bending satisfies the degree of bending threshold, drawing a sub-trajectory image according to the trajectory information of the current sub-trajectory; when the degree of bending does not satisfy the degree of bending threshold, correcting the trajectory information using the degree of bending threshold, and drawing the sub-trajectory image according to the corrected trajectory information.
[0146] In an exemplary embodiment, the preview image display unit 901 is further configured to delete the sub-trajectory image matched with the current sub-trajectory when the distance of the current sub-trajectory is less than a preset distance threshold, and use the remaining sub-trajectory images to form the target trajectory image.
[0147] In an exemplary embodiment, the position change trajectory is composed of multiple sub-trajectories; the preview image display unit 901 is further configured to execute the acquisition of trajectory vector information of each sub-trajectory; based on each trajectory vector information, the position change trajectory is dyed according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image.
[0148] In an exemplary embodiment, the dyeing mode includes a first dyeing mode; the preview image display unit 901 is further configured to execute, when the dyeing mode is the first dyeing mode, obtaining the trajectory direction information of the position change trajectory based on each trajectory vector information; dyeing the position change trajectory according to the trajectory direction information, and drawing the target trajectory image.
[0149] In an exemplary embodiment, the dyeing mode includes a second dyeing mode; the preview image display unit 901 is further configured to execute, when the dyeing mode is the second dyeing mode, obtaining the width direction information of the position change trajectory based on each trajectory vector information; dyeing the position change trajectory according to the width direction information, and drawing the target trajectory image.
[0150] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0151] Fig.10 1 is a block diagram of an electronic device 1000 for image generation according to an exemplary embodiment. For example, the electronic device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0152] Reference Fig.10, the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .
[0153] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0154] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, an optical disk, or a graphene memory.
[0155] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.
[0156] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0157] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting an audio signal.
[0158] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0159] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect changes in the position of the electronic device 1000 or components of the electronic device 1000, the presence or absence of contact between the user and the electronic device 1000, the orientation or acceleration / deceleration of the device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0160] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0161] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0162] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the above instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0163] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions. The instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method.
[0164] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments, which will not be described one by one here.
[0165] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0166] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image generation method, characterized in that: include: A target trajectory image is drawn according to a position change trajectory of a target object in a video captured image, and a preview drawn image generated by transforming the target trajectory image is displayed in the video captured image; the preview drawn image is a preview image displayed in the video captured image after the image drawing process is completed; the transformation process includes at least one of a rotation transformation process and a mirror transformation process; an image drawing area for drawing an image is displayed in the video captured image, and the image drawing area includes a plurality of sub-areas; the method of drawing the target trajectory image according to the position change trajectory of a target object in a video captured image, and displaying the preview drawn image generated by transforming the target trajectory image in the video captured image includes: drawing the target trajectory image in the first sub-area according to the position change trajectory of the target object in the first sub-area; The first sub-region is any sub-region in the video captured image through which the position of the target object passes; the target trajectory image is transformed into any one or more sub-regions in the image drawing area except the first sub-region to obtain a transformed trajectory image; the preview drawing image is generated based on the target trajectory image and the transformed trajectory image, and is displayed in the video captured image; In response to the preview drawing image satisfying a preset drawing condition, the preview drawing image satisfying the drawing condition is used as a target drawing image and displayed in the video shooting image; the image generated after the target drawing image is drawn.
2. The method according to claim 1, characterized in that At least one line is displayed in the image drawing area, and each of the sub-areas is divided by the line; The step of transforming the target trajectory image into any one or more sub-areas in the image drawing area except the first sub-area includes: The target trajectory image is transformed into any one or more sub-areas except the first sub-area with the line as the axis of symmetry.
3. The method according to claim 2, characterized in that The lines include a first line and a second line, and the first line is perpendicular to the second line; The step of transforming the target trajectory image to any one or more sub-regions other than the first sub-region with the line as the axis of symmetry includes: Taking the first line as the axis of symmetry, performing a first transformation process on the target trajectory image drawn in the first sub-region, and drawing the first transformed trajectory image in the second sub-region; the second sub-region is a symmetric sub-region of the first sub-region taking the first line as the axis of symmetry; Taking the second line as the axis of symmetry, performing a second transformation processing on the target trajectory image, drawing a second transformation trajectory image in the third sub-region, and performing a second transformation processing on the first transformation trajectory image, drawing a third mirror trajectory image in the fourth sub-region; the third sub-region is a symmetric sub-region of the first sub-region taking the second line as the axis of symmetry, and the fourth sub-region is a symmetric sub-region of the second sub-region taking the second line as the axis of symmetry.
4. The method according to claim 1, characterized in that: An image template is displayed in the video shooting image, and the image template includes the image drawing area and a preset basic image; The generating the preview drawing image based on the target trajectory image and the transformation trajectory image comprises: The preview drawing image is generated based on the target trajectory image, the transformation trajectory image and the image template.
5. The method according to claim 1, characterized in that The video captured image shows a drawing countdown for drawing a target drawing image; In response to the preview drawing image satisfying a preset drawing condition, taking the preview drawing image satisfying the drawing condition as a target drawing image and displaying it in the video shooting image, comprises: In response to the drawing countdown returning to zero, the preview drawing image satisfying the condition that the drawing countdown returns to zero is used as the target drawing image, and the target drawing image is displayed in the video capture image.
6. The method according to claim 5, characterized in that The step of displaying the target drawn image in the video captured image comprises: A target display object is identified from the video captured image, and the target drawn image is associated with the target display object for display.
7. The method according to claim 1, characterized in that The position change trajectory is composed of a plurality of sub-trajectories, and the target trajectory image is composed of sub-trajectory images drawn according to the plurality of sub-trajectories; The step of drawing a target trajectory image according to the position change trajectory of the target object in the video captured image includes: Acquire the track information of the current sub-track, and acquire the curvature degree of the current sub-track according to the track information; The current sub-track is any one of the multiple sub-tracks; Based on the curvature and a preset curvature threshold, drawing a sub-track image matching the current sub-track; The target track image is formed according to the sub-track images matched by each of the current sub-tracks.
8. The method according to claim 7, characterized in that Drawing a sub-track image matching the current sub-track based on the curvature and a preset curvature threshold includes: When the curvature degree satisfies the curvature degree threshold, drawing the sub-track image according to the track information of the current sub-track; In the case that the curvature does not satisfy the curvature threshold, the trajectory information is corrected using the curvature threshold, and the sub-trajectory image is drawn according to the corrected trajectory information.
9. The method according to claim 7, characterized in that: The forming the target trajectory image according to the sub-trajectory images matched by each of the current sub-trajectories comprises: When the distance of the current sub-trajectory is less than a preset distance threshold, the sub-trajectory image matched by the current sub-trajectory is deleted, and the target trajectory image is formed by using the remaining sub-trajectory images.
10. The method according to claim 1, characterized in that The position change trajectory is composed of a plurality of sub-trajectories; and drawing a target trajectory image according to the position change trajectory of the target object in the video captured image includes: Obtaining trajectory vector information of each of the sub-trajectories; Based on each of the trajectory vector information, the position change trajectory is dyed according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image.
11. The method according to claim 10, characterized in that The dyeing mode includes a first dyeing mode; based on each of the trajectory vector information, dyeing the position change trajectory according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image includes: When the dyeing mode is the first dyeing mode, based on each of the trajectory vector information, acquiring the trajectory direction information of the position change trajectory; The position change trajectory is dyed according to the trajectory direction information to draw the target trajectory image.
12. The method according to claim 10, characterized in that The dyeing mode includes a second dyeing mode; based on each of the trajectory vector information, dyeing the position change trajectory according to the dyeing mode corresponding to the target drawing image to draw the target trajectory image includes: When the dyeing mode is the second dyeing mode, based on each of the trajectory vector information, acquiring the width direction information of the position change trajectory; The position change trajectory is dyed according to the width direction information to draw the target trajectory image.
13. An image generating device, characterized in that: include: A preview image display unit is configured to execute drawing of a target trajectory image according to a position change trajectory of a target object in a video captured image, and to display in the video captured image a preview drawing image generated by transforming the target trajectory image; the preview drawing image is a preview image displayed in the video captured image after the image drawing process is completed; the transformation process includes at least one of a rotation transformation process and a mirror transformation process; an image drawing area for drawing an image is displayed in the video captured image, and the image drawing area includes a plurality of sub-areas; the preview image display unit is further configured to execute drawing of the target trajectory image in the first sub-area according to a position change trajectory of the target object in the first sub-area; the first sub-area is any sub-area through which the position of the target object in the video captured image passes; the target trajectory image is transformed into any one or more sub-areas in the image drawing area except the first sub-area to obtain a transformed trajectory image; the preview drawing image is generated based on the target trajectory image and the transformed trajectory image, and displayed in the video captured image; The target image display unit is configured to execute, in response to the preview drawing image satisfying a preset drawing condition, the preview drawing image satisfying the drawing condition as the target drawing image and display it in the video shooting image; the image generated after the target drawing image is drawn.
14. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image generating method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image generating method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Information arrangement method, device and equipment and computer storage medium
CN107273032A
Special effect display method and device, equipment and medium
CN112929582A
Hand-drawn graph recognition method, device and system and computer readable storage medium
CN115589786A