Public Member Functions

project2d Class Reference

#include <project2d.h>

List of all members.

Public Member Functions

 project2d ()
void update_segment (IplImage *new_segment)
CvPoint project (CvPoint p) const
bool is_inside (CvPoint p) const
CvSize get_size () const

Detailed Description

Project image points on a segment in the image. This is useful for finding the nearest point on a segment in an image. The algorithm computes the distance map of the segmented image and uses this to find the nearest point on a segment by calculating derivatives of the map. This operation can be unstable near ridges of the distance map.


Constructor & Destructor Documentation

project2d::project2d (  )  [inline]

Initialise the object. This function does not allocate any data.

Prior to performing any projection you need to call the update_segment function at least once.


Member Function Documentation

CvSize project2d::get_size (  )  const [inline]

Return the size of the binary image from which the segment was found.

Returns:
The size of the image.
bool project2d::is_inside ( CvPoint  p  )  const [inline]

Determines if an image point is inside a segment in the binary image.

Parameters:
[in] p Coordinates of an image point.
Returns:
true if inside; otherwise false.
CvPoint project2d::project ( CvPoint  p  )  const [inline]

Project an image point onto the nearest segment in the binary image.

Parameters:
[in] p Coordinates of an image point.
Returns:
The coordinates of the nearest image point on the segment. Due to the approximate nature of the algorithm, this point might not be on the segment, but it will be near.
void project2d::update_segment ( IplImage *  new_segment  )  [inline]

Compute a new distance map for the projection operation. You only need to call this function when the segmented image changes.

Parameters:
[in] new_segment A binary (8-bit gray scale) image containing the segment. The binary image is inverted as part of the computations.

The documentation for this class was generated from the following file: