CN112149431A - Translation method, electronic device and readable storage medium - Google Patents

Translation method, electronic device and readable storage medium Download PDF

Info

Publication number
CN112149431A
CN112149431A CN202010951697.6A CN202010951697A CN112149431A CN 112149431 A CN112149431 A CN 112149431A CN 202010951697 A CN202010951697 A CN 202010951697A CN 112149431 A CN112149431 A CN 112149431A
Authority
CN
China
Prior art keywords
translation
picture
language
translation region
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010951697.6A
Other languages
Chinese (zh)
Inventor
黄江辰
杨里
陈俊升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Chuanying Information Technology Co Ltd
Original Assignee
Shanghai Chuanying Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Chuanying Information Technology Co Ltd filed Critical Shanghai Chuanying Information Technology Co Ltd
Priority to CN202010951697.6A priority Critical patent/CN112149431A/en
Publication of CN112149431A publication Critical patent/CN112149431A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a translation method, electronic equipment and a readable storage medium. The method comprises the following steps: acquiring at least one picture of a shooting interface; receiving a first selected instruction, selecting a first translation region from the picture, and translating the first translation region into a first language; receiving a second selected instruction, selecting a second translation region from the picture, and translating the second translation region into a second language; the picture displays a first translation region translated into a first language and a second translation region translated into a second language. The method and the device support the user to select a plurality of translation areas from the picture and select languages for each translation area to translate, and therefore multi-area and multi-language translation of a single picture can be achieved.

Description

Translation method, electronic device and readable storage medium
Technical Field
The present application relates to the field of translation and electronic device technologies, and in particular, to a translation method, an electronic device, and a readable storage medium.
Background
With the continuous development of intelligent mobile communication, the convenience and importance of the photographing and translating functions in the work and life of people are more and more highlighted for electronic equipment such as smart phones, tablet computers and intelligent translators. The picture taking and translation refers to calling a camera function to take a picture, identifying text content in the picture, and translating the text content.
In some implementations, a single shot picture usually only supports a user to drag a selection box once, that is, only one selection of text content to be translated can be realized, so that other text content in a single shot picture cannot be selected and translated, and certainly, simultaneous display of multiple languages cannot be realized.
The foregoing description is provided for general background information and is not admitted to be prior art.
Disclosure of Invention
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 shot picture cannot be translated in multiple regions and multiple languages.
The application provides a translation method, which comprises the following steps:
acquiring at least one picture of a shooting interface;
receiving a first selected instruction, selecting a first translation region from the picture, and translating the first translation region into a first language;
receiving a second selected instruction, selecting a second translation region from the picture, and translating the second translation region into a second language;
the picture displays a first translation region translated into a first language and a second translation region translated into a second language.
Optionally, when the first translation region is selected from the picture and/or the second translation region is selected from the picture, the translation method includes:
and displaying at least one language on the shooting interface.
Optionally, the method for selecting different translation regions multiple times includes:
firstly, selecting the first translation region and the second translation region, and then translating the first translation region and the second translation region; or the like, or, alternatively,
the first translation region is selected, the first translation region is translated into a first language, the second translation region is selected, and the second translation region is translated into a second language.
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 sequentially.
Optionally, the first translation region and the second translation region do not overlap, or at least partially overlap.
Optionally, the translation method further comprises:
setting a background pattern for the first translation region and the second translation region, wherein optionally, the background patterns of the first translation region and the second translation region are different;
the picture displays a first translation region translated into a first language and a second translation region translated into a second language, comprising: and displaying the first translation area, the second translation area, the translated language and the background pattern on a shooting interface.
Optionally, the acquiring at least one picture of the shooting interface includes:
acquiring a plurality of pictures of a shooting interface, wherein the plurality of pictures comprise at least two pictures with different shooting parameters; and
and carrying out picture synthesis processing on the plurality of pictures to obtain a picture and translating the picture, or translating the plurality of pictures.
Optionally, the obtaining multiple pictures of the shooting interface, the translation method further includes:
recognizing the text content of each translation area of the plurality of pictures, and translating the text content into languages of corresponding languages;
optionally, a synchronous or asynchronous multithreading mechanism is adopted to identify the text content of each translation region of the multiple pictures and translate the text content into a language of a corresponding language;
and displaying the translation area of each picture and the translated language on a shooting interface.
The electronic device provided by the application comprises a memory and a processor, wherein the memory stores programs, and the programs are used for executing any translation method when being executed by the processor.
The application provides a readable storage medium storing a program, which is operable to execute any one of the translation methods described above when executed by a processor.
The method and the device support the user to select a plurality of translation areas from the picture and select the languages for each translation area for translation, allow the user to select a single picture for multiple times, and can realize display of a plurality of different languages when the languages of each translation area are different.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic hardware structure diagram of an electronic device implementing various embodiments of the present application;
fig. 2 is a communication network system architecture diagram according to an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of a translation method according to an embodiment of the present application;
FIG. 4 is a schematic interface diagram of a selected translation region of the present application;
FIG. 5 is a schematic flow chart diagram of a translation method according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings. With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the recitation of an element by the phrase "comprising an … …" does not exclude the presence of additional like elements in the process, method, article, or apparatus that comprises the element, and further, where similarly-named elements, features, or elements in different embodiments of the disclosure may have the same meaning, or may have different meanings, that particular meaning should be determined by their interpretation in the embodiment or further by context with the embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning 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 way.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or at least partially with respect to other steps or sub-steps of other steps.
It should be noted that step numbers such as S11 and S12 are used herein for the purpose of more clearly and briefly describing the corresponding content, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform S12 first and then S11 in specific implementation, which should be within the scope of the present application.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning by themselves. Thus, "module", "component" or "unit" may be used mixedly.
The electronic device may be implemented in various forms. For example, the electronic devices described in the present application may include mobile electronic devices such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and fixed electronic devices such as a Digital TV, a desktop computer, and the like.
While the following description will be made taking a mobile electronic device as an example, those skilled in the art will appreciate that the configuration according to the embodiment of the present application can be applied to a fixed type electronic device in addition to elements particularly used for moving purposes.
Referring to fig. 1, which is a schematic diagram of a 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. Those skilled in the art will appreciate that the configuration of the mobile electronic device 100 shown in fig. 1 does not constitute a limitation of the mobile electronic device 100, and that the mobile electronic device 100 may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The various components of the mobile electronic device 100 are described in detail below with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, 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, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access2000 ), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi is a short-range wireless transmission technology, and the mobile electronic device 100 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 102, and provides the user with wireless broadband internet access. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile electronic device 100, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile electronic device 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile electronic device 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile electronic device 100 also includes at least one sensor 105, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or the backlight when the mobile electronic device 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs 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 referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two separate components to implement the input and output functions of the mobile electronic device, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile electronic device 100, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile electronic apparatus 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 having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices 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 external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile electronic device 100, connects various parts of the entire mobile electronic device 100 using various interfaces and lines, and performs various functions of the mobile electronic device 100 and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile electronic device 100. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile electronic device 100 may further include a power supply 111 (such as a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
Although not shown in fig. 1, the mobile electronic device 100 may further include a bluetooth module or the like, which is not described herein.
In order to facilitate understanding of the embodiments of the present application, a communication network system on which the mobile electronic device 100 of the present application is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present disclosure, where the communication Network system is an LTE system of a universal mobile telecommunications 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 IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the mobile electronic device 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present application is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the hardware structure of the mobile electronic device 100 and the communication network system, the embodiments of the present application are provided.
Fig. 3 is a flowchart illustrating a translation method according to an embodiment of the present application. The translation method is also called a translation method based on shooting or a shooting translation method, that is, a method for translating text contents in a shot picture. The execution subject of the method described in fig. 3 may be the electronic device described in fig. 1, and the embodiments of the present application are not limited thereto.
Unlike the conventional shooting function which can be realized only by a camera, the shooting translation method according to the embodiment of the present Application needs to rely on both shooting and translation functions, and may be realized by an APP (Application) that integrates the two functions, for example.
Referring to FIG. 3, the translation method includes the following steps S11-S14.
S11: and acquiring at least one picture of the shooting interface.
The shooting interface can be regarded as a view finding interface of the camera, and the shooting interface can capture different objects or backgrounds along with the movement of the camera. For example, after detecting that APP integrating the functions of shooting and translating is started, a real scene captured by a camera in real time serves as a shooting interface, and the shooting interface can be displayed on a screen of the electronic device in real time (for example, full screen).
When an instruction for determining photographing by a user, for example, pressing a photographing shutter (a virtual photographing button of a mobile phone) is detected, the electronic device images a current photographing interface as a picture in response to the instruction.
The electronic device can obtain one or more pictures of the shooting interface through the continuous shooting function, and shooting parameters adopted when the pictures are shot can be the same or different and are not limited. The photographing parameters include, but are not limited to, exposure, focus parameters, white balance parameters, and the like.
S12: receiving a first selected instruction, selecting a first translation region from the picture, and translating the first translation region into a first language.
S13: and receiving a second selected instruction, selecting a second translation region from the picture, and translating the second translation region into a second language.
Referring to fig. 4, a selection frame 20 may be displayed on the screen (on the shooting interface) of the electronic device in real time, and the instructions (e.g., the first selection instruction and the second selection instruction) issued by the user each time may be embodied as dragging the selection frame 20 and/or adjusting the size of the selection frame 20. The regions selected by the selection box 20 are the first translation region and the second translation region.
For a clearer identification of the respective translation regions for easy viewing by the user, the electronic device may freeze the selection box 20 on a single picture after each translation region is selected. Taking the example that the user selects two translation regions, and referring to fig. 4, according to the first selection instruction, the electronic device freezes the selection frame 20 and uses it as the first selection frame 21, and the region selected by the first selection frame 21 is the first translation region; according to the second selection instruction, the electronic device freezes the selection frame 20 and uses it as a second selection frame 22, and the area selected by the second selection frame 22 is the second translation area.
Alternatively, the first translation region and the second translation region may overlap partially or completely, or may not overlap, for example, as shown in fig. 4, both the first selection box 21 identifying the first translation region and the second selection box 22 identifying the second translation region do not overlap.
While each translation area is selected, the electronic equipment can display at least one language on the shooting interface, and then respond to a user instruction to select one language as the language to be translated in the translation area. Considering that the limited screen size and the displaying of more languages may affect the selection operation, if it is not practical to display all of them, and may also affect the viewing experience of the user, the sidebar may display only a predetermined number of languages, for example, only 1 language of "chinese" as shown in fig. 4, and the languages exceeding the predetermined number are hidden according to a predetermined sequence, and the user may display the hidden languages through the finger back-and-forth touch operation according to the arrangement sequence.
While the sidebar is displayed, the electronic device may automatically recognize the language of the text content in the selection box 20 and display it in the sidebar, such as shown in fig. 4, and recognize that the language in the selection box 20 is english, the sidebar may display "english
Figure BDA0002677184920000131
Chinese … ".
The languages selected by the electronic equipment for the translation areas according to the user instruction can be the same or different. Then, the electronic equipment 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 is translated into a first language and a second language respectively.
In a specific implementation, the order of selecting different translation regions and performing translation is performed multiple times, and the embodiments of the present application are not limited. The translation region is selected and translated twice as described above as an example:
in one implementation, the electronic device may select the first translation region and the second translation region, and then translate text contents in the first translation region and the second translation region.
In another implementation, a first translation region is selected, the first translation region is translated into a first language, a second translation region is selected, and the second translation region is translated into a second language.
In either implementation, any selected instruction is generated by at least two operations, one for selecting the translation region and the other for selecting the language. For example, the first selected instruction may be generated by two operations, wherein one operation is used to select the first translation region, and the other operation is used to select the first language to be translated for the first translation region; the second selected instruction may result from two operations, one for selecting the second translation region and the other for selecting the second language to be translated for the second translation region.
S14: the picture displays a first translation region translated into a first language and a second translation region translated into a second language.
The picture (the shooting interface or the screen of the electronic device) 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.
The translated text, i.e., the first language and the second language, after translation may be displayed on the sides of the respective selection boxes 20. Continuing with the example shown in fig. 4, the text content in the first translation area is "I have a great news today", and the first language "I have a very good message today" is displayed on top of the first selection box 21 in the form of a pop-up window (or dialog box); after the translation is completed, the text content in the second translation area is "I'll keep it a secret. I'll tell you" in the form of a popup displayed 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 screen of the electronic device, and herein, the embodiment of the present application can allow the user to change the position of the first translation region translated into the first language and the second translation region translated into the second language on the screen of the electronic device.
In one implementation, the electronic device may set a background pattern for (the translated text of) each translation region, including but not limited to any combination of graphics and colors. The background patterns of the translation areas are different, or the background patterns of different languages are different, and the background patterns of the same language are the same. Then, the electronic equipment simultaneously displays the translated text and the background pattern of the translation areas on the shooting interface. Therefore, the user can intuitively and quickly distinguish and read.
Based on the foregoing, the embodiment of the application allows a user to select a single shot picture for multiple times, and when the languages of the regions to be translated are different, simultaneous display of multiple different languages can be achieved, that is, multi-region and multi-language translation of a single shot picture can be achieved.
In the embodiment of the application, the definition of the picture directly influences the accuracy of text recognition. In this regard, the electronic device may obtain a plurality of pictures by a single shot, and then perform sharpening on the pictures to obtain the clearest picture. In order to distinguish from the one picture obtained finally, the multiple pictures obtained by taking a single picture are referred to as alternative pictures.
In an embodiment, the electronic device may obtain multiple candidate pictures of the shooting interface through a continuous shooting function, and shooting parameters adopted when the camera shoots the candidate pictures are different, where the shooting parameters include, but are not limited to, exposure, focusing parameters, white balance parameters, and the like. Then, the candidate pictures are subjected to picture synthesis processing to obtain the clearest picture.
The picture synthesis processing mode is as follows: the method comprises the steps of firstly extracting the outline of an object in alternative pictures, aligning the alternative pictures according to the outline of the object to enable the same object to be imaged on the same position, then carrying out gray processing and picture enhancement on the alternative pictures, selecting one of the alternative pictures with the clearest and sharpest object imaging outline (hereinafter referred to as a basic picture), finding out the part of the basic picture with the unclear object imaging outline, traversing all the alternative pictures to search in other alternative pictures to obtain the part of the object with the clearest and sharpest object imaging outline, and synthesizing the part of the object imaging outline onto the basic picture, so that the clearest picture can be obtained.
In another implementation, the electronic device may obtain multiple candidate pictures of the shooting interface through a continuous shooting function, shooting parameters adopted when the camera shoots the candidate pictures may also be different, and then select a picture with the highest definition from the candidate pictures.
Through the above, even if the picture is blurred due to inaccurate focusing or uneven brightness of the environment light, the definition of the picture can be still improved, so that the accuracy of text content identification is favorably ensured, and the quality of shooting and translation is ensured.
Of course, for the case that multiple pictures are taken in step S11, the embodiment of the present application may separately translate the multiple pictures by using the aforementioned translation method.
The existing shooting translation technology only supports the single picture shooting and single picture translation, namely, one picture is shot and translated, and multiple pictures cannot be synchronously translated. To solve this problem, the embodiment of the present application provides a method as shown in fig. 5 below.
Fig. 5 is a flowchart illustrating a translation method according to another embodiment of the present application. Referring to fig. 5, the shooting translation method includes the following steps S21 to S25.
S21: and acquiring a plurality of pictures of the same shooting interface.
The electronic device can acquire a plurality of pictures of the shooting interface through the continuous shooting function, and shooting parameters adopted when the camera shoots the pictures can be the same or different and are not limited. The shooting parameters include, but are not limited to, exposure, focus parameters, white balance parameters, etc.
Any one of these pictures can be obtained by performing picture synthesis processing on a plurality of candidate pictures, and the manner of synthesizing a single picture can be referred to the description of the foregoing embodiments.
S22: a translation region is selected for each picture.
In the continuous shooting process of the electronic equipment, the position of the camera is basically kept unchanged, and the view range presented in the same shooting interface is also basically kept unchanged. In this way, the electronic device can automatically perform area division on the shooting interface, and the same area of the shooting interface corresponds to the same area of the pictures.
The number of the areas divided by the electronic equipment for the shooting interface can be equal to the number of the pictures, at the moment, each picture correspondingly has a translation area, the translation areas of the pictures can be partially overlapped or adjacently arranged, but the translation areas jointly cover the whole shooting interface, so that the electronic equipment can identify all text contents in the pictures, and omission does not occur.
Of course, the electronic device may select multiple translation regions for each picture, and as such, all translation regions of the pictures collectively cover the entire capture interface.
S23: the language to be translated is selected for each translation region.
The electronic device may set the corresponding language for each divided region before shooting, and at this time, the corresponding language may be automatically selected according to the preset. Or, when a picture is taken, selecting languages for the translation regions according to the method described in the foregoing fig. 3.
S24: and recognizing the text content of each translation area of the plurality of pictures by adopting an asynchronous multithreading mechanism, and translating the text content into a translation text of the corresponding language.
S25: and displaying the translation area of each picture and the translated language on a shooting interface.
The embodiment shoots and translates a plurality of pictures. The same steps and operations in the embodiments before and after the present application are not described herein again. The differences are explained below.
By asynchronous multithreading mechanism is understood: and the translation of each picture is independently executed by a corresponding task thread, and the translations of a plurality of pictures are parallel. The asynchronous multithreading mechanism can be divided into two processes: firstly, asynchronous recognition is carried out, and a plurality of task threads respectively carry out recognition on text contents of each picture; and secondly, asynchronous translation, wherein a plurality of task threads respectively translate the text content of each identified picture.
Based on the method, the electronic equipment can perform translation every time the text content in one picture is successfully identified and extracted, asynchronous identification and asynchronous translation of each picture are not influenced mutually, the total time consumption of identification and translation of a plurality of pictures is equal to the maximum time consumption of identification and translation of a single picture, and the translation time effectiveness can be improved.
Optionally, before uploading a plurality of pictures to the multithread of the electronic device, if the data size of the pictures is very large, in order to effectively transmit and store the pictures, the electronic device may perform picture compression processing on the pictures, for example, reduce picture pixels by using a pixel gray scale compression method, so as to perform data size compression on the pictures exceeding a predetermined resolution, thereby saving storage space.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 6, the electronic device 40 can be regarded as the electronic device 100, and includes a processor 41, a memory 42, and a communication bus 43, where the communication bus 43 is used for connecting the processor 41 and the memory 42.
The processor 41 is a control center of the electronic device 40, connects various parts of the entire electronic device 40 by various interfaces and lines, and performs various functions of the electronic device 40 and processes data by running or loading a program stored in the memory 42 and calling data stored in the memory 42, thereby performing overall monitoring of the electronic device 40.
Alternatively, the processor 41 may load instructions corresponding to one or more processes of the program into the memory 42, and the processor 41 executes the program stored in the memory 42, so as to implement the method of any of the foregoing embodiments.
For the specific implementation of each step, that is, the specific content of the step executed by the processor 41 calling the program can be referred to the foregoing, and is not described in detail here. Here, the electronic device 40 has the advantages that can be achieved by the foregoing method.
It should be understood that, when implemented in a practical application scenario, the execution bodies of the above steps may not be the processor 41 and the memory 42, but implemented by other modules and units respectively, according to the device type of the electronic device 40.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, the present application provides a readable storage medium, where a plurality of instructions are stored, and the instructions can be loaded and executed by a processor to implement the steps in any one of the translation methods provided by the present application.
Alternatively, the storage medium may include a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, or the like.
Since the instructions stored in the storage medium can execute the steps in any one of the translation methods provided in the embodiments of the present application, beneficial effects that can be achieved by any one of the translation methods can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
In the embodiments of the electronic device and the readable storage medium provided in the present application, all technical features of the embodiments of the translation method are included, and the expanding and explaining contents of the specification are basically the same as those of the embodiments of the translation method, and are not described herein again.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method of each embodiment of the present application.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.
The present application further provides a mobile terminal device, which includes a memory and a processor, where the memory stores a translation program, and the translation program implements the steps of the translation method in any of the above embodiments when executed by the processor.
The present application further provides a computer-readable storage medium, on which a translation program is stored, and the translation program, when executed by a processor, implements the steps of the translation method in any of the above embodiments.
In the embodiments of the mobile terminal and the computer-readable storage medium provided in the present application, all technical features of the embodiments of the translation method are included, and the expanding and explaining contents of the specification are basically the same as those of the embodiments of the method, and are not described herein again.
Embodiments of the present application also provide a computer program product, which includes computer program code, when the computer program code runs on a computer, the computer is caused to execute the method in the above various possible embodiments.
Embodiments of the present application further provide a chip, which includes a memory and a processor, where 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 in which the chip is installed executes the method in the above various possible embodiments.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The embodiments of the present application are intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements 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 application is limited only by the appended claims.

Claims (10)

1. A method of translation, comprising:
acquiring at least one picture of a shooting interface;
receiving a first selected instruction, selecting a first translation region from the picture, and translating the first translation region into a first language;
receiving a second selected instruction, selecting a second translation region from the picture, and translating the second translation region into a second language;
the picture displays a first translation region translated into a first language and a second translation region translated into a second language.
2. The translation method according to claim 1, wherein when the first translation region is selected from the picture and/or the second translation region is selected from the picture, the translation method comprises:
and displaying at least one language on the shooting interface.
3. The translation method according to claim 1, wherein the method of selecting different translation regions a plurality of times comprises:
firstly, selecting the first translation region and the second translation region, and then translating the first translation region and the second translation region; or the like, or, alternatively,
the first translation region is selected, the first translation region is translated into a first language, the second translation region is selected, and the second translation region is translated into a second language.
4. The translation method according to claim 3, wherein the picture displays a first translation region translated into the first language and a second translation region translated into the second language simultaneously or sequentially.
5. The translation method of claim 1, wherein 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, further comprising:
setting a background pattern for the first translation region and the second translation region;
the picture displays a first translation region translated into a first language and a second translation region translated into a second language, comprising: and displaying the first translation area, the second translation area, the translated language and the background pattern on a shooting interface.
7. The translation method according to any one of claims 1 to 6, wherein said obtaining at least one picture of a photographic interface comprises:
acquiring a plurality of pictures of a shooting interface, wherein the plurality of pictures comprise at least two pictures with different shooting parameters; and
and carrying out picture synthesis processing on the plurality of pictures to obtain a picture and translating the picture, or translating the plurality of pictures.
8. The translation method according to any one of claims 1 to 6, wherein a plurality of pictures of the shooting interface are acquired, and the translation method further comprises:
recognizing the text content of each translation area of the plurality of pictures, and translating the text content into languages of corresponding languages;
and displaying the translation area of each picture and the translated language on a shooting interface.
9. An electronic device comprising a memory and a processor, the memory storing a program for execution by the processor to perform the steps in the translation method of any of claims 1 to 8.
10. A readable storage medium, in which a program is stored, which program, when being executed by a processor, is adapted to carry out the steps of the translation method according to any one of claims 1 to 8.
CN202010951697.6A 2020-09-11 2020-09-11 Translation method, electronic device and readable storage medium Pending CN112149431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010951697.6A CN112149431A (en) 2020-09-11 2020-09-11 Translation method, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010951697.6A CN112149431A (en) 2020-09-11 2020-09-11 Translation method, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN112149431A true CN112149431A (en) 2020-12-29

Family

ID=73889604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010951697.6A Pending CN112149431A (en) 2020-09-11 2020-09-11 Translation method, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN112149431A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064186A (en) * 2021-11-30 2022-02-18 Oppo广东移动通信有限公司 Character processing method, device, server, storage medium, terminal device and server
CN114064186B (en) * 2021-11-30 2024-06-07 Oppo广东移动通信有限公司 Character processing method, device, server, storage medium, terminal equipment and server

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1315085A1 (en) * 2001-11-27 2003-05-28 Sun Microsystems, Inc. Automatic image-button creation process
US20110252316A1 (en) * 2010-04-12 2011-10-13 Microsoft Corporation Translating text on a surface computing device
US20140081619A1 (en) * 2012-09-18 2014-03-20 Abbyy Software Ltd. Photography Recognition Translation
CN108062301A (en) * 2016-11-08 2018-05-22 希思特兰国际 Character translation method and its device
CN108536686A (en) * 2018-04-11 2018-09-14 百度在线网络技术(北京)有限公司 A kind of picture interpretation method, device, terminal and storage medium
CN110674814A (en) * 2019-09-25 2020-01-10 深圳传音控股股份有限公司 Picture identification and translation method, terminal and medium
CN111382748A (en) * 2020-02-28 2020-07-07 北京小米松果电子有限公司 Image translation method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1315085A1 (en) * 2001-11-27 2003-05-28 Sun Microsystems, Inc. Automatic image-button creation process
US20110252316A1 (en) * 2010-04-12 2011-10-13 Microsoft Corporation Translating text on a surface computing device
US20140081619A1 (en) * 2012-09-18 2014-03-20 Abbyy Software Ltd. Photography Recognition Translation
CN108062301A (en) * 2016-11-08 2018-05-22 希思特兰国际 Character translation method and its device
CN108536686A (en) * 2018-04-11 2018-09-14 百度在线网络技术(北京)有限公司 A kind of picture interpretation method, device, terminal and storage medium
CN110674814A (en) * 2019-09-25 2020-01-10 深圳传音控股股份有限公司 Picture identification and translation method, terminal and medium
CN111382748A (en) * 2020-02-28 2020-07-07 北京小米松果电子有限公司 Image translation method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064186A (en) * 2021-11-30 2022-02-18 Oppo广东移动通信有限公司 Character processing method, device, server, storage medium, terminal device and server
CN114064186B (en) * 2021-11-30 2024-06-07 Oppo广东移动通信有限公司 Character processing method, device, server, storage medium, terminal equipment and server

Similar Documents

Publication Publication Date Title
CN106937039B (en) Imaging method based on double cameras, mobile terminal and storage medium
CN108921212B (en) Image matching method, mobile terminal and computer readable storage medium
CN111654628B (en) Video shooting method and device and computer readable storage medium
CN111885307B (en) Depth-of-field shooting method and device and computer readable storage medium
CN113542610A (en) Shooting method, mobile terminal and storage medium
CN112188082A (en) High dynamic range image shooting method, shooting device, terminal and storage medium
CN112511741A (en) Image processing method, mobile terminal and computer storage medium
CN107896304B (en) Image shooting method and device and computer readable storage medium
CN112184722A (en) Image processing method, terminal and computer storage medium
CN108848321B (en) Exposure optimization method, device and computer-readable storage medium
CN112135045A (en) Video processing method, mobile terminal and computer storage medium
CN111953906A (en) Image processing method, image processing apparatus, and computer-readable storage medium
CN109510941B (en) Shooting processing method and device and computer readable storage medium
CN112422813B (en) Image blurring method, terminal device, and computer-readable storage medium
CN112532786B (en) Image display method, terminal device, and storage medium
WO2022252158A1 (en) Photographing method, mobile terminal and readable storage medium
CN112532838B (en) Image processing method, mobile terminal and computer storage medium
CN109495683B (en) Interval shooting method and device and computer readable storage medium
CN115134527A (en) Processing method, intelligent terminal and storage medium
CN109215004B (en) Image synthesis method, mobile terminal and computer readable storage medium
CN113572916A (en) Shooting method, terminal device and storage medium
CN113542605A (en) Camera shooting control method, mobile terminal and storage medium
CN113572964A (en) Image processing method, mobile terminal and storage medium
CN110070569B (en) Registration method and device of terminal image, mobile terminal and storage medium
CN112149431A (en) Translation method, electronic device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination