CN114117281A - Background determination method, device, equipment and storage medium - Google Patents

Background determination method, device, equipment and storage medium Download PDF

Info

Publication number
CN114117281A
CN114117281A CN202111440883.4A CN202111440883A CN114117281A CN 114117281 A CN114117281 A CN 114117281A CN 202111440883 A CN202111440883 A CN 202111440883A CN 114117281 A CN114117281 A CN 114117281A
Authority
CN
China
Prior art keywords
background
text content
contrast
picture
foreground
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
CN202111440883.4A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111440883.4A priority Critical patent/CN114117281A/en
Publication of CN114117281A publication Critical patent/CN114117281A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure provides a background determination method, a background determination device, a background determination equipment and a storage medium, and relates to the technical field of computers, in particular to the technical field of computer vision. The specific implementation scheme is as follows: obtaining a foreground picture; taking the masked picture as a background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture; and in response to the contrast of the text content and the background being lower than a preset contrast threshold, increasing the preset transparency, wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, the text content is the text content in the foreground, and the foreground comprises the text content and the foreground picture. The present disclosure can improve the readability of text content.

Description

Background determination method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of computer vision technology.
Background
With the rise of mobile internet and the popularization of application, all organizations, units or individuals can issue information through pages, and can embed the text of the information content as a main body in the page and then form a complete page to be presented to users by matching with various backgrounds. The background is important content of the whole page, determines the style, the tone and the like of the page, and not only influences the overall attractiveness of the page, but also influences the expression of the main content of the page.
Disclosure of Invention
The disclosure provides a background determination method, a device, equipment and a storage medium.
According to a first aspect of the present disclosure, there is provided a context determination method, including:
obtaining a foreground picture;
taking the masked picture as a background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture;
and in response to the contrast of the text content and the background being lower than a preset contrast threshold, increasing the preset transparency, wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, the text content is the text content in a foreground, and the foreground comprises the text content and the foreground picture.
According to a second aspect of the present disclosure, there is provided a context determining apparatus comprising:
the acquisition module is used for acquiring a foreground picture;
the processing module is used for taking the masked picture as a background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture;
and the transparency increasing module is used for increasing the preset transparency in response to the contrast of the text content and the background being lower than a preset contrast threshold, wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, the text content is the text content in the foreground, and the foreground comprises the text content and the foreground picture.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to the first aspect.
The present disclosure can improve the readability of text content.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flowchart of a context determination method provided by an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of background composition in an embodiment of the disclosure;
FIG. 3 is a schematic diagram of foreground composition in an embodiment of the disclosure;
FIG. 4A is a schematic illustration of the readability of an embodiment of the present disclosure;
FIG. 4B is a schematic illustration of poor readability in an embodiment of the present disclosure;
FIG. 5 is a schematic illustration of readability after enhanced transparency in an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a background determination apparatus provided in an embodiment of the present disclosure;
fig. 7 is another schematic structural diagram of a background determination apparatus provided in an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a background determination apparatus provided in an embodiment of the present disclosure;
fig. 9 is a block diagram of an electronic device for implementing a context determination method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
When the content uploader can upload the pictures, the page background color is modified at the management terminal through the technical interface, so that the background color of the front-end page is fused with the pictures of the page, and the effect of consistent color is achieved. However, in this way, the application scene can only be set and applied under the condition that the picture color is known, the application range is limited, and the operation cost is large when the method is applied to a plurality of pages, so the method is not adopted in general.
In addition, the color with the largest proportion in the picture of the current page can be obtained and filled in the background layer, so that when the background color of the page is fused with the picture, the consistency of the page color and the picture is ensured. The color with the widest color range in the uploaded picture is obtained through the program, but only one color with the widest color range in the picture page can be extracted, the display effect is single, the readability of the page cannot be guaranteed, and the user experience is possibly influenced.
Based on this, the disclosed embodiments provide a context determination method. Obtaining a foreground picture; the foreground picture is used as a background after being subjected to blurring and masking processing, the foreground picture is applied to the background layer, uniformity of page styles is facilitated, meanwhile, richness of global products can be guaranteed, the problem of single display effect is solved, and the display effect is enabled to be richer. In addition, in the embodiment of the disclosure, on the basis of applying the foreground picture to the background, a detection process of the contrast between the text content in the foreground and the background is added, and when the contrast between the text content and the background is lower than a preset contrast threshold, the preset transparency in the mask processing process is increased, so that the readability of the text content can be improved, and the text content can be understood to be clearer.
The background determination method provided by the embodiment of the disclosure can be applied to electronic equipment. Specifically, the electronic device may include a mobile phone, a computer, a tablet, and the like. The electronic device may include an electronic display screen, and the background determination method provided by the embodiment of the present disclosure is applied to an electronic display screen in an electronic device, for example, may be applied to an electronic display screen of a mobile phone, a computer, a tablet, and the like.
The embodiment of the disclosure provides a background determination method, which includes:
obtaining a foreground picture;
taking the masked picture as a background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture;
and in response to the contrast of the text content and the background being lower than a preset contrast threshold, increasing the preset transparency, wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, the text content is the text content in the foreground, and the foreground comprises the text content and the foreground picture.
In the embodiment of the disclosure, the foreground picture is processed to serve as a background, when the contrast between the text content of the foreground and the background is lower than a preset contrast threshold, the preset transparency of the mask is increased in the processing process, the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, and when the contrast between the text content and the background is lower than the preset contrast threshold, the preset transparency is increased, so that the readability of the text content can be improved.
In addition, the obtained foreground picture is applied to the background layer, so that the uniformity of the page style and the richness of global products are facilitated, and the uniqueness and the innovation of page design can be realized.
The embodiment of the disclosure can avoid that the readability is low due to the fact that some foreground pictures are processed as the background, and on the basis that the foreground pictures are applied as the background, when the contrast ratio of the text content of the foreground and the background is lower than the preset contrast threshold value, the preset transparency is increased, so that the readability of the text content can be improved and the reading experience of a user can be improved on the basis that the uniqueness and the innovativeness of the page design are guaranteed.
Fig. 1 is a flowchart of a background determination method provided in an embodiment of the present disclosure. Referring to fig. 1, a background determination method provided by the embodiment of the present disclosure includes:
and S101, acquiring a foreground picture.
The main picture in the current page may be obtained, or the picture uploaded by the user may also be obtained, such as obtaining the picture uploaded by the user in real time.
For example, the application scenario in the embodiment of the present disclosure may be to show a product for a merchant in an auction-type mall. In such a scenario, a merchant can upload a commodity picture, which is a foreground picture uploaded by a user.
And S102, taking the masked picture as a background.
The masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture. Firstly, blurring the foreground picture to obtain a blurred foreground picture, and then adding a mask with preset transparency on the basis of the blurred foreground picture to obtain a picture.
The blurring processing of the embodiment of the present disclosure may adopt any mode that can implement blurring processing on a picture. In one implementation, a gaussian blur may be applied to the foreground picture, with values of blur being 30, 35, etc.
The color of the background is within the same brightness range by adding the mask. The preset transparency may be determined according to actual requirements, for example, 85%, 80%, and so on.
In one approach, the foreground picture may be padded to the background; and carrying out fuzzy processing on the foreground picture filled into the background, and adding a mask with preset transparency to the foreground picture subjected to the fuzzy processing.
For example, the composition of the background is shown in FIG. 2, and includes a background picture layer and a mask layer, which can be understood to cover the background picture layer. The foreground picture may be filled into the background picture layer in the background first, wherein the foreground picture may be filled into the background picture layer in an equal ratio and in the middle. And then, blurring the foreground picture filled in the background picture layer, and adding a mask with preset transparency into the blurred picture.
In another mode, the foreground picture can be subjected to fuzzy processing, and a mask with preset transparency is added to the foreground subjected to the fuzzy processing; and filling the masked picture to the background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground.
In the embodiment of the present disclosure, the order of filling and processing the foreground picture is not limited, as long as the foreground picture can be processed and then used as the background, and in the embodiment of the present disclosure, a mode of processing after filling or a mode of processing before filling is adopted, so that the processing mode is more flexible.
And S103, in response to the contrast ratio of the text content and the background being lower than a preset contrast threshold, increasing the preset transparency.
Wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content.
The text content is the text content in the foreground, and the foreground includes the text content and the foreground picture, such as the content in the block 301, the block 302, the block 303, the block 304, and the block 305 in fig. 3, which constitute the foreground, wherein the content in the block 301, the block 302, and the block 303 can be understood as the text content in the foreground.
The contrast of the text content to the background may include a visual display contrast of the text content to the background. The lowest contrast, i.e. the preset contrast threshold, which guarantees readability of the text content may be determined from a visual point of view or the like.
In an implementation manner, the contrast of the text content and the background may also be understood as the contrast of the text color and the background color, i.e. the contrast of the color of the text content and the color of the background.
The contrast between the text content and the background is detected, and specifically, whether the contrast between the text content and the background is lower than a preset contrast threshold may be determined.
And if the contrast ratio of the text content and the background is lower than the preset contrast ratio threshold value, the preset transparency is increased.
In an implementation manner, the target transparency after the preset transparency is increased is not limited, that is, the transparency is increased on the basis of the preset transparency used when a mask is added, and the target transparency is increased to a certain extent without any requirement.
In another implementation, the target transparency is limited after the preset transparency is increased, for example, the increased transparency ensures that the contrast of the text content to the background is not lower than the preset contrast threshold.
Specifically, after the transparency is increased, whether the contrast between the text content and the background is lower than the preset contrast threshold value or not can be judged again, if the contrast between the text content and the background after the transparency is increased is still lower than the preset contrast threshold value, the transparency is continuously increased, and the like, until the contrast between the text content and the background can be lower than the preset contrast threshold value by the increased transparency.
For example, the preset transparency when the mask is added is 85%, and the preset transparency is adjusted to 100%.
Therefore, the text content in the foreground can be clearer by increasing the transparency of the mask, the readability of the text content is improved, and the text content can have the legibility.
The background is used in response to the text content not having a contrast with the background that is not below a preset contrast threshold.
The background is used if the contrast of the text content to the background is not lower than a preset contrast threshold, i.e. if the contrast of the text content to the background is greater than or equal to the preset contrast threshold. Namely, the masked picture is kept as the background, and the preset transparency is not adjusted when the mask is added.
The contrast ratio of the text content and the background is not lower than the preset contrast threshold, so that the readability of the text content can be guaranteed by the current background, the transparency of the mask in the background does not need to be adjusted, and the operation is simple and convenient on the basis of guaranteeing the readability of the text content.
In an alternative embodiment, the contrast between the text content and the background represents the contrast between the color of the text content and the color of the background, and the preset contrast threshold is the lowest color contrast that can ensure readability of the text content.
The judgment of whether the contrast between the text content and the background is lower than the preset contrast threshold may be to judge whether the color contrast between the text content and the background is lower than the preset contrast threshold, that is, to judge whether the contrast between the color of the text content and the color of the background is lower than the preset contrast threshold.
In one implementation, the preset contrast threshold is the minimum contrast required by the content accessible guide WCAG2.0 AA level: 4.5: 1.
in another implementation, the text in the large font is easier to read, and in an implementation, the minimum contrast required for WCAG2.0 AA level is 3:1 for the large font, i.e., the preset contrast threshold may be 3: 1.
In another implementation, the preset contrast threshold may be the lowest contrast required by WCAG2.0 AAA level: 7:1.
Minimum contrast required with a preset contrast threshold of WCAG2.0 AA rating: 4.5: the process of determining whether the contrast between the text content and the background is lower than the preset contrast threshold is described by taking 1 as an example, and when the preset contrast threshold is other values, the reference preset contrast threshold is: 4.5: 1.
The minimum contrast as required by WCAG2.0 AA rating is 4.5:1, if the contrast of the text content to the background is lower than 4.5:1, the WCAG2.0 AA specification is not met.
Whether the specification of WCAG2.0 AA level is met is checked through the contrast between the text content and the background in the embodiment of the present disclosure, and it may also be understood that whether the specification is available is judged through the contrast between the text content and the background. Specifically, it is determined whether the contrast of the text content with the background is lower than 4.5:1, in response to the contrast of the text content to the background being below 4.5:1, increasing the preset transparency; in response to the contrast of the text content with the background not being below 4.5:1, use background.
The WCAG2.0 AA level is a standard of specification, the contrast of the text content and the background is checked by utilizing the WCAG2.0 AA level specification, and the condition that the contrast does not meet the reading requirement can be accurately reflected, so that when the contrast does not meet the reading requirement, namely the contrast of the text content and the background is lower than a preset contrast threshold value, the preset transparency is increased, the transparency can be accurately increased according to the condition that the contrast does not meet the reading requirement, and the readability of the text content is ensured. And the contrast of the text content and the background is checked by using the WCAG2.0 AA-level specification without additionally calculating a preset contrast threshold, so that the complexity of determining that the contrast does not meet the condition is reduced, and the calculation process is simple and convenient on the basis of ensuring the readability of the text content.
The foreground picture is directly obtained and applied to the background layer, so that the uniformity of page styles and the richness of global products are facilitated, but problems may also exist in direct multiplexing, and the most important is whether the user has legibility on the foreground file, namely text content in the foreground. Therefore, important issues to be considered in the context determination process are: how to ensure the uniqueness and the innovativeness of the page design and on the basis of ensuring the uniqueness and the innovativeness of the page design, the reading experience of a user can be ensured.
In an implementation manner, in the embodiment of the present disclosure, a main picture in a current page is obtained and used as a background, gaussian blur processing is performed on the main picture filled in the background, and then a layer of mask with transparency is added to the picture subjected to the gaussian blur processing and used as the background of the current page.
In order to ensure that the overall effect of the page does not affect the reading and information acquisition of the user, whether the contrast between the generated background and the color of the characters (text content in the foreground) of the foreground is available or not is judged (for example, the minimum contrast is 4.5: 1).
If the contrast between the generated background and the text color of the foreground is higher than 4.5:1 (e.g., greater than or equal to 4.5:1), which indicates better legibility, as shown in fig. 4A, where legibility can also be understood as readability, the background generated in the above manner is used, that is, a mask with transparency is added to the picture after the gaussian blur processing as the background of the current page.
If the contrast between the generated background and the text color of the foreground is lower than 4.5:1 (e.g., less than 4.5:1), which indicates poor legibility, and as shown in fig. 4B, the transparency of the mask layer needs to be uniformly increased to 100%.
Therefore, the readability of the characters in the foreground can be ensured.
Because the colors of the pictures uploaded by the user are uncontrollable, the text content can not be clearly displayed, and effective measures are required to avoid the problem of clear display of the text content.
Based on this, in the embodiment of the present disclosure, contrast detection of a text color and a background color is adopted, adjustment is made according to WCAG2.0 AA-level specifications, after a user uploads a picture, the picture uploaded by the user is obtained, the picture is subjected to equal-ratio filling to a background and fuzzy processing, then a layer of mask is covered on the blurred picture, so that the picture can be unified in a brightness range, contrast detection is performed on the text color and the background formed after covering the mask, and after the contrast is lower than a value set in the WCAG2.0 AA-level specifications (the ratio of the text to the background contrast cannot be lower than 4.5:1), 85% of the transparency of the mask layer of the background is changed to 100%; so that the text content can have clear readability.
In the embodiment of the disclosure, the picture uploaded by the user can be obtained in real time, and then the picture is equally proportioned and filled in the middle on the background; then, carrying out image blurring processing on the picture filled in the background; then, a layer of mask with 85% transparency is added above the blurred picture, so that the colors are in the same brightness range.
Whether the text content in the foreground meets the WCAG2.0 AA standard is checked through the contrast ratio of the text (text content in the foreground) to the background, and it can also be understood that whether the contrast ratio of the text color of the generated background layer to the foreground is available is judged, and the minimum contrast ratio required by the WCAG2.0 AA standard is 4.5:1, it can be judged whether the contrast of the text and the background is lower than 4.5:1, the contrast of the text to the background is higher than 4.5:1, using the background layer generated in the above mode; when the contrast of the text to the background is lower than 4.5:1, the transparency of the mask layer needs to be increased to 100%, as shown in fig. 5, to ensure the readability of the text.
The embodiment of the disclosure can enable the page background not to be limited to pure color any more, visually improve richness of the page, bring visual freshness to a user, and effectively ensure that reading of the file is not influenced while different visual feelings are brought to the user.
Due to the instability of the network, there may be network delay, which may result in that the picture uploaded by the user cannot be obtained in time. For this situation, the embodiments of the present disclosure also have a corresponding processing mechanism. And in response to not acquiring the foreground picture uploaded by the user, using a default background.
For example, when the picture cannot be obtained in time due to network delay, the transparency of the mask of the background is also changed from 85% to 100%, and the color of the mask layer is the default background color.
Therefore, a mode of determining the background can be provided for the situation that the picture uploaded by the user cannot be obtained in time due to network delay possibly existing in practical application, and the situation that special situations cannot be processed is avoided.
The present disclosure also provides a background determination apparatus, as shown in fig. 6, which may include:
an obtaining module 601, configured to obtain a foreground picture;
the processing module 602 is configured to use the masked picture as a background, where the masked picture is obtained by adding a preset transparency to the blurred foreground picture;
and an increase transparency module 603, configured to increase the preset transparency in response to that a contrast of the text content with the background is lower than a preset contrast threshold, where the preset contrast threshold is a lowest contrast that can ensure readability of the text content, the text content is text content in a foreground, and the foreground includes the text content and a foreground picture.
Optionally, as shown in fig. 7, the apparatus further includes:
a first using module 701, configured to use the background in response to a contrast of the text content with the background not being lower than a preset contrast threshold.
Optionally, the processing module 602 is specifically configured to fill the foreground picture into the background; blurring the foreground picture filled in the background, and adding a mask with preset transparency to the foreground picture subjected to blurring; or, carrying out fuzzy processing on the foreground picture, and adding a mask with preset transparency to the foreground after the fuzzy processing; and filling the masked picture into the background.
Optionally, the contrast between the text content and the background indicates a contrast between a color of the text content and a color of the background, and the preset contrast threshold is a lowest color contrast that can ensure readability of the text content.
Optionally, as shown in fig. 8, the apparatus further includes:
a second using module 801, configured to use a default background in response to that a foreground picture uploaded by a user is not obtained.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 9 illustrates a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 9, the apparatus 900 includes a computing unit 901, which can perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The calculation unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
A number of components in the device 900 are connected to the I/O interface 905, including: an input unit 906 such as a keyboard, a mouse, and the like; an output unit 907 such as various types of displays, speakers, and the like; a storage unit 908 such as a magnetic disk, optical disk, or the like; and a communication unit 909 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 909 allows the device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 901 performs the respective methods and processes described above, such as the background determination method. For example, in some embodiments, the context determination method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 900 via ROM 902 and/or communications unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the context determination method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the context determination method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (13)

1. A background determination method, comprising:
obtaining a foreground picture;
taking the masked picture as a background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture;
and in response to the contrast of the text content and the background being lower than a preset contrast threshold, increasing the preset transparency, wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, the text content is the text content in a foreground, and the foreground comprises the text content and the foreground picture.
2. The method of claim 1, further comprising:
using the background in response to a contrast of text content to the background not being below a preset contrast threshold.
3. The method according to claim 1, wherein the using the masked picture as a background comprises:
filling the foreground picture into a background;
blurring the foreground picture filled into the background, and adding the mask with the preset transparency to the blurred foreground picture;
alternatively, the first and second electrodes may be,
blurring the foreground picture, and adding a mask with preset transparency to the blurred foreground;
and filling the masked picture into the background.
4. The method according to any one of claims 1 to 3, wherein the contrast of the text content to the background represents the contrast of the color of the text content to the color of the background, the preset contrast threshold being the lowest color contrast that can guarantee readability of the text content.
5. The method of claim 1, further comprising:
and in response to not acquiring the foreground picture uploaded by the user, using a default background.
6. A context determining apparatus, comprising:
the acquisition module is used for acquiring a foreground picture;
the processing module is used for taking the masked picture as a background, wherein the masked picture is obtained by adding a mask with preset transparency to the blurred foreground picture;
and the transparency increasing module is used for increasing the preset transparency in response to the contrast of the text content and the background being lower than a preset contrast threshold, wherein the preset contrast threshold is the lowest contrast capable of ensuring the readability of the text content, the text content is the text content in the foreground, and the foreground comprises the text content and the foreground picture.
7. The apparatus of claim 6, further comprising:
a first using module for using the background in response to a contrast of text content to the background not being below a preset contrast threshold.
8. The apparatus according to claim 6, wherein the processing module is specifically configured to fill the foreground picture to a background; blurring the foreground picture filled into the background, and adding the mask with the preset transparency to the blurred foreground picture; or, carrying out fuzzy processing on the foreground picture, and adding a mask with preset transparency to the foreground after the fuzzy processing; and filling the masked picture into the background.
9. The apparatus according to any one of claims 6 to 8, wherein the contrast of the text content to the background represents a contrast of a color of the text content to a color of the background, and the preset contrast threshold is a minimum color contrast that can guarantee readability of the text content.
10. The apparatus of claim 6, further comprising:
and the second using module is used for responding to the situation that the foreground picture uploaded by the user is not obtained and using the default background.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-5.
CN202111440883.4A 2021-11-30 2021-11-30 Background determination method, device, equipment and storage medium Pending CN114117281A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111440883.4A CN114117281A (en) 2021-11-30 2021-11-30 Background determination method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111440883.4A CN114117281A (en) 2021-11-30 2021-11-30 Background determination method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114117281A true CN114117281A (en) 2022-03-01

Family

ID=80368276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111440883.4A Pending CN114117281A (en) 2021-11-30 2021-11-30 Background determination method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114117281A (en)

Similar Documents

Publication Publication Date Title
CN113808231B (en) Information processing method and device, image rendering method and device, and electronic device
EP3876197A2 (en) Portrait extracting method and apparatus, electronic device and storage medium
CN112785493B (en) Model training method, style migration method, device, equipment and storage medium
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN113923474B (en) Video frame processing method, device, electronic equipment and storage medium
CN113836462A (en) Page description file generation method, device, equipment and storage medium
CN113392660A (en) Page translation method and device, electronic equipment and storage medium
CN113453073A (en) Image rendering method and device, electronic equipment and storage medium
CN114998897B (en) Method for generating sample image and training method of character recognition model
CN114882313B (en) Method, device, electronic equipment and storage medium for generating image annotation information
CN114117281A (en) Background determination method, device, equipment and storage medium
CN112861504A (en) Text interaction method, device, equipment, storage medium and program product
CN109062645B (en) Method and apparatus for processing information for terminal
CN113780297A (en) Image processing method, device, equipment and storage medium
CN113947146A (en) Sample data generation method, model training method, image detection method and device
CN113836455A (en) Special effect rendering method, device, equipment, storage medium and computer program product
CN113032251A (en) Method, device and storage medium for determining service quality of application program
CN113962240B (en) Picture processing method, device, electronic equipment and storage medium
CN113744414B (en) Image processing method, device, equipment and storage medium
CN116071422B (en) Method and device for adjusting brightness of virtual equipment facing meta-universe scene
CN113438428B (en) Method, apparatus, device and computer-readable storage medium for automated video generation
CN115599488A (en) Page display method and device, electronic equipment and storage medium
CN113160377B (en) Method, apparatus, device and storage medium for processing image
CN115481339A (en) Information presentation method, device, equipment and storage medium
CN112861058A (en) Visual node processing method, device, medium 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