Calculate the binary reference image using linear SVM trained on manually selected pixels.
Useful links