A translation method, electronic device, and readable storage medium

By selecting multiple translation areas on the shooting interface and selecting different languages ​​for translation, multi-region and multi-language translation of a single picture is realized, solving the problem that multi-region and multi-language translation cannot be achieved in the existing technology, and improving the Translation flexibility and user experience.

CN112149431BActive Publication Date: 2024-11-15SHANGHAI TRANSSION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010951697.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-11
Publication Date
2024-11-15
Estimated Expiration
2040-09-11

AI Technical Summary

Technical Problem

The prior art cannot realize multi-regional multi-lingual translation of a single picture, and cannot display the translation results of multiple different languages ​​at the same time.

Method used

By obtaining pictures of the shooting interface, receiving selected instructions to select multiple translation areas, and selecting different languages ​​for each area for translation, displaying the translated text, supporting multiple selection of different translation areas, realizing multiple translation areas multilingual display.

Benefits of technology

It allows users to select multiple pictures taken by a single picture, and realizes the simultaneous display of multiple different languages, solving the problem that a single picture cannot achieve multi-region and multi-language translation, and improving the flexibility and user experience of translation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112149431B_ABST
    Figure CN112149431B_ABST
Patent Text Reader

Abstract

The present application discloses a translation method, an electronic device, and a readable storage medium. The method comprises: obtaining at least one picture of a shooting interface; receiving a first selection instruction, selecting a first translation area from the picture, and translating the first translation area into a first language; receiving a second selection instruction, selecting a second translation area from the picture, and translating the second translation area into a second language; the picture displays the first translation area translated into the first language and the second translation area translated into the second language. The present application supports users to select multiple translation areas from a picture, and select a language for each translation area for translation, thereby enabling multi-region and multi-language translation of a single shot picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of translation and electronic equipment, and in particular to a translation method, electronic equipment, and a readable storage medium. Background Art

[0002] With the continuous development of intelligent mobile communications, the convenience and importance of camera translation functions in people's work and life are becoming more and more prominent for electronic devices such as smart phones, tablets, and smart translators. The so-called camera translation refers to calling the camera function to take a picture, then identifying the text content in the picture and translating the text content.

[0003] In some implementations, a single shot image usually only supports the user to drag the selection box once, that is, the text content to be translated can only be selected once, so other text content in the single shot image cannot be selected and translated, and of course, simultaneous display of multiple languages ​​cannot be achieved.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the invention

[0005] In view of this, the present application provides a translation method, an electronic device, and a readable storage medium to solve the problem that a single photograph cannot achieve multi-region and multi-language translation.

[0006] A translation method provided by the present application comprises:

[0007] Get at least one picture of the shooting interface;

[0008] receiving a first selection instruction, selecting a first translation region from the image, and translating the first translation region into a first language;

[0009] receiving a second selection instruction, selecting a second translation region from the image, and translating the second translation region into a second language;

[0010] The image shows a first translation region translated into a first language and a second translation region translated into a second language.

[0011] Optionally, when selecting a first translation area from the image and / or selecting a second translation area from the image, the translation method includes:

[0012] At least one language is displayed on the shooting interface.

[0013] Optionally, the method of selecting different translation regions multiple times includes:

[0014] Firstly, the first translation region and the second translation region are selected, and then the first translation region and the second translation region are translated; or,

[0015] First, the first translation region is selected and translated into a first language, and then the second translation region is selected and translated into a second language.

[0016] Optionally, the picture displays a first translation region translated into a first language and a second translation region translated into a second language simultaneously or successively.

[0017] Optionally, the first translation region and the second translation region do not overlap, or at least partially overlap.

[0018] Optionally, the translation method further includes:

[0019] Setting a background pattern for the first translation area and the second translation area, wherein optionally, the background patterns of the first translation area and the second translation area are different;

[0020] The picture displays a first translation area translated into a first language and a second translation area translated into a second language, including: displaying the first translation area and the second translation area and the translated languages ​​and background patterns on a shooting interface.

[0021] Optionally, acquiring at least one picture of the shooting interface includes:

[0022] Acquire multiple pictures of the shooting interface, wherein the multiple pictures include at least two pictures with different shooting parameters; and

[0023] Performing image synthesis processing on the multiple images to obtain one image and translating the image, or translating the multiple images.

[0024] Optionally, the acquiring of multiple images of the shooting interface, the translation method further includes:

[0025] Identify the text content of each translation area of ​​the plurality of images and translate them into the corresponding language;

[0026] Optionally, a synchronous or asynchronous multi-thread mechanism is used to identify the text content of each translation area of ​​the plurality of images, and translate them into a language of a corresponding language;

[0027] The translation area and translated language of each picture are displayed on the shooting interface.

[0028] The present application provides an electronic device, including a memory and a processor, wherein the memory stores a program for executing any one of the above-mentioned translation methods when executed by the processor.

[0029] The present application provides a readable storage medium storing a program, which can be used to perform any of the above-mentioned translation methods when executed by a processor.

[0030] This application supports users to select multiple translation areas from a picture, and select a language for translation for each translation area, allowing users to make multiple selections for a single picture. When the languages ​​of each translation area are different, multiple different languages ​​can be displayed. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0032] Figure 1 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present application;

[0033] Figure 2 A communication network system architecture diagram provided for an embodiment of the present application;

[0034] Figure 3 is a flowchart of a translation method according to an embodiment of the present application;

[0035] Figure 4 This is a schematic diagram of the interface of the selected translation area of ​​this application;

[0036] Figure 5 is a flowchart of a translation method according to another embodiment of the present application;

[0037] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application.

[0038] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The above-mentioned drawings have shown clear embodiments of this application, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0040] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.

[0041] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of..." or "when..." or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate that there are described features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, “A, B, or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will occur only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.

[0042] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0043] It should be noted that, in this article, step codes such as S11, S12, etc. are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the sequence. When implementing it specifically, those skilled in the art may execute S12 first and then S11, etc., but these should all be within the scope of protection of this application.

[0044] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0046] The electronic device may be implemented in various forms. For example, the electronic device described in this application may include mobile electronic devices such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed electronic devices such as digital TVs and desktop computers.

[0047] The following description will be made by taking mobile electronic devices as an example, and those skilled in the art will understand that, in addition to components specifically used for mobile purposes, the construction according to the embodiments of the present application can also be applied to fixed-type electronic devices.

[0048] See also Figure 1, which is a schematic diagram of the hardware structure of a mobile electronic device for implementing various embodiments of the present application, the mobile electronic device 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, A / V (audio / video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111 and other components. Those skilled in the art can understand that Figure 1 The structure of the mobile electronic device 100 shown in the figure does not constitute a limitation on the mobile electronic device 100. The mobile electronic device 100 may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0049] Combine the following Figure 1 The various components of the mobile electronic device 100 are introduced in detail:

[0050] The radio frequency unit 101 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving the downlink information of the base station, it is sent to the processor 110 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 101 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 101 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution) and TDD-LTE (Time Division Duplexing-Long Term Evolution), etc.

[0051] WiFi is a short-range wireless transmission technology. The mobile electronic device 100 can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile electronic device 100 and can be omitted as required without changing the essence of the invention.

[0052] The audio output unit 103 can convert the audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile electronic device 100 is in a call signal receiving mode, a talk mode, a recording mode, a voice recognition mode, a broadcast receiving mode, etc. Moreover, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile electronic device 100 (e.g., a call signal receiving sound, a message receiving sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.

[0053] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processor (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a telephone call mode, a recording mode, a voice recognition mode, and other operating modes, and can process such sound into audio data. The processed audio (voice) data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 can implement various types of noise elimination (or suppression) algorithms to eliminate (or suppress) noise or interference generated in the process of receiving and sending audio signals.

[0054] The mobile electronic device 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile electronic device 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can also be configured on the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0055] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0056] The user input unit 107 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the mobile electronic device 100. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch panel 1071), and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact point coordinates, and then sends it to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc., which are not specifically limited here.

[0057] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile electronic device. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile electronic device 100, which is not limited here.

[0058] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile electronic device 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile electronic device 100 or may be used to transmit data between the mobile electronic device 100 and an external device.

[0059] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0060] The processor 110 is the control center of the mobile electronic device 100. It uses various interfaces and lines to connect various parts of the entire mobile electronic device 100. By running or executing software programs and / or modules stored in the memory 109 and calling data stored in the memory 109, it performs various functions of the mobile electronic device 100 and processes data, thereby monitoring the mobile electronic device 100 as a whole. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.

[0061] The mobile electronic device 100 may also include a power source 111 (such as a battery) for supplying power to various components. Preferably, the power source 111 may be logically connected to the processor 110 via a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system.

[0062] although Figure 1 Not shown, the mobile electronic device 100 may also include a Bluetooth module, etc., which will not be described in detail here.

[0063] To facilitate understanding of the embodiments of the present application, the communication network system on which the mobile electronic device 100 of the present application is based is described below.

[0064] See also Figure 2 , Figure 2 A communication network system architecture diagram is provided for an embodiment of the present application, wherein the communication network system is an LTE system of universal mobile communication technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are connected in sequence for communication.

[0065] Specifically, UE201 may be the above-mentioned mobile electronic device 100, which will not be described in detail here.

[0066] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 , etc. Among them, eNodeB 2021 can be connected to other eNodeBs 2022 through a backhaul (eg, an X2 interface), and eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 can provide UE 201 with access to EPC 203 .

[0067] EPC203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, PGW (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function) 2036, etc. Among them, MME2031 is a control node that processes signaling between UE201 and EPC203, and provides bearer and connection management. HSS2032 is used to provide some registers to manage functions such as home location register (not shown in the figure), and save some user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, which selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).

[0068] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem) or other IP services.

[0069] Although the above introduction takes the LTE system as an example, those skilled in the art should know that the present application is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems, etc., which are not limited here.

[0070] Based on the hardware structure of the mobile electronic device 100 and the communication network system, various embodiments of the present application are proposed.

[0071] Figure 3The so-called translation method is also called a photography-based translation method or a photography translation method, that is, a method for translating text content in a photographed image. Figure 3 The method described may be performed by Figure 1 The electronic device described is not limited in the embodiments of the present application.

[0072] Different from the traditional shooting function that can be realized only by the camera, the shooting translation method of the embodiment of the present application needs to rely on both shooting and translation functions, for example, it can be realized by an APP (Application) that integrates these two functions.

[0073] See also Figure 3 , the translation method includes the following steps S11 to S14.

[0074] S11: Acquire at least one picture of the shooting interface.

[0075] The shooting interface can be regarded as the camera's framing interface, which captures different objects or backgrounds as the camera moves. For example, after detecting that an app with integrated shooting and translation functions is started, the real scene captured by the camera in real time is used as the shooting interface, and the shooting interface can be displayed in real time (e.g., full screen) on the screen of the electronic device.

[0076] When detecting a user's instruction to shoot, such as pressing a shutter button (a virtual shooting button on a mobile phone), the electronic device responds to the instruction and images the current shooting interface as a picture.

[0077] The electronic device can obtain one or more pictures of the shooting interface through the continuous shooting function, and the shooting parameters used when shooting these pictures can be the same or different, and there is no restriction. The shooting parameters include but are not limited to exposure, focus parameters, white balance parameters, etc.

[0078] S12: receiving a first selection instruction, selecting a first translation region from the image, and translating the first translation region into a first language.

[0079] S13: receiving a second selection instruction, selecting a second translation region from the image, and translating the second translation region into a second language.

[0080] See also Figure 4 The screen of the electronic device (on the shooting interface) may display a selection box 20 in real time, and each instruction issued by the user (such as the first selection instruction and the second selection instruction) may specifically include dragging the selection box 20 and / or adjusting the size of the selection box 20. The area selected by the selection box 20 is the first translation area and the second translation area.

[0081] In order to more clearly mark each translation area for the convenience of the user, after each translation area is selected, the electronic device can freeze the selection frame 20 on the single picture. Figure 4 As shown, according to the first selection instruction, the electronic device freezes the selection box 20 and uses it as the first selection box 21, and the area selected by the first selection box 21 is the first translation area; according to the second selection instruction, the electronic device freezes the selection box 20 and uses it as the second selection box 22, and the area selected by the second selection box 22 is the second translation area.

[0082] Optionally, the first translation region and the second translation region may partially overlap or completely overlap, or may not overlap, for example, Figure 4 As shown, the first selection frame 21 identifying the first translation area and the second selection frame 22 identifying the second translation area do not overlap.

[0083] When each translation area is selected, the electronic device may display at least one language on the shooting interface, and then select a language as the language to be translated in the translation area in response to the user's instruction. Considering the limited screen size and the fact that displaying more languages ​​will affect the selection operation, it is not practical to display all of them, and it will also affect the user's viewing experience. Therefore, the sidebar may only display a predetermined number of languages, such as Figure 4 As shown, only one language, "Chinese", is displayed, and languages ​​exceeding the predetermined number are hidden in a predetermined order. The user can display the hidden languages ​​by touching back and forth with a finger in the arrangement order.

[0084] While displaying the sidebar, the electronic device can automatically identify the language of the text content in the selected frame 20 and display it in the sidebar, for example Figure 4 As shown, if the language in the selected box 20 is identified as English, the sidebar can display "English Chinese…".

[0085] The languages ​​selected by the electronic device for each translation area according to the user instruction can be the same or different. Then, the electronic device identifies the text content of each translation area and translates the text content of each translation area into a translation text of the corresponding language. The text content in the first translation area and the second translation area are translated into the first language and the second language respectively.

[0086] In a specific implementation, the order of selecting different translation regions and performing translation multiple times is not limited in the present embodiment. Taking the above two selections of translation regions and translations as an example:

[0087] In one implementation, the electronic device may first select a first translation area and a second translation area, and then translate the text contents in the first translation area and the second translation area.

[0088] In another implementation, a first translation region is selected first, and the first translation region is translated into a first language, and then a second translation region is selected, and the second translation region is translated into a second language.

[0089] Regardless of which implementation method is adopted, any selection instruction is generated by at least two operations, one of which is used to select a translation area, and the other is used to select a language. For example, a first selection instruction may be generated by two operations, one of which is used to select a first translation area, and the other is used to select a first language to be translated for the first translation area; a second selection instruction may be generated by two operations, one of which is used to select a second translation area, and the other is used to select a second language to be translated for the second translation area.

[0090] S14: The picture displays a first translation region translated into the first language and a second translation region translated into the second language.

[0091] The picture (shooting interface or electronic device screen) can simultaneously display or sequentially display a first translation area translated into the first language and a second translation area translated into the second language.

[0092] The translated text, i.e. the first language and the second language, can be displayed on the side of the respective selection box 20. Figure 4 As shown in the example, the text content in the first translation area is "I have a great news today", and the first language "I have a very good news today" is displayed in the form of a pop-up window (or dialog box) above the first selection box 21; after the translation is completed, the text content in the second translation area is "I'll keep it a secret. I'll tell you later.", and the second language "I'll keep it a secret and tell you later" is displayed in the form of a pop-up window below the second selection box 22. Optionally, the electronic device allows the user to drag each selection box and thereby change the position of each translated text (pop-up window) on the electronic device screen. Here, the embodiment of the present application can allow the user to change the position of the first translation area translated into the first language and the second translation area translated into the second language on the electronic device screen.

[0093] In one implementation, the electronic device can set a background pattern for each translation area (translation text), including but not limited to any combination of graphics and colors. The background patterns of each translation area are different, or the background patterns of different languages ​​are different, while the background patterns of the same language are the same. Then, the electronic device displays the translation texts and background patterns of multiple translation areas on the shooting interface at the same time. In this way, the user can distinguish and read intuitively and quickly.

[0094] Based on the foregoing, it can be seen that the embodiments of the present application allow the user to make multiple selections for a single-shot picture. When the languages ​​of the various areas to be translated are different, multiple languages ​​can be displayed simultaneously, that is, multi-area and multi-language translation of a single-shot picture can be achieved.

[0095] In the embodiment of the present application, the clarity of the image directly affects the accuracy of text recognition. To this end, the electronic device can obtain multiple images by a single shot, and then perform a clearing process on these images, and finally obtain the clearest image. To distinguish them from the final image, the multiple images obtained by a single shot are referred to as candidate images herein.

[0096] In one embodiment, the electronic device can obtain multiple candidate images of the shooting interface through the continuous shooting function, and the camera uses different shooting parameters when shooting these candidate images, and the shooting parameters include but are not limited to exposure, focus parameters, white balance parameters, etc. Then, these candidate images are synthesized to obtain the clearest image.

[0097] The method of image synthesis processing is as follows: first, the contours of the objects in the candidate images are extracted, and the candidate images are aligned according to the contours of the objects so that the same object is imaged at the same position. Then, the candidate images are gray-scale processed and enhanced, so as to select the one with the clearest and sharpest contour of the object imaging from the candidate images (hereinafter referred to as the basic image), and find the part of the basic image where the contour of the object imaging is not clear, and then traverse each candidate image to search in other candidate images to obtain the clearest and sharpest part of the object imaging contour, and synthesize it onto the basic image to obtain the clearest image.

[0098] In another implementation, the electronic device can obtain multiple candidate images of the shooting interface through the continuous shooting function, and the shooting parameters used by the camera when shooting these candidate images can also be different, and then the image with the highest definition is selected from these candidate images.

[0099] Through the above, even if the picture is blurred due to inaccurate focus or uneven ambient light, this embodiment can still improve the clarity of the picture, which is beneficial to ensure the accuracy of text content recognition and the quality of shot translation.

[0100] Of course, when multiple pictures are taken in step S11, the embodiment of the present application can use the aforementioned translation method to translate the multiple pictures separately.

[0101] The existing photography translation technology usually only supports the translation of a single picture. That is, it only supports the translation of a single picture. It is not possible to translate multiple pictures simultaneously. To solve this problem, the present application provides the following Figure 5 The method shown.

[0102] Figure 5 is a flowchart of a translation method according to another embodiment of the present application. Figure 5 As shown, the shooting and translation method includes the following steps S21 to S25.

[0103] S21: Acquire multiple images of the same shooting interface.

[0104] The electronic device can obtain multiple pictures of the shooting interface through the continuous shooting function, and the shooting parameters used by the camera when shooting these pictures can be the same or different, and there is no restriction. The shooting parameters include but are not limited to exposure, focus parameters, white balance parameters, etc.

[0105] Any of these pictures can be obtained by performing picture synthesis processing on a plurality of candidate pictures. The method of synthesizing a single picture can refer to the description of the aforementioned embodiment.

[0106] S22: Select a translation area for each image.

[0107] During the continuous shooting process of the electronic device, the position of the camera remains basically unchanged, and the framing range presented in the same shooting interface also remains basically unchanged. Therefore, the electronic device can automatically divide the shooting interface into regions, and the same region of the shooting interface corresponds to the same region of these pictures.

[0108] The number of areas divided by the electronic device on the shooting interface can be equal to the number of pictures. At this time, each picture corresponds to a translation area. The translation areas of these pictures can partially overlap or be set adjacent to each other, but together cover the entire shooting interface. In this way, the electronic device can recognize all text content in the picture without omission.

[0109] Of course, the electronic device can select multiple translation areas for each picture, and similarly, all the translation areas of these pictures together cover the entire shooting interface.

[0110] S23: Select the language to be translated for each translation area.

[0111] The electronic device can set the corresponding language for each divided area before shooting, and then automatically select the corresponding language according to the pre-set setting. Figure 3 The described method selects a language for each translation region.

[0112] S24: Using an asynchronous multi-threading mechanism to identify the text content of each translation area of ​​multiple images, and translate them into translation texts in corresponding languages.

[0113] S25: Displaying the translation area and the translated language of each picture on the shooting interface.

[0114] This embodiment performs photography translation on multiple pictures. The same steps and operations of the previous and subsequent embodiments of this application are not repeated here. The differences are described below.

[0115] The so-called asynchronous multi-threading mechanism can be understood as: the translation of each image is executed by a corresponding task thread separately, and the translation of multiple images is carried out in parallel. The asynchronous multi-threading mechanism can be divided into two processes: one is asynchronous recognition, where multiple task threads recognize the text content of each image respectively; the other is asynchronous translation, where multiple task threads translate the text content of each recognized image respectively.

[0116] Based on this, the electronic device can translate the text content in a picture every time it successfully recognizes and extracts it. The pictures are recognized and translated asynchronously without affecting each other. The total time required for recognizing and translating multiple pictures is equal to the maximum time required for recognizing and translating a single picture, which can improve the translation efficiency.

[0117] Optionally, before uploading multiple pictures to the multi-threaded electronic device, if the data volume of these pictures is very large, in order to effectively transmit and store these pictures, the electronic device can perform image compression processing on these pictures, such as using pixel grayscale compression to reduce picture pixels, thereby compressing the data volume of pictures exceeding a predetermined resolution and saving storage space.

[0118] Figure 6 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 6 The electronic device 40 can be regarded as the aforementioned electronic device 100, including a processor 41, a memory 42 and a communication bus 43, and the communication bus 43 is used for connecting the processor 41 and the memory 42.

[0119] The processor 41 is the control center of the electronic device 40. It uses various interfaces and lines to connect various parts of the entire electronic device 40, executes various functions of the electronic device 40 and processes data by running or loading programs stored in the memory 42 and calling data stored in the memory 42, thereby monitoring the electronic device 40 as a whole.

[0120] Optionally, the processor 41 may load instructions corresponding to the processes of one or more programs into the memory 42 according to the following steps, and the processor 41 may run the programs stored in the memory 42, thereby implementing the method of any of the aforementioned embodiments.

[0121] The specific implementation of each step, that is, the specific content of the steps executed by the processor 41 calling the program can be referred to above, and will not be repeated here. Here, the electronic device 40 has the beneficial effects that can be achieved by the above method.

[0122] It should be understood that, when implemented in actual application scenarios, depending on the device type of the electronic device 40, the execution entities of the above steps may not be the processor 41 and the memory 42, but may be implemented by other modules and units respectively.

[0123] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded and executed by a processor to implement the steps in any translation method provided in the embodiment of the present application.

[0124] Optionally, the storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0125] Since the instructions stored in the storage medium can execute the steps in any translation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any translation method can be achieved. Please refer to the previous embodiments for details, which will not be repeated here.

[0126] In the embodiments of the electronic device and the readable storage medium provided in the present application, all the technical features of the embodiments of the above-mentioned translation method are included, and the expansion and explanation content of the specification are basically the same as those of the embodiments of the above-mentioned translation method, and will not be repeated here.

[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.

[0128] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

[0129] The present application also provides a mobile terminal device, which includes a memory and a processor. The memory stores a translation program, and when the translation program is executed by the processor, the steps of the translation method in any of the above embodiments are implemented.

[0130] The present application also provides a computer-readable storage medium, on which a translation program is stored. When the translation program is executed by a processor, the steps of the translation method in any of the above embodiments are implemented.

[0131] In the embodiments of the mobile terminal and computer-readable storage medium provided in the present application, all technical features of the embodiments of the above-mentioned translation method are included, and the expanded and explained contents of the specification are basically the same as those of the embodiments of the above-mentioned method, and will not be repeated here.

[0132] The embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer executes the methods in the above various possible implementation modes.

[0133] An embodiment of the present application also provides a chip, including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.

[0134] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The embodiments of the present application are intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and embodiments are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0135] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A translation method, It is characterized in that include: Get multiple pictures of the shooting interface through continuous shooting; Dividing the shooting interface into regions, the number of divided regions being equal to the number of pictures, and the same region of the shooting interface corresponding to the same region of the multiple pictures; Selecting a translation area for each picture, wherein each picture has at least one translation area, and all translation areas of the multiple pictures together cover the entire shooting interface; Selecting a language to be translated for each translation area, including: pre-setting a corresponding language for each divided area, selecting the corresponding language as the language to be translated for each translation area according to the pre-setting; or, receiving a first selection instruction, selecting a first translation area from the image, translating the first translation area into a first language, and receiving a second selection instruction, selecting a second translation area from the image, translating the second translation area into a second language, and the image displays the first translation area translated into the first language and the second translation area translated into the second language; Using an asynchronous multi-threading mechanism to identify the text content of each translation area of ​​the plurality of images, and translating them into translation texts in corresponding languages; The translation area and translated language of each picture are displayed on the shooting interface.

2. The translation method according to claim 1, It is characterized in that When a first translation area is selected from the picture and / or a second translation area is selected from the picture, the translation method includes: At least one language is displayed on the shooting interface.

3. The translation method according to claim 1, It is characterized in that Methods for selecting different translation regions multiple times include: Firstly, the first translation region and the second translation region are selected, and then the first translation region and the second translation region are translated; or, First, the first translation region is selected and translated into a first language, and then the second translation region is selected and translated into a second language.

4. The translation method according to claim 3, It is characterized in that The picture displays a first translation region translated into a first language and a second translation region translated into a second language simultaneously or successively.

5. The translation method according to claim 1, It is characterized in that The first translation region and the second translation region do not overlap, or at least partially overlap.

6. The translation method according to claim 1, It is characterized in that The translation method further comprises: Setting background patterns for the first translation area and the second translation area; The picture displays a first translation area translated into a first language and a second translation area translated into a second language, including: displaying the first translation area and the second translation area and the translated languages ​​and background patterns on a shooting interface.

7. An electronic device, It is characterized in that The invention comprises a memory and a processor, wherein the memory stores a program, and the program is used to execute the steps of the translation method according to any one of claims 1 to 6 when being executed by the processor.

8. A readable storage medium, It is characterized in that The readable storage medium stores a program, and the program is used to execute the steps of the translation method as described in any one of claims 1 to 6 when executed by a processor.