move selection from global to local to camshift
move all variable of camshift to local
clean code 2