Data processing method, device and equipment and readable storage medium

By identifying and adjusting foreground and background objects in an image, the target text is displayed with proper coverage, solving the problem of text obscuring foreground objects and improving the display effect and visual attention of image editing.

CN121600100APending Publication Date: 2026-03-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411181962.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In image editing, text content can easily obscure foreground objects when displayed over text, resulting in poor display quality, especially when important foreground objects such as portraits are obscured, leading to poor harmony.

Method used

The system identifies foreground and background objects using an image segmentation model, automatically determines the display coordinates of the target text, ensures it overlaps the background object, embeds it around the foreground object to prevent important foreground objects from being obscured, and adjusts the text style to match the foreground object.

Benefits of technology

It improves the display effect of image editing, ensures clear details of foreground objects, creates overlapping visual layers, and enhances visual attention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600100A_ABST
    Figure CN121600100A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, device and equipment and a readable storage medium, and the method comprises the steps: responding to an editing operation for a business image, and displaying a character input window in an image editing page; the business image comprises a foreground object and a background object; in response to a confirmation operation for a target text input in the character input window, embedding and displaying the target text in the business image to obtain an updated business image; updating a target text in the business image to cover and display the target text on the background object; if the display area of the target text in the updated service image and the display area of the foreground object have an overlapping area, part of content, located in the overlapping area, in the target text is covered by the foreground object. By adopting the method, the display effect of updating the business image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, device, and readable storage medium. Background Technology

[0002] In the process of editing business images to create posters and covers, the business image is often used as the base image, and the text content is displayed on top of the base image. The text content is superimposed on the image, which often obscures important foreground elements. For example, when the foreground object is a human figure, the superimposed text content will obscure the human figure. The coordination between the text content and the business image is poor, resulting in a poor display effect. Summary of the Invention

[0003] This application provides a data processing method, apparatus, device, and readable storage medium that can improve the display effect of updated business images.

[0004] One embodiment of this application provides a data processing method, including:

[0005] In response to editing operations on a business image, a text input window is displayed on the image editing page; the business image includes foreground and background objects;

[0006] In response to the confirmation operation of the target text entered in the text input window, the target text is embedded and displayed in the business image to obtain an updated business image; the target text in the updated business image is displayed on top of the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the part of the target text located in the overlapping area is covered by the foreground object.

[0007] One embodiment of this application provides a data processing apparatus, including:

[0008] The image editing module is used to respond to editing operations on business images and displays a text input window on the image editing page; business images include foreground objects and background objects;

[0009] The image display module is used to respond to the confirmation operation of the target text entered in the text input window, embed and display the target text in the business image to obtain an updated business image; the target text in the updated business image is displayed on top of the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the part of the target text located in the overlapping area is covered by the foreground object.

[0010] In one possible implementation, the number of scene objects is Q, where Q is a positive integer; the image display module is also used to perform the following operations:

[0011] In response to a trigger operation targeting the target foreground object among Q foreground objects in the updated business image, the content covered by the display area of ​​the target foreground object is re-displayed on top of the target foreground object; there is an overlap between the display area of ​​the target foreground object and the display area of ​​the target text.

[0012] In one possible implementation, the image editing page is also used to display a prompt input window; the image display module is also used to perform the following operations:

[0013] In response to a confirmation request for style hint text in the prompt input window, adjust and update at least one of the display style or display position of the target text in the business image; the style type of the adjusted target text matches the style hint text.

[0014] In one possible implementation, the image display module is also used to perform the following operations:

[0015] Displays M image frames for the business image, and responds to the selection operation of the target image frame by the object, displaying the business image in the target image frame; M is a positive integer, and the M image frames include the target image frame.

[0016] In one possible implementation, the text input window is also used to display N recommended texts for the business image; N is a positive integer, and the N recommended texts include updated text; the image display module is also used to perform the following operations:

[0017] N recommended texts for the business image are displayed in the candidate area of ​​the text input window; the N recommended texts include at least one of the following: recommended text associated with the shooting time of the business image, recommended text associated with the shooting location of the business image, or template text associated with the image style of the business image;

[0018] In response to a selection operation for the target text among N recommended texts, enter the target text in the text input window.

[0019] In one possible implementation, the image display module is also used to perform the following operations:

[0020] Display at least two font icons and at least two font size icons on the style editing page;

[0021] In response to a selection action for a target font identifier among at least two font identifiers, highlight the target font identifier in the style editing page;

[0022] In response to the selection operation of the target font size identifier among at least two font size identifiers, highlight the target font size identifier in the style editing page;

[0023] The image display module is used to respond to confirmation operations for target text entered in the text input window, embed and display the target text in the business image, and specifically perform the following operations when the business image is updated:

[0024] In response to a confirmation operation for the target text entered in the text input window, the target text with the target font and target font size is embedded and displayed in the business image, resulting in an updated business image; the target font is the font indicated by the target font identifier, and the target font size is the font size indicated by the target font size identifier.

[0025] In one possible implementation, the image display module is also used to perform the following operations:

[0026] If the display area of ​​the target text overlaps with the display area of ​​the foreground object, and the target text is completely covered by the foreground object, then the moving border of the target text in the updated business image will be highlighted.

[0027] In response to a drag operation on the moving border of the target text, the dragged target text is redisplayed in the updated business image.

[0028] In one possible implementation, the image editing module is also used to perform the following operations:

[0029] Display S content items, respond to the selection operation of the target content item among the S content items, display the target content item in the updated business image, and re-embed the target text in the updated business image containing the target content item; S is a positive integer; if the display area of ​​the re-embedded target text item overlaps with the display area of ​​the target content item, then part of the content in the target text item located in the overlapping area within the target content item will be covered by the target content item.

[0030] In one possible implementation, the coverage ratio of a single character in the overlapping region of the target text is less than a coverage ratio threshold; the image display module is also used to perform the following operations:

[0031] In response to an update operation on the target text in the updated business image, the updated target text is re-embedded and displayed in the updated business image; if the display area of ​​the updated target text overlaps with the display area of ​​the foreground object, the coverage ratio of a single character in the updated target text located in the overlapping area is less than the coverage ratio threshold.

[0032] In one possible implementation, the image display module is also used to perform the following operations:

[0033] Feature extraction is performed on the business image to obtain T unit feature vectors; T is a positive integer, and the T unit feature vectors are used to represent the feature information of the pixels in the business image.

[0034] For each of the T unit feature vectors, feature recognition is performed to obtain the foreground probability value corresponding to each unit feature vector. The pixels corresponding to the foreground probability values ​​that are greater than or equal to the foreground probability threshold are determined as foreground pixels.

[0035] Foreground objects in the business image are determined based on foreground pixels, and pixels in the business image other than foreground objects are determined as background objects.

[0036] The image display module is used to respond to confirmation operations for target text entered in the text input window. When embedding and displaying target text in a business image, it is specifically used to perform the following operations:

[0037] In response to the confirmation action for the target text entered in the text input window, obtain the display style of the target text;

[0038] Determine the display coordinates of the target text in the business image based on the display styles of the foreground object, background object, and target text;

[0039] The target text is embedded and displayed at the display coordinates in the business image to obtain the updated business image.

[0040] In one possible implementation, the image display module is used to embed the target text at the display coordinates in the business image, and when updating the business image, it is specifically used to perform the following operations:

[0041] A foreground layer is generated based on the display area of ​​the foreground object; the foreground layer contains the display area of ​​the foreground object, and the area in the foreground layer other than the display area of ​​the foreground object is a transparent area; the size of the foreground layer is the same as the size of the business image.

[0042] Based on the display coordinates and the display style of the target text, a text layer for the target text is generated; the area in the text layer other than the display area of ​​the target text is a transparent area; the size of the text layer is the same as the size of the business image.

[0043] The foreground layer, text layer, and business image are overlaid to obtain the updated display image; the text layer is located above the business image, and the foreground layer is located above the text layer.

[0044] In one possible implementation, when the image display module determines the display coordinates of the target text in the business image based on the display styles of the foreground object, background object, and target text, it specifically performs the following operations:

[0045] Initial display coordinates are generated based on the display area of ​​the foreground object and the display style of the target text. Based on the initial display coordinates and the display style of the target text, the undetermined display area of ​​the target text in the business image is determined. A character ratio threshold is generated based on the image resolution of the business image.

[0046] If the display area of ​​the target text does not overlap with the display area of ​​the foreground object, or if the coverage ratio of a single character in the target text located in the overlapping area is less than the character ratio threshold, then the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image.

[0047] If the undetermined display area that overlaps with the display area of ​​the foreground object does not meet the text recognition conditions, the initial display coordinates are updated in the opposite direction to the overlapping area to obtain the display coordinates of the target text in the business image.

[0048] In one possible implementation, the image display module is also used to perform the following operations:

[0049] Feature extraction is performed on the desired display area to obtain the desired display feature vector. Text recognition is then performed on the desired display feature vector to obtain the text recognition result.

[0050] If the text recognition result matches the target text, then the area to be displayed is determined to meet the text recognition conditions;

[0051] If the text recognition result does not match the target text, it is determined that the pending display area does not meet the text recognition conditions.

[0052] In one possible implementation, the image display module updates the initial display coordinates along the direction pointing to the overlapping area. When obtaining the display coordinates of the target text in the business image, it specifically performs the following operations:

[0053] Based on the image resolution of the business image, a position movement value is generated. Based on the initial display coordinates and the position movement value, the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the first display coordinates. Based on the first display coordinates and the display style of the target text, the first display area of ​​the target text in the business image is determined. The ordinate of the first display coordinates is smaller than the ordinate of the initial display coordinates.

[0054] If the coverage ratio of a single character in the overlapping area of ​​the first display area and the display area of ​​the foreground object is less than the character ratio threshold, then based on the position movement value, the first display coordinates are updated along the direction pointing to the overlapping area to obtain new first display coordinates. The new first display area is determined in the business image until the coverage ratio of a single character in the overlapping area of ​​the new first display area and the display area of ​​the foreground object is greater than or equal to the character ratio threshold. The new first display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new first display coordinates is less than the ordinate of the first display coordinates.

[0055] In one possible implementation, the image display module updates the initial display coordinates along the direction opposite to the overlapping area. When obtaining the display coordinates of the target text in the business image, it specifically performs the following operations:

[0056] Based on the image resolution of the business image, a positional movement value is generated. Based on the initial display coordinates and the positional movement value, the initial display coordinates are updated in the opposite direction to the overlapping area to obtain the second display coordinates. Based on the second display coordinates and the display style of the target text, the second display area of ​​the target text in the business image is determined. The ordinate of the second display coordinates is greater than the ordinate of the initial display coordinates.

[0057] If the second display area does not meet the text recognition conditions, the second display coordinates are updated along the opposite direction to the overlapping area based on the position movement value to obtain new second display coordinates. The new second display area in the business image is determined by the new second display coordinates until the new second display area meets the text recognition conditions. The new second display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new second display coordinates is greater than the ordinate of the second display coordinates.

[0058] In one possible implementation, the image display module is also used to perform the following operations:

[0059] Feature extraction is performed on each of the P image classification labels to obtain the classification feature vectors corresponding to the P image classification labels. Feature extraction is performed on the business image to obtain T unit feature vectors. P and T are both positive integers, and the T unit feature vectors are used to represent the feature information of the pixels in the business image.

[0060] Based on P classification feature vectors, image classification is performed on the image feature sequence composed of T unit feature vectors to obtain the image classification probabilities corresponding to the P classification feature vectors. The image classification labels corresponding to the image classification probabilities that are greater than or equal to the classification threshold are determined as the image classification results of the business image. Based on the image classification results, template text associated with the image style of the business image is generated.

[0061] One embodiment of this application provides a computer device, including: a processor, a memory, and a network interface;

[0062] The processor is connected to a memory and a network interface. The network interface is used to provide data communication functions, and the memory is used to store computer programs. When the computer program is executed by the processor, the computer device performs the method provided in the embodiments of this application.

[0063] One aspect of this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having the processor performs the method provided in this application.

[0064] One embodiment of this application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the method provided in this application embodiment.

[0065] This application embodiment obtains the uploaded business image in response to an editing operation on the business image, displays a text input window in the image editing page, and obtains the target text and its display style determined by the object in response to a confirmation operation on the target text entered in the text input window. Based on the display area of ​​the foreground object and the display style of the target text, the display coordinates of the target text are automatically determined. The target text is then embedded at these display coordinates, thus embedding and displaying the target text in the business image to obtain an updated business image. In this updated business image, the target text is displayed overlaid on the background object. If the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the portion of the target text located in the overlapping area is covered by the foreground object. This application embodiment can embed and display target text around the foreground object, achieving a display effect where the target text blends with the background object and is covered by the foreground object. This avoids obscuring important foreground elements, improves the detail of the foreground object, makes the content of the updated business image more organized, and highlights the target text in the updated business image, creating a visually layered overlay and enhancing the visual attention and display effect of the updated business image. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0067] Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application;

[0068] Figure 2 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 1 ;

[0069] Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 ;

[0070] Figure 4 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 2 ;

[0071] Figure 5 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 3 ;

[0072] Figure 6 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 2 ;

[0073] Figure 7 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 4 ;

[0074] Figure 8 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 3 ;

[0075] Figure 9 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 5 ;

[0076] Figure 10 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 6 ;

[0077] Figure 11 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 7 ;

[0078] Figure 12 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0079] Figure 13 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0080] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0081] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application. For example... Figure 1 As shown, the network architecture may include a service server 100 and a terminal device cluster. The terminal device cluster may include terminal devices 10a, 10b, ..., 10n. Each terminal device in the terminal device cluster may have a communication connection with the service server 100. For example, terminal device 10a may have a communication connection with the service server 100, and terminal device 10b may have a communication connection with the service server 100. The communication connection is not limited to a specific method. It may be a direct or indirect connection via wired communication, a direct or indirect connection via wireless communication, or other methods. This application does not impose any restrictions on these methods.

[0082] Each terminal device in the terminal device cluster can include: smartphones, tablets, laptops, desktop computers, intelligent voice interaction devices, smart home appliances (e.g., smart TVs), wearable devices, in-vehicle terminals, aircraft, and other intelligent terminals with data processing capabilities. In-vehicle terminals can be terminal devices used in intelligent transportation scenarios and assisted driving scenarios. It should be understood that, for example... Figure 1 Each terminal device in the terminal device cluster shown can be equipped with an application client that has data processing capabilities. When the application client runs on each terminal device, it can interact with the aforementioned... Figure 1 Data interaction is performed between the business servers 100 shown.

[0083] Specifically, the application client may include: in-vehicle client, smart home client, entertainment client (e.g., game client), multimedia client (e.g., video client), social client, and information client (e.g., news client). In this embodiment, the application client may be integrated into a client (e.g., a social client) or may be a standalone client (e.g., a news client). This embodiment does not limit the type of application client.

[0084] Among them, the business server 100 can be the server corresponding to the application client. The business server 100 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0085] Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, available on demand, and offers flexibility and convenience. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support to be realized through cloud computing.

[0086] like Figure 1 As shown, for ease of understanding, terminal device 10a is used as an example. The user can upload a business image in the application client. Terminal device 10a can send the business image to business server 100. Business server 100 uses an image segmentation model to segment the foreground and background objects in the business image, obtaining the display areas of the foreground and background objects, and then sends these display areas back to terminal device 10a. The image segmentation model can be an RMBG (Remove Background) model implemented with U-net (a deep learning convolutional neural network), a SegNet (Segmentation Net) model, etc., and is not limited to this embodiment.

[0087] The target text can be entered in the text input window, and the terminal device 10a can embed and display the target text in the business image to obtain an updated business image. The target text in the updated business image is displayed over the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the portion of the target text located in the overlapping area is covered by the foreground object.

[0088] This application embodiment can complete the image segmentation task through the business server 100, thereby improving the accuracy and technical cost of image segmentation. Alternatively, a local image segmentation model can be deployed on the terminal device 10a. The image segmentation model built on the business server 100 can be deployed on the terminal device 10a through transfer learning. The image segmentation model can also be trained on the terminal device 10a by using the image segmentation model built on the business server 100 as a teacher model through knowledge distillation technology. This reduces the computational complexity and memory consumption of the model, improves the security of image data, and is more suitable for deployment and distribution on the terminal device 10a.

[0089] It is understood that in the specific implementation of this application, the user (object or player) data involved, such as the above-mentioned business images, requires user permission or consent when the above and below embodiments of this application are applied to specific products or technologies, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions.

[0090] If this application requires the collection of object data (such as user data), a prompt interface or pop-up window will be displayed before and during the collection process. This prompt interface or pop-up window is used to inform the user that certain data is being collected. The data acquisition steps will only begin after the user confirms the prompt interface or pop-up window; otherwise, the process will end. Furthermore, the acquired user data will be used in reasonable and legal scenarios or for legitimate purposes. Optionally, in scenarios where user data needs to be used but user authorization has not been obtained, authorization can be requested from the user, and the user data can only be used after authorization is granted.

[0091] Please see Figure 2 , Figure 2 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 1 .like Figure 2As shown, the object can upload a business image X on the image editing page of the application client on the terminal device. The image editing page can be as shown on page 101. The application client can display the business image X uploaded by the object and perform image segmentation on the business image X to obtain the display area of ​​the foreground object FG and the display area of ​​the background object BG. The terminal device can be as shown on page 101. Figure 1 Any terminal device in the terminal device cluster shown can be, for example, terminal device 10a. The image segmentation task can be implemented by an image segmentation model deployed in the terminal device, and this embodiment of the application does not impose any limitations on this.

[0092] The object can click the text editing control T, as shown on page 102. The terminal device can respond to the editing operation on the business image X, displaying a text input window A on the image editing page. The object can enter "target text" in the text input window A, and the terminal device can respond to the confirmation operation of the "target text" entered in the text input window A. As shown on page 103, the "target text" is embedded and displayed in the business image X, resulting in an updated business image Y. The display area of ​​the "target text" overlaps with the display area of ​​the foreground object FG in area B. The "target text" in the updated business image Y is displayed over the background object BG, and the foreground object FG is displayed over the "target text".

[0093] As shown on page 103, the object can select "Recommended Text 1" in the candidate area of ​​the text input window A. The terminal device can display "Recommended Text 1" in the text input window A and respond to the confirmation operation for "Recommended Text 1" entered in the text input window A. As shown on page 104, the "Target Text" embedded in the updated business image Y is replaced with "Recommended Text 1". The display position of "Recommended Text 1" can be the same as that of "Target Text". The display area of ​​"Recommended Text 1" overlaps with the display area of ​​the foreground object FG in area B. "Recommended Text 1" in the updated business image Y is displayed on top of the background object BG, and the foreground object FG is displayed on top of "Recommended Text 1".

[0094] As shown on page 102, the object can click the style editing control to display the style editing page, as shown on page 105. The terminal device can display several font identifiers and font size identifiers on the style editing page. The terminal device can respond to a selection operation for a target font identifier among at least two font identifiers, highlighting the target font identifier on the style editing page. Similarly, it can respond to a selection operation for a target font size identifier among at least two font size identifiers, highlighting the target font size identifier on the style editing page. For example, if the object selects an italic font identifier, the selected target font size identifier could be 12pt (point), while the default font size before the object edits the style is 18pt. The terminal device can respond to confirmation operations for the target font identifier and target font size identifier, as shown on page 106, embedding and displaying "target text" with the target font and target font size in the business image X, thus updating the business image. Here, the target font is the font indicated by the target font identifier, and the target font size is the font size indicated by the target font size identifier. Optionally, the terminal device may also display a font size recommendation message determined based on the resolution of the business image X, indicating the font size that can be clearly displayed in the business image X.

[0095] The target text embedded in this embodiment can be entered by the user or selected from associated recommended text. The display style (font and size) of the target text can also be edited, meeting diverse user needs and providing a more comprehensive editing method for images. This embodiment is not only suitable for personal users in everyday scenarios such as photo editing and social media sharing, but also perfectly supports professional designers and photographers in quickly achieving text cutout effects in advertising, promotional posters, and other design needs. Through the automatic recognition of foreground objects in business images and the ability to synthesize embedded target text, the efficiency and convenience of image editing tasks can be improved.

[0096] Please see Figure 3 , Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 This data processing method can be executed by a computer device, which can be, for example, Figure 1 The business server 100 shown or any terminal device in the terminal device cluster, such as terminal device 10a, can be used. The following description will use the example of this data processing method being executed by a computer device. This data processing method will at least include the following steps S101-S102:

[0097] Step S101: In response to an editing operation on a business image, a text input window is displayed on the image editing page; the business image includes a foreground object and a background object;

[0098] Specifically, users can upload business images on the image editing page of the application client on the computer device. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 2 .like Figure 4 As shown on page 201, a computer device can perform image segmentation on a business image X based on a deployed image segmentation model to obtain the display area of ​​the foreground object FG and the display area of ​​the background object BG.

[0099] In this context, the foreground object can be an object close to the visual center in the image, typically the main focus or subject of the image. The background object can be an object farther from the visual center in the image, usually providing context and environment for the foreground object. The image depth of the foreground object in the image is less than that of the background object. The image segmentation task can be implemented by an image segmentation model deployed on a computer device. The image segmentation model can be the RMBG model implemented with U-net, the SegNet model, etc., and this embodiment of the application is not limited thereto.

[0100] As shown on page 201, the object can click the text editing control T, and the computer device can respond to the editing operation for the business image. As shown on page 202, the text input window A is displayed on the image editing page.

[0101] In step S102, in response to the confirmation operation for the target text entered in the text input window, the target text is embedded and displayed in the business image to obtain an updated business image; the target text in the updated business image is displayed on top of the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, then the part of the target text located in the overlapping area is covered by the foreground object.

[0102] Specifically, computer equipment can generate recommended text based on business images. Users can choose the recommended text or manually enter text. See also... Figure 4 ,like Figure 4 As shown, when an object clicks on text input window A, the application client's keyboard is automatically activated, allowing the object to input text. For example, if the object inputs "target text" in text input window A, the computer device can respond with a confirmation operation for the "target text" entered in text input window A. As shown on page 203, the "target text" is embedded and displayed in business image X, resulting in updated business image Y. The display area of ​​the "target text" overlaps with the display area of ​​the foreground object FG in area B. The "target text" in the updated business image Y is displayed over the background object BG, and the foreground object FG is also displayed over the "target text."

[0103] Optional, please see again Figure 5 , Figure 5 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 3 .like Figure 5 As shown on page 204, after obtaining the updated business image Y, the object can click the material editing control C to enter the material editing page and display the material content on the business image. The process can be as follows: display S material contents, respond to the selection operation of the target material content among the S material contents, display the target material content in the updated business image, and re-embed the target text in the updated business image containing the target material content; S is a positive integer; if the display area of ​​the re-embedded target text overlaps with the display area of ​​the target material content, then part of the content in the target text located in the overlapping area within the target material content is covered by the target material content.

[0104] Specifically, as shown on page 205, the material editing page allows the computer device to display S material contents. These S material contents can include material content 1 and material content 2. An object can click on material content 2, and the computer device can determine the selected material content as the target material content. Taking material content 2 as the target material content, the computer device can respond to the selection operation on material content 2, as shown on page 206, by displaying material content 2 in the updated business image and re-embedding the target text in the updated business image containing material content 2.

[0105] It is understandable that, on page 206, the display area of ​​the re-embedded target text overlaps with the display area of ​​the target material content in an area E, and part of the content in the target text located within the overlapping area E of the target material content is covered by the target material content.

[0106] Optional, such as Figure 5 As shown on page 204, after obtaining the updated business image Y, the object can click the frame editing control C to enter the frame editing page and display the business image in the frame. The process can be as follows: display M image frames for the business image, respond to the object's selection operation for the target image frame, and display the business image in the target image frame; M is a positive integer, and the M image frames include the target image frame.

[0107] Specifically, the frame editing page can be as shown on page 207. The computer device can display M image frames on the frame editing page. The M image frames can include image frame 1, image frame 2, image frame 3, etc. An object can click on image frame 1, and the computer device can determine the image frame selected by the object as the target image frame, responding to the selection operation of the target image frame, as shown on page 208, and displaying the business image in the target image frame.

[0108] This application embodiment obtains the uploaded business image in response to an editing operation on the business image, displays a text input window in the image editing page, and obtains the target text and its display style determined by the object in response to a confirmation operation on the target text entered in the text input window. Based on the display area of ​​the foreground object and the display style of the target text, the display coordinates of the target text are automatically determined. The target text is then embedded at these display coordinates, thus embedding and displaying the target text in the business image to obtain an updated business image. In this updated business image, the target text is displayed overlaid on the background object. If the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the portion of the target text located in the overlapping area is covered by the foreground object. This application embodiment can embed and display target text around the foreground object, achieving a display effect where the target text blends with the background object and is covered by the foreground object. This avoids obscuring important foreground elements, improves the detail of the foreground object, makes the content of the updated business image more organized, and highlights the target text in the updated business image, creating a visually layered overlay and enhancing the visual attention and display effect of the updated business image.

[0109] Please see Figure 6 , Figure 6 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 2 This data processing method can be executed by a computer device, which can be, for example, Figure 1 The business server 100 shown or any terminal device in the terminal device cluster, such as terminal device 10a, can be used. The following description will use the example of this data processing method being executed by a computer device. This data processing method will at least include the following steps S201-S205:

[0110] Step S201: In response to an editing operation on a business image, a text input window is displayed on the image editing page; the business image includes a foreground object and a background object;

[0111] For details, please refer to the above. Figure 3 The specific description of step S101 in the corresponding embodiment will not be repeated here.

[0112] In step S202, in response to the confirmation operation for the target text entered in the text input window, the target text is embedded and displayed in the business image to obtain an updated business image; the target text in the updated business image is displayed on top of the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the part of the target text located in the overlapping area is covered by the foreground object.

[0113] For details, please see [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 1 .like Figure 2 As shown on page 102, the computer device can generate recommended text based on the business image, and the object can select the recommended text in the candidate area of ​​the text input window A or manually enter text in the text input window A.

[0114] Taking the example of an object entering "target text" in text input window A, when the object clicks on text input window A, the keyboard of the application client can be automatically brought up, allowing the object to enter text content. The computer device can then respond with a confirmation operation for the "target text" entered in text input window A. As shown on page 103, the "target text" is embedded and displayed in business image X, resulting in updated business image Y. The display area of ​​the "target text" overlaps with the display area of ​​the foreground object FG in area B. The "target text" in the updated business image Y is displayed over the background object BG, and the foreground object FG is also displayed over the "target text".

[0115] Taking the selection of recommended text in the candidate window of text input window A as an example, as shown on page 102, the computer device can display several recommended texts. These recommended texts can include recommended texts associated with the shooting time of the business image, recommended texts associated with the shooting location of the business image, and template texts associated with the image style of the business image. For example, recommended texts can include recommended text 1 and recommended text 2. When the shooting location of the business image is "Summer Palace," the recommended texts associated with the shooting location of the business image can include "Summer Palace," "Beijing," etc. When the shooting location of the business image is "Maldives," the recommended texts associated with the shooting location of the business image can include "Maldives," "Maldives," etc. When the shooting time of the business image is "November 14, 2023, 8:26 AM," the recommended texts associated with the shooting time of the business image can include "November 14, 2023," "08:26," etc. When the business image is a cat photo, the template texts associated with the image style of the business image can include "pet," "cat," etc. When the business image is a landscape photo, the template text associated with the image style of the business image may include "travel", "check-in", "photography", etc., and this application embodiment does not impose any limitations.

[0116] The computer device can generate template text in the following ways: Features are extracted from P image classification labels to obtain classification feature vectors corresponding to each of the P image classification labels; features are extracted from the business image to obtain T unit feature vectors; P and T are both positive integers, and the T unit feature vectors are used to characterize the feature information of pixels in the business image; based on the P classification feature vectors, image classification is performed on the image feature sequence composed of the T unit feature vectors to obtain the image classification probabilities corresponding to each of the P classification feature vectors; the image classification labels corresponding to the image classification probabilities that are greater than or equal to the classification threshold are determined as the image classification results of the business image; and template text associated with the image style of the business image is generated based on the image classification results.

[0117] Specifically, the computer device can first extract features from several image classification labels to obtain classification feature vectors corresponding to each image classification label. The image classification labels can be predefined image categories, foreground objects, or background objects in the image. The computer device can then extract features from the business image to obtain unit feature vectors representing the feature information of pixels in the business image. Based on the classification feature vectors, the computer device can perform image classification on the image feature sequence composed of unit feature vectors, obtaining the image classification probability corresponding to each classification feature vector. The image classification label corresponding to the image classification probability greater than or equal to a classification threshold (preset value) is determined as the image classification result of the business image. A single business image can have multiple image classification results. The computer device can generate template text associated with the image style of the business image based on the image classification results. One image classification result can generate multiple associated template texts. For example, when the image classification result is a landscape photo, the generated template text can include "travel," "check-in," "photography," etc., which is not limited in this embodiment.

[0118] As shown on page 103, the object can select "Recommended Text 1" in the candidate area of ​​the text input window A. The computer device can display "Recommended Text 1" in the text input window A. In response to the confirmation operation of "Recommended Text 1" entered in the text input window A, the "Target Text" embedded in the updated business image Y is replaced with "Recommended Text 1". The display position of "Recommended Text 1" can be the same as that of "Target Text". The display area of ​​"Recommended Text 1" overlaps with the display area of ​​the foreground object FG in area B. "Recommended Text 1" in the updated business image Y is displayed on top of the background object BG, and the foreground object FG is displayed on top of "Recommended Text 1".

[0119] Please see again Figure 7 , Figure 7 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 4 .like Figure 7 As shown on page 301, after the object confirms the input of "target text", the computer device embeds and displays "target text" in the business image to obtain an updated business image Y. Among them, the display area of ​​"target text" overlaps with the display area of ​​the foreground object FG in an area B. The "target text" in the updated business image Y is displayed on top of the background object BG, and the foreground object FG is displayed on top of the "target text".

[0120] It is understood that there may be several foreground objects in the updated business image Y. The computer device can respond to the trigger operation for the target foreground object among the Q foreground objects in the updated business image and adjust the layer display relationship of the target foreground object. The process may be as follows: in response to the trigger operation for the target foreground object among the Q foreground objects in the updated business image, the part of the content covered by the display area of ​​the target foreground object is re-overlaid on the target foreground object; there is an overlapping area between the display area of ​​the target foreground object and the display area of ​​the target text.

[0121] Specifically, the target foreground object can be a foreground object FG. As shown on page 302, the computer device can respond to a trigger operation on the foreground object FG in the updated business image, displaying a dashed box associated with the display area of ​​the foreground object FG. The object can click the layer adjustment control F corresponding to the dashed box, as shown on page 303, to re-overlay the content covered by the display area of ​​the foreground object FG. In the updated image Y after re-overlay, the display area of ​​the "target text" overlaps with the display area of ​​the foreground object FG in an overlapping area G (the range and position of the overlapping area G are the same as those of the overlapping area B), and the "target text" in the updated business image Y is overlaid on the foreground object FG.

[0122] Step S203: In response to the confirmation operation for the style hint text in the prompt input window, adjust and update at least one of the display style or display position of the target text in the business image; the style type of the adjusted target text matches the style hint text.

[0123] For details, please see [link / reference]. Figure 7 ,like Figure 7 As shown, the image editing page also displays a prompt input window, which can be prompt input window L in page 304. The object can input style prompt text in prompt input window L. The style prompt text can be the object's desired text for the "target text," or text describing the display style and presentation of the "target text." The computer device can respond to confirmation operations for the style prompt text in the prompt input window, adjusting or updating the display style or position of the target text in the business image based on the style prompt text. As shown in page 304, the style prompt text entered by the object can be "italic, centered, 18pt." The computer device can adjust the font style of the "target text" to "italic," the font size to "18pt," and the display position to the center of the business image. As shown in page 305, the computer device can display the target text that matches the style prompt text. The adjusted target text presents a style type that matches the style prompt text.

[0124] Step S204: If the display area of ​​the target text overlaps with the display area of ​​the foreground object, and the target text is completely covered by the foreground object, then the moving border of the target text in the updated business image is highlighted; in response to the drag operation of the moving border of the target text, the dragged target text is redisplayed in the updated business image.

[0125] For details, please see [link / reference]. Figure 7 ,like Figure 7 As shown, after adjusting the font size, display position, and other information of the "target text," the "target text" may be completely covered by the foreground object FG. If the display area of ​​the target text overlaps with the display area of ​​the foreground object, and the target text is completely covered by the foreground object, then, as shown on page 306, the computer device can highlight the moving border J of the target text in the updated business image. The object can drag the moving border J. As shown on page 307, the computer device can respond to the dragging operation of the moving border of the target text and redisplay the dragged target text in the updated business image. The display position of the dragged target text is related to the position where the dragging operation stops.

[0126] Step S205: In response to the update operation for the target text in the updated business image, the updated target text is re-embedded and displayed in the updated business image; if the display area of ​​the updated target text overlaps with the display area of ​​the foreground object, the coverage ratio of a single character in the overlapping area of ​​the updated target text is less than the coverage ratio threshold.

[0127] Specifically, when the target text's font size or font is updated, the computer device can adjust the target text's display position and re-embed the updated target text in the updated business image, ensuring that the coverage ratio of a single character in the target text is always less than the coverage ratio threshold. This avoids the target text being excessively covered by foreground objects, thus affecting the semantic recognition of the target text.

[0128] Please see again Figure 7 ,like Figure 7As shown on page 301, the font size of the "target text" can be 14pt, and the coverage ratio of a single character in the overlapping area B of the "target text" can be a first coverage ratio. The first coverage ratio is less than a coverage ratio threshold (preset value). As shown on page 308, the object adjusts the font identifier of the "target text" to the target font identifier and adjusts the font size identifier to the target font size identifier, which can be 18pt. When the object adjusts the font identifier or font size identifier of the target font, the computer device can automatically adjust the display position of the "target text" to maintain the coverage ratio of a single character in the overlapping area between the display area of ​​the target text and the display area of ​​the foreground object being less than a certain coverage ratio threshold. The computer device can respond to an update operation for the target text in an updated business image, re-embed and display the updated target text in the updated business image, where the display area of ​​the updated target text overlaps with the display area of ​​the foreground object in an overlapping area K. The coverage ratio of a single character in the overlapping area of ​​the updated target text is a second coverage ratio. The second coverage ratio is less than a coverage ratio threshold.

[0129] It's understandable that the updated font size of 18pt is larger than the previous 14pt. If the display coordinates remain unchanged, the display area of ​​the 18pt target text will be more significantly covered by the display area of ​​the foreground object, reducing the readability of the updated target text. Therefore, the computer device can determine a coverage ratio threshold and automatically adjust the display position of the "target text" to ensure that the coverage ratio of individual characters in the overlapping area between the target text's display area and the foreground object's display area is less than a certain coverage ratio threshold. When the coverage ratio is large, the display position of the target text can be adjusted upwards so that the adjusted coverage ratio is less than the coverage ratio threshold, thereby ensuring the readability and clear display of the target text.

[0130] Optionally, the object can click the style editing control to display a style editing page, as shown on page 307. The computer device can display several font and font size identifiers on the style editing page. In response to a selection operation for a target font identifier among at least two font identifiers, the computer device can highlight the target font identifier on the style editing page. Similarly, in response to a selection operation for a target font size identifier among at least two font size identifiers, the computer device can highlight the target font size identifier on the style editing page. For example, if the object selects an italic font identifier, the selected target font size identifier could be 12pt, while the default font size before style editing is 18pt. The computer device can respond to confirmation operations for the target font and target font size identifiers, as shown on page 308, embedding and displaying "target text" with the target font and target font size in the updated business image, thus obtaining the updated business image. Here, the target font is the font indicated by the target font identifier, and the target font size is the font size indicated by the target font size identifier. Optionally, the computer device can also display font size recommendation information determined based on the resolution of the business image, indicating the font size size that can be clearly displayed in the business image.

[0131] This application embodiment obtains the uploaded business image in response to an editing operation on the business image. An artificial intelligence model automatically identifies the display areas of the foreground and background objects in the business image. A text input window is displayed on the image editing page. In response to a confirmation operation on the target text entered in the text input window, the target text determined by the object and its display style are obtained. Based on the display areas of the foreground objects and the display style of the target text, the display coordinates of the target text are automatically determined. The target text is then embedded at these display coordinates, thus embedding and displaying the target text in the business image, resulting in an updated business image. In this updated business image, the target text is displayed over the background object. If the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the portion of the target text located in the overlapping area is covered by the foreground object. This application embodiment can embed target text around a foreground object, achieving a display effect where the target text blends with the background object and is covered by the foreground object. This avoids obscuring important foreground elements, enhances the detail of the foreground object, and makes the content of the updated business image more organized. Simultaneously, it highlights the target text in the updated business image, creating a layered visual hierarchy and improving the visual attention and display effect of the updated business image. This process requires no manual intervention, greatly simplifying the workflow for generating images with embedded text. It eliminates the need to learn and understand complex image editing tools to create various layers and masks to achieve the embedded display effect, reducing the learning cost, increasing the efficiency of generating images containing embedded text, and reducing technical costs.

[0132] On the other hand, the target text embedded in this embodiment can be entered by the object itself or selected from associated recommended text. The display style (font and size) of the target text can also be edited, satisfying diverse needs. In the prompt input window, the object can also enter style prompt text for the target text object. An artificial intelligence model identifies the semantics of the style prompt text, and adjusts the display style and position of the target text based on the style prompt text, ensuring that the style type of the adjusted target text matches the style prompt text. This further reduces the learning cost for users in image editing and improves the efficiency of image editing. This embodiment also allows for dynamic adjustment of the display position of the target foreground object through dragging operations, providing a way for users to edit the display area of ​​the target text themselves, thus improving the feasibility of this embodiment.

[0133] Please see Figure 8 , Figure 8 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 3 This data processing method can be executed by a computer device, which can be, for example, Figure 1 The business server 100 shown or any terminal device in the terminal device cluster, such as terminal device 10a, can be used. The following description will use the example of this data processing method being executed by a computer device. This data processing method will at least include the following steps S301-S305:

[0134] Step S301: In response to an editing operation on a business image, a text input window is displayed on the image editing page; the business image includes a foreground object and a background object;

[0135] For details, please refer to the above. Figure 3 The specific description of step S101 in the corresponding embodiment will not be repeated here.

[0136] Step S302: Extract features from the business image to obtain T unit feature vectors; T is a positive integer, and the T unit feature vectors are used to represent the feature information of pixels in the business image; perform feature recognition on the T unit feature vectors to obtain the foreground probability value corresponding to each unit feature vector, and determine the pixels corresponding to the foreground probability values ​​that are greater than or equal to the foreground probability threshold as foreground pixels; determine the foreground objects in the business image based on the foreground pixels, and determine the pixels in the business image other than the foreground objects as background objects;

[0137] For details, please see [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 5 .like Figure 9 As shown, the computer device can segment the business image 401 using the deployed image segmentation model to obtain the display area of ​​the foreground object 402 and the display area of ​​the background object. The image segmentation model can be an RMBG model implemented with U-net, a SegNet model, etc., and this embodiment is not limited thereto. The image segmentation model can be obtained by using transfer learning and knowledge distillation techniques, where a pre-trained segmentation model is used as a teacher model to train the student model in the computer device, which can reduce the computational complexity and memory consumption of the segmentation model.

[0138] A business image may include T pixels. For example, T pixels can be used to represent a 512×512 pixel business image. The computer device can obtain an RGB (Red Green Blue) array composed of T pixels, with a size of 512×512×3. The computer device can perform feature extraction on the RGB array to obtain a unit feature vector corresponding to each pixel. The T unit feature vectors are used to characterize the feature information of the pixels in the business image.

[0139] The computer device can perform feature recognition on T unit feature vectors to obtain the foreground probability value corresponding to each unit feature vector. The foreground probability value can be a probability value between 0 and 1. The computer device identifies pixels with foreground probability values ​​greater than or equal to a foreground probability threshold as foreground pixels. For example, pixels with a foreground probability value greater than or equal to 0.5 are identified as foreground pixels. The computer device can then perform subject recognition on the foreground pixels to obtain the foreground objects in the business image, and identify pixels in the business image other than foreground objects as background objects. Specifically, if the subject recognition result is key object information, such as when there is a person in the business image that is close to the visual center of the image and occupies a large area, then the object segmentation model is used; otherwise, the foreground segmentation model is used. Different segmentation methods are selected based on different subject types. For example, in a scene with only people, the object segmentation model can also include objects near the person as foreground, such as a nearby billboard, to improve the segmentation effect.

[0140] Optionally, when performing transfer training on the image segmentation model deployed on computer equipment, a penalty mechanism can be introduced to integrate the foreground probability values ​​of 0 to 1 output by the teacher model into integer values ​​of 0 or 1, so that the image segmentation model as the student model learns more stringent segmentation criteria, preventing the appearance of semi-transparent areas in the foreground or background objects during the image segmentation process, which would lead to a deterioration in the segmentation effect and improve the accuracy and effect of image segmentation.

[0141] Step S303: In response to the confirmation operation for the target text entered in the text input window, obtain the display style of the target text;

[0142] Specifically, the computer device can respond to a confirmation operation on the target text entered in the text input window and obtain the display style of the target text. The display style of the target text can be the style entered by the object in the style editing page or the prompt input window; for information on the style editing page, please refer to the above. Figure 6 For a detailed description of step S205 in the corresponding embodiment, please refer to the above for the content of the input prompt window. Figure 6 The specific description of step S203 in the corresponding embodiment will not be repeated here.

[0143] Step S304: Generate initial display coordinates based on the display area of ​​the foreground object and the display style of the target text; determine the undetermined display area of ​​the target text in the business image based on the initial display coordinates and the display style of the target text; generate a character ratio threshold based on the image resolution of the business image; if the undetermined display area of ​​the target text does not overlap with the display area of ​​the foreground object, or if the coverage ratio of a single character in the overlapping area of ​​the target text is less than the character ratio threshold, update the initial display coordinates along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image; if the undetermined display area that overlaps with the display area of ​​the foreground object does not meet the text recognition conditions, update the initial display coordinates along the direction opposite to the overlapping area to obtain the display coordinates of the target text in the business image.

[0144] For details, please see [link / reference]. Figure 9 ,like Figure 9 As shown, the computer device can generate initial display coordinates based on the display area of ​​the foreground object and the display style of the target text. For example, the computer device can generate a foreground layer 403 based on the display area of ​​the foreground object and a text layer 404 based on the display style of the target text. The coordinates of the highest point O of the foreground layer 403 are determined as the initial display coordinates of the target text. The initial display coordinates can be the same as the coordinates of point O in the text layer 404. That is, the initial display coordinates coincide with the center point of the target text. The overlapping area between the display area of ​​the foreground object and the display area of ​​the target text located at the initial display coordinates can be exactly half of the target text. The font portion of the target text below the center line (the horizontal line determined by the center point) is all obscured by the foreground object.

[0145] Computer equipment can determine the display coordinates of target text in a business image based on the display styles of foreground objects, background objects, and target text. The process can be as follows: generate initial display coordinates based on the display area of ​​the foreground object and the display style of the target text; determine the undetermined display area of ​​the target text in the business image based on the initial display coordinates and the display style of the target text; generate a character ratio threshold based on the image resolution of the business image; if the undetermined display area of ​​the target text does not overlap with the display area of ​​the foreground object, or if the coverage ratio of a single character in the overlapping area of ​​the target text is less than the character ratio threshold, then update the initial display coordinates along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image; if the undetermined display area that overlaps with the display area of ​​the foreground object does not meet the text recognition conditions, then update the initial display coordinates along the direction opposite to the overlapping area to obtain the display coordinates of the target text in the business image.

[0146] For details, please see [link / reference]. Figure 10 , Figure 10 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 6 ,like Figure 10 As shown, the initial display coordinates of the target text can be represented by point O in text layer 501. Figure 10 Text layer 501 in the middle can be with Figure 9 The text layer 404 is the same. The computer device can determine the undetermined display area of ​​the target text in the business image based on the initial display coordinates and the display style of the target text. The undetermined display area can be as shown in area R in page 502, and a character ratio threshold can be generated based on the image resolution of the business image. The character ratio threshold refers to the minimum coverage ratio required for the target text to achieve embedded display in the business image. Page 502 can be a hypothetical page created by the computer device in the background when determining the display position of the target text; that is, page 502 is not directly displayed on the application client's interface.

[0147] Computer devices can determine whether the display area to be displayed overlaps with the display area of ​​the foreground object, whether the coverage ratio of a single character in the corresponding overlapping area is too small, and the display coordinates of the target text, in order to adjust and ensure the embedding effect of the target text.

[0148] If the target text's undetermined display area does not overlap with the foreground object's display area, or if the coverage ratio of a single character in the target text located in the overlapping area is less than a character ratio threshold, then the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the target text's display coordinates in the business image. The direction pointing to the overlapping area can be direction V in page 503. Page 503 can be a hypothetical page created by the computer device in the background when determining the target text's display position; that is, page 503 is not directly displayed on the application client's interface.

[0149] The process by which a computer device updates the initial display coordinates along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image can be as follows: A positional movement value is generated based on the image resolution of the business image; based on the initial display coordinates and the positional movement value, the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the first display coordinates; based on the first display coordinates and the display style of the target text, the first display area of ​​the target text in the business image is determined; the ordinate of the first display coordinates is less than the ordinate of the initial display coordinates; if the coverage ratio of a single character in the overlapping area of ​​the first display area and the display area of ​​the foreground object is less than a character ratio threshold, then based on the positional movement value, the first display coordinates are continued to be updated along the direction pointing to the overlapping area to obtain new first display coordinates; the new first display area is determined in the business image until the coverage ratio of a single character in the overlapping area of ​​the new first display area and the display area of ​​the foreground object is greater than or equal to the character ratio threshold, and the new first display coordinates are determined as the display coordinates of the target text in the business image; the ordinate of the new first display coordinates is less than the ordinate of the first display coordinates.

[0150] Specifically, the computer device can generate position shift values ​​based on the image resolution of the business image. These position shift values ​​represent the number of pixels by which the coordinates of the target text are adjusted each time. Based on the initial display coordinates and the position shift values, the computer device updates the initial display coordinates along the direction pointing towards the overlapping area to obtain the first display coordinates. For example, in a 512×515 pixel business image, when the coverage ratio of a single character in the overlapping area of ​​the target text is less than a character ratio threshold, the computer device can move the initial display coordinates down by 5 pixels to obtain the first display coordinates. The ordinate of the first display coordinates is less than the ordinate of the initial display coordinates. Based on the first display coordinates and the display style of the target text, the computer device can redetermine the first display area of ​​the target text in the business image.

[0151] If the coverage ratio of a single character in the overlapping area between the first display area and the foreground object's display area is less than a character ratio threshold, the computer device can continue to update the first display coordinates based on the position movement value, continuing along the direction pointing to the overlapping area to obtain new first display coordinates. This new first display area is then determined within the business image, until the coverage ratio of a single character in the overlapping area between the new first display area and the foreground object's display area is greater than or equal to the character ratio threshold. The new first display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new first display coordinates is less than the ordinate of the first display coordinates.

[0152] It is understandable that the computer device continuously moves the initial display coordinates downwards until the overlap between the first display area and the display area of ​​the foreground object meets a certain ratio threshold, thereby ensuring that the target text has a good embedding effect in the business image.

[0153] Computer equipment can perform text recognition on a designated display area and adjust the display coordinates of the target text to ensure that the target text embedded in the business image can be correctly recognized. The computer equipment can determine whether the designated display area meets the text recognition conditions by: extracting features from the designated display area to obtain a feature vector; performing text recognition on the designated display feature vector to obtain a text recognition result; if the text recognition result matches the target text, the designated display area is determined to meet the text recognition conditions; if the text recognition result does not match the target text, the designated display area is determined not to meet the text recognition conditions.

[0154] Specifically, the computer device can extract features from the unit image corresponding to the designated display area to obtain a feature vector for the designated display area. This unit image can be shown as region R on page 503. The computer device can then use an Optical Character Recognition (OCR) model to perform text recognition on the designated display feature vector to obtain the text recognition result. If the text recognition result matches the target text, the designated display area is determined to meet the text recognition conditions; if the text recognition result does not match the target text, the designated display area is determined not to meet the text recognition conditions.

[0155] If a pending display area that overlaps with the display area of ​​a foreground object does not meet the text recognition conditions, the computer device can update the initial display coordinates along the direction opposite to the overlapping area to obtain the display coordinates of the target text in the business image. The direction opposite to the overlapping area can be direction W as shown on page 503.

[0156] The process by which a computer device updates the initial display coordinates along the direction opposite to the overlapping area to obtain the display coordinates of the target text in the business image can be as follows: A positional shift value is generated based on the image resolution of the business image; based on the initial display coordinates and the positional shift value, the initial display coordinates are updated along the direction opposite to the overlapping area to obtain second display coordinates; based on the second display coordinates and the display style of the target text, a second display area for the target text in the business image is determined; the ordinate of the second display coordinates is greater than the ordinate of the initial display coordinates; if the second display area does not meet the text recognition conditions, the second display coordinates are continued to be updated along the direction opposite to the overlapping area based on the positional shift value to obtain new second display coordinates; a new second display area for the new second display coordinates in the business image is determined, until the new second display area meets the text recognition conditions, and the new second display coordinates are determined as the display coordinates of the target text in the business image; the ordinate of the new second display coordinates is greater than the ordinate of the second display coordinates.

[0157] Specifically, the computer device updates the initial display coordinates along the opposite direction to the overlapping area based on the initial display coordinates and the positional movement value, obtaining second display coordinates, where the ordinate of the second display coordinates is smaller than the ordinate of the initial display coordinates. Based on the second display coordinates and the display style of the target text, the computer device can redetermine the second display area of ​​the target text in the business image.

[0158] If the second display area does not meet the text recognition conditions, the computer device can continue to update the second display coordinates based on the positional movement value, moving in the opposite direction to the overlapping area, to obtain new second display coordinates. This new second display coordinates then define a new second display area in the business image, continuing until the new second display area meets the text recognition conditions. Finally, the new second display coordinates are determined as the display coordinates of the target text in the business image. The ordinate of the new second display coordinates is greater than the ordinate of the second display coordinates.

[0159] It is understandable that the computer device continuously moves the initial display coordinates upwards until the obtained second display area meets the text recognition conditions, so that the target text embedded in the business image can be correctly recognized in terms of its semantics.

[0160] Optionally, if, after the computer device adjusts the initial display coordinates upwards or downwards, the target text display area always meets the condition that the overlap area with the foreground object's display area is greater than or equal to the character ratio threshold, but cannot simultaneously satisfy the text recognition condition, then the computer device can adjust the initial display coordinates left or right based on the left and right security lines of the business image. The left security line can be represented by the dashed line SL in page 504, and the right security line can be represented by the dashed line SR in page 504. The left security line can be the leftmost edge of the foreground object's display area, and the right security line can be the rightmost edge of the foreground object's display area. Page 504 can be a hypothetical page created by the computer device in the background when determining the target text display position; that is, page 504 is not directly displayed on the application client's interface.

[0161] It is understandable that when a certain text in the target text cannot be recognized, the computer device can select the security line that the text is close to, such as the left security line, and move the display position of the target text to the left until the text is located to the left of the left security line. When the text is located to the left of the left security line, the text does not overlap with the display area of ​​the foreground object, and can therefore be correctly recognized.

[0162] Optionally, if none of the above methods can ensure that the display area of ​​the target text overlaps with the display area of ​​the foreground object by more than or equal to the character ratio threshold, and the display area of ​​the target text meets the text recognition conditions, then the computer device can display the target text on top of the business image, that is, the target text displayed on top is displayed on the foreground object.

[0163] Optionally, the computer device can determine the display position of the target text based on the image recognition results of the business image. For details regarding the image recognition results of the business image, please refer to the above. Figure 6 The specific description of step S202 in the corresponding embodiment will not be repeated here. The computer device can use cross-attention processing to calculate the degree of correlation between the target text and the image recognition result, and display the target text around the foreground object corresponding to the most relevant image recognition result. For example, a business image may include multiple foreground objects, which may include people and pets. If the target text is text associated with a pet, the computer device can determine the display position of the target text around the display area of ​​the pet.

[0164] Step S305: Generate a foreground layer based on the display area of ​​the foreground object; the foreground layer contains the display area of ​​the foreground object, and the area in the foreground layer other than the display area of ​​the foreground object is a transparent area; the size of the foreground layer is the same as the size of the business image; generate a text layer for the target text based on the display coordinates and the display style of the target text; the area in the text layer other than the display area of ​​the target text is a transparent area; the size of the text layer is the same as the size of the business image; overlay the foreground layer, the text layer, and the business image to obtain an updated display image; the text layer is located above the business image, and the foreground layer is located above the text layer.

[0165] For details, please see [link / reference]. Figure 10 ,like Figure 10 As shown, for ease of understanding, the example given is that after adjusting the display coordinates of the target text along aspect V on page 504, the resulting display coordinates of the target text simultaneously satisfy the condition that the overlap area between the target text and the display area of ​​the foreground object is greater than or equal to the character ratio threshold, and the display area of ​​the target text meets the text recognition conditions. The display coordinates of the adjusted target text can be represented by coordinate Z in text layer 505.

[0166] Please see again Figure 9 ,like Figure 9 As shown, Figure 9 Text layer 405 in the middle can be with Figure 10 Similar to text layer 505, the computer device can generate a foreground layer 403 based on the display area of ​​the foreground object. The foreground layer 403 may contain the display area of ​​the foreground object, and the area outside the display area of ​​the foreground object in the foreground layer is a transparent area. The size of the foreground layer is the same as the size of the business image. The computer device can also generate a text layer 405 for the target text based on display coordinates and the display style of the target text. The area outside the display area of ​​the target text in the text layer 405 is a transparent area, and the size of the text layer 405 is the same as the size of the business image.

[0167] The computer device can overlay the foreground layer 403, the text layer 405 and the business image 401 to obtain an updated display image 409, wherein the text layer 405 is located above the business image 401 and the foreground layer 403 is located above the text layer 405.

[0168] It is understandable that the overlay display between the foreground layer, text layer, and business image can be achieved through image masks. Please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 7 ,like Figure 11As shown, the computer device can perform image segmentation on the business image 601 to obtain the display area of ​​the foreground object 602. A Boolean operation is then performed between the display area of ​​the foreground object and the business image to obtain the display area of ​​the background object 603. The computer device can then perform a Boolean operation between the display area of ​​the background object and the text layer 604 to obtain a mask layer 605. Among these, Figure 11 The text layer 604 in the middle can be with Figure 9 The same applies to text layer 405. In mask layer 605, the non-overlapping area U between the display area of ​​the target text and the display area of ​​the background object can be defined as a transparent area. The computer device can then apply the mask layer as an image mask over the business image, embedding the target text within the business image, resulting in the updated business image 606.

[0169] This application embodiment obtains the uploaded business image in response to an editing operation on the business image. An artificial intelligence model automatically identifies the display areas of the foreground and background objects in the business image. A text input window is displayed on the image editing page. In response to a confirmation operation on the target text entered in the text input window, the target text determined by the object and its display style are obtained. Based on the display areas of the foreground objects and the display style of the target text, the display coordinates of the target text are automatically determined. The target text is then embedded at these display coordinates, thus embedding and displaying the target text in the business image, resulting in an updated business image. In this updated business image, the target text is displayed over the background object. If the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the portion of the target text located in the overlapping area is covered by the foreground object. This application embodiment can embed target text around a foreground object, achieving a display effect where the target text blends with the background object and is covered by the foreground object. This avoids obscuring important foreground elements, enhances the detail of the foreground object, and makes the content of the updated business image more organized. Simultaneously, it highlights the target text in the updated business image, creating a layered visual hierarchy and improving the visual attention and display effect of the updated business image. This process requires no manual intervention, greatly simplifying the workflow for generating images with embedded text. It eliminates the need to learn and understand complex image editing tools to create various layers and masks to achieve the embedded display effect, reducing the learning cost, increasing the efficiency of generating images containing embedded text, and reducing technical costs.

[0170] On the other hand, embodiments of this application can generate initial display coordinates based on the display area of ​​the foreground object and the display style of the target text. These initial display coordinates are continuously adjusted to ensure that the display area of ​​the target text overlaps with the display area of ​​the foreground object by a factor greater than or equal to a character ratio threshold, while simultaneously satisfying the text recognition conditions. This guarantees a good embedding effect of the target text in the business image, and ensures that the semantics of the embedded target text in the business image can be correctly recognized. Updating the initial display coordinates yields the display coordinates of the target text in the business image. By automatically determining the display position of the target text in the business image, the technical cost of image editing can be further reduced, efficiency improved, and the embedding effect of the target text can be directly and intuitively displayed to the object. This facilitates further adjustments to the display style and position of the target text, enhancing the convenience of image editing tasks.

[0171] Please see Figure 12 , Figure 12 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 12 As shown, the data processing device 1 includes an image editing module 910 and an image display module 920.

[0172] Image editing module 910 is used to respond to editing operations on business images and display a text input window on the image editing page; the business image includes foreground objects and background objects;

[0173] The image display module 920 is used to respond to the confirmation operation of the target text entered in the text input window, embed and display the target text in the business image to obtain an updated business image; the target text in the updated business image is displayed on top of the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the part of the target text located in the overlapping area is covered by the foreground object.

[0174] In one possible implementation, the number of scene objects is Q, where Q is a positive integer; the image display module 920 is also used to perform the following operations:

[0175] In response to a trigger operation targeting the target foreground object among Q foreground objects in the updated business image, the content covered by the display area of ​​the target foreground object is re-displayed on top of the target foreground object; there is an overlap between the display area of ​​the target foreground object and the display area of ​​the target text.

[0176] In one possible implementation, the image editing page is also used to display a prompt input window; the image display module 920 is also used to perform the following operations:

[0177] In response to a confirmation request for style hint text in the prompt input window, adjust and update at least one of the display style or display position of the target text in the business image; the style type of the adjusted target text matches the style hint text.

[0178] In one possible implementation, the image display module 920 is also used to perform the following operations:

[0179] Displays M image frames for the business image, and responds to the selection operation of the target image frame by the object, displaying the business image in the target image frame; M is a positive integer, and the M image frames include the target image frame.

[0180] In one possible implementation, the text input window is also used to display N recommended texts for the business image; N is a positive integer, and the N recommended texts include updated text; the image display module 920 is also used to perform the following operations:

[0181] N recommended texts for the business image are displayed in the candidate area of ​​the text input window; the N recommended texts include at least one of the following: recommended text associated with the shooting time of the business image, recommended text associated with the shooting location of the business image, or template text associated with the image style of the business image;

[0182] In response to a selection operation for the target text among N recommended texts, enter the target text in the text input window.

[0183] In one possible implementation, the image display module 920 is also used to perform the following operations:

[0184] Display at least two font icons and at least two font size icons on the style editing page;

[0185] In response to a selection action for a target font identifier among at least two font identifiers, highlight the target font identifier in the style editing page;

[0186] In response to the selection operation of the target font size identifier among at least two font size identifiers, highlight the target font size identifier in the style editing page;

[0187] The image display module 920 is used to respond to a confirmation operation for the target text entered in the text input window, embed and display the target text in the business image, and specifically performs the following operations when the business image is updated:

[0188] In response to a confirmation operation for the target text entered in the text input window, the target text with the target font and target font size is embedded and displayed in the business image, resulting in an updated business image; the target font is the font indicated by the target font identifier, and the target font size is the font size indicated by the target font size identifier.

[0189] In one possible implementation, the image display module 920 is also used to perform the following operations:

[0190] If the display area of ​​the target text overlaps with the display area of ​​the foreground object, and the target text is completely covered by the foreground object, then the moving border of the target text in the updated business image will be highlighted.

[0191] In response to a drag operation on the moving border of the target text, the dragged target text is redisplayed in the updated business image.

[0192] In one possible implementation, the image editing module 910 is also used to perform the following operations:

[0193] Display S content items, respond to the selection operation of the target content item among the S content items, display the target content item in the updated business image, and re-embed the target text in the updated business image containing the target content item; S is a positive integer; if the display area of ​​the re-embedded target text item overlaps with the display area of ​​the target content item, then part of the content in the target text item located in the overlapping area within the target content item will be covered by the target content item.

[0194] In one possible implementation, the coverage ratio of a single character in the overlapping region of the target text is less than a coverage ratio threshold; the image display module 920 is also used to perform the following operations:

[0195] In response to an update operation on the target text in the updated business image, the updated target text is re-embedded and displayed in the updated business image; if the display area of ​​the updated target text overlaps with the display area of ​​the foreground object, the coverage ratio of a single character in the updated target text located in the overlapping area is less than the coverage ratio threshold.

[0196] In one possible implementation, the image display module 920 is also used to perform the following operations:

[0197] Feature extraction is performed on the business image to obtain T unit feature vectors; T is a positive integer, and the T unit feature vectors are used to represent the feature information of the pixels in the business image.

[0198] For each of the T unit feature vectors, feature recognition is performed to obtain the foreground probability value corresponding to each unit feature vector. The pixels corresponding to the foreground probability values ​​that are greater than or equal to the foreground probability threshold are determined as foreground pixels.

[0199] Foreground objects in the business image are determined based on foreground pixels, and pixels in the business image other than foreground objects are determined as background objects.

[0200] The image display module 920 is used to respond to a confirmation operation for the target text entered in the text input window. When embedding and displaying the target text in a business image, it is specifically used to perform the following operations:

[0201] In response to the confirmation action for the target text entered in the text input window, obtain the display style of the target text;

[0202] Determine the display coordinates of the target text in the business image based on the display styles of the foreground object, background object, and target text;

[0203] The target text is embedded and displayed at the display coordinates in the business image to obtain the updated business image.

[0204] In one possible implementation, the image display module 920 is used to embed the target text at the display coordinates in the business image, and when updating the business image, it is specifically used to perform the following operations:

[0205] A foreground layer is generated based on the display area of ​​the foreground object; the foreground layer contains the display area of ​​the foreground object, and the area in the foreground layer other than the display area of ​​the foreground object is a transparent area; the size of the foreground layer is the same as the size of the business image.

[0206] Based on the display coordinates and the display style of the target text, a text layer for the target text is generated; the area in the text layer other than the display area of ​​the target text is a transparent area; the size of the text layer is the same as the size of the business image.

[0207] The foreground layer, text layer, and business image are overlaid to obtain the updated display image; the text layer is located above the business image, and the foreground layer is located above the text layer.

[0208] In one possible implementation, when the image display module 920 determines the display coordinates of the target text in the business image based on the display styles of the foreground object, background object, and target text, it specifically performs the following operations:

[0209] Initial display coordinates are generated based on the display area of ​​the foreground object and the display style of the target text. Based on the initial display coordinates and the display style of the target text, the undetermined display area of ​​the target text in the business image is determined. A character ratio threshold is generated based on the image resolution of the business image.

[0210] If the display area of ​​the target text does not overlap with the display area of ​​the foreground object, or if the coverage ratio of a single character in the target text located in the overlapping area is less than the character ratio threshold, then the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image.

[0211] If the undetermined display area that overlaps with the display area of ​​the foreground object does not meet the text recognition conditions, the initial display coordinates are updated in the opposite direction to the overlapping area to obtain the display coordinates of the target text in the business image.

[0212] In one possible implementation, the image display module 920 is also used to perform the following operations:

[0213] Feature extraction is performed on the desired display area to obtain the desired display feature vector. Text recognition is then performed on the desired display feature vector to obtain the text recognition result.

[0214] If the text recognition result matches the target text, then the area to be displayed is determined to meet the text recognition conditions;

[0215] If the text recognition result does not match the target text, it is determined that the pending display area does not meet the text recognition conditions.

[0216] In one possible implementation, the image display module 920 updates the initial display coordinates along the direction pointing to the overlapping area. When obtaining the display coordinates of the target text in the business image, it specifically performs the following operations:

[0217] Based on the image resolution of the business image, a position movement value is generated. Based on the initial display coordinates and the position movement value, the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the first display coordinates. Based on the first display coordinates and the display style of the target text, the first display area of ​​the target text in the business image is determined. The ordinate of the first display coordinates is smaller than the ordinate of the initial display coordinates.

[0218] If the coverage ratio of a single character in the overlapping area of ​​the first display area and the display area of ​​the foreground object is less than the character ratio threshold, then based on the position movement value, the first display coordinates are updated along the direction pointing to the overlapping area to obtain new first display coordinates. The new first display area is determined in the business image until the coverage ratio of a single character in the overlapping area of ​​the new first display area and the display area of ​​the foreground object is greater than or equal to the character ratio threshold. The new first display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new first display coordinates is less than the ordinate of the first display coordinates.

[0219] In one possible implementation, the image display module 920 updates the initial display coordinates along a direction opposite to the overlapping area. Specifically, when obtaining the display coordinates of the target text in the business image, it performs the following operations:

[0220] Based on the image resolution of the business image, a positional movement value is generated. Based on the initial display coordinates and the positional movement value, the initial display coordinates are updated in the opposite direction to the overlapping area to obtain the second display coordinates. Based on the second display coordinates and the display style of the target text, the second display area of ​​the target text in the business image is determined. The ordinate of the second display coordinates is greater than the ordinate of the initial display coordinates.

[0221] If the second display area does not meet the text recognition conditions, the second display coordinates are updated along the opposite direction to the overlapping area based on the position movement value to obtain new second display coordinates. The new second display area in the business image is determined by the new second display coordinates until the new second display area meets the text recognition conditions. The new second display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new second display coordinates is greater than the ordinate of the second display coordinates.

[0222] In one possible implementation, the image display module 920 is also used to perform the following operations:

[0223] Feature extraction is performed on each of the P image classification labels to obtain the classification feature vectors corresponding to the P image classification labels. Feature extraction is performed on the business image to obtain T unit feature vectors. P and T are both positive integers, and the T unit feature vectors are used to represent the feature information of the pixels in the business image.

[0224] Based on P classification feature vectors, image classification is performed on the image feature sequence composed of T unit feature vectors to obtain the image classification probabilities corresponding to the P classification feature vectors. The image classification labels corresponding to the image classification probabilities that are greater than or equal to the classification threshold are determined as the image classification results of the business image. Based on the image classification results, template text associated with the image style of the business image is generated.

[0225] This application embodiment obtains the uploaded business image in response to an editing operation on the business image. An artificial intelligence model automatically identifies the display areas of the foreground and background objects in the business image. A text input window is displayed on the image editing page. In response to a confirmation operation on the target text entered in the text input window, the target text determined by the object and its display style are obtained. Based on the display areas of the foreground objects and the display style of the target text, the display coordinates of the target text are automatically determined. The target text is then embedded at these display coordinates, thus embedding and displaying the target text in the business image, resulting in an updated business image. In this updated business image, the target text is displayed over the background object. If the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the portion of the target text located in the overlapping area is covered by the foreground object. This application embodiment can embed target text around a foreground object, achieving a display effect where the target text blends with the background object and is covered by the foreground object. This avoids obscuring important foreground elements, enhances the detail of the foreground object, and makes the content of the updated business image more organized. Simultaneously, it highlights the target text in the updated business image, creating a layered visual hierarchy and improving the visual attention and display effect of the updated business image. This process requires no manual intervention, greatly simplifying the workflow for generating images with embedded text. It eliminates the need to learn and understand complex image editing tools to create various layers and masks to achieve the embedded display effect, reducing the learning cost, increasing the efficiency of generating images containing embedded text, and reducing technical costs.

[0226] On the other hand, the target text embedded in this embodiment can be entered by the user or selected from associated recommended text. The display style (font and size) of the target text can also be edited, satisfying diverse user needs. In the prompt input window, the user can also input style prompt text for the target text object. An artificial intelligence model identifies the semantics of the style prompt text, and the display style and position of the target text are adjusted based on the style prompt text, ensuring that the style type of the adjusted target text matches the style prompt text. This further reduces the learning cost for users editing images and improves the efficiency of image editing. This embodiment can also dynamically adjust the display position of the target foreground object through dragging operations, providing a way for users to edit the display area of ​​the target text, thus improving the feasibility of this embodiment. This embodiment can generate initial display coordinates based on the display area of ​​the foreground object and the display style of the target text. The initial display coordinates are continuously adjusted so that the resulting display area of ​​the target text satisfies the requirement that the overlap area with the display area of ​​the foreground object is greater than or equal to the character ratio threshold, and simultaneously satisfies the text recognition condition. This ensures that the target text has a good embedding effect in the business image, and that the target text embedded in the business image can correctly recognize its semantics. Updating the initial display coordinates yields the display coordinates of the target text within the business image. By automatically determining the display position of the target text within the business image, the technical cost of image editing can be further reduced, efficiency improved, and the embedded display effect of the target text can be intuitively displayed directly to the object. This allows users to continue adjusting the display style and position of the target text, enhancing the convenience of image editing tasks.

[0227] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0228] Please see Figure 13 , Figure 13 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 13As shown, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the processor 1001. Figure 13 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.

[0229] In such Figure 13 In the computer device 1000 shown, the network interface 1004 provides network communication elements; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0230] In response to editing operations on a business image, a text input window is displayed on the image editing page; the business image includes foreground and background objects;

[0231] In response to the confirmation operation of the target text entered in the text input window, the target text is embedded and displayed in the business image to obtain an updated business image; the target text in the updated business image is displayed on top of the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, the part of the target text located in the overlapping area is covered by the foreground object.

[0232] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 3 , Figure 6 and Figure 8 The description of the data processing method in any corresponding embodiment will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0233] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program. When the processor executes the computer program, it can execute the aforementioned... Figure 3 , Figure 6 and Figure 8 The description of the data processing method in any corresponding embodiment is already provided, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.

[0234] The aforementioned computer-readable storage medium can be an internal storage unit of the data processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been displayed or will be displayed.

[0235] Furthermore, it should be noted that this application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned... Figure 3 , Figure 6 and Figure 8 The method provided in any of the corresponding embodiments.

[0236] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0237] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the foregoing description as a network element. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described network elements using different methods for each specific application, but such implementation should not be considered beyond the scope of this application.

[0238] The methods and related apparatus provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0239] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.

[0240] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.

[0241] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method, characterized in that, include: In response to an editing operation on a business image, a text input window is displayed on the image editing page; the business image includes a foreground object and a background object; In response to a confirmation operation for the target text entered in the text input window, the target text is embedded and displayed in the business image to obtain an updated business image; the target text in the updated business image is displayed over the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, then the portion of the target text located in the overlapping area is covered by the foreground object.

2. The method according to claim 1, characterized in that, The number of foreground objects is Q, where Q is a positive integer; the method further includes: In response to a trigger operation targeting a target foreground object among Q foreground objects in the updated service image, the content covered by the display area of ​​the target foreground object is re-displayed over the target foreground object; the display area of ​​the target foreground object overlaps with the display area of ​​the target text.

3. The method according to claim 1, characterized in that, The image editing page is also used to display a prompt input window, and the method further includes: In response to a confirmation operation for the style hint text in the prompt input window, at least one of the display style or display position of the target text in the updated business image is adjusted; the style type of the adjusted target text matches the style hint text.

4. The method according to claim 1, characterized in that, Also includes: Display M image frames for the business image, and in response to the object's selection operation for the target image frame, display the business image in the target image frame; M is a positive integer, and the M image frames include the target image frame.

5. The method according to claim 1, characterized in that, The text input window is also used to display N recommended texts for the business image; N is a positive integer, and the N recommended texts include the updated text; the method further includes: N recommended texts for the business image are displayed in the candidate area of ​​the text input window; The N recommended texts include at least one of the following: recommended text associated with the shooting time of the business image, recommended text associated with the shooting location of the business image, or template text associated with the image style of the business image; In response to the selection operation of the target text among the N recommended texts, the target text is entered in the text input window.

6. The method according to claim 1, characterized in that, Also includes: Display at least two font icons and at least two font size icons on the style editing page; In response to a selection operation for a target font identifier among the at least two font identifiers, the target font identifier is highlighted on the style editing page; In response to the selection operation of the target font size identifier among the at least two font size identifiers, the target font size identifier is highlighted on the style editing page; The response, in response to a confirmation operation of the target text entered in the text input window, embeds and displays the target text in the business image to obtain an updated business image, including: In response to a confirmation operation for the target text entered in the text input window, the target text with the target font and target font size is embedded and displayed in the business image to obtain an updated business image; the target font is the font indicated by the target font identifier, and the target font size is the font size indicated by the target font size identifier.

7. The method according to claim 1, characterized in that, Also includes: If the display area of ​​the target text overlaps with the display area of ​​the foreground object, and the target text is completely covered by the foreground object, then the moving border of the target text in the updated business image is highlighted. In response to a drag operation on the moving border of the target text, the dragged target text is redisplayed in the updated business image.

8. The method according to claim 1, characterized in that, Also includes: Display S content items, respond to a selection operation for a target content item among the S content items, display the target content item in the updated business image, and re-embed the target text in the updated business image containing the target content item; S is a positive integer; if the display area of ​​the re-embedded target text overlaps with the display area of ​​the target material content, then part of the content in the target text located in the overlapping area within the target material content will be covered by the target material content.

9. The method according to claim 1, characterized in that, The coverage ratio of a single character in the target text located in the overlapping region is less than a coverage ratio threshold; the method further includes: In response to an update operation on the target text in the updated service image, the updated target text is re-embedded and displayed in the updated service image; if the display area of ​​the updated target text overlaps with the display area of ​​the foreground object, the coverage ratio of a single character in the updated target text located in the overlapping area is less than the coverage ratio threshold.

10. The method according to claim 1, characterized in that, Also includes: Feature extraction is performed on the business image to obtain T unit feature vectors; T is a positive integer, and the T unit feature vectors are used to characterize the feature information of pixels in the business image; Feature recognition is performed on the T unit feature vectors respectively to obtain the foreground probability value corresponding to each unit feature vector. The pixels corresponding to the foreground probability values ​​that are greater than or equal to the foreground probability threshold are determined as foreground pixels. Based on the foreground pixels, the foreground object in the service image is determined, and the pixels in the service image other than the foreground object are determined as background objects. The response, in response to a confirmation operation of the target text entered in the text input window, embeds and displays the target text in the business image, including: In response to a confirmation operation on the target text entered in the text input window, obtain the display style of the target text; Based on the display style of the foreground object, the background object, and the target text, determine the display coordinates of the target text in the business image; The target text is embedded and displayed at the display coordinates in the business image to obtain the updated business image.

11. The method according to claim 10, characterized in that, The step of embedding the target text at the display coordinates in the business image to obtain the updated business image includes: A foreground layer is generated based on the display area of ​​the foreground object; the foreground layer contains the display area of ​​the foreground object, and the area in the foreground layer other than the display area of ​​the foreground object is a transparent area; the size of the foreground layer is the same as the size of the business image. Based on the display coordinates and the display style of the target text, a text layer for the target text is generated; the area of ​​the text layer other than the display area of ​​the target text is a transparent area; the size of the text layer is the same as the size of the business image. The foreground layer, the text layer, and the business image are overlaid to obtain an updated display image; the text layer is located above the business image, and the foreground layer is located above the text layer.

12. The method according to claim 10, characterized in that, Determining the display coordinates of the target text in the business image based on the display styles of the foreground object, the background object, and the target text includes: Initial display coordinates are generated based on the display area of ​​the foreground object and the display style of the target text. Based on the initial display coordinates and the display style of the target text, the undetermined display area of ​​the target text in the business image is determined. A character ratio threshold is generated based on the image resolution of the business image. If the undetermined display area of ​​the target text does not overlap with the display area of ​​the foreground object, or if the coverage ratio of a single character in the target text located in the overlapping area is less than the character ratio threshold, then the initial display coordinates are updated along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image; If the undetermined display area that overlaps with the display area of ​​the foreground object does not meet the text recognition condition, the initial display coordinates are updated along the opposite direction to the overlapping area to obtain the display coordinates of the target text in the business image.

13. The method according to claim 12, characterized in that, Also includes: Feature extraction is performed on the undetermined display area to obtain the undetermined display feature vector, and text recognition is performed on the undetermined display feature vector to obtain the text recognition result; If the text recognition result matches the target text, then the undetermined display area is determined to meet the text recognition conditions; If the text recognition result does not match the target text, then the undefined display area is determined not to meet the text recognition conditions.

14. The method according to claim 12, characterized in that, The step of updating the initial display coordinates along the direction pointing to the overlapping area to obtain the display coordinates of the target text in the business image includes: A positional movement value is generated based on the image resolution of the business image. Based on the initial display coordinates and the positional movement value, the initial display coordinates are updated along the direction pointing to the overlapping area to obtain a first display coordinate. Based on the first display coordinate and the display style of the target text, a first display area of ​​the target text in the business image is determined. The ordinate of the first display coordinate is smaller than the ordinate of the initial display coordinate. If the coverage ratio of a single character in the overlapping area of ​​the first display area and the display area of ​​the foreground object is less than the character ratio threshold, then based on the position movement value, the first display coordinates are updated again along the direction pointing to the overlapping area to obtain new first display coordinates. The new first display area is determined as the new first display area in the business image until the coverage ratio of a single character in the overlapping area of ​​the new first display area and the display area of ​​the foreground object is greater than or equal to the character ratio threshold. The new first display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new first display coordinates is less than the ordinate of the first display coordinates.

15. The method according to claim 12, characterized in that, The step of updating the initial display coordinates along a direction opposite to the overlapping region to obtain the display coordinates of the target text in the business image includes: A positional movement value is generated based on the image resolution of the business image. Based on the initial display coordinates and the positional movement value, the initial display coordinates are updated along the direction opposite to the overlapping area to obtain a second display coordinate. Based on the second display coordinate and the display style of the target text, a second display area of ​​the target text in the business image is determined. The ordinate of the second display coordinate is greater than the ordinate of the initial display coordinate. If the second display area does not meet the text recognition conditions, the second display coordinates are updated along the opposite direction to the overlapping area based on the position movement value to obtain new second display coordinates. The new second display coordinates are then used to determine a new second display area in the business image until the new second display area meets the text recognition conditions. The new second display coordinates are then determined as the display coordinates of the target text in the business image. The ordinate of the new second display coordinates is greater than the ordinate of the second display coordinates.

16. The method according to claim 5, characterized in that, Also includes: Feature extraction is performed on each of the P image classification labels to obtain classification feature vectors corresponding to each of the P image classification labels. Feature extraction is then performed on the business image to obtain T unit feature vectors. Both T and T are positive integers, and the T unit feature vectors are used to characterize the feature information of pixels in the service image; Based on P classification feature vectors, image classification is performed on the image feature sequence composed of T unit feature vectors to obtain the image classification probabilities corresponding to the P classification feature vectors respectively. The image classification labels corresponding to the image classification probabilities that are greater than or equal to the classification threshold are determined as the image classification results of the business image. Based on the image classification results, template text associated with the image style of the business image is generated.

17. A data processing apparatus, characterized in that, include: The image editing module is used to respond to editing operations on business images and display a text input window on the image editing page; the business image includes foreground objects and background objects; An image display module is used to respond to a confirmation operation for target text entered in the text input window, embed and display the target text in the business image to obtain an updated business image; the target text in the updated business image is displayed over the background object; if the display area of ​​the target text in the updated business image overlaps with the display area of ​​the foreground object, then the part of the target text located in the overlapping area is covered by the foreground object.

18. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication functions, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the method according to any one of claims 1-16.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-16.

20. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium and adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-16.