3 ms·
If you are going to analyze all pixels on the screen, it would be better to use some kind of median filter[1]. It looks smoother and more focused: http://i.img
by jQueryIsAwesome 15y ago
If you are going to analyze all pixels on the screen, it would be better to use some kind of median filter[1].
It looks smoother and more focused: http://i.imgur.com/hsq84.jpg http://i.imgur.com/hsq84.jpg
[1]http://en.wikipedia.org/wiki/Median_filter http://en.wikipedia.org/wiki/Median_filter
- alextgordon 15y agoNo wonder it looks smoother. The pixels are half the size!
- malkia 15y agoMedian filter has to sort pixels (3x3, or 5x5) and get the median (this is by memory, haven't looked at wikipedia). As such it might be or might not be better solution. Also it can't be done in-place (or can it?)
- regularfry 15y agoYou could do it in-place with a memory cost of one pixel row (for 3x3, or two for 5x5) plus one (or 2) pixels. That might make be worthwhile depending on where you're actually doing it. It might be more efficient - it's worth implementing both to see.