fixing NaN
pruning dominant orientations