Jafar
|
The lines module provides containers and functions to deal with 2d line segments in image planes. The main features are extraction,tracking and matching of line segments. The key classes are LineSegment, LineSegmentSet, LsExtractor and LsTracker.
The lines module requires the jafar::image module, openCV and boost.
The interface of the module is generated from the following files:
try
{ } catch
block for this module. Classes | |
class | jafar::filter::ConstantVelocityKalmanFilter |
Kalman filter for an one dimensional constant velocity model. More... | |
class | jafar::lines::ConstPositionKF |
Kalman filter for an one dimensional constant position model. More... | |
class | jafar::lines::Histogram |
Wrap cvHistogram. More... | |
class | jafar::lines::LineSegment |
Class for a line segment with descriptor. More... | |
class | jafar::lines::LineSegmentSet |
Container for a set of LineSegment. More... | |
class | jafar::lines::LinesException |
Base class for all exceptions defined in the module lines. More... | |
class | jafar::lines::LsExtractor |
Class with functions to extract line segments of an image. More... | |
class | jafar::lines::LsPredictor2D |
Class for prediction of the movement of a line in a sequenze of images. More... | |
class | jafar::lines::LsTracker |
Provides tracking of line segments. More... | |
struct | jafar::lines::MatchStatistic |
Structure to store the result of a comparison of two matchings. More... | |
class | jafar::lines::MatchingSet |
Container for a matching. More... | |
Enumerations | |
enum | jafar::lines::PredictionModel { MIDPOINT_X_Y, POLAR_COORD, ONLY_PERP_MOTION, PERP_MIDPOINT_PROJ } |
Enumeration for the kind of motion model for the prediction. More... | |
enum | jafar::lines::TrackScheme { GLOB_LOC_SEARCH, GLOB_MATCHING, GLOB_LOC_SEARCH_HISTOGRAMS } |
Indictor for tracking scheme. More... | |
enum | jafar::lines::MatchRepres { FAST_OLD_LINE_MATCH_ACCESS, FAST_MATCH_ACCESS, BOTH_MATCH_ACCESS_TYPES } |
Enumerates the kinds of representation in the MatchingSet. More... | |
Functions | |
bool | jafar::lines::contourPtTest (jafar::image::Image *image, int x, int y) |
double | jafar::lines::distPointVector (CvPoint a, CvPoint b, CvPoint c) |
Calculates distance of a point to an infinite line defined by a vector (a, b defines the vector) | |
double | jafar::lines::distPointVector (double ax, double ay, double bx, double by, double cx, double cy) |
Calculates distance of a point to an infinite line defined by a vector (a, b defines the vector) | |
double | jafar::lines::signedDistPointVector (CvPoint a, CvPoint b, CvPoint c) |
Calculates signed distance of a point to an infinite line defined by a vector (sign results of vector product (b-a) x c ) | |
double | jafar::lines::distPtPt (CvPoint a, CvPoint b) |
Calculates distance of two points. | |
bool | jafar::lines::calcGradientImage (jafar::image::Image *image) |
Calculate gradient image. | |
bool | jafar::lines::calcXYGradientImages (jafar::image::Image *image, jafar::image::Image *destX, jafar::image::Image *destY, int signedFlag) |
Calculate gradient images in x and y direction. | |
bool | jafar::lines::calcOrientedGradientImage (jafar::image::Image *image, jafar::image::Image *gradAbsImage, jafar::image::Image *gradOriImage) |
Calculate gradient image and image with orientation of the gradients. | |
double | jafar::lines::validLine (jafar::image::Image *gradX, jafar::image::Image *gradY, CvPoint p1, CvPoint p2, double minGrad=0, double lowRate=1) |
int | jafar::lines::calcIntersec (CvPoint p1, CvPoint p2, CvPoint p3, CvPoint p4, CvPoint &s) |
Calculate intersection point of two lines given by endpoints. | |
double | jafar::lines::startTimeMeasure () |
Starts a time measurement. | |
double | jafar::lines::stopTimeMeasure (double t1) |
Evaluates time measurement. |
Enumerates the kinds of representation in the MatchingSet.
Enumerates the kinds of representation in the MatchingSet.
FAST_OLD_LINE_MATCH_ACCESS is the representation with map member
FAST_MATCH_ACCESS is the representation with oldIdx and newIdx vectors
BOTH_MATCH_ACCESS_TYPES matchings are stored in map and in oldIdx and newIdx vectors
Definition at line 26 of file matchingSet.hpp.
Enumeration for the kind of motion model for the prediction.
This enumeration indicates the type of the model for the motion prediction. All modells use Kalman filtering for prediction.
MIDPOINT_X_Y Constant velocity model, Prediction of the midpoint and the orientation of the line. Fails if the length of the line is not extracted stable.
POLAR_COORD Constant velocity model. Prediction with polar coordinates. Unfortunatly the uncertainty of polar coordinates depends on the position of the line in the image and thus it behaves sometimes strange.
ONLY_PERP_MOTION Constant position model applyed on the projected midpoint difference and difference of orientation of consecutive measurements. For prediction these differences are added to the last prior position of the line. Works well if there are no false matchings. False matchings destroy the performance.
PERP_MIDPOINT_PROJ Constant velocity model. The line position is represented with midpoint coordinates and orientation. These values are estimated with independent Kalman filters. The prediction of the line segment is the projection of the prior endpoints on the predicted line. This model is recommended.
Definition at line 27 of file lsPredictor2D.hpp.
Indictor for tracking scheme.
Here the different tracking schemes which can be used in procTracking() are enumerated
GLOB_LOC_SEARCH Extract lines on the whole image and applys local search (LineSegment::fitLineOrientation()) on all old lines. (trackingScheme4)
GLOB_MATCHING Extract lines on the whole image and try to match them with histogram descriptor (trackingScheme6)
GLOB_LOC_SEARCH_HISTOGRAMS Extract lines on the whole image and applys local search (LineSegment::fitLineOrientation()) on all old lines. (trackingScheme8)
Definition at line 27 of file lsTracker.hpp.
bool jafar::lines::calcGradientImage | ( | jafar::image::Image * | image | ) |
Calculate gradient image.
Calculate gradient image of image and store in image. Gradient image means sum of vertical and horizontal Sobel images with first derivatives.
int jafar::lines::calcIntersec | ( | CvPoint | p1, |
CvPoint | p2, | ||
CvPoint | p3, | ||
CvPoint | p4, | ||
CvPoint & | s | ||
) |
Calculate intersection point of two lines given by endpoints.
Calculate intersection point line through p1 and p2 and line through p3 and p4 and store intersection point.in s. Returns 1 if intersection point exists.
bool jafar::lines::calcOrientedGradientImage | ( | jafar::image::Image * | image, |
jafar::image::Image * | gradAbsImage, | ||
jafar::image::Image * | gradOriImage | ||
) |
Calculate gradient image and image with orientation of the gradients.
Calculate two images, first is gradient image with absolute values, second is image with direction of gradients in each pixel. Gradients are calculated with cvSobel one time in x and one time in y direction.
image | the image that should be processed |
gradAbsImage | storage for the gradients |
gradOriImage | storage for the orientations of the gradients |
bool jafar::lines::calcXYGradientImages | ( | jafar::image::Image * | image, |
jafar::image::Image * | destX, | ||
jafar::image::Image * | destY, | ||
int | signedFlag | ||
) |
Calculate gradient images in x and y direction.
Calculates two gradient images, first with result of cvSobel in x direction and second in y direction. destX and destY have to be two [IPL_DEPTH_16S JfrImage_CS_GRAY] Jafar-Images signedFlag indicates whether the reslut should be in range [-128..127] or [0..255]
bool jafar::lines::contourPtTest | ( | jafar::image::Image * | image, |
int | x, | ||
int | y | ||
) |
Test if a neighbour of point with coordinates _x and _y is a non zero pixel.
double jafar::lines::startTimeMeasure | ( | ) |
Starts a time measurement.
That function initializes a time measurement with use of gettimeofday() function. The return value can be used later as parameter for stopTimeMeasure() function to get the time difference in seconds.
double jafar::lines::stopTimeMeasure | ( | double | t1 | ) |
Evaluates time measurement.
Can be used to measure the passed time since the startTimeMeasure() function was called. Therefore assign the return value of according startTimeMeasure() function to the parameter of this function.
double jafar::lines::validLine | ( | jafar::image::Image * | gradX, |
jafar::image::Image * | gradY, | ||
CvPoint | p1, | ||
CvPoint | p2, | ||
double | minGrad = 0 , |
||
double | lowRate = 1 |
||
) |
Evaluates the line defined by p1 and p2 with respect to the gradients in image.
Line should be oriented: p1->p2 left side is brighter (LineSegment::orientLine() could be useful)
Line must be completly inside the gradient images (use cvClipLine).
Returns average gradient value along the line.
gradX | gradients in x-direction |
gardY | gradients in y-direction |
p1 | start point of the line |
p2 | end point of the line |
minGrad | the minimal gradient (perpendicular to the line) of a line-pixel to be count as inlier, others are outliers |
lowRate | Can be used to return 0 if the number of ouliers (gradient is to small) is to high (if outliers/(ouliers+inliers) > lowRate return 0) |
Generated on Wed Oct 15 2014 00:37:30 for Jafar by doxygen 1.7.6.1 |