axelthorstein / object

An exercise in manual object recognition through colour.
0 stars 0 forks source link

Mean/Median Filtering #17

Closed axelthorstein closed 5 years ago

axelthorstein commented 6 years ago

There could be a large margin of error introduced by slightly discolored pixels. If for example, the center colored pixels are all in the range of white, light grey, etc. then that will throw off the detection by providing false positives. Hopefully, we can apply a median filter to put consistency over a group of pixels and only not group pixels if there is a stark difference in color.

We may need to build our own image filter to identify the most common color for each group and assign that color to every similar colored pixel. Maybe we could do this by iterating over every pixel, keeping track of its color and location, then once we've seen every pixel we group by similarity and assign the most common color to each pixel.

Or we could use a modified Mean filter where we modify the pixels value based on the mean of it's neighbors. A traditional mean filter would most likely have an issue around the edge of a dash because it could blur the edges. But we could group based on the most common close color in the image. Or use something like this: http://mkweb.bcgsc.ca/color-summarizer/?

This could, however, be extremely slow and if we need to filter every incoming image this could severely increase runtime.

axelthorstein commented 6 years ago

Median filtering works well and to avoid the issue of blurred edges we can simply run a sharpening filter over the image after.

axelthorstein commented 5 years ago

Added in #21