Adjust curve parameter to draw line naturally
Change threshold to draw straight line
Avoid moving out of paper