CN113553865A - Information display method and device, electronic equipment and storage medium - Google Patents

Information display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113553865A
CN113553865A CN202110774917.7A CN202110774917A CN113553865A CN 113553865 A CN113553865 A CN 113553865A CN 202110774917 A CN202110774917 A CN 202110774917A CN 113553865 A CN113553865 A CN 113553865A
Authority
CN
China
Prior art keywords
target
text
area
region
expanded
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.)
Granted
Application number
CN202110774917.7A
Other languages
Chinese (zh)
Other versions
CN113553865B (en
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.)
Vivo Software Technology Co Ltd
Original Assignee
Vivo Software 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 Vivo Software Technology Co Ltd filed Critical Vivo Software Technology Co Ltd
Priority to CN202110774917.7A priority Critical patent/CN113553865B/en
Publication of CN113553865A publication Critical patent/CN113553865A/en
Application granted granted Critical
Publication of CN113553865B publication Critical patent/CN113553865B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • G06F40/44Statistical methods, e.g. probability models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses an information display method, an information display device, electronic equipment and a storage medium. The information display method comprises the following steps: acquiring a target text display area of a text to be translated in an interface, and acquiring a target translation text, wherein the target translation text is a text obtained by translating the text to be translated; calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text; when the filling character size is smaller than the preset character size, expanding the target text display area; and displaying the target translation text in a target display mode according to the target character size in the expanded target text display area, wherein the target character size is larger than or equal to the preset character size. By the information display method, the background area and the translation text can be displayed in a distinguishing mode, and a user can distinguish the background area from the translation text conveniently, so that the user can obtain the translation text more clearly and better, and user experience is improved.

Description

Information display method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of image processing, and particularly relates to an information display method and device, electronic equipment and a storage medium.
Background
With the continuous development of electronic devices, most electronic devices have a real-time translation function, and the real-time translation function has become an important function frequently used in daily life of users.
At present, the electronic device may display a translation text corresponding to the text to be translated in a text region where the text to be translated is located in the interface. However, due to diversification of scenes where the text to be translated is located, the situation that the degree of distinction between the translated text and a background area in the interface (i.e., an area outside the text area where the text to be translated is located in the interface) is low often occurs, so that the user is difficult to see the translated text, and the user experience is poor.
Disclosure of Invention
The embodiment of the application aims to provide an information display method, an information display device, electronic equipment and a storage medium, and can solve the problems that a user cannot see clearly translated texts and the user experience is poor.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides an information display method, including:
acquiring a target text display area of a text to be translated in an interface, and acquiring a target translation text, wherein the target translation text is a text obtained by translating the text to be translated;
calculating the filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text;
when the filling character size is smaller than a preset character size, expanding the target text display area;
and displaying the target translation text in a target display mode according to a target character size in the expanded target text display area, wherein the target character size is larger than or equal to the preset character size.
In a second aspect, an embodiment of the present application provides an information display apparatus, including:
the obtaining module is used for obtaining a target text display area of a text to be translated in an interface and obtaining a target translation text, wherein the target translation text is a text obtained by translating the text to be translated;
the calculation module is used for calculating the filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text;
the expansion module is used for expanding the target text display area when the filling character size is smaller than a preset character size;
and the display module is used for displaying the target translation text in a target display mode according to a target character size in the expanded target text display area, wherein the target character size is larger than or equal to the preset character size.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, the filling character size of the target translation text is calculated according to the number of characters of the target translation text, when the filling character size is smaller than the preset character size, the target text display area is expanded, and the target translation text is displayed in the expanded target text display area in a target display mode according to the target character size which is larger than or equal to the preset character size. Therefore, the differential display of the background region and the translated text can be realized, the situation that the differential degree of the background region and the translated text is low and the translated text cannot be seen clearly due to the fact that the translated text is more and the filling character size of the translated text is smaller is avoided, and therefore the background region and the translated text can be distinguished conveniently by a user, the user can obtain the translated text better and more clearly, and the user experience is improved.
Drawings
Fig. 1 is a schematic flowchart of an information display method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of another information display method provided in the embodiment of the present application;
fig. 3 is a schematic structural diagram of an information display device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
Based on the background technology, in the prior art, the difference between the translated text and the background area in the interface is low, so that the user can hardly see the translated text of the text to be translated clearly, and the user experience is poor.
Specifically, in the prior art, when performing real-time translation, a user may align an image acquisition device (e.g., a camera) of an electronic device with a text to be translated, the electronic device may acquire an image including the text to be translated through the image acquisition device and display the image on an interface, extract the text to be translated in the interface by using an OCR (Optical Character Recognition) technology, translate the text to be translated to obtain a translated text, smear or cover a region where the text to be translated is located in the interface, and backfill the translated text thereon. When the translated texts are more in the interface, the translated texts are usually backfilled in the region of the text to be translated by using a smaller filling font, so that the translated texts are smaller in font, the translated texts are not distinguished from the background region of the text to be translated in the interface, and are easily interfered by irrelevant backgrounds, so that a user is difficult to clearly see the translated texts, and particularly, the translated texts are difficult to clearly see under the conditions of high brightness of the outside such as outdoors or shaking of a handheld electronic device of the user.
Based on this, the embodiment of the application provides an information display method, an information display device, an electronic device and a storage medium, which can display a target translation text in a target display mode according to a target font size larger than or equal to a preset font size, so that a user can better and more clearly obtain the translation text, and user experience is improved.
The information display method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 shows a schematic flow chart of an information display method provided in an embodiment of the present application, where the information display method may be applied to an electronic device such as a mobile phone, a tablet computer, a notebook computer, a palm computer, and as shown in fig. 1, the information display method may include:
s110, acquiring a target text display area of the text to be translated in the interface, and acquiring a target translation text.
The text to be translated can be text information to be translated in an interface of the electronic device, and the target translation text is a text obtained by translating the text to be translated. And the target text display area is an area where the text to be translated is located in the interface.
As an example, when performing real-time translation, a user may align an image acquisition device (e.g., a camera) of an electronic device with a text to be translated, and the electronic device may acquire an image including the text to be translated through the image acquisition device and display the image on an interface, extract the text to be translated in the interface by using an OCR technology, and translate the text to be translated to obtain a target translation text.
It is understood that the specific language category of the target translation text may be the default of the electronic device, or may be selected by the user, such as english, chinese, russian, etc.
And S120, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
As an example, after acquiring a target translation text and a target text display region of a text to be translated in an interface, the electronic device may calculate an area of the target text display region, and may count the number of characters of the target translation text. Then, the fill type number of the target translation text may be determined according to the area of the target text display region and the number of characters of the target translation text. For example, when the number of characters of the target translation text is large, if the target translation text is to be displayed in the target text display area completely, the filling character size of the target translation text needs to be reduced appropriately, and conversely, the filling character size of the target translation text can be increased appropriately.
It can be understood that the filling type number of the target translation text can be determined by combining the type number of the text to be translated on the basis of the area of the target text display area and the number of characters of the target translation text, and can also be directly calculated according to the area of the target text display area and the number of characters of the target translation text.
And S130, when the filling character size is smaller than the preset character size, expanding the target text display area.
The preset word size can be a preset minimum word size, and when the translated text is smaller than the word size, the word size of the translated text can be considered to be too small to be seen clearly by a user.
As an example, after calculating the filled-in word size of the target translation text, the electronic device may compare the calculated filled-in word size of the target translation text with a preset word size to determine whether the calculated filled-in word size of the target translation text is smaller than the preset word size. When the calculated filling character size of the target translation text is smaller than the preset character size, it is considered that if the target translation text is displayed in the target text display region according to the filling character size, the character size of the target translation text is too small, and the difference from the background region is small, and the target translation text is difficult to be seen by the user.
It is to be understood that, when the filling font size is greater than or equal to the preset font size, the target translation text may be displayed in the target text display area in the target display manner according to the filling font size.
And S140, displaying the target translation text in a target display mode according to the target character size in the expanded target text display area.
Wherein, the target word size is larger than or equal to the preset word size. The target display mode can be highlighting, for example, different colors can be used for highlighting the target translation text, so that the contrast between the target translation text and the background area can be increased, the distinguishing degree between the target translation text and the background area can be increased, a user can obtain the target translation text conveniently, and the user experience is further improved.
As an example, after the electronic device expands the target text display area to obtain the expanded target text display area, the electronic device may determine a target font size, where the target font size is greater than or equal to a preset font size, and it may be understood that the target font size may be the preset font size, or may be a font size recalculated according to the expanded target text display area and the number of characters of the target translation text. Then, the target translation text may be displayed in the expanded target text display area in a target display manner in accordance with the target font size.
In the embodiment of the application, the filling character size of the target translation text is calculated according to the number of characters of the target translation text, when the filling character size is smaller than the preset character size, the target text display area is expanded, and the target translation text is displayed in the expanded target text display area in a target display mode according to the target character size which is larger than or equal to the preset character size. Therefore, the differential display of the background region and the translated text can be realized, the situation that the differential degree of the background region and the translated text is low and the translated text cannot be seen clearly due to the fact that the translated text is more and the filling character size of the translated text is smaller is avoided, and therefore the background region and the translated text can be distinguished conveniently by a user, the user can obtain the translated text better and more clearly, and the user experience is improved.
In some embodiments, when the area of the target text display area is small in the interface, the filling font size of the target translation text may be calculated, and accordingly, the specific implementation manner of the step S120 may be as follows:
and under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
As one example, the electronic device may calculate a ratio of an area of the target text display region to an area of the interface, that is, a ratio of the area of the target text display region in the interface area. And if the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, namely the area of the target text display area occupies a smaller area in the interface, the main content of the interface is non-text content. At this time, the probability that the target text display region is insufficient to display the target translated text by the number of characters larger than or equal to the preset number of characters is high, and the expandable region of the target text display region is large and is usually sufficient to display the target translated text by the number of characters larger than or equal to the preset number of characters after expansion. Therefore, under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than the preset threshold, the filling character size of the target translation text is calculated according to the area of the target text display area and the number of characters of the target translation text, so that when the filling character size is smaller than the preset character size, the target text display area is expanded, and the target translation text is displayed in the expanded target text display area in a target display mode according to the target character size.
It can be understood that, when the ratio of the area of the target text display area to the area of the interface is greater than or equal to the preset threshold, the main content of the interface may be considered as text content, at this time, the expandable area of the target text display area is smaller, and if the calculated filling font size is smaller than the preset font size, even if the expansion of the target text display area is performed, the target translation text is generally not enough to be displayed according to the preset font size or larger, so that, at this time, the blurring processing may be performed on the background area outside the first target text display area, the degree of distinction between the target translation text and the background area may be increased, for example, the contour of the background area may be detected by an object recognition and contour segmentation network such as R-CNN (Region-CNN), yolo (youno Only Look), and the blurring processing may be performed on the object inside the contour.
Therefore, on one hand, when the area of the target text display area is smaller in the interface, the filling character size of the target translation text is calculated to perform subsequent display area expansion processing, so that unnecessary processing procedures can be avoided, the processing efficiency is improved, and the user experience is further improved. On the other hand, when the area of the target text display area is larger in the interface, the filled font size does not need to be calculated, the display area does not need to be expanded, only the background is blurred, and the degree of distinction between the target translation text and the background area can be ensured while the processing efficiency is improved.
In some embodiments, the expanding of the target text region may be further performed when the difference between the number of characters of the target translation text and the number of characters of the text to be translated is relatively large, and accordingly, a specific implementation manner may be as follows:
calculating the difference value between the number of characters of the target translation text and the number of characters of the text to be translated;
and expanding the target text display area under the condition that the difference value is larger than a preset difference value threshold value.
The preset difference threshold is a specific preset number of characters, such as 20, 25, 30, and the like.
As an example, the electronic device may also count the number of characters of the text to be translated, calculate a difference between the number of characters of the target translation text and the number of characters of the text to be translated, and compare the difference with a preset difference threshold. If the target translation text is displayed in the target text display area, the word size of the target translation text needs to be reduced for completely displaying the target translation text, which may cause the target translation text to be unclear due to too small word size.
As a specific example, the electronic device may separate the text region from the background region in the interface using a color-clustered K-means (K-means clustering algorithm), extract a boundary of the text region using an edge detection method, draw a boundary of the text region using an arc, and separate the text region from the background region. And comparing the number of characters of the target translation text with the number of characters of the text to be translated, if the difference value between the number of characters of the target translation text and the number of characters of the text to be translated is greater than a preset difference threshold value, namely the number of characters of the target translation text is increased significantly, selecting areas with similar pixel points in a target text display area for boundary expansion according to the number of characters of the target text display area and the number of characters of the target translation text increased compared with the text to be translated, and simultaneously selecting characters with strong contrast and a background to fill and display the target translation text.
In some embodiments, the specific implementation of expanding the target text display area may be as follows:
setting a region division threshold value by taking a pixel point clustering value of a target text display region as a reference, and dividing a region of which the difference value with the pixel point clustering value is within the region division threshold value into regions to be expanded;
judging whether the pixel points of the area to be expanded are uniformly distributed;
under the condition that pixel points of the region to be expanded are uniformly distributed, expanding the boundary of the target text display region in the region to be expanded;
and under the condition that the pixel points of the area to be expanded are not uniformly distributed, carrying out fuzzy processing on the area to be expanded, and expanding the boundary of the target text display area in the area to be expanded after the fuzzy processing.
As an example, when the target text display area is expanded, the area division threshold may be set based on the pixel point cluster value of the target text display area, for example, the area division threshold may be set to 10, that is, the difference between the RGB value and the pixel point cluster value is ± 10. And according to the region division threshold, dividing the region which is around the target text display region and has the difference value with the pixel point clustering value of the target text display region within the region division threshold into the region to be expanded. Then, whether the distribution of the pixel points in the region to be expanded is uniform (if the distribution is uniform, the pixel points are a solid background, otherwise, the pixel points are a variegated background) can be judged.
If the pixel points of the region to be expanded are uniformly distributed, expanding the boundary of the target text display region in the region to be expanded, for example, performing convolution expansion (i.e., expansion) on the boundary of the target text display region in the region to be expanded through a filter (such as linear filtering, mean filtering, gaussian filtering, nonlinear filtering, median filtering, bilateral filtering, etc.). If the pixel points of the region to be expanded are not uniformly distributed, fuzzy processing (such as mean fuzzy, median fuzzy, Gaussian fuzzy and the like) can be performed on the region to be expanded, and then the boundary of the target text display region is expanded in the region to be expanded after the fuzzy processing.
It is to be understood that a background region of a solid color may be preferentially selected for expansion of the target text display region, while boundaries of the plurality of text regions cannot overlap. When the target translation text is displayed in the expanded target text display area, a channel transformation algorithm needs to be selected for R, G, B channels of the expanded target text display area to change the gray scale or the color value of the target text display area, for example, piecewise linear transformation, brightness enhancement, and the like can be performed. It can be understood that, the lookup table mode is also directly adopted, the calculated pixel value is directly queried when the pixel point within the proper threshold value is processed, and the translated text is displayed in the expanded target text display area after being processed by the reverse color and the like.
Therefore, the expansion of the target text display area is realized by adopting different methods according to different conditions, so that not only can support the display of the subsequent target translation text be provided, but also the flexibility of the scheme can be improved.
In some embodiments, after expanding the target text display area, the following steps may also be performed:
and carrying out fuzzy processing on the area except the expanded target text display area in the interface.
As an example, after the target text display area is expanded, the blurring processing may be performed on an area of the interface other than the expanded target text display area. It can be understood that the blurring processing on the area of the interface except the expanded target text display area may adopt any one of methods such as mean blurring, median blurring, gaussian blurring, and the like. Therefore, on the basis of expanding the target text display area and displaying the target translation text in a target display mode according to the target font size, the fuzzy processing is carried out on the area, except for the expanded target text display area, in the interface, the contrast ratio of the target translation text to the background area can be further increased, a user can see the target translation text clearly, and the user experience is further improved.
It can be understood that after the filling font size is greater than or equal to the preset font size and the target translation text is displayed in the target text display area in the target display mode according to the filling font size, the area outside the target text display area may also be subjected to the fuzzy processing.
In order to make the method provided by the embodiment of the present application clearer, an information display method provided by the embodiment of the present application is described below with reference to fig. 2, where as shown in fig. 2, the method may include:
s210, acquiring a text to be translated.
S220, acquiring a target text display area of the text to be translated in the interface, and acquiring a target translation text.
And S230, under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
S240, judging whether the filling character size is smaller than the preset character size.
In the case of whether the pad size is smaller than the preset size, steps S250 to S270 are performed. Otherwise, steps S280 to S290 are performed.
And S250, expanding the target text display area.
And S260, displaying the target translation text in a target display mode according to the target character size in the expanded target text display area.
And S270, carrying out fuzzy processing on the area except the expanded target text display area in the interface.
And S280, displaying the target translation text in a target display mode in the target text display area according to the filling character size.
S290, blurring is performed on the region outside the target text display region.
The specific implementation principle and technical effect of the embodiments of the present application are similar to those of the embodiments described above, and for the sake of brevity, detailed description is omitted here.
It should be noted that, in the information display method provided in the embodiment of the present application, the execution main body may be an information display apparatus, or a control module in the information display apparatus for executing the loaded information display method. In the embodiment of the present application, an information display device executes a loaded information display method as an example, and the information display method provided in the embodiment of the present application is described.
Based on the same inventive concept, the present application further provides an information display apparatus, as shown in fig. 3, the information display apparatus 300 may include:
the obtaining module 310 is configured to obtain a target text display area of a text to be translated in an interface, and obtain a target translation text, where the target translation text is a text obtained by translating the text to be translated;
a calculating module 320, configured to calculate a filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text;
the expansion module 330 is configured to expand the target text display area when the filling font size is smaller than a preset font size;
and the display module 340 is configured to display the target translation text in a target display manner according to a target font size in the expanded target text display area, where the target font size is greater than or equal to the preset font size.
In the embodiment of the application, the filling character size of the target translation text is calculated according to the number of characters of the target translation text, when the filling character size is smaller than the preset character size, the target text display area is expanded, and the target translation text is displayed in the expanded target text display area in a target display mode according to the target character size which is larger than or equal to the preset character size. Therefore, the differential display of the background region and the translated text can be realized, the situation that the differential degree of the background region and the translated text is low and the translated text cannot be seen clearly due to the fact that the translated text is more and the filling character size of the translated text is smaller is avoided, and therefore the background region and the translated text can be distinguished conveniently by a user, the user can obtain the translated text better and more clearly, and the user experience is improved.
In some embodiments, the calculating module 320 is specifically configured to:
and under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
Therefore, only when the area of the target text display area is smaller in the interface, the filling character size of the target translation text is calculated to perform subsequent display area expansion processing, so that unnecessary processing procedures can be avoided, the processing efficiency is improved, and the user experience is further improved.
In some embodiments, the expansion module 330 includes:
the dividing unit is used for setting a region division threshold value by taking a pixel point clustering value of a target text display region as a reference, and dividing a region of which the difference value with the pixel point clustering value is within the region division threshold value into a region to be expanded;
the judging unit is used for judging whether the distribution of the pixel points of the area to be expanded is uniform or not;
the first expansion unit is used for expanding the boundary of the target text display area in the area to be expanded under the condition that the pixel points of the area to be expanded are uniformly distributed;
and the second expansion unit is used for performing fuzzy processing on the region to be expanded under the condition that the distribution of the pixel points of the region to be expanded is not uniform, and expanding the boundary of the target text display region in the region to be expanded after the fuzzy processing.
Therefore, the expansion of the target text display area is realized by adopting different methods according to different conditions, so that not only can support the display of the subsequent target translation text be provided, but also the flexibility of the scheme can be improved.
In some embodiments, the apparatus 300 further comprises:
and the blurring module is used for blurring the area of the interface except the expanded target text display area.
Therefore, on the basis of expanding the target text display area and displaying the target translation text in a target display mode according to the target font size, the fuzzy processing is carried out on the area, except for the expanded target text display area, in the interface, the contrast ratio of the target translation text to the background area can be further increased, a user can see the target translation text clearly, and the user experience is further improved.
In some embodiments, the target display mode is highlighting.
Therefore, the contrast ratio of the target translation text and the background area can be increased, the distinguishing ratio of the target translation text and the background area is increased, a user can obtain the target translation text conveniently, and user experience is further improved.
The information display device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The information display device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The information display device provided in the embodiment of the present application can implement each process implemented by the information display device in the method embodiments of fig. 1 to fig. 2, and is not described here again to avoid repetition.
Optionally, an electronic device is further provided in this embodiment of the present application, and includes a processor 410, a memory 409, and a program or an instruction stored in the memory 409 and executable on the processor 410, where the program or the instruction is executed by the processor 410 to implement each process of the above-mentioned information display method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 4 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 400 includes, but is not limited to: radio unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.
Those skilled in the art will appreciate that the electronic device 400 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 4 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein, the processor 410 is configured to:
acquiring a target text display area of a text to be translated in an interface, and acquiring a target translation text, wherein the target translation text is a text obtained by translating the text to be translated;
calculating the filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text;
when the filling character size is smaller than a preset character size, expanding the target text display area;
a display unit 406 for:
and displaying the target translation text in a target display mode according to a target character size in the expanded target text display area, wherein the target character size is larger than or equal to the preset character size.
In the embodiment of the application, the filling character size of the target translation text is calculated according to the number of characters of the target translation text, when the filling character size is smaller than the preset character size, the target text display area is expanded, and the target translation text is displayed in the expanded target text display area in a target display mode according to the target character size which is larger than or equal to the preset character size. Therefore, the differential display of the background region and the translated text can be realized, the situation that the differential degree of the background region and the translated text is low and the translated text cannot be seen clearly due to the fact that the translated text is more and the filling character size of the translated text is smaller is avoided, and therefore the background region and the translated text can be distinguished conveniently by a user, the user can obtain the translated text better and more clearly, and the user experience is improved.
Optionally, the processor 410 is specifically configured to:
and under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
Therefore, only when the area of the target text display area is smaller in the interface, the filling character size of the target translation text is calculated to perform subsequent display area expansion processing, so that unnecessary processing procedures can be avoided, the processing efficiency is improved, and the user experience is further improved.
Optionally, the processor 410 is further configured to:
setting a region division threshold value by taking a pixel point clustering value of a target text display region as a reference, and dividing a region of which the difference value with the pixel point clustering value is within the region division threshold value into a region to be expanded;
judging whether the pixel points of the area to be expanded are uniformly distributed;
under the condition that the pixel points of the region to be expanded are uniformly distributed, expanding the boundary of a target text display region in the region to be expanded;
and under the condition that the pixel points of the region to be expanded are not uniformly distributed, carrying out fuzzy processing on the region to be expanded, and expanding the boundary of the target text display region in the region to be expanded after the fuzzy processing.
Therefore, the expansion of the target text display area is realized by adopting different methods according to different conditions, so that not only can support the display of the subsequent target translation text be provided, but also the flexibility of the scheme can be improved.
Optionally, the processor 410 is further configured to:
and carrying out fuzzy processing on the area except the expanded target text display area in the interface.
Therefore, on the basis of expanding the target text display area and displaying the target translation text in a target display mode according to the target font size, the fuzzy processing is carried out on the area, except for the expanded target text display area, in the interface, the contrast ratio of the target translation text to the background area can be further increased, a user can see the target translation text clearly, and the user experience is further improved.
Optionally, the target display mode is a highlight display.
Therefore, the contrast ratio of the target translation text and the background area can be increased, the distinguishing ratio of the target translation text and the background area is increased, a user can obtain the target translation text conveniently, and user experience is further improved.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above-mentioned information display method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement the foregoing methodInformation displayAll processes of the method embodiment can achieve the same technologyThe operation effect is not described herein in detail to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
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, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
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 (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (12)

1. An information display method, characterized in that the method comprises:
acquiring a target text display area of a text to be translated in an interface, and acquiring a target translation text, wherein the target translation text is a text obtained by translating the text to be translated;
calculating the filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text;
when the filling character size is smaller than a preset character size, expanding the target text display area;
and displaying the target translation text in a target display mode according to a target character size in the expanded target text display area, wherein the target character size is larger than or equal to the preset character size.
2. The method of claim 1, wherein calculating the filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text comprises:
and under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
3. The method of claim 1, wherein expanding the target text display area comprises:
setting a region division threshold value by taking a pixel point clustering value of a target text display region as a reference, and dividing a region of which the difference value with the pixel point clustering value is within the region division threshold value into a region to be expanded;
judging whether the pixel points of the area to be expanded are uniformly distributed;
under the condition that the pixel points of the region to be expanded are uniformly distributed, expanding the boundary of a target text display region in the region to be expanded;
and under the condition that the pixel points of the region to be expanded are not uniformly distributed, carrying out fuzzy processing on the region to be expanded, and expanding the boundary of the target text display region in the region to be expanded after the fuzzy processing.
4. The method of claim 1, wherein after expanding the target text display area, further comprising:
and carrying out fuzzy processing on the area except the expanded target text display area in the interface.
5. The method of claim 1, wherein the target display mode is highlighting.
6. An information display apparatus, characterized in that the apparatus comprises:
the obtaining module is used for obtaining a target text display area of a text to be translated in an interface and obtaining a target translation text, wherein the target translation text is a text obtained by translating the text to be translated;
the calculation module is used for calculating the filling word size of the target translation text according to the area of the target text display area and the number of characters of the target translation text;
the expansion module is used for expanding the target text display area when the filling character size is smaller than a preset character size;
and the display module is used for displaying the target translation text in a target display mode according to a target character size in the expanded target text display area, wherein the target character size is larger than or equal to the preset character size.
7. The apparatus of claim 6, wherein the computing module is specifically configured to:
and under the condition that the ratio of the area of the target text display area to the area of the interface is smaller than a preset threshold value, calculating the filling character size of the target translation text according to the area of the target text display area and the number of characters of the target translation text.
8. The apparatus of claim 6, wherein the expansion module comprises:
the dividing unit is used for setting a region division threshold value by taking a pixel point clustering value of a target text display region as a reference, and dividing a region of which the difference value with the pixel point clustering value is within the region division threshold value into a region to be expanded;
the judging unit is used for judging whether the distribution of the pixel points of the area to be expanded is uniform or not;
the first expansion unit is used for expanding the boundary of the target text display area in the area to be expanded under the condition that the pixel points of the area to be expanded are uniformly distributed;
and the second expansion unit is used for performing fuzzy processing on the region to be expanded under the condition that the distribution of the pixel points of the region to be expanded is not uniform, and expanding the boundary of the target text display region in the region to be expanded after the fuzzy processing.
9. The apparatus of claim 1, further comprising:
and the blurring module is used for blurring the area of the interface except the expanded target text display area.
10. The apparatus of claim 6, wherein the target display mode is highlighting.
11. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the information display method according to any one of claims 1 to 5.
12. A readable storage medium, on which a program or instructions are stored, which when executed by a processor, carry out the steps of the information display method according to any one of claims 1 to 5.
CN202110774917.7A 2021-07-08 2021-07-08 Information display method, information display device, electronic equipment and storage medium Active CN113553865B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110774917.7A CN113553865B (en) 2021-07-08 2021-07-08 Information display method, information display device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110774917.7A CN113553865B (en) 2021-07-08 2021-07-08 Information display method, information display device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113553865A true CN113553865A (en) 2021-10-26
CN113553865B CN113553865B (en) 2023-08-01

Family

ID=78102841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110774917.7A Active CN113553865B (en) 2021-07-08 2021-07-08 Information display method, information display device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113553865B (en)

Cited By (1)

* 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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158940A (en) * 2007-11-21 2008-04-09 金蝶软件(中国)有限公司 Method and device for dwindling character stuffing in target region
CN106385626A (en) * 2016-10-26 2017-02-08 广东小天才科技有限公司 video playing processing method and device
CN110569457A (en) * 2019-08-01 2019-12-13 平安科技(深圳)有限公司 page adjusting method and device, computer equipment and storage medium
US20210073340A1 (en) * 2019-09-09 2021-03-11 Adobe Inc. Design suggestion techniques for documents to-be-translated

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158940A (en) * 2007-11-21 2008-04-09 金蝶软件(中国)有限公司 Method and device for dwindling character stuffing in target region
CN106385626A (en) * 2016-10-26 2017-02-08 广东小天才科技有限公司 video playing processing method and device
CN110569457A (en) * 2019-08-01 2019-12-13 平安科技(深圳)有限公司 page adjusting method and device, computer equipment and storage medium
US20210073340A1 (en) * 2019-09-09 2021-03-11 Adobe Inc. Design suggestion techniques for documents to-be-translated

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

Also Published As

Publication number Publication date
CN113553865B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN108830780B (en) Image processing method and device, electronic device and storage medium
CN110930296B (en) Image processing method, device, equipment and storage medium
CN106202086B (en) Picture processing and obtaining method, device and system
CN112055244B (en) Image acquisition method and device, server and electronic equipment
CN112308797A (en) Corner detection method and device, electronic equipment and readable storage medium
CN113553865B (en) Information display method, information display device, electronic equipment and storage medium
CN110442313B (en) Display attribute adjusting method and related equipment
CN111724455A (en) Image processing method and electronic device
CN112764606A (en) Identification display method and device and electronic equipment
CN111695323A (en) Information processing method and device and electronic equipment
CN113362426B (en) Image editing method and image editing device
CN112580638B (en) Text detection method and device, storage medium and electronic equipment
CN112286430B (en) Image processing method, apparatus, device and medium
CN111160358B (en) Image binarization method, device, equipment and medium
CN114518859A (en) Display control method, display control device, electronic equipment and storage medium
CN113436297A (en) Picture processing method and electronic equipment
CN113157184A (en) Content display method and device, electronic equipment and readable storage medium
CN114118029A (en) Image processing method, device, equipment and storage medium
CN113038055A (en) Image processing method and device and electronic equipment
CN111626913B (en) Image processing method, device and storage medium
CN113269102A (en) Seal information identification method and device, computer equipment and storage medium
CN113096069A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112732100A (en) Information processing method and device and electronic equipment
CN113223117A (en) Image processing method and related device
CN112288835A (en) Image text extraction method and device and electronic equipment

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
GR01 Patent grant
GR01 Patent grant