A method, device, terminal and storage medium for page display
By identifying and adjusting the associated background area of the foreground object in the page, the problem of similar background and foreground colors in the prior art is solved, and the display effect and contrast of the page are improved.
Patent Information
- Application Number
- CN202010076679.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-23
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-01-23
AI Technical Summary
When adjusting the display mode with existing page display technology, the background image may have the same or similar color as the foreground object, reducing the contrast and affecting the display effect.
By identifying the associated background area of the foreground object in the target page in the target background image, the foreground object is adjusted according to the background pixel value of the associated background area to match the display mode, and the target page is generated.
This prevents the adjusted background image from having the same or similar color as the foreground object, thereby improving the display effect and contrast of the page.
Smart Images

Figure CN113157357B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and in particular, relates to a method, device, terminal and storage medium for page display. Background Art
[0002] Mobile phones, tablet computers and other terminal devices can adjust the color of each display object in the page according to the current display mode to match the page with the display mode. For example, in the dark display mode, the foreground objects such as text and icons can be inverted and the background can be dimmed, so that the displayed page matches the dark display mode. Since the adjustment process of the page background and foreground objects is performed separately, it is possible that the color of the adjusted page background and foreground objects is the same or close, which reduces the contrast between the foreground objects and the background and affects the display effect of the page. Summary of the invention
[0003] The embodiments of the present application provide a method, device, terminal and storage medium for page display, which can solve the problem of the existing page display technology that the same or similar colors may appear after the image and foreground object in the page are adjusted according to the display mode.
[0004] In a first aspect, an embodiment of the present application provides a method for displaying a page, including:
[0005] Adjust the original background image in the target page to a target background image corresponding to the current display mode;
[0006] Identifying the associated background area of each foreground object in the target page in the target background image;
[0007] adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area;
[0008] The target page is generated according to all the target objects and the target background image.
[0009] In a possible implementation manner of the first aspect, identifying the associated background area of each foreground object in the target page in the target background image includes:
[0010] Dividing the target background image into a plurality of candidate background regions;
[0011] The associated background area corresponding to the foreground object is selected from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image.
[0012] In a possible implementation manner of the first aspect, dividing the target background image into a plurality of candidate background areas includes:
[0013] Obtaining a minimum foreground size, and using the minimum foreground size as a determined block size;
[0014] The target background image is divided based on the block size to obtain a plurality of candidate background regions.
[0015] In a possible implementation manner of the first aspect, selecting the associated background area corresponding to the foreground object from the candidate background area according to the center coordinates of the foreground object and the boundary coordinates of the target background image includes:
[0016] According to the display position of each candidate background area in the target background image, assigning an associated reference row and column number to each candidate background area;
[0017]
[0018] Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0, SrcY0) are the boundary coordinates of the candidate background area; (pX, pY) are the center coordinates of the candidate background area; (Size x ,Size y ) is the area size of the candidate background area;
[0019] The center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:
[0020]
[0021] Wherein, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1, SrcY1) is the center coordinate of the foreground object; (Size x ,Size y ) is the area size of the candidate background area; (Target x ,Target y ) is the object size of the foreground object;
[0022] The candidate background region whose reference row and column number matches the target row and column number is selected as the associated background region of the foreground object.
[0023] In a possible implementation manner of the first aspect, the display mode is a dark display mode, and adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:
[0024] Get the pixel value and transparency of the center coordinates of the associated background area;
[0025] Determining a background brightness value of the associated background area according to the pixel value of the center coordinate and the transparency;
[0026] If the background brightness value is greater than a preset brightness threshold, the foreground object is subjected to brightness reduction processing to generate the target object;
[0027] If the background brightness value is less than or equal to the brightness threshold, the foreground object is inverted to generate the target object.
[0028] In a possible implementation manner of the first aspect, after determining the brightness value of the associated background area according to the pixel value of the center coordinate and the transparency, the method further includes:
[0029] Determining a characteristic brightness value corresponding to the foreground object according to the pixel value of each pixel point in the foreground object;
[0030] If the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold, the foreground object is subjected to brightness reduction processing to generate the target object;
[0031] If the brightness difference is less than or equal to the inversion threshold, the foreground object is inverted to generate the target object.
[0032] In a possible implementation manner of the first aspect, identifying the associated background area of each foreground object in the target page in the target background image includes:
[0033] Determining a display level of the foreground object within the target page;
[0034] Selecting, in the target page, a target background image at a level adjacent to the display level as an associated background image for the foreground object;
[0035] An associated background region of the foreground object within the associated background image is determined.
[0036] In a possible implementation manner of the first aspect, adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:
[0037] generating a preview object corresponding to the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object;
[0038] The target object corresponding to the foreground object is generated according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.
[0039] In a second aspect, an embodiment of the present application provides a device for displaying a page, including:
[0040] A background image adjustment unit, used to adjust the original background image in the target page to a target background image corresponding to the current display mode;
[0041] An associated background region identification unit, used for identifying an associated background region of each foreground object in the target page in the target background image;
[0042] a foreground object adjustment unit, configured to adjust the foreground object to a target object corresponding to the display mode according to a background pixel value of the associated background area;
[0043] The target page generating unit is used to generate the target page according to all the target objects and the target background image.
[0044] In a third aspect, an embodiment of the present application provides a terminal device, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the method for page display described in any one of the first aspects above is implemented.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the method for displaying a page described in any one of the first aspects above is implemented.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the page display method described in any one of the first aspects above.
[0047] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0048] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0049] The embodiment of the present application obtains a target background image by adjusting the original background image in the target page, and then determines an adjustment strategy for the foreground object based on the brightness value of the associated background area of each foreground object in the target background image, and generates a target object corresponding to the foreground object based on the adjustment strategy. Finally, a target page is generated based on the target background image and the target object. When adjusting the foreground object, the adjustment strategy is determined based on the associated background area, which avoids the adjusted background image and the foreground object having the same or similar color, thereby improving the display effect of the page. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] Figure 1 is a block diagram of a partial structure of a mobile phone provided in an embodiment of the present application;
[0052] Figure 2 is a schematic diagram of the software structure of a mobile phone in an embodiment of the present application;
[0053] Figure 3 This is a flow chart of a method for displaying a page provided in the first embodiment of the present application;
[0054] Figure 4 is a schematic diagram of a dark display mode provided by an embodiment of the present application;
[0055] Figure 5 is a schematic diagram of a dark display mode provided by an embodiment of the present application;
[0056] Figure 6 This is a schematic diagram of identifying an associated background area provided by an embodiment of the present application;
[0057] Figure 7 is a schematic diagram for identifying an associated background area provided by another embodiment of the present application;
[0058] Figure 8 This is a specific implementation flow chart of a page display method S302 provided in the second embodiment of the present application.
[0059] Fig. 9 It is a schematic diagram of the interaction of various processing units in the process of page display provided by an embodiment of the present application;
[0060] Fig.10 It is a schematic diagram of a process of displaying a page based on a dark display mode provided by an embodiment of the present application;
[0061] Fig.11 This is a specific implementation flow chart of a page display method S801 provided in the third embodiment of the present application;
[0062] Fig.12 is a schematic diagram of dividing the candidate background area provided in an embodiment of the present application;
[0063] Fig.13 This is a specific implementation flow chart of a page display method S802 provided in the fourth embodiment of the present application;
[0064] Fig.14 is a schematic diagram of selecting target row and column numbers provided in an embodiment of the present application;
[0065] Fig.15 This is a specific implementation flow chart of a page display method S304 provided in the fifth embodiment of the present application;
[0066] Fig.16 This is a specific implementation flow chart of a page display method provided in the sixth embodiment of the present application;
[0067] Fig.17 This is a specific implementation flow chart of a page display method S302 provided in the seventh embodiment of the present application;
[0068] Fig.18 This is a specific implementation flow chart of a page display method S303 provided in the eighth embodiment of the present application;
[0069] Fig.19 is a schematic diagram of generating a target object provided by an embodiment of the present application;
[0070] Fig. 20 This is a structural block diagram of a page display device provided by an embodiment of the present application;
[0071] Fig.21 A schematic diagram of a terminal device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0072] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0073] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0074] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0075] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0076] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0077] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0078] The page display method provided in the embodiment of the present application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc., and can also be applied to databases and servers with display functions and service response systems based on terminal artificial intelligence. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.
[0079] For example, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a computer, a laptop computer, a handheld communication device, a handheld computing device, and / or other devices for communicating on a wireless system and a next-generation communication system, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved Public Land Mobile Network (PLMN) network, etc.
[0080] As an example but not limitation, when the terminal device is a wearable device, the wearable device can also be a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing and shoes with shooting functions. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. It is attached to the user and is used to record images of the user during the movement or to collect environmental images according to shooting instructions initiated by the user. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those with full functions, large sizes, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application functions and need to be used in conjunction with other devices such as smartphones, such as various types of smart watches and smart bracelets with display screens.
[0081] Take the terminal device as a mobile phone as an example. Figure 1The block diagram shows a partial structure of a mobile phone provided in an embodiment of the present application. Figure 1 The mobile phone includes: a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a near field communication module 170, a processor 180, and a power supply 190. Those skilled in the art will understand that Figure 1 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0082] Combine the following Figure 1 A detailed introduction to the various components of the mobile phone:
[0083] The RF circuit 110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 180 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (SMS), etc., receive the page data about the target page sent by the server through the RF circuit 110, and generate the target page according to the page data.
[0084] The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120, such as storing the page data of the target page in the cache area of the memory 120, adjusting the page data according to the current display mode, and then generating the target page. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0085] The input unit 130 may be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the mobile phone 100. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, may collect user touch operations on or near it (such as operations performed by the user using a finger, stylus, or any other suitable object or accessory on or near the touch panel 131), and drive corresponding connection devices according to a pre-set program.
[0086] The display unit 140 can be used to display information input by the user or information provided to the user and various menus of the mobile phone, such as outputting an adjusted correction image. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 131 may cover the display panel 141. When the touch panel 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 1 In the embodiment, the touch panel 131 and the display panel 141 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 131 and the display panel 141 can be integrated to realize the input and output functions of the mobile phone.
[0087] The mobile phone 100 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0088] The mobile phone 100 may further include a camera 160. Optionally, the camera may be located at the front or rear of the mobile phone 100, which is not limited in the embodiment of the present application.
[0089] Optionally, the mobile phone 100 may include a single camera, a dual camera, or a triple camera, etc., which is not limited in the embodiments of the present application.
[0090] For example, the mobile phone 100 may include three cameras, one of which is a main camera, one is a wide-angle camera, and one is a telephoto camera.
[0091] Optionally, when the mobile phone 100 includes multiple cameras, all of the multiple cameras may be front-mounted, or all of the cameras may be rear-mounted, or some may be front-mounted and others may be rear-mounted, and this is not limited in the embodiments of the present application.
[0092] The terminal device can receive device information pages sent by other devices through the near field communication module 170. For example, the near field communication module 170 is integrated with a Bluetooth communication module, and establishes a communication connection with other mobile phones through the Bluetooth communication module, and receives device information fed back by other mobile phones, and generates a device information page corresponding to the other mobile phones. Figure 1 A near field communication module 170 is shown, but it is understandable that it is not an essential component of the mobile phone 100 and can be omitted as required without changing the essence of the application.
[0093] The processor 180 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.
[0094] The mobile phone 100 also includes a power source 190 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0095] The mobile phone 100 also includes an audio circuit and a speaker. The microphone can provide an audio interface between the user and the mobile phone. The audio circuit can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another mobile phone through the RF circuit 110, or the audio data is output to the memory 120 for further processing. For example, the user can collect the user's voice signal through the audio circuit, set the display mode of the mobile phone based on the voice signal, and adjust the target page displayed on the foreground based on the currently configured display mode, and output the target page corresponding to the current display mode.
[0096] Figure 2 1 is a schematic diagram of the software structure of the mobile phone 100 of the embodiment of the present application. Taking the operating system of the mobile phone 100 as an example, in some embodiments, the Android system is divided into four layers, namely, the application layer, the application framework layer (framework, FWK), the system layer and the hardware abstraction layer, and the layers communicate with each other through software interfaces.
[0097] like Figure 2 As shown, the application layer can be a series of application packages, and the application packages can include short message, calendar, camera, video, navigation, gallery, call and other applications.
[0098] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer may include some predefined functions, such as a function for receiving events sent by the application framework layer.
[0099] like Figure 2 As shown, the application framework layer may include a window manager, a resource manager, a notification manager, and the like.
[0100] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0101] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0102] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0103] The application framework layer may also include:
[0104] A view system, wherein the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures. The embodiment of the present application can be run in the application framework layer, and the text type objects in the target page are adjusted through the text control, and the background image in the target page is adjusted through the control for displaying pictures, and all the adjusted page data is encapsulated to generate the target page.
[0105] The phone manager is used to provide communication functions of the mobile phone 100, such as management of call status (including answering, hanging up, etc.).
[0106] The system layer may include multiple functional modules, such as sensor service module, physical state recognition module, 3D graphics processing library (such as OpenGL ES), etc.
[0107] The sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer and determine the physical state of the mobile phone 100;
[0108] Physical state recognition module, used to analyze and recognize user gestures, faces, etc.;
[0109] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0110] The system layer may also include:
[0111] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0112] The media library supports a variety of commonly used static image files, video format playback and recording, and audio, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0113] The hardware abstraction layer is a layer between hardware and software. The hardware abstraction layer may include display drivers, camera drivers, sensor drivers, microphone drivers, etc., which are used to drive related hardware of the hardware layer, such as display screens, cameras, sensors, and microphones.
[0114] In the embodiment of the present application, the execution subject of the process is a device installed with a program for page display. As an example but not limitation, the device for the program for page display can be a terminal device, which can be a smart phone, tablet computer, laptop computer, etc. used by a user. When receiving a display request, the target page corresponding to the display request is adjusted according to the current display mode, and the displayed target page is matched with the display mode. Figure 3 The following is a flowchart of the method for displaying a page according to the first embodiment of the present application, which is described in detail as follows:
[0115] In S301, the original background image in the target page is adjusted to a target background image corresponding to the current display mode.
[0116] In this embodiment, the terminal device is equipped with a display screen, and can respond to display requests initiated by the user through the display screen, such as displaying an operation interface in an application, or displaying images stored in a database through an album application, etc. Before performing the above display operation, the terminal device can adjust the content of the target page to be displayed through the page display method provided in this embodiment, so that the output target page matches the current display mode, thereby improving the consistency between the overall page and the display mode, and improving the display effect of the terminal device.
[0117] In a possible implementation, the display mode may be a dark display mode, also referred to as a "night mode", that is, in a dark display environment or according to the actual display needs of the user, the controls and display objects such as pictures in the display interface of the terminal device may be set to a display mode with a lower overall brightness value. It should be noted that the dark display mode does not adjust the brightness values of all objects in the page to a low brightness value, but the overall visual effect of the entire page belongs to a low brightness mode, that is, the average brightness value of the page is lower than a preset brightness threshold. For example, the background image in the page may be set to a low brightness image or a black background. At this time, in order to make the text and controls in the page visible to the user, the color of objects such as text or controls may be configured to white or a color with a higher brightness. However, since the display area of the above objects in the entire page is relatively small relative to the background image, the overall visual effect of the page still outputs a low brightness display mode, which matches the current display effect.
[0118] For example, Figure 4 A schematic diagram of a dark display mode provided by an embodiment of the present application is shown. Figure 4 (a) shows the display effect of a target page before adjusting to the dark display mode; Figure 4 (b) shows the display effect of the target page after adjusting to the dark display mode. Figure 4 As shown, the background image of the target page is a monochrome image, and its color is white, which is a color with relatively high brightness. At this time, the background image needs to be inverted and adjusted to a black background. And because the colors of other foreground objects in the original page are black, in order to make the content visible, the foreground image needs to be inverted accordingly, and the color of the foreground object is adjusted to white, so that the tone of the entire page is dark.
[0119] For example, Figure 5 A schematic diagram of a dark display mode provided by an embodiment of the present application is shown. Figure 5 (a) shows the display effect of a target page before adjusting to the dark display mode; Figure 5(b) shows the display effect of the target page after adjusting to the dark display mode. Figure 5 As shown, the background image of the target page is a multi-color mixed image. Since the multi-color mixed image cannot be processed by inverting the colors to achieve dark color (since inverting the colors will affect the display effect of the original image, and even fail to express the content that the image originally needs to express, the multi-color image will not be directly inverted, but will be), the dark color processing mainly reduces the contrast and brightness value of the background image. In the prior art, since each display object in the page is processed separately, the correlation between the objects is not considered. Therefore, for the text, icons and other contents, the inverting adjustment method is still adopted, so that the inverted text and image will be the same or similar in color to the background image after dark color processing, which reduces the visibility of the text, icons and other contents, affecting the overall display effect. It can be seen that the existing page display technology processes each display object separately, and in the page, different display objects are displayed overlapping with each other, and the same or similar colors may appear when they are combined and displayed. In order to avoid the above situation, the terminal device can first process the background image when adjusting the page, and then determine the corresponding adjustment strategy based on the associated background area of the foreground image in the background image, and make color adjustments that match the display mode, while ensuring the contrast between the foreground object and the background image, making the adjusted foreground object match the current display mode, avoiding the situation in which some objects on the generated target page are invisible due to the same or similar colors.
[0120] In a possible implementation, the display mode may also include: a strong contrast display mode and a high brightness mode, etc. If the display mode is a strong contrast mode, the contrast between the background image and the foreground object is required to be strong, and the terminal device may adjust the saturation, contrast, sharpness and other parameter values of the background image and the foreground object in subsequent operations to make the contrast of the page strong and match the display mode; correspondingly, when the display mode is a high brightness mode, the terminal device may adjust the highlight color area of the background image and the foreground object to increase the proportion of the highlight color area and reduce the proportion of the shadow color area to increase the brightness value of the entire page. The terminal device may determine a page adjustment strategy according to different display modes, and adjust each display object in the page based on the page adjustment strategy to make the adjusted target page match the current display mode.
[0121] In this embodiment, the terminal device may be configured with a default display mode, and the original page data of each target page may be data generated based on the default display mode, that is, in the default display mode, the target page is generated based on the original page data, and the original page data is not adjusted. The default display mode may be referred to as a normal display mode. If the terminal device detects that the current display mode is the default display mode, the received page data of the target page may be output and displayed without adjusting parameters such as the color or brightness of the display object in the page; conversely, if the terminal device detects that the current display mode is a non-default display mode, the page adjustment policy corresponding to the current display mode is obtained, and the display object in the target page is adjusted through the page adjustment policy, and related operations from S301 to S304 are performed.
[0122] In one possible implementation, when the terminal device detects that the user inputs a display mode change instruction, it will detect whether the page currently displayed in the foreground matches the changed display mode. If so, there is no need to adjust the currently displayed page; conversely, if the currently displayed page does not match the changed display mode, the currently displayed page will be used as the target page and the relevant operations of S301 to S304 will be performed.
[0123] In a possible implementation, after detecting that the display mode has changed, the terminal device obtains the applications currently running in the background and obtains the operation pages corresponding to each application, matches each operation page with the current display mode, and if any operation page does not match the current display mode, adjusts the page through S301 to S304.
[0124] In one possible implementation, the terminal device may also store page data of the target page in different display modes in a local memory, or the server corresponding to the target page may be configured with corresponding page data according to the display mode. The terminal device may obtain page data matching the current display mode from the local memory or page server, and output the target page based on the obtained page data; if the local memory or page server does not store page data matching the current display mode, the display object in the target page is adjusted through operations S301 to S304 to generate a target page corresponding to the display mode.
[0125] In the present embodiment, the target page can include multiple display objects, respectively background images and foreground objects. Wherein, the number of background images can be one or more, that is, the target page can be obtained by splicing multiple different background images, and the image size of each background image can also be different, or it can be matched with the display size of the terminal device, and the display size can also be adjusted according to the actual display content, which is not limited here. It should be noted that the background images can be superimposed on each other, and the background of the target page is formed according to the overlap between the multiple background images. Different background images can be configured with corresponding transparency so that the background image at the bottom and the background image at the upper layer are superimposed on each other to form the page background of the target page. In this case, when the terminal device adjusts the original background image to the target background image that matches the current implementation mode, it can first adjust the original background image of the bottom layer, and determine the adjustment strategy of the original background image of the adjacent upper layer based on the brightness value of the target background image of the bottom layer. If the brightness difference between the brightness value of the target background image of the bottom layer and the brightness value of the original background image of the adjacent upper layer is less than a preset adjustment threshold, the original background image of the upper layer is processed using the first adjustment algorithm (for example, the original background image of the adjacent upper layer is inverted); conversely, if the brightness difference between the brightness value of the target background image of the bottom layer and the brightness value of the original background image of the adjacent upper layer is greater than or equal to the preset adjustment threshold, the original background image of the upper layer is processed using the second adjustment algorithm (for example, the original background image of the adjacent upper layer is reduced in brightness).
[0126] In this embodiment, different display modes correspond to different adjustment algorithms. The terminal device can obtain the adjustment algorithm associated with the current display mode. The adjustment algorithm can be configured with different adjustment models according to different display object types, for example, a first adjustment model is used for background images, a second adjustment model is used for text objects, and a third adjustment model is used for icon objects. Of course, for the adjustment model of the same type of display object, different adjustment models can also be distinguished according to the object attributes. For example, when the background image is a monochrome background image, the first adjustment model is used; and for a multi-color background image, the second adjustment model is used; the corresponding adjustment model can also be determined according to the original color of the original background image. For example, if the average pixel value of the original background image is detected to be between (255, 125), the first adjustment model is used; if the average pixel value of the original background image is detected to be between (125, 0), the second adjustment model is used. The specific adjustment method used can be determined according to the display mode, image level, object type, and multiple dimensions of image chromaticity.
[0127] For example, the current display mode is a dark display mode, and an original background image is a monochrome black image. The terminal device obtains a page adjustment strategy corresponding to the dark display mode. The page adjustment strategy is divided into two different adjustment algorithms according to the background image and the foreground image, namely a first adjustment algorithm and a second adjustment algorithm. When it is detected that the current required adjustment object is the background image, the first adjustment algorithm is used to adjust the original background image. The first adjustment algorithm needs to recognize that the original background image is a monochrome image and the color is black. In this case, the original background image is not adjusted, and only the backlight brightness of the terminal device display needs to be reduced.
[0128] In S302, the associated background area of each foreground object in the target page in the target background image is identified.
[0129] In this embodiment, the target page includes a background image and a foreground object. The foreground object is specifically a display object displayed on the upper layer of the background image, and the foreground object includes but is not limited to: foreground icons, text, controls, touch animations, pop-up windows and other display objects.
[0130] In this embodiment, the object information of each foreground object may include the center coordinates of the target page and the object size of the foreground object. The terminal device may identify the associated background area corresponding to the foreground object according to the above two parameters, namely, the display position and the object size.
[0131] In one possible implementation, the associated background area can be determined as follows: if there are multiple background images in the target page, the terminal device uses the target background image corresponding to the background area in which the center coordinates of the foreground object fall as the target background image associated with the foreground object based on the background areas of the respective target background images; the terminal device determines the coverage area of the foreground object in the target background image based on the object size and center area of the foreground object, and identifies the coverage area as the associated background area of the foreground object in the target background image.
[0132] For example, Figure 6 FIG. 1 shows a schematic diagram of identifying an associated background area provided by an embodiment of the present application. Figure 6 As shown, the target page includes three background images, namely background image 1, background image 2 and background image 3. The target page also includes a foreground object, namely icon 1. The terminal device can determine the center coordinates of the foreground object by reading the object information of icon 1. If the center coordinates fall into the background area of background image 1, background image 1 is identified as the associated background image of icon 1. The terminal device extracts the corresponding associated background area in the associated background image according to the object size of icon 1.
[0133] In a possible implementation, the target page contains multiple target background images, and different target background images can be adjusted in transparency so that the bottom background image and the upper background image overlap each other to form the page background of the target page. In this case, a certain coordinate point can correspond to two different target background images at the same time. In this case, the terminal device can merge the visible layers of all target background images of the target page, that is, merge multiple target background images in different layers according to the transparency of each target background image to generate a merged background image, and then determine the associated background area corresponding to the foreground object from the merged background image.
[0134] For example, Figure 7 FIG. 2 shows a schematic diagram of identifying an associated background area provided by another embodiment of the present application. Figure 7 As shown, the target image includes background image 1 and background image 2. Background image 1 is located at the next display level of background image 2, and the foreground object is located at the previous display level of background image 2. In this case, the target background images corresponding to the foreground object are background image 1 and background image 2. Therefore, the terminal device can merge background image 1 and background image 2 to obtain a merged background image, and determine the corresponding associated background area in the merged background image according to the center coordinates and object size of the foreground object.
[0135] In S303, the foreground object is adjusted to a target object corresponding to the display mode according to the background pixel value of the associated background area.
[0136] In this embodiment, after determining the associated background area, the terminal device can calculate the background pixel value corresponding to the associated background area. The background pixel value can be the pixel mean of the associated background area. In this case, the terminal device can superimpose the pixel values of each pixel point in the associated background area, and calculate the pixel mean corresponding to the associated background area according to the accumulated value, and use the pixel mean as the background pixel value of the associated background area. Optionally, the terminal device can determine the weighted weight corresponding to each pixel point according to the distance value between each pixel point and the center coordinate of the associated background area, wherein the smaller the distance from the center coordinate, the larger the value of the corresponding weighted weight, and perform weighted accumulation based on the weighted weights and pixel values of each pixel point to obtain a weighted accumulated value, and average the weighted accumulated value to use the weighted mean as the background pixel value of the associated area.
[0137] In a possible implementation, the terminal device can downsample the target background image, that is, divide the target background image into multiple grid areas through a preset grid, and use the pixel value of the central coordinate point of each grid area as the pixel value of each grid area, thereby generating a downsampled image of the target background image. The terminal device determines the background pixel value of the associated background area according to the pixel value of the grid area corresponding to the associated background area in the downsampled image. If the display area of the foreground object covers two or more grid areas, the covered grid area is used as the associated background area of the foreground object, or the grid area where the center coordinates of the foreground object are located is used as the associated background area corresponding to the foreground area. If the associated background area corresponds to multiple grid areas, the average of the pixel values of each grid area can be used as the background pixel value of the associated background area.
[0138] In this embodiment, the terminal device may adjust the foreground object by obtaining a foreground pixel value of the foreground object and adjusting the foreground object according to the foreground pixel value, background pixel value and color tone corresponding to the current display mode.
[0139] In one possible implementation, if the display mode is a dark display mode, i.e., a night display mode, the terminal device may invert the foreground object if it is detected that the pixel difference between the foreground pixel value and the background pixel value is less than a preset contrast threshold; conversely, if it is detected that the pixel difference between the foreground pixel value and the background pixel value is greater than or equal to the preset contrast threshold, it means that before adjustment, the foreground object already had a high visibility when it was superimposed on the target background image for display. At this time, if the foreground object continues to be inverted, it will cause the foreground object to be superimposed on the target background area. Reduced visibility, therefore, the terminal device does not invert the foreground object, but instead reduces the brightness value of the foreground object to match the dark display mode.
[0140] In one possible implementation, if the display mode is a high contrast mode, if the terminal device detects that the pixel difference between the foreground pixel value and the background pixel value is less than a preset contrast threshold, the foreground object is inverted and the contrast between the foreground object and the target background image after the inversion is increased; conversely, if the pixel difference between the foreground pixel value and the background pixel value is detected to be greater than or equal to the preset contrast threshold, it indicates that the foreground object and the target background object already have a high contrast between the adjustments. In this case, there is no need to invert the foreground object, but instead the contrast of the foreground object is increased to obtain the target object.
[0141] In this embodiment, the target page may include multiple foreground objects. Operations S302 and S303 are performed on each foreground object to generate target objects for each foreground object. If it is detected that each foreground object has been adjusted, operation S304 may be performed.
[0142] In S304, the target page is generated according to all the target objects and the target background image.
[0143] In this embodiment, the terminal device can encapsulate the target objects corresponding to the adjusted foreground objects and the target background images corresponding to the original background images to generate a target page that matches the current display mode. In this case, the terminal device records the display coordinates and object levels of each foreground object in the target page. Similarly, the terminal device also records the display coordinates and object levels of each original background image in the target page. Based on the above parameters, the terminal device can determine the display area of each display object (i.e., the target object and the target background image) in the target page, and perform splicing and superimposition display to obtain the target page.
[0144] From the above, it can be seen that a page display method provided by an embodiment of the present application obtains a target background image by adjusting the original background image in the target page, and then determines the adjustment strategy of the foreground object according to the brightness value of the associated background area of each foreground object in the target background image, and generates the target object corresponding to the foreground object according to the adjustment strategy, and finally generates the target page according to the target background image and the target object. When adjusting the foreground object, the adjustment strategy is determined according to the associated background area, which avoids the adjusted background image and the foreground object having the same or similar color, thereby improving the display effect of the page.
[0145] Figure 8 The specific implementation flow chart of a method S302 for page display provided in the second embodiment of the present application is shown. Figure 8 , relative to Figure 3 In the embodiment, in a method for displaying a page provided in this embodiment, S302 includes: S801 to S802, which are described in detail as follows:
[0146] Furthermore, the identifying the associated background area of each foreground object in the target page in the target background image includes:
[0147] In S801, the target background image is divided into a plurality of candidate background regions.
[0148] In this embodiment, the terminal device can divide the target background image into regions, thereby dividing a target background image with a larger area into multiple candidate background regions with smaller areas, so that it is convenient to determine the associated background region in the subsequent adjustment process of the foreground object. Since the background region matching the object shape is intercepted from the target background image as the associated background region of the foreground object according to the object shape of the foreground object, the amount of calculation is large, not only the contour information of the foreground object needs to be obtained, but also the region frame needs to be taken from the target background region according to the contour information, not only the area size of each candidate background region extracted is inconsistent, but also when there are many foreground objects and the contour is more complicated, more computing resources are consumed to perform the identification operation of the associated background region, thereby reducing the generation efficiency of the target page, prolonging the time consumption of page generation, and reducing the user's experience. Therefore, the terminal device can divide the target background image into multiple candidate background regions according to the pre-division rule, so that when determining the associated background region, it can be selected from the candidate background region, without intercepting in the target background image according to the object contour of the foreground object, reducing the amount of calculation of the terminal device, thereby improving the generation efficiency of the target page.
[0149] In a possible implementation, the terminal device may generate grid lines with the preset region shape as a unit, divide the target background image based on the grid lines, and thus generate multiple candidate background regions. The region shape may be a polygon such as a rectangle, square, or triangle.
[0150] In a possible implementation, the terminal device can identify the object size of each foreground object in the target page, select the object size with the smallest value as the target size, configure a grid based on the target size, and divide the target background image into multiple candidate background areas based on the above grid. Configuring the grid according to the minimum value of the object size of the foreground object can enable each foreground object to select a candidate background area that matches its shape and size, avoid multiple foreground objects corresponding to the same associated background area due to the candidate background area being too large, and can also reduce the number of blocks of the candidate background area as much as possible, thereby improving the selection efficiency. Since the image is actually divided into regions, it is actually a downsampling process. Therefore, the higher the downsampling ratio, the greater the improvement in the computing speed. Grid division according to the minimum size of the foreground object can not only improve the computing speed, but also ensure the consistency between the associated background area and the foreground object, thereby improving the accuracy of subsequent adjustment operations.
[0151] In S802, the associated background area corresponding to the foreground object is selected from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image.
[0152] In this embodiment, when the terminal device configures the display position of each foreground object, the display position is the position of the foreground object relative to the display screen. However, since each target background image has a corresponding display area, when it is necessary to determine the associated background area of the foreground object in the target background image, it is necessary to consider the display area of each candidate background area in the target background image relative to the display screen, so that the associated background area of the foreground object can be identified. Based on this, the terminal device needs to obtain the boundary coordinates of the target background image, and the display area of the target background area can be determined according to any boundary coordinate and the image size of the target background image. And according to the display position of each candidate background area on the target background image, the display area corresponding to each candidate background area can be determined, and the display area where the central coordinates of the foreground object fall can be identified, that is, the associated background area of the foreground object in the target background image can be determined.
[0153] In one possible implementation, the method for identifying the associated background area can be: determining the display area of the target background image based on the boundary coordinates and image size of the target background image, determining the display area of each candidate background area based on the position of each candidate background area, determining the area coordinates of each candidate background area based on the display area of each candidate background area, calculating the distance value between the area coordinates and the center coordinates of the foreground object, and selecting the candidate background area whose distance value is less than a preset distance threshold as the associated background area.
[0154] For example, Fig. 9 FIG. 1 shows a schematic diagram of the interaction of various processing units in the process of page display provided by an embodiment of the present application. Fig. 9 As shown, the terminal device includes a display mode adjustment unit, a bitmap processing unit, a background image adjustment unit, a historical layer color library and a foreground object processing unit. The specific implementation process is as follows:
[0155] 1. The display module adjustment unit can be used to parse the display objects contained in the target page, and hand over the original background image in the target page to the bitmap processing unit for processing;
[0156] 2. The display module adjustment unit may import the foreground objects obtained by the analysis into the foreground object processing unit, wherein before importing the foreground object processing unit, the display module adjustment unit may determine the center coordinates and object colors of each foreground object; it should be noted that the above steps 1 and 2 may be performed simultaneously;
[0157] 3. After obtaining the original background image, the bitmap processing module can parse at least one boundary coordinate and image size corresponding to the original background image. In particular, the pixel information of the background image can be determined, such as the average pixel value, characteristic pixel value, and color types contained in the background image.
[0158] 4. Importing the original background image containing pixel information and coordinate information into the background image adjustment unit, adjusting the original background image according to the pixel information and an adjustment algorithm matching the current display mode to obtain a target background image, importing the target background image into the preprocessing unit, and dividing the target background image into regions to obtain multiple candidate background regions through the preprocessing unit;
[0159] 5. After dividing the target background image, the historical layer color library can store and record the colors of each layer to generate a corresponding database. Specifically, the historical layer color library can identify the background pixel values corresponding to each target background area and return each background pixel value to the background image adjustment unit;
[0160] 6. The background image adjustment unit can send the divided target background image and the background pixel values of each candidate background area to the foreground object processing unit;
[0161] 7. The foreground image processing unit can adjust each foreground object according to the pixel value of each candidate background area and the corresponding display area to generate a target object;
[0162] 8. The target object output by the forward image processing unit is returned to the display mode adjustment unit, and the display mode adjustment unit merges the target object and the target background image to generate a target page.
[0163] For example, Fig.10 FIG. 1 shows a schematic diagram of a process of displaying a page based on a dark display mode provided by an embodiment of the present application. Fig.10As shown, the target page includes four different display objects, namely, the root view Rootview, the background layer ImageView, the first foreground text TextView1 and the second foreground text TextView2. The terminal device imports the above four display objects into the preprocessing unit at the same time, and determines the corresponding preprocessing method, wherein the preprocessing unit can determine the adjustment method of each object to be displayed in turn according to the order of the display levels of each display object. Since Rootview is at the bottom display level, the preprocessing unit first determines the adjustment method of Rootview. The Rootview is a monochrome image, so when adjusting the dark display mode, the monochrome image needs to be inverted; and ImageView is a second-level display object, and it is a multi-color background image, then when adjusting the dark display mode, the brightness value of ImageView is reduced without performing inversion processing; finally, for TextView1 and TextView2, which are third-level display objects, and the background image of the previous level is ImageView, a brightness reduction process is performed. At this time, if TextView1 and TextView2 are inverted, the inverted text object will be the same or similar in color to the associated background area. Therefore, the terminal device changes the original inversion processing strategy and adopts a brightness reduction process. The terminal device identifies the adjustment strategy of each display object through the preprocessing unit, adjusts each adjustment strategy and the display object through the adjustment unit, outputs the target background image and the target object, and generates the target page based on the target background object and the target object.
[0164] In an embodiment of the present application, the target background image is divided into blocks to obtain multiple candidate background areas, and the associated target background areas are selected from the candidate background areas based on the center coordinates of each foreground object, thereby improving the selection efficiency of the associated background areas and reducing the construction time of the target page.
[0165] Fig.11 A specific implementation flow chart of a method S801 for page display provided in the third embodiment of the present application is shown. Fig.11 , relative to Figure 8 In the embodiment, a method for displaying a page provided in this embodiment, S801 includes: S1101 to S1102, which are described in detail as follows:
[0166] Furthermore, dividing the target background image into a plurality of candidate background areas includes:
[0167] In S1101, a minimum foreground size is obtained, and the minimum foreground size is used as a determined block size.
[0168] In this embodiment, when the terminal device divides the target background image into regions, it needs to obtain the size of the basic region, that is, the above-mentioned block size. The terminal device can determine the block size by detecting the minimum size of the foreground object contained in the target page, or it can determine the above-mentioned block size according to the minimum foreground size of the industry standard.
[0169] In S1102, the target background image is divided based on the block size to obtain a plurality of candidate background regions.
[0170] In this embodiment, after determining the block size corresponding to each grid, the display screen can be divided into multiple regions based on the block size, and multiple candidate background regions can be obtained according to the grids covered by the target background image in the display screen. Fig.12 FIG. 4 shows a schematic diagram of dividing the candidate background area provided by an embodiment of the present application. Fig.12 As shown, the target page contains two background images, namely background image 1 and background image 2, wherein the boundary coordinates of background image 1 do not overlap with the boundary of the display screen. After obtaining the block size, the terminal device can divide the entire display screen based on the block size to obtain multiple blocks. Background image 1 and background image 2 can be divided into regions according to the generated grid lines to obtain multiple candidate background regions. Among them, background image 1 contains 3*2 candidate background regions, and its first candidate background region has a row and column number of the first row and the second column relative to all background regions of the display screen, and has a certain offset from the screen boundary.
[0171] In an embodiment of the present application, by identifying the resolution of the display, determining the block size, and dividing the target background image into regions based on the block size, a plurality of candidate background regions are obtained, thereby improving the accuracy of the block division and avoiding overlap of the associated background regions of the foreground object.
[0172] Fig.13 FIG. 4 shows a specific implementation flow chart of a method S802 for page display provided in the fourth embodiment of the present application. Fig.13 , relative to Figure 8 In the embodiment, in a method for displaying a page provided in this embodiment, S802 includes: S1301 to S1303, which are described in detail as follows:
[0173] Further, selecting the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image includes:
[0174] In S1301, according to the display position of each candidate background area in the target background image, an associated reference row and column number is configured for each candidate background area;
[0175]
[0176] Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0, SrcY0) are the boundary coordinates of the candidate background area; (pX, pY) are the center coordinates of the candidate background area; (Size x ,Size y ) is the area size of the candidate background area.
[0177] In this embodiment, after the terminal device divides the target background image into multiple candidate background areas, it can configure the corresponding reference row and column numbers according to the display position of each candidate background area in the target background image, determine the position of each candidate background area through grid coordinates, and realize downsampling processing of the target background image.
[0178] It should be noted that if the target page contains multiple foreground objects, it is only necessary to perform the S1301 operation once, that is, to determine the baseline row and column numbers of each candidate background area. Since the target background area is gridded, it is only necessary to determine the approximate position of the foreground object when identifying the associated background area, thereby reducing the amount of calculation when selecting the associated background area, thereby improving the selection efficiency of the associated background area.
[0179] In S1302, the center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:
[0180] The center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:
[0181]
[0182] Wherein, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1, SrcY1) is the center coordinate of the foreground object; (Size x ,Size y ) is the area size of the candidate background area; (Target x ,Target y ) is the object size of the foreground object.
[0183] In this embodiment, when calculating the row and column numbers, the terminal device may uniformly use a rounding-down method to calculate the target row and column numbers and the reference row and column numbers. In this case, the above conversion formula may be changed to:
[0184]
[0185] in, is the rounding function.
[0186] For example, if the center coordinates of a foreground object are (25, 25), and the object size of the foreground object is 3*3 pixels, and the area size of each of the candidate background areas is 5*5, then the value of the target row number calculated by the above formula is: (25+3 / 2) / 5=5.3, which is rounded down by the rounding function to 5.
[0187] In this embodiment, since there is a certain offset between the target background image and the display screen, in order to determine the relative position between the foreground object and the target background image, when calculating the target row and column number corresponding to the foreground object in the target background image, it is necessary to consider the offset corresponding to the boundary coordinates of the target background image. Among them, the boundary coordinates are specifically the boundary points closest to the coordinate origin corresponding to the display screen. For example, if the origin coordinates of the display screen are the screen boundary points in the upper left corner, then the boundary coordinates of the target background image are the corresponding boundary coordinates of the upper left corner of the target background image in the coordinate system of the display screen.
[0188] Fig.14 FIG. 1 shows a schematic diagram of selecting target row and column numbers provided by an embodiment of the present application. Fig.14 As shown in FIG. 1 , the target background image does not completely overlap with the screen boundary of the terminal device, but has a certain offset, namely (SrcX0, SrcY0). When determining the target row and column number of the foreground object relative to the target background area, the above offset needs to be considered to avoid misalignment of the selection of the associated background area due to the above offset, such as Fig.14 As shown, if the above-mentioned offset is not taken into account, the foreground object is equivalent to the entire display screen, and the corresponding row and column number is (3,1), while the row and column number relative to the target background area is (2,1). Because there is a certain offset between the horizontal coordinate of the target background image and the coordinate origin of the display screen, if the associated background area is obtained based on the row and column number (3,1), the background area will be misaligned, thereby affecting the subsequent adjustment effect.
[0189] In S1303, the candidate background region whose reference row and column number matches the target row and column number is selected as the associated background region of the foreground object.
[0190] In this embodiment, the terminal device may select, from the candidate background regions, a candidate background region whose reference row and column numbers match the target row and column numbers as the associated background region.
[0191] In the embodiment of the present application, by performing row and column encoding on the candidate background areas and configuring a corresponding associated background area for each foreground object according to the row and column numbers, the efficiency of selecting the associated background areas can be improved.
[0192] Fig.15 FIG. 5 shows a specific implementation flow chart of a method S304 for displaying a page provided in the fifth embodiment of the present application. Fig.15 , relative to Figure 3 In the embodiment, the method for displaying a page provided in this embodiment includes S304: S1501 to S1504, which are described in detail as follows:
[0193] Furthermore, if the display mode is a dark display mode, then adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:
[0194] In S1501, the pixel value and transparency of the center coordinates of the associated background area are obtained.
[0195] In this embodiment, in order to improve the efficiency of adjustment, the terminal device can use the pixel value of the center coordinates of each candidate background area of the target background image as the characteristic pixel value of the entire candidate background area, so that in the process of adjusting the foreground image, the target background image can be downsampled to a grid image, and the pixel value and transparency of each grid image can be determined according to the pixel value and transparency of the center coordinate, thereby reducing the storage space of the target background image in the cache area and improving the processing efficiency of subsequent operations.
[0196] In S1502, the background brightness value of the associated background area is determined according to the pixel value of the central coordinate and the transparency.
[0197] In this embodiment, in addition to being related to the pixel value, the background brightness value is also related to the transparency of the target background image. According to the degree of transparency, the color contribution ratio of the next layer to the current target background image can be determined. For example, if the image of the next layer of the target background image is a white image and the current transparency is not 0, then on the basis of the original pixel value, the proportion of white is superimposed to increase the brightness value of the overall image. Based on this, in order to accurately determine the pixel value of the target background image so as to determine the adjustment strategy of the foreground object, the terminal device can calculate the background brightness value of the associated background area according to the pixel value of the center coordinate and the transparency.
[0198] In S1503, if the background brightness value is greater than a preset brightness threshold, the foreground object is subjected to brightness reduction processing to generate the target object.
[0199] In this embodiment, since the current display mode is a dark display mode, the brightness value of the entire picture needs to be adjusted. If the brightness value of the associated background area is detected to be greater than the preset brightness threshold, it means that the current associated background area is at a higher brightness, and the default color of the foreground object before adjustment is often a low-brightness color such as black. If the above color is inverted at this time, it will be changed to a high-brightness color, resulting in the adjusted associated background image being the same or similar to the color of the adjusted foreground object. In order to avoid the above situation, the terminal device does not invert the foreground object, but reduces the brightness of the foreground object, thereby generating a target object with lower brightness.
[0200] Among them, the method of reducing the brightness can be: the terminal device converts the foreground object into an image in HSV format, adjusts the value of the brightness V layer, and merges the adjusted V layer with the other two images, thereby achieving the purpose of reducing the brightness of the foreground object.
[0201] In S1504, if the background brightness value is less than or equal to the brightness threshold, the foreground object is inverted to generate the target object.
[0202] In this embodiment, if the terminal device detects that the brightness value of the current associated background area is less than or equal to the brightness threshold, the foreground object can be inverted. Since the default color of the foreground object before adjustment is often a low-brightness color such as black, it will be changed to a higher-brightness color after the inversion process. At this time, there is a higher color contrast between the foreground object and the associated background, making the foreground object clearly visible, thereby improving the visibility of the foreground object.
[0203] In an embodiment of the present application, by identifying and obtaining the pixel value and transparency of the center coordinates of the associated background area, the brightness value of the associated background area is determined, and the adjustment strategy of the foreground object is determined based on the brightness value to avoid the background and foreground objects having the same or similar colors, thereby improving the adjustment effect.
[0204] Fig.16 The following is a flowchart showing a specific implementation of a method for displaying a page provided in the sixth embodiment of the present application. Fig.16 , relative to Fig.15 The embodiment, a method for displaying a page provided by the embodiment, after determining the brightness value of the associated background area according to the pixel value of the center coordinate and the transparency, further includes: S1601 to S1603, which are described in detail as follows:
[0205] Further, after determining the brightness value of the associated background area according to the pixel value of the central coordinate and the transparency, the method further includes:
[0206] In S1601, a characteristic brightness value corresponding to the foreground object is determined according to the pixel value of each pixel point in the foreground object.
[0207] In this embodiment, in addition to directly determining the adjustment strategy of the foreground image according to the brightness value, the terminal device can also determine the adjustment strategy according to the actual brightness value of the foreground object. In this case, the terminal device can calculate the pixel mean of the foreground object according to the pixel values of each pixel point in the foreground object, and determine the characteristic brightness value of the foreground object based on the pixel mean. In a possible implementation, the terminal device can select the pixel value of the center coordinate of the foreground object as the characteristic pixel value of the foreground object, and calculate the characteristic brightness value of the foreground object based on the characteristic pixel value of the center coordinate.
[0208] In S1602, if the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold, the foreground object is subjected to brightness reduction processing to generate the target object.
[0209] In this embodiment, if the terminal device detects that the brightness difference between the background brightness value and the characteristic brightness value of the foreground object before adjustment is greater than the preset inversion threshold, it means that the contrast before adjustment has met the display requirements, and there is no need to invert the foreground object, only the brightness needs to be adjusted.
[0210] In S1603, if the brightness difference is less than or equal to the inversion threshold, the foreground object is inverted to generate the target object.
[0211] In this embodiment, if the terminal device detects that the brightness difference between the background brightness value and the characteristic brightness value of the foreground object before adjustment is less than or equal to the preset inversion threshold, it means that the contrast difference before adjustment is small. At this time, inversion processing is performed on the foreground object, which can improve the contrast between the foreground object and the background image, so inversion processing is performed.
[0212] In the embodiment of the present application, by acquiring the characteristic brightness value of the foreground object and determining the adjustment strategy according to the difference between the characteristic brightness value and the background brightness value, the accuracy of the adjustment operation can be improved.
[0213] Fig.17 FIG. 5 shows a specific implementation flow chart of a method S302 for displaying a page provided in the seventh embodiment of the present application. Fig.17 , relative to Figure 3 , Figure 8 , Fig.11 , Fig.13 , Fig.15 as well as Fig.16 In any of the above embodiments, a method for displaying a page provided in this embodiment includes, in S302, S1701 to S1703, which are described in detail as follows:
[0214] Furthermore, the identifying the associated background area of each foreground object in the target page in the target background image includes:
[0215] In S1701, the display level of the foreground object in the target page is determined.
[0216] In this embodiment, the target page may include multiple layers, each layer corresponds to a display level, the foreground object is often at a higher display level, and the background image is often at a lower display level, thereby achieving a display effect in which the background image is used as the base and the foreground object covers the background image. In this case, a page can be superimposed with multiple background images to form the background of the entire page, that is, a foreground object can correspond to different background images at different display levels, and the visibility of the foreground object and whether the color is the same or similar are often affected by the background image at the adjacent level. In this case, the terminal device needs to determine the background image at the adjacent display level to the foreground object, and therefore needs to identify the display level of the foreground object in the target page.
[0217] In S1702, a target background image at a level adjacent to the display level is selected in the target page as an associated background image of the foreground object.
[0218] In this embodiment, the terminal device may obtain the display level of each target background image, and select a target background image whose display level is adjacent to the display level of the foreground object as the associated background image of the foreground object.
[0219] In S1703, an associated background area of the foreground object in the associated background image is determined.
[0220] In this embodiment, after determining the associated background object of the forward object, the terminal device can determine the corresponding associated background area from the associated background image according to the display position of the foreground object. The method for determining the associated background area can refer to the relevant description of S302, and can also be determined by the methods provided in the second to fourth embodiments, which will not be repeated here.
[0221] In an embodiment of the present application, by determining the target background image adjacent to the foreground object level as the associated background image, the associated background area can be accurately determined when multiple background images are superimposed, thereby improving the accuracy of determining the subsequent adjustment method.
[0222] Fig.18 FIG. 8 shows a specific implementation flow chart of a method S303 for page display provided in the eighth embodiment of the present application. Fig.18 , relative to Figure 3 , Figure 8 , Fig.11 , Fig.13 , Fig.15 as well as Fig.16 In any of the above embodiments, a method for displaying a page provided in this embodiment includes, in S303: S1801 to S1802, which are described in detail as follows:
[0223] Further, adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes:
[0224] In S1801, a preview object corresponding to the foreground object is generated according to the background pixel value of the associated background area and the pixel value of the foreground object.
[0225] In this embodiment, in addition to determining the adjustment method of the foreground object according to the upper and lower levels, the terminal device can also determine its own adjustment method according to the adjustment methods of the adjacent foreground objects at the same level, thereby ensuring the consistency of the overall display effect. In this case, the terminal device can generate a preview object of the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object. The above method is executed for all foreground objects. At this time, the preview object is not the display effect of the adjusted foreground object output at the end.
[0226] In S1802, the target object corresponding to the foreground object is generated according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.
[0227] In this embodiment, the terminal device can generate a corresponding preview page based on all preview objects, and the terminal device can determine the associated object corresponding to each preview object based on the display position of each preview object. The associated object is another preview object that has an associated relationship with the preview object after being processed by S1801. The above-mentioned associated relationship can be that the display positions of the two preview objects are adjacent; the object types of the two preview objects can also be the same; in particular, if the two preview objects are text objects, and the above-mentioned two preview objects are located in the same sentence or paragraph, it can be identified that the above-mentioned two preview objects have an associated relationship.
[0228] In this embodiment, the terminal device can identify whether the difference between the pixel values of the preview object and the associated object is less than a preset association threshold. If so, it is recognized that the display effects between the preview object and the associated object are unified, and the preview object is taken as the target object; conversely, if it is detected that the pixel difference between the preview object and the associated object is greater than or equal to the association threshold, it is recognized that the display effects between the preview object and the associated object are not unified. At this time, according to the pixel average values of the preview object and the associated object, the preview object and the associated object can be adjusted, and the adjusted preview object is taken as the target object for display.
[0229] Fig.19 FIG. shows a schematic diagram of the generation of the target object provided by an embodiment of the present application. Refer to Fig.19 FIG. (a) is a preview page generated based on each preview object; while Fig.19 FIG. (b) is a target page obtained by adjusting the preview object based on the associated object. Refer to Fig.19 It can be determined that there are four foreground objects in this preview page, namely the texts "front", "scene", "object", and "image". Among them, after being adjusted according to the associated background area, the preview object of the text "front" is adjusted to white, while the preview objects of other texts are adjusted to black. Since the above four objects are associated objects, the display effects need to be unified. Therefore, the text "front" can be adjusted to the same display effect as that of other associated objects, that is, adjusted to black, so as to ensure the consistency of the display effects of the associated texts.
[0230] In the embodiment of the present application, through the associated objects of each foreground object at the same level, the adjustment strategy of the foreground object is determined according to the associated object, which ensures the unity of the display effects between the associated objects at the same level and improves the display effect.
[0231] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0232] Corresponding to the page display method described in the above embodiments, Fig. 20 FIG. shows a structural block diagram of a page display device provided by an embodiment of the present application. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown.
[0233] Refer to Fig. 20 The page display device includes:
[0234] A background image adjustment unit 201, configured to adjust the original background image in the target page to a target background image corresponding to the current display mode;
[0235] The associated background region identifying unit 202 is used to identify the associated background region of each foreground object in the target page in the target background image;
[0236] A foreground object adjustment unit 203, configured to adjust the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area;
[0237] The target page generating unit 204 is configured to generate the target page according to all the target objects and the target background image.
[0238] Optionally, the associated background area identification unit 202 includes:
[0239] A candidate background region division unit, used for dividing the target background image into a plurality of candidate background regions;
[0240] The candidate background area selection unit is used to select the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image.
[0241] Optionally, the candidate background area division unit includes:
[0242] A block size determination unit, used to obtain a minimum foreground size, and use the minimum foreground size as a determined block size;
[0243] A grid division unit is used to divide the target background image based on the block size to obtain a plurality of candidate background areas.
[0244] Optionally, the candidate background area selection unit includes:
[0245] A reference row and column number acquisition unit, configured to configure an associated reference row and column number for each candidate background area according to the display position of each candidate background area in the target background image;
[0246]
[0247] Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0, SrcY0) are the boundary coordinates of the candidate background area; (pX, pY) are the center coordinates of the candidate background area; (Size x ,Size y ) is the area size of the candidate background area;
[0248] The target row and column number acquisition unit is used to import the center coordinates of the foreground object into a preset row and column conversion model to calculate the target row and column number of the foreground object; the row and column conversion model is specifically:
[0249] The center coordinates of the foreground object are imported into a preset row-column conversion model to calculate the target row and column number of the foreground object; the row-column conversion model is specifically:
[0250]
[0251] Wherein, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1, SrcY1) is the center coordinate of the foreground object; (Size x ,Size y ) is the area size of the candidate background area; (Target x ,Target y ) is the object size of the foreground object;
[0252] The associated background region determining unit is used to select the candidate background region whose reference row and column number matches the target row and column number as the associated background region of the foreground object.
[0253] Optionally, the display mode is a dark display mode, and the foreground object adjustment unit 203 includes:
[0254] A center coordinate acquisition unit, used to acquire the pixel value and transparency of the center coordinate of the associated background area;
[0255] A background brightness value determining unit, configured to determine a background brightness value of the associated background area according to the pixel value of the central coordinate and the transparency;
[0256] A first brightness reduction processing unit, configured to reduce the brightness of the foreground object to generate the target object if the background brightness value is greater than a preset brightness threshold;
[0257] The first inversion processing unit is used to perform inversion processing on the foreground object to generate the target object if the background brightness value is less than or equal to the brightness threshold.
[0258] Optionally, the page display unit further includes:
[0259] a characteristic brightness value acquisition unit, configured to determine a characteristic brightness value corresponding to the foreground object according to the pixel value of each pixel point in the foreground object;
[0260] A second brightness reduction processing unit is used to reduce the brightness of the foreground object to generate the target object if the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold;
[0261] The second color inversion processing unit is used to perform color inversion processing on the foreground object to generate the target object if the brightness difference is less than or equal to the color inversion threshold.
[0262] Optionally, the associated background area identification unit 202 includes:
[0263] A display level determination unit, used to determine the display level of the foreground object in the target page;
[0264] An associated background image determining unit, configured to select, within the target page, a target background image at a level adjacent to the display level as an associated background image for the foreground object;
[0265] The associated background area determining unit is used to determine the associated background area of the foreground object in the associated background image.
[0266] Optionally, the foreground object adjustment unit 203 includes:
[0267] A preview object generating unit, configured to generate a preview object corresponding to the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object;
[0268] The associated object adjustment unit is used to generate the target object corresponding to the foreground object according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.
[0269] Therefore, the page display device provided in the embodiment of the present application can also obtain the target background image by adjusting the original background image in the target page, and then determine the adjustment strategy of the foreground object according to the brightness value of the associated background area of each foreground object in the target background image, and generate the target object corresponding to the foreground object according to the adjustment strategy, and finally generate the target page according to the target background image and the target object. When adjusting the foreground object, the adjustment strategy is determined according to the associated background area, thereby avoiding the adjusted background image and the foreground object from having the same or similar color, thereby improving the display effect of the page.
[0270] Fig.21 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig.21 As shown, the terminal device 21 of this embodiment includes: at least one processor 210 ( Fig.21Only one is shown in the figure) a processor, a memory 211, and a computer program 212 stored in the memory 211 and executable on the at least one processor 210, and when the processor 210 executes the computer program 212, the steps in any of the above-mentioned embodiments of the method for displaying any page are implemented.
[0271] The terminal device 21 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 210 and a memory 211. Those skilled in the art will appreciate that Fig.21 It is only an example of the terminal device 21 and does not constitute a limitation on the terminal device 21. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0272] The processor 210 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0273] In some embodiments, the memory 211 may be an internal storage unit of the terminal device 21, such as a hard disk or memory of the terminal device 21. In other embodiments, the memory 211 may also be an external storage device of the terminal device 21, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 21. Further, the memory 211 may also include both an internal storage unit of the terminal device 21 and an external storage device. The memory 211 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 211 may also be used to temporarily store data that has been output or is to be output.
[0274] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0275] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0276] An embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.
[0277] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0278] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0279] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0280] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0281] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0282] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0283] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0284] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for page display, characterized in that: include: Adjust the original background image in the target page to a target background image corresponding to the current display mode; Identifying the associated background area of each foreground object in the target page in the target background image; adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area; Generate the target page according to all the target objects and the target background image; The identifying the associated background area of each foreground object in the target page in the target background image includes: Dividing the target background image into a plurality of candidate background regions includes: dividing the target background image into a plurality of candidate background regions in units of preset region shapes to obtain a plurality of candidate background regions; Selecting the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image; The selecting the associated background area corresponding to the foreground object from the candidate background areas according to the center coordinates of the foreground object and the boundary coordinates of the target background image comprises: According to the display position of each candidate background area in the target background image, each candidate background area is assigned an associated reference row and column number; the reference row and column number is a position of each candidate background area determined by grid coordinates; Importing the center coordinates of the foreground object into a preset row-column conversion model to calculate the target row-column number of the foreground object, including: calculating the target row-column number and the reference row-column number by rounding down; The candidate background region whose reference row and column number matches the target row and column number is selected as the associated background region of the foreground object.
2. The method according to claim 1, characterized in that The step of dividing the target background image into a plurality of candidate background areas comprises: Obtaining a minimum foreground size, and using the minimum foreground size as a block size; The target background image is divided based on the block size to obtain a plurality of candidate background regions.
3. The method according to claim 1, characterized in that The reference row and column numbers are: Wherein, Colunm0 is the base column number of the candidate background area; Row0 is the base row number of the candidate background area; (SrcX0, SrcY0) are the boundary coordinates of the candidate background area; (pX, pY) are the center coordinates of the candidate background area; (Size x ,Size y ) is the area size of the candidate background area; The row-column conversion model is specifically: Wherein, Colunm1 is the column number within the target row and column number; Row1 is the row number within the target row and column number; (SrcX1, SrcY1) is the center coordinate of the foreground object; (Size x ,Size y ) is the area size of the candidate background area; (Target x ,Target y ) is the object size of the foreground object.
4. The method according to claim 1, characterized in that: If the display mode is a dark display mode, adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes: Get the pixel value and transparency of the center coordinates of the associated background area; Determining a background brightness value of the associated background area according to the pixel value of the center coordinate and the transparency; If the background brightness value is greater than a preset brightness threshold, the foreground object is subjected to brightness reduction processing to generate the target object; If the background brightness value is less than or equal to the brightness threshold, the foreground object is inverted to generate the target object.
5. The method according to claim 4, characterized in that After determining the brightness value of the associated background area according to the pixel value of the central coordinate and the transparency, the method further includes: Determining a characteristic brightness value corresponding to the foreground object according to the pixel value of each pixel point in the foreground object; If the brightness difference between the background brightness value and the characteristic brightness value is greater than a preset inversion threshold, the foreground object is subjected to brightness reduction processing to generate the target object; If the brightness difference is less than or equal to the inversion threshold, the foreground object is inverted to generate the target object.
6. The method according to any one of claims 1 to 5, characterized in that: The identifying the associated background area of each foreground object in the target page in the target background image includes: Determining a display level of the foreground object within the target page; Selecting, in the target page, a target background image at a level adjacent to the display level as an associated background image for the foreground object; An associated background region of the foreground object within the associated background image is determined.
7. The method according to any one of claims 1 to 5, characterized in that: The adjusting the foreground object to a target object corresponding to the display mode according to the background pixel value of the associated background area includes: generating a preview object corresponding to the foreground object according to the background pixel value of the associated background area and the pixel value of the foreground object; The target object corresponding to the foreground object is generated according to the pixel values of all associated objects corresponding to the preview object and the pixel value of the preview object.
8. A device for displaying a page, characterized in that: include: A background image adjustment unit, used to adjust the original background image in the target page to a target background image corresponding to the current display mode; An associated background region identification unit, used for identifying an associated background region of each foreground object in the target page in the target background image; a foreground object adjustment unit, configured to adjust the foreground object to a target object corresponding to the display mode according to a background pixel value of the associated background area; A target page generating unit, configured to generate the target page according to all the target objects and the target background image; The associated background area recognition unit comprises: The candidate background region division unit is used to divide the target background image into a plurality of candidate background regions, including: dividing the target background image into a plurality of candidate background regions in units of preset region shapes to obtain a plurality of candidate background regions; A candidate background region selection unit, configured to select the associated background region corresponding to the foreground object from the candidate background regions according to the center coordinates of the foreground object and the boundary coordinates of the target background image; The candidate background area selection unit comprises: A reference row and column number acquisition unit, used to configure an associated reference row and column number for each candidate background area according to the display position of each candidate background area in the target background image; the reference row and column number is determined by the position of each candidate background area through grid coordinates; The target row and column number acquisition unit is used to import the center coordinates of the foreground object into a preset row and column conversion model to calculate the target row and column number of the foreground object; the row and column conversion model is specifically: Importing the center coordinates of the foreground object into a preset row-column conversion model to calculate the target row-column number of the foreground object, including: calculating the target row-column number and the reference row-column number by rounding down; The associated background region determining unit is used to select the candidate background region whose reference row and column number matches the target row and column number as the associated background region of the foreground object.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
