Picture text translation method and device, storage medium and electronic equipment

By automatically obtaining and translating text in comics, adjusting the translated text properties, and overlaying display, it solves the problem of time-consuming and labor-intensive processing of multilingual support manually, and achieves efficient and accurate multilingual support.

CN119625134APending Publication Date: 2025-03-14BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411670933.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

Smart Images

  • Figure CN119625134A_ABST
    Figure CN119625134A_ABST
Patent Text Reader

Abstract

The invention relates to a picture text translation method and device, a storage medium and electronic equipment. The method comprises the steps of obtaining original text content, original text attributes and original text positions of an original text of an original picture; translating the original text content into a target language to obtain translated text content; converting the translated text content into a translated text according to the original text attribute; and overlapping and displaying the translated text to the original text position of the original picture to obtain a translated picture which displays the translated text and does not display the original text. The technical problem that multi-language release of the picture is time-consuming and labor-consuming due to a manual and repeated working process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for translating image text. Background Art

[0002] As a visual art form with pictures as the main carrier, comics are usually presented in a combination of pictures and text, including character dialogue, narration and other text content. These texts are usually embedded directly into the image, which is convenient when creating and publishing a single language version. However, when comics need to support multiple languages, this text embedding method brings significant technical and resource challenges. Specifically, in order to achieve different language versions, all text content in the original comics must be removed from the image manually using image editing tools, and then the text is translated into the target language, and the translated text is reinserted into the image. This process not only requires multiple uses of image editing tools, but also ensures that the reintegration of text and image is natural and does not affect the original artistic effect. Each language version needs to be processed and redesigned separately, which significantly increases time and labor costs. Therefore, this manual and repetitive workflow makes the multi-language publishing of comics time-consuming and laborious. Summary of the invention

[0003] The present application provides a method, device, storage medium and electronic device for translating image text to solve the technical problem that manual and repetitive workflows make multi-language publishing of images time-consuming and laborious.

[0004] In a first aspect, the present application provides a method for translating image text, comprising: obtaining the original text content, original text attributes and original text position of the original text of the original image; translating the original text content into a target language to obtain translated text content; converting the translated text content into a translated text according to the original text attributes; and superimposing the translated text on the original text position of the original image to obtain a translated image that displays the translated text but does not display the original text.

[0005] In a second aspect, the present application provides a picture-text translation device, comprising: an acquisition module, used to acquire the original text content, original text attributes and original text position of the original text of the original picture; a translation module, used to translate the above original text content into a target language to obtain translated text content; a conversion module, used to convert the above translated text content into a translated text according to the above original text attributes; a processing module, used to superimpose the above translated text on the above original text position of the above original picture to obtain a translated picture displaying the above translated text but not the above original text.

[0006] As an optional example, the above-mentioned acquisition module includes: a first setting unit, used to find the above-mentioned target layer through an image editing tool and set the above-mentioned target layer to a non-hidden layer when the target layer where the above-mentioned original text is located in the above-mentioned original picture is a hidden layer; an acquisition unit, used to obtain the above-mentioned original text content, the above-mentioned original text attributes and the above-mentioned original text position from the above-mentioned target layer; a second setting unit, used to restore the above-mentioned target layer to a hidden layer.

[0007] As an optional example, the original text attributes include original text font, original text size, original text color, original text size and original text background color, and the conversion module includes: a first adjustment unit, used to adjust the translated text content according to the original text font, the original text size and the original text color to obtain adjusted translated text content; a conversion unit, used to convert the adjusted translated text content into a first translated sub-text; and a third setting unit, used to set the background color of the first translated sub-text to the original text background color to obtain the translated text when the text size of the first translated sub-text is less than or equal to the original text size.

[0008] As an optional example, the conversion module further includes: a second adjustment unit, which is used to, after converting the adjusted translation text content into the first translation sub-text, readjust the text size of the translation text content when the text size of the first translation sub-text is larger than the original text size, and convert the readjusted translation text content into the second translation sub-text, wherein the text size of the second translation sub-text is smaller than or equal to the original text size; and a third setting unit, which is used to set the background color of the second translation sub-text to the background color of the original text to obtain the translation text.

[0009] As an optional example, the processing module includes: a first processing unit, for displaying the translated text superimposed on the original text position of the original image when the target layer where the original text is located in the original image is a hidden layer, so as to obtain the translated image.

[0010] As an optional example, the processing module includes: a second processing unit, for processing the original image to hide the original text when the target layer where the original text is located in the original image is a non-hidden layer, so as to obtain a processed original image; and a third processing unit, for superimposing and displaying the translated text on the original text position of the processed original image to obtain the translated image.

[0011] As an optional example, the second processing unit includes: a processing sub-unit, used to create an occlusion layer at the original text position of the original image to obtain a processed original image, wherein the size of the occlusion layer is the size of the original text, and the color of the occlusion layer is the background color of the original text; or erase the original text on the original image to obtain a processed original image.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned image text translation method when executed by a processor.

[0013] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned image text translation method through the computer program.

[0014] In an embodiment of the present application, a method is adopted for obtaining the original text content, original text attributes and original text position of the original text of the original image; translating the above original text content into a target language to obtain translated text content; converting the above translated text content into translated text according to the above original text attributes; and superimposing and displaying the above translated text on the above original text position of the above original image to obtain a translated image that displays the above translated text but does not display the above original text. In the above method, the text content and its attributes in the image are extracted through an automated process, and the text content is translated and adjusted to obtain the translated text, and finally the translated text is superimposed and displayed on the original image to obtain a translated image that displays the translated text but does not display the original text, thereby achieving the purpose of improving the efficiency of multi-language support for images, reducing the time and cost of manual editing of images, and maintaining the visual consistency of images and the accuracy of translation, thereby solving the technical problem that manual and repetitive workflows make multi-language publishing of images time-consuming and laborious. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0018] Figure 1 is a flowchart of an optional method for translating picture text according to an embodiment of the present application;

[0019] Figure 2 is a schematic structural diagram of an optional image-text translation device according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0022] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0023] According to a first aspect of an embodiment of the present application, a method for translating image text is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0024] S102, obtaining original text content, original text attributes, and original text position of the original text of the original image;

[0025] S104, translating the original text content into a target language to obtain translated text content;

[0026] S106, converting the translated text content into a translated text according to the original text attributes;

[0027] S108, superimposing and displaying the translated text at the original text position of the original picture, to obtain a translated picture displaying the translated text but not the original text.

[0028] Optionally, in this embodiment, the original picture may be a cartoon or other picture with text.

[0029] Optionally, in this embodiment, first, all text information, including dialogue, narration, etc., needs to be extracted from the original picture, and OCR (Optical Character Recognition) technology can be used to identify and extract the text content in the original picture. The results of OCR recognition include the following items: original text content, original text attributes, and original text position. After obtaining the original text content, the text can be translated through a large language model or a translation tool to convert the original language into the target language. The tone and format of the original text content are retained during translation to adapt to the expression habits of the target language. Based on the original text attributes obtained by OCR technology, the translated text is adjusted to a visual effect similar to the original text, including text font, text size, text color, and text background color, etc., to obtain the translated text. Finally, according to the original text position, the translated text is superimposed and displayed in the original picture, and the final generated translation picture displays the translated text, and the original text is completely covered or replaced.

[0030] Optionally, in this embodiment, the comics can be more easily extended to multiple languages ​​through an automated process without having to redesign images for each language. The automated process is more efficient than traditional manual methods, reduces repetitive labor, and thus significantly reduces time and labor costs. The text content, position, and attributes in the image are automatically extracted through OCR technology, combined with programmed processing, which greatly reduces the degree of manual participation in multilingual translation and image reproduction. The text attribute information (such as position, color, and size) extracted by OCR technology is used to automatically adjust the translated text so that it is consistent with the original text in visual effects, ensuring that the translated image can retain the style and layout of the original design as much as possible, and will not introduce inconsistencies or design deviations due to manual adjustments. Combining translation with a large language model can achieve high-quality text conversion in multilingual support, ensure the accuracy, naturalness, and contextual consistency of the translated text, and automated processing can avoid omissions and inconsistencies that may occur during manual translation.

[0031] As an optional example, obtaining the original text content, original text attributes, and original text position of the original text of the original image includes:

[0032] In the original image, if the target layer where the original text is located is a hidden layer, use the image editing tool to find the target layer and set it to a non-hidden layer;

[0033] Get the original text content, original text attributes and original text position from the target layer;

[0034] Restore the target layer to a hidden layer.

[0035] Optionally, in this embodiment, during the production process of the comic, the text is usually placed in a special layer. When exporting an image, a picture without text content can be obtained by setting the layer where the text content is located to hidden. When the layer where the text is located is set to hidden, the image still contains this layer, but the text is not displayed. In order to extract the text information, first open the original image through the image editing tool, then find the target layer to ensure that it is the layer where the original text content is located. Once the target layer is found, the hidden state of the layer can be changed to visible, and the image editing tool will display the text content that was originally hidden. The following information is extracted from the target layer through OCR technology: original text content: obtain the text information displayed on the layer; original text attributes: including the font, size, color, line height, etc. of the text; original text position: determine the specific position and area size of the text according to the coordinates and pixel information of the layer. After extracting the required text content and its attributes, the target layer can be restored to a hidden layer so that other operations can be continued without displaying the text content. Setting the layer where the text content is located to hidden avoids remaking all images every time a multilingual version is generated.

[0036] As an optional example, the original text attributes include original text font, original text size, original text color, original text size and original text background color. According to the original text attributes, converting the translated text content into the translated text includes:

[0037] Adjust the translated text content according to the original text font, original text size and original text color to obtain adjusted translated text content;

[0038] Converting the adjusted translated text content into a first translated sub-text;

[0039] When the text size of the first translated sub-text is smaller than or equal to the original text size, the background color of the first translated sub-text is set to the background color of the original text to obtain the translated text.

[0040] Optionally, in this embodiment, when converting the translated text content into the translated text finally used for the image, the original text attributes are obtained, including:

[0041] Original text font: used to keep the translated text visually consistent with the original text;

[0042] Original text size: ensure that the translated text matches the original text in size; Original text color: ensure that the translated text has the same color to maintain style consistency;

[0043] Original text size: the width and height of the text area, used to control the layout of the translated text;

[0044] Original text background color: The background color of the text, ensuring that the translated text is visually consistent with the original text.

[0045] Make the following adjustments to the translated text content based on the font, size, and color of the original text:

[0046] Font Matching: Set the translated text to the same font as the original text to maintain overall consistency;

[0047] Size Matching: Adjust the size of the translated text to match or fit the size of the original text;

[0048] Color Matching: Sets the color of the translated text to the color of the original text.

[0049] The adjusted translated text content is used as the first translated sub-text, i.e. the initially adjusted text, and matches the original text in terms of visual attributes. Check whether the text area size of the first translated sub-text is less than or equal to the original text area size. If this condition is met, the background color of the first translated sub-text is set to the background color of the original text to ensure that its display on the image is consistent with the original text. Finally, the adjusted translated text with the corresponding background color is obtained, which can be directly superimposed and displayed in the specified position of the original image to ensure the integrity and consistency of the visual effect.

[0050] Optionally, in this embodiment, the translated text is adjusted to match the original font, size and color to ensure that the images in different language versions are consistent in style. By verifying the text size, avoiding text overflow or typographical errors, and ensuring accurate display of multilingual content, different language versions can be quickly generated while maintaining the quality of the original image, significantly saving time and cost.

[0051] As an optional example, after converting the adjusted translated text content into the first translated sub-text, the method further includes:

[0052] In the case where the text size of the first translated sub-text is larger than the original text size, re-adjusting the text size of the translated text content, and converting the re-adjusted translated text content into a second translated sub-text, wherein the text size of the second translated sub-text is smaller than or equal to the original text size;

[0053] The background color of the second translated sub-text is set to the background color of the original text to obtain the translated text.

[0054] Optionally, in the present embodiment, after completing the preliminary adjustment, the text area size of the first translation subtext is compared with the original text area size. If the text size of the first translation subtext is larger than the original text area size, further adjustment is required. When the first translation subtext exceeds the original text area size, the text size of the translation text is gradually reduced by a programmatic method until its text area size is less than or equal to the area size of the original text. For example, the text size of the translation text is reduced by a certain proportion to maintain its readability and typesetting consistency. After each reduction, the actual area of ​​the text is recalculated to ensure that it meets the original text area limit. The readjusted translation text content is converted into a second translation subtext. At this time, it is ensured that its text size is less than or equal to the area size of the original text to meet the display requirements. After generating the second translation subtext, its background color is set to the background color of the original text to ensure that the new text is displayed on the image in accordance with the original text. The second translation subtext finally generated matches the original text in visual effect and size, and has a consistent background color, which is suitable for superimposing the corresponding position of the original image.

[0055] Optionally, in this embodiment, the translated text is adapted to the original text area by adjusting the text size to avoid overflow and layout disorder, so that no matter whether the text needs to be resized or not, the final result is consistent with the original text in color and background, ensuring overall visual unity.

[0056] As an optional example, the translated text is superimposed and displayed at the original text position of the original image, and the translated image displaying the translated text but not the original text is obtained, including:

[0057] In the original image, when the target layer where the original text is located is a hidden layer, the translated text is superimposed and displayed at the original text position of the original image to obtain the translated image.

[0058] Optionally, in this embodiment, in the original image, a target layer containing the original text is found. If the layer is currently hidden, the adjusted translated text content is directly superimposed and displayed on the original image according to the known original text position, size and attributes. The insertion of the translated text should be consistent with the layout and visual effects of the original text, including attributes such as position and color. In this way, the original text will not be displayed in the final image, only the newly superimposed translated text will be displayed. The adjusted image is exported or saved to obtain a final translated image that displays the translated text but not the original text.

[0059] As an optional example, the translated text is superimposed and displayed at the original text position of the original image, and the translated image displaying the translated text but not the original text is obtained, including:

[0060] In the original image, when the target layer where the original text is located is a non-hidden layer, the original image is processed to hide the original text, thereby obtaining a processed original image;

[0061] The translated text is superimposed and displayed at the original text position of the processed original image to obtain a translated image.

[0062] Optionally, in this embodiment, if it is confirmed that the target layer containing the original text in the original image is a non-hidden layer, that is, the original text is currently visible, the original image is processed to hide or cover the original text, for example, a mask layer consistent with the background is placed at the original text position to cover the text, or the content-aware function in the image editing tool is used to intelligently fill and cover the text area so that it blends naturally with the background. After processing, a picture with the original text hidden is obtained, and it is ensured that the text area is ready to receive the superposition of the translated text. The translated text is superimposed and displayed in the processed picture, and the specific position is the position of the original text. The translated text should maintain an appropriate font, size and color to make it consistent with the original visual style. After the superposition is completed, the picture is exported or saved to obtain a final translated picture that displays the translated text but does not display the original text.

[0063] As an optional example, the original image is processed to hide the original text, and the processed original image includes:

[0064] Create an occlusion layer at the original text position of the original image to obtain a processed original image, wherein the size of the occlusion layer is the size of the original text, and the color of the occlusion layer is the background color of the original text; or

[0065] Erase the original text on the original image to obtain the processed original image.

[0066] Optionally, in this embodiment, the original text can be hidden by two methods. One is to use an occlusion layer. Specifically, in the original image, an occlusion layer is created according to the position and size of the original text. The size of the occlusion layer should be consistent with the original text area, and the color should match the original text background color to ensure that the occluded area blends naturally with the image background. The occlusion layer is applied to the original image so that the original text is covered but does not affect the visual effect of the overall image. Finally, a processed image with the original text covered is obtained. The second is to erase the original text. Specifically, AIGC (Artificial Intelligence Generated Content) technology is used to erase the original text and automatically fill the area with the surrounding background. The text area is intelligently completed based on the information of the surrounding pixels so that it naturally connects with the rest of the image. Finally, a processed image without the original text and filled smoothly is obtained.

[0067] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0068] According to another aspect of the embodiment of the present application, a picture text translation device is also provided. Figure 2 As shown, including:

[0069] The acquisition module 202 is used to acquire the original text content, original text attributes and original text position of the original text of the original picture;

[0070] The translation module 204 is used to translate the original text content into a target language to obtain a translated text content;

[0071] A conversion module 206, used to convert the translated text content into a translated text according to the original text attributes;

[0072] The processing module 208 is used to overlay the translated text on the original text position of the original picture to obtain a translated picture that displays the translated text but does not display the original text.

[0073] It should be noted that the acquisition module 202 in this embodiment can be used to execute step S102 in the embodiment of the present application, the translation module 204 in this embodiment can be used to execute step S104 in the embodiment of the present application, the conversion module 206 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the processing module 208 in this embodiment can be used to execute step S108 in the embodiment of the present application.

[0074] As an optional example, the acquisition module includes:

[0075] The first setting unit is used to find the target layer through an image editing tool and set the target layer to a non-hidden layer when the target layer where the original text is located in the original image is a hidden layer;

[0076] An acquisition unit, used to acquire original text content, original text attributes and original text position from a target layer;

[0077] The second setting unit is used to restore the target layer to a hidden layer.

[0078] As an optional example, the original text attributes include original text font, original text size, original text color, original text size and original text background color, and the conversion module includes:

[0079] A first adjustment unit, configured to adjust the translated text content according to the original text font, original text size and original text color to obtain adjusted translated text content;

[0080] A conversion unit, used for converting the adjusted translation text content into a first translation sub-text;

[0081] The third setting unit is used to set the background color of the first translated subtext to the background color of the original text to obtain the translated text when the text size of the first translated subtext is smaller than or equal to the original text size.

[0082] As an optional example, the conversion module further includes:

[0083] A second adjustment unit is used for, after converting the adjusted translated text content into a first translated sub-text, if the text size of the first translated sub-text is larger than the original text size, re-adjusting the text size of the translated text content, and converting the re-adjusted translated text content into a second translated sub-text, wherein the text size of the second translated sub-text is smaller than or equal to the original text size;

[0084] The third setting unit is used to set the background color of the second translated sub-text to the background color of the original text to obtain the translated text.

[0085] As an optional example, the processing module includes:

[0086] The first processing unit is used to, when the target layer where the original text is located in the original picture is a hidden layer, overlay the translated text on the original text position of the original picture to obtain a translated picture.

[0087] As an optional example, the processing module includes:

[0088] The second processing unit is used to process the original image to hide the original text in the case where the target layer where the original text is located in the original image is a non-hidden layer, so as to obtain a processed original image;

[0089] The third processing unit is used to overlay and display the translated text on the original text position of the processed original image to obtain a translated image.

[0090] As an optional example, the second processing unit includes:

[0091] A processing subunit is used to create an occlusion layer at the original text position of the original image to obtain a processed original image, wherein the size of the occlusion layer is the size of the original text and the color of the occlusion layer is the background color of the original text; or

[0092] Erase the original text on the original image to obtain the processed original image.

[0093] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0094] Figure 3 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 3 As shown, it includes a processor 302, a communication interface 304, a memory 306 and a communication bus 308, wherein the processor 302, the communication interface 304 and the memory 306 communicate with each other through the communication bus 308, wherein,

[0095] Memory 306, used for storing computer programs;

[0096] The processor 302 is used to implement the following steps when executing the computer program stored in the memory 306:

[0097] Obtaining original text content, original text attributes, and original text position of the original text of the original image;

[0098] Translate the original text content into the target language to obtain the translated text content;

[0099] According to the original text attributes, the translated text content is converted into the translated text;

[0100] The translated text is superimposed and displayed at the original text position of the original image, so as to obtain a translated image that displays the translated text but does not display the original text.

[0101] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The communication interface is used for communication between the above electronic device and other devices.

[0102] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0103] As an example, the memory 306 may include, but is not limited to, the acquisition module 202, translation module 204, conversion module 206, and processing module 208 in the image text translation device. In addition, it may also include, but is not limited to, other module units in the image text translation device, which will not be repeated in this example.

[0104] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0105] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0106] It can be understood by those skilled in the art that Figure 3 The structure shown is for illustration only. The device for implementing the above-mentioned image text translation method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 3 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 3 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 3 Different configurations shown.

[0107] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0108] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned image text translation method when executed by a processor.

[0109] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0110] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0111] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0112] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0113] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0115] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0116] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for translating image text, characterized in that: include: Obtaining original text content, original text attributes, and original text position of the original text of the original image; Translating the original text content into a target language to obtain translated text content; According to the original text attributes, converting the translated text content into a translated text; The translated text is superimposed and displayed at the original text position of the original picture, so as to obtain a translated picture that displays the translated text but does not display the original text.

2. The method according to claim 1, characterized in that The obtaining of the original text content, original text attributes and original text position of the original text of the original image includes: In the original image, if the target layer where the original text is located is a hidden layer, find the target layer through an image editing tool, and set the target layer to a non-hidden layer; Acquire the original text content, the original text attributes and the original text position from the target layer; Restore the target layer to a hidden layer.

3. The method according to claim 1, characterized in that The original text attributes include original text font, original text size, original text color, original text size and original text background color. The converting the translated text content into the translated text according to the original text attributes includes: Adjusting the translated text content according to the original text font, the original text size, and the original text color to obtain adjusted translated text content; Converting the adjusted translated text content into a first translated sub-text; When the text size of the first translated subtext is smaller than or equal to the size of the original text, the background color of the first translated subtext is set to the background color of the original text to obtain the translated text.

4. The method according to claim 3, characterized in that After converting the adjusted translated text content into a first translated sub-text, the method further includes: In the case where the text size of the first translated sub-text is larger than the original text size, re-adjusting the text size of the translated text content, and converting the re-adjusted translated text content into a second translated sub-text, wherein the text size of the second translated sub-text is smaller than or equal to the original text size; The background color of the second translated sub-text is set to the background color of the original text to obtain the translated text.

5. The method according to claim 1, characterized in that The step of superimposing and displaying the translated text at the original text position of the original picture to obtain a translated picture displaying the translated text but not the original text comprises: In the original image, when the target layer where the original text is located is a hidden layer, the translated text is superimposed and displayed on the original text position of the original image to obtain the translated image.

6. The method according to claim 1, characterized in that The step of superimposing and displaying the translated text at the original text position of the original picture to obtain a translated picture displaying the translated text but not the original text comprises: In the original image, when the target layer where the original text is located is a non-hidden layer, the original image is processed to hide the original text, thereby obtaining a processed original image; The translated text is superimposed and displayed at the original text position of the processed original image to obtain the translated image.

7. The method according to claim 6, characterized in that The processing of the original image to hide the original text to obtain the processed original image includes: Creating a masking layer at the original text position of the original image to obtain a processed original image, wherein the size of the masking layer is the size of the original text, and the color of the masking layer is the background color of the original text; or The original text on the original image is erased to obtain a processed original image.

8. A picture text translation device, characterized in that: include: An acquisition module, used to acquire original text content, original text attributes and original text position of the original text of the original image; A translation module, used to translate the original text content into a target language to obtain a translated text content; A conversion module, used for converting the translation text content into a translation text according to the original text attributes; The processing module is used to overlay and display the translated text at the original text position of the original picture to obtain a translated picture that displays the translated text but does not display the original text.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Cited By

  • Information processing method, information processing system, and program

    EP4811206A1