CN117392244A - Image processing method, device, electronic equipment and storage medium - Google Patents
Image processing method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117392244A CN117392244A CN202210759984.6A CN202210759984A CN117392244A CN 117392244 A CN117392244 A CN 117392244A CN 202210759984 A CN202210759984 A CN 202210759984A CN 117392244 A CN117392244 A CN 117392244A
- Authority
- CN
- China
- Prior art keywords
- image
- value
- gray
- pixel
- gray value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Transforming Electric Information Into Light Information (AREA)
Abstract
The application discloses an image processing method, an image processing device, electronic equipment and a storage medium; the method and the device can acquire the gray value of the pixel point in the image; determining a maximum value interval in a distribution interval of gray values of the image; based on the gray value in the maximum value interval and a preset maximum threshold value, integrally updating the gray value in the image to obtain an integrally updated image; partitioning pixel points in an image to obtain a plurality of pixel partitions; based on the gray value of the pixel point in the pixel partition, carrying out local update on the gray value of the target pixel point to obtain a locally updated image; and carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image. In the application, the gray values of the image are updated in whole and in part, so that the image is globally brightness-improved and dark scene details are focused at the same time. Therefore, the image quality can be improved by the scheme.
Description
Technical Field
The present disclosure relates to the field of information technologies, and in particular, to an image processing method, an image processing device, an electronic device, and a storage medium.
Background
The intelligent projector integrates functions of software and hardware expansion, man-machine interaction, multimedia interconnection and the like, and can realize application services such as network searching, network video, video On Demand (VOD), digital music, network education resources and the like. The user can search various network resources, conduct remote conferences, throw in network and local videos, and can also realize screen throwing of external electronic equipment.
However, there are many pictures of dark scenes in the video, which may lead to poor quality of the image viewed by the user.
Disclosure of Invention
The application provides an image processing method, an image processing device, an electronic device and a storage medium, which can improve image quality.
The application provides an image processing method, which comprises the following steps:
acquiring gray values of pixel points in an image;
determining a maximum value interval in a distribution interval of gray values of the image;
based on the gray value in the maximum value interval and a preset maximum threshold value, integrally updating the gray value in the image to obtain an integrally updated image;
partitioning pixel points in an image to obtain a plurality of pixel partitions;
based on the gray value of the pixel point in the pixel partition, carrying out local update on the gray value of the target pixel point to obtain a locally updated image;
And carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
The present application also provides an image processing apparatus including:
the acquisition unit is used for acquiring the gray value of the pixel point in the image;
a determining unit configured to determine a maximum value interval among distribution intervals of gradation values of an image;
the integral updating unit is used for integrally updating the gray value in the image based on the gray value in the maximum value interval and a preset maximum threshold value to obtain an integrally updated image;
the partition unit is used for partitioning the pixel points in the image to obtain a plurality of pixel partitions;
the local updating unit is used for carrying out local updating on the gray value of the target pixel point based on the gray value of the pixel point in the pixel partition and a second preset maximum threshold value to obtain a locally updated image, wherein the target pixel point is a pixel point shared among the pixel partitions;
and the fusion unit is used for carrying out fusion processing on the image after the local update and the image after the integral update to obtain a processed image.
In some embodiments, the global updating unit is specifically configured to:
determining a maximum average value corresponding to the maximum interval according to the gray value in the maximum interval;
When the maximum average value is smaller than a preset maximum threshold value, determining an average value corresponding to the image according to the gray value in the image;
when the average value corresponding to the image is smaller than a first preset average value threshold value, determining an overall gain value based on the maximum average value and a preset maximum threshold value;
and based on the integral gain value, carrying out integral updating on the gray value in the image to obtain an integral updated image.
In some embodiments, the local update unit is specifically configured to:
determining a partition mean value corresponding to the target pixel point based on the gray value of the pixel point in the pixel partition where the target pixel point is located;
and when the partition mean value is smaller than a second preset mean value threshold value, locally updating the gray value of the target pixel point based on the preset gain value to obtain a locally updated image.
In some embodiments, the pixel partitions include pixel partitions in a center region and pixel partitions in an edge region of the image, and the preset gain values include a first preset gain value and a second preset gain value;
based on a preset gain value, locally updating the gray value of the target pixel point to obtain a locally updated image, wherein the locally updated image comprises the following steps:
updating the gray value of the target pixel point in the central area based on the first preset gain value, and updating the gray value of the target pixel point in the edge area based on the second preset gain value to obtain a locally updated image.
In some embodiments, based on the gray value of the pixel point in the pixel partition, the method further includes, before locally updating the gray value of the target pixel point to obtain the locally updated image:
determining the number of pixel points with gray values smaller than a preset gray threshold in a target pixel partition, wherein the target pixel partition is any pixel partition;
determining the proportion of pixel points with gray values smaller than a preset gray threshold in a target pixel partition based on the number;
when the ratio is greater than the preset ratio, the target pixel point includes a pixel point in the target pixel partition.
In some embodiments, based on the gray value of the pixel point in the pixel partition, the local updating of the gray value of the target pixel point is performed, and before obtaining the locally updated image, the method includes:
determining dark pixel points in an image, wherein the gray value of the dark pixel points is smaller than a preset gray threshold value;
determining whether the gray value of the adjacent pixel point of the dark pixel point is smaller than a preset gray threshold value;
when the gray value of the adjacent pixel point is smaller than the preset gray threshold value, the target pixel point comprises a dark pixel point and the adjacent pixel point.
In some embodiments, the image is an image in a first video, the image processing apparatus further configured to:
acquiring film source information of a first video;
And determining a first resolution and a first refresh rate when the first video is played according to the slice source information.
In some embodiments, the image processing apparatus is further configured to:
determining motion compensation data corresponding to a second refresh rate when playing a second video at the second resolution and the second refresh rate, the motion compensation data including transition images between images in the second video, the second resolution and the second refresh rate being different from the first resolution and the first refresh rate;
the second video is motion compensated based on the motion compensation data.
In some embodiments, before acquiring the gray value of the pixel point in the image, the image processing apparatus is further configured to:
displaying a selective mode interface;
and in response to the confirmation entering operation of the interface in the selective mode, entering the selective mode to execute the steps to acquire the gray value of the pixel point in the image.
The application also provides an electronic device comprising a memory and a processor, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to perform steps in any of the image processing methods provided herein.
The present application also provides a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform steps in any of the image processing methods provided herein.
In the application, whether the gray value of the image is integrally lifted is judged by judging whether the maximum value interval in the distribution interval of the gray value of the image reaches a preset maximum threshold value, so that overexposure can be avoided; meanwhile, the image can be partitioned, the gray value of the common pixel point of each partition is updated, and the brightness of local details can be improved; the dark scene details can be focused on while global brightness of the image is improved. Therefore, the image quality can be improved by the scheme.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic view of an image processing method provided herein;
FIG. 1b is a schematic flow chart of an image processing method provided in the present application;
FIG. 1c is a schematic diagram of a pixel partition provided herein;
FIG. 2 is a schematic view of an image processing apparatus according to the present application;
Fig. 3 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The application provides an image processing method, an image processing device, an electronic device and a storage medium.
The image processing device may be integrated in an electronic device, which may be a terminal, a server, or other devices. The terminal can be a projector, an intelligent television, a laser television, a mobile phone, a tablet personal computer, intelligent Bluetooth equipment, a notebook computer, a desktop computer and other equipment; the server may be a single server or a server cluster composed of a plurality of servers. In some embodiments, the server may also be implemented in the form of a terminal. In some embodiments, the image processing apparatus may also be integrated in a plurality of electronic devices, for example, the image processing apparatus may be integrated in a terminal and a server, and the image processing method of the present application is jointly implemented by the terminal and the server.
For example, the image processing apparatus may be integrated into a projector, and as shown in fig. 1a, in this scenario, a System on Chip (SoC), a display module, a projector light machine, and the like may be mounted in the projector. The projector can acquire the gray value of the pixel point in the image; determining a maximum value interval in a distribution interval of gray values of the image; based on the gray value in the maximum value interval and a preset maximum threshold value, integrally updating the gray value in the image to obtain an integrally updated image; partitioning pixel points in an image to obtain a plurality of pixel partitions; based on the gray value of the pixel point in the pixel partition, carrying out local update on the gray value of the target pixel point to obtain a locally updated image; and carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
In this embodiment, the projector determines whether to integrally raise the gray value of the image by determining whether a maximum value interval in the distribution interval of the gray value of the image reaches a preset maximum threshold value, so that overexposure can be avoided; meanwhile, the image can be partitioned, the gray value of the common pixel point of each partition is updated, and the brightness of local details can be improved; the dark scene details can be focused on while global brightness of the image is improved. Therefore, the image quality of the projection picture of the projector can be improved.
The following will describe in detail. The numbers of the following examples are not intended to limit the preferred order of the examples.
In this embodiment, an image processing method is provided, as shown in fig. 1b, and a specific flow of the image processing method may be as follows:
110. and acquiring gray values of pixel points in the image.
The image may be any frame of image in the target video being played by the projector, any frame of image in the game being operated by the projector, a signal stream transmitted to the projector through HDMI, and the like. The target video may be a video stream acquired from a network, a local video, a video stream transmitted to a projector through HDMI, or the like.
In some embodiments, the SOC of the projector may capture each frame of image, then process each frame of image into a gray map using the image graying method in the OpenCV library, and then obtain the gray values from the first pixel to the last pixel of the image, where the gray values range from 0 to 255.
In some embodiments, before the SOC acquires the gray value of the pixel point in the image, the SOC may further determine the current playing scene; determining whether to perform motion compensation and motion estimation (Motion Estimate and Motion Compensation, MEMC) on the image based on the play scene, the motion compensation and motion estimation being performed on the image when the play scene is a film-viewing type scene; when the play scene is a delay sensitive type scene, motion compensation and motion estimation are not performed on the image. The playing scenes may include, but are not limited to, a viewing scene, which may be a scene that plays multimedia data such as a video stream, and a delay sensitive scene, which may be a scene that needs real-time interaction and updating of a picture, such as a game. For example, when the user is watching a video-like scene, the scene may have priority in smoothness (i.e., the MEMC effect is guaranteed), and thus it is determined to perform motion compensation and motion estimation on the image. When a user uses the HDMI projection game, the scenes have low priority in time delay, and it is determined that motion compensation and motion estimation are not performed on the images, so that the minimum time delay experience is achieved.
In some embodiments, when the image is an image in the first video, the playing scene at this time is a viewing scene, and before the SOC acquires the gray value of the pixel point in the image, the method may further include:
1) And obtaining the film source information of the first video.
The slice source information may include, among other things, a resolution of the first video, a signal frame rate, etc. The first video may be any one of the target videos.
2) And determining a first resolution and a first refresh rate when the first video is played according to the slice source information.
The first resolution refers to a resolution corresponding to each frame of image in the first video when the display module displays the image. The first refresh rate refers to the number of frames of images in the first video that the display module displays per second.
Optionally, device performance parameters may also be obtained, including physical resolution and device refresh rate. The first resolution and the first refresh rate when playing the first video may be determined based on the slice source information, the physical resolution, and the device refresh rate.
The performance parameter of the equipment can be the performance parameter of a hardware module carried by the projector; if the physical resolution is the physical resolution of the display module, the resolution of the first video when played cannot exceed the physical resolution; the device refresh rate may be a refresh rate of the display module, e.g., the display module may support refresh rates of 60HZ and 120HZ, the first refresh rate being included in the device refresh rate. For example, the SOC detects the resolution of the target video played by the user in real time, if the first video is detected as a 4k resolution film source; the physical resolution is 4K and the device refresh rates are 60HZ and 120HZ. The first resolution and first refresh rate when playing the first video may be 4K 60hz, providing the user with the best 4K effect. If the first video is detected to be a source of 1080p resolution or less, the first resolution and the first refresh rate when the first video is played are 1080p 120hz.
Optionally, the motion compensation data corresponds to a refresh rate; for example, the SOC may support MEMC performing 60HZ and 120 HZ; the 60HZ MEMC corresponds to a 60HZ refresh rate of the display module and the 120HZ MEMC corresponds to a 120HZ refresh rate of the display module. Taking the example that the signal frame rate of the target video is 30HZ, it is assumed that the video includes a frame, B frame, and C frame images. If the refresh rate is 60HZ, performing 60HZ MEMC, and determining motion compensation data by the SOC according to an MEMC algorithm, wherein the motion compensation data may include a transition image A1 between a frame and B frame, a transition image B1 between B and C frame images; and performing motion compensation on the target video based on the motion compensation data, wherein the target video is converted into a frame rate of 60HZ and sent to the display module, and the video sent to the display module is changed into AA1BB1CC1. If the refresh rate is 60HZ, the MEMC of 120HZ is executed, the SOC may determine motion compensation data according to the MEMC algorithm, the motion compensation data may include transition images A1, A2, A3, B1, B2, B3 between a and B two frame images, and the transition images B1, B2, B3 between a and C two frame images, and the target video transmitted to the display module may become AA1A2A3BB1B2B3CC1C2C3 by performing motion compensation on the target video based on the motion compensation data.
In some embodiments, when playing the second video at a second resolution and a second refresh rate, determining motion compensation data corresponding to the second refresh rate, the motion compensation data including transitional images between images in the second video, the second resolution and the second refresh rate being different from the first resolution and the first refresh rate; the second video is motion compensated based on the motion compensation data. Wherein the second resolution and the second refresh rate are determined by the slice source information of the second video; the second video is any one of the target videos, and the projector can switch from playing the first video to the second video.
For example, the SOC may detect the resolution of the target video played by the user in real time, if the first video is a 4k resolution, 30HZ frame rate, and the second video is a 30HZ frame rate, 1080p resolution, or less. The first resolution and the first refresh rate when the first video is played may be 4k 60hz, and the compensation data corresponding to the first refresh rate may include 1 frame transition image, and then 1 frame motion compensation is performed on the first video. When the projector can switch from playing the first video to playing the second video, the second resolution and the second refresh rate when playing the second video are 1080p 120HZ, and the compensation data corresponding to the second refresh rate can comprise 3 frames of transition images, so that the motion compensation of 3 frames is performed on the second video, and the smoothness of the second video can be improved. Because 1080p film source is played on the 4K display screen, the 4K effect is not achieved, the effect of the MEMC is preferentially improved, and 120HZ motion estimation and motion compensation frame insertion are executed to achieve the best video fluency.
In some embodiments, the processing of an image using the image processing method of the present scheme may be referred to as a refined mode, and a user may select whether to execute the image processing scheme of the present application on the image through a user interface. Therefore, before acquiring the gray value of the pixel point in the image, the method may further include: displaying a selective mode interface; and in response to the confirmation entering operation of the interface in the selective mode, entering the selective mode to execute the steps to acquire the gray value of the pixel point in the image. For example, the projector may display a refined mode interface in response to the user's operation of the corresponding key of the remote controller, and the refined mode interface may prompt the user to improve the effect of the refined mode on the screen, and display a confirmation control; and responding to the confirmation entering operation of the user to the confirmation control, entering into a fine mode and starting to acquire the gray value of the pixel point in the image.
120. A maximum value interval among distribution intervals of gray values of the image is determined.
Wherein the distribution intervals may be used to represent the distribution of gray values of the image. In some embodiments, the SOC of the projector may sort the gray values of all the pixel points to obtain the sorted gray values; partitioning the ordered gray values to obtain a distribution interval. For example, the sorted gray values may be divided into 1000 distribution sections on average, and if there are 1920×1080 pixels in total, and the sorted gray values are divided into 1000 distribution sections, there are about 2074 gray values corresponding to each distribution section.
The maximum value section is a section in which the average value of the gradation values in the distribution section is maximum. For example, when the gradation values are sorted from small to large, the maximum value interval may be the last distribution interval.
130. And based on the gray value in the maximum value interval and a preset maximum threshold value, carrying out integral updating on the gray value in the image to obtain an integral updated image.
The preset maximum threshold may be set in a user-defined manner according to an actual application scenario, for example, may be 255, 250, etc.
In some embodiments, the SOC of the projector updates the gray value in the image as a whole based on the gray value in the maximum interval and the preset maximum threshold, to obtain an updated image as a whole, which may include, but is not limited to, the following steps:
1) And determining the maximum average value corresponding to the maximum interval according to the gray value in the maximum interval. For example, the average value or the expected value of the gradation value in the maximum value section is calculated to obtain the maximum average value.
2) And when the maximum average value is smaller than a preset maximum threshold value, determining the average value corresponding to the image according to the gray value in the image. When the maximum average value is greater than or equal to the preset maximum threshold value, the gray value in the image can not be updated integrally so as to avoid overexposure.
3) And when the average value corresponding to the image is smaller than a first preset average value threshold value, determining an overall gain value based on the maximum average value and a preset maximum threshold value. The first preset average value threshold may be set according to the actual application scenario in a user-defined manner, for example, may be set to one tenth, one fifth, etc. of the preset maximum threshold.
Alternatively, the difference between the maximum average and the preset maximum threshold may be calculated, and the difference is referred to as the maximum gain value for convenience of description; based on the difference, an overall gain value is obtained, which may be less than the maximum gain value. In some embodiments, the system can be divided into three grades of strong, medium and weak, so as to meet the requirements of different users. For example, a value of the overall gain that is one tenth of the maximum gain value may be referred to as weak, a value of the overall gain that is one fifth of the maximum gain value may be referred to as medium, a value of the overall gain that is one half of the maximum gain value may be referred to as strong, etc.; optionally, the selective mode interface may set strong, medium and weak corresponding selection controls, and perform the overall update of the corresponding level in response to the selection operation of the selection control by the user. By integrally updating the gray value of the image, the overall brightness of the picture can be improved when the number of dark scene pictures in the image is large.
When the average value corresponding to the image is greater than or equal to a first preset average value threshold value, the dark scene images in the image are less, so that the gray value in the image can not be updated integrally.
4) And based on the integral gain value, carrying out integral updating on the gray value in the image to obtain an integral updated image.
140. And partitioning the pixel points in the image to obtain a plurality of pixel partitions.
In some embodiments, the image may be divided into n×m grids, as shown in fig. 1c, which is a schematic diagram of pixel partitions provided in this embodiment, where each small grid represents one pixel point, and each dotted grid is one pixel partition. Where (1, 1) may be the first pixel of the image, (n, m) is the last pixel of the image, e.g., 1920 x 1080 resolution, (n, m) is (1920, 1080).
In some embodiments, edges of at least one object in the image may be acquired; and partitioning the pixel points in the image based on the edge to obtain a plurality of pixel partitions, namely dividing different objects in the image into one pixel partition. The specific implementation manner of obtaining the edge of the object is not limited, and for example, a differential edge detection method, a Roberts edge detection operator, a Sobel edge detection operator and the like are adopted.
150. And based on the gray values of the pixel points in the pixel partitions, locally updating the gray values of the target pixel points to obtain a locally updated image.
When the image is divided into grids to obtain pixel partitions, the target pixel points may include pixel points shared between the pixel partitions and/or pixel points in the target pixel partitions.
Alternatively, the target pixel may be a pixel corresponding to a common vertex of the four pixel partitions, and/or a pixel corresponding to a common edge of the two pixel partitions. For example, as shown in fig. 1b, taking pixel partitions 1, 2, 3, and 4 as an example, the target pixel point may be a pixel point (i, j) corresponding to a common vertex of pixel partitions 1, 2, 3, and 4. Alternatively, since the pixel points on the vertex corners and edge lines of the overall image have less influence on the overall effect of the image quality, no processing may be performed; the target pixel may not include pixels on vertices of four corners of the image and/or pixels on four edge lines of the image.
Optionally, the number of pixel points in the target pixel partition, the gray value of which is smaller than the preset gray threshold, may be determined, and the target pixel partition is any pixel partition; determining the proportion of pixel points with gray values smaller than a preset gray threshold in a target pixel partition based on the number; when the ratio is greater than the preset ratio, the target pixel point includes a pixel point in the target pixel partition. The preset proportion can be set in a self-defined mode according to practical application, for example, the preset gray threshold can be set to be one tenth of the preset maximum threshold.
When the image is partitioned based on the edge of the object to obtain a pixel partition, the target pixel point may include a pixel point in the pixel partition having a gray value smaller than a preset gray threshold.
In some embodiments, the SOC of the projector may locally update the gray value of the target pixel based on the gray value of the pixel in the pixel partition, to obtain a locally updated image, which may include, but is not limited to, the following steps:
1) And determining a partition mean value corresponding to the pixel partition where the target pixel point is located based on the gray value of the pixel point in the pixel partition where the target pixel point is located.
For example, as shown in fig. 1b, taking pixel partitions 1, 2, 3 and 4 as an example, the average value of the gray values of the pixel points in the pixel partitions 1, 2, 3 and 4 may be determined as the partition average value corresponding to the target pixel point (i, j).
2) And when the partition mean value is smaller than a second preset mean value threshold value, locally updating the gray value of the target pixel point based on the preset gain value to obtain a locally updated image.
The second preset average value threshold value can be set in a self-defined mode according to an actual application scene. For example, it may be one tenth of the preset maximum threshold.
In some embodiments, the pixel partitions include pixel partitions in a center region and pixel partitions in an edge region of the image, and the preset gain values include a first preset gain value and a second preset gain value. The central area may be an area obtained by extending a certain range in the horizontal and vertical directions with respect to the center point of the image, for example, the horizontal and vertical directions occupy about 4/5 of the width and height of the image; taking a resolution of 4k as an example, the center point extends in the horizontal and vertical directions, 1536 pixels in the horizontal direction, and 864 pixels in the vertical direction. The edge region is a region other than the center region in the image. The first preset gain value and the second preset gain value can be set in a self-defined mode according to practical application conditions, and can also be set according to a maximum gain value, for example, the first preset gain value can be five percent of the maximum gain value, and the second preset gain value can be ten percent of the maximum gain value. It should be noted that the first preset gain value and the second preset gain value may be equal.
Therefore, based on the preset gain value, the gray value of the target pixel is locally updated to obtain a locally updated image, which may include the following steps: updating the gray value of the target pixel point in the central area based on the first preset gain value, and updating the gray value of the target pixel point in the edge area based on the second preset gain value to obtain a locally updated image.
Since the user focuses on the central area of the screen most of the time during the viewing process, the edge areas around the screen are not too sensitive. Therefore, the gray value of the pixel point in the central area is properly improved, so that local brightness details can be improved, and the negative influence on the image color reproducibility is avoided; the gray value of the pixel points in the edge area is greatly improved, so that the overall brightness of the image can be improved for a user, and the color reproducibility of the overall picture is ensured.
In some embodiments, dark pixel points in the image with gray values less than a preset gray threshold may also be determined; determining whether the gray value of the adjacent pixel point of the dark pixel point is smaller than a preset gray threshold value; when the gray value of the adjacent pixel point is smaller than the preset gray threshold value, the target pixel point comprises a dark pixel point and the adjacent pixel point. Specifically, after gray values of all pixel points in an image are arranged from large to small, dark pixel points with gray values lower than a preset gray threshold value are screened out, and whether gray values of 8 adjacent pixel points of a certain dark pixel point all meet the gray values lower than the preset gray threshold value or not is detected. If so, taking the pixel points as target pixel points, recycling other pixel points of the detection screen, and performing de-duplication processing to obtain all the satisfied target pixel points. The target pixel points can form a certain continuous area with similar gray values, and the gray values of the target pixel points can be locally updated based on a preset gain value to obtain a locally updated image. Alternatively, the gray value of the target pixel point may be locally updated based on the gray value of the pixel point in the pixel partition by combining with the pixel partition, so as to obtain a locally updated image.
160. And carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
In some embodiments, the SOC performs fusion processing on the locally updated image and the integrally updated image to obtain a processed image, where the image is a gray scale image, and the gray scale image may be converted into an RGB image by using a method in the OpenCV library and then sent to the display module. The specific embodiment of the fusion process is not limited, and for example, gray values in the image after the local update and the image after the whole update may be averaged after corresponding addition according to pixel points, so as to obtain the processed image.
From the above, the present application can determine whether to integrally raise the gray value of the image by determining whether the maximum value interval in the distribution interval of the gray value of the image reaches the preset maximum threshold value, so as to avoid overexposure; meanwhile, the image can be partitioned, the gray value of the common pixel point of each partition is updated, and the brightness of local details can be improved; the dark scene details can be focused on while global brightness of the image is improved. Therefore, the image quality can be improved by the scheme.
In order to better implement the above method, the present application further provides an image processing apparatus, which may be specifically integrated in an electronic device, for example, in the present embodiment, the method of the present application will be described in detail taking the example that the image processing apparatus is specifically integrated in a projector.
For example, as shown in fig. 2, the image processing apparatus may include an acquisition unit 201, a determination unit 202, an overall update unit 203, a partition unit 204, a local update unit 205, and a fusion unit 206, as follows:
the acquisition unit is used for acquiring the gray value of the pixel point in the image;
a determining unit configured to determine a maximum value interval among distribution intervals of gradation values of an image;
the integral updating unit is used for integrally updating the gray value in the image based on the gray value in the maximum value interval and a preset maximum threshold value to obtain an integrally updated image;
the partition unit is used for partitioning the pixel points in the image to obtain a plurality of pixel partitions;
the local updating unit is used for carrying out local updating on the gray value of the target pixel point based on the gray value of the pixel point in the pixel partition and a second preset maximum threshold value to obtain a locally updated image;
And the fusion unit is used for carrying out fusion processing on the image after the local update and the image after the integral update to obtain a processed image.
In some embodiments, the global updating unit 203 is specifically configured to:
determining a maximum average value corresponding to the maximum interval according to the gray value in the maximum interval;
when the maximum average value is smaller than a preset maximum threshold value, determining an average value corresponding to the image according to the gray value in the image;
when the average value corresponding to the image is smaller than a first preset average value threshold value, determining an overall gain value based on the maximum average value and a preset maximum threshold value;
and based on the integral gain value, carrying out integral updating on the gray value in the image to obtain an integral updated image.
In some embodiments, the local update unit 205 is specifically configured to:
determining a partition mean value corresponding to the target pixel point based on the gray value of the pixel point in the pixel partition where the target pixel point is located;
and when the partition mean value is smaller than a second preset mean value threshold value, locally updating the gray value of the target pixel point based on the preset gain value to obtain a locally updated image.
In some embodiments, the pixel partitions include pixel partitions in a center region and pixel partitions in an edge region of the image, and the preset gain values include a first preset gain value and a second preset gain value;
Based on a preset gain value, locally updating the gray value of the target pixel point to obtain a locally updated image, wherein the locally updated image comprises the following steps:
updating the gray value of the target pixel point in the central area based on the first preset gain value, and updating the gray value of the target pixel point in the edge area based on the second preset gain value to obtain a locally updated image.
In some embodiments, based on the gray value of the pixel point in the pixel partition, the method further includes, before locally updating the gray value of the target pixel point to obtain the locally updated image:
determining the number of pixel points with gray values smaller than a preset gray threshold in a target pixel partition, wherein the target pixel partition is any pixel partition;
determining the proportion of pixel points with gray values smaller than a preset gray threshold in a target pixel partition based on the number;
when the ratio is greater than the preset ratio, the target pixel point includes a pixel point in the target pixel partition.
In some embodiments, based on the gray value of the pixel point in the pixel partition, the local updating of the gray value of the target pixel point is performed, and before obtaining the locally updated image, the method includes:
determining dark pixel points in an image, wherein the gray value of the dark pixel points is smaller than a preset gray threshold value;
Determining whether the gray value of the adjacent pixel point of the dark pixel point is smaller than a preset gray threshold value;
when the gray value of the adjacent pixel point is smaller than the preset gray threshold value, the target pixel point comprises a dark pixel point and the adjacent pixel point.
In some embodiments, the image is an image in a first video, the image processing apparatus further configured to:
acquiring film source information of a first video;
and determining a first resolution and a first refresh rate when the first video is played according to the slice source information.
In some embodiments, the image processing apparatus is further configured to:
determining motion compensation data corresponding to a second refresh rate when the second video is played at the second resolution and the second refresh rate, the motion compensation data including transition images between images in the second video, the second resolution and the second refresh rate being different from the first resolution and the second refresh rate;
the second video is motion compensated based on the motion compensation data.
In some embodiments, before acquiring the gray value of the pixel point in the image, the image processing apparatus is further configured to:
displaying a selective mode interface;
and in response to the confirmation entering operation of the interface in the selective mode, entering the selective mode to execute the steps to acquire the gray value of the pixel point in the image.
In the implementation, each unit may be implemented as an independent entity, or may be implemented as the same entity or several entities in any combination, and the implementation of each unit may be referred to the foregoing method embodiment, which is not described herein again.
As can be seen from the above, the image processing apparatus of the present embodiment can determine whether to integrally raise the gray value of the image by determining whether the maximum value interval in the distribution interval of the gray value of the image reaches the preset maximum threshold value, so as to avoid overexposure; meanwhile, the image can be partitioned, the gray value of the common pixel point of each partition is updated, and the brightness of local details can be improved; the dark scene details can be focused on while global brightness of the image is improved. Therefore, the image quality can be improved by the scheme.
The present application further provides an electronic device, in this embodiment, a detailed description will be given taking an example that the electronic device of this embodiment is a projector, for example, as shown in fig. 3, which shows a schematic structural diagram of the electronic device related to the present application, specifically:
the electronic device may include one or more processing cores 'processors 301, one or more computer-readable storage media's memory 302, a power supply 303, an input module 304, and a communication module 305, among other components. Those skilled in the art will appreciate that the electronic device structure shown in fig. 3 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components. Wherein:
The processor 301 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data, such as the above-described SOC, by running or executing software programs and/or modules stored in the memory 302, and invoking data stored in the memory 302. In some embodiments, processor 301 may include one or more processing cores; in some embodiments, processor 301 may integrate an application processor that primarily processes operating systems, user interfaces, applications, etc., with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 301.
The memory 302 may be used to store software programs and modules, and the processor 301 executes various functional applications and data processing by executing the software programs and modules stored in the memory 302. The memory 302 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic 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.
The electronic device also includes a power supply 303 that powers the various components, and in some embodiments, the power supply 303 may be logically connected to the processor 301 through a power management system to perform functions such as managing charging, discharging, and power consumption. The power supply 303 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may also include an input module 304, which input module 304 may be used to receive entered numeric or character information and to generate remote control, keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The electronic device may also include a communication module 305, and in some embodiments the communication module 305 may include a wireless module, through which the electronic device may wirelessly transmit over a short distance, thereby providing wireless broadband internet access to the user. For example, the communication module 305 may be used to assist a user in e-mail, browsing web pages, accessing streaming media, and the like.
The electronic device may further include a display module and a projection light engine.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 301 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 executes the application programs stored in the memory 302, so as to implement various functions as follows:
acquiring gray values of pixel points in an image;
determining a maximum value interval in a distribution interval of gray values of the image;
based on the gray value in the maximum value interval and a preset maximum threshold value, integrally updating the gray value in the image to obtain an integrally updated image;
partitioning pixel points in an image to obtain a plurality of pixel partitions;
based on the gray value of the pixel point in the pixel partition, carrying out local update on the gray value of the target pixel point to obtain a locally updated image;
and carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
From the above, the electronic device can determine whether to integrally raise the gray value of the image by determining whether the maximum value interval in the distribution interval of the gray value of the image reaches the preset maximum threshold value, so as to avoid overexposure; meanwhile, the image can be partitioned, the gray value of the common pixel point of each partition is updated, and the brightness of local details can be improved; the dark scene details can be focused on while global brightness of the image is improved. Therefore, the image quality can be improved by the scheme.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the image processing methods provided herein. For example, the instructions may perform the steps of:
acquiring gray values of pixel points in an image;
Determining a maximum value interval in a distribution interval of gray values of the image;
based on the gray value in the maximum value interval and a preset maximum threshold value, integrally updating the gray value in the image to obtain an integrally updated image;
partitioning pixel points in an image to obtain a plurality of pixel partitions;
based on the gray value of the pixel point in the pixel partition, carrying out local update on the gray value of the target pixel point to obtain a locally updated image;
and carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the image processing method provided in the above-described embodiment.
The steps in any image processing method provided in the present application may be executed due to the instructions stored in the storage medium, so that the beneficial effects that any image processing method provided in the present application can achieve are achieved, and detailed descriptions of the foregoing embodiments are omitted herein.
The foregoing has outlined some of the more detailed description of the image processing method, apparatus, electronic device and computer readable storage medium that are provided herein, and the detailed description of the principles and embodiments of the present application that are provided herein apply to the details of the embodiments and the examples that follow are provided herein to assist in the understanding of the methods and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.
Claims (12)
1. An image processing method, characterized in that the image processing method comprises:
acquiring gray values of pixel points in an image;
determining a maximum value interval in a distribution interval of gray values of the image;
based on the gray value in the maximum value interval and a preset maximum threshold value, integrally updating the gray value in the image to obtain an integrally updated image;
Partitioning pixel points in the image to obtain a plurality of pixel partitions;
based on the gray value of the pixel point in the pixel partition, locally updating the gray value of the target pixel point to obtain a locally updated image;
and carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
2. The image processing method according to claim 1, wherein the step of integrally updating the gray value in the image based on the gray value in the maximum value interval and a preset maximum threshold value to obtain an integrally updated image includes:
determining a maximum average value corresponding to the maximum value interval according to the gray value in the maximum value interval;
when the maximum average value is smaller than the preset maximum threshold value, determining an average value corresponding to the image according to the gray value in the image;
when the average value corresponding to the image is smaller than a first preset average value threshold value, determining an overall gain value based on the maximum average value and the preset maximum threshold value;
and based on the integral gain value, integrally updating the gray value in the image to obtain an integrally updated image.
3. The image processing method according to claim 1, wherein the locally updating the gray value of the target pixel based on the gray value of the pixel in the pixel partition to obtain the locally updated image includes:
determining a partition mean value corresponding to the target pixel point based on the gray value of the pixel point in the pixel partition where the target pixel point is located;
and when the partition mean value is smaller than a second preset mean value threshold value, locally updating the gray value of the target pixel point based on a preset gain value to obtain a locally updated image.
4. The image processing method of claim 3, wherein the pixel partitions include a pixel partition in a center region and a pixel partition in an edge region of the image, the preset gain values including a first preset gain value and a second preset gain value;
the local updating of the gray value of the target pixel point based on the preset gain value is performed to obtain a locally updated image, and the method comprises the following steps:
updating the gray value of the target pixel point in the central area based on the first preset gain value, and updating the gray value of the target pixel point in the edge area based on the second preset gain value to obtain a locally updated image.
5. The image processing method according to claim 1, wherein the step of locally updating the gray value of the target pixel based on the gray value of the pixel in the pixel partition, before obtaining the locally updated image, further comprises:
determining the number of pixel points with gray values smaller than a preset gray threshold value in a target pixel partition, wherein the target pixel partition is any pixel partition;
determining the proportion of the pixel points with the gray values smaller than a preset gray threshold in the target pixel partition based on the number;
when the ratio is greater than a preset ratio, the target pixel point comprises a pixel point in the target pixel partition.
6. The image processing method according to claim 1, wherein the step of locally updating the gray value of the target pixel based on the gray value of the pixel in the pixel partition, before obtaining the locally updated image, includes:
determining dark pixel points in the image, wherein the gray value of the dark pixel points is smaller than a preset gray threshold value;
determining whether the gray value of the adjacent pixel point of the dark pixel point is smaller than the preset gray threshold value;
when the gray value of the adjacent pixel point is smaller than the preset gray threshold value, the target pixel point comprises the dark pixel point and the adjacent pixel point.
7. The image processing method according to claim 1, wherein the image is an image in a first video, and before the acquiring the gray value of the pixel in the image, further comprising:
acquiring the film source information of the first video;
and determining a first resolution and a first refresh rate when the first video is played according to the slice source information.
8. The image processing method according to claim 7, wherein the method further comprises:
determining motion compensation data corresponding to a second refresh rate when a second video is played at the second resolution and the second refresh rate, the motion compensation data including transition images between images in the second video, the second resolution and the second refresh rate being different from the first resolution and the first refresh rate;
and performing motion compensation on the second video based on the motion compensation data.
9. The image processing method according to any one of claims 1 to 8, further comprising, before the step of acquiring the gray value of the pixel point in the image:
displaying a selective mode interface;
and in response to the confirmation entering operation of the selective mode interface, entering a selective mode to execute the steps to acquire the gray value of the pixel point in the image.
10. An image processing apparatus, comprising:
the acquisition unit is used for acquiring the gray value of the pixel point in the image;
a determining unit configured to determine a maximum value interval among distribution intervals of gradation values of the image;
the integral updating unit is used for integrally updating the gray value in the image based on the gray value in the maximum value interval and a preset maximum threshold value to obtain an integrally updated image;
the partition unit is used for partitioning the pixel points in the image to obtain a plurality of pixel partitions;
the local updating unit is used for carrying out local updating on the gray value of the target pixel point based on the gray value of the pixel point in the pixel partition and a second preset maximum threshold value to obtain a locally updated image;
and the fusion unit is used for carrying out fusion processing on the image after the local updating and the image after the whole updating to obtain a processed image.
11. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps in the image processing method according to any one of claims 1 to 9.
12. A computer readable storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor for performing the steps in the image processing method according to any one of claims 1 to 9.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210759984.6A CN117392244A (en) | 2022-06-30 | 2022-06-30 | Image processing method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210759984.6A CN117392244A (en) | 2022-06-30 | 2022-06-30 | Image processing method, device, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117392244A true CN117392244A (en) | 2024-01-12 |
Family
ID=89436028
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210759984.6A Pending CN117392244A (en) | 2022-06-30 | 2022-06-30 | Image processing method, device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117392244A (en) |
-
2022
- 2022-06-30 CN CN202210759984.6A patent/CN117392244A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109783178B (en) | Color adjusting method, device, equipment and medium for interface component | |
| EP3955584B1 (en) | Digital media system | |
| JP7728891B2 (en) | Screensaver interaction method, device, electronic device, and storage medium | |
| US8179400B2 (en) | Motion adaptive ambient lighting | |
| CN111796826B (en) | Bullet screen drawing method, device, equipment and storage medium | |
| KR20210147868A (en) | Video processing method and device | |
| JP2011237690A (en) | Image processing device and image processing method | |
| WO2024139533A1 (en) | Data processing method and apparatus, and computer device and computer-readable storage medium | |
| CN112565909A (en) | Video playing method and device, electronic equipment and readable storage medium | |
| CN114764821B (en) | Moving object detection method, moving object detection device, electronic equipment and storage medium | |
| CN114647468B (en) | Screen projection image display method and device, electronic equipment and storage medium | |
| CN114095793A (en) | Video playing method and device, computer equipment and storage medium | |
| CN117392244A (en) | Image processing method, device, electronic equipment and storage medium | |
| CN115209193B (en) | Display processing equipment and method and display system | |
| CN115278278B (en) | Page display method and device, electronic equipment and storage medium | |
| CN113986168B (en) | Image display method, device, equipment and readable storage medium | |
| CN113038094A (en) | Image acquisition method and device | |
| CN114283055B (en) | Virtual reality device and image display method | |
| CN120091190A (en) | Display control method, device, equipment and storage medium | |
| CN111836055B (en) | Image processing device and image block matching method based on image content for MEMC | |
| US20250047830A1 (en) | Display method | |
| CN118102016A (en) | Screen projection optimization method, device, equipment and storage medium | |
| CN117412013A (en) | Image quality adjustment method, image quality adjustment device, electronic device, and computer storage medium | |
| CN117459757A (en) | Video playing method, device, equipment and storage medium | |
| CN119648601A (en) | Image processing method, device, computer equipment and computer readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |