fixed a bug that the region for a fit could be outside the image boundaries
set the threshold for a wrong detection to 1.5px