Embodiment
The embodiment of the invention provides a kind of peaking method and device based on many bands bandpass filtering, is used for image is carried out sharpening, obtains picture clearly.
See also Fig. 1, the embodiment for a kind of peaking method based on many bands bandpass filtering of the embodiment of the invention comprises:
101, first luminance signal is carried out graphical analysis and be with bandpass filtering treatment to obtain a plurality of second luminance signals more;
By interlacing scan or line by line scan and can obtain picture signal, in picture signal, obtain first luminance signal again, this luminance signal can be the Y in the YUV model, the V in the HSV model, the luminance signal in the I in the HIS model or other the data model.
First luminance signal in the picture signal that gets access to is imported in a plurality of band pass filters simultaneously, carried out many band bandpass filtering treatment, obtain the second luminance signal BPF (k) (i.e. k second luminance signal) on a plurality of different frequency ranges.
It then is for edge details different in the differentiate between images that frequency-division section carries out bandpass filtering treatment to luminance signal, and different edge details is handled respectively.The present invention uses many band band pass filters to carry out the bandpass filtering treatment of multiband, for example: divide three frequency ranges to carry out bandpass filtering in the horizontal direction, be with more band pass filter frequency band division as shown in Figure 6, wherein, A1, A2 and A3 represent three frequency ranges respectively.The bandwidth of A1 is the highest, allows in the luminance signal part of high frequency to pass through, and the bandwidth of A2 is in middle high section, the inclined to one side stage casing of the bandwidth of A3.Also can divide a plurality of frequency ranges to carry out bandpass filtering at vertical direction, or carry out bandpass filtering in level and vertical direction with a plurality of frequency ranges of time-division.
Simultaneously, first luminance signal is carried out graphical analysis, can extract the characteristic information of image, obtain the output of graphical analysis.First luminance signal is added up the maximum maxstep in the absolute value of the difference of maximum, minimum value and the neighbor point value of the brightness number of all pixels in the neighborhood that the size centered by current pixel point that obtains first luminance signal is N * M, wherein N and M are generally the integer more than or equal to 2.
102, determine the yield value of a plurality of second luminance signal correspondences;
According to the output information of a plurality of second luminance signals and graphical analysis, can obtain the yield value of a plurality of second luminance signal correspondences, the calculating of yield value is for the amplitude of adjusting second luminance signal, strengthens the definition of image.
103, use yield value respectively second luminance signal of correspondence to be carried out sharpening.
The Peaking method is a kind of method of image sharpening, is mainly used in the profile of outstanding image, strengthens the image brightness edge, makes image become more clear.
In embodiments of the present invention, be a kind of improvement to existing peaking method based on the peaking method of many bands bandpass filtering, a plurality of filters have been taked, obtained more band information, utilize the result of graphical analysis that yield value is calculated simultaneously, the yield value that can be fit to more can carry out sharpening respectively to the details of image like this and handle, and obtains distinct image.
To a plurality of modules based on the peaking method of many bands bandpass filtering be introduced respectively below, see also Fig. 2, be the edge filter in the embodiment of the invention graphical analysis and edge detection method, comprising:
201, obtain luminance matrix in first luminance signal;
In embodiments of the present invention, image is carried out extraction and the rim detection that graphical analysis has comprised characteristic value, the characteristic value of extracting comprises the maximum in the brightness value of pixel in the luminance matrix that gets access to, maximum in the absolute value of the difference of minimum value and neighbor pixel brightness value, characteristic value will be for calculating and the adjustment of yield value, and concrete operational mode will be described in detail in the computational methods of yield value.
Rim detection is used for judging whether pixel belongs to marginal point, before carrying out rim detection, carry out edge filter to first luminance signal, and the result of edge filter is carried out rim detection, obtains marginal information accurately.
Obtain luminance matrix in first luminance signal, luminance matrix is N * Metzler matrix that the neighborhood territory pixel point of the current pixel point of first luminance signal and current pixel point is formed, and wherein, M and N are the positive integer greater than 2.
202, utilize R direction matrix to carry out R the edge filter on the direction to luminance matrix and obtain R direction coefficient;
Can determine current pixel point corresponding direction coefficient on R direction according to luminance matrix and R direction matrix.In embodiments of the present invention, when being carried out the edge filter, luminance matrix need preset R direction matrix, R is more than or equal to 1, each direction matrix is the numerical matrix of N * M, wherein, numerical value is in order to calculate the gradient on certain edge direction in the direction matrix, after default R the direction matrix, again to R direction matrix execution in step successively: will the point of correspondence position in the point in should the direction matrix of direction and the luminance matrix be multiplied each other, and with taking absolute value after N * M the value addition of putting that obtains, obtain the direction coefficient of current pixel point on this direction.Can obtain R direction coefficient of R direction correspondence as stated above respectively.
In actual applications, R is 2 o'clock, generally choose horizontal direction and vertical direction, R is 4 o'clock, generally selects horizontal direction, vertical direction, 45 degree methods and 135 degree directions are understandable that the number of R and concrete direction are not limited to above description, choosing of R value and concrete direction can not done restriction herein according to the make an uproar requirement of precision and the performance for the treatment of facility of filter decides to image.
Need to prove that the computational methods of above-mentioned direction coefficient are a kind of in numerous methods, as the calculating of routine direction coefficient, the computational methods of choice direction coefficient as required do not limit herein in actual applications.
203, choose R the maximum in the direction coefficient as the current direction coefficient of current pixel point;
System obtains will to choose the current direction coefficient of R the maximum in the direction coefficient as current pixel point after the direction coefficient of luminance matrix on R direction.
204, judge according to current direction coefficient whether current pixel point is marginal point, if then execution in step 205;
Size to current direction coefficient and first threshold is judged, if current direction coefficient, determines then that current pixel point is the alternative marginal point that current direction coefficient counterparty makes progress more than or equal to first threshold, and the value of edge counter is set to 1; If current direction coefficient is less than first threshold, then current pixel point is not marginal point, continues next pixel is carried out rim detection.
First threshold is the parameter value of system intialization, and system arranges this parameter value according to the concrete condition of input picture.
205, obtain the direction of several neighborhood territory pixel points of current pixel point;
Step 205 is that detected alternative marginal point is further detected, and prevents that some noise signal is judged as marginal point, and has been carried out gain, makes that the noise spot in the picture is more outstanding.
This neighborhood neighbor pixel can be chosen in 8 pixels adjacent with current pixel point, for example can choose the left side of current pixel point, and is upper left, top and 4 upper right neighbor pixels, and direction is respectively level, 135 degree, vertical and 45 degree.Can determine the edge direction of neighbor pixel according to the direction coefficient of neighbor pixel.
206, compare the poor of edge direction, obtain the size of edge counter;
Obtain the size of current pixel point direction and the size of neighbor pixel direction, the current pixel point direction is carried out difference operation with the direction of adjacent vegetarian refreshments respectively, and statistics is less than or equal to the number of the difference of second threshold value, the numerical value of edge counter is added the number of the difference that is less than or equal to second threshold value.
If when choosing 4 neighbor pixels in the step 205, this second threshold value is traditionally arranged to be miter angle, if the difference of the direction of the direction of current pixel point and certain neighbor pixel is less than or equal to 45 degree, think that then current pixel point and this field pixel are continuous.In actual applications, can set second threshold value according to the complexity of input picture, not limit herein.
207, judge marginal point according to the edge counter.
Value and the 3rd threshold value of edge counter are compared, if the value of edge counter, determines then that current pixel point is marginal point more than or equal to the 3rd threshold value.If the value of edge counter, determines finally then that current pixel point is not marginal point less than the 3rd threshold value.
In actual applications, the 3rd threshold value can arrange according to the complexity of input picture, if the 3rd threshold value is set to 2, when the current pixel point that then has been judged to alternative marginal point links to each other with adjacent one pixel that has been judged to alternative marginal point at least, determine that just current pixel point is marginal point.
Need to prove in embodiments of the present invention, whether execution just might finish current pixel point is the further judgement of marginal point after step 204.If current direction coefficient is less than first threshold, then current pixel point is not marginal point, continuation is carried out rim detection to next pixel, current direction coefficient is more than or equal to first threshold, determine that then current pixel point is the alternative marginal point that current direction coefficient counterparty makes progress, need to continue to carry out step 207, judge further whether current pixel point is marginal point.
In embodiments of the present invention, step 201 to 204 is the Preliminary detection of current pixel point, and step 205 to 207 is the further detection of current pixel point, can prevent that like this noise spot is considered to marginal point and strengthens in Preliminary detection.
First luminance signal is carried out many band bandpass filterings obtain a plurality of second luminance signals, and first luminance signal is carried out graphical analysis obtain after the output information, to carry out gain process to a plurality of second luminance signals respectively, see also Fig. 3, for in the embodiment of the invention second luminance signal being carried out the schematic diagram of gain process, comprising:
301, obtain the brightness excursion;
When input picture is analyzed, first luminance signal is added up the maximum maxstep in the absolute value of the difference of maximum, minimum value and the neighbor point value of the brightness number of all pixels in the neighborhood that the size centered by current pixel point that will obtain first luminance signal is N * M, wherein N and M are generally the integer more than or equal to 2.In embodiments of the present invention, the difference of maximum and minimum value is brightness excursion range.
302, travel through a plurality of second luminance signals, obtain the positive negativity of a plurality of second luminance signals;
In embodiments of the present invention, will obtain the yield value of second luminance signal according to the positive negativity of second luminance signal.
303, calculate first yield value of a plurality of second luminance signals respectively;
In embodiments of the present invention, system will arrange the 3rd threshold value EDGE_COUNT_THD, the second gain parameter fsp_modulation, the first change threshold THD0, the second change threshold THD1.The 3rd threshold value EDGE_COUNT_THD is used for making comparisons with the value of edge counter, judge whether current pixel point is marginal point, the second gain parameter fsp_modulation is used for first yield value is adjusted, the first change threshold THD0 and the second change threshold THD1 are used for comparing to determine first yield value with the brightness excursion, simultaneously, be provided with positive direction gain parameter PB (i) _ gain0 and PB (i) _ gain1 respectively at a plurality of second luminance signals, negative direction gain parameter NB (i) _ gain0 and NB (i) _ gain1, a plurality of second luminance signals are carried out in proper order the calculating of first yield value, the first yield value G (i) with i second luminance signal is calculated as example below, describes the computational process of first yield value.
If i second luminance signal is greater than 0, and if the value of edge counter is more than or equal to the 3rd threshold value EDGE_COUNT_THD, then as brightness excursion range during greater than the second change threshold THD1, G (i)=PB (i) _ gain1 then, when brightness excursion during less than THD0
When brightness excursion during more than or equal to THD0 and less than THD1,
If i second luminance signal is greater than 0, and the edge Counter Value is less than the 3rd threshold value EDGE_COUNT_THD, then G (i)=0.
If i second luminance signal is less than 0, and the value of edge counter is more than or equal to the 3rd threshold value EDGE_COUNT_THD, then as brightness excursion range during more than or equal to the second change threshold TDH1, and G (i)=NB (i) _ gain1, as brightness excursion range during less than THD0
As brightness excursion range during more than or equal to THD0 and less than THD1,
If i second luminance signal is less than 0, and the value of edge counter is less than the 3rd threshold value EDGE_COUNT_THD, then G (i)=0.
More than be the calculating to first yield value of i second luminance signal, other second luminance signal adopts identical algorithm to calculate first yield value, repeats no more herein.
Need to prove that in embodiments of the present invention, also can adopt other algorithm to calculate first yield value of a plurality of second luminance signals, concrete computational methods are decided on actual needs, do not limit herein.
304, the first yield value adjustment to a plurality of second luminance signals obtains corresponding yield value;
Earlier the first gain parameter modulation is arranged, if range=0, modulation=0 then, if range is not equal to 0, modulation=(maxstep*fsp_modulation)/range then, wherein maxstep is the maximum in the absolute value of difference of numerical value of neighbor pixel, and fsp_modulation is second gain parameter of system intialization, and modulation is first gain parameter.
According to first gain parameter that judgement obtains first yield value of second luminance signal is adjusted, is adjusted being expressed as of the yield value obtain a plurality of second luminance signals:
gain(i)=(256-Modulation)×G(i)/256,
Wherein, gain (i) is the yield value of i second luminance signal, respectively the first yield value adjustment of a plurality of second luminance signals is obtained corresponding yield value according to expression formula.
305, determine that first of first luminance signal strengthens signal;
With a plurality of second luminance signals respectively the yield value corresponding with it multiply each other, again with the product addition, obtain first of first luminance signal and strengthen signal, obtain first expression formula that strengthens signal and be:
Wherein, change is the first enhancing signal, and gain (k) is the yield value of k the second luminance signal correspondence, and BPF (k) is k second luminance signal.
306, strengthen signal to first and adjust, obtain second and strengthen signal;
If the first enhancing signal is positive number, namely the first enhancing signal strengthens signal on positive direction, judge that then whether the difference of the enhancing value that the first enhancing Signals ﹠ Systems are preset is greater than 0, if, then strengthen signal with second and be adjusted into first difference that strengthens the enhancing value that Signals ﹠ Systems preset, if not, then strengthen signal with second and be adjusted into 0.
Signal is strengthened on negative direction if first strengthens signal, then judge first strengthen enhancing value that Signals ﹠ Systems preset and whether less than 0, if, then with second strengthen signal be adjusted into first strengthen enhancing value that Signals ﹠ Systems preset and, if not, then strengthen signal with second and be adjusted into 0.
307, strengthen signal according to second first luminance signal is carried out sharpening.
Strengthening with second that signal is added on first luminance signal is signal after the first luminance signal sharpening, exports the signal after the first luminance signal sharpening.
In embodiments of the present invention, determine first yield value by the positive negativity according to a plurality of second luminance signals, can carry out positive and negative enhancing respectively to the image detail in first luminance signal, can regulate visual effect, be conducive to the portrayal to image detail more, make picture become more clear, by first yield value being adjusted and being strengthened adjusting of signal to first, can further carry out reasonable sharpening according to picture characteristics effectively, and can further prevent excessive sharpening noise, make image see clearly and know nature more.
See also Fig. 4, a kind of peaking device based on many bands bandpass filtering in the embodiment of the invention comprises:
Bandpass filtering modules block 401 is imported a plurality of band pass filters simultaneously for first luminance signal of the picture signal that will get access to, and obtains a plurality of second luminance signals;
Image analysis module 402 is used for first luminance signal is carried out graphical analysis, obtains the output information of graphical analysis;
Gain process module 403 is used for the output information according to a plurality of second luminance signals and graphical analysis, obtains the yield value of a plurality of second luminance signal correspondences;
Sharpening module 404 is used for using yield value respectively second luminance signal of correspondence to be carried out sharpening.
Wherein, bandpass filtering modules block 401 comprises several band pass filters in parallel, is used for first luminance signal is carried out bandpass filtering treatment.
In embodiments of the present invention, image analysis module 402 comprises:
Characteristic extracting module 4021, be used for first luminance signal is carried out the maximum of absolute value of difference of maximum, minimum value and neighbor pixel brightness number of numerical value that the size centered by current pixel point that statistical computation obtains first luminance signal is all pixels of neighborhood of N * M, wherein N and M are generally the integer more than or equal to 2;
Edge filter module 4022 is used for that first luminance signal is carried out edge filter and obtains the edge filter signal;
Rim detection module 4023 is used for the edge filtering signal is carried out rim detection, obtains the marginal information of described first luminance signal.
In embodiments of the present invention, first luminance signal in the picture signal that gets access to is imported after the bandpass filtering modules block 401 that comprises a plurality of band pass filters simultaneously, can obtain a plurality of second luminance signals, and second luminance signal sent to gain process module 403, and simultaneously first luminance signal is sent to image analysis module 402, wherein the characteristic extracting module 4021 in the image analysis module 402 will be added up first luminance signal, obtain the maximum of the numerical value of all pixels in the neighborhood that the size of first luminance signal centered by current pixel point is N * M, the characteristic values such as maximum of the absolute value of the difference of minimum value and neighbor pixel brightness number, edge filter module in the image analysis module 402 will be carried out edge filter to first luminance signal simultaneously and be obtained the edge filter signal, and the edge filter signal sent to rim detection module 4023, rim detection module 4023 will be carried out rim detection to the edge filtering signal, obtain the marginal information of first luminance signal, image analysis module 402 sends to gain process module 403 with characteristic value and the marginal information of extracting, the yield value that the gain process module will obtain a plurality of second luminance signal correspondences according to characteristic value and the marginal information of a plurality of second luminance signals and graphical analysis, sharpening module 404 will be carried out sharpening to second luminance signal of correspondence respectively according to the yield value of gain process module 403.
In embodiments of the present invention, whether the rim detection module is that marginal point detects to current pixel point, can effectively judge marginal point, and it is the situation of marginal point that the minimizing noise spot is mistaken as, make when peaking strengthens, only marginal point to be strengthened, make picture clear and natural more.
See also Fig. 5, be the schematic diagram of gain process module of the present invention, gain process module 403 comprises:
Computing module 501 is used for the output information according to graphical analysis, obtains brightness excursion range, and wherein brightness excursion range is maximum in the image output information and the difference of minimum value;
Positive and negative judge module 502 is used for a plurality of second luminance signals of traversal, obtains the positive negativity of a plurality of second luminance signals;
Gain calculation module 503, be used for marginal information and brightness excursion according to the luminance signal of the output information of the positive negativity of the gain parameter of system intialization, a plurality of second luminance signals and graphical analysis, obtain first yield value of a plurality of second luminance signal correspondences;
Gain regulation module 504, be used for maximum and brightness excursion in the absolute value of difference of numerical value of the neighbor pixel that the output information according to graphical analysis comprises, first yield value to a plurality of second luminance signal correspondences is adjusted, and obtains the yield value of a plurality of second luminance signals.
In embodiments of the present invention, computing module 501 will obtain brightness excursion range according to the output information of graphical analysis, obtain after the range, positive and negative judge module 502 will travel through a plurality of second luminance signals, obtain the positive negativity of a plurality of second luminance signals, again by the gain parameter of gain calculation module 503 according to system intialization, the positive negativity of a plurality of second luminance signals and range obtain first yield value of a plurality of second luminance signal correspondences, obtain after first yield value, maximum and brightness excursion in the absolute value of the difference of the numerical value of the neighbor pixel that gain regulation module 504 comprises in will the output information according to graphical analysis, first yield value to the second luminance signal correspondence is adjusted, and obtains the yield value of a plurality of second luminance signals.
In embodiments of the present invention, the positive negativity of a plurality of second luminance signal correspondences that obtain by positive and negative judge module 501, can realize the positive and negative enhancing of second luminance signal is controlled respectively, obtain better visual effect, simultaneously, utilize 503 pairs of first yield values of gain regulation module to adjust, can reach the reasonable sharpening of image detail and prevent excessive sharpening noise.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is to instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
More than a kind of peaking method and device based on many bands bandpass filtering provided by the present invention is described in detail, for one of ordinary skill in the art, thought according to the embodiment of the invention, part in specific embodiments and applications all can change, in sum, this description should not be construed as limitation of the present invention.