fixed LM
added dynamic surf threshold