Updated the detector to reduce false positives on lettuce. It checks that the matched waterfill object contains the black outline.
for waterfill objects that matched the hand template, apply a mask filter to retain all black components
if this is a true positive, waterfill_sub_binary_image should be a black outline of the hand.
if false positive, it will be a pure white image
then apply the waterfill+template match algorithm on the resulting waterfill_sub_binary_image
this helps to remove false positives (e.g. lettuce)
SandwichHandLocator::detect will still use the old method of detection, for performance reasons (I didn't test it, but I imagine that adding an extra round of waterfill matching will worsen the lag in an already laggy program).
So, I think that detecting the black outline should only be done for recovery routines.
Updated the detector to reduce false positives on lettuce. It checks that the matched waterfill object contains the black outline.
SandwichHandLocator::detect will still use the old method of detection, for performance reasons (I didn't test it, but I imagine that adding an extra round of waterfill matching will worsen the lag in an already laggy program). So, I think that detecting the black outline should only be done for recovery routines.
I recommend merging #428 first.