Image processing method, electronic equipment and storage medium
By identifying the scene type in electronic devices and processing HDR layers and SDR layers, the problem of poor display effect during screen recording or projection is solved, and high-quality display effect during screen recording or projection is achieved to satisfy users The need for rich and vivid visual experiences.
Patent Information
- Application Number
- CN202410949874.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-08
AI Technical Summary
When existing electronic devices record or project screens, the screen recording data or project screenshot data is still standard dynamic range (SDR) photos, resulting in poor display results and cannot meet users' needs for high-quality display.
Provide an image processing method, by receiving user operations, identifying scene types, obtaining preset switch status, and obtaining HDR layers, SDR layers and display optimization factors in the target interface when it is turned on, generating HDR layers and Images of SDR layers, adjust the brightness of the HDR layer to improve the display effect, ensuring a richer and more vivid visual experience when recording or projecting the screen.
Even if the original data is in SDR format, the HDR layer processing is used to improve the display effect, meet users' needs for high-quality display, and provide a better visual experience.
Smart Images

Figure CN118921425A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and specifically provides an image processing method, electronic equipment and storage medium. Background Art
[0002] Existing electronic devices already support the display of High Dynamic Range (HDR) photos on the main screen with good results. However, in the case of screen recording or screen projection, the recorded or projected data is still Standard Dynamic Range (SDR) photos, and the display effect is not good when users watch the recorded or projected data. Therefore, how to obtain data that meets user needs in the screen recording or screen projection scenario has become an urgent problem to be solved.
[0003] To this end, the present application proposes an image processing solution to solve the above technical problems. Summary of the invention
[0004] In order to solve the technical problem of poor display effect of screen recording or screen projection data obtained by existing methods, the present application provides an image processing method, an electronic device and a storage medium.
[0005] In a first aspect, the present application provides an image processing method, applied to an electronic device, the method comprising:
[0006] Receiving a first operation from a user;
[0007] identifying a scene type in response to the first operation;
[0008] Acquire the state of a preset switch based on the scene type;
[0009] When the preset switch is in the on state, obtaining a first HDR layer, an SDR layer, and a first display optimization factor in the target interface;
[0010] A first image is generated based on the first HDR layer, the SDR layer and the first display optimization factor, wherein the target interface is a current display interface of the display screen of the electronic device.
[0011] In one embodiment of the present application, generating a first image based on the first HDR layer, the SDR layer and the first display optimization factor includes:
[0012] adjusting the brightness of the first HDR layer based on the first display optimization factor to obtain a second HDR layer;
[0013] The SDR layer and the second HDR layer are synthesized to obtain the first image.
[0014] In one embodiment of the present application, adjusting the brightness of the first HDR layer based on the first display optimization factor includes:
[0015] determining a second display optimization factor based on the first display optimization factor, wherein a product of the first display optimization factor and the second display optimization factor is 1;
[0016] Determine a first brightness parameter based on the first HDR layer and the second display optimization factor;
[0017] The first HDR layer is adjusted from a first brightness to a second brightness based on the first brightness parameter, wherein the first brightness is less than the second brightness.
[0018] In one embodiment of the present application, after adjusting the brightness of the first HDR layer based on the first display optimization factor and before synthesizing the SDR layer and the second HDR layer, the method further includes:
[0019] Get display correction factor;
[0020] Normalizing each pixel value in the HDR layer;
[0021] Correcting each normalized pixel based on the display correction factor;
[0022] Denormalize the corrected pixel values.
[0023] In one embodiment of the present application, the method further includes:
[0024] When the preset switch is in an off state, obtaining a third HDR layer and an SDR layer in the target interface;
[0025] A second image is generated based on the third HDR layer and the SDR layer.
[0026] In one embodiment of the present application, the electronic device includes a layer synthesis module and a backlight module;
[0027] The third HDR layer is obtained by the following steps:
[0028] The layer synthesis module obtains a shielding flag, and sends a first instruction to the backlight module based on the shielding flag;
[0029] In response to the first instruction, the backlight module generates a second brightness parameter and sends it to the target application. The target application adjusts the first HDR layer in the target interface from the first brightness to the third brightness based on the second brightness parameter to obtain the third HDR layer, wherein the first brightness is greater than the third brightness.
[0030] In one embodiment of the present application, the method further includes:
[0031] Identify the screen type, where the screen type includes the display screen, virtual screen, and secondary screen;
[0032] The first image or the second image is sent to a corresponding screen based on the screen type recognition result.
[0033] In one embodiment of the present application, the method further includes:
[0034] receiving a second operation from the user;
[0035] In response to the second operation, the layer synthesis module deletes the shielding flag and sends a second instruction to the backlight module;
[0036] In response to the second instruction, the backlight module generates a third brightness parameter and sends it to the target application, and the target application adjusts the third HDR layer in the target interface from the third brightness to the first brightness based on the third brightness parameter.
[0037] In a second aspect, an electronic device is provided, comprising:
[0038] Display screen;
[0039] at least one processor;
[0040] and, a memory communicatively coupled to the at least one processor;
[0041] Wherein, a computer program is stored in the memory, and the computer program is the aforementioned image processing method when executed by the at least one processor.
[0042] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute any of the aforementioned image processing methods.
[0043] The above one or more technical solutions of this application have at least one or more of the following Beneficial effects:
[0044] The image processing method in the present application includes: receiving a first operation of a user; identifying a scene type in response to the first operation; obtaining the state of a preset switch based on the scene type; obtaining a first HDR layer, an SDR layer, and a first display optimization factor in a target interface when the preset switch is turned on; generating a first image based on the first HDR layer, the SDR layer, and the first display optimization factor. In this way, when the preset switch is turned on, a first image including an HDR layer and an SDR layer is generated. Even if the original data is in SDR format, the display effect can be improved through the HDR layer when recording or projecting the screen, thereby providing a richer and more vivid visual experience and meeting the user's demand for high-quality display. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The disclosure of the present application will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the drawings are used to represent similar components, among which:
[0046] Figure 1 is a schematic diagram of a display interface of a display screen in an embodiment;
[0047] Figure 2 is a schematic diagram of the main flow of an image processing method according to an embodiment of the present application;
[0048] Figure 3 is a schematic diagram of a system architecture of an electronic device in one embodiment of the present application;
[0049] Figure 4 This is a complete flowchart of an image processing method in one embodiment of the present application;
[0050] Figure 5 is a structural schematic diagram of an image processing device in one embodiment of the present application;
[0051] Figure 6 It is a schematic diagram of the main structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0052] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0053] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.
[0054] At present, when traditional electronic devices record or project the screen, the recorded or projected screen data is still SDR data, and the display effect is poor when users watch the recorded or projected screen data. To this end, the present application provides an image processing method, an electronic device and a storage medium.
[0055] The image processing method of the present application is applied to electronic devices. The electronic device includes a display screen, which is a physical screen used for input and display of the electronic device, and allows the user to control the electronic device by displaying icons, buttons and menus on the screen. The display screen can be operated using fingers or special touch pens, which are usually composed of a transparent capacitive layer and a sensor, and can detect the user's touch position and gesture.
[0056] In addition to mobile phones, the electronic devices described in the embodiments of the present application may also be tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, vehicle-mounted devices, smart cars, robots, smart glasses, smart televisions, and other devices with display screens and capable of display functions. The present application does not impose any special restrictions on the specific form of the electronic device.
[0057] Generally speaking, the display interface displayed by an electronic device is composed of multiple layers. For example, in a scenario where an HDR picture or video is not displayed in full screen, the display interface synthesized in the electronic device may include an HDR layer and an SDR layer. The HDR layer is used to indicate the layer of the display content of the HDR picture or video. The SDR layer is usually other layers in the display interface, such as a status bar layer, a navigation bar layer, etc.
[0058] It should be understood that the above description of the layer synthesis display interface is based on non-full screen display as an example. When the display interface is in full screen, the layers of the display interface can also be synthesized by multiple layers, and can also include HDR layers and SDR layers. In this regard, the embodiments of the present application do not impose any restrictions on this. Generally, full screen means that the area occupied by the displayed video or picture on the screen is the entire physical display area, and non-full screen means that the area occupied by the displayed video or picture on the screen is only a part of the entire physical display area.
[0059] For example, Figure 1 FIG. 1 is a schematic diagram of a display interface corresponding to a display screen, taking a photo album as an example. Figure 1 As shown, the electronic device displays a non-full-screen photo playback interface in the album APP. The interface can be composed of multiple layers such as the status bar layer, the UI interface of the gallery, and the layer corresponding to the HDR photo. Among them, except for the layer corresponding to the HDR photo which is the HDR layer, the other layers are all SDR layers.
[0060] See attached Figure 2 , Figure 2 It is a main flow chart of an image processing method according to an embodiment of the present application.
[0061] like Figure 2 As shown, the image processing method in the embodiment of the present application mainly includes the following steps S10 to S50.
[0062] Step S10: The electronic device receives a first operation from the user.
[0063] The first operation may be an operation performed by a user on an application in an electronic device, and the first operation may be implemented by a user click or voice, etc., without limitation. For example, starting a screen recording application or a screen projection application may be used as an example of the first operation.
[0064] Step S20: In response to the first operation, identifying the scene type, the scene type includes screen recording, screen projection or screen rotation.
[0065] Specifically, each application in the electronic device is configured with a scene identifier for indicating a corresponding scene. When the electronic device receives a first operation from a user on a certain application, the window manager determines the scene type according to the scene identifier corresponding to the first application.
[0066] Step S30: Acquire the status of a preset switch based on the scene type.
[0067] The preset switch can be a button set in the system settings for controlling whether to adjust the brightness of the HDR layer. If the user intends to obtain an image with an HDR effect, the preset switch can be turned on in advance. If the user does not intend to obtain an image with an SDR effect, the preset switch can be turned off.
[0068] Specifically, when the scene type is a screen projection scene or a screen recording scene, the state of the preset switch is obtained. When the scene type is a screen rotation scene, the screen is rotated.
[0069] Step S40: When the preset switch is in the on state, the first HDR layer, the SDR layer and the first display optimization factor in the target interface are obtained.
[0070] The target interface is the current display interface of the display screen of the electronic device.
[0071] A target application is installed in the electronic device, and the target application can play HDR videos or HDR photos. When the target application plays HDR videos or HDR photos, a target interface is displayed on the display screen of the electronic device, and the target interface includes a first HDR layer and an SDR layer, and the brightness of the first HDR layer is a first brightness. For example, an album application can be used as an example of the target application.
[0072] The first display optimization factor is the backlight compression factor, which is the ratio of the brightness of the SDR layer in the current display interface to the brightness of the first HDR layer.
[0073] The brightness of an SDR layer or an HDR layer can be expressed in units of candela per square meter (cd / m 2 ), foot-Lambert (ft-L), etc., where candela per square meter is also called nit. It should be noted that the difference in brightness units of SDR layers or HDR layers should not be used as a limitation on SDR layers or HDR layers in this application.
[0074] Specifically, since the target interface includes both HDR layers and SDR layers, the layer synthesis module can obtain all HDR layers and SDR layers in the target interface and the first display optimization factor.
[0075] Step S50: Generate a first image based on the first HDR layer, the SDR layer and the first display optimization factor, wherein the target interface is the current display interface of the display screen of the electronic device.
[0076] Based on the above steps S10 to S50, first receive the user's first operation; identify the scene type in response to the first operation; obtain the state of the preset switch based on the scene type; when the preset switch is on, obtain the first HDR layer, SDR layer and the first display optimization factor in the target interface; generate the first image based on the first HDR layer, SDR layer and the first display optimization factor. In this way, when the preset switch is on, a first image containing an HDR layer and an SDR layer is generated. Even if the original data is in SDR format, the display effect can be improved through the HDR layer when recording or projecting the screen, thereby providing a richer and more vivid visual experience and meeting the user's demand for high-quality display.
[0077] Before introducing the specific implementation details of the present application, the software system of the electronic device is first explained.
[0078] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture or a cloud architecture. The present application embodiment takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device. Figure 3 As shown in FIG. 1 , the Android system is composed of the application layer, application framework layer, system library layer and kernel layer from top to bottom.
[0079] The application layer may include a series of application packages, such as desktop, system user interface, gallery, camera, browser and other applications (applications may be referred to as applications for short), and the embodiments of the present application do not impose any restrictions on this.
[0080] Applications in the application layer can be divided into system applications and non-system applications. System applications can specifically include system user interface, gallery, camera, browser, etc., and non-system applications can include TikTok, WeChat and other applications.
[0081] The gallery is used to provide the user with a picture display function and a video playback function. Exemplarily, in response to the user clicking the video playback operation, the gallery calls the codec to decode the video and sends a request to start the video playback to the activity manager.
[0082] The application framework layer provides application programming interfaces and programming frameworks for applications in the application layer. The application framework layer may include a window manager, a view system, an activity manager, and a resource manager.
[0083] The window manager is used to manage window programs. The window manager can obtain the size of the display screen and the size and shape of the volume bar, and determine whether the size and shape of the volume bar need to be adjusted. In an embodiment of the present application, the window manager can, for example, record the screen, project the screen, etc. The screen recording indicates the content displayed on the recording screen, and generates an image accordingly. The screen projection indicates that the image on the display screen is projected to the corresponding screen, where the screen projection can include wired screen projection and wireless screen projection.
[0084] The activity manager is used to manage the life cycle of each application and the navigation fallback function. It is responsible for creating the Android main thread and maintaining the life cycle of each application.
[0085] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, in an embodiment of the present application, the view system can be used to display a non-full-screen video playback interface.
[0086] The system library may include multiple functional modules, such as a surface flinger (SF) synthesis module, a 3D graphics processing library (eg, openGL ES), a 2D graphics engine (eg, SGL), and the like.
[0087] The surface compositing module (Surface Flinger, SF) is one of the core components responsible for window management and graphics synthesis, which can implement functions such as window management, graphics synthesis and display output.
[0088] InputFlinger is used to implement input event management, including receiving events reported from the touch screen driver and event processing and distribution, and finally notifying the input event listening unit registered at the framework layer.
[0089] The kernel layer is a layer between hardware and software. The kernel layer includes at least the graphics processor driver and display driver.
[0090] The above step S50 is further described below.
[0091] Specifically, the above step S50 can be implemented through the following steps S501 to S502.
[0092] Step S501: adjusting the brightness of the first HDR layer based on the first display optimization factor to obtain a second HDR layer.
[0093] The display optimization factor is intended to change the display effect. For example, the brightness value of the HDR layer can be enlarged according to the display optimization factor to improve the display effect. Of course, the brightness value of the HDR layer can also be reduced according to the display optimization factor to weaken the display effect.
[0094] Step S5011: determining a second display optimization factor based on the first display optimization factor, wherein the product of the first display optimization factor and the second display optimization factor is 1.
[0095] Specifically, the second display optimization factor has a reciprocal relationship with the first display optimization factor. Exemplarily, the second display optimization factor can be obtained by taking the reciprocal of the first display optimization factor.
[0096] Step S5012: Determine a first brightness parameter based on the first HDR layer and the second display optimization factor.
[0097] Specifically, the product of the brightness of the area corresponding to the first HDR layer and the second display optimization factor can be used as the first brightness parameter.
[0098] Step S5013: adjusting the first HDR layer from a first brightness to a second brightness based on a first brightness parameter, wherein the first brightness is less than the second brightness.
[0099] Specifically, the brightness of the first HDR layer may be adjusted to a brightness value corresponding to the first brightness parameter to obtain a second HDR layer.
[0100] In addition, a gamma compensation algorithm may be used to perform gamma compensation on the second HDR layer.
[0101] In a specific embodiment of the present application, after adjusting the brightness of the first HDR layer based on the first display optimization factor, and before synthesizing the SDR layer and the second HDR layer, the method also includes: obtaining a display correction factor; normalizing each pixel value in the HDR layer; correcting each normalized pixel based on the display correction factor; and denormalizing the corrected pixel values.
[0102] The display correction factor is a gamma value, and in practical applications, the gamma value can be adaptively adjusted according to the specific display device and display content. For example, 2.2, 2.3, 2.4, etc. can be used as examples of gamma values.
[0103] First, normalize each pixel value in the second HDR layer from the original pixel to between 0 and 1 to facilitate subsequent calculations. Then, use the Gamma correction formula (Where V out is the output pixel value; V inis the input pixel value; γ is the gamma value) to calculate each normalized pixel value so that the bright part in the second HDR layer becomes brighter and the dark part becomes darker, thereby enhancing the contrast of the image. At this time, the original data of the second HDR layer is already in a certain gamma space. In this case, the corrected pixel value needs to be denormalized from the range of 0-1 back to the original range, that is, the pixel value after gamma correction is denormalized to ensure that the corrected pixel value still meets the requirements of the HDR format.
[0104] Gamma correction increases the difference between the dark and light parts of the image, and makes targeted adjustments to the bright and dark parts of the image, thereby optimizing the dynamic range of the image, making the image closer to the visual effect of the real world when displayed, improving the contrast of the image, and making the details in the image more clearly visible.
[0105] Step S502: synthesize the SDR layer and the second HDR layer to obtain a first image.
[0106] Specifically, the SDR layer and the second HDR layer may be synthesized by a layer synthesis module to obtain a first image.
[0107] The surface compositing module (Surface Flinger, SF) is one of the core components responsible for window management and graphics synthesis, which can implement functions such as window management, graphics synthesis and display output.
[0108] By adjusting the brightness of the first HDR layer, the problem of reduced brightness of HDR content on the original screen due to backlight compression can be compensated, so that the HDR content can still maintain its original brightness characteristics on the virtual screen or physical screen, thereby improving the overall visual experience.
[0109] In a specific embodiment of the present application, the method also includes: when the preset switch is in an off state, obtaining a third HDR layer and an SDR layer in the target interface; and generating a second image based on the third HDR layer and the SDR layer.
[0110] The third HDR layer has a reduced brightness value relative to the first HDR layer in the target interface, and other contents remain unchanged.
[0111] In a specific implementation of the present application, the electronic device includes a layer synthesis module and a backlight module; the third HDR layer can be obtained through the following steps S503 to S504.
[0112] Step S503: the layer synthesis module obtains the shielding flag, and sends a first instruction to the backlight module based on the shielding flag.
[0113] The shielding flag is a binary flag used to indicate that the brightness of the first HDR layer (first brightness) is adjusted to the third brightness. Specifically, the shielding flag is generated based on factors such as the current system state (e.g., screen recording state), user settings (e.g., the user turns off the preset switch), etc., and is not specifically limited to this, where the third brightness is the brightness corresponding to the SDR layer.
[0114] Specifically, when it is determined that the preset switch is not turned on, the layer synthesis module obtains the shielding flag, generates a first instruction according to the shielding flag and sends it to the backlight module, where the first instruction may be an instruction such as adjusting the brightness of the first HDR layer to a third brightness.
[0115] Step S504: In response to the first instruction, the backlight module generates a second brightness parameter and sends it to the target application. The target application adjusts the first HDR layer in the target interface from the first brightness to the third brightness based on the second brightness parameter to obtain a third HDR layer, wherein the first brightness is greater than the third brightness.
[0116] After receiving the first instruction, the backlight module generates a second brightness parameter and sends it to the target application. The target application can adjust the first HDR layer from the first brightness to the third brightness according to the second brightness parameter, that is, adjust the first HDR layer to the same brightness as the SDR layer.
[0117] It is understandable that if Figure 3 As shown, the application framework layer of the system includes a backlight module, which can obtain brightness parameters for the HDR layer according to the instructions issued by the layer synthesis module, and send the brightness parameters to the target application so that the target application can adjust the brightness of the HDR layer.
[0118] When the target application monitors that the brightness of the first HDR layer in the target interface changes from the first brightness to the third brightness (corresponding to the third HDR layer at this time), the target application draws the third HDR layer and SDR content and displays them on the display screen. At this time, the layer synthesis module obtains the SDR layer and the third HDR layer in the target interface for synthesis to obtain the second image.
[0119] In this way, an image containing only SDR layers is generated according to user needs, satisfying the user experience.
[0120] In a specific embodiment of the present application, the method further includes: identifying a screen type, where the screen types include a display screen, a virtual screen, and a secondary screen; and sending the first image or the second image to the corresponding screen based on the screen type identification result.
[0121] The virtual screen may refer to a virtual reality interface created by an application (eg, a screen recording app) in an electronic device. Specifically, when it is identified that the scene type corresponding to the user's first operation is a screen recording operation, a virtual screen is created in response to the user's first operation.
[0122] The secondary screen may be an external display screen of the electronic device, and it may be connected to the electronic device by wire or wirelessly, and there is no limitation on this.
[0123] Specifically, each screen has its own independent screen ID and each screen ID is different, so the screen type can be identified based on the screen ID. For example, the ID of the main screen can be 0, the ID of the virtual screen can be 1, and the ID of a secondary screen (external physical screen) can be 2, without limitation.
[0124] In one embodiment, taking screen recording as an example, when the layer synthesis module identifies the existence of the virtual screen according to the screen ID, the first image or the second image can be sent to the virtual screen for file storage.
[0125] In a specific embodiment of the present application, the method also includes: receiving a second operation of the user; in response to the second operation, the layer synthesis module deletes the mask flag and sends a second instruction to the backlight module; in response to the second instruction, the backlight module generates a third brightness parameter and sends it to the target application, and the target application adjusts the third HDR layer in the target interface from the third brightness to the first brightness based on the third brightness parameter.
[0126] The second operation can be an operation performed by the user on the electronic device according to actual needs. The second operation is an operation corresponding to the first operation. The second operation can be implemented by a user click or voice, etc., and is not limited to this. For example, closing the screen recording application can be used as an example of the second operation.
[0127] Specifically, after the user performs the second operation, the layer synthesis module deletes the shielding flag and sends a second instruction to the backlight module. The second instruction may be an instruction to adjust the third HDR layer from the third brightness to the first brightness. After receiving the second instruction, the backlight module generates a third brightness parameter according to the second instruction and sends it to the target application. The target application adjusts the third HDR layer in the target interface from the third brightness to the first brightness based on the third brightness parameter. In this way, after the screen recording or projection is completed, the display effect of the target application continues to be adjusted to the display brightness of the HDR layer, thereby improving the user's visual experience.
[0128] After the screen recording or projection is completed, the target application monitors that the brightness of the third HDR layer has been adjusted from the third brightness to the first brightness, and then starts to draw the display content. The layer synthesis module synthesizes the current HDR layer and the SDR layer and sends them to the display screen for display.
[0129] In a specific implementation of the present application, the image processing method of the present application is described in detail with the photo album as the target application and the screen recording as the scene type, such as Figure 4 As shown, specifically as shown in the following steps S201 to S213.
[0130] Step S201: Based on the user's first operation, start the screen recording application.
[0131] Step S202: Determine whether the preset switch is turned on, if so, execute the following step S203, otherwise execute the following step S207.
[0132] Step S203: the album draws the content corresponding to the first HDR layer.
[0133] Step S204: The layer synthesis module obtains the layer content of the target interface displayed on the current display screen, including the SDR layer, the first HDR layer and the backlight compression coefficient (the first display optimization factor), and adjusts the first HDR layer from the first level brightness to the second brightness and compensates to obtain a second HDR image. The specific implementation principle of brightness adjustment and compensation can be found in the aforementioned step S40, which will not be repeated here.
[0134] Step S205: synthesize the SDR layer and the second HDR layer to obtain a first image.
[0135] Step S206: Send the first image to the virtual screen.
[0136] Step S207: Determine whether the screen recording parameters are empty. If so, execute the following step S213, otherwise execute the following step S208. Specifically, when the screen recording application is opened, a virtual screen is created. The screen recording application obtains the layer (surface) parameters through the application program interface call or internal mechanism. If the layer parameters are empty, it means that the data is not obtained directly from SurfaceFlinger. The screen recording application may choose other ways to capture the screen content, such as using the media projection API (MediaProjection) to capture the screen video stream instead of directly obtaining the synthesized data from SurfaceFlinger, and then the process ends. If the layer parameters are not empty and point to a valid Surface object, it means that the screen recording application hopes to obtain the synthesized data directly from SurfaceFlinger, and then execute S208.
[0137] Step S208: the layer synthesis module obtains the shielding flag, and sends a first instruction to the backlight module based on the shielding flag, so that the backlight module generates a second brightness parameter and sends it to the album.
[0138] Step S209: The album adjusts the first HDR layer from the first brightness to the third brightness based on the second brightness parameter to obtain the third HDR layer to turn off the HDR effect. Specifically, in the process of turning off the HDR effect, the album needs to wait for the first HDR to change from the first brightness to the third brightness. The waiting time can be 198ms, 199ms, 200ms, 201ms, 202ms, etc., because the backlight changes from high brightness to low brightness, and the process of a backlight animation gradient needs time to complete. During this waiting process, SF will not send data to the virtual screen, because the brightness has not completely changed to the third brightness, and the data drawn by the album is still HDR data, and HDR data should not be sent to the virtual screen.
[0139] Step S210: the album draws the corresponding content of the third HDR layer.
[0140] Step S211: The layer synthesis module synthesizes the SDR layer and the third HDR layer to obtain a second image.
[0141] Step S212: the layer synthesis module sends the second image to the virtual screen.
[0142] Step S213: End.
[0143] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.
[0144] Furthermore, the present application also provides an image processing device.
[0145] See attached Figure 5 , Figure 5 It is a main structural block diagram of an image processing device according to an embodiment of the present application.
[0146] like Figure 5 As shown, the image processing device in the embodiment of the present application mainly includes a receiving module 51, a recognition module 52, a first acquisition module 53, a second acquisition module 54 and a layer synthesis module 55. In some embodiments, one or more of the receiving module 51, the recognition module 52, the first acquisition module 53, the second acquisition module 54 and the layer synthesis module 55 can be combined into one module.
[0147] In some embodiments, the receiving module 51 is configured to receive a first operation of a user.
[0148] The identification module 52 is configured to identify a scene type in response to a first operation.
[0149] The first acquisition module 53 is configured to acquire the state of the preset switch based on the scene type.
[0150] The second acquisition module 54 is configured to acquire the first HDR layer, the SDR layer and the first display optimization factor in the target interface when the preset switch is in the on state.
[0151] The layer synthesis module 55 is configured to generate a first image based on the first HDR layer, the SDR layer and the first display optimization factor, wherein the target interface is the current display interface of the display screen of the electronic device.
[0152] In one implementation, the description of the specific implementation functions can refer to step S10 to step S50.
[0153] The image processing device is used to perform Figure 2 The image processing method embodiments shown in the figure have similar technical principles, technical problems solved and technical effects produced. Technicians in this technical field can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the image processing device can refer to the contents described in the embodiment of the image processing method, which will not be repeated here.
[0154] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
[0155] Furthermore, the present application also provides an electronic device, which may include a display screen, at least one processor, and a memory connected to the at least one processor; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the image processing method described in any of the above embodiments is implemented. Figure 6 As shown, Figure 6The structure of the smart device is shown as an example, which includes a processor 61, a memory 62 and a display screen 63.
[0156] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the image processing method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned image processing method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a memory device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.
[0157] The relevant user personal information that may be involved in the various embodiments of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.
[0158] The user personal information processed by this application will vary depending on the specific product / service scenario, and will be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information or other related information. The applicant will treat the user's personal information and its processing with a high degree of diligence.
[0159] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.
[0160] So far, the technical solutions of the present application have been described in conjunction with the specific implementations shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific implementations. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. An image processing method, characterized in that: Applied to electronic equipment, the method comprises: Receiving a first operation from a user; identifying a scene type in response to the first operation; Acquire the state of a preset switch based on the scene type; When the preset switch is in the on state, obtaining a first HDR layer, an SDR layer, and a first display optimization factor in the target interface; A first image is generated based on the first HDR layer, the SDR layer and the first display optimization factor, wherein the target interface is a current display interface of the display screen of the electronic device.
2. The image processing method according to claim 1, characterized in that: The generating a first image based on the first HDR layer, the SDR layer and the first display optimization factor includes: adjusting the brightness of the first HDR layer based on the first display optimization factor to obtain a second HDR layer; The SDR layer and the second HDR layer are synthesized to obtain the first image.
3. The image processing method according to claim 2, characterized in that: The adjusting the brightness of the first HDR layer based on the first display optimization factor includes: determining a second display optimization factor based on the first display optimization factor, wherein a product of the first display optimization factor and the second display optimization factor is 1; Determine a first brightness parameter based on the first HDR layer and the second display optimization factor; The first HDR layer is adjusted from a first brightness to a second brightness based on the first brightness parameter, wherein the first brightness is less than the second brightness.
4. The image processing method according to claim 2, characterized in that: After adjusting the brightness of the first HDR layer based on the first display optimization factor and before compositing the SDR layer and the second HDR layer, the method further includes: Get display correction factor; Normalizing each pixel value in the HDR layer; Correcting each normalized pixel based on the display correction factor; Denormalize the corrected pixel values.
5. The image processing method according to claim 1, characterized in that: The method further comprises: When the preset switch is in an off state, obtaining a third HDR layer and an SDR layer in the target interface; A second image is generated based on the third HDR layer and the SDR layer.
6. The image processing method according to claim 5, characterized in that: The electronic device comprises a layer synthesis module and a backlight module; The third HDR layer is obtained by the following steps: The layer synthesis module obtains a shielding flag, and sends a first instruction to the backlight module based on the shielding flag; In response to the first instruction, the backlight module generates a second brightness parameter and sends it to the target application. The target application adjusts the first HDR layer in the target interface from the first brightness to the third brightness based on the second brightness parameter to obtain the third HDR layer, wherein the first brightness is greater than the third brightness.
7. The image processing method according to claim 5, characterized in that: The method further comprises: Identify the screen type, where the screen type includes the display screen, virtual screen, and secondary screen; The first image or the second image is sent to a corresponding screen based on the screen type recognition result.
8. The image processing method according to claim 6, characterized in that: The method further comprises: receiving a second operation from the user; In response to the second operation, the layer synthesis module deletes the shielding flag and sends a second instruction to the backlight module; In response to the second instruction, the backlight module generates a third brightness parameter and sends it to the target application, and the target application adjusts the third HDR layer in the target interface from the third brightness to the first brightness based on the third brightness parameter.
9. An electronic device, characterized in that: include: Display screen; at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores a computer program, and when the computer program is executed by the at least one processor, the image processing method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the image processing method according to any one of claims 1 to 8.
Citation Information
Cited By
Display method, electronic device, and storage medium
WO2026179839A1
