improved feature detection