Image display method and electronic device
By acquiring the spatial geometric and brightness features of an image and combining them with spatiotemporal state information to determine the parameters of the virtual light source, the problems of intelligent and diversified image display are solved, thereby improving user experience and device performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-07-09
- Publication Date
- 2026-05-29
Smart Images

Figure CN120765825B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to an image display method and an electronic device. Background Technology
[0002] With the continuous development of smart devices, image display has been widely used in electronic devices such as smartphones, tablets, and personal computers. For example, wallpaper image display can not only beautify the device interface, but also provide a personalized user experience.
[0003] How to provide an intelligent and diverse image display method affects device display performance and user experience. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides an image display method and an electronic device. In this method, the spatial geometric features and brightness distribution features of the image to be rendered are acquired. Furthermore, based on the spatiotemporal state information of the electronic device, illumination characteristic parameters of a preset virtual light source are determined. This virtual light source is used to relight the image to be rendered. Then, based on the spatial geometric features and brightness distribution features of the image to be rendered, image display parameters based on the illumination characteristic parameters are determined, and the image to be rendered is displayed based on these parameters. This facilitates an intelligent image display method, improves user experience, and enhances device display performance.
[0005] In a first aspect, embodiments of this application provide an image display method applied to an electronic device. The method includes: determining the spatial geometric features and brightness distribution features of an image to be rendered; determining illumination feature parameters of a preset virtual light source based on the spatiotemporal state information of the electronic device, wherein the virtual light source is used to relight the image to be rendered; determining image display parameters based on the illumination feature parameters for the image to be rendered according to the spatial geometric features and the brightness distribution features; and displaying the image to be rendered based on the image display parameters.
[0006] Electronic devices determine the spatial geometric features of an image to be rendered, including determining pixel depth features and pixel normal features of the image to be rendered.
[0007] According to the first aspect, the spatial geometric features include pixel depth features and pixel normal features. Determining the spatial geometric features of the image to be rendered includes: performing depth extraction processing on the image to be rendered to obtain the pixel depth features of the image to be rendered; and constructing normals on the image to be rendered based on the pixel depth features to obtain the pixel normal features of the image to be rendered.
[0008] According to the first aspect, or any implementation of the first aspect above, determining the brightness distribution characteristics of the image to be rendered includes: constructing a brightness integral map matching the image to be rendered; and determining the average brightness value of a preset local region of the image to be rendered based on the brightness integral map, so as to obtain the brightness distribution characteristics.
[0009] According to the first aspect, or any implementation of the first aspect above, determining the illumination characteristic parameters of the preset virtual light source based on the spatiotemporal state information of the electronic device includes: determining the light source position and illumination intensity coefficient of the virtual light source based on the system time and / or current geographical location of the electronic device, so as to obtain the illumination characteristic parameters.
[0010] According to the first aspect, or any implementation of the first aspect above, determining the light source position of the virtual light source based on the system time and / or current geographical location of the electronic device includes: determining the illumination direction vector of the virtual light source based on the system time and / or current geographical location of the electronic device, wherein the illumination direction vector indicates the light source position of the virtual light source in the three-dimensional virtual space where the image to be rendered is located.
[0011] According to the first aspect, or any implementation of the first aspect above, determining the illuminance coefficient of the virtual light source based on the system time and / or current geographical location of the electronic device includes: determining the illuminance coefficient of the virtual light source based on a preset mapping relationship and at least one of the following parameters: the system time, the preset location label of the current geographical location, and the weather type matching the current geographical location.
[0012] According to the first aspect, or any implementation of the first aspect above, the spatial geometric features include the pixel depth features and pixel normal features of the image to be rendered; the brightness distribution features include the average brightness value of a preset local region of the image to be rendered; and the lighting feature parameters include the lighting direction vector and lighting intensity coefficient of the virtual light source.
[0013] According to the first aspect, or any implementation of the first aspect above, determining the image display parameters based on the illumination feature parameters for the image to be rendered based on the spatial geometric features and the brightness distribution features includes: for any target pixel in the image to be rendered, determining the pixel position of the target pixel indicated by the pixel depth feature, and the normal direction vector of the target pixel indicated by the pixel normal feature; determining a first brightness value of the target pixel under the relighting of the virtual light source based on the pixel position and the normal direction vector of the target pixel, the illumination direction vector of the virtual light source, and the illumination intensity coefficient; determining an equalization brightness value matching the target pixel based on the first brightness value and the second brightness value of the target pixel indicated by the brightness distribution features; and determining the image display parameters for the image to be rendered based on the equalization brightness value matching any target pixel.
[0014] According to the first aspect, or any implementation of the first aspect above, the method further includes: performing image segmentation on the image to be rendered to obtain a foreground image containing the target object; and performing an operation to determine the equalization brightness value on any target pixel in the foreground image.
[0015] According to the first aspect, or any implementation of the first aspect above, the steps are as follows: determining an equal brightness value matching the target pixel based on the first brightness value and the second brightness value of the target pixel indicated by the brightness distribution characteristics; summing the first brightness value and the second brightness value to obtain a third brightness value; determining whether the absolute value of the difference between the third brightness value and the target brightness value is greater than a preset difference threshold; and if the absolute value of the difference is greater than the difference threshold, adjusting the third brightness value based on the target brightness value and a brightness adjustment coefficient to obtain the equal brightness value, wherein the target brightness value is a preset theoretical brightness value for image display in the electronic device.
[0016] According to the first aspect, or any implementation of the first aspect above, determining the image display parameters for the image to be rendered based on the balanced brightness value matched with any target pixel includes: determining at least one of the following parameters of the image to be rendered as the image display parameters based on the balanced brightness value matched with any target pixel: brightness parameter, color parameter, sharpness parameter, display resolution, background light parameter, and material roughness parameter.
[0017] According to the first aspect, or any implementation of the first aspect above, displaying the image to be rendered based on the image display parameters includes: determining color filter parameters for the image to be rendered based on the image display parameters; and applying the color filter parameters to the currently displayed image to be rendered.
[0018] According to the first aspect, or any implementation thereof, determining the image display parameters for the image to be rendered based on the balanced brightness value matching any target pixel includes: determining visual effect parameters for the effect layer of the image to be rendered based on the balanced brightness value matching any target pixel, as the image display parameters; and displaying the image to be rendered based on the image display parameters includes: generating an effect layer matching the image to be rendered based on the image display parameters; and superimposing the effect layer on top of the currently displayed image to be rendered.
[0019] According to the first aspect, or any implementation of the first aspect above, the method further includes: when there are N virtual light sources, determining the illumination influence range of each virtual light source on the target object in the image to be rendered, based on the spatiotemporal state information and the light source type of each virtual light source among the N virtual light sources, to obtain N illumination influence ranges, where N is an integer greater than 1; for any target pixel in the image to be rendered, determining M illumination influence ranges where the target pixel is located, wherein the M illumination influence ranges have a one-to-one mapping relationship with the corresponding M virtual light sources, where M is an integer and 0≤M≤N; determining the first brightness value of the target pixel under the relighting of each virtual light source among the M virtual light sources, to obtain M first brightness values; and determining an equal brightness value matching the target pixel based on the M first brightness values and the second brightness value of the target pixel indicated by the brightness distribution characteristics.
[0020] According to the first aspect, or any implementation of the first aspect above, determining the balanced brightness value matching the target pixel based on the M first brightness values and the second brightness value of the target pixel indicated by the brightness distribution feature includes: performing a weighted summation on the M first brightness values and the second brightness value to obtain a fourth brightness value; determining whether the absolute value of the difference between the fourth brightness value and the target brightness value is greater than a preset difference threshold; and if the absolute value of the difference is greater than the difference threshold, adjusting the fourth brightness value based on the target brightness value and a brightness adjustment coefficient to obtain the balanced brightness value, wherein the target brightness value is a preset theoretical brightness value for image display in the electronic device.
[0021] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the image to be rendered includes a person object, obtaining a skin thickness map of the person object; based on the skin thickness map, determining a target skin region whose skin thickness is less than a preset thickness threshold; and based on the average brightness value of the target skin region, determining the balanced brightness value of the target pixel in the target skin region under the relighting of the virtual light source, wherein the balanced brightness value is negatively correlated with the skin thickness of the person object.
[0022] According to the first aspect, or any implementation of the first aspect above, the image to be rendered includes the wallpaper image currently displayed in the electronic device, and the wallpaper image includes at least one of the desktop wallpaper image, the lock screen wallpaper image, and the always-on wallpaper image.
[0023] According to the first aspect, or any implementation of the first aspect above, the type of wallpaper image includes static wallpaper type and dynamic wallpaper type, and the wallpaper image of dynamic wallpaper type includes multiple image frames.
[0024] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the image to be rendered is the dynamic wallpaper type, smoothing the normal direction vector of the target pixel of each image frame according to the similarity between each image frame in the image to be rendered; and determining the balanced brightness value of the target pixel of each image frame under the relighting of the virtual light source according to the smoothed normal direction vector.
[0025] According to the first aspect, or any implementation of the first aspect above, the virtual light source includes a virtual solar light source for simulating the effect of sunlight.
[0026] Secondly, embodiments of this application provide an electronic device, including: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: determining the spatial geometric features and brightness distribution features of an image to be rendered; determining the illumination feature parameters of a preset virtual light source based on the spatiotemporal state information of the electronic device, wherein the virtual light source is used to relight the image to be rendered; determining image display parameters for the image to be rendered based on the illumination feature parameters according to the spatial geometric features and the brightness distribution features; and displaying the image to be rendered based on the image display parameters.
[0027] Thirdly, embodiments of this application provide a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to execute instructions for the method as described in any possible implementation of the first aspect. Attached Figure Description
[0028] Figure 1 This illustration shows an application scenario diagram of an embodiment of this application;
[0029] Figure 2 This is a schematic diagram of the structure of an electronic device as an example.
[0030] Figure 3 A software architecture block diagram of an electronic device as an example;
[0031] Figure 4 A flowchart illustrating an embodiment of the image display method of this application;
[0032] Figure 5 The diagram illustrates the module interaction of the image display process.
[0033] Figure 6 This is an illustrative diagram illustrating the calculation of the sum of pixel values within an arbitrary region.
[0034] Figure 7 This is an illustrative diagram illustrating the process of determining pixel depth features of an image to be rendered.
[0035] Figure 8 This is an illustrative diagram illustrating the process of determining pixel normal features of an image to be rendered.
[0036] Figure 9 This is a schematic diagram illustrating the azimuth and altitude angles of the sun as an example.
[0037] Figure 10 This is a schematic diagram illustrating the process of determining image display parameters as an example.
[0038] Figure 11 This is a schematic diagram illustrating the relationship between incident ray, reflected ray, and normal, as an example.
[0039] Figure 12 This is an illustrative diagram illustrating the brightness equalization of an image to be rendered;
[0040] Figure 13 This is an illustrative diagram illustrating image segmentation of an image to be rendered;
[0041] Figure 14 This is an illustrative diagram of skin thickness and image relighting.
[0042] Figure 15 This is a schematic diagram illustrating the image display effect as an example.
[0043] Figure 16 This is a flowchart illustrating an exemplary image display method. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0046] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.
[0047] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0048] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.
[0049] Figure 1 The illustration shows an application scenario diagram of an embodiment of this application.
[0050] This application provides an image display method for determining image display parameters of an image to be rendered in an electronic device under relighting from a virtual light source. The image to be rendered may include the wallpaper image currently displayed in the electronic device, such as a desktop wallpaper image, a lock screen wallpaper image, and an always-on wallpaper image.
[0051] Let's take a mobile phone as an example for illustration, such as... Figure 1 As shown, when the phone is on the home screen, it displays the desktop wallpaper image 101. When the user presses the power button 102, the phone enters a screen-off state. While in the screen-off state, the phone displays Always-on Display (AOD). A screen-off state refers to a state where the screen of an electronic device is completely off. AOD can be called Always-on Display or Always-on Display, and this embodiment does not limit this. For example, after entering the AOD interface, the phone can display information such as time, date, and battery level, and can also display the Always-on Display wallpaper image 103.
[0052] When the phone is in the AOD (Away From Home) interface, pressing the power button 102 will exit the AOD interface and enter the lock screen state. The lock screen state refers to a state where the screen of an electronic device is lit but locked. For example, after entering the lock screen interface, the phone can display the lock screen wallpaper image 104.
[0053] How to display wallpaper images intelligently and in a diverse manner affects the display performance of electronic devices and the user experience.
[0054] This application proposes an image display scheme applied to an electronic device. The electronic device can determine the spatial geometric features and brightness distribution features of the image to be rendered, and based on spatiotemporal state information, determine the illumination feature parameters of a preset virtual light source. The virtual light source is used to relight the image to be rendered. Next, the electronic device determines image display parameters based on the illumination feature parameters for the image to be rendered according to the spatial geometric features and brightness distribution features, and displays the image to be rendered based on the image display parameters.
[0055] Electronic devices may include mobile phones, tablets, smartwatches, laptops, smart home devices, in-vehicle devices, and virtual-real fusion devices. The embodiments of this application can be applied to various scenarios requiring image display.
[0056] like Figure 2 The diagram shows the structure of electronic device 100. Optionally, electronic device 100 can be referred to as a terminal or a terminal device. The specific product form of electronic device 100 can be a smart terminal, such as a mobile phone, tablet computer, wearable device, augmented reality / virtual reality device, laptop computer, in-vehicle device, personal digital assistant (PDA), or other electronic devices with image display capabilities. Specifically, the functional modules involved in this application can be deployed on the DSP chip of the relevant device, specifically as applications or software. An image display function can be achieved through software installation or upgrades, and through hardware calls and coordination.
[0057] It should be understood that, Figure 2The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. Figure 2 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0058] Electronic device 100 may include: processor 110, memory 200, mobile communication module 130, wireless communication module 140, sensor module 150, button 160, motor 161, indicator 162, camera 163, and display screen 164. Sensor module 150 may include pressure sensor, gyroscope sensor, accelerometer, temperature sensor, motion sensor, barometric pressure sensor, magnetic sensor, distance sensor, proximity sensor, fingerprint sensor, touch sensor, ambient light sensor, bone conduction sensor, etc.
[0059] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0060] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.
[0061] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 130, wireless communication module 140, modem processor, and baseband processor.
[0062] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization.
[0063] The mobile communication module 130 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 130 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0064] The wireless communication module 140 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0065] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 130, and antenna 2 is coupled to wireless communication module 140, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.
[0066] Electronic device 100 implements display functions through a GPU, display screen 164, and application processor. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0067] The display screen 164 is used to display images, videos, etc., and the display screen 164 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 164, where N is a positive integer greater than 1.
[0068] Electronic device 100 can perform shooting functions through ISP, camera 163, video codec, GPU, display screen 164 and application processor.
[0069] The ISP (Image Signal Processor) is used to process data fed back from the camera 163. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 163.
[0070] Camera 163 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard formats such as RGB and YUV. In some embodiments, the electronic device 100 may include one or N cameras 163, where N is a positive integer greater than 1.
[0071] The camera 163 can be located at the edge of the electronic device, and can be an under-display camera or a pop-up camera. The camera 163 can include a front-facing camera or a rear-facing camera. This application embodiment does not limit the specific location and shape of the camera 163. The electronic device 100 can include one or more cameras with different focal lengths, such as telephoto cameras, wide-angle cameras, ultra-wide-angle cameras, or panoramic cameras.
[0072] The memory 120 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the memory 120, such as enabling the electronic device 100 to implement the image display method in the embodiments of this application. The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100, etc. Furthermore, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0073] A touch sensor, also known as a "touch panel," can be located on the display screen 164. The touch sensor and display screen 164 together form a touchscreen, also called a "touch screen." The touch sensor detects touch operations applied to or near it. The touch sensor can then transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 164.
[0074] A pressure sensor is used to sense pressure signals and can convert these signals into electrical signals. In some embodiments, the pressure sensor may be located on the display screen 164. The electronic device 100 may also calculate the position of a touch based on the detection signal from the pressure sensor.
[0075] A gyroscope sensor can be used to determine the motion attitude of an electronic device 100. In some embodiments, the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes) can be determined by the gyroscope sensor.
[0076] An accelerometer can detect the magnitude of acceleration of an electronic device 100 in various directions (typically three axes). When the electronic device 100 is stationary, the accelerometer can detect the magnitude and direction of gravity. Accelerometers can also be used to identify the posture of electronic devices, and are applied in applications such as screen orientation switching and pedometers.
[0077] Buttons 160 include a power button, volume buttons, etc. Buttons 160 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0078] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software structure of electronic device 100.
[0079] like Figure 3 The software architecture diagram of the illustrative electronic device 100 illustrates a layered architecture that divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the Android runtime, the system layer, and the kernel layer.
[0080] The application layer can include a series of application packages, such as Figure 3 As shown, the application package may include a gallery, a UI display application, an AOD application, and a lock screen application. The UI display application is used for setting and displaying the user interface, the AOD application is used to display the AOD interface, and the lock screen application is used to lock the phone's display screen and display the lock screen interface.
[0081] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer, including various components and services to support Android development. The application framework layer includes some predefined functions. For example... Figure 3 As shown, the application framework layer may include a window manager, a resource manager, a window management service, a wallpaper management service, and a screen management service, etc.
[0082] Window managers are used to manage windowed applications, for example. A window manager can obtain the screen size, determine if a status bar is present, lock the screen, capture screenshots, and perform other actions.
[0083] The file explorer can provide applications with various resources, such as localized strings, icons, images, layout files, video files, etc.
[0084] Window management services are used, for example, to assign and manage window attributes (such as hierarchy, size, display order, etc.) for applications. Window management services are also used to manage the display and switching of lock screen windows and wallpaper windows.
[0085] Wallpaper management services, for example, are used to manage the operation and switching of wallpapers, and provide an interface for manipulating wallpapers to the outside world through the WallpaperManager class.
[0086] Screen management services, for example, are used to manage the current display state of the screen and send notifications to the system and other applications when the screen state is updated, such as notifying the screen that it has switched to a bright or dark state, or that it has switched to a lock screen state or a desktop state.
[0087] The system layer includes system libraries and the Android Runtime. System libraries can include multiple functional modules, such as image rendering libraries, image compositing libraries, function libraries, and media libraries. The image rendering library provides image processing functions to help meet various image processing needs.
[0088] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java calls, and the other part consists of the Android core libraries. The application layer and application framework layer run in the virtual machine, which executes the Java files of the application layer and application framework layer into binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0089] Understandable, Figure 3The components included in the system framework layer, system library, and runtime layer shown do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements.
[0090] The kernel layer is the layer between the hardware and the aforementioned software layers. The kernel layer includes at least display drivers, audio drivers, and sensor drivers. Hardware may include devices such as cameras, displays, microphones, processors, and memory.
[0091] Figure 4 A flowchart illustrating an embodiment of the image display method of this application is shown, such as... Figure 4 As shown, the image display method includes, for example, operations S110 to S140.
[0092] In operation S110, the electronic device determines the spatial geometric features and brightness distribution features of the image to be rendered.
[0093] In operation S120, the electronic device determines the lighting characteristic parameters of the preset virtual light source based on the spatiotemporal state information. The virtual light source is used to relight the image to be rendered.
[0094] In operation S130, the electronic device determines the image display parameters based on illumination feature parameters for the image to be rendered, according to the spatial geometric features and brightness distribution features.
[0095] In operation S140, the electronic device displays the image to be rendered based on the image display parameters.
[0096] The following are exemplary operation examples of the image display method according to embodiments of this application.
[0097] In operation S110, the electronic device determines the spatial geometric features and brightness distribution features of the image to be rendered.
[0098] For example, the electronic device may include a mobile phone, tablet computer, laptop computer, smartwatch, wearable electronic device, etc. The image to be rendered may be captured by the camera of the electronic device or obtained by the electronic device from other devices. This application embodiment does not limit the source of the image to be rendered. The image to be rendered may be an original image acquired by the electronic device or an image processed from an original image.
[0099] For example, the image to be rendered may be the wallpaper image currently displayed on the electronic device. Wallpaper images include, for example, desktop wallpaper images, lock screen wallpaper images, and always-on wallpaper images. The types of wallpaper images include, for example, static wallpaper types and dynamic wallpaper types.
[0100] Static wallpaper images can be static single-frame images that can be displayed frozen on the home screen, AOD screen, or lock screen. Live wallpaper images can include multiple continuously changing frames; essentially, displaying a live wallpaper image is equivalent to playing a video containing multiple image frames. When rendering a live wallpaper image, multiple image frames within the live wallpaper image can be rendered, determining the image display parameters for each frame.
[0101] Electronic devices determine the spatial geometric features of an image to be rendered, including determining pixel depth features and pixel normal features of the image to be rendered.
[0102] Pixel depth features indicate the distance of a pixel in an image to be rendered within the view coordinate system, specifically the distance from the camera's viewpoint to the pixel's location. Pixel depth features are used for purposes such as depth buffering, lighting calculations, and determining parallax effects. For example, depth buffering helps determine which pixels should be displayed in the foreground to prevent overlapping. Lighting calculations use depth comparisons to identify occluded pixels for accurate shadow rendering. Parallax rendering adjusts rendering based on depth information to enhance the three-dimensionality of the image.
[0103] Pixel normal features are used to characterize the direction of the normal to the surface containing a pixel in an image to be rendered. Pixel normal features are a key element in lighting calculations; for example, in the Phong lighting model, the Blinn-Phong lighting model, and other advanced lighting models, pixel normal features can be used to calculate light reflection and scattering. The angle between the pixel normal direction and the light source direction and the view direction determines the brightness and specular effect of the pixel.
[0104] The electronic device determines the brightness distribution characteristics of the image to be rendered. These brightness distribution characteristics describe the brightness distribution in different regions of the image. These characteristics may include, for example, a brightness histogram, average brightness value, brightness variance, local brightness features, brightness gradient, brightness peaks, and brightness troughs.
[0105] For example, a luminance histogram counts the number of pixels at each luminance level (from darkest to brightest) in the image to be rendered. The luminance histogram can be used for contrast adjustment and luminance equalization of the image. Local luminance features describe the luminance distribution in local areas of the image to be rendered, such as local average luminance and local contrast. Local luminance features can be used, for example, to enhance the luminance and contrast of specific areas in the image to be rendered, thereby highlighting local details.
[0106] In operation S120, the electronic device determines the lighting characteristic parameters of the preset virtual light source based on the spatiotemporal state information. The virtual light source is used to relight the image to be rendered.
[0107] For example, spatiotemporal state information may include the electronic device's system time and current geographic location. The system time can be the current time of the electronic device's location. For instance, when rendering a wallpaper image, the electronic device can create a wallpaper service class and use the Calendar or LocalDateTime class to obtain the current system time, such as retrieving the hour, minute, and second from a Calendar instance. The electronic device can access location providers (such as GPS or a network) through the LocationManager to obtain location information, thus determining the electronic device's current geographic location and listening for location updates.
[0108] Virtual light sources are used to relight images to be rendered. Virtual light sources include, for example, virtual sunlight sources to simulate the effect of sunlight, or virtual indoor lights to simulate the effect of artificial lighting.
[0109] The lighting characteristics of a virtual light source can include the light source position and the illumination intensity coefficient. The light source position can be, for example, the location of the virtual light source in the three-dimensional virtual space where the image to be rendered is located. The illumination intensity coefficient can be, for example, the brightness intensity coefficient of any target pixel in the image to be rendered by the virtual light source, including, for example, the total light intensity coefficient, ambient light intensity coefficient, diffuse light intensity coefficient, specular light intensity coefficient, etc.
[0110] In operation S130, the electronic device determines the image display parameters based on illumination feature parameters for the image to be rendered, according to the spatial geometric features and brightness distribution features.
[0111] For example, the electronic device determines the image display parameters of the image to be rendered under the relighting of a virtual light source based on the spatial geometric features and brightness distribution features of the image to be rendered. The image display parameters may include at least one of the following parameters: brightness parameter, color parameter, sharpness parameter, display resolution, background light parameter, and material roughness parameter.
[0112] For example, a lighting model (such as the Phong model or the Blinn-Phong model) can be used to calculate the brightness value of any target pixel under virtual light source illumination. For instance, the Phong model can be used to simulate light reflection on an object's surface, dividing the virtual light source's illumination into ambient light, diffuse light, and specular reflection light. The ambient light brightness value, diffuse light brightness value, and specular reflection light brightness value of the target pixel under virtual light source illumination can be calculated, and then summed to obtain the total brightness value of the target pixel under virtual light source illumination.
[0113] The total luminance value of the target pixel under virtual lighting is mapped to the dynamic display range of the electronic device. Gamma correction is then applied to the mapped luminance values, and the RGB components of the color are determined based on these gamma-corrected values. For example, in Phong or Blinn-Phong models, the luminance value for each color channel is typically calculated and then merged. The adjusted luminance values are then applied to the pixels of the image to be rendered to obtain the final color values, which serve as the image display parameters for the image.
[0114] In operation S140, the electronic device displays the image to be rendered based on the image display parameters.
[0115] Based on the brightness distribution and spatial geometric features of the image to be rendered, the image display parameters under virtual light source relighting are determined. This enhances the realism and depth of the rendered image, better showcasing details in both bright and dark areas. For example, the wallpaper image's display effect can be adaptively adjusted based on the electronic device's system time and current geographical location. This allows for more context-appropriate visual effects in response to dynamic environmental changes, improves the image display performance of electronic devices, and provides a richer user experience.
[0116] The following is combined Figure 5 The interactive diagrams of the various modules shown illustrate the image display process of this application embodiment.
[0117] The image display method is applied to electronic devices, which include multiple functional modules for image display located in the application framework layer, such as a module for acquiring the image to be rendered, a module for acquiring spatiotemporal state information, a module for determining brightness distribution features, a module for determining pixel depth features, a module for determining pixel normal features, a module for determining illumination feature parameters, an image rendering engine, and an image display engine.
[0118] like Figure 5 As shown, the image to be rendered acquisition module can, for example, acquire a WallpaperManager instance and, through the WallpaperManager instance, acquire the image to be rendered from the electronic device. The image to be rendered can, for example, be the currently displayed wallpaper image. The image to be rendered acquisition module then sends the image to be rendered to the brightness distribution feature determination module, the pixel depth feature determination module, and the pixel normal feature determination module.
[0119] The spatiotemporal status information acquisition module is used, for example, to obtain the system time and current geographical location of an electronic device. For instance, the spatiotemporal status information acquisition module can obtain a Calendar or LocalDateTime class, and use either the Calendar or LocalDateTime class to obtain the system time of the electronic device.
[0120] The spatiotemporal status information acquisition module can also obtain LocationManager or FusedLocationProviderClient, and obtain the current geographical location of the electronic device through LocationManager or FusedLocationProviderClient.
[0121] The spatiotemporal state information acquisition module can provide the acquired system time and current geographical location to the illumination characteristic parameter determination module.
[0122] The brightness distribution feature determination module can construct a brightness integral map that matches the image to be rendered, and based on the brightness integral map, determine the average brightness value of a preset local region of the image to be rendered, thus obtaining the brightness distribution features. This module can then send the brightness distribution features of the image to be rendered to the image rendering engine, allowing the engine to determine the image display parameters based on these features.
[0123] For example, the brightness distribution feature determination module constructs a SAT (Summed Area Table) table that matches the image to be rendered. SAT is a data structure used to quickly calculate the sum of pixel values within a rectangular region. In image processing, a pixel value can be a numerical representation of each pixel in an image, such as the brightness value of each pixel or the RGB value of each pixel.
[0124] SAT has wide applications in image processing, especially in calculating the average brightness value of local regions of an image. The basic principle of SAT is to construct a cumulative sum image based on the original image, so that the sum of pixel values within any rectangular region can be calculated by simple addition and subtraction operations without traversing all pixels within the region.
[0125] For the image I(x,y) to be rendered, assuming its size is W×H, the brightness distribution feature determination module can construct a brightness integral map S(x,y) of the same size as the image I(x,y). S(x,y) represents the cumulative sum of pixel values from the top left corner (0,0) of the image to the current position (x,y), and can be expressed using equation (1):
[0126] S(x,y)=I(x,y)+S(x 1,y)+S(x,y 1) S(x 1,y 1) Equation (1)
[0127] Where S(x,y) represents the value of the luminance integral image at coordinates (x,y), and I(x,y) represents the pixel value of the image to be rendered at coordinates (x,y). If x or y is 0, the integral value outside the boundary is considered 0.
[0128] The sum of pixel values within any rectangular region can be quickly calculated using the luminance integral image SAT. Suppose we need to calculate the sum of pixel values within a rectangular region from point (x1, y1) to (x2, y2), the calculation method is shown in equation (2):
[0129] Sum = S(x2, y2) S(x1 1,y2) S(x2,y1 1)+S(x1 1,y1 1) Equation (2)
[0130] Figure 6 The illustration shows a diagram of calculating the sum of pixel values within an arbitrary region, such as... Figure 6 As shown in (1), the total pixel value in region A = the total pixel value in region B - the total pixel value in region C - the total pixel value in region D + the total pixel value in region E.
[0131] like Figure 6 As shown in (2), assuming the coordinates of the top-left corner O of the image are (0,0), S(x,y) represents the cumulative sum of pixel values from the top-left corner (0,0) to the current position (x,y). The total sum of pixel values in region A = S(LR) - S(LL) - S(UR) + S(UL). Assuming the size of region A is w l, the average pixel value within region A is [S(LR) - S(LL) - S(UR) + S(UL)] / (w l).
[0132] Taking the pixel value as the brightness value of the corresponding pixel point as an example, the average brightness value of any local area in the image to be rendered can be determined based on the brightness integral map SAT, so as to obtain the brightness distribution characteristics.
[0133] The pixel depth feature determination module can perform depth extraction processing on the image to be rendered to obtain the pixel depth features of the image to be rendered, and send the pixel depth features to the image rendering engine so that the image rendering engine can determine the image display parameters of the image to be rendered based on the pixel depth features.
[0134] Figure 7 This schematically illustrates the process of determining pixel depth features of an image to be rendered, such as... Figure 7 As shown, the pixel depth feature determination module can estimate the depth value of each pixel in the image to be rendered 10 using a trained depth estimation model, thereby obtaining a pixel depth image 11 that matches the image to be rendered 10. Depth estimation models include, for example, U-Net, ResNet, or DPT (Dense Prediction Transformer). The depth value of any pixel indicates the distance from the camera to that pixel.
[0135] The pixel depth feature determination module can transform the pixels in the 2D image coordinate system to the 3D camera coordinate system based on the pixel depth image 11, thereby converting each pixel into a vertex in 3D space and obtaining an image 12 with spatial topological information. The image 12 can indicate the pixel depth features of the image 10 to be rendered.
[0136] 3D point cloud maps have wide applications in image processing. For example, they can be used for ray tracing and occlusion detection. For instance, ray tracing algorithms can use point cloud data to calculate the intersection points of rays and objects, simulating the propagation paths of real light rays in a 3D virtual scene containing the image to be rendered, generating more realistic lighting effects. 3D point cloud maps are also used to calculate vertex normals. By combining vertex normals with lighting models, diffuse reflection, specular reflection, and ambient lighting can be calculated to generate realistic shadows and specular highlights.
[0137] Continue to refer to Figure 5 To illustrate, the pixel depth feature determination module sends the pixel depth features of the image to be rendered to the pixel normal feature determination module. Based on the acquired pixel depth features, the pixel normal feature determination module constructs normals for the image to be rendered, obtains the pixel normal features of the image to be rendered, and sends the pixel normal features to the image rendering engine.
[0138] For example, pixel depth features can indicate the depth value D(x,y) of any pixel (x,y) in the image to be rendered. The pixel normal feature determination module can obtain the normal direction information of the corresponding vertex by performing gradient calculation on the depth value D(x,y). For example, the normal vector N(x,y) of any pixel (x,y) in the image to be rendered can be represented by equation (3):
[0139] N(x,y) = ( , Equation (3) -1)
[0140] Normalizing the normal vectors yields the normal direction vector N(x,y) for any pixel (x,y). .
[0141] The pixel normal features of the image to be rendered are obtained based on the normal direction vector N(x,y) of any pixel (x,y) in the image to be rendered.
[0142] As an optional embodiment, pixel normal features may include not only the normal direction vector but also information such as normal angle, normal curvature, and normal consistency. The normal angle can be, for example, the angle between the normal vector and a specific reference axis (such as the camera's viewpoint axis or the world coordinate system axis). Normal curvature indicates the rate of change of the normal direction and can be used to deduce the surface curvature of the target object in the image to be rendered. Normal consistency indicates the degree of consistency in the normal directions of neighboring pixels in the image to be rendered.
[0143] Figure 8 This schematically illustrates the process of determining the pixel normal features of an image to be rendered, such as... Figure 8 As shown, the pixel normal feature determination module uses the depth value D(x,y) of any pixel point (x,y) in the image to be rendered 10 to calculate the gradient of the depth value D(x,y) to obtain the depth value change feature of the image to be rendered 10, thereby deducing the tilt and normal direction of the surface of the target object in the image to be rendered, and obtaining the pixel normal image 13.
[0144] The spatiotemporal status information acquisition module sends the spatiotemporal status information of the electronic device to the illumination characteristic parameter determination module. This spatiotemporal status information includes, for example, the system time and current geographical location of the electronic device. The system time includes information such as year, month, day, hour, minute, and second, while the current geographical location indicates the longitude and latitude of the electronic device.
[0145] The lighting feature parameter determination module determines the light source position and illumination intensity coefficient of the virtual light source based on the system time and / or current geographical location of the electronic device, thereby obtaining the lighting feature parameters. For example, the lighting feature parameter determination module determines the illumination direction vector of the virtual light source based on the system time and / or current geographical location of the electronic device. The illumination direction vector indicates the position of the virtual light source in the three-dimensional virtual space where the image to be rendered is located.
[0146] Taking a virtual light source as an example to simulate sunlight, the lighting characteristic parameter determination module can, for instance, use a sun position algorithm to calculate the actual azimuth and elevation angles of the sun based on the system time and current geographical location of the electronic device. Then, based on the actual azimuth and elevation angles of the sun, it determines the lighting direction vector pointing from the virtual light source to the center of the scene in the target virtual space.
[0147] The azimuth angle indicates the horizontal angle of the sun relative to true north, with 0 degrees representing true north, and the azimuth angle increases clockwise. The altitude angle indicates the vertical angle of the sun relative to the horizontal plane, with 0 degrees representing the horizon and 90 degrees representing directly above. The 3D virtual space in which the image to be rendered is located constitutes the target virtual space, and the center of the target object in the image to be rendered constitutes the scene center of the target virtual space. The virtual solar light source has the same azimuth and altitude angles as the sun, and both have the same illuminance coefficient.
[0148] Figure 9 A schematic diagram illustrating the azimuth and altitude angles of the sun is shown, such as... Figure 9 As shown, the azimuth angle α of the sun is the horizontal angle of the sun's rays relative to due north, and the altitude angle β is the vertical angle of the sun's rays relative to the horizontal plane.
[0149] The direction vector of sunlight can be determined based on the azimuth and altitude angles of the sun. Assume the direction vector of sunlight is d = (x, y, z), where the x-component (eastward component) = cosβsinα, the y-component (northward component) = cosβcosα, and the z-component (upward component) = sinβ.
[0150] Solar intensity is affected by various factors, such as time, location, and atmospheric conditions. The illumination characteristic parameter determination module can determine the illumination intensity coefficient of the virtual light source based on a preset mapping relationship and at least one of the following parameters: system time, preset location label of the current geographical location, and weather type matching the current geographical location.
[0151] For example, the location tags for the current geographic location include indoor tags and outdoor tags. Indoor tags include tags such as bedroom, living room, stadium, and cinema. At the same time, the illuminance coefficient corresponding to the outdoor tag location is greater than the illuminance coefficient corresponding to the indoor tag location. The illuminance coefficient corresponding to dimly lit locations such as bedrooms and cinemas is relatively small, while the illuminance coefficient corresponding to brightly lit locations such as living rooms and stadiums is relatively large.
[0152] The lighting characteristic parameter determination module sends the light source position and lighting intensity coefficient of the virtual light source to the image rendering engine, so that the image rendering engine can determine the image display parameters of the image to be rendered under the relighting of the virtual light source based on the light source position and lighting intensity coefficient.
[0153] Figure 10 This schematically illustrates the process of determining image display parameters, such as... Figure 10As shown, the image rendering engine determines the image display parameters of the image to be rendered based on the brightness distribution features, pixel depth features, and pixel normal features of the received image to be rendered, as well as the light source position and illumination intensity coefficient of the virtual light source.
[0154] For example, for any target pixel in the image to be rendered, the image rendering engine can determine the pixel position of the target pixel indicated by the pixel depth feature, and the normal direction vector of the target pixel indicated by the pixel normal feature. Based on the pixel position and normal direction vector of the target pixel, the illumination direction vector of the virtual light source, and the illumination intensity coefficient, the image rendering engine can determine a first brightness value of the target pixel under the relighting of the virtual light source. Next, based on the first brightness value and a second brightness value of the target pixel indicated by the brightness distribution feature, the image rendering engine determines a balanced brightness value matching the target pixel. Then, based on the balanced brightness value matching any target pixel, the image rendering engine can determine the image display parameters for the image to be rendered.
[0155] For any target pixel in the image to be rendered, assuming the normal direction vector of the target pixel is N, the illumination direction vector (i.e., the incident light direction vector) of the virtual light source at the target pixel is I, and the angle between the normal direction vector N and the illumination direction vector I is θ. cos =<N,I> In lighting models, light intensity is typically proportional to the cosine of the angle between the pixel normal and the light source direction.
[0156] Figure 11 This schematically illustrates the relationship between the incident ray, the reflected ray, and the normal, as shown in the diagram. Figure 11 As shown, for target pixel A in the image to be rendered, assume the normal direction vector at target pixel A is N, and the tangent direction vector is... The incident ray vector of virtual light source B at target pixel A is The vector of the reflected ray is Normal direction vector with tangent direction vector They are in a vertical relationship.
[0157] The reflected ray vector R is the incident ray vector. Relative to the normal direction vector Symmetric vector, reflected ray vector With the incident ray vector The relationship between them is = -2 ( . ) , . This represents the dot product of the incident ray vector I and the normal vector N.
[0158] Continue to refer to Figure 10 To explain, the image rendering engine can determine the first brightness value of the target pixel under the relighting of the virtual light source based on the pixel position and normal direction vector of the target pixel, the illumination direction vector of the virtual light source, and the illumination intensity coefficient.
[0159] For example, for any target pixel in the image to be rendered, the first brightness value L(X,R) of the target pixel under the relighting of the virtual light source can be represented by Equation (4).
[0160] L(X,R) = (X, ) <N, >d Equation (4)
[0161] Where the position of the target pixel is X, the reflected ray vector at the target pixel is R, L(X,R) represents the first brightness value of the target pixel under the relighting of the virtual light source, and f(X,R, ) represents when the incident ray vector is given , reflected ray vector When, the ratio of the reflected irradiance to the incident irradiance at the target pixel, f(X,R, It is related to the position X of the target pixel. (X, () represents the illuminance coefficient of the virtual light source. This represents the set of incident light vectors from the virtual light source at the target pixel.
[0162] The image rendering engine receives a second brightness value of the target pixel provided by the brightness distribution feature determination module. The second brightness value can be the initial brightness value of the target pixel in the image to be rendered. Then, the image rendering engine determines an equalized brightness value that matches the target pixel based on the first brightness value and the second brightness value of the target pixel indicated by the brightness distribution feature.
[0163] For example, the image rendering engine sums the first brightness value and the second brightness value to obtain a third brightness value. The image rendering engine determines whether the absolute value of the difference between the third brightness value and the target brightness value is greater than a preset difference threshold. If the absolute value of the difference is greater than the difference threshold, the image rendering engine adjusts the third brightness value based on the target brightness value and the brightness adjustment coefficient to obtain a balanced brightness value.
[0164] The target brightness value is the theoretical brightness value preset for image display in an electronic device. The image rendering engine or display system in the electronic device can set the theoretical brightness value for image display based on factors such as the characteristics of the displayed content, ambient lighting conditions, and the device's display capabilities. The target brightness value aims to present the best visual effect when the device screen displays the image.
[0165] If the absolute value of the difference is greater than a preset difference threshold, the image rendering engine can adjust the third brightness value based on the target brightness value and the brightness adjustment coefficient to obtain a balanced brightness value. For example, equation (5) can be used to represent the balanced brightness value matching the target pixel.
[0166] =α( - )+ Equation (5)
[0167] This represents the third brightness value of the target pixel. This represents the average brightness value of the image to be rendered. The brightness distribution characteristics of the rendered image can indicate this. This represents the preset target brightness value, and α represents the brightness adjustment coefficient.
[0168] The brightness adjustment coefficient is a scaling factor used to adjust the third brightness value to more closely approximate the target brightness value. The brightness adjustment coefficient can be an empirical value or an optimal adjustment coefficient obtained under different conditions based on experimental data. Furthermore, the brightness adjustment coefficient can also be a dynamic adjustment coefficient continuously adjusted based on real-time feedback, or a matching adjustment coefficient calculated based on a preset algorithm according to the difference between the third brightness value and the target brightness value. Common algorithms include proportional control and PID control algorithms.
[0169] Figure 12 This diagram illustrates the process of brightness equalization for an image to be rendered. The image rendering engine determines the initial brightness value of the target pixels in the image under relighting from the virtual light source, based on the illumination characteristic parameters of the virtual light source and the brightness distribution characteristics of the image to be rendered. The spatiotemporal state information of the electronic device affects the illumination characteristic parameters of the virtual light source. For example, the system time and current geographical location of the electronic device influence the light source position and illumination intensity coefficient of the virtual light source.
[0170] Taking a virtual light source used to simulate sunlight as an example, at noon on a sunny day, the illuminance coefficient of the virtual light source is relatively high, and the first brightness value of the target pixel determined based on the illuminance coefficient is also relatively high. The image rendering engine sums the first brightness value and the second brightness value of the target pixel, indicated by the brightness distribution characteristics, to obtain a third brightness value. When the first brightness value is high, the third brightness value is also correspondingly high, and the difference between the third brightness value and the target brightness value exceeds a preset difference threshold.
[0171] like Figure 12 As shown in Figure A1, the display effect of the image to be rendered based on the third brightness value exhibits overexposure and color distortion. The image rendering engine adjusts the third brightness value based on a preset target brightness value and a brightness adjustment coefficient to obtain a balanced brightness value. Figure A2 illustrates the display effect of the image to be rendered based on the balanced brightness value, resulting in a display with moderate brightness and a realistic, natural appearance.
[0172] Continuing with the example of a virtual sunlight source, on a cloudy afternoon, the illuminance coefficient of the virtual sunlight source is low, and the first brightness value of the target pixel determined based on the illuminance coefficient is also low. The image rendering engine sums the first brightness value and the second brightness value of the target pixel, indicated by the brightness distribution characteristics, to obtain a third brightness value. Since the first brightness value is low, the third brightness value is also correspondingly low, and the difference between the target brightness value and the third brightness value exceeds a preset difference threshold.
[0173] like Figure 12 As shown in Figure B1, the display effect of the image to be rendered based on the third brightness value is schematically illustrated, and the display effect has the problems of underexposure and color distortion. The image rendering engine adjusts the third brightness value based on the preset target brightness value and brightness adjustment coefficient to obtain a balanced brightness value. Figure B2 schematically illustrates the display effect of the image to be rendered based on the balanced brightness value, and the display effect has the characteristics of moderate brightness and realistic and natural appearance.
[0174] As an alternative, the image rendering engine can also perform image segmentation on the image to be rendered to obtain a foreground image containing the target object, and the image rendering engine can perform an operation to determine the equalization brightness value for any target pixel in the foreground image.
[0175] Figure 13 The illustration shows a schematic diagram of image segmentation of the image to be rendered, such as... Figure 13As shown, the image rendering engine performs image segmentation on the image to be rendered 10 to obtain a foreground image 14 containing the target object. The image rendering engine can determine the balanced brightness value of any target pixel in the foreground image 14, and determine the image display parameters for the image to be rendered 10 based on the balanced brightness value. For example, the image rendering engine can perform image segmentation on the image to be rendered 10 based on threshold segmentation algorithms, edge detection algorithms, region growing algorithms, clustering algorithms, graph theory algorithms, deep learning algorithms, etc., and this embodiment does not limit this.
[0176] The image rendering engine determines image display parameters for the image to be rendered based on the balanced brightness value matched with any target pixel. For example, the image rendering engine can determine at least one of the following parameters of the image to be rendered as image display parameters based on the balanced brightness value matched with any target pixel: brightness parameter, color parameter, sharpness parameter, display resolution, background light parameter, and texture roughness parameter. Brightness parameters include, for example, average brightness, backlight brightness, and contrast. Color parameters include, for example, hue, saturation, and color space.
[0177] The image rendering engine sends the image display parameters of the image to be rendered to the image display engine, so that the image display engine can display the image to be rendered based on the image display parameters, thereby adjusting the display effect of the image to be rendered.
[0178] Alternatively, the image display engine can determine color filter parameters for the image to be rendered based on the received image display parameters, and apply the color filter parameters to the currently displayed image. For example, the image display engine can determine image processing parameters for adjusting the color characteristics of the image to be rendered, based on the received image display parameters, as color filter parameters. Image processing parameters include, for example, brightness adjustment parameters, color enhancement parameters, color conversion parameters, and hue adjustment parameters. For instance, the image display engine can enhance or adjust the color performance of the image to be rendered by adjusting display parameters such as brightness, contrast, and color saturation to ensure optimal visual presentation on the display device.
[0179] As an alternative approach, the image rendering engine can determine the visual effect parameters for the effect layer of the image to be rendered based on the balanced brightness value matching any target pixel, and use these parameters as image display parameters. The image rendering engine then sends these display parameters to the image display engine, which generates an effect layer that matches the image to be rendered based on these parameters, and overlays the effect layer on top of the currently displayed image.
[0180] Visual effect parameters include brightness, contrast, saturation, hue, color temperature, color balance, and gamma correction. Taking a wallpaper image as an example, the effect layer can be displayed on top of the wallpaper image. In other words, a wallpaper image can have multiple layers; the top layer displays the effect layer, and the bottom layer displays the user-defined wallpaper. These two parts constitute the visual effect of the wallpaper image.
[0181] Furthermore, effects layers can also correspond to weather information, user activity levels, and app usage. For example, different weather conditions can dictate different visual effects. For instance, in sunny weather, effects layers corresponding to sunny weather can be overlaid on the wallpaper image, such as adding elements like sunlight or the sun, while also increasing the image's clarity, brightness, and saturation. Conversely, in rainy weather, effects layers corresponding to rainy weather can be overlaid on the wallpaper image, such as adding elements like rain or fog, while also reducing the image's clarity, brightness, and saturation.
[0182] As an alternative approach, in the presence of N virtual light sources, the image rendering engine can determine the illumination influence range of each virtual light source on the target object in the image to be rendered based on the spatiotemporal state information of the electronic device and the light source type of each virtual light source among the N virtual light sources, so as to obtain N illumination influence ranges, where N is an integer greater than 1.
[0183] For any target pixel in the image to be rendered, the image rendering engine can determine the M lighting influence ranges where the target pixel is located. There is a one-to-one mapping relationship between the M lighting influence ranges and the corresponding M virtual light sources, where M is an integer and 0≤M≤N.
[0184] The image rendering engine determines the first brightness value of the target pixel under the relighting of each of the M virtual light sources, resulting in M first brightness values. Then, based on the M first brightness values and the second brightness value of the target pixel indicated by the brightness distribution characteristics, the image rendering engine determines a balanced brightness value that matches the target pixel.
[0185] For example, the image rendering engine performs a weighted summation of M first brightness values and second brightness values to obtain a fourth brightness value. The image rendering engine determines whether the absolute value of the difference between the fourth brightness value and the target brightness value is greater than a preset difference threshold. If the absolute value of the difference is greater than the difference threshold, the image rendering engine adjusts the fourth brightness value based on the target brightness value and a brightness adjustment coefficient to obtain a balanced brightness value. The target brightness value is a preset theoretical brightness value for image display in an electronic device.
[0186] Light source types include, for example, point lights, parallel lights, line lights, area lights, ambient lights, segmented lights, and butterfly lights. For instance, a point light source can be considered a point in three-dimensional space that emits light in all directions; therefore, the illumination direction of any pixel can be represented as the difference between the pixel's coordinates and the point light source's coordinates. Parallel lights emit parallel rays, and the illumination direction is independent of the pixel's position relative to the light source; all pixels have the same illumination direction. A line light source can be considered a straight line parallel to a plane in two-dimensional space that emits light in all directions. The illumination direction of each pixel can be calculated by taking the perpendicular point from the pixel to the line and then calculating the coordinate difference between the pixel and the perpendicular point. An area light source emits light from a surface with an area, and the light is emitted uniformly across the entire surface. Ambient lights have no specific direction or position and are used to simulate scattered light from all directions in a scene.
[0187] The image rendering engine can determine the illumination influence range of each virtual light source on the target object in the image to be rendered based on parameters such as the light source position, shape, and illumination direction, thus obtaining N illumination influence ranges. For any target pixel in the image to be rendered, the image rendering engine can determine M illumination influence ranges that affect the target pixel, and there is a one-to-one mapping relationship between the M illumination influence ranges and the corresponding M virtual light sources. The image rendering engine combines the influence of the M virtual light sources to calculate the final lighting effect, obtaining the balanced brightness value of the target pixel under the illumination influence of the M virtual light sources. By accurately rendering complex scenes with multiple light source influences, the realism and visual effect of image display can be significantly improved.
[0188] As an alternative approach, when the image to be rendered includes a human figure, the image rendering engine can obtain a skin thickness map of the human figure and, based on the skin thickness map, determine target skin regions whose skin thickness is less than a preset thickness threshold. The image rendering engine can then determine the balanced brightness value of target pixels within the target skin region under relighting from a virtual light source, based on the average brightness value of the target skin region. The balanced brightness value is negatively correlated with the skin thickness of the human figure.
[0189] For example, an image rendering engine can use a trained deep learning model to analyze the skin thickness features of a human object in an image to be rendered, obtaining thickness data for each skin point of the human object. The image rendering engine can then map the thickness data onto a 2D image to generate a skin thickness map.
[0190] The image rendering engine determines the balanced brightness value of any target pixel of the character object under the relighting of the virtual light source. Then, based on the skin thickness map, the engine can further adjust the balanced brightness value to obtain the adjusted balanced brightness value. The adjusted balanced brightness value is negatively correlated with the skin thickness of the character object. Schematic, for any target pixel, the smaller the skin thickness corresponding to the target pixel, the higher its adjusted balanced brightness value; the larger the skin thickness corresponding to the target pixel, the lower its adjusted balanced brightness value.
[0191] Figure 14 This schematically illustrates a skin thickness map and a diagram of image relighting. (For example...) Figure 14 As shown, when the image to be rendered includes a human figure, the image rendering engine can generate a skin thickness image 15 for the human figure. Schematic, in the skin thickness image 15, the lighter the hue of any target area, the greater its corresponding skin thickness; the darker the hue, the smaller its corresponding skin thickness.
[0192] The image rendering engine can relight a person based on a skin thickness image 15. Illustratively, for any target area, the greater the skin thickness, the lower the brightness value after relighting; conversely, the smaller the skin thickness, the higher the brightness value after relighting.
[0193] Image rendering engines can use techniques such as image capture, 3D modeling, image processing, and machine learning to obtain skin thickness maps of human subjects in an image to be rendered. Based on these skin thickness maps, the rendering engine can relight the human subjects in the image. This effectively enhances skin details, improves lighting effects, and increases the realism of image rendering, generating more lifelike and vivid lighting effects, thus contributing to a high-quality visual experience.
[0194] As an optional embodiment, when the image to be rendered is a dynamic wallpaper, the image rendering engine can smooth the normal direction vector of the target pixel in each image frame based on the similarity between the image frames in the image to be rendered. Furthermore, the image rendering engine can determine the balanced brightness value of the target pixel in each image frame under the relighting of the virtual light source based on the smoothed normal direction vector.
[0195] Smoothing the normal direction vectors of target pixels in each image frame effectively ensures smooth changes in normal direction between image frames, enhancing the smoothness and naturalness of live wallpaper playback. Calculating the balanced brightness value based on the smoothed normal direction vectors ensures consistent lighting effects for the live wallpaper under virtual light source relighting, facilitating natural transitions of light and shadow in live wallpaper display, enhancing the realism of lighting effects, and optimizing the visual experience.
[0196] Figure 15 The illustration shows a schematic diagram of the image display effect. Taking the image to be rendered as the wallpaper image being displayed on an electronic device, and the virtual light source as a virtual sunlight source used to simulate the effect of sunlight, the virtual sunlight source corresponds to the actual sun in the environment where the electronic device is located, and the two have the same light source position and light intensity coefficient.
[0197] like Figure 15 As shown, at 11:08, due to the sun's relatively off-center position and weaker light intensity, the relighting effect of the virtual light source corresponding to the sun was not very noticeable. The balanced brightness value determined based on the lighting characteristic parameters of the virtual light source was small, resulting in a slightly darker display effect for the wallpaper image.
[0198] At 12:08, due to the sun's central position and strong light intensity, the re-illumination effect of the virtual light source corresponding to the sun was quite noticeable. The balanced brightness value determined based on the virtual light source's illumination characteristic parameters was relatively high, resulting in a brighter display of the wallpaper image.
[0199] At 19:08, due to the sun's position in the west and the weaker light intensity, the relighting effect of the virtual light source corresponding to the sun was reflected on the right side of the character, resulting in a brighter display effect on the right side of the wallpaper image.
[0200] Taking a virtual light source used to simulate lighting effects as an example, at 22:08, the light sensor detected that the left side of the environment where the electronic device is located was brighter, indicating that there might be a light source on the left side of the environment. Therefore, the relighting effect of the virtual light source corresponding to the light source is reflected on the left side of the character, and the wallpaper image shows a brighter display effect on the left side.
[0201] Figure 16 A schematic diagram illustrating the image display method is shown. Figure 16As shown, the lock screen wallpaper interface 101 of an electronic device is used as an example for explanation. The lock screen interface includes a lock screen wallpaper image, calendar, system time, etc. In the lock screen wallpaper interface 101, the system time of the electronic device is 12:08, and the lock screen wallpaper image of the electronic device includes a person. Taking a virtual light source as an example, which is used to simulate the effect of sunlight, the virtual sunlight source has the same lighting characteristic parameters as the actual sun in the environment where the electronic device is located, that is, it has the same light source position and light intensity coefficient.
[0202] Image rendering services in electronic devices can render lock screen wallpaper images based on actual solar illumination characteristics to ensure the display effect matches the actual solar illumination. These image rendering services typically include modules such as an image acquisition module, a spatiotemporal state information acquisition module, a brightness distribution feature determination module, a pixel depth feature determination module, a pixel normal feature determination module, an illumination feature parameter determination module, and an image rendering engine.
[0203] For example, the image rendering service may obtain a lock screen wallpaper image as an image to be rendered 102 based on the lock screen wallpaper interface 101, and obtain the spatiotemporal state information 103 of the electronic device, such as the system time and current geographical location of the electronic device.
[0204] The image rendering service can extract depth information from the image 102 to be rendered, obtaining a pixel depth map 104 that matches the image 102. Based on the pixel depth map 104, the image rendering service can also transform pixels in the 2D image coordinate system to the 3D camera coordinate system, thereby converting each pixel into a vertex in 3D space, resulting in a 3D point cloud map 105 with spatial topological information. The 3D point cloud map 105 can indicate the pixel depth features of the image 102 to be rendered.
[0205] The image rendering service can construct normals for the image 102 to be rendered based on the depth value of any pixel indicated by the pixel depth map 104, and obtain a pixel normal map 106 that matches the image 102 to be rendered.
[0206] The image rendering service can also perform image segmentation on the image 102 to be rendered to obtain a foreground image 107 containing the target object, so as to render the foreground image 107.
[0207] The image rendering service can also extract brightness information from the image 102 to be rendered, and obtain a brightness integral map 108 that matches the image 102 to be rendered. The brightness integral map 108 can indicate the average brightness value of a preset local area of the image 102 to be rendered, so as to obtain the brightness distribution characteristics of the image 102 to be rendered.
[0208] The image rendering service can also determine the position and intensity coefficient of the virtual light source based on the spatiotemporal state information 103 of the electronic device (Figure 109 schematically shows a schematic diagram of the position of the light source).
[0209] The image rendering service can determine the first brightness value of any target pixel in the foreground image 107 under the relighting of the virtual light source based on the pixel depth features indicated by the 3D point cloud map 105, the pixel normal features indicated by the pixel normal map 106, the light source position of the virtual light source, and the illumination intensity coefficient.
[0210] The image rendering service determines the balanced brightness value of the target pixel based on a first brightness value and a second brightness value of the target pixel indicated by the brightness integral map 108. For example, the image rendering service sums the first and second brightness values to obtain a third brightness value. The image rendering service determines whether the absolute value of the difference between the third brightness value and the target brightness value is greater than a preset difference threshold. If the absolute value of the difference is greater than the difference threshold, the image rendering service adjusts the third brightness value based on the target brightness value and a brightness adjustment coefficient to obtain the balanced brightness value. The target brightness value is a preset theoretical brightness value for image display in the electronic device.
[0211] The image rendering service determines the image display parameters 113 for the image to be rendered 102 based on the balanced brightness value of any target pixel. Schematic, the image rendering service determines at least one of the following parameters of the image to be rendered 102 as the image display parameters 113 based on the balanced brightness value 112 that matches any target pixel: brightness parameter, color parameter, sharpness parameter, display resolution, background light parameter, and material roughness parameter.
[0212] The image rendering service sends the image display parameters 113 of the image to be rendered 102 to the image display service. The image display service can generate an effect layer that matches the image to be rendered 102 according to the image display parameters 113, and overlay the effect layer on top of the image to be rendered 102 for display, thus obtaining the lock screen wallpaper interface 114 based on virtual light source relighting.
[0213] In the lock screen wallpaper interface 101 of the electronic device, the display brightness of the lock screen wallpaper image is low. However, at 12:08, the sun is in the center of the field of view, and the light intensity is strong. The display effect of the lock screen wallpaper image cannot be matched with the ambient light brightness of the environment in which the electronic device is located, resulting in a poor display effect of the lock screen wallpaper image.
[0214] A virtual sunlight source simulating the effect of sunlight is used to relight the figures in the lock screen wallpaper image. For example, based on the illumination characteristic parameters of the virtual light source, the balanced brightness value of any target pixel of the figure under the relighting is determined, and the lock screen wallpaper image is displayed based on this balanced brightness value. In the lock screen wallpaper interface 114 of the electronic device, the display brightness of the lock screen wallpaper image is improved, which can match the ambient light brightness of the environment in which the electronic device is located, resulting in a better display effect.
[0215] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0216] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0217] This embodiment also provides an electronic device, including: one or more processors, a memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: determining the spatial geometric features and brightness distribution features of an image to be rendered; determining the illumination feature parameters of a preset virtual light source based on the spatiotemporal state information of the electronic device, wherein the virtual light source is used to relight the image to be rendered; determining image display parameters based on the illumination feature parameters for the image to be rendered according to the spatial geometric features and brightness distribution features; and displaying the image to be rendered based on the image display parameters.
[0218] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the image display method described above.
[0219] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the image display method described above.
[0220] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the image display methods in the above-described method embodiments.
[0221] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0222] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0223] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0224] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0225] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0226] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.
[0227] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0228] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0229] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. One exemplary embodiment involves a storage medium coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0230] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0231] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An image display method, characterized in that, Applied to electronic devices, the method includes: Determine the spatial geometric features and brightness distribution features of the image to be rendered; Based on the spatiotemporal state information of the electronic device, the illumination characteristic parameters of the preset virtual light source are determined, wherein the virtual light source is used to relight the image to be rendered; Based on the spatial geometric features and the brightness distribution features, image display parameters based on the illumination feature parameters are determined for the image to be rendered; wherein, the spatial geometric features include the pixel depth features and pixel normal features of the image to be rendered; the brightness distribution features include the average brightness value of a preset local region of the image to be rendered; the illumination feature parameters include the illumination direction vector and illumination intensity coefficient of the virtual light source; and The image to be rendered is displayed based on the image display parameters; The step of determining the image display parameters based on the illumination feature parameters for the image to be rendered, according to the spatial geometric features and the brightness distribution features, includes: For any target pixel in the image to be rendered, determine the pixel position of the target pixel as indicated by the pixel depth feature, and the normal direction vector of the target pixel as indicated by the pixel normal feature; Based on the pixel position and normal direction vector of the target pixel, the illumination direction vector and illumination intensity coefficient of the virtual light source, the first brightness value of the target pixel under the relighting of the virtual light source is determined; Based on the first brightness value and the second brightness value of the target pixel indicated by the brightness distribution characteristics, a balanced brightness value matching the target pixel is determined; and The image display parameters for the image to be rendered are determined based on the equalization brightness value matched with any target pixel.
2. The method according to claim 1, characterized in that, The spatial geometric features include pixel depth features and pixel normal features. Determining the spatial geometric features of the image to be rendered includes: The image to be rendered is subjected to depth extraction processing to obtain the pixel depth features of the image to be rendered; and Based on the pixel depth features, normals are constructed on the image to be rendered to obtain the pixel normal features of the image to be rendered.
3. The method according to claim 1, characterized in that, Determining the brightness distribution characteristics of the image to be rendered includes: Construct a luminance integral map that matches the image to be rendered; and Based on the luminance integral map, the average luminance value of a preset local region of the image to be rendered is determined to obtain the luminance distribution characteristics.
4. The method according to claim 1, characterized in that, The determination of the illumination characteristic parameters of the preset virtual light source based on the spatiotemporal state information of the electronic device includes: Based on the system time and / or current geographical location of the electronic device, the light source position and illuminance coefficient of the virtual light source are determined to obtain the illuminance characteristic parameters.
5. The method according to claim 4, characterized in that, Determining the location of the virtual light source based on the system time and / or current geographical location of the electronic device includes: Based on the system time and / or the current geographical location of the electronic device, the illumination direction vector of the virtual light source is determined, and the illumination direction vector indicates the position of the virtual light source in the three-dimensional virtual space where the image to be rendered is located.
6. The method according to claim 4, characterized in that, Determining the illuminance coefficient of the virtual light source based on the system time and / or current geographical location of the electronic device includes: The illumination intensity coefficient of the virtual light source is determined based on a preset mapping relationship and at least one of the following parameters: The system time, the preset location tag of the current geographical location, and the weather type matching the current geographical location.
7. The method according to claim 1, characterized in that, The method further includes: The image to be rendered is segmented to obtain a foreground image containing the target object; and The operation of determining the equalization brightness value is performed on any target pixel in the foreground image.
8. The method according to claim 1, characterized in that, The step involves determining an equal brightness value that matches the target pixel based on the first brightness value and the second brightness value of the target pixel indicated by the brightness distribution feature. The first brightness value and the second brightness value are summed to obtain the third brightness value; Determine whether the absolute value of the difference between the third brightness value and the target brightness value is greater than a preset difference threshold; as well as If the absolute value of the difference is greater than the difference threshold, the third brightness value is adjusted based on the target brightness value and the brightness adjustment coefficient to obtain the balanced brightness value. The target brightness value is a preset theoretical brightness value for image display in the electronic device.
9. The method according to claim 1, characterized in that, Determining the image display parameters for the image to be rendered based on the balanced brightness value matched with any target pixel includes: Based on the equalization brightness value matched with any target pixel, at least one of the following parameters of the image to be rendered is determined as the image display parameter: Brightness parameters, color parameters, sharpness parameters, display resolution, backlight parameters, and material roughness parameters.
10. The method according to claim 9, characterized in that, The step of displaying the image to be rendered based on the image display parameters includes: Based on the image display parameters, determine the color filter parameters for the image to be rendered; and The color filter parameters are applied to the currently displayed image to be rendered.
11. The method according to claim 1, characterized in that, Determining the image display parameters for the image to be rendered based on the balanced brightness value matched with any target pixel includes: Based on the balanced brightness value matched with any target pixel, visual effect parameters for the effect layer of the image to be rendered are determined, and used as the image display parameters. The step of displaying the image to be rendered based on the image display parameters includes: Based on the image display parameters, generate an effect layer that matches the image to be rendered; The effect layer is overlaid on top of the currently displayed image to be rendered.
12. The method according to claim 1, characterized in that, The method further includes: In the presence of N virtual light sources, based on the spatiotemporal state information and the light source type of each virtual light source among the N virtual light sources, the illumination influence range of each virtual light source on the target object in the image to be rendered is determined to obtain N illumination influence ranges, where N is an integer greater than 1. For any target pixel in the image to be rendered, determine the M lighting influence ranges where the target pixel is located. The M lighting influence ranges have a one-to-one mapping relationship with the corresponding M virtual light sources, where M is an integer and 0≤M≤N. Determine the first brightness value of the target pixel under the relighting of each of the M virtual light sources, thus obtaining M first brightness values; and Based on the M first brightness values and the second brightness value of the target pixel indicated by the brightness distribution characteristics, a balanced brightness value matching the target pixel is determined.
13. The method according to claim 12, characterized in that, The step of determining an equalized brightness value matching the target pixel based on the M first brightness values and the second brightness value of the target pixel indicated by the brightness distribution characteristics includes: The fourth brightness value is obtained by weighted summation of the M first brightness values and the second brightness values; Determine whether the absolute value of the difference between the fourth brightness value and the target brightness value is greater than a preset difference threshold; and If the absolute value of the difference is greater than the difference threshold, the fourth brightness value is adjusted based on the target brightness value and the brightness adjustment coefficient to obtain the balanced brightness value. The target brightness value is a preset theoretical brightness value for image display in the electronic device.
14. The method according to claim 1, characterized in that, The method further includes: If the image to be rendered includes a human figure, obtain a skin thickness map of the human figure. Based on the skin thickness map, target skin regions with a skin thickness less than a preset thickness threshold are identified; and Based on the average brightness value of the target skin region, determine the balanced brightness value of the target pixel within the target skin region under the relighting of the virtual light source. The balanced brightness value is negatively correlated with the skin thickness of the subject.
15. The method according to claim 1, characterized in that, The image to be rendered includes the wallpaper image currently displayed on the electronic device, and the wallpaper image includes at least one of the desktop wallpaper image, lock screen wallpaper image, and always-on wallpaper image.
16. The method according to claim 15, characterized in that, The wallpaper images include static wallpapers and live wallpapers, and the live wallpaper images include multiple image frames.
17. The method according to claim 16, characterized in that, The method further includes: When the image to be rendered is of the dynamic wallpaper type, the normal direction vector of the target pixel in each image frame is smoothed according to the similarity between the image frames in the image to be rendered; and Based on the smoothed normal direction vector, the balanced brightness value of the target pixel in each image frame under the relighting of the virtual light source is determined.
18. The method according to claim 1, characterized in that, The virtual light source includes a virtual solar light source used to simulate the effect of sunlight.
19. An electronic device, characterized in that, include: One or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, cause the electronic device to perform the following steps: Determine the spatial geometric features and brightness distribution features of the image to be rendered; Based on the spatiotemporal state information of the electronic device, the illumination characteristic parameters of the preset virtual light source are determined, wherein the virtual light source is used to relight the image to be rendered; Based on the spatial geometric features and the brightness distribution features, image display parameters based on the illumination feature parameters are determined for the image to be rendered; wherein, the spatial geometric features include the pixel depth features and pixel normal features of the image to be rendered; the brightness distribution features include the average brightness value of a preset local region of the image to be rendered; the illumination feature parameters include the illumination direction vector and illumination intensity coefficient of the virtual light source; and The image to be rendered is displayed based on the image display parameters; The step of determining the image display parameters based on the illumination feature parameters for the image to be rendered, according to the spatial geometric features and the brightness distribution features, includes: For any target pixel in the image to be rendered, determine the pixel position of the target pixel as indicated by the pixel depth feature, and the normal direction vector of the target pixel as indicated by the pixel normal feature; Based on the pixel position and normal direction vector of the target pixel, the illumination direction vector and illumination intensity coefficient of the virtual light source, the first brightness value of the target pixel under the relighting of the virtual light source is determined; Based on the first brightness value and the second brightness value of the target pixel indicated by the brightness distribution characteristics, a balanced brightness value matching the target pixel is determined; and The image display parameters for the image to be rendered are determined based on the equalization brightness value matched with any target pixel.
20. A computer-readable storage medium, characterized in that, The method includes a computer program that, when run on an electronic device, causes the electronic device to perform the image display method as described in any one of claims 1 to 18.