new funtion find_scratch
implement line detection
stack size detect
minor bug fixed
compare each side using the correlation coefficent
bug fixed
add distance constraint