2D pattern matching with adaptive photodetectors