update: Moved masking code to find_bard

* Moved all image processing code into one place so that it's possible
  to time-profile it.

Signed-off-by: mr.Shu <mr@shu.io>