The present invention relates to a translation device that translates a character string included in a captured image.
In order to assist understanding of a foreign language, there has been conventionally developed a technique of displaying a translation result of a foreign language included in an image captured by a camera in a state in which the translation result is superimposed on the image. Such a technique typically uses optical character recognition (hereinafter, referred to as “OCR”) for extraction of a character string included in an image. Though extraction of a character string is typically performed on a per-line basis in OCR, translation of the character string should be performed on a per-sentence basis for improving translation accuracy. Under the circumstances, there has been known a technique of determining an end of a sentence of a character string extracted on the per-line basis. For example, Patent Literature 1 discloses a technique of determining an end of a sentence on the basis of a period. According to the technique disclosed in Patent Literature 1, in a case where a character string is composed only of alphanumeric characters or nouns, the character string will be determined to be a single sentence even if it does not have a period.
Japanese Patent Application Publication Tokukai No. 2011-81516 (Publication date: Apr. 21, 2011)
Japanese Patent Application Publication Tokukaihei No. 6-84019 (Publication date: Mar. 25, 1994)
Japanese Patent Application Publication Tokukaihei No. 8-147272 (Publication date: Jun. 7, 1996)
Unfortunately, such a conventional technique is not satisfactory in determining an end of a sentence of a character string. For example, in a case where a character string has no period, the technique disclosed in Patent Literature 1 cannot accurately determine an end of a sentence of the character string. This problem is particularly conspicuous in a case where a captured image includes a character string for which a period is likely to be omitted. Examples of such an image encompass images of a signboard and a menu each written in a foreign language. Inaccurate determination of an end of a sentence results in an inaccurate translation.
The present invention is attained in view of the above problem. An object of the present invention is to provide a translation device and the like that can accurately translate a character string composed of a plurality of lines.
In order to attain the above object, a translation device of an aspect of the present invention is a translation device that translates a character string included in a captured image, the translation device including: a character string extracting section for extracting, on a per-line basis, the character string composed of a plurality of lines; a determining section for determining whether or not two consecutive lines in the captured image meet a joining condition that is based on a characteristic of a language of the character string, the two consecutive lines being included in lines extracted by the character string extracting section; and a translating section, in a case where the determining section determines that the joining condition is met, the translating section joining and then translating the two consecutive lines, and in a case where the determining section determines that the joining condition is not met, the translation section translating the two consecutive lines, separately.
An aspect of the present invention makes it possible to provide a translation device that can accurately translate a character string composed of a plurality of lines.
The following description will discuss embodiments of the present invention in detail. Note that in the following embodiments, the present invention is applied to a smartphone. Application of the present invention, however, is not limited to a smartphone. The present invention is applicable to any translation device that can translate a character string included in a captured image. For convenience of explanation, an identical reference numeral is given to members having an identical function, in all the embodiments, and a description of the members will be omitted as appropriate. Moreover, shapes of components illustrated in the drawings, and dimensions such as length, size, and width do not reflect actual shapes and dimensions, but are modified as appropriate for clarification of and simplification of the drawings.
The following description will discuss Embodiment 1 of the present invention with reference to
The smartphone 1 of Embodiment 1 translates a character string included in a captured image. As illustrated in
The following description will discuss a concrete example of the joining condition with reference to
This makes it possible to prevent a plurality of lines that should be translated essentially as a single sentence from being translated as different sentences, in a case where the joining condition is based on a characteristic of a language of a character string and indicates that a line break between two consecutive lines is likely to be put in the middle of a sentence. The character string 51 is an English sentence having no mark, such as a punctuation, that separates sentences (see (a) of
The following description will discuss the configuration of the main part of the smartphone 1 with reference to
The operation section 11 is an input device that receives an input operation of a user. The operation section 11 of Embodiment 1 constitutes a touch panel together with the display section 12. The operation section 11 includes (i) an input surface that receives a touch event (including the case of proximity) of an indicator such as a finger and a pen, and (ii) a touch sensor that detects (a) the touch event of the indicator on the input surface and (b) a position (coordinates) at which the indicator touches the input surface. The touch sensor can be any sensor that can detect whether or not the indicator touches the input surface. For example, the touch sensor can be a pressure sensor or a capacitance sensor. The operation section 11 outputs detected coordinates to an operation identifying section 21, which will be later described. Note that a form of the operation section 11 is not limited to a touch panel. Alternatively, the operation section 11 can be physical keys or the like.
The display section 12 is a display device that displays, in its display region, an image of information processed by the smartphone 1. Specifically, the display section 12 displays information processed by a display control section 27, which will be later described. An example of the information that is processed by the display control section 27 and displayed by the display section 12 is a translated character string obtained by translation of a character string included in an image captured by the smartphone 1. Note that the display section 12 can be, for example, a display device such as a liquid crystal display (LCD). As described above, the display section 12 of Embodiment 1 is integrated with the operation section 11 and constitutes a touch panel together with the operation section 11.
The control section 13 performs integrated control on sections of the smartphone 1. The control section 13 includes the operation identifying section 21, an image obtaining section 22, the character string extracting section 23, the condition determining section 24, the extracted line joining section 25, the translation section 26, and the display control section 27.
The operation identifying section 21 identifies an input operation received by the operation section 11. Specifically, the operation identifying section 21 identifies the input operation, on the basis of, for example, coordinates of the input operation, a duration of a touch event of the indicator on the input surface, and a direction in which the indicator touching the input surface moves. In accordance with the input operation thus identified, the operation identifying section 21 instructs the above sections of the control section 13 on respective processes to be performed by the sections of the control section 13. For example, the operation identifying section 21 identifies an input operation for causing the image capturing section 14 to operate, and then instructs the image obtaining section 22 to operate the image capturing section 14. Note that the image capturing section 14 will be later described.
The image obtaining section 22 obtains an image by operating the image capturing section 14, which will be later described. Specifically, upon receipt of an instruction from the operation identifying section 21, the image obtaining section 22 causes the image capturing section 14 to capture an image. The image obtaining section 22 then obtains the image captured by the image capturing section 14, and supplies the image thus obtained to the character string extracting section 23. Note that the image obtaining section 22 of Embodiment 1 is configured to obtain an image captured by the image capturing section 14, but is not limited to this configuration. For example, the image obtaining section 22 can also be configured to read out, upon receipt of an instruction from the operation identifying section 21, an image stored in the storage section 15, which will be later described, and supply the image thus read out to the character string extracting section 23. Note also that an image to be obtained can be a still image such as a photograph, a video image such as a moving image, and a so-called through-the-lens image that is displayed on the display section 12, for capturing an image by the image capturing section 14.
The character string extracting section 23 extracts a character string included in an image. Specifically, in a case where an image supplied from the image obtaining section 22 includes a character string, the character string extracting section 23 extracts the character string on the per-line basis. A technique of extracting a character string can be, for example, any existing optical character recognition technique. Note that information that indicates lines extracted (which information will be hereinafter simply referred as “extracted lines”) is preferably information that allows identification of a positional relationship of the extracted lines in an image. For example, the character string extracting section 23 can extract lines of a character string included in an image in the order from the top of the character string, and convert the lines thus extracted, into information in a table form in which the extracted lines are arranged in the order of extraction. Note that the extracted lines are not limited to the above example, and can be any information that can allow identification of a positional relationship of extracted lines in an image. The character string extracting section 23 which has extracted all lines constituting the character string supplies the extracted lines to the condition determining section 24.
The condition determining section 24 determines whether or not the extracted lines meet a predetermined condition. Specifically, the condition determining section 24 reads out the joining condition stored in a joining condition storage section 31, which will be later described. The condition determining section 24 then determines whether or not the joining condition is met by two consecutive extracted lines of the extracted lines in an image which extracted lines have been supplied from the character string extracting section 23. In a case where the two consecutive extracted lines is determined to meet the joining condition, the condition determining section 24 supplies the two consecutive extracted lines to the extracted line joining section 25. In such a case, the condition determining section 24 further determines whether or not the joining condition is met by an extracted-and-joined line supplied from the extracted line joining section 25, and a subsequent extracted line, in the image obtaining section 22, following the extracted-and-joined line. In a case where the extracted-and-joined line and the subsequent extracted line are determined to meet the joining condition, the condition determining section 24 supplies both the extracted-and-joined line and the subsequent extracted line to the extracted line joining section 25. Having completed determination for all extracted lines, the condition determining section 24 supplies, to the translation section 26, an extracted-and-joined line(s) and an extracted line(s) which have been subjected to the determination.
The joining condition is based on a characteristic of a language of a character string, and specifically is a condition that indicates that a line break between two consecutive lines is likely to be put in the middle of a sentence. In a case where the character string is written in English, the following conditions (1) to (3) are examples of the joining condition: (1) Between two consecutive lines in an image obtained by the image obtaining section 22, a latter line has a lower-case character as an initial character. (2) Between the two consecutive lines, a former line has a last word whose word class is a conjunction, a preposition, or an article. (3) Between the two consecutive lines, the latter line is composed only of upper-case characters.
The condition determining section 24 of Embodiment 1 reads out the joining conditions (1) through (3), each stored in the joining condition storage section 31 which will be later described, and determines whether or not the two consecutive lines meet at least any one of the joining conditions (1) through (3). For this purpose, the condition determining section 24 of Embodiment 1 has (i) a function of determining whether characters constituting each extracted line are upper-case characters or lower-case characters, and (ii) a function of identifying a word class of a last word of each extracted line. Note, however, that the joining condition is not limited to the above conditions, and can be any condition which is based on a characteristic of a language of a character string included in an image obtained by the image obtaining section 22 and that indicates that a line break between two consecutive lines is likely to be put in the middle of a sentence. Note also that the functions of the condition determining section 24 are not limited to the above functions, and can be any functions corresponding to the joining condition.
The extracted line joining section 25 joins two consecutive extracted lines that meet the joining condition. Specifically, the extracted line joining section 25 joins the two consecutive extracted lines that are supplied from the condition determining section 24, and thereby generates an extracted-and-joined line. The extracted line joining section 25 then supplies, as an extracted line to be subject to determination, the extracted-and-joined line thus generated to the condition determining section 24.
The translation section 26 translates an extracted line(s) and an extracted-and-joined line(s). Specifically, the translation section 26 translates the extracted line(s) and the extracted-and-joined line(s) each supplied from the condition determining section 24, on the basis of translation data read out from a translation data storage section 33, which will be later described. Note that the translation data will be later described in detail. The translation section 26 can use any existing translation technique to perform a translation process (e.g., English-to-Japanese translation process). The translation section 26 supplies a translated character string, which is a translation result of the extracted line(s) and the extracted-and-joined line(s), to the display control section 27.
The display control section 27 determines an image to be displayed on the display section 12. Specifically, on receipt of a translated character string from the translation section 26, the display control section 27 causes the display section 12 to display the translated character string as an image. For example, the display control section 27 can identify a region in which an original character string is displayed on the display section 12, and cause the display section 12 to display the translated character string in the region thus identified. In such a case, the translated character string will be superimposed on the original character string. This allows a user to obtain an image in which a character string is translated in an unspoiled layout of the image captured by the image capturing section 14. Note that the form of a display of the translated character string is not limited to the above example. The translated character string can also be displayed, for example, in the vicinity of the original character string. Alternatively, only the translated character string can be displayed without a display of the captured image.
The image capturing section 14 is an image capturing device (i.e., a camera) for capturing an image of an object. The image capturing section 14 can be any existing camera that is typically mounted on the smartphone 1. Note that the image capturing section 14 can be one that captures a still image such as a photograph, one that captures a video image such as a moving image, or one that can capture both a still image and a video image. The image capturing section 14 is controlled by the image obtaining section 22 to capture an image of an object. The image capturing section 14 transmits a captured still image and/or a captured video image to the image obtaining section 22.
The storage section 15 is a storage device that stores various data to be used in the smartphone 1. As illustrated in
The joining condition storage section 31 stores the joining condition that the condition determining section 24 uses for determining whether or not to join extracted lines. The joining condition storage section 31 of Embodiment 1 includes at least the joining conditions (1) through (3). The translation data storage section 33 stores various data that the translation section 26 uses for translating the extracted line(s) and the extracted-and-joined line(s). Specifically, the translation data storage section 33 stores, for example, dictionary data (e.g., English-Japanese dictionary data) used for translating words, collocations, and idioms included in a character string, and grammatical rules of both an original language to be translated and a language into which the original language is to be translated.
The following description will discuss, with reference to
For this reason, the condition determining section 24 of Embodiment 1 determines whether or not the extracted lines 61 and 62 meet the joining conditions (1) through (3). In the example illustrated in
As illustrated in (a) of
As illustrated in (c) of
The following description will discuss, with reference to
First, the image obtaining section 22 obtains an image (S1). Here, the image obtaining section 22 obtains an image by, for example, causing the image capturing section 14 to capture an image of the surroundings of the smartphone 1. The image obtaining section 22 supplies the image thus obtained to the character string extracting section 23. Assume that this image includes a character string composed of a plurality of lines. The character string extracting section 23 then extracts, on the per-line basis, a character string included in the image (S2). The character string extracting section 23 supplies information that indicates lines thus extracted (extracted lines) to the condition determining section 24. The condition determining section 24 then determines whether or not the extracted lines meet the joining condition (S3). Specifically, the condition determining section 24 determines whether or not two consecutive lines in the image obtained by the image obtaining section 22 meet the joining condition. In a case where the joining condition is met (YES in S4), the extracted line joining section 25 joins the two consecutive lines in the image (S6). Specifically, the extracted line joining section 25 joins the two lines that are supplied from the condition determining section 24 and that meet the joining condition, thereby generating an extracted-and-joined line. The extracted line joining section 25 then supplies, as an extracted line to be subject to determination, the extracted-and-joined line to the condition determining section 24. In contrast, in a case where the joining condition is not met (NO in S4), the condition determining section 24 does not supply the two lines to the extracted line joining section 25, skipping the step S6.
In a case where the condition determining section 24 has not completed the determination for all the extracted lines (NO in S7), the condition determining section 24 returns to the step S4 and performs the process from the steps S4 through S6 for other two consecutive lines that have not yet been subjected to the determination. In a case where the condition determining section 24 has completed the determination for all the extracted lines (YES in S7), the condition determining section 24 supplies the above extracted-and-joined line(s) and extracted line(s) to the translation section 26. The translation section 26 then translates the character string (S8). Specifically, the translation section 26 translates the extracted line(s) and the extracted-and-joined line(s) each supplied from the condition determining section 24, on the basis of translation data read out from the translation data storage section 33. The translation section 26 then supplies a translated character string that is a translation result of the extracted line(s) and the extracted-and-joined line(s), to the display control section 27. Lastly, the display control section 27 causes the translated character string to be displayed (S9). Specifically, upon receipt of the translated character string from the translation section 26, the display control section 27 causes the display section 12 to display the translated character string in the form of an image.
The following description will discuss Embodiment 2 of the present invention with reference to
The separation condition indicates an exception of the two consecutive lines that meet the joining condition. That is, the separation condition is a condition for leaving, as unjoined lines, the two consecutive lines that meet the joining condition but are likely to have different sentences, respectively. The condition determining section 24 supplies, to an extracted line joining section 25, the two consecutive extracted lines that have been determined to meet the joining condition but not to meet the separation condition. The extracted line joining section 25 then joins the two consecutive extracted lines that meet the joining condition but do not meet the separation condition.
Specifically, the separation condition is based on at least one of (i) characteristics of characters constituting the two consecutive lines and (ii) a positional relationship between the two consecutive lines. The separation condition indicates that the two consecutive lines are likely to have different sentences, respectively. The following conditions (4) to (7) are examples of the separation condition: (4) In an image obtained by the image obtaining section 22, a difference in character size between two consecutive lines exceeds a predetermined threshold (character size threshold). (5) A distance between the two consecutive lines exceeds a predetermined threshold (distance threshold). (6) The two consecutive lines differ from each other in color of characters. (7) Positions of respective initial characters of the two consecutive lines are different from each other in a line direction of a character string, by more than a predetermined threshold (character position threshold).
The condition determining section 24 of Embodiment 2 reads out the separation conditions (4) through (7) from the separation condition storage section 32, which will be later described, and determines whether or not the two consecutive lines meet at least any one of the separation conditions (4) through (7). For this purpose, the condition determining section 24 of Embodiment 2 further includes: (i) a function of identifying sizes of characters constituting the two consecutive lines to determine whether or not a difference in character size between the two consecutive lines exceeds the character size threshold; (ii) a function of identifying a distance between the two consecutive lines to determine whether or not the distance exceeds the distance threshold; (iii) a function of identifying colors of characters constituting the two consecutive lines to determine whether or not the two consecutive lines differ from each other in color of characters; and (iv) a function of identifying positions of respective initial characters of the two consecutive lines to determine whether or not the positions of the respective initial characters are different from each other in a line direction of a character string, by more than the character position threshold. Note that the separation condition is not limited to the above conditions, and can be any condition that is based on (i) characteristics of characters constituting two consecutive lines of a character string included in an image obtained by the image obtaining section 22 or (ii) a positional relationship between the two consecutive lines, and that indicates that the two consecutive lines are likely to have different sentences, respectively. Note also that the functions of the condition determining section 24 are not limited to the above functions, and can be any functions corresponding to the separation condition.
The following description will discuss, with reference to
In such a case, the condition determining section 24 further determines whether or not the extracted lines 64 and 65 meet the separation conditions (4) through (7). In the example illustrated in
A character string 55 included in an image 45 illustrated in (a) of
The following description will discuss, with reference to
According to the smartphone 1 of Embodiment 2, in a case where the joining condition is met (YES in S4), the condition determining section 24 further determines whether or not the two consecutive lines meet the separation condition (S5). In a case where the separation condition is not met (NO in S5), the condition determining section 24 supplies the two consecutive lines to the extracted line joining section 25. The extracted line joining section 25 then joins the two consecutive lines in the image (S6). Specifically, the extracted line joining section 25 joins the two consecutive lines which are supplied from the condition determination section 24 and which meet the joining condition but do not meet the separation condition, thereby generating an extracted-and-joined line. In contrast, in a case where the joining condition is not met (NO in S4), the condition determination section 24 does not supply the two consecutive lines to the extracted line joining section 25, skipping the steps S5 and S6. In a case where the separation condition is met (YES in S5), the condition determining section 24 does not supply the two consecutive lines to the extracted line joining section 25, skipping the step S6.
The following description will discuss Embodiment 3 of the present invention with reference to
An image 95 illustrated in (c) of
As described above, values for determination on a distance between two consecutive lines and on positions of respective initial characters of the two consecutive lines are set in accordance with character size. This makes it possible to reduce the possibility of erroneous determination.
[Software Implementation Example]
Control blocks of the smartphone 1 (particularly, the operation identifying section 21, the image obtaining section 22, the character string extracting section 23, the condition determining section 24, the extracted line joining section 25, the translation section 26, and the display control section 27) can be realized by a logic circuit (hardware) provided in an integrated circuit (IC chip) or the like or can be alternatively realized by software as executed by a central processing unit (CPU).
In the latter case, the smartphone 1 includes a CPU that executes instructions of a program that is software realizing the foregoing functions; a read only memory (ROM) or a storage device (each referred to as “storage medium”) in which the program and various kinds of data are stored so as to be readable by a computer (or a CPU); and a random access memory (RAM) in which the program is loaded. An object of the present invention can be achieved by a computer (or a CPU) reading and executing the program stored in the storage medium. Examples of the storage medium encompass “a non-transitory tangible medium” such as a tape, a disk, a card, a semiconductor memory, and a programmable logic circuit. The program can be supplied to the computer via any transmission medium (such as a communication network or a broadcast wave) which allows the program to be transmitted. Note that the present invention can also be achieved in the form of a computer data signal in which the program is embodied via electronic transmission and which is embedded in a carrier wave.
[Main Points]
A translation device (smartphone 1) of Aspect 1 of the present invention is a translation device that translates a character string included in a captured image, the translation device including: a character string extracting section (character string extracting section 23) for extracting, on a per-line basis, the character string composed of a plurality of lines; a determining section (condition determining section 24) for determining whether or not two consecutive lines in the captured image meet a joining condition that is based on a characteristic of a language of the character string, the two consecutive lines being included in lines extracted by the character string extracting section; and a translating section (extracted line joining section 25 and translation section 26), in a case where the determining section determines that the joining condition is met, the translating section joining and then translating the two consecutive lines, and in a case where the determining section determines that the joining condition is not met, the translation section translating the two consecutive lines, separately.
According to the above configuration, in a case where the two consecutive lines meet the joining condition, they are joined and then translated. In contrast, in a case where the two consecutive lines do not meet the joining condition, they are translated separately. This makes it possible to prevent a plurality of lines that should be essentially translated as a single sentence from being translated as different sentences, in a case where the joining condition is based on a characteristic of a language of a character string and indicates that a line break between two consecutive lines is likely to be put in the middle of a sentence. Further, in a case where the joining condition is based on a characteristic of a language of a character string and indicates that a line break between two consecutive lines is likely to be put in the middle of a sentence, a plurality of lines that should be translated essentially as a single sentence can be correctly translated as a single sentence even if the character string has no mark, such as a punctuation, that separates sentences. This makes it possible to provide a translation device that can accurately translate a character string composed of a plurality of lines.
In Aspect 2 of the present invention, a translation device is arranged such that, in Aspect 1 of the present invention, the language of the character string is English; the joining condition includes: a first condition that a latter line of the two consecutive lines has a lower-case character as an initial character; a second condition that a former line of the two consecutive lines has a last word whose word class is a conjunction, a preposition, or an article; and a third condition that the latter line of the two consecutive lines is composed only of upper-case characters; and the determining section determines whether or not at least any one of the first to third conditions of the joining condition is met.
According to the above configuration, in a case where the character string is written in English, whether or not the two consecutive lines meet the joining condition is determined. Specifically, in a case where a latter line in the order of extraction of the two consecutive lines has a lower-case character as an initial character, a sentence starting from a former line in the order of extraction of the two consecutive lines is possibly continuing in the latter line, and therefore it is determined that the former line and the latter line should be joined. In a case where the former line has a last word whose word class is a conjunction, a preposition, or an article, the sentence starting from the former line is possibly continuing in the latter line, and therefore it is determined that the former line and the latter line should be joined. Even in a case where the latter line has an upper-case character as the initial character, the sentence starting from the former line is possibly continuing in the latter line if the latter line is composed only of upper-case characters. In this case, it is therefore determined that the former line and the latter line should be joined. This allows a character string written in English to be translated on a per-sentence basis, achieving accurate translation of a character string composed of a plurality of lines written in English.
In Aspect 3 of the present invention, a translation device is arranged such that, in Aspect 1 or 2 of the present invention, the determining section further determines whether or not a separation condition is met, the separation condition being based on at least either characteristics of characters constituting the two consecutive lines or a positional relationship between the two consecutive lines; and in a case where the separation condition and the joining condition are met, the translating section translates the two consecutive lines, separately.
According to the above configuration, even in a case where two consecutive lines meet the joining condition, the two consecutive lines will not be joined to each other if the two consecutive lines that meet the separation condition, which is based on the characteristics of the characters constituting the two consecutive lines or the positional relationship between the two consecutive lines. That is, in a case where the characteristics of the characters or the positional relationship (separation condition) indicates that the two consecutive lines are likely to have different sentences, respectively, the two consecutive lines that are likely to have different sentences, respectively, can be correctly translated as different sentences even if they meet the joining condition. This allows more accurate translation of a character string composed of a plurality of lines.
In Aspect 4 of the present invention, a translation device is arranged such that, in Aspect 3 of the present invention, the separation condition includes a fourth condition that a difference in character size between the two consecutive lines exceeds a predetermined character size threshold; a fifth condition that a distance between the two consecutive lines exceeds a predetermined distance threshold; a sixth condition that the two consecutive lines differ from each other in color of characters; and a seventh condition that positions of respective initial characters of the former line and the latter line of the two consecutive lines are different from each other in a line direction of the character string, by more than a predetermined character position threshold; and the determining section determines whether or not at least any one of the fourth to seventh conditions of the separation condition is met.
According to the above configuration, in a case where the two consecutive lines greatly differ from each other in character size, the two consecutive lines are likely to have different sentences, respectively. Similarly, in a case where the two consecutive lines are at a distance from each other which distance is not less than a predetermined distance, the two consecutive lines are likely to have different sentences, respectively. Similarly, in a case where the two consecutive lines differ from each other in color of characters, the two consecutive lines are likely to have different sentences, respectively. Similarly, in a case where positions of respective initial characters of the two consecutive lines are different from each other by not less than a predetermined value, the two consecutive lines are likely to have different sentences, respectively. As such, a character string composed of a plurality of lines can be more accurately translated by leaving two consecutive lines unjoined in a case where the two consecutive lines meet the above condition, i.e., the condition indicating that the two consecutive lines are likely to have different sentences, respectively.
In Aspect 5 of the present invention, a translation device is arranged to further include, in Aspect 4 of the present invention, a character size determining section (condition determination section 24) for determining character sizes of lines extracted by the character string extracting section, the determining section determining the predetermined distance threshold and the predetermined character position threshold in accordance with the character sizes determined by the character size determining section.
According to the above configuration, each value for determination on a distance between the two consecutive lines and on a difference between positions of respective initial characters of the two consecutive lines is determined based on character sizes of the lines extracted. An increase in character size of a line included in a character string typically increases a distance between two consecutive lines and a difference between positions of respective initial characters of two consecutive lines. That is, in a case where each value for determination on the distance and on the difference is constant regardless of character size, two consecutive lines that should be essentially determined not to meet the separation condition may be erroneously determined to meet the separation condition when the character size is larger. It is possible to reduce the possibility of such erroneous determination, by setting each value for determination on a distance between two consecutive lines and on a difference between positions of respective initial characters of the two consecutive lines, in accordance with character size.
The translation device of the foregoing embodiments of the present invention can be realized by a computer. In such a case, the scope of the present invention encompasses: a control program for the translation device which program causes a computer to operate as the foregoing sections of the translation device so that the translation device can be realized by the computer; and a computer-readable storage medium storing the program.
The present invention is not limited to the embodiments above, but can be altered by a skilled person in the art within the scope of the claims. An embodiment based on a proper combination of technical means disclosed in different embodiments is encompassed in the technical scope of the present invention. Furthermore, the technical means disclosed in different embodiments can be combined to form a novel technical feature.
The present invention is applicable to a translation device that translates a character string included in a captured image, and is particularly suitable for a smartphone, a tablet terminal, a digital camera, and the like.
Number | Date | Country | Kind |
---|---|---|---|
2013-246529 | Nov 2013 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2014/071786 | 8/20/2014 | WO | 00 |