CN116362981A - Tone mapping method, computer program product, electronic device, and storage medium - Google Patents

Tone mapping method, computer program product, electronic device, and storage medium Download PDF

Info

Publication number
CN116362981A
CN116362981A CN202111619304.2A CN202111619304A CN116362981A CN 116362981 A CN116362981 A CN 116362981A CN 202111619304 A CN202111619304 A CN 202111619304A CN 116362981 A CN116362981 A CN 116362981A
Authority
CN
China
Prior art keywords
tone mapping
image
local
mapping model
global
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
Application number
CN202111619304.2A
Other languages
Chinese (zh)
Inventor
张一林
张学成
孙浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jigan Technology Co ltd
Original Assignee
Beijing Jigan Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jigan Technology Co ltd filed Critical Beijing Jigan Technology Co ltd
Priority to CN202111619304.2A priority Critical patent/CN116362981A/en
Publication of CN116362981A publication Critical patent/CN116362981A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The application provides a tone mapping method, a computer program product, an electronic device and a storage medium, which are applied to the field of image processing. The method comprises the steps of performing tone mapping on an image to be adjusted by using a global tone mapping model to ensure uniformity of overall brightness distribution of a target image, and performing tone mapping on the image to be processed by using a local tone mapping model to ensure higher contrast of the target image. The mixed tone mapping model is obtained by fusing the global tone mapping model and the local tone mapping model, so that tone mapping of the image to be adjusted by using the mixed tone mapping model can ensure the uniformity of the overall brightness distribution of the target image and also ensure the higher contrast of the target image, thereby solving the technical problem that the tone mapping method in the prior art cannot consider the uniformity of the overall brightness distribution of the image and the higher contrast.

Description

Tone mapping method, computer program product, electronic device, and storage medium
Technical Field
The present application relates to the field of image processing, and in particular, to a tone mapping method, a computer program product, an electronic device, and a storage medium.
Background
Dynamic Range refers to the relative ratio between the brightest and darkest portions of a scene. In the real world, visual information and brightness variation contained in a scene are high; alternatively, high dynamic range (High Dynamic Range, HDR) image data captured by some advanced devices also has a very high dynamic range. However, currently mainstream display devices, for example: a liquid crystal display (Liquid Crystal Display, LCD), projector, or the like can generally display only 256 levels of luminance values. Therefore, HDR image data needs to be processed into a low dynamic range (Low Dynamic Range, LDR) before it can be displayed on the currently mainstream display devices.
The tone mapping method is a technique for converting HDR image data into LDR image data, and the basic principle thereof is to build a mapping from high bit pixel values (e.g. 0-65535) to low bit pixel values (e.g. 0-255), so that the HDR image data is converted into LDR image data, and can be displayed by a display.
However, the tone mapping method in the prior art cannot give consideration to the uniformity of the overall brightness distribution of the image and the higher contrast; if the overall brightness distribution of the tone mapped image is ensured to be uniform, more contrast is lost; if the contrast of the tone mapped image is guaranteed to be high, the overall brightness distribution may be uneven.
Disclosure of Invention
An objective of the embodiments of the present application is to provide a tone mapping method, a computer program product, an electronic device, and a storage medium, which are used for solving the technical problem that the tone mapping method in the prior art cannot achieve uniformity of overall brightness distribution and higher contrast of an image.
In a first aspect, an embodiment of the present application provides a tone mapping method, including: acquiring an image to be adjusted; the value range of the pixel value in the image to be adjusted is a first value range, the value range of the pixel value in the target image corresponding to the image to be adjusted is a second value range, and the first value range is larger than the second value range; establishing a global tone mapping model corresponding to the image to be adjusted; image segmentation is carried out on the image to be adjusted to obtain a plurality of partial images, and a plurality of partial tone mapping models corresponding to the partial images are established; respectively fusing the global tone mapping model and each local tone mapping model to obtain a plurality of mixed tone mapping models; for each local image, mapping the local image into a corresponding local target image by utilizing the corresponding mixed tone mapping model; and fusing the partial target images to obtain the target image. In the above scheme, tone mapping of the image to be adjusted by using the global tone mapping model can ensure uniformity of overall brightness distribution of the target image, and tone mapping of the image to be processed by using the local tone mapping model can ensure higher contrast of the target image. The mixed tone mapping model is obtained by fusing the global tone mapping model and the local tone mapping model, so that tone mapping of the image to be adjusted by using the mixed tone mapping model can ensure the uniformity of the overall brightness distribution of the target image and also ensure the higher contrast of the target image, thereby solving the technical problem that the tone mapping method in the prior art cannot consider the uniformity of the overall brightness distribution of the image and the higher contrast.
In an alternative embodiment, the global tone mapping model and the local tone mapping model are identical in structure. In the above scheme, the structures of the global tone mapping model and the local tone mapping model can be the same, so that the global tone mapping model and the local tone mapping model can be conveniently fused later, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In an alternative embodiment, the global tone mapping model and the local tone mapping model are piecewise linear functions, and the global tone mapping model and the local tone mapping model have the same piecewise manner for the first range of values. In the above scheme, the global tone mapping model and the local tone mapping model can be represented in the form of piecewise linear functions, and the piecewise modes of the first value range of the image to be adjusted are the same, so that the subsequent fusion of the global tone mapping model and the local tone mapping model is facilitated, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In an alternative embodiment, the fusing the global tone mapping model with each local tone mapping model to obtain a plurality of mixed tone mapping models includes: and fusing each section of linear function in the global tone mapping model with a corresponding section of linear function in the local tone mapping model to obtain a corresponding section of linear function in the mixed tone mapping model. In the above scheme, each section of linear function in the global tone mapping model and a corresponding section of linear function in the local tone mapping model can be fused to obtain a mixed tone mapping model which is still a piecewise linear function, so that the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In an alternative embodiment, the building a global tone mapping model corresponding to the image to be adjusted includes: constructing a global histogram according to the image to be adjusted and the segmentation mode; the global histogram comprises a plurality of segments of pixel value ranges and brightness distribution probabilities corresponding to each segment of pixel value range, wherein the brightness distribution probabilities corresponding to each segment of pixel value range refer to the probabilities that the pixel values in the image to be adjusted fall into the segment of pixel range; determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; wherein each slope is proportional to a probability of a luminance distribution corresponding to the segment of the pixel value range; determining the global tone mapping model from the plurality of slopes; and/or, the establishing a plurality of local tone mapping models corresponding to the plurality of local images includes: constructing a local histogram according to the local image and the segmentation mode for each local image; the local histogram comprises a plurality of sections of pixel value ranges and brightness distribution probabilities corresponding to each section of pixel value range, wherein the brightness distribution probabilities corresponding to each section of pixel value range refer to the probabilities that pixel values in the local image fall into the section of pixel value range; determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; the multiple slopes enable the mean square error between the contrast of the local image and the contrast of a local mapping image to be minimum, and the local mapping image is an image obtained after the local image is mapped based on the local mapping model; the local tone mapping model is determined from the plurality of slopes. In the scheme, in the process of establishing the global tone mapping model, the uniformity of the overall brightness distribution of the image can be considered, so that the uniformity of the overall brightness distribution of the target image can be ensured by tone mapping the image to be adjusted by using the global tone mapping model; in the process of establishing the local tone mapping model, the contrast of the local image can be considered to be reserved, so that the contrast of the target image can be ensured to be higher by tone mapping the image to be processed by using the local tone mapping model.
In an optional embodiment, the image segmentation of the image to be adjusted to obtain a plurality of local images includes: and dividing the image to be adjusted in a sliding window mode to obtain the partial images. In the above scheme, the image to be adjusted can be segmented by means of a movable window, so that a local tone mapping model and a global tone mapping model can be established based on the segmented image to map the image tone.
In an alternative embodiment, there is an overlap between two adjacent partial images in the image to be adjusted. In the above scheme, the image to be adjusted can be segmented in a movable window mode, and overlapping can exist between adjacent partial images obtained by segmentation, so that uniformity of brightness distribution between the partial images can be improved.
In an alternative embodiment, the area of the overlapping part between two adjacent partial images in the image to be adjusted is one half of the area of the partial images.
In a second aspect, embodiments of the present application provide a tone mapping apparatus, including: the acquisition module is used for acquiring the image to be adjusted; the value range of the pixel value in the image to be adjusted is a first value range, the value range of the pixel value in the target image corresponding to the image to be adjusted is a second value range, and the first value range is larger than the second value range; the building module is used for building a global tone mapping model corresponding to the image to be adjusted; the segmentation module is used for carrying out image segmentation on the image to be adjusted to obtain a plurality of partial images, and establishing a plurality of partial tone mapping models corresponding to the partial images; wherein the global tone mapping model and the local tone mapping model are both used for mapping pixel values in the first value range to pixel values in the second value range; the first fusion module is used for respectively fusing the global tone mapping model and each local tone mapping model to obtain a plurality of mixed tone mapping models; the mapping module is used for mapping each local image into a corresponding local target image by utilizing the corresponding mixed tone mapping model; and the second fusion module is used for fusing the plurality of local target images to obtain the target image. In the above scheme, tone mapping of the image to be adjusted by using the global tone mapping model can ensure uniformity of overall brightness distribution of the target image, and tone mapping of the image to be processed by using the local tone mapping model can ensure higher contrast of the target image. The mixed tone mapping model is obtained by fusing the global tone mapping model and the local tone mapping model, so that tone mapping of the image to be adjusted by using the mixed tone mapping model can ensure the uniformity of the overall brightness distribution of the target image and also ensure the higher contrast of the target image, thereby solving the technical problem that the tone mapping method in the prior art cannot consider the uniformity of the overall brightness distribution of the image and the higher contrast.
In an alternative embodiment, the global tone mapping model and the local tone mapping model are identical in structure. In the above scheme, the structures of the global tone mapping model and the local tone mapping model can be the same, so that the global tone mapping model and the local tone mapping model can be conveniently fused later, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In an alternative embodiment, the global tone mapping model and the local tone mapping model are piecewise linear functions, and the global tone mapping model and the local tone mapping model have the same piecewise manner for the first range of values. In the above scheme, the global tone mapping model and the local tone mapping model can be represented in the form of piecewise linear functions, and the piecewise modes of the first value range of the image to be adjusted are the same, so that the subsequent fusion of the global tone mapping model and the local tone mapping model is facilitated, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In an alternative embodiment, the first fusion module is specifically configured to: and fusing each section of linear function in the global tone mapping model with a corresponding section of linear function in the local tone mapping model to obtain a corresponding section of linear function in the mixed tone mapping model. In the above scheme, each section of linear function in the global tone mapping model and a corresponding section of linear function in the local tone mapping model can be fused to obtain a mixed tone mapping model which is still a piecewise linear function, so that the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In an alternative embodiment, the establishing module is specifically configured to: constructing a global histogram according to the image to be adjusted and the segmentation mode; the global histogram comprises a plurality of segments of pixel value ranges and brightness distribution probabilities corresponding to each segment of pixel value range, wherein the brightness distribution probabilities corresponding to each segment of pixel value range refer to the probabilities that the pixel values in the image to be adjusted fall into the segment of pixel range; determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; wherein each slope is proportional to a probability of a luminance distribution corresponding to the segment of the pixel value range; determining the global tone mapping model from the plurality of slopes; and/or, the segmentation module is specifically configured to: constructing a local histogram according to the local image and the segmentation mode for each local image; the local histogram comprises a plurality of sections of pixel value ranges and brightness distribution probabilities corresponding to each section of pixel value range, wherein the brightness distribution probabilities corresponding to each section of pixel value range refer to the probabilities that pixel values in the local image fall into the section of pixel value range; determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; the multiple slopes enable the mean square error between the contrast of the local image and the contrast of a local mapping image to be minimum, and the local mapping image is an image obtained after the local image is mapped based on the local mapping model; the local tone mapping model is determined from the plurality of slopes. In the scheme, in the process of establishing the global tone mapping model, the uniformity of the overall brightness distribution of the image can be considered, so that the uniformity of the overall brightness distribution of the target image can be ensured by tone mapping the image to be adjusted by using the global tone mapping model; in the process of establishing the local tone mapping model, the contrast of the local image can be considered to be reserved, so that the contrast of the target image can be ensured to be higher by tone mapping the image to be processed by using the local tone mapping model.
In an alternative embodiment, the segmentation module is specifically configured to: and dividing the image to be adjusted in a sliding window mode to obtain the partial images. In the above scheme, the image to be adjusted can be segmented by means of a movable window, so that a local tone mapping model and a global tone mapping model can be established based on the segmented image to map the image tone.
In an alternative embodiment, there is an overlap between two adjacent partial images in the image to be adjusted. In the above scheme, the image to be adjusted can be segmented in a movable window mode, and overlapping can exist between adjacent partial images obtained by segmentation, so that uniformity of brightness distribution between the partial images can be improved.
In an alternative embodiment, the area of the overlapping part between two adjacent partial images in the image to be adjusted is one half of the area of the partial images.
In a third aspect, embodiments of the present application provide a computer program product comprising computer program instructions which, when read and executed by a processor, perform the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide an electronic device, including: a processor, a memory, and a bus; the processor and the memory complete communication with each other through the bus; the memory stores computer program instructions executable by the processor, the processor invoking the computer program instructions capable of performing the method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a computer-readable storage medium storing computer program instructions that, when executed by a computer, cause the computer to perform the method according to the first aspect.
In order to make the above objects, features and advantages of the present application more comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a tone mapping method according to an embodiment of the present application;
FIG. 2 is a block diagram of a tone mapping apparatus according to an embodiment of the present disclosure;
fig. 3 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In recent years, technology research such as computer vision, deep learning, machine learning, image processing, image recognition and the like based on artificial intelligence has been advanced significantly. Artificial intelligence (Artificial Intelligence, AI) is an emerging scientific technology for studying and developing theories, methods, techniques and application systems for simulating and extending human intelligence. The artificial intelligence discipline is a comprehensive discipline and relates to various technical categories such as chips, big data, cloud computing, internet of things, distributed storage, deep learning, machine learning, neural networks and the like. Computer vision is an important branch of artificial intelligence, and particularly, machine recognition is a world, and computer vision technologies generally include technologies such as face recognition, living body detection, fingerprint recognition and anti-counterfeit verification, biometric feature recognition, face detection, pedestrian detection, object detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, word recognition, video processing, video content recognition, behavior recognition, three-dimensional reconstruction, virtual reality, augmented reality, synchronous positioning and map building (SLAM), computational photography, robot navigation and positioning, and the like. With research and progress of artificial intelligence technology, the technology expands application in various fields, such as security protection, city management, traffic management, building management, park management, face passing, face attendance, logistics management, warehouse management, robots, intelligent marketing, computed photography, mobile phone images, cloud services, intelligent home, wearing equipment, unmanned driving, automatic driving, intelligent medical treatment, face payment, face unlocking, fingerprint unlocking, personnel verification, intelligent screen, intelligent television, camera, mobile internet, network living broadcast, beauty, make-up, medical beauty, intelligent temperature measurement and the like.
Referring to fig. 1, fig. 1 is a flowchart of a tone mapping method according to an embodiment of the present application, where the tone mapping method may be applied to an electronic device, and specifically may include the following:
step S101: and acquiring an image to be adjusted.
Step S102: and establishing a global tone mapping model corresponding to the image to be adjusted.
Step S103: image segmentation is carried out on the image to be adjusted to obtain a plurality of partial images, and a plurality of partial tone mapping models corresponding to the partial images are established.
Step S104: and respectively fusing the global tone mapping model and each local tone mapping model to obtain a plurality of mixed tone mapping models.
Step S105: for each local image, it is mapped to a corresponding local target image using a corresponding hybrid tone mapping model.
Step S106: and fusing the multiple local target images to obtain a target image.
Specifically, the image to be adjusted in step S101 refers to an image that needs to be tone-mapped, and the target image in step S106 refers to an image obtained after tone-mapping the image to be adjusted. The tone mapping method converts an image with a high dynamic range into an image with a low dynamic range, and the dynamic range can be understood as a value range of pixel values in the image or as the number of bits occupied by each pixel point in the image. Therefore, the first value range of the pixel values in the image to be adjusted should be larger than the second value range of the pixel values in the target image.
For example, the first value range of the image to be adjusted may be 0-65535, and the second value range of the target image may be 0-255; that is, the image to be adjusted with the pixel value ranging from 0 to 65535 can be mapped to the target image with the pixel value ranging from 0 to 255 by the tone mapping method provided by the embodiment of the present application.
It is understood that the specific values are only examples provided in the embodiments of the present application, and those skilled in the art may adjust the values of the first value range and the second value range according to the actual situation.
In addition, the embodiment of the application does not specifically limit the specific implementation manner of acquiring the image to be adjusted by the electronic device, and a person skilled in the art can perform appropriate adjustment according to actual situations. For example, the image to be adjusted may be an image acquired by an image acquisition device in real time, and the image acquisition device may send the image to be adjusted to an electronic device; or, the image to be adjusted can be an image stored locally in advance, and the electronic device can directly read the locally stored image to be adjusted; or, the image to be adjusted may be an image stored in the cloud, and the electronic device may read the image to be adjusted stored in the cloud, and so on.
Then, based on the image to be adjusted acquired in step S101, a global tone mapping model and a local tone mapping model may be respectively established. The global tone mapping model and the local tone mapping model are used for mapping the pixel values in the first value range to the pixel values in the second value range.
As the name suggests, the global tone mapping model refers to applying the same mapping rules over all pixels in the image to be adjusted. Thus, a global tone mapping model can be built directly on the complete image to be adjusted. Based on the global tone mapping model, all pixels in the image to be adjusted can be mapped with the same mapping rule.
The local tone mapping model refers to that the same mapping rule is applied to local pixels in the image to be adjusted, and the mapping rules applied to pixels of different local parts may be different. Therefore, the image to be adjusted can be firstly subjected to image segmentation to obtain a plurality of partial images, and then a corresponding partial tone mapping model is generated based on each partial image, so that a plurality of partial tone mapping models are obtained. Based on each local tone mapping model, mapping all pixel points in the corresponding local image according to the same mapping rule; based on different local tone mapping models, pixel points in different local images can be mapped with different mapping rules.
The above embodiment of creating the global tone mapping model, the embodiment of dividing the image to be adjusted, and the embodiment of creating the local tone mapping model will be described in detail in the following examples, which will not be described here.
It will be appreciated that the order of creating the global tone mapping model and creating the local tone mapping model in the embodiments of the present application is not particularly limited, and those skilled in the art may also make appropriate adjustments according to the actual situation. For example, two models may be built simultaneously; or firstly establishing a global tone mapping model and then establishing a local tone mapping model; alternatively, a local tone mapping model may be built first and then a global tone mapping model may be built.
Next, after obtaining a global tone mapping model and a plurality of local tone mapping models, each local tone mapping model and the global tone mapping model may be fused to obtain a corresponding mixed tone mapping model; the plurality of local tone mapping models results in a corresponding plurality of hybrid tone mapping models. Thus, a partial image will correspond to a partial tone mapping model, and also to a hybrid tone mapping model.
And then, mapping the corresponding local images by utilizing each mixed tone mapping model to obtain local target images corresponding to each local image. It will be appreciated that the hybrid tone mapping model may also map pixel values from a first range of values to a second range of values, i.e. the range of values of pixel values of the local image is larger than the range of values of pixel values of the corresponding local target image, thus converting the high dynamic range local image to a low dynamic range local target image.
And finally, fusing the plurality of local target images obtained through conversion to obtain a target image. It can be understood that in the process of fusing the plurality of partial target images, reference may be made to the process of dividing the image to be adjusted into a plurality of partial images; in other words, the local target image can be fused by adopting a process opposite to the process of dividing the image to be adjusted, so that the fused target image is ensured to be an image after the image to be adjusted is converted.
The following description of the above embodiments is given by way of example:
first, an image P to be adjusted is acquired 1 The method comprises the steps of carrying out a first treatment on the surface of the Then based on P 1 Build global tone mapping model G and apply P 1 Divided into n partial images IN 1 ,IN 2 ,……,IN n Based on IN 1 Establishing a corresponding local tone mapping model L 1 … … based on IN n Establishing a corresponding local tone mapping model L n Obtaining n local tone mapping models L 1 ,L 2 ,……,L n The method comprises the steps of carrying out a first treatment on the surface of the Next, G and L are combined 1 Fusion is carried out to obtain a corresponding mixed tone mapping model GL 1 … … G and L n Fusion is carried out to obtain a corresponding mixed tone mapping model GL n Obtaining n mixed tone mapping models GL 1 ,GL 2 ,……,GL n The method comprises the steps of carrying out a first treatment on the surface of the Next, GL is utilized 1 Will IN 1 Mapping to a corresponding local target image OUT 1 … …, using GL n Will IN n Mapping to a corresponding local target image OUT n Obtaining n partial target images OUT 1 ,OUT 2 ,……,OUT n The method comprises the steps of carrying out a first treatment on the surface of the Finally, fuse OUT 1 ,OUT 2 ,……,OUT n Obtaining a target image P 2 The method comprises the steps of carrying out a first treatment on the surface of the Wherein P is 1 The value range of the pixel value (namely the first value range) is larger than P 2 A second range of values (i.e., a second range of values) for the pixel values.
In the above scheme, tone mapping of the image to be adjusted by using the global tone mapping model can ensure uniformity of overall brightness distribution of the target image, and tone mapping of the image to be processed by using the local tone mapping model can ensure higher contrast of the target image. The mixed tone mapping model is obtained by fusing the global tone mapping model and the local tone mapping model, so that tone mapping of the image to be adjusted by using the mixed tone mapping model can ensure the uniformity of the overall brightness distribution of the target image and also ensure the higher contrast of the target image, thereby solving the technical problem that the tone mapping method in the prior art cannot consider the uniformity of the overall brightness distribution of the image and the higher contrast.
Further, on the basis of the foregoing embodiments, the structures of the global tone mapping model and the local tone mapping model provided in the embodiments of the present application may be the same.
In particular, for example, the global tone mapping model and the local tone mapping model may each be piecewise linear functions; alternatively, the global tone mapping model and the local tone mapping model may both be linear functions; alternatively, the global tone mapping model and the local tone mapping model may both be exponential functions or the like.
It will be appreciated that the specific implementation of the global tone mapping model and the local tone mapping model in the embodiments of the present application are not specifically limited, and those skilled in the art may make suitable selections according to the actual situation.
In the above scheme, the structures of the global tone mapping model and the local tone mapping model can be the same, so that the global tone mapping model and the local tone mapping model can be conveniently fused later, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
Furthermore, based on the foregoing embodiment, the global tone mapping model and the local tone mapping model provided in the embodiments of the present application may be piecewise linear functions, and the piecewise manners of the global tone mapping model and the local tone mapping model to the first value range are the same.
Specifically, the pixel value in the image to be adjusted is assumed to be l, and the first value range is 0-l max The method comprises the steps of carrying out a first treatment on the surface of the The pixel value in the target image is v, and the second value range is 0-v max
Because the global tone mapping model and the local tone mapping model are piecewise linear functions, the abscissa of the global tone mapping model and the local tone mapping model are pixel values before mapping, and the ordinate of the global tone mapping model and the local tone mapping model are pixel values after mapping; thus, both the global tone mapping model and the local tone mapping model may be segmented based on the first range of values of the image to be adjusted, and the manner of segmentation should be the same. After segmentation, the size of the pixel value before mapping and the size of the pixel value after mapping are in a linear relation within the value range of a certain segment of pixel value.
It can be appreciated that the embodiments of the present application provide various ways to segment the first value range, and those skilled in the art may make appropriate adjustments according to practical situations. For example, the first value range may be equally divided, for example: the first value range is 0-65535, and can be divided into 16 sections with 4096 pixel values in each section; alternatively, the first value range of the image to be adjusted may be 0 to l max Divided by a segmentation factor delta
Figure BDA0003437354960000151
A segment; wherein when k=1, the kth segment represents the pixel value range [0, δ), when +.>
Figure BDA0003437354960000152
The kth segment represents the pixel value range [ k×δ, (k+1) ×δ).
As an embodiment, the global tone mapping model and the local tone mapping model may be expressed as piecewise linear functions as follows:
v(l)=v k +s k *(l-l k );
wherein v (l) is the pixel value v in the image to which the pixel value l in the image to be adjusted is mapped,
Figure BDA0003437354960000153
slope as a piecewise linear function of the kth segment, l k =k×δ is the pixel value, v in the image to be adjusted corresponding to the start position of the kth segment k I.e. v (l) k ) The pixel value in the mapped image corresponding to the k-th segment start position.
It should be understood that the specific implementation manners of the global tone mapping model and the local tone mapping model provided in the embodiments of the present application are merely provided as an example, and those skilled in the art may make appropriate adjustments to the specific implementation manners of the global tone mapping model and the local tone mapping model according to actual situations, for example: the global tone mapping model and the local tone mapping model may also be nonlinear functions or the like.
In the above scheme, the global tone mapping model and the local tone mapping model can be represented in the form of piecewise linear functions, and the piecewise modes of the first value range of the image to be adjusted are the same, so that the subsequent fusion of the global tone mapping model and the local tone mapping model is facilitated, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
Further, on the basis that the global tone mapping model and the local tone mapping model provided in the embodiment of the present application are piecewise linear functions, the step S104 may specifically include the following:
and fusing each section of linear function in the global tone mapping model with a corresponding section of linear function in the local tone mapping model to obtain a corresponding section of linear function in the mixed tone mapping model.
Specifically, since the global tone mapping model and the local tone mapping model are piecewise linear functions, and the piecewise manner of the piecewise linear functions is the same for the first value range, the kth segment in the global tone mapping model has the same abscissa as the kth segment in the local tone mapping model. That is, fusing the global tone mapping model with the local tone mapping model can be understood as fusing the global tone mapping model with a corresponding linear function in the local tone mapping model; further, it is also understood that the slope of the global tone mapping model is fused with the slope of the local tone mapping model.
As an embodiment, the global tone mapping model and the local tone mapping model may be weighted and fused based on a fusion policy during the fusion process. The above-mentioned fusion strategy can be determined in advance for the user; the electronic equipment can be adjusted at any time according to actual conditions; and the device can also be adjusted at any time by a user according to actual conditions, and the like. The embodiment of the present application is not particularly limited, and those skilled in the art may make appropriate adjustments according to the actual situation.
It can be understood that, when the tone mapping method provided in the embodiment of the present application is suitable for a scene with a high requirement for uniformity of overall brightness distribution of an image, the weight occupied by the global tone mapping model may be larger; when the tone mapping method provided by the embodiment of the application is suitable for a scene with high requirements on the contrast of an image, the weight occupied by the local tone mapping model can be large.
Taking the piecewise linear function provided in the above embodiment as an example, the blended mixed tone mapping model can be expressed as:
s GL,k =α*s G,k +(1-α)*s L,k
wherein s is GL,k S for the mixed tone mapping model corresponding to the kth segment G,k Slope, s, of global tone mapping model corresponding to kth segment L,k s G,k For the slope of the local tone mapping model corresponding to the kth segment, α is the weight of the global tone mapping model corresponding to the kth segment, and (1- α) is the weight of the local tone mapping model corresponding to the kth segment.
In the above scheme, each section of linear function in the global tone mapping model and a corresponding section of linear function in the local tone mapping model can be fused to obtain a mixed tone mapping model which is still a piecewise linear function, so that the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
Further, on the basis that the global tone mapping model and the local tone mapping model provided in the embodiment of the present application are piecewise linear functions, the step of establishing the global tone mapping model corresponding to the image to be adjusted in the step S102 may specifically include the following steps:
and 1) constructing a global histogram according to the image to be adjusted and the segmentation mode.
Step 2), determining the slope of the linear function of the global tone mapping model on each segment of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether.
Step 3), determining a global tone mapping model according to the plurality of slopes.
Specifically, the global histogram may be first constructed based on the image to be adjusted and the segmentation method in which the first value range is segmented in the above embodiment. The global histogram includes a plurality of pixel value ranges (abscissa) and luminance distribution probabilities (ordinate) corresponding to each segment of pixel value range, where the luminance distribution probability corresponding to each segment of pixel value range refers to a probability that a pixel value in an image to be adjusted falls within the segment of pixel range.
For the global tone mapping model, the uniformity of the overall luminance distribution of the image is considered, so the probability p for the segmented luminance distribution can be considered with reference to the viewpoint of histogram equalization k The larger segment k should occupy a larger luminance range distribution in the mapped image. The following formula can thus be derived:
Figure BDA0003437354960000181
wherein N is the total number of segments of the piecewise function, p i 、p j The probabilities that the pixel values of the images to be adjusted fall into the ith and jth sections are respectively. Then, the above formula is substituted into the slope calculation formula given before
Figure BDA0003437354960000182
The following formula can be derived:
Figure BDA0003437354960000183
wherein p is k As can be seen from the probability that the pixel value of the image to be adjusted falls into the kth segment, the slope s of the kth segment k Luminance distribution probability p corresponding to the segment of pixel value range k Proportional to the ratio.
Then, the above s is further added k Substituting the piecewise linear function can result in a corresponding global tone mapping model.
In the piecewise linear function, v k Can be based on v k-1 S k And (5) calculating to obtain the product. For example, v is known to be 0 =0, then v 1 =s 1 *δ。
In the above scheme, in the process of establishing the global tone mapping model, the uniformity of the overall brightness distribution of the image can be considered, so that the uniformity of the overall brightness distribution of the target image can be ensured by tone mapping the image to be adjusted by using the global tone mapping model.
Further, on the basis that the global tone mapping model and the local tone mapping model provided in the embodiment of the present application are piecewise linear functions, the establishing a plurality of local tone mapping models corresponding to a plurality of local images in the step S103 may specifically include the following:
Step 1), constructing a local histogram according to the local image and the segmentation mode for each local image.
Step 2), determining the slope of the linear function of the global tone mapping model on each segment of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether.
Step 3) determining a local tone mapping model according to the plurality of slopes.
Specifically, the local histogram may be first constructed based on the local image and the segmentation method in which the first value range is segmented in the above embodiment. The local histogram includes a plurality of pixel value ranges (abscissa) and a luminance distribution probability (ordinate) corresponding to each pixel value range, and the luminance distribution probability corresponding to each pixel value range refers to a probability that a pixel value in an image to be adjusted falls within the pixel range of the segment, similar to the global histogram.
For the local tone mapping model, the contrast of the image is considered. Assuming that only the kth segment in the linear piecewise function is concerned, the contrast between pixel values falling in this segment in the partial image is assumed to be C k The contrast after tone mapping is
Figure BDA0003437354960000191
Obviously there is a skew of the current segmentRate s k The lower the more prone it is to map a larger pixel value range to a smaller pixel value range, i.e. the contrast will become lower; similarly, s k The higher the contrast ratio becomes, and when s k At 1, the contrast can be well preserved. Thus, it is possible to obtain:
Figure BDA0003437354960000192
generalizing the above analysis to all segments in the linear piecewise function, if it is desired that the contrast loss of the tone mapped image be minimized, the following mean square error can be minimized:
Figure BDA0003437354960000201
wherein, loss(s) 0 ,…,s N ) The method comprises the steps that mean square error between the contrast of a local image and the contrast of a local mapping image is obtained after the local image is mapped based on a local mapping model; p (C) is the contrast between the brightness values falling in the section of the image to be adjusted is C k Is a distribution of (a).
Will be
Figure BDA0003437354960000202
Substituting the formula, the simplification can be obtained:
Figure BDA0003437354960000203
due to C k And p (C) are each related to the image to be adjusted only, and s is k Irrespective, the above equation can therefore also be simplified to a solution:
Figure BDA0003437354960000204
at the same time, it should be ensured that after piecewise linear function mappingThe maximum pixel value should be equal to the expressible upper limit v of pixel values in the target image max The method comprises the following steps:
Figure BDA0003437354960000205
thus, based on the constraints above, there are the following combinations of KKT conditions using Lagrangian:
Figure BDA0003437354960000206
Figure BDA0003437354960000207
/>
Figure BDA0003437354960000208
the method can be solved as follows:
Figure BDA0003437354960000209
substituting λ into s k The method comprises the following steps:
Figure BDA0003437354960000211
among other things, it can be seen that the solved multiple slopes minimize the mean square error between the contrast of the local image and the contrast of the local map image.
Then, the above s is further added k Substituting the partial tone mapping model into the piecewise linear function can obtain the corresponding partial tone mapping model.
It should be noted that, similar to the global tone mapping model, v in the piecewise linear function in the local tone mapping model k Can also be based on v k-1 S k And (5) calculating to obtain the product.
In the above scheme, in the process of establishing the local tone mapping model, the contrast of the local image can be considered to be preserved, so that the contrast of the target image can be ensured to be higher by tone mapping the image to be processed by using the local tone mapping model.
Further, on the basis of the foregoing embodiment, the step of performing image segmentation on the image to be adjusted in the step S103 to obtain a plurality of partial images may specifically include the following:
and dividing the image to be adjusted in a sliding window mode to obtain the partial images.
Specifically, embodiments of the present application provide various implementations for segmenting an image to be adjusted, for example: dividing to-be-adjusted by adopting a sliding window mode; the method and the device realize the determination of the size of the local image, the segmentation of the image to be adjusted, and the like, and the person skilled in the art can perform proper adjustment according to the actual situation.
In the process of dividing the image to be adjusted, there may be an overlap between two adjacent partial images in the image to be adjusted, or there may be no overlap.
For example, assuming that the window size window_size=l, the window movement step number step=l/2, the image to be adjusted having the original size (H, W) may be divided into
Figure BDA0003437354960000212
Figure BDA0003437354960000213
A partial image of size (window_size).
In the above scheme, the image to be adjusted can be segmented in a sliding window mode, and overlapping can exist between adjacent partial images obtained by segmentation, so that uniformity of brightness distribution between the partial images can be improved.
Referring to fig. 2, fig. 2 is a block diagram of a tone mapping apparatus according to an embodiment of the present application, where the tone mapping apparatus 200 may include: an acquisition module 201, configured to acquire an image to be adjusted; the value range of the pixel value in the image to be adjusted is a first value range, the value range of the pixel value in the target image corresponding to the image to be adjusted is a second value range, and the first value range is larger than the second value range; a building module 202, configured to build a global tone mapping model corresponding to the image to be adjusted; the segmentation module 203 is configured to perform image segmentation on the image to be adjusted to obtain a plurality of local images, and establish a plurality of local tone mapping models corresponding to the plurality of local images; wherein the global tone mapping model and the local tone mapping model are both used for mapping pixel values in the first value range to pixel values in the second value range; a first fusion module 204, configured to fuse the global tone mapping model with each of the local tone mapping models to obtain a plurality of hybrid tone mapping models; a mapping module 205, configured to map each local image into a corresponding local target image by using the corresponding mixed tone mapping model; and the second fusion module 206 is configured to fuse the plurality of local target images to obtain the target image.
In an alternative embodiment, the global tone mapping model and the local tone mapping model are identical in structure. In the above scheme, the structures of the global tone mapping model and the local tone mapping model can be the same, so that the global tone mapping model and the local tone mapping model can be conveniently fused later, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
In the embodiment of the application, the uniformity of the overall brightness distribution of the target image can be ensured by tone mapping the image to be adjusted by using the global tone mapping model, and the contrast of the target image can be ensured to be higher by tone mapping the image to be processed by using the local tone mapping model. The mixed tone mapping model is obtained by fusing the global tone mapping model and the local tone mapping model, so that tone mapping of the image to be adjusted by using the mixed tone mapping model can ensure the uniformity of the overall brightness distribution of the target image and also ensure the higher contrast of the target image, thereby solving the technical problem that the tone mapping method in the prior art cannot consider the uniformity of the overall brightness distribution of the image and the higher contrast.
Further, the global tone mapping model and the local tone mapping model are piecewise linear functions, and the global tone mapping model and the local tone mapping model have the same piecewise manner for the first value range.
In the embodiment of the application, the global tone mapping model and the local tone mapping model can be represented in a piecewise linear function mode, and the piecewise modes of the first value range of the image to be adjusted are the same, so that the global tone mapping model and the local tone mapping model can be fused conveniently, and the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
Further, the first fusing module 204 is specifically configured to: and fusing each section of linear function in the global tone mapping model with a corresponding section of linear function in the local tone mapping model to obtain a corresponding section of linear function in the mixed tone mapping model.
In the embodiment of the application, each section of linear function in the global tone mapping model and a corresponding section of linear function in the local tone mapping model can be fused to obtain a mixed tone mapping model which is still a piecewise linear function, so that the uniformity of the overall brightness distribution of the image and the higher contrast ratio can be considered.
Further, the establishing module 202 is specifically configured to: constructing a global histogram according to the image to be adjusted and the segmentation mode; the global histogram comprises a plurality of segments of pixel value ranges and brightness distribution probabilities corresponding to each segment of pixel value range, wherein the brightness distribution probabilities corresponding to each segment of pixel value range refer to the probabilities that the pixel values in the image to be adjusted fall into the segment of pixel range; determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; wherein each slope is proportional to a probability of a luminance distribution corresponding to the segment of the pixel value range; determining the global tone mapping model from the plurality of slopes; and/or, the segmentation module 203 is specifically configured to: constructing a local histogram according to the local image and the segmentation mode for each local image; the local histogram comprises a plurality of sections of pixel value ranges and brightness distribution probabilities corresponding to each section of pixel value range, wherein the brightness distribution probabilities corresponding to each section of pixel value range refer to the probabilities that pixel values in the local image fall into the section of pixel value range; determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; the multiple slopes enable the mean square error between the contrast of the local image and the contrast of a local mapping image to be minimum, and the local mapping image is an image obtained after the local image is mapped based on the local mapping model; the local tone mapping model is determined from the plurality of slopes.
In the embodiment of the application, in the process of establishing the global tone mapping model, the uniformity of the overall brightness distribution of the image can be considered, so that the uniformity of the overall brightness distribution of the target image can be ensured by tone mapping the image to be adjusted by using the global tone mapping model; in the process of establishing the local tone mapping model, the contrast of the local image can be considered to be reserved, so that the contrast of the target image can be ensured to be higher by tone mapping the image to be processed by using the local tone mapping model.
Further, the splitting module 203 is specifically configured to: and dividing the image to be adjusted in a sliding window mode to obtain the partial images.
In the embodiment of the application, the image to be adjusted can be segmented in a movable window mode, and overlapping can exist between adjacent local images obtained through segmentation, so that a local tone mapping model and a global tone mapping model can be established based on the segmented images to map the image tone.
Further, there is an overlap between two adjacent partial images in the image to be adjusted.
In the embodiment of the application, the image to be adjusted can be segmented in a movable window mode, and overlapping can exist between adjacent partial images obtained through segmentation, so that uniformity of brightness distribution between the partial images can be improved.
Further, the area of the overlapping part between two adjacent partial images in the image to be adjusted is one half of the area of the partial images.
Referring to fig. 3, fig. 3 is a block diagram of an electronic device according to an embodiment of the present application, where the electronic device 300 includes: at least one processor 301, at least one communication interface 302, at least one memory 303, and at least one communication bus 304. Wherein the communication bus 304 is used for direct connection communication of these components, the communication interface 302 is used for signaling or data communication with other node devices, and the memory 303 stores machine readable instructions executable by the processor 301. When the electronic device 300 is in operation, the processor 301 and the memory 303 communicate via the communication bus 304, and the machine readable instructions when invoked by the processor 301 perform the tone mapping method described above.
For example, the processor 301 of the embodiment of the present application may implement the following method by reading a computer program from the memory 303 through the communication bus 304 and executing the computer program: step S101: and acquiring an image to be adjusted. Step S102: and establishing a global tone mapping model corresponding to the image to be adjusted. Step S103: image segmentation is carried out on the image to be adjusted to obtain a plurality of partial images, and a plurality of partial tone mapping models corresponding to the partial images are established. Step S104: and respectively fusing the global tone mapping model and each local tone mapping model to obtain a plurality of mixed tone mapping models. Step S105: for each local image, it is mapped to a corresponding local target image using a corresponding hybrid tone mapping model. Step S106: and fusing the multiple local target images to obtain a target image.
The processor 301 includes one or more, which may be an integrated circuit chip, having signal processing capabilities. The processor 301 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a micro control unit (Micro Controller Unit, MCU), a network processor (Network Processor, NP), or other conventional processor; but may also be a special purpose processor including a Neural Network Processor (NPU), a graphics processor (Graphics Processing Unit GPU), a digital signal processor (Digital Signal Processor DSP), an application specific integrated circuit (Application Specific Integrated Circuits ASIC), a field programmable gate array (Field Programmable Gate Array FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. Also, when the processor 610 is plural, some of them may be general-purpose processors, and another may be special-purpose processors.
The Memory 303 includes one or more, which may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), and the like.
It is to be understood that the configuration shown in fig. 3 is merely illustrative, and that electronic device 300 may also include more or fewer components than those shown in fig. 3, or have a different configuration than that shown in fig. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination thereof. In this embodiment of the present application, the electronic device 300 may be, but is not limited to, a physical device such as a desktop, a notebook, a smart phone, an intelligent wearable device, a vehicle-mounted device, or a virtual device such as a virtual machine. In addition, the electronic device 300 is not necessarily a single device, and may be a combination of a plurality of devices, for example, a server cluster, or the like.
The present application also provides a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising computer program instructions which, when executed by a computer, are capable of performing the steps of the tone mapping method of the above embodiments, for example comprising: acquiring an image to be adjusted; the value range of the pixel value in the image to be adjusted is a first value range, the value range of the pixel value in the target image corresponding to the image to be adjusted is a second value range, and the first value range is larger than the second value range; establishing a global tone mapping model corresponding to the image to be adjusted; image segmentation is carried out on the image to be adjusted to obtain a plurality of partial images, and a plurality of partial tone mapping models corresponding to the partial images are established; wherein the global tone mapping model and the local tone mapping model are both used for mapping pixel values in the first value range to pixel values in the second value range; respectively fusing the global tone mapping model and each local tone mapping model to obtain a plurality of mixed tone mapping models; for each local image, mapping the local image into a corresponding local target image by utilizing the corresponding mixed tone mapping model; and fusing the partial target images to obtain the target image.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM) random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. A tone mapping method, comprising:
acquiring an image to be adjusted; the value range of the pixel value in the image to be adjusted is a first value range, the value range of the pixel value in the target image corresponding to the image to be adjusted is a second value range, and the first value range is larger than the second value range;
establishing a global tone mapping model corresponding to the image to be adjusted;
image segmentation is carried out on the image to be adjusted to obtain a plurality of partial images, and a plurality of partial tone mapping models corresponding to the partial images are established;
respectively fusing the global tone mapping model and each local tone mapping model to obtain a plurality of mixed tone mapping models;
for each local image, mapping the local image into a corresponding local target image by utilizing the corresponding mixed tone mapping model;
And fusing the partial target images to obtain the target image.
2. The tone mapping method according to claim 1, wherein the global tone mapping model and the local tone mapping model are identical in structure.
3. The tone mapping method of claim 2, wherein the global tone mapping model and the local tone mapping model are piecewise linear functions, and the global tone mapping model and the local tone mapping model are identical in piecewise manner for the first range of values.
4. A tone mapping method according to claim 3, wherein said fusing the global tone mapping model with each local tone mapping model to obtain a plurality of hybrid tone mapping models, respectively, comprises:
and fusing each section of linear function in the global tone mapping model with a corresponding section of linear function in the local tone mapping model to obtain a corresponding section of linear function in the mixed tone mapping model.
5. The tone mapping method according to claim 3 or 4, wherein said building a global tone mapping model corresponding to said image to be adjusted comprises:
Constructing a global histogram according to the image to be adjusted and the segmentation mode; the global histogram comprises a plurality of segments of pixel value ranges and brightness distribution probabilities corresponding to each segment of pixel value range, wherein the brightness distribution probabilities corresponding to each segment of pixel value range refer to the probabilities that the pixel values in the image to be adjusted fall into the segment of pixel range;
determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; wherein each slope is proportional to a probability of a luminance distribution corresponding to the segment of the pixel value range;
determining the global tone mapping model from the plurality of slopes;
and/or, the establishing a plurality of local tone mapping models corresponding to the plurality of local images includes:
constructing a local histogram according to the local image and the segmentation mode for each local image; the local histogram comprises a plurality of sections of pixel value ranges and brightness distribution probabilities corresponding to each section of pixel value range, wherein the brightness distribution probabilities corresponding to each section of pixel value range refer to the probabilities that pixel values in the local image fall into the section of pixel value range;
Determining the slope of a linear function of the global tone mapping model on each section of pixel value range according to the global histogram, and obtaining a plurality of slopes altogether; the multiple slopes enable the mean square error between the contrast of the local image and the contrast of a local mapping image to be minimum, and the local mapping image is an image obtained after the local image is mapped based on the local mapping model;
the local tone mapping model is determined from the plurality of slopes.
6. The tone mapping method according to any one of claims 1 to 5, wherein the image segmentation of the image to be adjusted to obtain a plurality of partial images includes:
and dividing the image to be adjusted in a sliding window mode to obtain the partial images.
7. The tone mapping method according to claim 6, wherein there is an overlap between two of the partial images segmented from adjacent regions in the image to be adjusted.
8. A computer program product comprising computer program instructions which, when read and executed by a processor, perform the method of any of claims 1-7.
9. An electronic device, comprising: a processor, a memory, and a bus;
the processor and the memory complete communication with each other through the bus;
the memory stores computer program instructions executable by the processor, the processor invoking the computer program instructions to perform the method of any of claims 1-7.
10. A computer readable storage medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1-7.
CN202111619304.2A 2021-12-27 2021-12-27 Tone mapping method, computer program product, electronic device, and storage medium Pending CN116362981A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111619304.2A CN116362981A (en) 2021-12-27 2021-12-27 Tone mapping method, computer program product, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111619304.2A CN116362981A (en) 2021-12-27 2021-12-27 Tone mapping method, computer program product, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN116362981A true CN116362981A (en) 2023-06-30

Family

ID=86910345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111619304.2A Pending CN116362981A (en) 2021-12-27 2021-12-27 Tone mapping method, computer program product, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN116362981A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116894795A (en) * 2023-09-11 2023-10-17 归芯科技(深圳)有限公司 Image processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116894795A (en) * 2023-09-11 2023-10-17 归芯科技(深圳)有限公司 Image processing method and device
CN116894795B (en) * 2023-09-11 2023-12-26 归芯科技(深圳)有限公司 Image processing method and device

Similar Documents

Publication Publication Date Title
EP3937124A1 (en) Image processing method, device and apparatus, and storage medium
CN112990211B (en) Training method, image processing method and device for neural network
CN110163188B (en) Video processing and method, device and equipment for embedding target object in video
Xiao et al. Single image dehazing based on learning of haze layers
CN115205150A (en) Image deblurring method, device, equipment, medium and computer program product
CN113592726A (en) High dynamic range imaging method, device, electronic equipment and storage medium
CN112419326A (en) Image segmentation data processing method, device, equipment and storage medium
WO2023279799A1 (en) Object identification method and apparatus, and electronic system
CN115577768A (en) Semi-supervised model training method and device
CN110827341A (en) Picture depth estimation method and device and storage medium
CN116797504A (en) Image fusion method, electronic device and storage medium
CN116362981A (en) Tone mapping method, computer program product, electronic device, and storage medium
CN114708172A (en) Image fusion method, computer program product, storage medium, and electronic device
CN114708173A (en) Image fusion method, computer program product, storage medium, and electronic device
CN113706550A (en) Image scene recognition and model training method and device and computer equipment
CN117095019A (en) Image segmentation method and related device
CN115115552B (en) Image correction model training method, image correction device and computer equipment
CN116309050A (en) Image super-resolution method, program product, storage medium and electronic device
CN113591838B (en) Target detection method, device, electronic equipment and storage medium
CN115249269A (en) Object detection method, computer program product, storage medium, and electronic device
CN114708143A (en) HDR image generation method, equipment, product and medium
CN114648604A (en) Image rendering method, electronic device, storage medium and program product
Huang et al. An efficient single image enhancement approach using luminance perception transformation
CN113869325A (en) Image processing method, apparatus, device and medium
CN117274761B (en) Image generation method, device, electronic equipment and 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