fix boarder points detection bug, compute directly on original