The content of the invention
In view of this, this application provides a kind of method and device for removing singular point noise, for solving due to camera
The image information of collection includes singular point noise, the problem of caused influence Consumer's Experience.
To achieve these goals, it is proposed that scheme it is as follows:
A kind of method for removing singular point noise, for each pixel that will be sent in the image of encoder, perform
Following processes:
In several neighbor pixel points for calculating current pixel point, the luminance difference and chroma difference of pixel, are obtained two-by-two
To some first luminance differences and some first chroma differences;Calculate current pixel point and the luminance difference of each neighbor pixel point
Value and chroma difference, obtain some second luminance differences and some second chroma differences;
Judge whether the absolute value of each first luminance difference is less than the first predetermined luminance threshold values;
If so, judging whether the absolute value of the second luminance difference that absolute value is minimum in each second luminance difference is more than
Second predetermined luminance threshold values;
If so, the brightness value of the current pixel point is arranged to the average value of the brightness value of each neighbor pixel point;
Judge whether the absolute value of each first chroma difference is less than the first default colourity threshold values;
If so, judging whether the absolute value of the second chroma difference that absolute value is minimum in each second chroma difference is more than
Second default colourity threshold values;
If so, the chromatic value of the current pixel point is arranged to the average value of the chromatic value of each neighbor pixel point.
Preferably, when described image is the image of yuv format, the first luminance difference for calculating gained is Δ Y1, first
Chroma difference is Δ U1 and Δ V1, the second luminance difference are Δ Y2, the second chroma difference is Δ U2 and Δ V2, and described first is default
Colourity threshold values includes the first default U values and the first default V values, and described second presets colourity threshold values presets U values and the including second
Two default V values;
Whether the absolute value for judging each first chroma difference is less than the first default colourity threshold values, and is judging
As a result when being, to judge the absolute value of the second minimum chroma difference of absolute value in each second chroma difference whether more than the
The processes of two default colourity threshold values are:
Judge whether each Δ U1 absolute value is less than the first default U values;
When it is determined that each Δ U1 absolute value is less than the first default U values, judge the Δ U2's that absolute value is minimum in each Δ U2
Whether absolute value is more than the second default U values;
Judge whether each Δ V1 absolute value is less than the first default V values;
When it is determined that each Δ V1 absolute value is less than the first default V values, judge the Δ V2's that absolute value is minimum in each Δ V2
Whether absolute value is more than the second default V values.
Preferably, the chromatic value by the current pixel point is arranged to the flat of the chromatic value of each neighbor pixel point
Average, including:
It is determined that each Δ U1 absolute value is less than the first default U values, and the minimum Δ U2 of absolute value in each Δ U2 of determination
When absolute value is more than the second default U values, the chromatic value of the current pixel point will be arranged to the color of each neighbor pixel point
The average value of angle value;And
It is determined that each Δ V1 absolute value is less than the first default V values, and the minimum Δ V2 of absolute value in each Δ V2 of determination
When absolute value is more than the second default V values, the chromatic value of the current pixel point will be arranged to the color of each neighbor pixel point
The average value of angle value.
Preferably, several neighbor pixel points of the current pixel point are:
Positioned at the top of current pixel point, lower section, the left and right four pixels.
A kind of device for removing singular point noise, at each pixel that will be sent in the image of encoder
Reason, the device include:
First computing unit, in several neighbor pixel points for calculating current pixel point, the brightness of pixel two-by-two
Difference and chroma difference, obtain some first luminance differences and some first chroma differences;
Second computing unit, for calculating the luminance difference and colour difference of current pixel point and each neighbor pixel point
Value, obtains some second luminance differences and some second chroma differences;
First judging unit, for judging whether the absolute value of each first luminance difference is less than the first predetermined luminance valve
Value;
Second judging unit, for when first judging unit is judged as YES, judging each second luminance difference
Whether the absolute value of the second minimum luminance difference of middle absolute value is more than the second predetermined luminance threshold values;
Pixel luma processing unit, for when second judging unit is judged as YES, by the current pixel point
Brightness value be arranged to each neighbor pixel point brightness value average value;
Whether the 3rd judging unit, the absolute value for judging each first chroma difference are less than the first default colourity valve
Value;
4th judging unit, for when the 3rd judging unit is judged as YES, judging each second chroma difference
Whether the absolute value of the second minimum chroma difference of middle absolute value is more than the second default colourity threshold values;
Pixel colourity processing unit, for when the 4th judging unit is judged as YES, by the current pixel point
Chromatic value be arranged to each neighbor pixel point chromatic value average value.
Preferably, when described image is the image of yuv format, the first luminance difference for calculating gained is Δ Y1, first
Chroma difference is Δ U1 and Δ V1, the second luminance difference are Δ Y2, the second chroma difference is Δ U2 and Δ V2, and described first is default
Colourity threshold values includes the first default U values and the first default V values, and described second presets colourity threshold values presets U values and the including second
Two default V values;
3rd judging unit includes:
Whether the first U value judging units, the absolute value for judging each Δ U1 are less than the first default U values;
Whether the first V value judging units, the absolute value for judging each Δ V1 are less than the first default V values;
4th judging unit includes:
2nd U value judging units, it is pre- that the absolute value for judging each Δ U1 in the first U value judging units is less than first
If during U values, judge whether the absolute value of the Δ U2 that absolute value is minimum in each Δ U2 is more than the second default U values;
2nd V value judging units, it is pre- that the absolute value for judging each Δ V1 in the first V value judging units is less than first
If during V values, judge whether the absolute value of the Δ V2 that absolute value is minimum in each Δ V2 is more than the second default V values.
Preferably, the pixel colourity processing unit includes:
Pixel colourity handles subelement, for it is determined that each Δ U1 absolute value is less than the first default U values, and determines respectively
When the minimum Δ U2 of absolute value absolute value is more than the second default U values in Δ U2, the chromatic value of the current pixel point will be set
It is set to the average value of the chromatic value of each neighbor pixel point;And it is determined that each Δ V1 absolute value is less than the first default V
, will be by the current pixel point when being worth, and determining the absolute value of the Δ V2 that absolute value is minimum in each Δ V2 more than the second default V values
Chromatic value be arranged to each neighbor pixel point chromatic value average value.
Preferably, several neighbor pixel points of the current pixel point are:
Positioned at the top of current pixel point, lower section, the left and right four pixels.
It can be seen from the above technical scheme that the method for the removal singular point noise that the embodiment of the present application provides, for inciting somebody to action
The each pixel being sent in the image of encoder, performs following processes:Calculate several neighbours' pictures of current pixel point
In vegetarian refreshments, the luminance difference and chroma difference of pixel, obtain some first luminance differences and some first chroma differences two-by-two;
Calculate the luminance difference and chroma difference of current pixel point and each neighbor pixel point, if obtain some second luminance differences and
Dry second chroma difference;It is less than the first predetermined luminance threshold values in the absolute value for judging each first luminance difference, and it is each described
When the absolute value of the second minimum luminance difference of absolute value is more than the second predetermined luminance threshold values in second luminance difference, described it will work as
The brightness value of preceding pixel point is arranged to the average value of the brightness value of each neighbor pixel point;Judging each first colour difference
The absolute value of value is less than the first default colourity threshold values, and the second minimum chroma difference of absolute value in each second chroma difference
Absolute value when being more than the second default colourity threshold values, the chromatic value of the current pixel point is arranged to each neighbor pixel point
Chromatic value average value.By said process, the singular point noise in image is eliminated, improves the experience sense of user.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only some embodiments of the present application, rather than whole embodiments.It is based on
Embodiment in the application, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of the application protection.
The embodiment of the present application provides a kind of method for removing singular point noise, and this method will be for that will be sent to encoder
Each pixel in image is handled, and concrete processing procedure is referring to Fig. 1.
, it is necessary to explain, the pixel of image is by two factor structures of brightness and colourity before application scheme is introduced
It is too high or too low may cause the pixel to turn into a singular point noise into, the value of any one in the two.
As shown in figure 1, this method includes:
Step S100, in several neighbor pixel points for calculating current pixel point, the luminance difference and color of pixel two-by-two
Difference is spent, obtains some first luminance differences and some first chroma differences;
Specifically, the pixel in image is usually rectanglar arrangement, and each pixel has neighbor pixel point.Can
With understanding, the number of the neighbor pixel point of the pixel on four sides of image, less than the neighbour of the pixel in the middle part of image
Occupy the number of pixel.
In this step, for several neighbor pixel points of current pixel point, luminance difference between any two and color are calculated
Spend difference.
Step S110, current pixel point and the luminance difference and chroma difference of each neighbor pixel point are calculated, if obtaining
Dry second luminance difference and some second chroma differences;
Step S120, judge whether the absolute value of each first luminance difference is less than the first predetermined luminance threshold values;If so,
Perform step S130;
Wherein, the first predetermined luminance threshold values is value set in advance, if the absolute value of each first luminance difference is small
In the value, then mean that the luminance difference of neighbor pixel point is little, wherein in the absence of singular point noise.
Step S130, judge the second minimum luminance difference of absolute value in each second luminance difference absolute value whether
More than the second predetermined luminance threshold values;If so, perform step S140;
Wherein, the second predetermined luminance threshold values is value set in advance, if value minimum big absolutely in each second luminance difference
The absolute value of second luminance difference is more than the value, then means that the brightness of current pixel point is far longer than the bright of its neighbor pixel point
Degree.And because the above-mentioned neighbor pixel point for having determined that current pixel point is non critical point noise, thus may determine that working as
Preceding pixel point is a singular point noise.
Step S140, the brightness value of the current pixel point is arranged to being averaged for the brightness value of each neighbor pixel point
Value;
, it is necessary to adjust the brightness of current pixel point after previous step determines current pixel point for a singular point noise
Value.During specific adjustment, the brightness value of current pixel point is adjusted to the average value of its neighbor pixel point brightness value.
Step S150, judge whether the absolute value of each first chroma difference is less than the first default colourity threshold values;If so,
Perform step S160;
Wherein, the first default colourity threshold values is value set in advance, if the absolute value of each first chroma difference is small
In the value, then mean that the colourity difference of neighbor pixel point is little, wherein in the absence of singular point noise.
Step S160, judge the second minimum chroma difference of absolute value in each second chroma difference absolute value whether
More than the second default colourity threshold values;If so, perform step S170;
Wherein, the second default colourity threshold values is value set in advance, if value minimum big absolutely in each second chroma difference
The absolute value of second chroma difference is more than the value, then means that the colourity of current pixel point is far longer than the color of its neighbor pixel point
Degree.And because the above-mentioned neighbor pixel point for having determined that current pixel point is non critical point noise, thus may determine that working as
Preceding pixel point is a singular point noise.
Step S170, the chromatic value of the current pixel point is arranged to being averaged for the chromatic value of each neighbor pixel point
Value.
, it is necessary to adjust the colourity of current pixel point after previous step determines current pixel point for a singular point noise
Value.During specific adjustment, the chromatic value of current pixel point is adjusted to the average value of its neighbor pixel point chromatic value.
It is to be understood that above-mentioned steps S100 and step S110 do not limit sequencing, and step S120-S140 is with walking
Rapid S150-S170 is two independent deterministic processes, and the two links can be performed individually, can also successively perform, in Fig. 1 only
Only illustrate the situation that the two links independently execute.
The method for the removal singular point noise that the embodiment of the present application provides, it is each in the image of encoder for that will be sent to
Individual pixel, perform following processes:In several neighbor pixel points for calculating current pixel point, the luminance difference of pixel two-by-two
And chroma difference, obtain some first luminance differences and some first chroma differences;Calculate current pixel point and each neighbours
The luminance difference and chroma difference of pixel, obtain some second luminance differences and some second chroma differences;Judging each institute
The absolute value for stating the first luminance difference is less than the first predetermined luminance threshold values, and absolute value minimum in each second luminance difference
When the absolute value of second luminance difference is more than the second predetermined luminance threshold values, the brightness value of the current pixel point is arranged to each institute
State the average value of the brightness value of neighbor pixel point;It is less than the first default colourity in the absolute value for judging each first chroma difference
Threshold values, and the absolute value of the second minimum chroma difference of absolute value is more than the second default colourity valve in each second chroma difference
During value, the chromatic value of the current pixel point is arranged to the average value of the chromatic value of each neighbor pixel point.By above-mentioned
Process, the singular point noise in image is eliminated, improve the experience sense of user.
It should be noted that the neighbor pixel point of current pixel point described above can be understood as the upper of current pixel point
Side, lower section, four pixels of the left and right.Certainly, if current pixel point is in image border, the neighbour of the pixel
Occupy pixel now may only need to consider remaining neighbor pixel point less than 4.
Because existing encoder is typically merely able to encode the image information of yuv format, so if camera
The image of collection is the image information of rgb format, then needs to be converted to the image information of yuv format according to existing formula.YUV lattice
The image of formula includes luminance signal Y and two carrier chrominance signals U and V.
For the image that image is yuv format, we are introduced in the scheme to above-described embodiment.
First, the first luminance difference obtained by above-mentioned calculating is Δ Y1, the first chroma difference is Δ U1 and Δ V1, second bright
Degree difference is Δ Y2, the second chroma difference is Δ U2 and Δ V2.Described first default colourity threshold values includes the first default U values and the
One default V values, the described second default colourity threshold values include the second default U values and the second default V values.
1st, the process whether above-mentioned absolute value for judging each first luminance difference is less than the first predetermined luminance threshold values is:
Judge whether each Δ Y1 absolute value is less than the first predetermined luminance threshold values.
2nd, whether the absolute value of above-mentioned the second luminance difference for judging that absolute value in each second luminance difference is minimum is big
It is in the process of the second predetermined luminance threshold values:
Judge whether the absolute value of the Δ Y2 that absolute value is minimum in each Δ Y2 is more than the second predetermined luminance threshold values.
3rd, whether the above-mentioned absolute value for judging each first chroma difference is less than the first default colourity threshold values, and is sentencing
Disconnected result is when being, to judge whether the absolute value of the second chroma difference that absolute value is minimum in each second chroma difference is more than
The process of second default colourity threshold values is:
Judge whether each Δ U1 absolute value is less than the first default U values;
When it is determined that each Δ U1 absolute value is less than the first default U values, judge the Δ U2's that absolute value is minimum in each Δ U2
Whether absolute value is more than the second default U values.
And
Judge whether each Δ V1 absolute value is less than the first default V values;
When it is determined that each Δ V1 absolute value is less than the first default V values, judge the Δ V2's that absolute value is minimum in each Δ V2
Whether absolute value is more than the second default V values.
4th, the above-mentioned chromatic value by the current pixel point is arranged to the average value of the chromatic value of each neighbor pixel point
Process be:
It is determined that each Δ U1 absolute value is less than the first default U values, and the minimum Δ U2 of absolute value in each Δ U2 of determination
When absolute value is more than the second default U values, the chromatic value of the current pixel point will be arranged to the color of each neighbor pixel point
The average value of angle value;And
It is determined that each Δ V1 absolute value is less than the first default V values, and the minimum Δ V2 of absolute value in each Δ V2 of determination
When absolute value is more than the second default V values, the chromatic value of the current pixel point will be arranged to the color of each neighbor pixel point
The average value of angle value.
In general, the brightness Y of pixel, colourity U and colourity V can turn into singular point noise composition on pixel and influence.
If pixel turns into singular point noise due to brightness Y, the brightness Y to pixel is needed to be adjusted;If pixel due to
Colourity U and when turning into singular point noise, then need to be adjusted the colourity U of pixel;If pixel is due to colourity V and as strange
During spot noise, then need to be adjusted the colourity V of pixel.
In order to make it easy to understand, the present embodiment is illustrated by a specific example, as shown in Figure 2.
Fig. 2 illustrates 8*8 pixel-matrix.Wherein, pixel P neighbor pixel point elects P four pictures up and down as
Vegetarian refreshments (point that oblique line is marked in figure), is respectively defined as POn、PUnder、PIt is left、PIt is right.The brightness that only example passes through pixel in the present embodiment
Come judge pixel whether be singular point noise process.Assuming that P brightness is 10, POn、PUnder、PIt is left、PIt is rightBrightness be respectively 2,3,
4、3.It is 3 to define the first predetermined luminance threshold values, and the second predetermined luminance threshold values is 5.
Due to POn、PUnder、PIt is left、PIt is rightBetween four points, the difference of the brightness of any two point is and P points and P more than 3On、
PUnder、PIt is left、PIt is rightMinimum difference is 10-4=6 in the luminance difference of four points, and is more than the second predetermined luminance threshold values 5 due to 6, because
And it is singular point noise to determine pixel P.
The device of the removal singular point noise provided below the embodiment of the present application is described, removal singular point described below
The method of the device of noise and above-described removal singular point noise can be mutually to should refer to.
Referring to Fig. 3, Fig. 3 is a kind of apparatus structure schematic diagram for removing singular point noise disclosed in the embodiment of the present application.
The device is handled each pixel that will be sent in the image of encoder.As shown in figure 3, the device
Including:
First computing unit 31, in several neighbor pixel points for calculating current pixel point, pixel is bright two-by-two
Difference and chroma difference are spent, obtains some first luminance differences and some first chroma differences;
Second computing unit 32, for calculating the luminance difference and colour difference of current pixel point and each neighbor pixel point
Value, obtains some second luminance differences and some second chroma differences;
First judging unit 33, for judging whether the absolute value of each first luminance difference is less than the first predetermined luminance
Threshold values;
Second judging unit 34, for when first judging unit 33 is judged as YES, judging each second brightness
Whether the absolute value of the second minimum luminance difference of absolute value is more than the second predetermined luminance threshold values in difference;
Pixel luma processing unit 35, for when second judging unit 34 is judged as YES, by the current picture
The brightness value of vegetarian refreshments is arranged to the average value of the brightness value of each neighbor pixel point;
Whether the 3rd judging unit 36, the absolute value for judging each first chroma difference are less than the first default colourity
Threshold values;
4th judging unit 37, for when the 3rd judging unit 36 is judged as YES, judging each second colourity
Whether the absolute value of the second minimum chroma difference of absolute value is more than the second default colourity threshold values in difference;
Pixel colourity processing unit 38, for when the 4th judging unit 37 is judged as YES, by the current picture
The chromatic value of vegetarian refreshments is arranged to the average value of the chromatic value of each neighbor pixel point.
Optionally, when described image is the image of yuv format, the first luminance difference for calculating gained is Δ Y1, first
Chroma difference is Δ U1 and Δ V1, the second luminance difference are Δ Y2, the second chroma difference is Δ U2 and Δ V2, and described first is default
Colourity threshold values includes the first default U values and the first default V values, and described second presets colourity threshold values presets U values and the including second
Two default V values;
3rd judging unit 36 can include:
Whether the first U value judging units, the absolute value for judging each Δ U1 are less than the first default U values;
Whether the first V value judging units, the absolute value for judging each Δ V1 are less than the first default V values;
4th judging unit includes:
2nd U value judging units, it is pre- that the absolute value for judging each Δ U1 in the first U value judging units is less than first
If during U values, judge whether the absolute value of the Δ U2 that absolute value is minimum in each Δ U2 is more than the second default U values;
2nd V value judging units, it is pre- that the absolute value for judging each Δ V1 in the first V value judging units is less than first
If during V values, judge whether the absolute value of the Δ V2 that absolute value is minimum in each Δ V2 is more than the second default V values.
The pixel colourity processing unit 38 can include:
Pixel colourity handles subelement, for it is determined that each Δ U1 absolute value is less than the first default U values, and determines respectively
When the minimum Δ U2 of absolute value absolute value is more than the second default U values in Δ U2, the chromatic value of the current pixel point will be set
It is set to the average value of the chromatic value of each neighbor pixel point;And it is determined that each Δ V1 absolute value is less than the first default V
, will be by the current pixel point when being worth, and determining the absolute value of the Δ V2 that absolute value is minimum in each Δ V2 more than the second default V values
Chromatic value be arranged to each neighbor pixel point chromatic value average value.
It should be noted that the neighbor pixel point of current pixel point described above can be understood as the upper of current pixel point
Side, lower section, four pixels of the left and right.Certainly, if current pixel point is in image border, the neighbour of the pixel
Occupy pixel now may only need to consider remaining neighbor pixel point less than 4.
The device for the removal singular point noise that the embodiment of the present application provides, it is each in the image of encoder for that will be sent to
Individual pixel, perform following processes:In several neighbor pixel points for calculating current pixel point, the luminance difference of pixel two-by-two
And chroma difference, obtain some first luminance differences and some first chroma differences;Calculate current pixel point and each neighbours
The luminance difference and chroma difference of pixel, obtain some second luminance differences and some second chroma differences;Judging each institute
The absolute value for stating the first luminance difference is less than the first predetermined luminance threshold values, and absolute value minimum in each second luminance difference
When the absolute value of second luminance difference is more than the second predetermined luminance threshold values, the brightness value of the current pixel point is arranged to each institute
State the average value of the brightness value of neighbor pixel point;It is less than the first default colourity in the absolute value for judging each first chroma difference
Threshold values, and the absolute value of the second minimum chroma difference of absolute value is more than the second default colourity valve in each second chroma difference
During value, the chromatic value of the current pixel point is arranged to the average value of the chromatic value of each neighbor pixel point.By above-mentioned
Process, the singular point noise in image is eliminated, improve the experience sense of user.
Finally, it is to be noted that, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or equipment including a series of elements not only include that
A little key elements, but also the other element including being not expressly set out, or also include for this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged
Except other identical element in the process including the key element, method, article or equipment being also present.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.
The foregoing description of the disclosed embodiments, professional and technical personnel in the field are enable to realize or using the application.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments in the case where not departing from spirit herein or scope.Therefore, the application
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.