A kind of removal infrared image flashing Histogram Mapping method
Technical field
The present invention relates to infrared image processing technology fields, and in particular to a kind of removal infrared image flashing Histogram Mapping
Method.
Background technique
Existing common infrared camera generally detects the illumination intensity of local environment using light-sensitive element, according to
The threshold value determined in design parameter generates control signal, realizes the unlatching of infrared lamp: infrared when illumination intensity is lower than threshold value
Lamp, which is opened, to shine, and then closes when higher than threshold value.Wherein, the case where when illumination intensity is slightly less than threshold value: light-sensitive element detects photograph
Bright intensity is slightly less than threshold value, and control infrared lamp, which is opened, to shine;After infrared lamp shines, the illumination detected, which improves, (be added reversed
Infrared light back), and be more than threshold value, control infrared lamp is closed;Lead to the luminance reduction detected, another secondary control is red
Outer lamp is opened.Do not stop and so on, causes the flashing of image;Therefore in order to obtain high quality graphic, need to infrared image into
The processing of row blink-off.And image histogram is since to calculate cost smaller for it, and has image translation, rotation, scaling invariance etc.
Many merits are widely used in the every field of image procossing, therefore existing frequently with the methods of image histogram equalization
Blink-off processing is carried out to image.
Existing video image blink-off method further include: in such a way that threshold value is set, the image of present frame is carried out
Processing handles current frame image mapping table by the Histogram Mapping table to previous frame image, however when video image display
Substantially multiframe still image continuously displays process, and therefore, existing blink-off processing method does not consider adjacent multiframe figure
Relevance as between, causes image procossing precision not high, poor reliability;Furthermore when image background changes, existing skill
Art cannot in time handle it to the variation, cause treatment effect still undesirable.
Summary of the invention
Undesirable for solution removal flicker effect of the existing technology, the technical problems such as poor reliability, the present invention provides
A kind of removal infrared image flashes Histogram Mapping method.This method is directly handled histogram, can be carried on the back to image
Scape transformation, which is made, to be timely responded to and handles, and image displaying quality is improved.
The present invention is achieved through the following technical solutions:
A kind of removal infrared image flashing Histogram Mapping method, method includes the following steps:
Step 1: obtain the histogram of n-th frame image according to the histogram of preceding n frame image, wherein 1≤n≤N and n is positive
Integer, N are the totalframes of image;
Step 2: the histogram to n-th frame image carries out enhancing processing, the Histogram Mapping table of current frame image is obtained,
Realtime graphic is exported according to the Histogram Mapping table of current frame image.
In the present embodiment, when n takes 1, then the histogram L of the 1st frame image is counted1, filter is setLn2=
L1, Ln3=L1It is calculate by the following formula the histogram L of the 1st frame image after being filtered1'=(L1+Ln1+Ln2+Ln3)/4。
Further, in the present embodiment, as n >=2, then the histogram L of n-th frame image is countedn, filter is setLn2=Ln1, Ln3=Ln2 are calculate by the following formula to obtain the histogram L of n-th frame imagen'=(Ln+Ln1+Ln2+
Ln3)/4。
Further, image enhancement processing is carried out using histogram equalization mode.
The present invention has the advantage that and the utility model has the advantages that
For the present invention is compared to existing removal image flicker technology, directly the histogram of image is handled, energy
Enough make to the variation of image background timely responds to and handles, so that removal flicker effect is good;Simultaneously invention also contemplates that more
Relevance between frame image, improves picture quality.And treatment process of the invention is more succinct, calculation amount is small, convenient for hard
Part is realized.
Detailed description of the invention
Attached drawing described herein is used to provide to further understand the embodiment of the present invention, constitutes one of the application
Point, do not constitute the restriction to the embodiment of the present invention.In the accompanying drawings:
Fig. 1 is mapping method schematic diagram of the invention.
Fig. 2 is using treatment effect of the present invention and to use prior art treatment effect comparison diagram.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below with reference to embodiment and attached drawing, to this
Invention is described in further detail, and exemplary embodiment of the invention and its explanation for explaining only the invention, are not made
For limitation of the invention.
Embodiment 1
A kind of removal infrared image flashing Histogram Mapping method is present embodiments provided, this method following steps:
Step 1: obtain the histogram of n-th frame image according to the histogram of preceding n frame image, wherein 1≤n≤N and n is positive
Integer, N are the totalframes of image;
In the present embodiment, when n takes 1, then the histogram L of the 1st frame image is counted1, filter is setLn2=
L1, Ln3=L1It is calculate by the following formula the histogram L of the 1st frame image after being filtered1'=(L1+Ln1+Ln2+Ln3)/4;When n >=
When 2, then the histogram L of n-th frame image is countedn, filter is setLn2=Ln1, Ln3=Ln2 pass through following formula meter
Calculation obtains the histogram L of n-th frame imagen'=(Ln+Ln1+Ln2+Ln3)/4。
Step 2: the histogram to n-th frame image carries out enhancing processing, the Histogram Mapping table of current frame image is obtained,
Realtime graphic is exported according to the Histogram Mapping table of current frame image.
In the present embodiment, image enhancement processing is carried out using histogram of the histogram equalization mode to n-th frame image, it will
Enhancing treated Histogram Mapping obtains the Histogram Mapping table of current frame image, according to current frame image to 0~255
Histogram Mapping table exports realtime graphic.
Embodiment 2
The 1 removal infrared image proposed flashes Histogram Mapping method to the present embodiment 2 based on the above embodiment, specifically gives
The process that is handled 6 frame images as shown in Figure 1 is as follows:
2.1 obtain the 1st frame image, and count the histogram of current frame image, obtain the histogram L of the 1st frame image1If
Set filterLn2=L1, Ln3=L1It is calculate by the following formula to obtain the filtering histogram L of the 1st frame image1'=(L1+
Ln1+Ln2+Ln3)/4;In the present embodiment, the histogram of the 1st frame image i.e. histogram of the 1st frame image after filtering, then to
The filtering histogram of 1 frame image carries out image enhancement processing using histogram equalization method, and is mapped to 0~255, obtains the
1 frame image mapping table exports realtime graphic according to the 1st frame image mapping table.
2.2 obtain the 2nd frame image, and count the histogram of current frame image, obtain the histogram L of the 2nd frame image2If
Set filterLn2=Ln1, Ln3=Ln2 are calculate by the following formula to obtain the histogram L of the 2nd frame image2'=(L2+
Ln1+Ln2+Ln3)/4。
Then image enhancement processing is carried out using histogram equalization method to the filtering histogram of the 2nd frame image, and reflected
It is mapped to 0~255, obtains the 2nd frame image mapping table, realtime graphic is exported according to the 2nd frame image mapping table.
2.3 obtain the 3rd frame image, and count the histogram of current frame image, obtain the histogram L of the 3rd frame image3If
Set filterLn2=Ln1, Ln3=Ln2 are calculate by the following formula to obtain the histogram L of the 3rd frame image3'=(L3+
Ln1+Ln2+Ln3)/4。
Then image enhancement processing is carried out using histogram equalization method to the filtering histogram of the 3rd frame image, and reflected
It is mapped to 0~255, obtains the 3rd frame image mapping table, realtime graphic is exported according to the 3rd frame image mapping table.
2.4 obtain the 4th frame image, and count the histogram of current frame image, obtain the histogram L of the 4th frame image4If
Set filterLn2=Ln1, Ln3=Ln2 are calculate by the following formula to obtain the histogram L of the 4th frame image4'=(L4+
Ln1+Ln2+Ln3)/4。
Then image enhancement processing is carried out using histogram equalization method to the filtering histogram of the 4th frame image, and reflected
It is mapped to 0~255, obtains the 4th frame image mapping table, realtime graphic is exported according to the 4th frame image mapping table.
2.5 obtain the 5th frame image, and count the histogram of current frame image, obtain the histogram L of the 5th frame image5If
Set filterLn2=Ln1, Ln3=Ln2 are calculate by the following formula to obtain the histogram L of the 5th frame image5'=(L5+
Ln1+Ln2+Ln3)/4。
Then image enhancement processing is carried out using histogram equalization method to the filtering histogram of the 5th frame image, and reflected
It is mapped to 0~255, obtains the 5th frame image mapping table, realtime graphic is exported according to the 5th frame image mapping table.
2.6 obtain the 6th frame image, and count the histogram of current frame image, obtain the histogram L of the 6th frame image6If
Set filterLn2=Ln1, Ln3=Ln2 are calculate by the following formula to obtain the histogram L of the 6th frame image6'=(L6+
Ln1+Ln2+Ln3)/4。
Then image enhancement processing is carried out using histogram equalization method to the filtering histogram of the 6th frame image, and reflected
It is mapped to 0~255, obtains the 6th frame image mapping table, realtime graphic is exported according to the 6th frame image mapping table.
Embodiment 3
The removal infrared image flashing Histogram Mapping method and existing that the present embodiment 3 is proposed using above-described embodiment
It removes image flicker method and blink-off processing is carried out to same infrared image, output treated image, as shown in Figure 2, wherein
(left side) figure is the image that processing output is carried out using infrared image flashing Histogram Mapping method of the invention, and (right side) figure is to use
The prior art carries out the image of processing output, and as shown in Figure 2, the display display effect of (left side) figure is substantially better than (right side) figure, shows
Blink-off better effect of the invention.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects
It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention
Protection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.