Accessor Functions Requiring EDGENORMALS

#python
self.subscription.subscribe(playmotion.SERVICE_EDGENORMALS)

syntax

float VisionInput::getDistanceFromEdge(int x, int y, floatp, nx, floatp ny)
float VisionInput::getDistanceFromEdge(int x, int y, CvPoint2D32f normal)
float VisionInput::getDistanceFromEdge(CvPoint point, floatp, nx, floatp ny)
float VisionInput::getDistanceFromEdge(CvPoint point, CvPoint2D32f normal)

brief

Returns a floating point distance between the input point and the nearest white pixel in the segmentation image. This as a vision space operation, meaning that the input point shold be a pair (x,y) of coordinates with origin at the upper lefthand corner. The point should not lie outside the boundary of the segmentation image. The return value is also in vision space -- the Euclidean distance from the input point to the nearest pixel across the image. Negative values mean that the point is inside a white region.

When subscribed to SERVICE_EDGENORMALS, these functions can return a second value as an out parameter: a vector pointing in the direction of the normal to the nearest edge of the white segmented pixels. NOTE: this vector is not normalized.

details

The edge normals service applies first order Sobel operators to the distance transform image in the x- and y-direction. So SERVICE_EDGENORMALS computes the gradient of the distance transform scalar field. When sampled at the boundary between black and white pixels, the values of the gradient point in the direction normal to said boundary. Note that all vectors computed are oriented to point outward from regions of segmented (white) pixels.

See also: