Information processing device, information processing method, and program
The information processing device automatically translates text in image data while maintaining the original layout, addressing the inefficiencies of manual translation methods by analyzing and adjusting attribute information to reconstruct the image data.
Patent Information
- Application Number
- JP2022193534
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-12-02
AI Technical Summary
Existing methods for translating text in image data require manual modification of image data, which is time-consuming and costly, and existing technologies do not allow for automatic translation of text within image data to maintain the original image layout.
An information processing device and method that analyzes text in image data, translates it, and adjusts attribute information to reconstruct the image data, maintaining the original layout and minimizing visual changes.
Enables automatic translation of text in image data across languages while preserving the original image layout, reducing time and cost associated with manual translation.
Smart Images

Figure 0007766883000001 
Figure 0007766883000002 
Figure 0007766883000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to an information processing device, an information processing method, and a program. [Background technology]
[0002] In recent years, with the dramatic improvement in the performance of portable information processing devices such as smartphones and mobile phones, as well as advances in peripheral technologies for web browsers such as HTML (HyperText Markup Language) 5 and JavaScript (registered trademark), users have been able to smoothly enjoy services such as games and content viewing using web browsers. Furthermore, with the development of international networks such as undersea cables and satellite communications connecting countries, an environment has been realized in which users in various countries can enjoy services using content such as games and animations produced in one country. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Chinese Patent Application Publication No. 104090871 Summary of the Invention [Problem to be solved by the invention]
[0004] Image data contained in content such as games and animations may contain text in addition to background images and character images. Conventionally, when translating text contained in image data into another country's language, it was necessary to manually translate the text into the target language and then modify the image data with the resulting translated words or sentences. Therefore, when content produced in one country was to be distributed in another country, it was necessary to manually translate a large amount of image data contained in the content, which posed the problem of requiring a huge amount of time, effort, and cost.
[0005] Patent Document 1 discloses a technology for tagging image data with type information of an object selected by a user and automatically translating the tagged type information into multiple languages. However, this conventional technology does not allow for the text in the image data, which is presented to the user as part of the image, to be translated into another language to modify the image data.
[0006] Therefore, an object of the present disclosure is to provide an information processing device, an information processing method, and a program that enable image data including text in one language to be easily translated into image data including text in another language. [Means for solving the problem]
[0007] An information processing device according to one embodiment of the present disclosure includes an analysis unit that identifies first attribute information of a first text written in a first language in a text layer in first image data having a hierarchical structure by analyzing text data of the first text; a translation unit that translates the first text into a second text in a second language different from the first language; a generation unit that generates second attribute information of the second text based on the first attribute information; an update unit that updates the first text in the text layer with the second text to which the second attribute information has been assigned; an adjustment unit that adjusts the second attribute information of the second text based on the position and size of the first text in the text layer; and a reconstruction unit that reconstructs second image data using the text layer including the second text to which the adjusted second attribute information has been assigned.
[0008] An information processing method according to one embodiment of the present disclosure includes identifying first attribute information of a first text written in a first language by analyzing text data of the first text in a text layer in first image data having a hierarchical structure, translating the first text into a second text in a second language different from the first language, generating second attribute information of the second text based on the first attribute information, updating the first text in the text layer with the second text to which the second attribute information has been assigned, adjusting the second attribute information of the second text based on a position and size of the first text in the text layer, and reconstructing second image data using the text layer including the second text to which the adjusted second attribute information has been assigned.
[0009] A program according to one embodiment of the present disclosure is a program for causing a computer to function for translating text in image data, and causes the computer to execute the following steps: identifying first attribute information of a first text written in a first language in a text layer in first image data having a hierarchical structure by analyzing text data of the first text; translating the first text into a second text in a second language different from the first language; generating second attribute information of the second text based on the first attribute information; updating the first text in the text layer with the second text to which the second attribute information has been assigned; adjusting the second attribute information of the second text based on the position and size of the first text in the text layer; and reconstructing second image data using the text layer including the second text to which the adjusted second attribute information has been assigned. [Brief explanation of the drawings]
[0010] [Figure 1] FIG. 2 is a diagram illustrating a file format of a PSD file as exemplified in an embodiment of the present disclosure. [Figure 2] FIG. 2 is a diagram showing an example of image data created as a psd file exemplified in an embodiment of the present disclosure. [Figure 3] FIG. 3 is a diagram showing an example of a layer structure of the image data exemplified in FIG. 2. [Figure 4] 3 is a diagram showing an example of a text layer in the image data illustrated in FIG. 2. FIG. [Figure 5] FIG. 3 is a diagram showing an example of a normal layer in the image data exemplified in FIG. 2. [Figure 6] 3 is a diagram showing another example of a normal layer in the image data exemplified in FIG. 2. FIG. [Figure 7] FIG. 3 is a diagram showing an example of a background layer in the image data exemplified in FIG. 2. [Figure 8] 10A and 10B are diagrams for explaining the positional relationship between an area where text is written and an area where pixel images are drawn in pre-translation image data exemplified in an embodiment of the present disclosure. [Figure 9] 10A and 10B are diagrams for explaining the positional relationship between an area where text is written and an area where pixel images are drawn in translated image data exemplified in an embodiment of the present disclosure. [Figure 10] FIG. 10 is a diagram for explaining an example of the size of pre-translation text written in Japanese according to an embodiment of the present disclosure. [Figure 11] FIG. 10 is a diagram for explaining an example of the size of translated text written in English according to an embodiment of the present disclosure. [Figure 12] FIG. 10 is a diagram for explaining an example of the size of translated text written in Chinese according to an embodiment of the present disclosure. [Figure 13] 10A and 10B are diagrams for explaining changes in the width and height of text before and after translation when the font, character size, and decoration are not changed according to an embodiment of the present disclosure. [Figure 14] FIG. 10 is a diagram illustrating a case where the width of the translated text is adjusted to approach the width of the untranslated text by changing the character size without changing the font and decoration according to an embodiment of the present disclosure. [Figure 15]FIG. 10 is a diagram for explaining a case where the width of the translated text is adjusted to approach the width of the untranslated text by inserting a line break in the translated text according to an embodiment of the present disclosure. [Figure 16] FIG. 10 is a diagram illustrating an example of a translated text layer according to an embodiment of the present disclosure. [Figure 17] FIG. 10 is a diagram illustrating an example of a layer structure of image data after translation according to an embodiment of the present disclosure. [Figure 18] FIG. 10 is a diagram illustrating an example of translated image data according to an embodiment of the present disclosure. [Figure 19] 1 is a block diagram illustrating a schematic configuration example of an image translation device according to an embodiment of the present disclosure. [Figure 20] 1 is a flowchart illustrating a schematic operation example of an image translation device according to an embodiment of the present disclosure. [Figure 21] FIG. 10 is a diagram illustrating an example of a screen presented to a user in an image translation device according to an embodiment of the present disclosure. [Figure 22] FIG. 1 is a diagram showing an example of image data translated using an image translation device according to an embodiment of the present disclosure (part 1). [Figure 23] FIG. 2 is a diagram showing an example of image data translated using an image translation device according to an embodiment of the present disclosure (part 2). [Figure 24] FIG. 1 is a hardware configuration diagram illustrating an example of an information processing device that realizes the functions of each unit of an image translation device according to an embodiment of the present disclosure. [Figure 25] FIG. 1 is a diagram illustrating an example of a system configuration in which an image translation device according to an embodiment of the present disclosure is configured as a server-client type. DETAILED DESCRIPTION OF THE INVENTION
[0011] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. Note that, for the sake of simplicity, the process of translating text in image data into text (translated sentences or translated words) in another language and replacing the text in the image data with this translated sentence or translated word will be simply referred to as "translating image data."
[0012] In the following embodiments, a file with a layer structure is exemplified as image data to be translated. A file with a layer structure may be any of a variety of files composed of one or more layers containing characters or character strings (hereinafter referred to as text), such as image data files such as PSD files, PSB files, PMB files, CLIP files, and SAI files, document files such as PDF files, and map data files such as MAP files. In other words, the layer structure in this description may be a structure having one or more layers, including a text layer. For clarity, the following description will be given using an image data file (hereinafter simply referred to as image data), such as a PSD file, that has a hierarchical structure in which a text layer and a pixel layer are separated.
[0013] Fig. 1 is a diagram schematically illustrating the file format of a PSD file exemplified in this embodiment. As shown in Fig. 1, the PSD file format defines a file header section F1, a color mode section F2, an image resource section F3, a layer and mask information section F4, and an image data section F5, and defines image data having a layer structure of one or more layers.
[0014] The file header section F1 stores information such as a file identifier, a version number, a reserved area, the number of channels, a canvas size, the number of data bits, and a color mode.
[0015] The color mode section F2 stores various information related to color, such as color data size.
[0016] The image resource section F3 stores information such as setting values used by an editor to edit a PSD file, such as image resource size, image resource section identifier, resource ID, resolution information, layer information, and thumbnail information.
[0017] The layer and mask information section F4 stores information for managing layer and mask data. For example, the data structure stores information such as data size, section size, number of layers, layer repetition, upper Y coordinate, left X coordinate, lower Y coordinate, right X coordinate, number of channels, start of repetition for the number of channels, channel type, channel size, end of repetition for the number of channels, and the layer information stores information such as layer identifier, mode key, transparency, clipping, flag, data size, upper Y coordinate, left X coordinate, lower Y coordinate, right X coordinate, standard position, mask, mask data size, dummy data, upper Y coordinate of mask, left X coordinate of mask, lower Y coordinate of mask, right X coordinate of mask, composite data size, data source location, data source address, layer size name, layer name, etc.
[0018] The image data section F5 is a section for managing the image data and text data of each layer, and stores the image data and text data of each layer.
[0019] Fig. 2 is a diagram showing an example of image data created as a PSD file. Fig. 3 is a diagram showing an example of the layer structure of the image data exemplified in Fig. 2, and Figs. 4 to 7 are diagrams showing examples of image data or text data of each layer.
[0020] As shown in Fig. 2, the image data 10 used in this description includes text A1, a pixel image B1, and a background image C1. As shown in Fig. 3, the image data 10 has a three-layer structure including a text layer 11 located at the top, a background layer 13 located at the bottom, and a normal layer 12 located between the text layer 11 and the background layer 13. However, as will be described later, the layer structure of the image data 10 according to this embodiment may be modified in various ways.
[0021] The text layer 11 may be a layer on which text (character strings) created in a language selected by the user is written in a position, font, character size, character color, decoration (bold, italic, outline, shading, etc.) specified by the user. In the following description, character color, decoration, etc. are collectively referred to as "decoration," the font, character size, decoration, etc. assigned to text are referred to as attribute information, and text to which attribute information is assigned is also referred to as text data. In the example shown in Figure 4, Japanese text A1, "soccer," is written in region R11 in the text layer 11 using the font "MS P Gothic," the character size "30 points," the character color "black," and the decoration "outline 6%."
[0022] The normal layer 12 may be, for example, a layer (also referred to as a pixel layer) on which characters and various objects (hereinafter collectively referred to as objects) are drawn using pixel images, line drawings, etc. In the example shown in Fig. 5 or 6, a pixel image B1 consisting of two objects, a first field player dribbling and a second field player tackling the first field player, and a soccer ball object, is drawn in an area R12 in the normal layer 12.
[0023] In this embodiment, the region R12 in the normal layer 12 in which the pixel image B1 is drawn is important for adjusting the positional relationship (distance, degree of overlap, etc.) between the text A1 arranged on the text layer 11 and the pixel image B1. Therefore, in this description, the region R12 in which the pixel image B1 is drawn is defined as the region R12 delimited by the outline of the pixel image B1, as shown in Fig. 5. However, the region in which the pixel image is drawn in this embodiment is not limited to the example shown in Fig. 5 and may be variously modified, such as a rectangular, circular, or elliptical region R12A surrounding the pixel image B1, as shown in Fig. 6, or a region in which some objects of the pixel image B1 are drawn.
[0024] The background layer 13 may be, for example, a layer in which a background image is drawn using pixel art or line art. In the example shown in Fig. 7, a soccer court is drawn as background image C1 on the background layer 13. Note that the background image C1 may be drawn on the entire background layer 13 or on only a part of the background layer 13.
[0025] In the above layer structure, the normal layer 12 is not limited to one layer, but may be a layer group consisting of multiple normal layers. In the example shown in Fig. 5, for example, the first field player, the second field player, and the soccer ball may be drawn in different normal layers, which may be grouped into a layer group to draw the pixel image B1 as a whole.
[0026] Furthermore, it is not essential that the text layer 11 be located at the top layer, and other layers such as a normal layer may exist above the text layer 11. Furthermore, the layers constituting the image data 10 are not limited to a text layer, a normal layer, and a background layer, but may include other types of layers such as an adjustment layer, a fill layer, and a shape layer, or at least one of the text layer, the normal layer, and the background layer may be replaced with another type of layer. In other words, the image data 10 according to this embodiment may be transformed in any manner as long as it has a layer structure of one or more layers including a text layer, as described above.
[0027] Furthermore, the following explanation gives an example of adjusting the size, placement, etc. of the translated text based on the positional relationship between the text and the pixel image (or an object contained in the pixel image), without taking into account the positional relationship between the text and the background image; however, this embodiment is not limited to this, and the size, placement, etc. of the translated text may also be adjusted based on the positional relationship between the text and the background image, or the positional relationship between the text, the pixel image (or an object contained in the pixel image), and the background image (or an object contained in the background image).
[0028] Fig. 8 is a diagram illustrating the positional relationship between an area where text is written and an area where pixel images are drawn in image data before translation exemplified in this embodiment, and Fig. 9 is a diagram illustrating the positional relationship between an area where text is written and an area where pixel images are drawn in image data after translation exemplified in this embodiment. Note that the translation from Fig. 8 to Fig. 9 illustrates an example in which image data 10 including text A1 written as "soccer" in Japanese is translated into image data 20 including text A2 written as "SOCCER" in English.
[0029] As shown in Figure 8, in image data 10, area R12 in which pixel image B1 is drawn is placed in a part of the canvas which is the display range of image data 10, and area R11 in which text A1 is written is placed in a margin area R10 on the canvas other than area R12.
[0030] That is, in the untranslated image data 10 created by the user, text A1 is written in a margin area R10 where no pixel image B1 is placed. Here, the margin area R10 may be an area large enough to be visible and capable of placing one or more characters of text, and its shape may be a rectangle (including a square), another polygon, a circle, an ellipse, or the like. FIG. 8 illustrates an example of a rectangular area R10 that does not overlap with the pixel image B1 area R12. However, the example shown in FIG. 8 is not limited to a rectangular area, and the margin area R10 may also be a combination of rectangles, such as a convex or concave shape, or another polygon, circle, ellipse, or the like.
[0031] As shown in Fig. 8, if the width of margin area R10 (the horizontal length in the drawing) is W_MAX, then the width W2 of area R21 of post-translation text A2 must be narrower than the width W_MAX of margin area R10, as shown in Fig. 9. Furthermore, if the width of pre-translation text A1 is W1, then in order to minimize the change in the impression that image data 10 / 20 gives to the user before and after translation, it is preferable that the width W2 of area R21 of post-translation text A2 be approximately the same as the width W1 of area R11 of pre-translation text A1.
[0032] Similarly, if the height (vertical length in the drawing) of margin area R10 is H_MAX as illustrated in Figure 8, then the height H2 of area R21 of post-translation text A2 must be lower than the height H_MAX of margin area R10 as illustrated in Figure 9. Furthermore, if the height of pre-translation text A1 is H1, then in order to minimize the change in the impression that image data 10 / 20 gives to the user before and after translation, it is preferable that the height H2 of area R21 of post-translation text A2 be approximately the same as the height H1 of area R11 of pre-translation text A1.
[0033] Here, "the impression that image data gives to the user" may refer to the impression or mental image that is given to the user who sees it, based on the size and positional relationship between the text and pixel image (which may include a background image), the font, character size, decoration, etc. of the text.
[0034] In this way, in order to minimize the change in the impression that Image Data 10 / 20 gives to the user before and after translation, it is necessary to minimize the change in the width and height (hereinafter simply referred to as size) of the text before and after translation. Note that maintaining or making similar the font and decoration of the text before and after translation can also further minimize the change in the impression that Image Data 10 / 20 gives to the user before and after translation.
[0035] FIG. 10 is a diagram illustrating an example of the size of pre-translation text written in Japanese according to this embodiment, FIG. 11 is a diagram illustrating an example of the size of translated text written in English according to this embodiment, and FIG. 12 is a diagram illustrating an example of the size of translated text written in Chinese according to this embodiment.
[0036] As described above and shown in Figure 10, in this example, the text A1, which writes "soccer" in Japanese, is decorated with the font "MS P Gothic," the font size "30 points," the font color "black," and the decoration "6% hollow."
[0037] Here, the width W1 of the entire text A1 varies depending on the shape and size of the character images associated with each font for the character codes of each character constituting the text A1, the character size set as attribute information, the decoration set for the character string, etc. For example, if the character code system is Shift-JIS, the character code sequence of the text A1, "soccer," is "8354 8362 834A 815B," and the width W1 of the entire text A1 is the sum of the horizontal length L11 of the character image "sa" associated with each font for the character code "8354," the horizontal length L12 of the character image "tsu" associated with each font for the character code "8362," the horizontal length L13 of the character image "ka" associated with each font for the character code "834A," and the horizontal length L14 of the character image "-" associated with each font for the character code "815B" (W1 = L11 + L12 + L13 + L14). The height H1 of the text is determined by the character size.
[0038] When this text A1 is translated into English text A2, as shown in FIG. 11, the overall width W2 of text A2 described as "SOCCER" in English also varies depending on the shape, size, character size, decoration, etc. of the character images associated with each font for the character codes of the characters constituting text A2, similar to text A1. Therefore, when the character code system is the ASCII code, the overall width W2 of text A2 is the sum of the horizontal lengths L21 to L26 of the character images associated with each font for the character codes "53", "4F", "43", "43", "45", "52" of each character constituting "SOCCER" (W2 = L21 + L22 + L23 + L24 + L25 + L26).
[0039] Similarly, when text A1 is translated into Chinese text A3, as shown in FIG. 12, the overall width W3 of text A3 described as "足球" in Chinese also varies depending on the shape, size, character size, decoration, etc. of the character images associated with each font for the character codes of the characters constituting text A3. Therefore, when the character code system is UTF-16, the overall width W3 of text A3 is the sum of the horizontal lengths L31 and L32 of the character images associated with each font for the character codes "8DB3" and "7403" of each character constituting "足球" (W3 = L31 + L32).
[0040] Here, the changes in the width and height of the text before and after translation when the font, character size, and decoration are not changed will be explained using the example shown in FIG. 13. As illustrated in (A) and (B) of FIG. 13, when the Japanese text A1 of "サッカー" is translated into the English text A2 of "SOCCER" without changing the font, character size, and decoration, mainly due to the increase in the number of characters, the width W2 of the translated text A2 becomes wider by the difference D2 than the width W1 of the text A1 before translation. And when the width of text A2 is wider than the width W_MAX of the margin area R10, if text A2 is placed in the text layer as it is, a part of text A2 will protrude outside the canvas, and the entire text A2 cannot be included in the image data.
[0041] 13A and 13C, if the Japanese text A1, "soccer," is translated into the Chinese text A3, "football," without changing the font, character size, or decoration, the width W3 of the translated text A3 will be shorter by a width D3 than the width W1 of the pre-translation text A1, mainly due to a reduction in the number of characters. Therefore, if the text A3 is placed on the text layer as is, the balance between the text A1 and pixel image B1 in the pre-translation image data 10 and the balance between the text A3 and pixel image B1 in the translated image data will change significantly, resulting in a significant change in the impression the image data gives to the user before and after translation.
[0042] Therefore, in this embodiment, in order to minimize the change in the impression that image data gives to the user before and after translation, the font, character size, and decoration of the translated text are automatically adjusted so that the width of the translated text approaches the width of the untranslated text. Figure 14 shows an example where the width of the translated text is adjusted to approach the width of the untranslated text by changing the character size without changing the font and decoration.
[0043] In the examples shown in Figures 14A and 14B, the character size, which was 30 points in the Japanese text A1 in the example shown in Figure 13A and 13B, is changed to 28 points in the English text A2. As a result, the width W2 of the text A2, which has an increased number of characters due to translation, is maintained at approximately the same width W1 as the text A1 before translation.
[0044] On the other hand, in the examples shown in Figures 14A and 14C, the character size, which was 30 points in the Japanese text A1 in the examples shown in Figures 13A and 13C, is changed to 55 points in the Chinese text A3. As a result, the width W3 of the text A3, whose number of characters is reduced by translation, is maintained at approximately the same width W1 as the text A1 before translation.
[0045] However, although the height H3 of the translated text A3 is lower than the height H_MAX of the margin area R10, it is significantly larger (approximately twice as large) than the height H1 of the untranslated text A1. In such a case, the character size and decoration may be adjusted so that the height H3 of the text A3 becomes an appropriate height. For example, the character size of the text A3 may be adjusted so that the sum of the rate of increase in the height H1 of the text A3 relative to the height H1 of the text A1 and the rate of decrease in the width W3 of the text A3 relative to the width W1 of the text A1 approaches a predetermined value (e.g., 0%). Alternatively, the character size of the text A3 may be adjusted so that the area of the area in which the text A3 is written approaches the area of the area R11 in which the text A1 is written.
[0046] 15A and 15B, depending on the number of characters in the translated text A4, its width W41 may significantly exceed the width W_MAX of the margin area R10. However, as shown in FIG. 15C, if the character size is adjusted so that the width W42 of the text A4 approaches the width W1 of the text A1 before translation (from 30 points to 9 points), each character becomes very small, which not only significantly changes the impression given to the user before and after translation, but also may make the characters themselves difficult to see.
[0047] In such cases, as shown in FIG. 15(D), the text A4 may be broken into two or more lines, and the character size may be adjusted so that the width W43 of the text A1 is approximately the same as the width W1 of the text A1. For example, if the character size is less than half the character size of the original text A1 or is less than a preset character size threshold, the translated text may be broken into lines and the character size adjusted. In such cases, the height H43 of the translated text A4 may exceed the height H_MAX of the margin region R10. In such cases, the character size of the text A4 may be adjusted so that the height H43 of the text A4 is less than the height H_MAX of the margin region R10 or approaches the height H1 of the original text A1.
[0048] FIG. 16 is a diagram showing an example of a translated text layer according to this embodiment, FIG. 17 is a diagram showing an example of a layer structure of translated image data according to this embodiment, and FIG. 18 is a diagram showing an example of translated image data according to this embodiment.
[0049] As shown in Fig. 16, in the translated text layer 21, the text A1 written in Japanese as "soccer" is translated into text A2 written as "SOCCER" in English. As shown in Fig. 17, in reconstructing the translated image data 20, the text layer 11 in the pre-translation image data 10 is replaced with the translated text layer 21. As a result, as shown in Fig. 18, translated image data 20 is generated in which the Japanese text A1 in the pre-translation image data 10 is replaced with the English text A2.
[0050] Next, an image translation device as an information processing device according to this embodiment will be described in detail with reference to the drawings.
[0051] 19 is a block diagram showing an example of the schematic configuration of an image translation device according to this embodiment. As shown in FIG. 19, the image translation device 100 includes an image data input unit 101, a layer structure analysis unit 102, an image region identification unit 103, a text data analysis unit 104, a text region identification unit 105, a source language identification unit 106, a target language setting unit 107, a translation unit 108, a text layer update unit 109, a text region adjustment unit 111, an image data reconstruction unit 112, and an image data output unit 113.
[0052] Next, the operation of each unit shown in Fig. 19 will be described with reference to Fig. 20. Fig. 20 is a flowchart showing an example of the general operation of the image translation device according to this embodiment. Fig. 21 is a diagram showing an example of a screen presented to a user in the image translation device according to this embodiment. For clarity, the following description will exemplify a case in which Japanese image data 10 (see Fig. 2) is translated into English image data 20 (see Fig. 18).
[0053] 20, in this operation, first, the image data input unit 101 inputs pre-translation image data 10 (step S101). As illustrated in FIG. 21, various methods may be employed for inputting the image data 10, such as a method in which a pre-translation image display area 210 in an image translation window 200 displayed on a display or the like functions as a drop area, and the user drags and drops the file of the image data 10 to be translated into this pre-translation image display area 210 using an input device such as a mouse, or a method in which the user specifies an address path to which the image data 10 to be translated is saved. Furthermore, the pre-translation image data 10 specified by the user may be displayed in the pre-translation image display area 210.
[0054] Next, the layer structure analysis unit 102 analyzes the layer structure of the input image data 10 by referring to the file format (see FIG. 1) of the image data 10 (step S102). In this explanation, as explained using FIG. 3 etc., a case will be exemplified in which the image data 10 has a layer structure consisting of a text layer 11, a normal layer 12, and a background layer 13.
[0055] Next, the image area specifying unit (also referred to as the specifying unit) 103 specifies the position and size (hereinafter referred to as the area) of a pixel image drawn in a layer other than the text layer 11 in the layer structure (step S103). Here, "specifying the area of the pixel image" may mean, for example, in the example shown in FIG. 5 or FIG. 6, specifying the area R12 or R12A in which the pixel image B1 in the normal layer 12 is drawn, and the position of the area R12 / R12A within the normal layer 12 (or the canvas) (for example, the coordinates of a reference point set in the area R12 / R12A). Note that if there are multiple pixel images, each area may be specified. Furthermore, when controlling the overlap between the background image and the text, the image area specifying unit 103 may specify the area of the pixel image as the background image in the background layer.
[0056] The area where the pixelated image is drawn (image area) may be identified using, for example, a pattern recognition technique, image recognition or object recognition that identifies the area of the object (pixelated image) by recognizing edges, or object recognition using AI (Artificial Intelligence) techniques such as semantic segmentation.
[0057] Furthermore, the image region specifying unit 103 may set a priority for each object identified by the recognition process. This priority may be used as an index indicating the degree to which superimposition with text is permitted. For example, if the recognized object is a character, a character's face, or a character's torso, a priority may be set that allows as little superimposition with text as possible. Alternatively, if the recognized object is a building or a character's arm, a priority may be set that does not restrict (i.e., allows) superimposition with text very much. In this case, the priority for each object may be set based on the degree to which each object superimposes with text in the image data before translation.
[0058] Next, the text data analysis unit (also referred to as the analysis unit) 104 extracts text data from the text layer 11 of the image data 10 and analyzes the extracted text data to identify the character coding system and character code string (which may include some control information such as line breaks), font, character size, decorations added to the text, and other attribute information of the text data (step S104). For example, open source software may be used to extract the text data. For example, if the image data 10 is a PSD file, it is possible to extract the text data from the image data 10 using open source software provided for Photoshop (registered trademark). In this case, the text data analysis unit 104 may identify the area of the text A1 in the image data 10 (text layer 11) (i.e., the position and size of area R11) from the identified character coding system, character code string, and attribute information.
[0059] Note that the text formats that can be incorporated into the text layer include plain text format, which consists of a displayable string of characters and some control information, and rich text format (including HTML (Hyper Text Markup Language) format), which includes attribute information such as font, character size, font color, underline, and emphasis (bold, shading, etc.). In this description, to illustrate a case where the text A1 in the image data 10 is decorated, the text A1 is written in rich text format, but other formats such as plain text format may also be used.
[0060] Next, the text area identification unit 105 identifies the area of the text A1 written in the text layer 11 (step S105). Here, "identifying the area of the text" may mean, for example, in the example shown in FIG. 4, identifying the area R11 in the text layer 11 where the text A1 is written and the position of the area R11 within the text layer 11 (or the canvas) (for example, the coordinates of a reference point set in the area R11). The area of the text can be identified based on the font, character size, and decoration, for example, as described above with reference to FIGS. 10 to 15. Note that if there are multiple pieces of text, each area may be identified.
[0061] Next, the source language identification unit 106 identifies the language of the text A1 to be translated (step S106). The language of the text A1 can be identified, for example, from the character code system identified by the analysis by the text data analysis unit 104. However, this is not limiting, and if other identification means are available, such as when the text data includes a language specification as attribute information, the language may be identified using this means. Alternatively, the language of the text A1 may be set by the user by providing the user with a pull-down menu 212 or the like, as shown in the image translation window 200 illustrated in FIG.
[0062] Next, the translation target language setting unit 107 sets the translation target language (step S107). The translation target language may be configured to be set by the user by providing the user with a pull-down menu 222 or the like, as in the image translation window 200 illustrated in Fig. 21. However, this is not limited to such a method, and various modifications are possible.
[0063] Next, the translation unit 108 translates the text A1 into a character string (text A2) in the language set by the translation target language setting unit 107 (step S108). Translation machines that can be used for the translation unit 108 include rule-based, statistical-based, neural network, and hybrid types that combine two or more types, and any translation machine may be used in this embodiment. Furthermore, the translation unit 108 may be a processing unit implemented within the image translation device 100, or may be an external processing unit such as a translation site located on the Internet. When an external translation site is used, the system may be configured to allow the user to select which of several translation sites to use.
[0064] Next, the text layer update unit (also referred to as the generation unit and the update unit) 109 updates the text A1 in the text layer 11 with the translated text A2, thereby generating the text layer 21 (step S109). In this step S109, for example, attribute information such as font, character size, decoration, etc. of the translated text A2 may be generated based on the attribute information identified by the text data analysis unit 104 in step S104, and the text layer 21 may be generated by generating text data of the text A2 in a rich text format.
[0065] Next, the text area adjustment unit (also referred to as the adjustment unit) 111 identifies the area of the text A2 in the text layer 21 (i.e., the position and size of area R21), and determines whether the text A2 is within an appropriate area (step S110). Note that the appropriate area may be variously changed, such as a margin area R10, an area within a predetermined ratio (e.g., ±20%) in both width and height based on area R11 of the text A1 before translation, or an area determined based on the positional relationship with each object in the image data 10, as long as it is an area that can minimize changes in the impression that the image data gives to the user before and after translation.
[0066] If the text A2 fits within the appropriate area (YES in step S110), the operation proceeds to step S112. On the other hand, if the text A2 does not fit within the appropriate area (NO in step S110), the text area adjustment unit 111 adjusts the area of the text A2 by adjusting one or more of the font, character size, and decoration (which may include line breaks, etc.) based on the attribute information assigned to the translated text A2 (step S111). As with step S105, the area of the text A2 may be adjusted using the methods described above with reference to Figures 10 to 15, etc. Furthermore, adjusting the area of the text A2 may include changing the translation or the translated phrase. For example, if there are multiple translations for the Japanese word "soccer," such as "SOCCER" and "ASSOCIATION FOOTBALL" in English, the translated phrase or phrase may be changed to more closely match the area of the untranslated text A1.
[0067] After the region of text A2 in the translated text layer 21 has been adjusted as described above, the image data reconstructor (also referred to as the reconstructor) 112 replaces the text layer 11 in the pre-translation image data 10 with the translated text layer 21, thereby reconstructing the translated image data 20 (step S112). The reconstructed translated image data 20 may be displayed in a translated image display area 220 adjacent to the pre-translation image display area 210 in the image translation window 200, as shown in FIG. 21, for example. By displaying the pre-translation image data 10 and the translated image data 20 side by side in this way, the user can visually compare the image data 10 / 20 before and after translation, and can easily determine the extent to which the impression given by the image data 10 / 20 has changed before and after translation.
[0068] Next, the image data output unit 113 outputs the translated image data 20 (step S113). The output image data 20 may be saved as an image file in a save destination designated by the user.
[0069] Thereafter, for example, a control unit (such as a CPU (Central Processing Unit) or GPU (Graphics Processing Unit)) that controls the entire image translation device 100 determines whether to terminate this operation (step S114), and if so (YES in step S114), this operation is terminated.
[0070] On the other hand, if the process is not to be completed (NO in step S114), for example, the control unit determines whether to translate the same image data 10 into another language or to translate other image data (step S115). This determination may be made based on an instruction from the user.
[0071] If the image data to be translated is to be changed (NO in step S115), the process returns to step S101 and the subsequent operations are executed. On the other hand, if the same image data is to be translated into a language different from the language set in step S107 (YES in step S115), the process returns to step S107 and the subsequent operations are executed.
[0072] With the above-described configuration and operation, this embodiment makes it possible to automatically translate image data containing text in one language into image data containing text in another language while minimizing changes in the impression given to the user. This makes it possible to easily translate image data into multiple languages, thereby significantly reducing the time, effort, and cost required to distribute content produced in one country to other countries.
[0073] 22 and 23 are diagrams showing examples of image data translated using the image translation device according to this embodiment. In the example shown in Fig. 22, the untranslated image data 30 shown in (A) has a layer structure in which a text layer 31 containing the text "First Purchase Reward," a normal layer 32 containing a pixelated image of a wrapped present, and a normal layer 33 containing pixelated images of two field players are superimposed, as shown in (B).
[0074] In this overlay, the text "First Purchase Reward" is positioned so as not to overlap with the pixel images of the two field players, but is allowed to overlap with the pixel images of the wrapped present. Therefore, as shown in (C), in the translated text layer 41, the translation of "First Purchase Reward" "First Purchase Pack" is broken into two lines so as not to overlap with the pixel images of the two field players. As a result, image data 40 is generated, as shown in (D), which includes the translated text "First Purchase Pack" positioned so as to overlap with the pixel images of the wrapped present but not to overlap with the pixel images of the two field players.
[0075] 23, the pre-translation image data 50 shown in (A) has a layer structure in which a text layer 51 containing the text "Diamond Pass," a normal layer 52 containing pixel images of multiple diamonds, and a normal layer 53 containing pixel images of two field players are superimposed, as shown in (B). Of these, the normal layer 52 containing pixel images of multiple diamonds may be a layer group made up of multiple normal layers, each containing one or more pixel images of diamonds.
[0076] In this overlay, the text "Diamond Pass" is positioned so as not to overlap with the pixel images of the two field players, but overlap with the pixel images of multiple diamonds is permitted. Furthermore, there is only a small change in the number of characters between "Diamond Pass" and its translation, "Gem Pass." Therefore, as shown in (C), in the translated text layer 61, one or more of the font, character size, and decoration of "Gem Pass" are adjusted so that the area of the translation of "Diamond Pass" ("Gem Pass") is approximately the same as the area of the original text "Diamond Pass." As a result, image data 60 is generated in which "Gem Pass" is positioned in an area approximately the same as "Diamond Pass" in the original image data 50, as shown in (D).
[0077] The image translation device 100 according to the embodiment described above can be realized by, for example, an information processing device 1000 configured as shown in FIG. 24. FIG. 24 is a hardware configuration diagram showing an example of an information processing device that realizes the functions of each unit of the image translation device according to this embodiment. The information processing device 1000 includes a CPU 1100, a GPU 1150, a ROM (Read Only Memory) 1200, a RAM (Random Access Memory) 1300, a recording device 1400, an input / output interface (I / F) 1500, and a communication unit 1600. The units of the information processing device 1000 are connected by a bus 1700.
[0078] The CPU 1100 operates and controls each unit based on programs stored in the ROM 1200 or the recording device 1400. For example, the CPU 1100 loads the programs stored in the ROM 1200 or the recording device 1400 into the RAM 1300 and executes processing corresponding to the various programs.
[0079] Like the CPU 1100, the GPU 1150 operates based on programs stored in the ROM 1200 or the recording device 1400 and controls each unit. For example, the GPU 1150 loads programs stored in the ROM 1200 or the recording device 1400 into the RAM 1300 and executes processing corresponding to the various programs. In this case, the GPU 1150 may cooperate with the CPU 1100 to execute the control of each unit.
[0080] The ROM 1200 stores boot programs such as a basic input output system (BIOS) executed by the CPU 1100 when the information processing device 1000 is started up, programs dependent on the hardware of the information processing device 1000, and the like.
[0081] Recording device 1400 is a computer-readable recording medium that non-temporarily records programs executed by CPU 1100 and data used by such programs. Specifically, recording device 1400 is a recording medium that records programs for executing each operation related to the present disclosure, which are examples of program data.
[0082] The communication unit 1600 is an interface for connecting the information processing device 1000 to an external network 1650 (e.g., the Internet). For example, the CPU 1100 receives data from other devices and transmits data generated by the CPU 1100 to other devices via the communication unit 1600.
[0083] The input / output I / F 1500 is an interface for connecting the input / output device 1650 and the information processing device 1000. For example, the CPU 1100 receives data from an input device such as a keyboard or a mouse via the input / output I / F 1500. The CPU 1100 also transmits data to an output device such as a display, a speaker, or a printer via the input / output I / F 1500. The input / output I / F 1500 may also function as a media interface for reading programs and the like recorded on a predetermined recording medium.
[0084] For example, when the information processing device 1000 functions as the image translation device 100 according to the above embodiment, the CPU 1100 of the information processing device 1000 may execute a program loaded on the RAM 1300 to realize the functions of the image data input unit 101, layer structure analysis unit 102, image region identification unit 103, text data analysis unit 104, text region identification unit 105, source language identification unit 106, target language setting unit 107, translation unit 108, text layer update unit 109, text region adjustment unit 111, image data reconstruction unit 112, image data output unit 113, and control unit. The recording device 1400 may also store programs according to the present disclosure. The CPU 1100 reads and executes program data from the recording device 1400. Alternatively, the CPU 1100 may acquire these programs from another device via an external network 1650.
[0085] Furthermore, the image translation device 100 according to this embodiment may be configured to operate standalone on the user side, or may be configured as a server-client system in which some or all of its functions (image data input unit 101, layer structure analysis unit 102, image region identification unit 103, text data analysis unit 104, text region identification unit 105, source language identification unit 106, target language setting unit 107, translation unit 108, text layer update unit 109, text region adjustment unit 111, image data reconstruction unit 112, image data output unit 113, control unit, etc.) are located on a server 2100 on a network 2300, as shown in FIG. 25 . In this case, a user accesses the server 2100 from clients 2200A, 2200B, etc. connected to the network 2300 and translates the target image data. Note that the server 2100 may be a centralized system consisting of a single server, a distributed system consisting of multiple servers, or a cloud server.
[0086] Although the embodiments and modifications of the present disclosure have been described above, the technical scope of the present disclosure is not limited to the above-described embodiments or modifications thereof, and various modifications are possible within the scope of the gist of the present disclosure. Furthermore, components of different embodiments and modifications may be combined as appropriate.
[0087] Furthermore, the effects of the embodiments and their modifications described in this specification are merely examples and are not intended to be limiting, and other effects may also be obtained. [Explanation of symbols]
[0088] 100 Image translation device 101 Image data input unit 102 Layer Structure Analysis Department 103 Image region identification unit 104 Text Data Analysis Department 105 Text Area Identification Unit 106 Source Language Identification Unit 107 Target Language Setting Section 108 Translation Department 109 Text Layer Update Section 111 Text area adjustment section 112 Image Data Reconstruction Unit 113 Image data output unit
Claims
1. an analysis unit that identifies first attribute information of a first text by analyzing text data of the first text written in a first language in a text layer of first image data having a hierarchical structure; a translation unit for translating the first text into a second text in a second language different from the first language; a generation unit that generates second attribute information of the second text based on the first attribute information; an updating unit that updates the first text in the text layer with the second text to which the second attribute information is assigned; an adjustment unit that adjusts the second attribute information of the second text based on the position and size of the first text in the text layer so that the width of the second text in the text layer approaches the width of the first text in the text layer; a reconstruction unit that reconstructs second image data by replacing the text layer in the first image data with the text layer including the second text to which the adjusted second attribute information has been assigned; Equipped with the first attribute information includes at least one of a font, a character size, and an ornamentation assigned to the first text; The second attribute information includes at least one of a font, a character size, and a decoration given to the second text. Information processing device.
2. the first image data is in a psd file format, The analysis unit extracts the text data from the first image data using open source software. The information processing device according to claim 1 .
3. The translation unit is a rule-based, statistical-based, neural network, or hybrid translation machine. The information processing device according to claim 1 .
4. an identifying unit that identifies an image area in which a pixel image in the first image data is drawn; the identification unit recognizes one or more objects drawn in the first image data by performing a recognition process on the first image data, and sets a priority order to be used as an index indicating a degree to which each object is allowed to be superimposed on text according to a category of the recognized object; The adjustment unit identifies an area of the second text in the text layer updated by the update unit, and adjusts the second attribute information based on a positional relationship between the identified area of the second text and the object identified by the identification unit, so that superimposition of the area of the second text and the one or more objects is adjusted based on the priority set for each object. The information processing device according to claim 1 .
5. The adjustment unit calculates a position and a size of the second text in the text layer based on the second attribute information, and adjusts the second attribute information by comparing the position and the size of the first text in the text layer with the position and the size of the second text so that the width of the second text in the text layer approaches the width of the first text in the text layer. The information processing device according to claim 1 .
6. The adjustment unit adjusts at least the character size in the second attribute information when there is a difference between the size of the first text and the size of the second text. The information processing device according to claim 5 .
7. The first image data includes a normal layer on which a pixel image is drawn and the text layer, The reconstructing unit reconstructs the second image data using the text layer including the second text to which the adjusted second attribute information has been assigned and the normal layer. The information processing device according to claim 1 .
8. A computer-implemented information processing method for translating text in image data, comprising: Identifying first attribute information of a first text by analyzing text data of the first text written in a first language in a text layer in the first image data having a hierarchical structure; translating the first text into a second text in a second language different from the first language; generating second attribute information of the second text based on the first attribute information; updating the first text in the text layer with the second text to which the second attribute information has been assigned; adjusting the second attribute information of the second text based on the position and size of the first text in the text layer so that the width of the second text in the text layer approaches the width of the first text in the text layer; Reconstructing the second image data by replacing the text layer in the first image data with the text layer including the second text to which the adjusted second attribute information has been assigned. This includes: the first attribute information includes at least one of a font, a character size, and an ornamentation assigned to the first text; The second attribute information includes at least one of a font, a character size, and a decoration assigned to the second text. Information processing methods.
9. A program for causing a computer to function to translate text in image data, comprising: a step of identifying first attribute information of a first text by analyzing text data of the first text written in a first language in a text layer in first image data having a hierarchical structure; translating the first text into a second text in a second language different from the first language; generating second attribute information of the second text based on the first attribute information; updating the first text in the text layer with the second text to which the second attribute information has been assigned; adjusting the second attribute information of the second text based on the position and size of the first text in the text layer so that the width of the second text in the text layer approaches the width of the first text in the text layer; Reconstructing second image data by replacing the text layer in the first image data with the text layer including the second text to which the adjusted second attribute information has been assigned; causing the computer to execute the first attribute information includes at least one of a font, a character size, and an ornamentation assigned to the first text; The second attribute information includes at least one of a font, a character size, and a decoration assigned to the second text. Program for.
Citation Information
Patent Citations
Picture translation method and system
CN104090871A
Apparatus and method for generating document image, and computer program
JP2011175569A
Translation result display method, translation result display system, translation result creation device and translation result display program
JP2012173785A