EDIT
A single pixel is not useful for such a task due to noise. Thus, the essence of the algorithm should be to measure the similarity between blocks of pixels. Prescription pseudo-code (based on correlation measurement):
Divide image into N x M grid
For each N, M cell in grid:
correlation = correlation_between (signal_pixels_of (N, M),
background_pixels_of (N, M)
);
if (correlation> threshold)
show_background_cell (N, M)
else
show_signal_cell (N, M)
This is a serial pseudo code, but it can easily be converted to an HLSL shader. Simply, each pixel determines which block of pixel it belongs to, and then measures the correlation between the respective blocks. And based on this correlation, the current pixel is shown or hidden.
Try this approach, good luck!
Agnius vasiliauskas
source share