Algorithm for finding dead pixels in Javascript

Viewed 2007

I am trying to create an algorithm that detects and counts dead pixels from an intensity map in .csv format. My current approach is to divide the value of the pixel I am testing by the value of the pixel immediately to the right (or, if on the far right side, the one to the left). If the dividend is less than some threshold (currently .9), then I mark it as a dead pixel.

My question is, is there a better/more efficient way to calculate if a pixel is dead?

Sample csv output:

3183    3176    3207    3183    3212
3211    3197    3198    3183    3191
3193    3177    1135    3185    3176
3175    3184    3188    3179    3181
3181    3165    3184    3187    3183

In this example, the middle pixel would be a "dead" pixel.

4 Answers
Related