Electronic device and method for correcting contrast ratio of image, and storage medium
By analyzing luminance histograms and applying threshold values and gamma parameters to correct luminance, the device enhances contrast ratio, addressing the challenge of mapping HDR to LDR images and improving image visibility.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-09-30
- Publication Date
- 2026-05-07
AI Technical Summary
The challenge lies in effectively mapping high dynamic range (HDR) images to low dynamic range (LDR) images while minimizing information loss and ensuring the resulting images closely approximate the human visual experience.
An electronic device employs a processor to analyze a luminance histogram, determine a threshold value, and apply a scale factor and gamma parameter to correct luminance, dividing the image into blocks for localized and global corrections to enhance contrast ratio.
This approach minimizes information loss and enhances the visibility and visual quality of images by improving the contrast ratio, making HDR images more perceptible on LDR displays.
Smart Images

Figure KR2025015537_07052026_PF_FP_ABST
Abstract
Description
Electronic device, method, and storage medium for correcting the contrast ratio of an image
[0001] The embodiments of this document relate to electronic devices, methods, and storage media, and, for example, to electronic devices, methods, and storage media for correcting the contrast ratio of an image.
[0002] The dynamic range that humans can perceive with their eyes can be much larger than the dynamic range that can be represented by a typical display. To display images similar to real scenes, tone mapping technology is being proposed to convert images with a wide dynamic range into images with a limited dynamic range. For example, tone mapping technology can be a technique that maps a high dynamic range (HDR) image with a wide 16-bit dynamic range into a low dynamic range (LDR) image with an 8-bit range that can be represented by a display. Tone mapping technology can minimize information loss that occurs during the mapping process to a smaller range and provide users with images that closely approximate the human visual experience.
[0003] The information described above may be provided merely as related art to aid in understanding the present disclosure. None of the foregoing is to be claimed as prior art related to the present disclosure or to be used in determining prior art.
[0004] An electronic device according to various embodiments of this document may include at least one processor comprising a processing circuit and a memory that stores instructions executed individually or collectively by said at least one processor. Instructions stored in said memory may be configured to cause the electronic device to obtain a first probability distribution function of luminance including a first plurality of Gaussian functions from a luminance histogram of an image. The instructions may be configured to cause the electronic device to determine a threshold value from said first probability distribution function of luminance. The instructions may be configured to cause the electronic device to determine a scale factor of the luminance when the threshold value is less than or equal to a preset first value. The instructions may be configured to cause the electronic device to perform a first luminance correction operation that corrects the luminance based on said scale factor. The instructions may be configured to cause the electronic device to correct the luminance of each of a plurality of blocks into which the image is divided by a preset size. The instructions may be configured to cause the electronic device to correct the luminance of the entire area of the image. The above command may be configured to cause the electronic device to determine the gamma parameter to which the threshold value is applied based on the average luminance of the image. The above command may be configured to cause the electronic device to correct the luminance based on the gamma parameter to generate a corrected image.
[0005] A method for correcting the contrast ratio of an image according to various embodiments of the present document may include an operation of obtaining a first probability distribution function of luminance including a plurality of Gaussian functions from a luminance histogram of the image. The method may include an operation of determining a threshold value from the first probability distribution function of luminance. If the threshold value is less than or equal to a preset first value, the method may include an operation of determining a scale factor of the luminance. The method may include an operation of performing a first luminance correction operation to correct the luminance based on the scale factor. The method may include an operation of correcting the luminance of each of a plurality of blocks into which the image is divided by a preset size. The method may include an operation of correcting the luminance of the entire area of the image. The method may include an operation of determining a gamma parameter to which the threshold value is applied based on the average luminance of the image. The method may include an operation of generating a corrected image by correcting the luminance based on the gamma parameter.
[0006] A non-transient computer-readable storage medium having a program recorded thereon for performing a method of correcting the contrast ratio of an image according to various embodiments of this document may perform an operation of obtaining a first probability distribution function of luminance including a plurality of Gaussian functions from a luminance histogram of the image. The storage medium may perform an operation of determining a threshold value from the first probability distribution function of luminance. If the threshold value is less than or equal to a preset first value, the storage medium may perform an operation of determining a scale factor of the luminance. The storage medium may perform an operation of performing a first luminance correction operation to correct the luminance based on the scale factor. The storage medium may perform an operation of correcting the luminance of each of a plurality of blocks into which the image is divided into preset sizes. The storage medium may perform an operation of correcting the luminance of the entire area of the image. The storage medium may perform an operation of determining a gamma parameter to which the threshold value is applied based on the average luminance of the image. The storage medium may perform an operation of generating a corrected image by correcting the luminance based on the gamma parameter.
[0007] In relation to the description of the drawings, the same or similar reference numerals may be used for identical or similar components.
[0008] FIG. 1 is a block diagram of an electronic device in a network environment according to various embodiments.
[0009] FIG. 2 is a block diagram illustrating the configuration of an electronic device according to various embodiments.
[0010] FIG. 3 is a flowchart illustrating a schematic operation for correcting the contrast ratio of an image according to various embodiments.
[0011] FIGS. 4a, FIGS. 4b, and FIGS. 4c are drawings illustrating an operation to correct a first brightness according to various embodiments.
[0012] FIGS. 5A, FIGS. 5B, FIGS. 5C, FIGS. 5D, FIGS. 5E, FIGS. 5F, FIGS. 5G, FIGS. 5H, and FIGS. 5I are drawings illustrating an operation for correcting local contrast ratios according to various embodiments.
[0013] FIGS. 6A, 6B, 6C, and 6D are drawings illustrating an operation to correct global contrast ratio according to various embodiments.
[0014] FIGS. 7a and 7b are drawings illustrating an operation to correct a second brightness according to various embodiments.
[0015] FIG. 8 is a flowchart illustrating a method for correcting the contrast ratio of an image according to various embodiments.
[0016] Hereinafter, embodiments of the present disclosure are described in detail with reference to the drawings so that those skilled in the art can easily implement them. However, the present disclosure may be embodied in various different forms and is not limited to the examples described herein. In relation to the description of the drawings, the same or similar reference numerals may be used for identical or similar components. Furthermore, in the drawings and related descriptions, descriptions of well-known functions and configurations may be omitted for clarity and brevity.
[0017] FIG. 1 is a block diagram of an electronic device (101) in a network environment (100) according to various embodiments.
[0018] Referring to FIG. 1, in a network environment (100), an electronic device (101) may communicate with an electronic device (102) through a first network (198) (e.g., a short-range wireless communication network) or with at least one of an electronic device (104) or a server (108) through a second network (199) (e.g., a long-range wireless communication network). According to one embodiment, the electronic device (101) may communicate with the electronic device (104) through a server (108). According to one embodiment, the electronic device (101) may include a processor (120), memory (130), input module (150), sound output module (155), display module (160), audio module (170), sensor module (176), interface (177), connection terminal (178), haptic module (179), camera module (180), power management module (188), battery (189), communication module (190), subscriber identification module (196), or antenna module (197). In some embodiments, at least one of these components (e.g., connection terminal (178)) may be omitted from the electronic device (101), or one or more other components may be added. In some embodiments, some of these components (e.g., sensor module (176), camera module (180), or antenna module (197)) may be integrated into a single component (e.g., display module (160)).
[0019] The processor (120) can control at least one other component (e.g., hardware or software component) of the electronic device (101) connected to the processor (120) by executing software (e.g., program (140)), and can perform various data processing or operations. According to one embodiment, as at least part of the data processing or operations, the processor (120) can store commands or data received from other components (e.g., sensor module (176) or communication module (190)) in volatile memory (132), process the commands or data stored in volatile memory (132), and store the resulting data in non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., central processing unit or application processor) or an auxiliary processor (123) that can operate independently or together with it (e.g., graphics processing unit, neural processing unit (NPU), image signal processor, sensor hub processor, or communication processor). For example, if the electronic device (101) includes a main processor (121) and an auxiliary processor (123), the auxiliary processor (123) may be configured to use less power than the main processor (121) or to be specialized for a designated function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as part thereof.
[0020] The auxiliary processor (123) may control at least some of the functions or states associated with at least one component of the electronic device (101) (e.g., display module (160), sensor module (176), or communication module (190)) on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. According to one embodiment, the auxiliary processor (123) (e.g., image signal processor or communication processor) may be implemented as part of another functionally related component (e.g., camera module (180) or communication module (190)). According to one embodiment, the auxiliary processor (123) (e.g., neural network processing unit) may include a hardware structure specialized for processing an artificial intelligence model. The artificial intelligence model may be generated through machine learning. Such learning may be performed, for example, on the electronic device (101) itself where the artificial intelligence model is executed, or through a separate server (e.g., server (108)). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the embodiments described above. The artificial intelligence model may include a plurality of artificial neural network layers.The artificial neural network may be a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the embodiments described above. In addition to the hardware structure, the artificial intelligence model may include a software structure, either additionally or substantially.
[0021] The memory (130) can store various data used by at least one component of the electronic device (101) (e.g., processor (120) or sensor module (176)). The data may include, for example, input data or output data for software (e.g., program (140)) and related commands. The memory (130) may include volatile memory (132) or non-volatile memory (134). The non-volatile memory (134) may include at least one internal memory (136) and an external memory (138).
[0022] The program (140) may be stored as software in memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).
[0023] The input module (150) can receive commands or data to be used for a component of the electronic device (101) (e.g., processor (120)) from outside the electronic device (101) (e.g., user). The input module (150) may include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0024] The sound output module (155) can output a sound signal to the outside of the electronic device (101). The sound output module (155) may include, for example, a speaker or a receiver. The speaker may be used for general purposes, such as multimedia playback or recording playback. The receiver may be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from the speaker or as part thereof.
[0025] The display module (160) can visually provide information to an external (e.g., user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling said device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of the force generated by said touch.
[0026] The audio module (170) can convert sound into an electrical signal or, conversely, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150) or output sound through the sound output module (155) or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphones) connected directly or wirelessly to the electronic device (101).
[0027] The sensor module (176) can detect the operating state of the electronic device (101) (e.g., power or temperature) or the external environmental state (e.g., user state) and generate an electrical signal or data value corresponding to the detected state. According to one embodiment, the sensor module (176) may include, for example, a gesture sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biosensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0028] The interface (177) may support one or more specified protocols that can be used for the electronic device (101) to be connected directly or wirelessly to an external electronic device (e.g., electronic device (102)). According to one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0029] The connection terminal (178) may include a connector through which the electronic device (101) can be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0030] The haptic module (179) can convert an electrical signal into a mechanical stimulus (e.g., vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic senses. According to one embodiment, the haptic module (179) may include, for example, a motor, a piezoelectric element, or an electric stimulation device.
[0031] The camera module (180) can capture still images and video. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.
[0032] The power management module (188) can manage power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented, for example, as at least part of a power management integrated circuit (PMIC).
[0033] The battery (189) can supply power to at least one component of the electronic device (101). According to one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0034] The communication module (190) can support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between an electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may include one or more communication processors that operate independently of the processor (120) (e.g., application processor) and support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., cellular communication module, short-range wireless communication module, or GNSS (global navigation satellite system) communication module) or a wired communication module (194) (e.g., LAN (local area network) communication module, or power line communication module). The corresponding communication module among these communication modules can communicate with an external electronic device (104) through a first network (198) (e.g., a short-range communication network such as Bluetooth, WiFi (wireless fidelity) direct, or IrDA (infrared data association)) or a second network (199) (e.g., a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can identify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) using subscriber information (e.g., International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module (196).
[0035] The wireless communication module (192) can support 5G networks and next-generation communication technologies following 4G networks, for example, new radio access technology. NR access technology can support high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and connection of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low-latency communications (URLLC)). The wireless communication module (192) can support a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate, for example. The wireless communication module (192) can support various technologies for securing performance in the high-frequency band, such as beamforming, massive MIMO (multiple-input and multiple-output), full-dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large-scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), external electronic device (e.g., electronic device (104)), or network system (e.g., second network (199)). According to one embodiment, the wireless communication module (192) can support a Peak data rate (e.g., 20 Gbps or more) for realizing eMBB, loss coverage (e.g., 164 dB or less) for realizing mMTC, or U-plane latency (e.g., downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) for realizing URLLC.
[0036] An antenna module (197) can transmit a signal or power to or from an external source (e.g., an external electronic device). According to one embodiment, the antenna module (197) may include an antenna comprising a radiator made of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). According to one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as a first network (198) or a second network (199), may be selected from the plurality of antennas, for example, by a communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device through the selected at least one antenna. According to some embodiments, in addition to the radiator, other components (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as part of the antenna module (197).
[0037] According to various embodiments, the antenna module (197) may form a mmWave antenna module. According to one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent to a first surface (e.g., bottom surface) of the printed circuit board and capable of supporting a specified high frequency band (e.g., mmWave band), and a plurality of antennas (e.g., array antennas) disposed on or adjacent to a second surface (e.g., top surface or side surface) of the printed circuit board and capable of transmitting or receiving a signal of the specified high frequency band.
[0038] At least some of the above components can be connected to each other via a communication method between peripheral devices (e.g., bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)) and exchange signals (e.g., commands or data) with each other.
[0039] According to one embodiment, commands or data may be transmitted or received between the electronic device (101) and an external electronic device (104) through a server (108) connected to a second network (199). Each of the external electronic devices (102, or 104) may be the same or a different type of device as the electronic device (101). According to one embodiment, all or part of the operations performed on the electronic device (101) may be performed on one or more of the external electronic devices (102, 104, or 108). For example, if the electronic device (101) needs to perform a function or service automatically or in response to a request from a user or another device, the electronic device (101) may request one or more external electronic devices to perform at least part of the function or service instead of performing the function or service itself or additionally. One or more external electronic devices that receive the above request may execute at least part of the requested function or service, or additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may provide the result as is or additionally processed as at least part of the response to the request. For this purpose, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device (101) may provide ultra-low latency services using, for example, distributed computing or mobile edge computing. In one embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server using machine learning and / or neural networks. According to one embodiment, the external electronic device (104) or the server (108) may be included within a second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0040] The electronic devices according to the various examples disclosed in this document may be of various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or consumer electronics. The electronic devices according to the embodiments of this document are not limited to the devices described above.
[0041] FIG. 2 is a block diagram illustrating the configuration of an electronic device according to various embodiments.
[0042] Referring to FIG. 2, the electronic device (200) may include memory (210) and a processor (220).
[0043] A memory (210) (e.g., memory (130) of FIG. 1) can store data, algorithms, programs, instructions, etc. that perform the functions of an electronic device (200). Instructions, etc. stored in the memory (210) can be loaded into a processor (220) and executed by the processor (220). For example, the memory (210) can store data (e.g., formulas, values, etc.) used in a first luminance correction (or, pre-gamma correction) operation, a local contrast ratio correction operation, a global contrast ratio correction operation and / or a second luminance correction (or, color space optimization, post-gamma correction) operation.
[0044] A processor (220) (e.g., processor (120) of FIG. 1) can control each component of the electronic device (200). The electronic device (200) may include one or more processors (220). For example, the processor (220) may correspond to a plurality of processors that collectively perform a plurality of functions by dividing them among the processors.
[0045] For example, the processor (220) can acquire an image. For example, the image may include an image with low luminance overall. The processor (220) can acquire a luminance histogram from the image. For example, the processor (220) can acquire a luminance histogram for the entire area of the image. The processor (220) can acquire a first probability distribution function of luminance including a plurality of Gaussian functions from the luminance histogram. For example, the first probability distribution function may include a Gaussian mixture model (or function). The Gaussian mixture model may include a plurality (e.g., three) of Gaussian functions. The Gaussian mixture model is a probability distribution model that represents the histogram of the image and can approximate a complex form of probability distribution through a weighted sum of a plurality of Gaussian functions.
[0046] For example, the processor (220) may determine a threshold value from a first probability distribution function (e.g., a Gaussian mixture model). The threshold value may be a reference value for determining the scale factor. Multiple Gaussian functions included in the first probability distribution function may each include different average values. The processor (220) may determine the threshold value based on the lowest average value among the average values of the multiple Gaussian functions. For example, the processor (220) may determine whether to perform the first luminance correction operation based on a preset reference value (e.g., about 0.0649) and the threshold value. As an example, if the threshold value exceeds the preset reference value, the processor (220) may skip the first luminance correction operation. If the threshold value is less than or equal to the preset reference value, the processor (220) may determine the scale factor of the luminance. The processor (220) may determine the scale factor based on the ratio of the threshold value to the maximum luminance of the pixels in the image. For example, if the ratio of the maximum luminance of the pixels in the image is less than a threshold value, the processor (220) may determine the scale factor to be a preset fixed value. If the ratio of the maximum luminance of the pixels in the image is greater than or equal to the threshold value and less than or equal to a preset reference value, the processor (220) may determine the scale factor to be a variable value according to the ratio of the maximum luminance. The processor (220) may perform a first luminance correction operation to correct the luminance based on the scale factor. For example, the processor (220) may perform the first luminance correction operation by multiplying the luminance of each pixel of the image by the scale factor.
[0047] As an example, the processor (220) may set a first weight. The processor (220) may set the average of the ratios of the maximum luminances of multiple pixels of an image as the first weight. The processor (220) may perform a first luminance correction operation by additionally applying the first weight. For example, the first luminance correction operation may be performed by applying the first weight to the value obtained by multiplying the luminance of each pixel of the image by a scale factor.
[0048] The processor (220) can divide the image on which the first luminance correction operation has been performed into a plurality of blocks of a preset size. The processor (220) can correct the luminance of each of the plurality of blocks. For example, the processor (220) can obtain the average and standard deviation of the luminance of each of the plurality of blocks. Based on the average and standard deviation of the luminance, the processor (220) can obtain a first cumulative distribution function (CDF) of the normal distribution of the luminance of each of the plurality of blocks and a second weight of the luminance. The processor (220) can correct the luminance of each of the plurality of blocks based on the second weight. For example, the processor (220) can obtain a luminance increase / decrease curve of each of the plurality of blocks by applying the second weight to the first cumulative distribution function. The processor (220) can generate a luminance increase / decrease curve map from the luminance increase / decrease curve and perform bilinear interpolation to make it the same size as the original image. As an example, the processor (220) can convert the maximum luminance of each pixel into 8 bits. The processor (220) can generate a luminance increase / decrease map per pixel by mapping the luminance of each pixel of a plurality of blocks to an increase / decrease curve. The processor (220) can correct the luminance of each of the plurality of blocks by multiplying the increase map by each channel (e.g., red, green, blue) of the pixel.
[0049] For example, the processor (220) may set a minimum value of the standard deviation and / or apply a penalty (or additional weight) to solve the light scattering problem. As an example, the processor (220) may set a minimum value of the standard deviation based on the entropy of the image. Based on the set minimum value of the standard deviation, the processor (220) may obtain a first cumulative distribution function of the normal distribution of the luminance of each of the plurality of blocks and a second weight of the luminance. As an example, the processor (220) may obtain a penalty of the luminance of each of the plurality of blocks based on the average. Based on the second weight to which the penalty is applied, the processor (220) may obtain a curve of increase or decrease in the luminance of each of the plurality of blocks and correct the luminance of each of the plurality of blocks.
[0050] The processor (220) can correct the luminance of the entire area of the image, in which the luminance of each of the plurality of blocks is corrected. For example, the processor (220) can obtain a second probability distribution function of luminance including a plurality of Gaussian functions from the luminance histogram of the image. The processor (220) can obtain a second cumulative distribution function based on the second probability distribution function. The processor (220) can obtain a global change curve based on the second cumulative distribution function. The processor (220) can correct the luminance of the entire area of the image based on the global change curve.
[0051] The processor (220) can determine a gamma parameter with a threshold applied based on the average luminance of the image with the luminance corrected across the entire area. The processor (220) can generate an image with the luminance corrected by performing a second luminance correction operation based on the gamma parameter. For example, if the average luminance of the image is less than a preset value, the processor (220) can reduce the threshold applied to the gamma parameter. The gamma parameter can determine the intensity of the brightness correction. As an example, the processor (220) can more strongly correct the brightness of the pixels in the dark areas by setting a relatively small gamma parameter and a small threshold in a dark image. In the case of a bright image, the processor (220) can limit excessive brightness correction by setting a relatively larger gamma parameter and a constant threshold. The processor (220) can correct the luminance based on the gamma parameter and generate a corrected image.
[0052] Various embodiments of this document can minimize information loss and provide an image close to the human visual experience when mapping an HDR image containing a wide dynamic range to an LDR image that can be displayed on a display. For example, various embodiments of this document can improve the visibility and visual quality of an image by enhancing the contrast ratio of the image.
[0053] The effects of the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by a person skilled in the art from the description below.
[0054] FIG. 3 is a flowchart illustrating a schematic operation for correcting the contrast ratio of an image according to various embodiments. FIGS. 4a, 4b, and 4c are drawings illustrating an operation for correcting a first brightness according to various embodiments. FIGS. 5a, 5b, 5c, 5d, 5e, 5f, 5g, 5h, and 5i are drawings illustrating an operation for correcting a local contrast ratio according to various embodiments. FIGS. 6a, 6b, 6c, and 6d are drawings illustrating an operation for correcting a global contrast ratio according to various embodiments. FIGS. 7a and 7b are drawings illustrating an operation for correcting a second brightness according to various embodiments.
[0055] In the following embodiments, each operation may be performed sequentially, but is not necessarily performed sequentially. For example, the order of each operation may be changed, and at least two operations may be performed in parallel.
[0056] According to one embodiment, 310 to 340 may be understood to be performed in a processor (e.g., processor (120) of FIG. 1 and / or processor (220) of FIG. 2) of an electronic device (e.g., electronic device (101) of FIG. 1 and / or electronic device (200) of FIG. 2).
[0057] Referring to FIGS. 3, FIGS. 4a, FIGS. 4b and FIGS. 4c, the electronic device (200) can perform a first brightness correction operation (310).
[0058] As an example, the electronic device (200) can acquire an image. As illustrated in FIG. 4a, the electronic device (200) can acquire a luminance histogram (21a) from the image. As an example, the electronic device (200) can acquire a luminance histogram (21a) for the entire area of the image. The electronic device (200) can acquire a probability distribution function of luminance including a plurality of Gaussian functions from the luminance histogram (21a). For example, the probability distribution function may include a Gaussian mixture model (or function). As an example, the electronic device (200) can determine a threshold value (α) from the probability distribution function (e.g., Gaussian mixture model). The plurality of Gaussian functions included in the probability distribution function may each include different average values. The electronic device (200) can determine the threshold value (α) based on the lowest average value (1) among the average values of the plurality of Gaussian functions. According to one example, the luminance of the image is represented in 16 bits, and the maximum value of the luminance represented in 16 bits may be 65535. As illustrated in FIG. 4a, the probability distribution function may include three Gaussian functions. The average values of the three Gaussian functions may be approximately 5217, approximately 12548, and approximately 39236, respectively. For example, the average value of the Gaussian functions may be a luminance value. The electronic device (200) may determine a threshold value using the smallest average value (1) among the average values of the plurality of Gaussian functions and the following equation.
[0059] α= μ min / 65535 ----- (Equation 1)
[0060] Here, α is the threshold value, and μ min can be the smallest average value.
[0061] For example, when the smallest average value (1) is about 5217, the electronic device (200) can determine the threshold value (α) to be about 0.0796 according to (Equation 1). The electronic device (200) can determine whether to perform the first luminance correction operation based on a preset reference value (e.g., about 0.0649) and the threshold value (α). As illustrated in FIG. 4b, for example, when the threshold value (α) is about 0.0649, the relationship between linear correction and gamma (or luminance) correction can be reversed. If the threshold value (α) is set to be greater than about 0.0649, excessive luminance correction may occur during linear correction. For example, the electronic device (200) of this document can set the preset reference value to about 0.0649 and limit the maximum value of the threshold value (α) to about 0.0649. For example, if the threshold value (α) exceeds a preset reference value, the electronic device (200) may skip the first luminance correction operation. For example, in the case of a linear RGB image that is already sufficiently bright, the normalized luminance value of most pixels may be greater than the threshold value (α), so the luminance may be over-corrected when gamma correction (or luminance correction) is performed. If approximately 0.0649 is not included in the 99% confidence interval range of the distribution of the Gaussian function with the smallest mean, the electronic device (200) may determine that it is a sufficiently bright image and skip the first luminance correction operation.
[0062] When the threshold value (α) is less than or equal to a preset reference value, the processor (220) can determine the scale factor of the luminance. As an example, the electronic device (200) can determine the scale factor based on the ratio of the threshold value and the maximum luminance of the pixels of the image. The electronic device (200) can determine the scale factor using the following equation.
[0063] ----- (Equation 2)
[0064] ----- (Equation 3)
[0065] Here, k u is the scale factor, ζ u is the ratio of the maximum luminance of the image pixels, and α can be a threshold value. max(r u , g u , b u ) can be the maximum value among the R, G, and B luminances of pixel u = (u, v). k u is determined by α, and m and n are for all ζ u from k u It can be set to be continuous.
[0066] As an example, if the ratio of the maximum luminance of the pixels of an image is less than a threshold value (α), the electronic device (200) has a scale factor (k u ) can be determined as a preset fixed value (e.g., 4.5). If the ratio of the maximum luminance of the pixels in the image is greater than or equal to a threshold value (α) and less than or equal to a preset reference value (e.g., approximately 0.0649), the electronic device (200) determines the scale factor (k) according to (Equation 2). u ) can be determined as a variable value according to the ratio of maximum brightness. As an example, the electronic device (200) uses a scale factor (k) as shown in the equation below to maintain a linear relationship of the image. u A first luminance correction operation can be performed by multiplying ) by the luminance value of the pixel.
[0067] I EN (u) = k u * I Ori (u), I Ori (u) = [r u , g u , b u ] t ----- (Equation 4)
[0068] Here, I EN (u) is the corrected luminance of the pixel in the image, k u is the scale factor, I Ori (u) is the original luminance of the pixel in the image, r u is the red luminance of pixel u, gu is the green luminance of pixel u, b u can be the blue luminance of pixel u.
[0069] As an example, the electronic device (200) may perform a first brightness correction operation by additionally applying a first weight. The electronic device (200) may set the first weight using the following equation.
[0070] ----- (Equation 5)
[0071] Here, w is the first weight, H is the height of the image (or, the number of pixels per row), W is the width of the image (or, the number of pixels per column), ζ u, v can be the ratio of the maximum luminance of the pixel in row u, column v of the image.
[0072] As an example, the electronic device (200) has a ratio (ζ) of the maximum brightness of a plurality of pixels of an image. u, v The average of the ) can be set as the first weight (w). The electronic device (200) can perform the first brightness correction operation by applying the first weight (w) as in the equation below.
[0073] I ADE = (1 - w) * I En + w * I Ori ----- (Equation 6)
[0074] Here, I ADE is the corrected luminance of a pixel in the image with the first weight applied, w is the weight, I En is the corrected luminance of the image pixels, I Ori It can be the original luminance of the pixels in the image.
[0075] As illustrated in FIG. 4c, the original image (11a) may be a generally dark image, and the luminance histogram (21a) of the original image (11a) may include pixels of luminance distributed in a low-luminance area. When the first luminance correction operation is performed, the electronic device (200) may obtain a first luminance correction image (11b) that is somewhat brighter than the original image (11a). The luminance histogram (21b) of the first luminance correction image (11b) may include pixels of luminance that are more diffused than the luminance histogram (21a) of the original image (11a).
[0076] Referring to FIG. 3, FIG. 5a, FIG. 5b, FIG. 5c, FIG. 5d, FIG. 5e, FIG. 5f, FIG. 5g, FIG. 5h and FIG. 5i, the electronic device (200) can perform a local contrast ratio correction operation (320).
[0077] Referring to FIG. 5a, the electronic device (200) can divide the image on which the first luminance correction operation has been performed into a plurality of blocks of a preset size. As an example, the electronic device (200) can divide the image on which the first luminance correction operation has been performed into m blocks (e.g., 48 blocks) in the row direction and n blocks (e.g., 64 blocks) in the column direction. The electronic device (200) can obtain the mean and standard deviation of the normalized luminance of the pixels for each block. The electronic device (200) can obtain the first cumulative distribution function (CDF) of a normal distribution based on the mean and standard deviation of the normalized luminance of the pixels. As an example, the mean of the block is μ b , the standard deviation is σ b In this case, the normal distribution is N(μ b , σ b 2 It can be ), and the first cumulative distribution function is Q μb,σb It could be.
[0078] As an example, the electronic device (200) has a first cumulative distribution function (Q) for each block. μb,σb Using ), a curve of increase or decrease as shown in the equation below can be obtained.
[0079] ----- (Equation 7)
[0080] ----- (Equation 8)
[0081] Here, H b is the increase / decrease curve of the block, x i is the ratio of the luminance of pixel i represented in 8 bits, w b is the block weight, Q μb,σb (x i ) may be a cumulative distribution function of the block. The weight may be a value between 0 and 1. For example, since the electronic device (200) converts the luminance value of the pixel to 8 bits in a local contrast correction operation, the maximum value of the luminance may be 255.
[0082] As shown in FIG. 5b, the increase / decrease curve of the block (H b The numerator of ) is the block weight (w b It can be a function regarding ). The weight of the block (w b The closer ) is to 0, the more y i is x i It approaches , and the closer it is to 1, the more the block's cumulative distribution function (Q μb,σb (x i It can approach )). The block's weight (w b ) can be obtained based on the mean and standard deviation of the luminance of the pixels included in the block. The weight of the block (w b ) can be set based on the mean weight and the standard deviation weight. For example, the block weight (w b ) can be obtained using the following formula.
[0083] w b = M(μ b ) * S(σ b ) ----- (Equation 9)
[0084] M(μ b ) = 1 - (2μ b - 1) 2 , S(σ b ) = 10-σb ----- (Equation 10)
[0085] Here, μ b is the block average, σ b is the standard deviation of the block, M(μ b ) is the weighting formula based on the mean, S(σ b ) can be a weighting formula based on the standard deviation.
[0086] As illustrated in FIG. 5c, in blocks with very low or high averages, such as night or day skies, a weighting formula based on the average (M(μ)) is used to maintain the original pixel distribution. b )) can be set in the form of an upward-convex quadratic function. For example, the weighting equation based on the mean (M(μ b )) is the average (μ b The closer ) is to 0 or 1, the higher the block weight (w b You can make ) close to 0.
[0087] As illustrated in FIG. 5d, the more the pixel distribution within the block is concentrated in a narrow range, the greater the weight (w b To flatten the pixel distribution by increasing ), the weighting formula based on standard deviation (S(σ b )) can be set in the form of a decreasing exponential function. For example, the weighting equation based on standard deviation (S(σ b )) is the standard deviation (σ b The smaller ) is, the greater the block weight (w b It can make ) larger.
[0088] For example, the electronic device (200) can generate an increase / decrease curve map from the increase / decrease curve obtained from each block and perform bilinear interpolation to make it the same size as the original image. The electronic device (200) can generate a pixel-wise increase / decrease map by converting the max(r, g, b) value of each pixel into 8 bits and mapping it to the increase / decrease curve. The electronic device (200) can perform a local contrast correction operation by multiplying the increase / decrease map by each channel of the image.
[0089] For example, when the electronic device (200) performs an operation to correct the local contrast ratio, to prevent light bleeding problems, the minimum value of the standard deviation (σ min ) restrict or weight(w b ) can be adjusted.
[0090] As an example, when the electronic device (200) obtains the first cumulative distribution function (CDF) of each block, the minimum value of the standard deviation (σ min ) can be set. According to one example, as shown in FIG. 5e, σ min As in the case where = 0, light scattering may occur in blocks where bright and dark pixels meet, as the slope of the first cumulative distribution function becomes steep. The minimum value of the standard deviation (σ min If ) is set to a value greater than 0, the slope of the first cumulative distribution function becomes gentler, and the problem of light scattering can be improved. When the pixels of an image are concentrated in the dark areas, the greater the image entropy, the more blocks there may be where pixels in the bright and dark areas meet. As an example, as shown in FIG. 5f, the minimum value of the standard deviation (σ) depending on the image entropy min ) can be set.
[0091] As an example, weights (w b ) penalty(η b ) can be added. According to one example, for bright images, weights (w b As ) increases, excessive correction may result in unintended light scattering. As illustrated in Fig. 5g, the weight (w b The penalty (η) set in ) b Applying ) weights(w b The problem of light scattering can be improved by reducing ). As an example, as shown in FIG. 5h, the average (μ b The larger ) is, the greater the penalty (η b ) can be set small. Penalty (η b ) is the weight(w bSince it is a weight that modifies (or adds) ), it can be called an additional weight.
[0092] For example, the minimum value of the standard deviation (σ min ) and / or penalty(η b Final weights (w) with ) applied b ') can be obtained as shown in the equation below.
[0093] w b ' = η b * M(μ b ) * S(max(σ b ,σ min )) ----- (Equation 11)
[0094] Here, w b ' is the final weight, η b is the penalty, M(μ b ) is the weighting formula based on the mean, S(max(σ b ,σ min )) may be a weighting formula for the standard deviation based on the larger value between the block's standard deviation and the minimum value of the standard deviation.
[0095] As illustrated in FIG. 5i, when a local contrast ratio correction operation is performed, the electronic device (200) can obtain a local contrast ratio correction image (11c) that is somewhat brighter than the first brightness correction image (11b). The brightness histogram (21c) of the local contrast ratio correction image (11c) may include pixels with relatively uniform brightness compared to the brightness histogram (21b) of the first brightness correction image (11b).
[0096] Referring to FIG. 3, FIG. 6a, FIG. 6b, FIG. 6c, and FIG. 6d, the electronic device (200) can perform a global contrast ratio correction operation (330).
[0097] As an example, the electronic device (200) can improve the sense of unity of the image by adjusting the overall brightness of the image into a single increase / decrease curve through a global contrast ratio correction operation and mitigating discontinuities between blocks. As illustrated in FIG. 6a, the electronic device (200) can obtain a second probability distribution function of luminance including a plurality of Gaussian functions from the luminance histogram of the image. As illustrated in FIG. 6b, the electronic device (200) can obtain a second cumulative distribution function based on the second probability distribution function. The electronic device (200) can obtain a global change curve (or, global increase / decrease curve) based on the second cumulative distribution function. As an example, the electronic device (200) can obtain a global change curve using the following equation.
[0098] ----- (Equation 12)
[0099] Here, G(x) is the global change curve, w g is the global weight, x is the pixel's luminance, Q GMM (x) can be the second cumulative distribution function.
[0100] As an example, the electronic device (200) can correct the brightness of the entire area of the image based on a global variation curve (G(x)). The electronic device (200) can use a second cumulative distribution function (Q GMM The luminance distribution of the pixels can be made uniform through (x). Referring to Fig. 6c, the weight (w g The results of global contrast ratio improvement and histograms according to ) are plotted. As an example, the weight (w g As ) increases, the distribution of pixel luminance widens, and image visibility can also be improved. According to one example, the weight (w g ) can be set to 1.
[0101] As illustrated in FIG. 6d, when a global contrast ratio correction operation is performed, the electronic device (200) can obtain a global contrast ratio correction image (11d) that is somewhat brighter than a local contrast ratio correction image (11c). The luminance histogram (21d) of the global contrast ratio correction image (11d) may have a wider distribution of luminance of pixels than the luminance histogram (21c) of the local contrast ratio correction image (11c).
[0102] Referring to FIG. 3, FIG. 7a and FIG. 7b, the electronic device (200) can perform a second brightness correction operation (340).
[0103] As an example, the electronic device (200) can obtain a final image by performing a second brightness correction operation. As an example, the electronic device (200) can perform a second brightness correction operation using the following equation.
[0104] ----- (Equation 13)
[0105] Here, x is the pixel luminance, γ F ε is the gamma parameter (or luminance parameter), α is the threshold value, α F can be the final threshold value.
[0106] As illustrated in FIG. 7a, the electronic device (200) uses the average (μ) of the normalized luminance of the pixels for adaptive brightness correction of the image. F ) obtain , and gamma parameter (γ F ) and final threshold value (α F ) can be set. As an example, the gamma parameter (γ F ) can determine the intensity of brightness correction. According to one example, the final threshold value (α F A linear correction section and a luminance correction section can be divided based on ). The electronic device (200) has a gamma parameter (γ) smaller than the existing 709 gamma technology in dark images. F ) and a small final threshold value (α FBy setting ), the brightness of the pixels in the dark areas can be corrected more strongly. In the case of a bright image, the electronic device (200) uses a gamma parameter (γ) larger than the existing 709 gamma technology. F Excessive brightness correction can be limited by setting ). In the case of a bright image, the electronic device (200) sets a final threshold value (α F ) can be set to the same value.
[0107] As illustrated in FIG. 7b, when a second luminance correction operation is performed, the electronic device (200) can obtain a clear second luminance correction image (11e) that is brighter than the global contrast ratio correction image (11d). The luminance histogram (21e) of the second luminance correction image (11e) can have a wider and more uniform distribution of luminance of pixels than the luminance histogram (21d) of the global contrast ratio correction image (11d).
[0108] After the second luminance correction operation is performed, the electronic device (200) may perform a color adjustment operation to restore the distorted color space to the original color space. For example, the electronic device (200) may perform the color adjustment operation using a color correction matrix (CCM) such as the equation below.
[0109] ----- (Equation 14)
[0110] Here, and can be the color values of the input image and the output image.
[0111] As an example, the electronic device (200) can obtain an optimal color correction matrix capable of obtaining color values similar to a reference image using quadratic programming. According to one example, the electronic device (200) obtains color values B = [r1', g1', b1', ..., r in an 8-bit RGB image obtained from a specific camera. N', g N ', b N '] T Input color values A = [r1, g1, b1, ..., r N , g N , b N ] T Obtain x = [a, b, c, d, e, f, g, h, i] satisfying the equation below T You can find it.
[0112] ----- (Equation 15)
[0113] FIG. 8 is a flowchart illustrating a method for correcting the contrast ratio of an image according to various embodiments.
[0114] In the following embodiments, each operation may be performed sequentially, but is not necessarily performed sequentially. For example, the order of each operation may be changed, and at least two operations may be performed in parallel.
[0115] According to one embodiment, 810 to 880 can be understood as being performed in a processor (e.g., processor (220) of FIG. 2) of an electronic device (e.g., electronic device (200) of FIG. 2).
[0116] For example, an electronic device (200) can obtain a probability distribution function of luminance including a plurality of Gaussian functions from a luminance histogram of an image (810). For example, the probability distribution function may include a Gaussian mixture model. A Gaussian mixture model may include a plurality of Gaussian functions. A Gaussian mixture model is a probability distribution model that represents the histogram of an image and can approximate a complex form of probability distribution through a weighted sum of a plurality of Gaussian functions.
[0117] The electronic device (200) can determine a threshold value from the probability distribution function of the luminance (820). For example, the electronic device (200) can determine the lowest average among the averages of a plurality of Gaussian functions as the threshold value. The electronic device (200) can determine whether to perform a first luminance correction operation based on a preset reference value and a threshold value. As an example, the preset reference value may include approximately 0.0649. If the threshold value exceeds the preset reference value, the first luminance correction operation may be skipped.
[0118] The electronic device (200) can determine the scale factor of the luminance when the threshold value is less than or equal to a preset reference value (830). For example, the electronic device (200) can determine the scale factor based on the ratio of the threshold value and the maximum luminance of the pixels in the image. When the ratio of the maximum luminance of the pixels in the image is less than the threshold value, the electronic device (200) can determine the scale factor as a preset fixed value. When the ratio of the maximum luminance of the pixels in the image is greater than or equal to the threshold value and less than or equal to a preset reference value, the electronic device (200) can determine the scale factor based on the ratio of the maximum luminance.
[0119] The electronic device (200) can perform a first brightness correction operation that corrects brightness based on a scale factor (840). For example, the electronic device (200) can set the average of the ratios of maximum brightness of multiple pixels of an image as a weight and perform the first brightness correction operation based on the weight.
[0120] The electronic device (200) can correct the luminance of each of the multiple blocks into which the image is divided into pre-set sizes (850). For example, the electronic device (200) can obtain the average and standard deviation of the luminance of each of the multiple blocks. The electronic device (200) can obtain a weight of the luminance of each of the multiple blocks based on a function of the average of the luminance and a function of the standard deviation of the luminance. The electronic device (200) can correct the luminance of each of the multiple blocks based on the weight. As an example, the electronic device (200) can set a minimum value of the standard deviation based on the entropy of the image to avoid light bleeding. As an example, the electronic device (200) can obtain a penalty of the luminance of each of the multiple blocks based on the average to avoid light bleeding, and correct the luminance of each of the multiple blocks based on the weight and the penalty.
[0121] The electronic device (200) can correct the luminance of the entire area of the image (860). For example, the electronic device (200) can obtain a probability distribution function of luminance including a plurality of Gaussian functions from a luminance histogram. The electronic device (200) can obtain a cumulative distribution function based on the probability distribution function. The electronic device (200) can obtain a global change curve based on the cumulative distribution function. The electronic device (200) can correct the luminance of the entire area based on the global change curve.
[0122] The electronic device (200) can determine a gamma parameter to which a threshold value is applied based on the average luminance of the image (870). For example, if the average luminance of the image is less than a preset value, the electronic device (200) can reduce the threshold value applied to the gamma parameter. The gamma parameter can determine the intensity of the brightness correction. As an example, the electronic device (200) can correct the brightness of the pixels in the dark areas more strongly by setting a relatively small gamma parameter and threshold value in a dark image. In the case of a bright image, the electronic device (200) can limit excessive brightness correction by setting a relatively larger gamma parameter and a constant threshold value. The electronic device (200) can correct the luminance based on the gamma parameter and generate a corrected image (880).
[0123] As an example, an electronic device may include at least one processor comprising a processing circuit and a memory that stores instructions executed individually or collectively by said at least one processor. Instructions stored in said memory may be configured to cause the electronic device to obtain a first probability distribution function of luminance including a first plurality of Gaussian functions from a luminance histogram of an image. The instructions may be configured to cause the electronic device to determine a threshold value from said first probability distribution function of luminance. The instructions may be configured to cause the electronic device to determine a scale factor of the luminance when the threshold value is less than or equal to a preset first value. The instructions may be configured to cause the electronic device to perform a first luminance correction operation that corrects the luminance based on said scale factor. The instructions may be configured to cause the electronic device to correct the luminance of each of a plurality of blocks into which the image is divided by a preset size. The instructions may be configured to cause the electronic device to correct the luminance of the entire area of the image. The above command may be configured to cause the electronic device to determine the gamma parameter to which the threshold value is applied based on the average luminance of the image. The above command may be configured to cause the electronic device to correct the luminance based on the gamma parameter to generate a corrected image.
[0124] As an example, the above command may be configured to cause the electronic device to determine the lowest average among the averages of the first plurality of Gaussian functions as the threshold value.
[0125] As an example, the above command may be configured to cause the electronic device to skip the first brightness correction operation when the threshold value exceeds a preset first value. The preset first value may include 0.0649.
[0126] As an example, the above command may be configured to cause the electronic device to determine the scale factor to a preset second value when the ratio of the maximum brightness of the pixels of the image is less than the threshold value, and to determine the scale factor based on the ratio of the maximum brightness when the ratio of the maximum brightness is greater than or equal to the threshold value and less than or equal to the preset first value.
[0127] As an example, the above command may be configured to cause the electronic device to set the average of the ratios of the maximum luminances of a plurality of pixels of the image as a weight, and to perform the first luminance correction operation based on the weight.
[0128] As an example, the above command may be configured to cause the electronic device to obtain the average and standard deviation of the luminance of each of the plurality of blocks, obtain a weight of the luminance of each of the plurality of blocks based on a function of the average of the luminance and a function of the standard deviation of the luminance, and correct the luminance of each of the plurality of blocks based on the weight.
[0129] As an example, the above command may be configured to cause the electronic device to set the minimum value of the standard deviation based on the entropy of the image.
[0130] As an example, the above command may be configured to cause the electronic device to obtain a penalty for the luminance of each of the plurality of blocks based on the average, and to correct the luminance of each of the plurality of blocks based on the weight and the penalty.
[0131] As an example, the above command may be configured to cause the electronic device to obtain a second probability distribution function of luminance including a second plurality of Gaussian functions from the luminance histogram, obtain a cumulative distribution function based on the second probability distribution function, obtain a global change curve based on the cumulative distribution function, and correct the luminance of the entire area based on the global change curve.
[0132] As an example, the above command may be configured to cause the electronic device to reduce the threshold value applied to the gamma parameter when the average brightness of the image is less than a preset third value.
[0133] As an example, a method for correcting the contrast ratio of an image may include an operation of obtaining a first probability distribution function of luminance including a plurality of Gaussian functions from a luminance histogram of the image. The method may include an operation of determining a threshold value from the first probability distribution function of luminance. If the threshold value is less than or equal to a preset first value, the method may include an operation of determining a scale factor of the luminance. The method may include an operation of performing a first luminance correction operation to correct the luminance based on the scale factor. The method may include an operation of correcting the luminance of each of a plurality of blocks into which the image is divided by a preset size. The method may include an operation of correcting the luminance of the entire area of the image. The method may include an operation of determining a gamma parameter to which the threshold value is applied based on the average luminance of the image. The method may include an operation of generating a corrected image by correcting the luminance based on the gamma parameter.
[0134] As an example, the operation of determining the threshold value may determine the lowest average among the averages of the plurality of Gaussian functions as the threshold value.
[0135] As an example, the above method may further include an operation to skip the first luminance correction operation when the threshold value exceeds a preset first value. The preset first value may include 0.0649.
[0136] As an example, the operation of determining the scale factor of the luminance may determine the scale factor to a preset second value when the ratio of the maximum luminance of the pixels of the image is less than the threshold value, and determine the scale factor based on the ratio of the maximum luminance when the ratio of the maximum luminance is greater than or equal to the threshold value and less than or equal to the preset first value.
[0137] As an example, the operation of performing the first luminance correction operation may set the average of the ratios of the maximum luminances of a plurality of pixels of the image as a weight, and perform the first luminance correction operation based on the weight.
[0138] As an example, the operation of correcting the luminance of each of the plurality of blocks may obtain the average and standard deviation of the luminance of each of the plurality of blocks, obtain a weight of the luminance of each of the plurality of blocks based on a function of the average of the luminance and a function of the standard deviation of the luminance, and correct the luminance of each of the plurality of blocks based on the weight.
[0139] As an example, the operation of correcting the brightness of each of the plurality of blocks can set the minimum value of the standard deviation based on the entropy of the image.
[0140] As an example, the operation of correcting the luminance of each of the plurality of blocks may obtain a penalty for the luminance of each of the plurality of blocks based on the average, and correct the luminance of each of the plurality of blocks based on the weight and the penalty.
[0141] As an example, the operation of correcting the luminance of the entire area may obtain a second probability distribution function of luminance including a second plurality of Gaussian functions from the luminance histogram, obtain a cumulative distribution function based on the second probability distribution function, obtain a global change curve based on the cumulative distribution function, and correct the luminance of the entire area based on the global change curve.
[0142] As an example, a non-transient computer-readable storage medium having a program recorded thereon for performing a method to correct the contrast ratio of an image may perform an operation of obtaining a first probability distribution function of luminance including a plurality of Gaussian functions from a luminance histogram of the image. The storage medium may perform an operation of determining a threshold value from the first probability distribution function of luminance. If the threshold value is less than or equal to a preset first value, the storage medium may perform an operation of determining a scale factor of the luminance. The storage medium may perform an operation of performing a first luminance correction operation to correct the luminance based on the scale factor. The storage medium may perform an operation of correcting the luminance of each of a plurality of blocks into which the image is divided by a preset size. The storage medium may perform an operation of correcting the luminance of the entire area of the image. The storage medium may perform an operation of determining a gamma parameter to which the threshold value is applied based on the average luminance of the image. The storage medium may perform an operation of generating a corrected image by correcting the luminance based on the gamma parameter.
[0143] The various embodiments of this document and the terms used therein are not intended to limit the technical features described in this document to specific embodiments, and should be understood to include various modifications, equivalents, or substitutions of said embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of said items unless the relevant context clearly indicates otherwise. In this document, each of phrases such as "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C" may include any one of the items listed together in the corresponding phrase, or all possible combinations thereof. Terms such as “first,” “second,” or “first” or “second” may be used simply to distinguish a component from another component and do not limit the components in any other aspect (e.g., importance or order). Where any (e.g., first) component is referred to as “coupled” or “connected” to another (e.g., second) component, with or without the terms “functionally” or “communicationally,” it means that said component may be connected to said other component directly (e.g., wired), wirelessly, or through a third component.
[0144] The term “module” as used in the various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example. A module may be a component formed integrally, or a minimum unit of said component or a part thereof that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0145] Various embodiments of the present document may be implemented as software (e.g., program (140)) comprising one or more instructions stored in a storage medium (e.g., internal memory (136) or external memory (138)) readable by a machine (e.g., electronic device (101)). For example, a processor (e.g., processor (120)) of the machine (e.g., electronic device (101)) may call at least one of the one or more instructions stored in the storage medium and execute it. This enables the machine to be operated to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code that can be executed by an interpreter. The storage medium readable by the machine may be provided in the form of a non-transitory storage medium. Here, 'non-temporary' simply means that the storage medium is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily.
[0146] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or an application store (e.g., Play Store). TM It can be distributed online (e.g., downloaded or uploaded) through ) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
[0147] According to various embodiments, each component (e.g., module or program) of the components described above may include a singular or multiple entities, and some of the multiple entities may be separated and placed in other components. According to various embodiments, one or more of the components or operations among the aforementioned components may be omitted, or one or more other components or operations may be added. Generally or additionally, multiple components (e.g., module or program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the multiple components in the same or similar manner as those performed by the corresponding component among the multiple components prior to integration. According to various embodiments, operations performed by the module, program, or other components may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
[0148] The effects of this document are not limited to those mentioned above, and other unmentioned effects will be clearly understood by a person skilled in the art from the description above.
Claims
1. In an electronic device, At least one processor including a processing circuit; and The above-mentioned memory for storing instructions executed individually or collectively by at least one processor; The instruction stored in the above memory causes the electronic device: A first probability distribution function of luminance including a first plurality of Gaussian functions is obtained from the luminance histogram of an image, and A threshold value is determined from the first probability distribution function of the above luminance, and If the above threshold value is less than or equal to a preset first value, the scale factor of the above luminance is determined, and A first brightness correction operation is performed to correct the brightness based on the above scale factor, and Correcting the brightness of each of the multiple blocks into which the above image is divided into preset sizes, and Corrects the brightness of the entire area of the above image, and Based on the average luminance of the above image, the gamma parameter to which the above threshold value is applied is determined, and An electronic device configured to generate a corrected image by correcting the brightness based on the above gamma parameters.
2. In Paragraph 1, The above command causes the electronic device to: An electronic device configured to determine the lowest average among the averages of the first plurality of Gaussian functions as the threshold value.
3. In Paragraph 1, The above command causes the electronic device to: An electronic device configured to skip the first brightness correction operation when the above threshold value exceeds a preset first value, wherein the preset first value includes 0.0649.
4. In Paragraph 1, The above command causes the electronic device to: An electronic device configured to determine the scale factor to a preset second value when the ratio of the maximum luminance of the pixels of the above image is less than the above threshold value, and to determine the scale factor based on the ratio of the maximum luminance when the ratio of the maximum luminance is greater than or equal to the above threshold value and less than or equal to the above preset first value.
5. In Paragraph 4, The above command causes the electronic device to: An electronic device configured to set the average of the ratios of the maximum luminances of a plurality of pixels of the above image as a weight, and to perform the first luminance correction operation based on the weight.
6. In Paragraph 1, The above command causes the electronic device to: An electronic device configured to obtain the average and standard deviation of the luminance of each of the plurality of blocks, obtain a weight of the luminance of each of the plurality of blocks based on a function of the average of the luminance and a function of the standard deviation of the luminance, and correct the luminance of each of the plurality of blocks based on the weight.
7. In Paragraph 6, The above command causes the electronic device to: An electronic device configured to set the minimum value of the standard deviation based on the entropy of the above image.
8. In Paragraph 6, The above command causes the electronic device to: An electronic device configured to obtain a penalty for the luminance of each of the plurality of blocks based on the above average, and to correct the luminance of each of the plurality of blocks based on the above weight and the above penalty.
9. In Paragraph 1, The above command causes the electronic device to: An electronic device configured to obtain a second probability distribution function of luminance including a second plurality of Gaussian functions from the luminance histogram, obtain a cumulative distribution function based on the second probability distribution function, obtain a global change curve based on the cumulative distribution function, and correct the luminance of the entire area based on the global change curve.
10. In Paragraph 1, The above command causes the electronic device to: An electronic device configured to reduce the threshold value applied to the gamma parameter when the average brightness of the above image is less than a preset third value.
11. In a method for correcting the contrast ratio of an image, The operation of obtaining a first probability distribution function of luminance including a plurality of Gaussian functions from the luminance histogram of the above image; An operation to determine a threshold value from the first probability distribution function of the above luminance; An operation to determine the scale factor of the luminance when the above threshold value is less than or equal to a preset first value; An operation to perform a first brightness correction operation that corrects the brightness based on the above scale factor; An operation to correct the brightness of each of the plurality of blocks into which the above image is divided into preset sizes; An operation to correct the brightness of the entire area of the above image; An operation to determine a gamma parameter to which the threshold value is applied based on the average luminance of the above image; and A method comprising the operation of generating a corrected image by correcting the luminance based on the above gamma parameter.
12. In Paragraph 11, The operation of determining the above threshold value is, A method for determining the lowest average among the averages of the plurality of Gaussian functions as the threshold value.
13. In Paragraph 11, The operation of skipping the first brightness correction operation when the above threshold value exceeds a preset first value is further included. A method in which the first value previously set above includes 0.0649.
14. In Paragraph 11, The operation of determining the scale factor of the above luminance is, A method for determining the scale factor to a preset second value when the ratio of the maximum luminance of the pixels of the above image is less than the threshold value, and determining the scale factor based on the ratio of the maximum luminance when the ratio of the maximum luminance is greater than or equal to the threshold value and less than or equal to the preset first value.
15. In a non-transient computer-readable storage medium on which a program for performing a method of correcting the contrast ratio of an image is recorded, The operation of obtaining a first probability distribution function of luminance including a plurality of Gaussian functions from the luminance histogram of the above image; An operation to determine a threshold value from the first probability distribution function of the above luminance; An operation to determine the scale factor of the luminance when the above threshold value is less than or equal to a preset first value; An operation to perform a first brightness correction operation that corrects the brightness based on the above scale factor; An operation to correct the brightness of each of the plurality of blocks into which the above image is divided into preset sizes; An operation to correct the brightness of the entire area of the above image; An operation to determine a gamma parameter to which the threshold value is applied based on the average luminance of the above image; and A non-transient computer-readable storage medium having a program recorded thereon that performs a method including the operation of generating a corrected image by correcting the brightness based on the above gamma parameters.
Citation Information
Patent Citations
Image processing method, device and equipment
CN117876229A
Automatic color correction processing method and automatic color correction processing device
JP2020155907A
Method and apparatus of histogram equalizer for contrast enhancement of image using histogram compression
KR1020140109217A
How to order custom interiors using software
KR1020230127802A
Antioxidant cosmetic compositions comprising plant extracts having antioxidant activity
KR102741855B1