Detect fingerprint/smear on lens

don’t use edge detection. a blurry smudge has no edges.

  1. take a picture of a reference background (flat white or color) with clean optics and exposure set such that it’s not overexposed. your picture’s white background is overexposed and the smudge can’t be seen there.
  2. compare (pixel-wise) against picture with smudged optics.