some optimization to icvCalcOrientation_simple (less looping)