Image processing method and device, electronic equipment and storage medium

By updating the grayscale values ​​of the image both globally and locally, the problem of poor image quality caused by dark scenes was solved, the image quality was improved, and the brightness of details in dark scenes was enhanced.

CN117392244BActive Publication Date: 2026-05-19YIBIN XGIMI OPTOELECTRONIC CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YIBIN XGIMI OPTOELECTRONIC CO LTD
Filing Date
2022-06-30
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

The dark scenes in the video resulted in poor image quality.

Method used

By acquiring the grayscale values ​​of pixels in the image, determining the distribution range of grayscale values, performing an overall update based on the maximum value range and a preset threshold, partitioning the image, updating the local grayscale values, and finally fusing the locally and globally updated images.

Benefits of technology

It improves image quality, avoids overexposure, and enhances the brightness of details in dark scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117392244B_ABST
    Figure CN117392244B_ABST
Patent Text Reader

Abstract

The application discloses an image processing method and device, electronic equipment and storage medium; the application can obtain the gray value of the pixel point in the image; determine the maximum value interval in the distribution interval of the gray value of the image; based on the gray value in the maximum value interval and the preset maximum threshold, the gray value in the image is updated as a whole, and the image updated as a whole is obtained; the pixel points in the image are partitioned, and a plurality of pixel partitions are obtained; based on the gray value of the pixel point in the pixel partition, the gray value of the target pixel point is locally updated, and the image updated locally is obtained; the image updated locally and the image updated as a whole are fused and processed, and the processed image is obtained. In the application, the gray value of the image is updated as a whole and locally respectively, the dark scene details are concerned while the global brightness of the image is improved. Therefore, the scheme can improve the image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information technology, specifically to an image processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] A smart projector is a projector that integrates expandable hardware and software, human-computer interaction, and multimedia interconnection functions. It can provide application services such as network search, online video, video-on-demand (VOD), digital music, and online educational resources. Users can search for various online resources, conduct remote meetings, project online and local videos, and also connect external electronic devices for screen projection.

[0003] However, the video contains many dark scenes, which results in poor image quality for the user. Summary of the Invention

[0004] This application provides an image processing method, apparatus, electronic device, and storage medium that can improve image quality.

[0005] This application provides an image processing method, including:

[0006] Get the grayscale value of a pixel in an image;

[0007] Determine the range of maximum values ​​within the distribution range of grayscale values ​​in the image;

[0008] Based on the gray values ​​in the maximum value range and the preset maximum threshold, the gray values ​​in the image are updated as a whole to obtain the updated image.

[0009] The pixels in the image are divided into multiple pixel partitions;

[0010] Based on the gray values ​​of pixels in the pixel partition, the gray values ​​of the target pixel are locally updated to obtain the locally updated image.

[0011] The locally updated image and the globally updated image are fused together to obtain the processed image.

[0012] This application also provides an image processing apparatus, comprising:

[0013] The acquisition unit is used to acquire the grayscale value of pixels in the image.

[0014] The determining unit is used to determine the maximum value range in the distribution range of grayscale values ​​of an image;

[0015] The overall update unit is used to update the gray values ​​in the image based on the gray values ​​in the maximum value range and the preset maximum threshold, so as to obtain the image after overall update;

[0016] A partitioning unit is used to divide the pixels in an image into multiple pixel partitions.

[0017] The local update unit is used to locally update the gray value of the target pixel based on the gray value of the pixel in the pixel partition and the second preset maximum threshold, so as to obtain the locally updated image. The target pixel is the pixel shared by the pixel partitions.

[0018] The fusion unit is used to fuse the locally updated image and the globally updated image to obtain the processed image.

[0019] In some embodiments, the overall update unit is specifically used for:

[0020] Determine the maximum mean value corresponding to the maximum value range based on the grayscale values ​​within the maximum value range;

[0021] When the maximum mean is less than the preset maximum threshold, the mean of the image is determined based on the grayscale values ​​in the image.

[0022] When the mean value of the image is less than the first preset mean threshold, the overall gain value is determined based on the maximum mean value and the preset maximum threshold.

[0023] Based on the overall gain value, the grayscale values ​​in the image are updated as a whole to obtain the updated image.

[0024] In some embodiments, the local update unit is specifically used for:

[0025] Determine the mean value of the partition corresponding to the target pixel based on the grayscale value of the pixels in the pixel partition where the target pixel is located;

[0026] When the mean value of a partition is less than the second preset mean value threshold, the gray value of the target pixel is locally updated based on the preset gain value to obtain the locally updated image.

[0027] In some embodiments, pixel partitioning includes pixel partitioning in the central region of the image and pixel partitioning in the edge region, and preset gain values ​​include a first preset gain value and a second preset gain value;

[0028] Based on a preset gain value, the grayscale value of the target pixel is locally updated to obtain the locally updated image, including:

[0029] Based on the first preset gain value, the grayscale value of the target pixel in the central region is updated, and based on the second preset gain value, the grayscale value of the target pixel in the edge region is updated to obtain the locally updated image.

[0030] In some embodiments, before locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image, the method further includes:

[0031] Determine the number of pixels in the target pixel partition whose gray value is less than a preset gray threshold. The target pixel partition can be any pixel partition.

[0032] Based on the quantity, determine the proportion of pixels with gray values ​​less than a preset gray threshold in the target pixel partition;

[0033] When the ratio is greater than the preset ratio, the target pixel includes the pixels in the target pixel partition.

[0034] In some embodiments, before locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image, the process includes:

[0035] Identify dark pixels in the image whose grayscale value is less than a preset grayscale threshold;

[0036] Determine whether the grayscale values ​​of adjacent pixels of a dark pixel are less than a preset grayscale threshold;

[0037] When the grayscale value of adjacent pixels is less than the preset grayscale threshold, the target pixel includes dark pixels and adjacent pixels.

[0038] In some embodiments, the image is an image from a first video, and the image processing apparatus is further configured to:

[0039] Obtain the source information of the first video;

[0040] Based on the source information, determine the first resolution and first refresh rate when playing the first video.

[0041] In some embodiments, the image processing apparatus is further configured to:

[0042] When playing the second video at the second resolution and the second refresh rate, motion compensation data corresponding to the second refresh rate is determined. The motion compensation data includes transition images between images in the second video. The second resolution and the second refresh rate are different from the first resolution and the first refresh rate.

[0043] Motion compensation is performed on the second video based on motion compensation data.

[0044] In some embodiments, before acquiring the grayscale value of a pixel in an image, the image processing apparatus further comprises:

[0045] Displays the Ultimate Mode interface;

[0046] In response to the confirmation of entry into the Ultimate Mode interface, enter Ultimate Mode to perform steps to obtain the grayscale values ​​of pixels in the image.

[0047] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute steps in any of the image processing methods provided in this application.

[0048] This application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform steps in any of the image processing methods provided in this application.

[0049] In this application, the determination of whether to enhance the overall grayscale value of an image is based on whether the maximum value range within the grayscale value distribution range reaches a preset maximum threshold, thus avoiding overexposure. Simultaneously, the image can be partitioned, and the grayscale values ​​of common pixels in each partition can be updated, improving the brightness of local details. In other words, while enhancing the overall brightness of the image, attention can be paid to details in dark scenes. Therefore, this solution can improve image quality. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1a This is a scene illustration of the image processing method provided in this application;

[0052] Figure 1b This is a flowchart illustrating the image processing method provided in this application;

[0053] Figure 1c This is a schematic diagram of the pixel partitioning provided in this application;

[0054] Figure 2 This is a schematic diagram of the structure of an image processing apparatus provided in this application;

[0055] Figure 3 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0056] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and 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.

[0057] This application provides an image processing method, apparatus, electronic device, and storage medium.

[0058] Specifically, the image processing device can be integrated into an electronic device, such as a terminal or server. The terminal can be a projector, smart TV, laser TV, mobile phone, tablet computer, smart Bluetooth device, laptop computer, desktop computer, etc.; the server can be a single server or a server cluster consisting of multiple servers. In some embodiments, the server can also be implemented as a terminal. In some embodiments, the image processing device can also be integrated into multiple electronic devices; for example, the image processing device can be integrated into both a terminal and a server, with the terminal and server jointly implementing the image processing method of this application.

[0059] For example, the image processing device can be integrated into a projector, such as Figure 1a As shown, in this scenario, the projector can incorporate a system-on-chip (SoC), a display module, and a projection optical engine. The projector can acquire the grayscale values ​​of pixels in an image; determine the maximum value range within the grayscale value distribution interval of the image; update the overall grayscale values ​​of the image based on the grayscale values ​​in the maximum value range and a preset maximum threshold to obtain the overall updated image; partition the pixels in the image to obtain multiple pixel partitions; based on the grayscale values ​​of pixels in the pixel partitions, locally update the grayscale values ​​of target pixels to obtain the locally updated image; and fuse the locally updated image and the overall updated image to obtain the processed image.

[0060] In this embodiment, the projector determines whether to enhance the overall grayscale value of the image by judging whether the maximum value range in the grayscale value distribution range of the image reaches a preset maximum threshold, thus avoiding overexposure. Simultaneously, the image can be divided into partitions, and the grayscale values ​​of common pixels in each partition can be updated to improve the brightness of local details. In other words, it can enhance the overall brightness of the image while maintaining attention to details in dark scenes. Therefore, this solution can improve the image quality of the projector's projected image.

[0061] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0062] In this embodiment, an image processing method is provided, such as... Figure 1b As shown, the specific process of this image processing method can be as follows:

[0063] 110. Obtain the grayscale value of a pixel in an image.

[0064] The image can be any frame from the target video being played on the projector, any frame from a game running on the projector, or a signal stream transmitted to the projector via HDMI. The target video can be a video stream obtained from the network, a local video, or a video stream transmitted to the projector via HDMI, etc.

[0065] In some embodiments, the SOC of the projector can capture each frame of image, and then use the image grayscale method in the OpenCV library to process each frame of image into a grayscale image, and then obtain the grayscale value from the first pixel to the last pixel of the image, with the grayscale value ranging from 0 to 255.

[0066] In some embodiments, before the SOC acquires the grayscale values ​​of pixels in the image, the SOC can also determine the current playback scene. Based on the playback scene, it determines whether to perform motion estimation and motion compensation (MEMC) on the image. When the playback scene is a movie-watching scene, motion estimation and motion compensation are performed on the image; when the playback scene is a latency-sensitive scene, motion estimation and motion compensation are not performed on the image. The playback scene can include, but is not limited to, movie-watching scenes and latency-sensitive scenes. Movie-watching scenes can be playing multimedia data such as video streams, while latency-sensitive scenes can be scenes such as games that require real-time interaction and screen updates. For example, when a user is in a movie-watching scene, smoothness is prioritized (i.e., ensuring MEMC effects), therefore, motion estimation and motion compensation are performed on the image. When a user is using HDMI screen mirroring for gaming, low latency is prioritized, therefore, motion estimation and motion compensation are not performed on the image to achieve the lowest possible latency experience.

[0067] In some embodiments, when the image is an image from the first video, the playback scenario is a movie-watching scenario. Before the SOC obtains the grayscale values ​​of the pixels in the image, it can also:

[0068] 1) Obtain the source information of the first video.

[0069] The source information may include the resolution and frame rate of the first video. The first video can be any video from the target video.

[0070] 2) Based on the source information, determine the first resolution and first refresh rate when playing the first video.

[0071] Here, the first resolution refers to the resolution at which the display module displays each frame of the first video. The first refresh rate refers to the number of frames of the first video displayed per second by the display module.

[0072] Optionally, device performance parameters, including physical resolution and device refresh rate, can also be obtained. Based on the source video information, physical resolution, and device refresh rate, the initial resolution and refresh rate for playing the first video can be determined.

[0073] The device performance parameters can refer to the performance parameters of the hardware modules integrated into the projector. For example, physical resolution refers to the physical resolution of the display module, and the resolution when playing the first video cannot exceed the physical resolution. Device refresh rate can be the refresh rate of the display module; for example, the display module can support refresh rates of 60Hz and 120Hz, and the first refresh rate is included in the device refresh rate. For instance, the SOC will detect the resolution of the target video played by the user in real time. If the first video is detected to be a 4K resolution source with a physical resolution of 4K and a device refresh rate of 60Hz and 120Hz, then the first resolution and first refresh rate when playing the first video can be 4K 60Hz to provide the user with the best 4K effect. If the first video is detected to be a 1080p resolution or lower source, then the first resolution and first refresh rate when playing the first video will be 1080p 120Hz.

[0074] Optionally, the motion compensation data corresponds to the refresh rate; for example, the SOC can support 60Hz and 120Hz MEMC. The 60Hz MEMC corresponds to the 60Hz refresh rate of the display module, and the 120Hz MEMC corresponds to the 120Hz refresh rate of the display module. Taking a target video with a signal frame rate of 30Hz as an example, assuming the video includes frames A, B, and C. If the refresh rate is 60Hz, then 60Hz MEMC is executed. The SOC can determine the motion compensation data based on the MEMC algorithm. The motion compensation data can include the transition image A1 between frames A and B, and the transition image B1 between frames B and C. Based on the motion compensation data, motion compensation is performed on the target video, which is then converted to a 60Hz frame rate and sent to the display module. The video sent to the display module becomes AA1BB1CC1. If the refresh rate is 60Hz, then MEMC at 120Hz will be executed. The SOC can determine motion compensation data based on the MEMC algorithm. The motion compensation data can include transition images A1, A2, A3 between two frames A and B, and transition images B1, B2, B3 between two frames B and C. Based on the motion compensation data, motion compensation is performed on the target video, and the target video sent to the display module will become AA1A2A3BB1B2B3CC1C2C3.

[0075] In some embodiments, when playing a second video at a second resolution and a second refresh rate, motion compensation data corresponding to the second refresh rate is determined. The motion compensation data includes transition images between images in the second video. The second resolution and second refresh rate are different from the first resolution and first refresh rate. Motion compensation is performed on the second video based on the motion compensation data. The second resolution and second refresh rate are determined using the source information of the second video. The second video is any video in the target video, and the projector can switch from playing the first video to playing the second video.

[0076] For example, the SOC detects the resolution of the target video being played in real time. If the first video is a 4K resolution, 30Hz frame rate source, and the second video is a 30Hz frame rate, 1080p resolution or lower source, then the first resolution and first refresh rate when playing the first video can be 4K 60Hz. The compensation data corresponding to the first refresh rate can include one frame of transition image, thus performing one frame of motion compensation on the first video. When the projector switches from playing the first video to the second video, the second resolution and second refresh rate when playing the second video are 1080p 120Hz. The compensation data corresponding to the second refresh rate can include three frames of transition image, thus performing three frames of motion compensation on the second video, which can improve the smoothness of the second video. Because a 1080p source cannot achieve a 4K effect when played on a 4K display, the MEMC effect is prioritized, performing 120Hz motion estimation and motion compensation frame interpolation to achieve optimal video smoothness.

[0077] In some embodiments, the image processing method of this solution can be referred to as the "Ultimate Mode," and the user can select whether to perform the image processing scheme of this application on the image through a user interface. Therefore, before obtaining the grayscale values ​​of pixels in the image, the process may further include: displaying an Ultimate Mode interface; and entering Ultimate Mode to perform the step of obtaining the grayscale values ​​of pixels in the image in response to a confirmation entry operation on the Ultimate Mode interface. For example, the projector may display an Ultimate Mode interface in response to the user's operation on the corresponding button of the remote control. This Ultimate Mode interface may prompt the user about the improvement effect of Ultimate Mode on the image and display a confirmation control; and enter Ultimate Mode and begin obtaining the grayscale values ​​of pixels in the image in response to the user's confirmation entry operation on the confirmation control.

[0078] 120. Determine the maximum value range within the distribution range of grayscale values ​​of an image.

[0079] The distribution interval can be used to represent the distribution of grayscale values ​​in an image. In some embodiments, the SOC of the projector can sort the grayscale values ​​of all pixels to obtain sorted grayscale values; and partition the sorted grayscale values ​​to obtain distribution intervals. For example, the sorted grayscale values ​​can be divided into 1000 distribution intervals. Assuming there are a total of 1920×1080 pixels, divided into 1000 distribution intervals, each distribution interval will contain approximately 2074 pixels with corresponding grayscale values.

[0080] The maximum value interval is the interval with the largest average grayscale value in the distribution interval. For example, when dividing the grayscale values ​​into partitions after sorting them from smallest to largest, the maximum value interval could be the last distribution interval.

[0081] 130. Based on the gray values ​​in the maximum value range and the preset maximum threshold, update the gray values ​​in the image as a whole to obtain the updated image.

[0082] The preset maximum threshold can be customized according to the actual application scenario, for example, it can be 255, 250, etc.

[0083] In some embodiments, the SOC of the projector updates the gray values ​​in the image as a whole based on the gray values ​​in the maximum value range and a preset maximum threshold, to obtain an updated image. This may include, but is not limited to, the following steps:

[0084] 1) Determine the maximum mean value corresponding to the maximum value range based on the grayscale values ​​within the maximum value range. For example, calculate the average or expected value of the grayscale values ​​within the maximum value range to obtain the maximum mean value.

[0085] 2) When the maximum mean is less than the preset maximum threshold, the mean of the image is determined based on the grayscale values ​​in the image. When the maximum mean is greater than or equal to the preset maximum threshold, the grayscale values ​​in the image are not updated as a whole to avoid overexposure.

[0086] 3) When the mean value of the corresponding image is less than the first preset mean threshold, the overall gain value is determined based on the maximum mean value and the preset maximum threshold. The first preset mean threshold can be customized according to the actual application scenario; for example, it can be set to one-tenth or one-fifth of the preset maximum threshold.

[0087] Optionally, the difference between the maximum mean and a preset maximum threshold can be calculated, and for ease of description, this difference is referred to as the maximum gain value. Based on this difference, the overall gain value is obtained, which can be less than the maximum gain value. In some embodiments, it can be divided into three levels: strong, medium, and weak, to meet the needs of different users. For example, an overall gain value of one-tenth of the maximum gain value can be called weak, an overall gain value of one-fifth of the maximum gain value can be called medium, and an overall gain value of one-half of the maximum gain value can be called strong. Optionally, the Ultimate Mode interface can set selection controls corresponding to strong, medium, and weak, and in response to the user's selection operation of the selection control, perform an overall update of the corresponding level. By updating the overall grayscale values ​​of the image, the overall brightness of the image can be improved when there are many dark scenes in the image.

[0088] When the mean value of the image is greater than or equal to the first preset mean value threshold, it indicates that there are few dark scenes in the image, so the grayscale values ​​in the image do not need to be updated as a whole.

[0089] 4) Based on the overall gain value, update the grayscale values ​​in the image to obtain the updated image.

[0090] 140. Divide the pixels in the image into multiple pixel partitions.

[0091] In some embodiments, the image can be divided into an n×m grid, such as Figure 1c The diagram shown is a schematic of pixel partitioning provided in this embodiment. Each small grid represents a pixel, and each dashed grid is a pixel partition. (1, 1) can be the first pixel of the image, and (n, m) is the last pixel of the image. For example, if the resolution is 1920×1080, (n, m) is (1920, 1080).

[0092] In some embodiments, the edge of at least one object in the image can be obtained; based on the edge, the pixels in the image are partitioned to obtain multiple pixel partitions, that is, different objects in the image can be divided into a pixel partition. The specific implementation for obtaining the object's edge is not limited, and methods such as differential edge detection, Roberts edge detection operator, and Sobel edge detection operator can be used.

[0093] 150. Based on the gray values ​​of pixels in the pixel partition, locally update the gray values ​​of the target pixel to obtain the locally updated image.

[0094] When an image is divided into grids to obtain pixel partitions, the target pixel can include pixels common to the pixel partitions and / or pixels in the target pixel partition.

[0095] Optionally, the target pixel can be a pixel corresponding to a common vertex of the four pixel partitions, and / or a pixel corresponding to a common edge of two pixel partitions. For example, as Figure 1b As shown, taking pixel partitions 1, 2, 3, and 4 as examples, the target pixel can be the pixel (i,j) corresponding to the common vertex of pixel partitions 1, 2, 3, and 4. Optionally, since the pixels at the vertices, corners, and edges of the overall image have little impact on the overall image quality, they can be left unprocessed; therefore, the target pixel may not include the pixels at the four corner vertices of the image, and / or the pixels on the four edges of the image.

[0096] Optionally, the number of pixels in the target pixel partition with grayscale values ​​less than a preset grayscale threshold can also be determined, where the target pixel partition can be any pixel partition. Based on the number, the proportion of pixels with grayscale values ​​less than the preset grayscale threshold in the target pixel partition is determined. When the proportion is greater than a preset proportion, the target pixel includes the pixels in the target pixel partition. The preset proportion can be customized according to the actual application, for example, it can be two-thirds. The preset grayscale threshold can also be customized according to the actual application, for example, it can be set to one-tenth of the preset maximum threshold.

[0097] When an image is partitioned based on the edges of an object to obtain pixel partitions, the target pixels can include pixels in the pixel partition whose gray values ​​are less than a preset gray value threshold.

[0098] In some embodiments, the SOC of the projector can locally update the grayscale value of the target pixel based on the grayscale value of the pixel in the pixel partition to obtain the locally updated image, which may include, but is not limited to, the following steps:

[0099] 1) Determine the mean value of the pixel partition corresponding to the pixel partition where the target pixel is located based on the gray value of the pixel in the pixel partition.

[0100] For example, such as Figure 1b As shown, taking pixel partitions 1, 2, 3 and 4 as examples, the average gray value of the pixels in pixel partitions 1, 2, 3 and 4 can be determined as the partition mean value corresponding to the target pixel (i,j).

[0101] 2) When the mean value of a partition is less than the second preset mean value threshold, the gray value of the target pixel is locally updated based on the preset gain value to obtain the locally updated image.

[0102] The second preset average threshold can be customized according to the actual application scenario. For example, it can be one-tenth of the preset maximum threshold.

[0103] In some embodiments, pixel partitioning includes pixel partitioning in the central region and pixel partitioning in the edge region of the image, and preset gain values ​​include a first preset gain value and a second preset gain value. The central region can be an area extending horizontally and vertically from the center point of the image, for example, approximately 4 / 5 of the image's width and height in the horizontal and vertical directions; taking a 4K resolution as an example, this would extend 1536 pixels horizontally and 864 pixels vertically from the center point. The edge region is the area in the image other than the central region. The first and second preset gain values ​​can be customized according to the actual application, or they can be set based on the maximum gain value. For example, the first preset gain value can be 5% of the maximum gain value, and the second preset gain value can be 10% of the maximum gain value. It should be noted that the first and second preset gain values ​​can also be equal.

[0104] Therefore, based on a preset gain value, locally updating the grayscale value of the target pixel to obtain a locally updated image can include the following steps: updating the grayscale value of the target pixel in the central region based on a first preset gain value, and updating the grayscale value of the target pixel in the edge region based on a second preset gain value to obtain a locally updated image.

[0105] Since users focus on the center of the screen most of the time while watching a movie, the edges are less sensitive. Therefore, appropriately increasing the grayscale value of pixels in the center area can improve local brightness details without negatively impacting color reproduction. Conversely, significantly increasing the grayscale value of pixels in the edge areas gives users the impression of overall image brightness improvement while maintaining overall color accuracy.

[0106] In some embodiments, dark pixels with gray values ​​less than a preset gray threshold in the image can also be identified; it can be determined whether the gray values ​​of adjacent pixels of the dark pixels are less than the preset gray threshold; when the gray values ​​of adjacent pixels are less than the preset gray threshold, the target pixel includes both the dark pixel and the adjacent pixels. Specifically, the gray values ​​of all pixels in the image can be arranged from largest to smallest, and dark pixels with gray values ​​lower than the preset gray threshold can be filtered out. The gray values ​​of the eight adjacent pixels of a certain dark pixel can be checked to see if they all meet the preset gray threshold. If they do, these pixels are taken as target pixels, and other pixels are filtered out in a loop, and deduplication is performed to obtain all target pixels that meet the requirements. These target pixels will form a continuous region with similar gray values. The gray values ​​of the target pixels can be locally updated based on a preset gain value to obtain a locally updated image. Optionally, pixel partitioning can also be combined, and the gray values ​​of the target pixels can be locally updated based on the gray values ​​of the pixels in the pixel partition to obtain a locally updated image.

[0107] 160. The locally updated image and the globally updated image are fused together to obtain the processed image.

[0108] In some embodiments, the SOC performs a fusion process on the locally updated image and the globally updated image to obtain a processed image. This processed image is a grayscale image, which can be converted to an RGB image using methods from the OpenCV library before being sent to the display module. The specific implementation of the fusion process is not limited; for example, it could involve adding the grayscale values ​​of the locally updated image and the globally updated image pixel by pixel and then averaging the results to obtain the processed image.

[0109] As shown above, this application can determine whether to enhance the overall grayscale value of an image by judging whether the maximum value range in the grayscale value distribution range reaches a preset maximum threshold, thus avoiding overexposure. Simultaneously, it can partition the image and update the grayscale values ​​of common pixels in each partition, improving the brightness of local details. In other words, it can enhance the overall brightness of the image while maintaining detail in dark scenes. Therefore, this solution can improve image quality.

[0110] To better implement the above methods, this application also provides an image processing device that can be integrated into an electronic device. For example, in this embodiment, the method of this application will be described in detail by taking the image processing device as specifically integrated into a projector.

[0111] For example, such as Figure 2 As shown, the image processing apparatus may include an acquisition unit 201, a determination unit 202, an overall update unit 203, a partitioning unit 204, a local update unit 205, and a fusion unit 206, as follows:

[0112] The acquisition unit is used to acquire the grayscale value of pixels in the image.

[0113] The determining unit is used to determine the maximum value range in the distribution range of grayscale values ​​of an image;

[0114] The overall update unit is used to update the gray values ​​in the image based on the gray values ​​in the maximum value range and the preset maximum threshold, so as to obtain the image after overall update;

[0115] A partitioning unit is used to divide the pixels in an image into multiple pixel partitions.

[0116] The local update unit is used to locally update the gray value of the target pixel based on the gray value of the pixel in the pixel partition and the second preset maximum threshold, so as to obtain the locally updated image.

[0117] The fusion unit is used to fuse the locally updated image and the globally updated image to obtain the processed image.

[0118] In some embodiments, the overall update unit 203 is specifically used for:

[0119] Determine the maximum mean value corresponding to the maximum value range based on the grayscale values ​​within the maximum value range;

[0120] When the maximum mean is less than the preset maximum threshold, the mean of the image is determined based on the grayscale values ​​in the image.

[0121] When the mean value of the image is less than the first preset mean threshold, the overall gain value is determined based on the maximum mean value and the preset maximum threshold.

[0122] Based on the overall gain value, the grayscale values ​​in the image are updated as a whole to obtain the updated image.

[0123] In some embodiments, the local update unit 205 is specifically used for:

[0124] Determine the mean value of the partition corresponding to the target pixel based on the grayscale value of the pixels in the pixel partition where the target pixel is located;

[0125] When the mean value of a partition is less than the second preset mean value threshold, the gray value of the target pixel is locally updated based on the preset gain value to obtain the locally updated image.

[0126] In some embodiments, pixel partitioning includes pixel partitioning in the central region of the image and pixel partitioning in the edge region, and preset gain values ​​include a first preset gain value and a second preset gain value;

[0127] Based on a preset gain value, the grayscale value of the target pixel is locally updated to obtain the locally updated image, including:

[0128] Based on the first preset gain value, the grayscale value of the target pixel in the central region is updated, and based on the second preset gain value, the grayscale value of the target pixel in the edge region is updated to obtain the locally updated image.

[0129] In some embodiments, before locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image, the method further includes:

[0130] Determine the number of pixels in the target pixel partition whose gray value is less than a preset gray threshold. The target pixel partition can be any pixel partition.

[0131] Based on the quantity, determine the proportion of pixels with gray values ​​less than a preset gray threshold in the target pixel partition;

[0132] When the ratio is greater than the preset ratio, the target pixel includes the pixels in the target pixel partition.

[0133] In some embodiments, before locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image, the process includes:

[0134] Identify dark pixels in the image whose grayscale value is less than a preset grayscale threshold;

[0135] Determine whether the grayscale values ​​of adjacent pixels of a dark pixel are less than a preset grayscale threshold;

[0136] When the grayscale value of adjacent pixels is less than the preset grayscale threshold, the target pixel includes dark pixels and adjacent pixels.

[0137] In some embodiments, the image is an image from a first video, and the image processing apparatus is further configured to:

[0138] Obtain the source information of the first video;

[0139] Based on the source information, determine the first resolution and first refresh rate when playing the first video.

[0140] In some embodiments, the image processing apparatus is further configured to:

[0141] When playing the second video at the second resolution and the second refresh rate, motion compensation data corresponding to the second refresh rate is determined. The motion compensation data includes transition images between images in the second video. The second resolution and the second refresh rate are different from the first resolution and the second refresh rate.

[0142] Motion compensation is performed on the second video based on motion compensation data.

[0143] In some embodiments, before acquiring the grayscale value of a pixel in an image, the image processing apparatus further comprises:

[0144] Displays the Ultimate Mode interface;

[0145] In response to the confirmation of entry into the Ultimate Mode interface, enter Ultimate Mode to perform steps to obtain the grayscale values ​​of pixels in the image.

[0146] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0147] As can be seen from the above, the image processing device in this embodiment can determine whether to improve the overall grayscale value of the image by judging whether the maximum value range in the grayscale value distribution range of the image reaches a preset maximum threshold, thus avoiding overexposure. Simultaneously, it can also partition the image and update the grayscale values ​​of common pixels in each partition, improving the brightness of local details. In other words, it can improve the overall brightness of the image while maintaining attention to details in dark scenes. Therefore, this solution can improve image quality.

[0148] This application also provides an electronic device. In this embodiment, a projector will be used as an example for detailed description. For example, ... Figure 3 As shown, it illustrates the structural diagram of the electronic device involved in this application, specifically:

[0149] The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, an input module 304, and a communication module 305. Those skilled in the art will understand that... Figure 3The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0150] The processor 301 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 302, and calls data stored in the memory 302 to perform various functions and process data. For example, it may be the aforementioned System-on-a-Chip (SoC). In some embodiments, the processor 301 may include one or more processing cores; in some embodiments, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 301.

[0151] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 302 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, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0152] The electronic device also includes a power supply 303 that supplies power to the various components. In some embodiments, the power supply 303 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The power supply 303 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0153] The electronic device may also include an input module 304, which can be used to receive input digital or character information and generate remote control, keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0154] The electronic device may also include a communication module 305. In some embodiments, the communication module 305 may include a wireless module, through which the electronic device can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 305 can be used to help users send and receive emails, browse web pages, and access streaming media.

[0155] The electronic device may also include a display module and a projection optical engine.

[0156] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 302 according to the following instructions, and the processor 301 runs the applications stored in the memory 302 to realize various functions, as follows:

[0157] Get the grayscale value of a pixel in an image;

[0158] Determine the range of maximum values ​​within the distribution range of grayscale values ​​in the image;

[0159] Based on the gray values ​​in the maximum value range and the preset maximum threshold, the gray values ​​in the image are updated as a whole to obtain the updated image.

[0160] The pixels in the image are divided into multiple pixel partitions;

[0161] Based on the gray values ​​of pixels in the pixel partition, the gray values ​​of the target pixel are locally updated to obtain the locally updated image.

[0162] The locally updated image and the globally updated image are fused together to obtain the processed image.

[0163] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0164] As shown above, electronic devices can determine whether to boost the overall grayscale value of an image by judging whether the maximum value range within the grayscale value distribution range reaches a preset maximum threshold, thus avoiding overexposure. Simultaneously, the image can be partitioned, and the grayscale values ​​of common pixels in each partition can be updated, improving the brightness of local details. In other words, it can improve the overall brightness of the image while maintaining detail in dark scenes. Therefore, this solution can improve image quality.

[0165] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0166] Therefore, this application provides a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the image processing methods provided in this application. For example, the instructions can execute the following steps:

[0167] Get the grayscale value of a pixel in an image;

[0168] Determine the range of maximum values ​​within the distribution range of grayscale values ​​in the image;

[0169] Based on the gray values ​​in the maximum value range and the preset maximum threshold, the gray values ​​in the image are updated as a whole to obtain the updated image.

[0170] The pixels in the image are divided into multiple pixel partitions;

[0171] Based on the gray values ​​of pixels in the pixel partition, the gray values ​​of the target pixel are locally updated to obtain the locally updated image.

[0172] The locally updated image and the globally updated image are fused together to obtain the processed image.

[0173] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0174] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the image processing method provided in the above embodiments.

[0175] Since the instructions stored in the storage medium can execute the steps of any of the image processing methods provided in this application, the beneficial effects that any of the image processing methods provided in this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0176] The foregoing has provided a detailed description of an image processing method, apparatus, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An image processing method, characterized in that, The image processing method includes: Get the grayscale value of a pixel in an image; Determine the range of maximum values ​​within the distribution range of grayscale values ​​of the image; Based on the gray values ​​in the maximum value range and the preset maximum threshold, the gray values ​​in the image are updated as a whole to obtain the updated image. The pixels in the image are divided into multiple pixel partitions; Based on the gray values ​​of the pixels in the pixel partition, the gray values ​​of the target pixels are locally updated to obtain the locally updated image. The locally updated image and the globally updated image are fused to obtain the processed image. The step of updating the grayscale values ​​in the image based on the grayscale values ​​in the maximum value range and a preset maximum threshold to obtain the updated image includes: Based on the grayscale values ​​in the maximum value range, determine the maximum mean value corresponding to the maximum value range; When the maximum mean is less than the preset maximum threshold, the mean of the image is determined based on the grayscale values ​​in the image. When the mean value corresponding to the image is less than the first preset mean threshold, the overall gain value is determined based on the maximum mean value and the preset maximum threshold. Based on the overall gain value, the grayscale values ​​in the image are updated to obtain the updated image.

2. The image processing method as described in claim 1, characterized in that, The step of locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image includes: Based on the grayscale values ​​of the pixels in the pixel partition where the target pixel is located, determine the partition mean value corresponding to the target pixel; When the mean value of the partition is less than the second preset mean value threshold, the gray value of the target pixel is locally updated based on the preset gain value to obtain the locally updated image.

3. The image processing method as described in claim 2, characterized in that, The pixel partitions include pixel partitions in the central region and pixel partitions in the edge region of the image, and the preset gain values ​​include a first preset gain value and a second preset gain value; The step of locally updating the grayscale value of the target pixel based on a preset gain value to obtain a locally updated image includes: Based on the first preset gain value, the grayscale value of the target pixel in the central region is updated, and based on the second preset gain value, the grayscale value of the target pixel in the edge region is updated to obtain a locally updated image.

4. The image processing method as described in claim 1, characterized in that, Before the step of locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image, the method further includes: Determine the number of pixels in the target pixel partition whose grayscale value is less than a preset grayscale threshold, wherein the target pixel partition is any pixel partition; Based on the quantity, determine the proportion of pixels with gray values ​​less than a preset gray threshold in the target pixel partition; When the ratio is greater than the preset ratio, the target pixel includes the pixels in the target pixel partition.

5. The image processing method as described in claim 1, characterized in that, Before the step of locally updating the grayscale value of the target pixel based on the grayscale value of the pixels in the pixel partition to obtain the locally updated image, the following steps are included: Identify dark pixels in the image whose grayscale value is less than a preset grayscale threshold; Determine whether the grayscale value of the adjacent pixels of the dark pixel is less than the preset grayscale threshold; When the grayscale value of the adjacent pixel is less than the preset grayscale threshold, the target pixel includes the dark pixel and the adjacent pixel.

6. The image processing method as described in claim 1, characterized in that, The image is an image from the first video. Before obtaining the grayscale values ​​of the pixels in the image, the method further includes: Obtain the source information of the first video; Based on the video source information, determine the first resolution and first refresh rate when playing the first video.

7. The image processing method as described in claim 6, characterized in that, The method further includes: When playing a second video at a second resolution and a second refresh rate, motion compensation data corresponding to the second refresh rate is determined. The motion compensation data includes transition images between images in the second video. The second resolution and the second refresh rate are different from the first resolution and the first refresh rate. Motion compensation is performed on the second video based on the motion compensation data.

8. The image processing method according to any one of claims 1-7, characterized in that, Before obtaining the grayscale values ​​of pixels in the image, the process also includes: Displays the Ultimate Mode interface; In response to the confirmation entry operation of the Ultimate Mode interface, the Ultimate Mode is entered to perform the steps of obtaining the grayscale value of the pixels in the image.

9. An image processing apparatus, characterized in that, include: The acquisition unit is used to acquire the grayscale value of pixels in the image. A determining unit is used to determine the maximum value range in the distribution range of grayscale values ​​of the image; The overall update unit is used to update the gray values ​​in the image based on the gray values ​​in the maximum value range and a preset maximum threshold, so as to obtain the overall updated image. A partitioning unit is used to partition the pixels in the image to obtain multiple pixel partitions; The local update unit is used to locally update the gray value of the target pixel based on the gray value of the pixel in the pixel partition and a second preset maximum threshold, so as to obtain the locally updated image. A fusion unit is used to fuse the locally updated image and the globally updated image to obtain a processed image. The step of updating the grayscale values ​​in the image based on the grayscale values ​​in the maximum value range and a preset maximum threshold to obtain the updated image includes: Based on the grayscale values ​​in the maximum value range, determine the maximum mean value corresponding to the maximum value range; When the maximum mean is less than the preset maximum threshold, the mean of the image is determined based on the grayscale values ​​in the image. When the mean value corresponding to the image is less than the first preset mean threshold, the overall gain value is determined based on the maximum mean value and the preset maximum threshold. Based on the overall gain value, the grayscale values ​​in the image are updated to obtain the updated image.

10. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps of the image processing method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the image processing method according to any one of claims 1 to 8.