Invention content
The technical problems to be solved by the invention are to provide a kind of segmentation exposure image high dynamic restoration methods and system, extensive
The droop that segmentation exposure introduces is eliminated while multiple high-dynamics image, without additional correction.
To solve the above problems, the present invention proposes a kind of segmentation exposure image high dynamic restoration methods, include the following steps:
S1:Obtain the section of the exposure sections of each pixel brightness value Vli and second of section last time of exposure T1 of the first exposure section
Each pixel brightness value Vi of last time of exposure T, i=1~n, n are the quantity of pixel, and the first exposure section is prior to second
Expose section;
S2:The slope value K of the corresponding current light intensity of each pixel is calculated, wherein, K=(Vi-Vli)/(T-T1);
S3:According to each slope value K and the total exposure time T of two exposure sections, the current pixel of each pixel is calculated
Brightness value Vxi=K*T;
S4:According to first exposure section average overexposure value determine an overexposure comparison range, to each pixel brightness value Vli into
Row multilevel iudge:
If pixel brightness value Vli does not reach the minimum value of the overexposure comparison range, final pixel brightness value Voi=Vi;
If pixel brightness value Vli is more than the maximum value of the overexposure comparison range, final pixel brightness value Voi=Vxi;
If pixel brightness value Vli in the overexposure comparison range, carries out fuzzy Judgment its tendency situation, according to tendency feelings
Condition determines final pixel brightness value Voi=Vi or final pixel brightness value Voi=Vxi.
According to one embodiment of present invention,
When entire exposure image process is divided into two sections, then in the step S1, this two exposure sections, the first exposure are chosen
The section of section last time of exposure T1 is the time of exposure of waypoint, and second exposes section last time of exposure T of section to complete the time of exposure,
Restore to complete after performing step S2-S4;
When exposing number of fragments more than two sections, two exposure sections are chosen from back to front and perform step S1-S4, based on recovery
Pixel brightness value afterwards, move forward one exposure section and choose it is corresponding two exposure section perform step S1-S4, and so on until
All exposure section is restored to complete.
According to one embodiment of present invention, step S5 is further included, by way of gamma mapping curves, will have been restored
The size compression of high-dynamics image after is mapped in the range of the bit wide of output.
According to one embodiment of present invention, in the step S4, the overexposure comparison range is VfA~Vf+A, and Vf is
The average overexposure value of first exposure section, A are luminance deviation value.
According to one embodiment of present invention, the average overexposure value of the first exposure section is obtained for off-line test, brightness
The value range of deviation A is 0~20.
According to one embodiment of present invention, in the step S4, carrying out fuzzy Judgment, it is inclined to situation, according to tendency feelings
Condition determines final pixel brightness value Voi=Vi or final pixel brightness value Voi=Vxi, including:
Centered on the pixels of pixel brightness value Vli in the overexposure comparison range, certain area is chosen;
The regional average value Vm of each pixel brightness value Vi in the region and each current pixel brightness value are calculated respectively
The mean value Vxm of Vxi;
The absolute value of the difference and Vs of each pixel brightness value Vi and its mean value Vxm and each is calculated in the region respectively
The absolute value of the difference and Vxs of current pixel brightness value Vxi and its mean value Vxm;
Judged, if Vxs < Vs, Vo=Vxi, on the contrary Vo=Vi.
According to one embodiment of present invention, selected regional extent is to be compared with pixel brightness value Vli in the overexposure
In the range of the pixel centered on MxN pixel composition region, the equal value of M, the N be 3~5.
According to one embodiment of present invention, pixel brightness value acquired in the step S1 obtains in the following manner
:During exposure image, in the section of the non-final exposure section for the completing exposure last time of exposure, each pixel at the moment is acquired
It is stored after brightness value;And it is bright to acquire each pixel at the moment in the section last time of exposure for the exposure section for being finally completed exposure
After angle value, the pixel brightness value of storage is obtained together, enters step in S2 and performs.
Exposure image high dynamic recovery system is segmented the present invention also provides a kind of, including:
Pixel brightness value acquisition module:Perform each pixel brightness value for section last time of exposure T1 for obtaining the first exposure section
Each pixel brightness value Vi of section last time of exposure T of the exposure sections of Vli and second, i=1~n, n are the quantity of pixel, described
First exposure section is prior to the second exposure section;
Slope value computing module:The slope value K for calculating the corresponding current light intensity of each pixel is performed, wherein, K=(Vi-
Vli)/(T-T1);
Current pixel brightness value computing module:The total exposure time T according to each slope value K and two exposure sections is performed,
Calculate the current pixel brightness value Vxi=K*T of each pixel;
Recovery module:It performs and an overexposure comparison range is determined according to the average overexposure value of the first exposure section, to each pixel
Brightness value Vli is compared judgement:
If pixel brightness value Vli does not reach the minimum value of the overexposure comparison range, final pixel brightness value Voi=Vi;
If pixel brightness value Vli is more than the maximum value of the overexposure comparison range, final pixel brightness value Voi=Vxi;
If pixel brightness value Vli in the overexposure comparison range, carries out fuzzy Judgment its tendency situation, according to tendency feelings
Condition determines final pixel brightness value Voi=Vi or final pixel brightness value Voi=Vxi.
According to one embodiment of present invention, it further includes:
Curve mapping unit is performed by way of gamma mapping, by the big of the high-dynamics image after the completion of recovery
Small compression is mapped in the range of the bit wide of output.
After adopting the above technical scheme, the present invention has the advantages that compared with prior art:
In the present invention, by the pixel brightness value of the section of the two exposure sections last time of exposure, the processing of linear exposure is carried out,
The current pixel brightness value considered based on linear exposure is obtained, and the pixel of the section for passing through the first exposure section last time of exposure is bright
Angle value judge pixel whether overexposure, and ambiguity is further judged, it is corresponding linear so as to be carried out to overexposure situation
Processing, final pixel brightness value cause high-dynamics image to be restored, simultaneously as the recovery of high-dynamics image also therewith will
The droop that segmentation exposure introduces is to eliminating, without additional correction.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, below in conjunction with the accompanying drawings to the present invention
Specific embodiment be described in detail.
Many details are elaborated in the following description in order to fully understand the present invention.But the present invention can be with
Much implement different from other manner described here, those skilled in the art can be in the situation without prejudice to intension of the present invention
Under do similar popularization, therefore the present invention is not limited to the specific embodiments disclosed below.
Referring to Fig. 1, in one embodiment, exposure image high dynamic restoration methods are segmented, are included the following steps:
S1:Obtain the section of the exposure sections of each pixel brightness value Vli and second of section last time of exposure T1 of the first exposure section
Each pixel brightness value Vi of last time of exposure T, i=1~n, n are the quantity of pixel, and the first exposure section is prior to second
Expose section;
S2:The slope value K of the corresponding current light intensity of each pixel is calculated, wherein, K=(V-V1)/(T-T1);
S3:According to each slope value K and the total exposure time T of two exposure sections, the current pixel of each pixel is calculated
Brightness value Vxi=K*T;
S4:According to first exposure section average overexposure value determine an overexposure comparison range, to each pixel brightness value Vli into
Row multilevel iudge:
If pixel brightness value Vli does not reach the minimum value of the overexposure comparison range, final pixel brightness value Voi=Vi;
If pixel brightness value Vli is more than the maximum value of the overexposure comparison range, final pixel brightness value Voi=Vxi;
If pixel brightness value Vli in the overexposure comparison range, carries out fuzzy Judgment its tendency situation, according to tendency feelings
Condition determines final pixel brightness value Voi=Vi or final pixel brightness value Voi=Vxi.
Expansion description is carried out, but should not be with this to the segmentation exposure image high dynamic restoration methods of the embodiment of the present invention below
As limitation.
The segmentation exposure image high dynamic restoration methods of the embodiment of the present invention are applicable to the figure using segmentation Exposure mode
As sensor, point two exposure or (three sections or more) exposures of multistage can be divided into, it is specific unlimited.It can solve segmentation exposure process
The exposure value when closing at waypoint of middle appearance may maintain an equal level a period of time, and the restricted technology of high dynamic range is caused to be asked
Topic so that high-dynamics image is restored.
In step sl, it since this method exposes section unfolding calculation both for two every time, thus first obtains and calculates
The corresponding data of two required exposure sections:Obtain each pixel brightness value Vli of section last time of exposure T1 of the first exposure section
And second exposure section section last time of exposure T each pixel brightness value Vi, i=1~n, n are the quantity of pixel.
The first exposure section is prior to the second exposure section.Such as in the case where entire exposure process is divided into two sections,
0-T1 is the first exposure section, and T1-T is the second exposure section, and total exposure time T, overall exposing is completed under moment T.And whole
In the case that a exposure process is divided into multistage, T1-T is still the second exposure section, and the first exposure Duan Ze is according to waypoint T1 and preceding
One waypoint moment determines.
Each pixel brightness value Vli and each pixel brightness value Vi can be stored first after collection, Ran Houbu
Corresponding data can be obtained from memory, and then enter in follow-up step and calculated in rapid S1.
Preferably, pixel brightness value acquired in the step S1 obtains in the following manner:During exposure image,
In the section of the non-final exposure section for the completing exposure last time of exposure, stored after acquiring each pixel brightness value at the moment;
And after acquiring each pixel brightness value at the moment in the section last time of exposure for the exposure section for being finally completed exposure, it obtains deposit together
The pixel brightness value of storage, enters step in S2 and performs.RAM can be stored in, and (random access memory, arbitrary access are deposited
Reservoir) in.By the first storage first sampled, and calculating is just directly entered when the data sampling that the moment is completed in exposure is completed, it can
To reduce read-write consumption, speed up processing promotes the real-time that high-dynamics image restores.
For example, in the case where exposure section is two sections, in exposure process, when the section last time of exposure to the first exposure section
During T1, each pixel brightness value Vli at the moment is acquired, and is stored in memory, and when the section to the second exposure section
During last time of exposure T, each pixel brightness value Vi at the moment is acquired, and by each pixel brightness value Vli mono- from memory
And it obtains and out enters step S2 execution.Certainly, in the case where exposure section is multistage, former sections of the last time of exposure acquisition of section
Pixel brightness value all stored, until the section of the final stage last time of exposure acquired after the leading portion of acquisition successively pixel
Brightness value enters step S2 execution.
Then step S2 is performed, for each pixel Vi at T moment, it is corresponding the T1 moment can be read from memory
The pixel value Vli of pixel the considerations of for linear exposure, can calculate the slope value of the corresponding current light intensity of each pixel
K, wherein, K=(Vi-Vli)/(T-T1).During this, each pixel of entire image can be directed to by way of traversal
It is calculated, obtains the current light intensity slope value of each pixel.
Then step S3 is performed, according to each slope value K and the total exposure time T of two exposure sections, calculates each pixel
The current pixel brightness value Vxi=K*T of point.These current pixel brightness values Vxi is determining based on linear exposure, thus such as
It, can be by current pixel brightness value Vxi come to this saturation feelings when exposure value saturation occurs at strong light, waypoint in fruit
Condition is restored, thus requires consideration for how automatic rapidly differentiation saturation and unsaturated situation, and the embodiment of the present invention passes through step
Rapid S4 solves the problems, such as this.
Then step S4 is performed, an overexposure comparison range is determined according to the average overexposure value of the first exposure section, to each picture
Plain brightness value V1i is compared judgement, determines final pixel brightness value according to judging result, overexposure comparison range is its minimum
The interval range that value and maximum value are limited.This judgement is to be directed to each pixel brightness value V1i, thus can traverse these pictures
Plain brightness value V1i is judged and is handled.
If pixel brightness value V1i does not reach the minimum value of the overexposure comparison range, final pixel brightness value Voi=Vi;
Pixel brightness value V1i is less than the minimum value of overexposure comparison range, illustrates that overexposure does not occur in it, nor non-linear value, thus
Final pixel brightness value can be set as to the pixel brightness value Vi that the sampling of moment T is completed in exposure.
If pixel brightness value V1i is more than the maximum value of the overexposure comparison range, final pixel brightness value Voi=Vxi;Picture
Plain brightness value V1i be less than overexposure comparison range maximum value, illustrate that overexposure has occurred in it, by final pixel brightness value be set as through
The current pixel brightness value Vxi that linear process is crossed.
If pixel brightness value V1i in the overexposure comparison range, carries out fuzzy Judgment its tendency situation, according to tendency feelings
Condition determines final pixel brightness value Voi=Vi or final pixel brightness value Voi=Vxi.Pixel brightness value V1i is in the overexposure ratio
When compared in the range of, illustrate that its value for non-linear value, needs linearly to be corrected, fuzzy judgement can be carried out to it, if the value is more
Close to linear processed current pixel brightness value Vxi, then final pixel brightness value Voi=Vxi, and if the value closer to
The pixel brightness value Vi of moment T sampling is completed in exposure, then final pixel brightness value Voi=Vi.
In this way, when exposure is divided into two sections, the high-dynamics image after being restored at this time, and expose a point non-multistage
When, then it is the recovery for selected two sections realization high-dynamics images.
Preferably, in the step S4, the overexposure comparison range is Vf A~Vf+A, and Vf is being averaged for the first exposure section
Overexposure value, A are luminance deviation value.That is, the minimum value of overexposure comparison range is Vf A, maximum value is Vf+A.
Optionally, the average overexposure value of the first exposure section is obtained for off-line test, can first be deposited test result
Storage is then obtained and is calculated;The value range of luminance deviation value A is 0~20, this 0~20 is in pixel intensity value 0~255
0~20.
Preferably, in the step S4, carrying out fuzzy Judgment, it is inclined to situation, determines that final pixel is bright according to tendency situation
Angle value Voi=Vi or final pixel brightness value Voi=Vxi, further comprises the steps:
Centered on the pixels of pixel brightness value V1i in the overexposure comparison range, certain area is chosen;
The regional average value Vm of each pixel brightness value Vi in the region and each current pixel brightness value are calculated respectively
The mean value Vxm of Vxi;
(section last time of exposure T of second exposure section) each pixel brightness value Vi and its mean value are calculated in the region respectively
The absolute value of the difference and Vs of Vxm and (calculating each pixel) each current pixel brightness value Vxi and its mean value Vxm
Absolute value of the difference and Vxs;
Judged, if Vxs < Vs, Vo=Vxi, on the contrary Vo=Vi.
Preferably, selected regional extent is the pixel in the overexposure comparison range with pixel brightness value V1i
Centered on MxN pixel composition region, the equal value of M, the N be 3~5.Referring to Fig. 4, P (y, x) is pixel brightness value V1i
The pixel in the overexposure comparison range, M and the equal values of N are 3, three rows, three row pixel using centered on P (y, x) as
Selected region.
When entire exposure image process is divided into two sections, then in the step S1, this two exposure sections (two altogether are chosen
Section is exposed, thus has been performed successively so as to step S1-S4), section last time of exposure T1 of the first exposure section is waypoint
The time of exposure, section last time of exposure T of the second exposure section restore to complete to complete the time of exposure after performing step S2-S4.
When exposing number of fragments more than two sections, two exposure sections are chosen from back to front and perform step S1-S4, based on recovery
Pixel brightness value afterwards, move forward one exposure section and choose it is corresponding two exposure section perform step S1-S4, and so on until
All exposure section is restored to complete.That is, when performing step S1-S4 for the first time, selected two exposure sections are exposures
Most latter two exposure section in the process, and when performing step S1-S4 second, selected two exposure sections are in exposure process
Second-to-last exposes section and 3rd exposure section reciprocal, it is follow-up in and so on ground toward one exposure section of Forward, until all exposing
Light section is processed, that is, completes the recovery of high-dynamics image.
In one embodiment, referring to Fig. 3, on the basis of previous embodiment, it is segmented exposure image high dynamic recovery side
Method further includes step S5, and by way of gamma mapping curves, the size of the high-dynamics image after the completion of recovery is compressed mapping
To in the range of the bit wide of output.High-dynamics image is compressed by way of curve, effect due to original linear compression mode,
Image high dynamic range compression can be achieved.
Exposure image high dynamic recovery system is segmented the present invention also provides a kind of, including:
Pixel brightness value acquisition module:Perform each pixel brightness value for section last time of exposure T1 for obtaining the first exposure section
Each pixel brightness value Vi of section last time of exposure T of the exposure sections of V1i and second, i=1~n, n are the quantity of pixel, described
First exposure section is prior to the second exposure section;
Slope value computing module:The slope value K for calculating the corresponding current light intensity of each pixel is performed, wherein, K=(Vi-
V1i)/(T-T1);
Current pixel brightness value computing module:The total exposure time T according to each slope value K and two exposure sections is performed,
Calculate the current pixel brightness value Vxi=K*T of each pixel;
Recovery module:It performs and an overexposure comparison range is determined according to the average overexposure value of the first exposure section, to each pixel
Brightness value V1i is compared judgement:
If pixel brightness value V1i does not reach the minimum value of the overexposure comparison range, final pixel brightness value Voi=Vi;
If pixel brightness value V1i is more than the maximum value of the overexposure comparison range, final pixel brightness value Voi=Vxi;
If pixel brightness value V1i in the overexposure comparison range, carries out fuzzy Judgment its tendency situation, according to tendency feelings
Condition determines final pixel brightness value Voi=Vi or final pixel brightness value Voi=Vxi.
According to one embodiment of present invention, it further includes:
Curve mapping unit is performed by way of gamma mapping, by the big of the high-dynamics image after the completion of recovery
Small compression is mapped in the range of the bit wide of output.
The particular content of segmentation exposure image high dynamic recovery system about the embodiment of the present invention may refer to aforementioned reality
The description as described in segmentation exposure image high dynamic restoration methods part in example is applied, details are not described herein.
Although the present invention is disclosed as above with preferred embodiment, it is not for limiting claim, any this field
Technical staff without departing from the spirit and scope of the present invention, can make possible variation and modification, therefore the present invention
Protection domain should be subject to the range that the claims in the present invention are defined.