After updating Macports, which I think is being updated by numpy, I get a warning:
VisibleDeprecationWarning: boolean index did not match indexed array along dimension 1; dimension is 2 but corresponding boolean dimension is 1 inliers = n.size(pixels[distances <= self.dst])
which did not rise earlier. Associated Code:
self.dst is the only scalar.
guess_feature.points_distance :
def points_distance(self,points): r''' Compute the distance of the points from the feature :math:`d = \left| \sqrt{(x_i - x_c)^2 + (y_i-y_c)^2} - r \right|` Args: points (numpy.ndarray): a (n,2) numpy array, each row is a 2D Point. Returns: d (numpy.ndarray): the computed distances of the points from the feature. ''' xa = n.array([self.xc,self.yc]).reshape((1,2)) d = n.abs(dist.cdist(points,xa) - self.radius) return d
Any ideas?
python numpy
SolidSnake
source share