Preliminary code for pixel detection.