Say I have a set of numbers:
1, 3, 2, 1, 1, 20, 1, 3, 75, 86
I'd like to filter out all the small numbers, or "noise" in the set. The values 75 and 86 are so much higher than everything else (even 20) that I can drop everything but the 75 and 86.
A simple idea I had is to take the average, then remove anything that falls below the average. In this contrived example, the average is 19.3, which would mean the result contains 20, 75, 86. Not perfect, but a good starting point.
Is there something better I should be doing, or a standard function/technique to apply? I don't want to re-invent the wheel, but I have no idea what this "filtering" is called, so I'm not sure what to Google.
Edit:
@Matthew Conroy: The numbers come from OpenCV's cv::findContours(). The numbers represent the area of each contour. I'd like to filter out the extremely small areas and keep just the large objects that findContours() has detected.
The concept of "large" and "small" is not fixed. It depends on the numbers in the set. If a set is composed of 1, 2, 3, 1, 2, 2, 3, 4 then I guess all of them would be considered important, since there are no obvious outliers.
@Asaf Karagila please stop removing relevant tags.