Word processing method and device, computer equipment and storage medium

By generating and stylizing text images, the problem of limited types and inefficiency when adding text in the prior art is solved, and fast and high-quality personalized text processing is achieved.

CN119515667APending Publication Date: 2025-02-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311049036.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When adding text to scenes such as image editing and poster production, professional designers are usually required to design artistic characters, resulting in fewer optional types and inefficient.

Method used

By obtaining the target text and its corresponding font information, a text image is generated, and the mask image is processed according to the style prompt information through the stylized model to generate a stylized text image.

Benefits of technology

Real-time generation of personalized stylized text images is achieved, improving the processing speed and quality of stylized text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515667A_ABST
    Figure CN119515667A_ABST
Patent Text Reader

Abstract

The invention provides a word processing method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a target word, and determining font information corresponding to the target word; generating a character image corresponding to the target character according to the font information; determining a mask image corresponding to a target character in the character image, inputting the mask image and style prompt information corresponding to the target character into a stylized model, and determining a stylized character image corresponding to the target character. By means of the method, the speed and quality of character stylization processing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a word processing method, apparatus, computer equipment and storage medium. Background Art

[0002] In many scenarios, such as image editing and poster making, some text needs to be added to improve the richness of visual effects. Generally, when adding text, the added text is often artistic text, and artistic text is generally designed by professional designers. This results in a limited number of artistic texts available to users, and it takes a lot of time for designers to design artistic texts, which is inefficient. Summary of the invention

[0003] The embodiments of the present disclosure at least provide a word processing method, apparatus, computer equipment and storage medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a text processing method, including:

[0005] Acquire a target text, and determine font information corresponding to the target text;

[0006] Generating a text image corresponding to the target text according to the font information;

[0007] A mask image corresponding to a target text in the text image is determined, and the mask image and style prompt information corresponding to the target text are input into a stylized model to determine a stylized text image corresponding to the target text.

[0008] In a possible implementation manner, the obtaining of the target text includes:

[0009] Get the target text added to the image to be processed;

[0010] After determining the stylized text image corresponding to the target text, the method further includes:

[0011] The stylized text image is fused with the image to be processed for display.

[0012] In a possible implementation manner, the method further includes determining style prompt information corresponding to the target text according to the following method:

[0013] receiving style prompt information corresponding to the target text input by a user; or,

[0014] Performing style detection on the image to be processed, and determining style prompt information corresponding to the target text based on the style detection result; or,

[0015] Content detection is performed on the target text, and style prompt information corresponding to the text is determined based on the content detection result.

[0016] In a possible implementation manner, when the style prompt information includes the name of a main object, the text in the stylized text image corresponding to the target text is text composed based on the main object.

[0017] In a possible implementation manner, when the style prompt information does not include the name of the main object, the text in the stylized text image corresponding to the target text is text composed based on the associated objects associated with the style prompt information.

[0018] In a possible implementation manner, when the target text includes multiple characters, different characters correspond to different style prompt information;

[0019] The step of inputting the mask image and the style prompt information corresponding to the target text into a stylized model to determine a stylized text image corresponding to the target text includes:

[0020] The mask image and the style prompt information corresponding to each target text are input into a stylized model to determine a stylized text image corresponding to the target text; wherein, in the stylized text image, different target texts correspond to stylized texts of different style types.

[0021] In a possible implementation manner, the acquiring the target text and determining the font information corresponding to the target text includes:

[0022] Acquire an image to be processed, perform content recognition on the image to be processed, and determine target text matching the image to be processed and font information corresponding to the target text based on the content recognition result;

[0023] After determining the stylized text image corresponding to the target text, the method further includes:

[0024] The stylized text image is fused with the image to be processed for display.

[0025] In a second aspect, the present disclosure also provides a text processing device, including:

[0026] An acquisition module, used to acquire a target text and determine font information corresponding to the target text;

[0027] A generating module, used for generating a text image corresponding to the target text according to the font information;

[0028] The stylization processing module is used to determine a mask image corresponding to the target text in the text image, and input the mask image and the style prompt information corresponding to the target text into a stylization model to determine a stylized text image corresponding to the target text.

[0029] In a possible implementation manner, the acquisition module, when acquiring the target text, is used to:

[0030] Get the target text added to the image to be processed;

[0031] After determining the stylized text image corresponding to the target text, the stylization processing module is further used to:

[0032] The stylized text image is fused with the image to be processed for display.

[0033] In a possible implementation manner, the stylization processing module is further configured to determine style prompt information corresponding to the target text according to the following method:

[0034] receiving style prompt information corresponding to the target text input by a user; or,

[0035] Performing style detection on the image to be processed, and determining style prompt information corresponding to the target text based on the style detection result; or,

[0036] Content detection is performed on the target text, and style prompt information corresponding to the text is determined based on the content detection result.

[0037] In a possible implementation manner, when the style prompt information includes the name of a main object, the text in the stylized text image corresponding to the target text is text composed based on the main object.

[0038] In a possible implementation manner, when the style prompt information does not include the name of the main object, the text in the stylized text image corresponding to the target text is text composed based on the associated objects associated with the style prompt information.

[0039] In a possible implementation manner, when the target text includes multiple characters, different characters correspond to different style prompt information;

[0040] The stylization processing module, when inputting the mask image and the style prompt information corresponding to the target text into the stylization model to determine the stylized text image corresponding to the target text, is used to:

[0041] The mask image and the style prompt information corresponding to each target text are input into a stylized model to determine a stylized text image corresponding to the target text; wherein, in the stylized text image, different target texts correspond to stylized texts of different style types.

[0042] In a possible implementation manner, the acquisition module, when acquiring the target text and determining the font information corresponding to the target text, is used to:

[0043] Acquire an image to be processed, perform content recognition on the image to be processed, and determine target text matching the image to be processed and font information corresponding to the target text based on the content recognition result;

[0044] After determining the stylized text image corresponding to the target text, the method further includes:

[0045] The stylized text image is fused with the image to be processed for display.

[0046] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.

[0047] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.

[0048] In the text processing method, apparatus, computer device and storage medium provided by the embodiments of the present disclosure, after obtaining the target text, a text image corresponding to the target text can be generated according to the font information corresponding to the target text, and then a mask image corresponding to the text image can be determined, and the mask image can be processed according to the style prompt information through the stylized model to obtain a stylized text image corresponding to the target text. This method can generate personalized stylized text images in real time, improving the processing speed and quality of stylized text.

[0049] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0051] Figure 1 A flowchart of a text processing method provided by an embodiment of the present disclosure is shown;

[0052] Figure 2 A schematic diagram of a text image in the text processing method provided by an embodiment of the present disclosure is shown;

[0053] Figure 3 A schematic diagram of a mask image in a text processing method provided by an embodiment of the present disclosure is shown;

[0054] Figure 4a A schematic diagram showing a stylized text in a text image in a text processing method provided by an embodiment of the present disclosure;

[0055] Figure 4b A schematic diagram showing a comparison between a stylized text image and a mask image in a text processing method provided by an embodiment of the present disclosure is shown;

[0056] Figure 5 A schematic diagram of the structure of a word processing device provided by an embodiment of the present disclosure is shown;

[0057] Figure 6 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0059] Research has found that in many scenarios, such as image editing and poster making, some text needs to be added to improve the richness of the visual effect. Generally, when adding text, in order to make the text match the picture better, the added text is often artistic text, and artistic text is generally designed by professional designers. This results in only a few types of artistic text available to users; and it takes a lot of time for designers to design artistic text, which is inefficient.

[0060] Based on the above research, the present disclosure provides a text processing method, device, computer equipment and storage medium. After obtaining the target text, a text image corresponding to the target text can be generated according to the font information corresponding to the target text, and then a mask image corresponding to the text image can be determined, and the mask image can be processed according to the style prompt information through a stylized model to obtain a stylized text image corresponding to the target text. This method can generate personalized stylized text images in real time, improving the processing speed and quality of stylized text.

[0061] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0062] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0063] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0064] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0065] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0066] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0067] To facilitate understanding of this embodiment, a text processing method disclosed in the embodiment of the present disclosure is first introduced in detail. The executor of the text processing method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, such as a server, a terminal device, etc.

[0068] See also Figure 1 FIG. 1 is a flowchart of a text processing method provided by an embodiment of the present disclosure, wherein the method includes steps 101 to 103, wherein:

[0069] Step 101: Acquire target text and determine font information corresponding to the target text.

[0070] Step 102: Generate a text image corresponding to the target text according to the font information.

[0071] Step 103: determine a mask image corresponding to the target text in the text image, and input the mask image and the style prompt information corresponding to the target text into a stylized model to determine a stylized text image corresponding to the target text.

[0072] The following is a detailed description of the above steps.

[0073] The target text may be a problem to be stylized. In a possible implementation, when obtaining the target text, it may be text input by a user, or optical character recognition (OCR) may be performed on an image, and the recognized text is then used as the target text.

[0074] In a possible application scenario, the target text may be text to be added to the image to be processed. For example, in a poster design scenario, the target text may be text that needs to be added to the poster. Therefore, obtaining the target text may be obtaining the target text to be added to the image to be processed.

[0075] The font information corresponding to the target text may include, for example, Songti, Kaiti, Heiti and other font types; when determining the font information corresponding to the target text, it may be to respond to a user's setting instruction and determine the font information carried in the setting instruction as the font information corresponding to the target text.

[0076] Optionally, the font information may also include font size, font thickness, etc.

[0077] In another possible implementation, when acquiring the target text and determining the font information corresponding to the target text, it is possible to perform content recognition on the image to be processed after acquiring the image to be processed, and determine the target text matching the image to be processed and the font information corresponding to the target text based on the content recognition result.

[0078] Specifically, in a poster production scenario, after the image portion of the poster is produced, text can be added to the poster by automatically adding text, and the target text can be the text automatically generated when the image is automatically added with text.

[0079] Exemplarily, during automatic text matching, a text matching model may be used. After the image to be processed is input into the text matching model, the text matching model may automatically output target text that matches the image to be processed, as well as font information corresponding to the target text.

[0080] For example, if the image to be processed is an ink-and-wash landscape painting, the target text that matches the image to be processed may be a line of an ancient poem.

[0081] The font information corresponding to the target text may match the image style of the image to be processed. For example, if the image style of the image to be processed is ink landscape painting, the font information corresponding to the target text may be regular script; if the image style of the image to be processed is cartoon animation, the font information corresponding to the target text may be bold, etc.

[0082] Generating a text image corresponding to the target text according to the font information may refer to displaying an image of a target background color according to a preset size, and then drawing the target text on the image of the target background color according to the font information.

[0083] The target background color may be white, for example. When drawing the target text on the image, a color different from the target background color may be used, for example, the default color black may be used for drawing. For example, if the target text is "ABC", the generated text image may be as follows: Figure 2 shown.

[0084] It should be noted that, after the text image is generated, it may not be displayed, but is only used for the subsequent stylization process.

[0085] The mask image corresponding to the target text in the text image may be a binary image. In the mask image, the pixel value of the text area where the target text is located is 1, and the pixel value of the remaining area except the text area is 0. For example, Figure 3 shown.

[0086] In a possible implementation, when determining the mask image corresponding to the target text in the text image, edge detection may be performed on the text image, and the mask image may be determined based on the edge detection result.

[0087] Here, the size of the mask image is the same as the size of the text image, and both may be the preset size, and the preset size may be the image size processed by a preset stylized model.

[0088] The stylized model may be an Artificial Intelligence Generated Content (AIGC) model; the style prompt information corresponding to the target text is used to prompt the stylized model to process the text image into a style image. Optionally, when determining the style prompt information corresponding to the target text, any of the following methods may be used:

[0089] Method 1: Receive style prompt information corresponding to the target text input by a user.

[0090] Specifically, when inputting the target text, the user can simultaneously input the style prompt information corresponding to the target text.

[0091] Method 2: performing style detection on the image to be processed, and determining style prompt information corresponding to the target text based on the style detection result.

[0092] Here, the image to be processed may refer to the image where the target text is located when the target text is obtained; since the target text needs to be added to the image to be processed, the final stylized text needs to be consistent with the style of the image to be processed.

[0093] In a specific implementation, when performing style detection on the image to be processed, the image to be processed can be input into the style detection model through a pre-trained style detection model, and the style detection model can output the style detection result, which includes the style to which the image to be processed belongs.

[0094] After the style detection result is determined, the text style corresponding to the image style of the image to be processed may be determined according to a pre-established correspondence between the image style and the text style, and the determined text style may be used as the style prompt information.

[0095] Method 3: Perform content detection on the target text, and determine style prompt information corresponding to the text based on the content detection result.

[0096] Specifically, the content detection of the target text may be to perform word segmentation processing on the target text, determine the keywords contained in the target text, then detect whether the keywords contained in the target text include the target keyword, and use the target keyword as the style prompt information. The word segmentation processing may be performed, for example, using an N-gram model.

[0097] The target keyword may be a word used to represent style information, such as comic, ancient style, cool, etc. The target keyword may be a pre-set keyword.

[0098] In another possible implementation, the stylized model may be a model that can only generate a fixed style. In this case, the style prompt information of the stylized model may be fixed, that is, a preset default value.

[0099] Similarly, if each stylized model can only generate stylized text of one style, in this case, a step of selecting a stylized model may also be included.

[0100] Specifically, in response to a selection operation of the user, the stylized model selected by the selection operation may be used as a model for executing step 103 ; or, the model for executing step 103 may be a model that matches the target text.

[0101] Exemplarily, semantic detection may be performed on the target text, and a model matching the semantic detection result may be determined as the model for executing step 103 (for example, a matching relationship between each semantic detection result and the model may be preset).

[0102] In a possible implementation, the target text may include multiple texts, and different texts may correspond to different style prompt information. In other words, not all texts correspond to the same style prompt information. Some texts may correspond to the same style prompt information, while other texts may correspond to different style prompt information.

[0103] In this way, when the mask image and the style prompt information corresponding to the target text are input into the stylization model to determine the stylized text image corresponding to the target text, the mask image and the style prompt information corresponding to each target text can be input into the stylization model to determine the stylized text image corresponding to the target text; wherein, in the stylized text image, the style types of the stylized texts corresponding to different target texts are different.

[0104] Exemplarily, if the target text includes three characters, the style prompt information may include three parts of information, corresponding to the three characters of the target text respectively. Then the generated stylized text image includes stylized text corresponding to the three target texts respectively, and the style types of the three stylized texts are different.

[0105] In a possible implementation, in order to improve the similarity between the text in the stylized text image and the target text, feature constraints may be added to the stylized model during the stylization process of the stylized model.

[0106] Specifically, the mask image can be input into the control model to determine the constraint features corresponding to the mask image, and then the style hint information, the mask image and the constraint features can be input into the stylized model to determine the stylized text image corresponding to the target text.

[0107] The control model may be, for example, a controlnet model. After the mask image is input into the control model, the control model may output constraint features of different dimensions. The constraint features may be understood as features that best characterize the target text, such as structural features of the target text.

[0108] The inputting of the style hint information, the mask image and the constraint feature into the stylized model can be understood as the style hint information and the mask image being simultaneously input into the stylized model, and the constraint feature can be an intermediate feature map acting on the stylized model. For example, the constraint feature can be fused with the feature map of the intermediate output of the stylized model to constrain the processing process of the stylized model.

[0109] In actual applications, when the style prompt information includes the name of the main object, the text in the stylized text image corresponding to the target text is the text composed based on the main object.

[0110] Here, the style prompt information contains the subject object, which means that the style prompt information contains the name of the subject object. When detecting whether the style prompt information contains the subject object, the style prompt information can be exemplarily firstly segmented to determine the segmentation result corresponding to the style prompt, and then the segmentation result is matched with the name of each subject object in the subject object name library. If the match is successful, it is determined that the style prompt information contains the name of the subject object.

[0111] The text formed based on the main object may refer to text formed based on the image of the main object. The combination mentioned here may be understood as patchwork.

[0112] For example, if the style prompt information is "nuts" and the target text is "ABC", then the text in the generated stylized text image is "ABC" composed of nuts. For example, Figure 4a shown.

[0113] In the case that the style prompt information does not include the name of the main object, the text in the stylized text image corresponding to the target text is text composed based on the associated objects associated with the style prompt information.

[0114] Here, the associated object associated with the style prompt information can be understood as an object that can reflect the style indicated by the style prompt information. For example, if the style prompt information is fruit, the associated object can be apples, grapes, bananas, etc.; if the style prompt information is flowers, the associated object can be lilies, sunflowers, roses, etc.

[0115] It should be noted that the main object / associated object constituting the above-mentioned text may be one or more types of objects.

[0116] Generally, the size of the stylized text image and the mask image can be the same. Furthermore, in order to make the text in the stylized text image more vivid, the area where the text in the stylized text image is located may not completely overlap with the mask area in the mask image (the mask area is the area in the mask image corresponding to the target text), that is, the area where the text in the stylized text image is located may be larger or smaller than the mask area in the mask image. The larger or smaller mentioned here does not mean enlarging or reducing in the same proportion, but means not completely overlapping at the same size.

[0117] For example, Figure 4b As stated, Figure 4bIn the figure, the black-and-white image on the left is the mask image, the target text is "P", and the grayscale image on the right is the stylized text image. In the area where the text is located in the stylized text image, the location selected by the dotted box exceeds the original mask area in order to fully display the flowers. In addition to the dotted box, other areas also have content that exceeds the mask area, which will not be introduced one by one here.

[0118] In practical applications, during the process of training the stylized model, the model parameters of the stylized model can be adjusted according to the size of the area where the text is located in the stylized text image generated during the training process and the size of the mask area in the mask image to control the size difference between the two areas.

[0119] In a possible implementation, when the target text is obtained based on the image to be processed, after a stylized text image corresponding to the target text is generated, the stylized text image may be fused with the image to be processed for display.

[0120] In actual applications, after generating a stylized text image corresponding to the target text, the stylized text image can be displayed at the target position (such as the center) of the image to be processed, and then the size and display position of the stylized text image can be set in response to the user's setting instructions for the stylized text image.

[0121] In another possible implementation, the image shape of the stylized text image may be the target text, that is, the stylized text image is an image in the shape of the target text, such as Figure 4a The text in the stylized text image is different from ordinary text, and the text in the stylized text image cannot be modified.

[0122] In a possible implementation, the text in the stylized text image can be deleted. Exemplarily, in response to a user's deletion instruction for any text in the stylized text image, the image area corresponding to the text in the stylized text image can be segmented, and the segmented image area corresponding to the text can be deleted.

[0123] In another possible implementation, after generating a stylized text image based on the above method, it is also possible to respond to a user's publishing instruction and publish a stylized text line corresponding to the stylized text image. Here, after the stylized text corresponding to the stylized text image is published, when other people apply the stylized text, they can directly process the input text to be stylized based on the same processing logic as the generation method of the published stylized text image after inputting the text to be stylized without performing other operations (such as setting style prompt information, etc.).

[0124] The text processing method provided by the embodiment of the present disclosure can generate a text image corresponding to the target text according to the font information corresponding to the target text after obtaining the target text, and then determine the mask image corresponding to the text image, and process the mask image according to the style prompt information through the stylized model to obtain the stylized text image corresponding to the target text. This method can generate personalized stylized text images in real time, improving the processing speed and quality of stylized text.

[0125] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0126] Based on the same inventive concept, a word processing device corresponding to the word processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned word processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0127] Reference Figure 5 , which is a schematic diagram of the structure of a text processing device provided by an embodiment of the present disclosure, the device includes: an acquisition module 501, a generation module 502, and a stylization processing module 503; wherein,

[0128] The acquisition module 501 is used to acquire a target text and determine font information corresponding to the target text;

[0129] A generating module 502, configured to generate a text image corresponding to the target text according to the font information;

[0130] The stylization processing module 503 is used to determine a mask image corresponding to the target text in the text image, and input the mask image and the style prompt information corresponding to the target text into a stylization model to determine a stylized text image corresponding to the target text.

[0131] In a possible implementation manner, the acquisition module 501, when acquiring the target text, is used to:

[0132] Get the target text added to the image to be processed;

[0133] After determining the stylized text image corresponding to the target text, the stylization processing module 503 is further used to:

[0134] The stylized text image is fused with the image to be processed for display.

[0135] In a possible implementation manner, the stylization processing module 503 is further configured to determine the style prompt information corresponding to the target text according to the following method:

[0136] receiving style prompt information corresponding to the target text input by a user; or,

[0137] Performing style detection on the image to be processed, and determining style prompt information corresponding to the target text based on the style detection result; or,

[0138] Content detection is performed on the target text, and style prompt information corresponding to the text is determined based on the content detection result.

[0139] In a possible implementation manner, when the style prompt information includes the name of a main object, the text in the stylized text image corresponding to the target text is text composed based on the main object.

[0140] In a possible implementation manner, when the style prompt information does not include the name of the main object, the text in the stylized text image corresponding to the target text is text composed based on the associated objects associated with the style prompt information.

[0141] In a possible implementation manner, when the target text includes multiple characters, different characters correspond to different style prompt information;

[0142] The stylization processing module 503, when inputting the mask image and the style prompt information corresponding to the target text into the stylization model to determine the stylized text image corresponding to the target text, is used to:

[0143] The mask image and the style prompt information corresponding to each target text are input into a stylized model to determine a stylized text image corresponding to the target text; wherein, in the stylized text image, different target texts correspond to stylized texts of different style types.

[0144] In a possible implementation, the acquisition module 501, when acquiring the target text and determining the font information corresponding to the target text, is used to:

[0145] Acquire an image to be processed, perform content recognition on the image to be processed, and determine target text matching the image to be processed and font information corresponding to the target text based on the content recognition result;

[0146] After determining the stylized text image corresponding to the target text, the method further includes:

[0147] The stylized text image is fused with the image to be processed for display.

[0148] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0149] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 6 , which is a schematic diagram of the structure of a computer device 600 provided in an embodiment of the present disclosure. The computer device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. Figure 6 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0150] like Figure 6 As shown, the computer device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only storage device (ROM) 602 or a program loaded from a storage device 605 to a random access storage device (RAM) 603. Various programs and data required for the operation of the computer device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0151] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 may allow the computer device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The computer device 600 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0152] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing a word processing method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0153] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the word processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0154] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the text processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0155] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0156] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0157] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0158] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0159] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0160] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A text processing method, characterized in that: include: Acquire a target text, and determine font information corresponding to the target text; Generating a text image corresponding to the target text according to the font information; A mask image corresponding to a target text in the text image is determined, and the mask image and style prompt information corresponding to the target text are input into a stylized model to determine a stylized text image corresponding to the target text.

2. The method according to claim 1, characterized in that The step of obtaining the target text includes: Get the target text added to the image to be processed; After determining the stylized text image corresponding to the target text, the method further includes: The stylized text image is fused with the image to be processed for display.

3. The method according to claim 2, characterized in that The method further includes determining style prompt information corresponding to the target text according to the following method: Receiving style prompt information corresponding to the target text input by a user; or, Performing style detection on the image to be processed, and determining style prompt information corresponding to the target text based on the style detection result; or, Content detection is performed on the target text, and style prompt information corresponding to the text is determined based on the content detection result.

4. The method according to claim 1, characterized in that: The step of inputting the mask image and the style prompt information corresponding to the target text into a stylized model to determine a stylized text image corresponding to the target text includes: Inputting the mask image into a control model to determine constraint features corresponding to the mask image; The style prompt information, the mask image and the constraint feature are input into the stylized model to determine a stylized text image corresponding to the target text.

5. The method according to claim 1, characterized in that In the case where the style prompt information includes the name of the main object, the text in the stylized text image corresponding to the target text is text composed based on the main object.

6. The method according to claim 5, characterized in that In the case that the style prompt information does not include the name of the main object, the text in the stylized text image corresponding to the target text is text composed based on the associated objects associated with the style prompt information.

7. The method according to claim 1, characterized in that When the target text includes multiple characters, different characters correspond to different style prompt information; The step of inputting the mask image and the style prompt information corresponding to the target text into a stylized model to determine a stylized text image corresponding to the target text includes: The mask image and the style prompt information corresponding to each target text are input into a stylized model to determine a stylized text image corresponding to the target text; wherein, in the stylized text image, different target texts correspond to stylized texts of different style types.

8. The method according to claim 1, characterized in that The step of acquiring the target text and determining the font information corresponding to the target text includes: Acquire an image to be processed, perform content recognition on the image to be processed, and determine target text matching the image to be processed and font information corresponding to the target text based on the content recognition result; After determining the stylized text image corresponding to the target text, the method further includes: The stylized text image is fused with the image to be processed for display.

9. A word processing device, characterized in that: include: An acquisition module, used to acquire a target text and determine font information corresponding to the target text; A generating module, used for generating a text image corresponding to the target text according to the font information; The stylization processing module is used to determine a mask image corresponding to the target text in the text image, and input the mask image and the style prompt information corresponding to the target text into a stylization model to determine a stylized text image corresponding to the target text.

10. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the word processing method as described in any one of claims 1 to 8 are performed.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the word processing method as claimed in any one of claims 1 to 8.