Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
jafar::lines::LsTracker Class Reference

Provides tracking of line segments. More...


Detailed Description

Provides tracking of line segments.

This class provides a tracking scheme for line segments. The interface for tracking is the procTracking() function which can be applyed iteratively on a sequence of images. The user has to handle the LineSegmentSet instances. They are not stored in LsTracker.

There is no need to use the same instance of lsTracker for each iteration of tracking but it increases speed, because otherwise a lot of temporary buffers are allocated and deallocated. If the tarcking is not done by only one instance of LsTracker you have to take special care of the id that are given to new lines. If there is a new line in procTracking() that could not be matched to an old line, it is given an id provided by nextId member, then nextId member is increased. Thus if you use different instances of LsTracker you have to update the nextId member before calling procTracking (use setNextId()).

Because it's tracking, the movement in the consecutive images should not be too large! There are some tracking schemes provided to be used in procTracking() function (see TrackScheme enumeration). The SVN version of the LsTracker-class should provide some of the currently best tracking schemes, further schemes are provided for further development as internal functions with name trackingSchemeX

Definition at line 45 of file lsTracker.hpp.

#include <lsTracker.hpp>

List of all members.

Public Member Functions

void procTracking (jafar::image::Image *image, LineSegmentSet *oldLS, LineSegmentSet *newLS, jafar::lines::MatchingSet *match, bool globalExtrFlag=1, jafar::image::Image *colorImage=0, TrackScheme scheme=GLOB_LOC_SEARCH)
 Proceed one tracking step (also the first step with empty _lsOld)
void trackingScheme8 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match, jafar::image::Image *colorImage=0)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme7 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match, jafar::image::Image *colorImage=0)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme6 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match, jafar::image::Image *colorImage=0)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme5 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match, jafar::image::Image *colorImage=0)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme4 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match, jafar::image::Image *colorImage=0)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme3 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match, jafar::image::Image *colorImage=0)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme2 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::image::Image *gradX, jafar::image::Image *gradY, jafar::lines::MatchingSet &match)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void trackingScheme1 (LineSegmentSet &lsA, LineSegmentSet &lsB, jafar::image::Image *image, jafar::lines::MatchingSet &match)
 Internal function for tracking. Have a look at procTracking to proceed tracking.
void setCannyPara (int lowerThresh, int higherThresh, int ap)
 Set the parameters for Canny edge detector of lsExtractor.
void setNextId (uint _nextId)
 Update the nextId member.
void setMinLength (double _minLength, double _minLengthFitting=15)
 Set the minimal length of new lines.
void setHistoThresh (double thresh)
 Set the maximal difference of two histograms to be matched.

Private Attributes

jafar::image::ImagegradX
 Gradient image (x direction)
jafar::image::ImagegradY
 Gradient image (y direction)
jafar::image::ImagecannyIm
 Canny edge detection image.
jafar::lines::LsExtractor lsExtractor
 LsExtractor instance for managment of line segment extarction.
double minLength
 Minimal length of new lines.
double minLengthFitting
 Minimal length of fiited lines (maybe you want it to be shorter than for the global extraction)
double histoThresh
 is only used in tracking scheme GLOB_LOC_SEARCH_HISTOGRAMS, used to decide if two histograms are equal or not
uint nextId
 New identifier for the next new line that could not be matched to a line.

Member Function Documentation

void jafar::lines::LsTracker::procTracking ( jafar::image::Image image,
LineSegmentSet oldLS,
LineSegmentSet newLS,
jafar::lines::MatchingSet match,
bool  globalExtrFlag = 1,
jafar::image::Image colorImage = 0,
TrackScheme  scheme = GLOB_LOC_SEARCH 
)

Proceed one tracking step (also the first step with empty _lsOld)

Proceed one tracking step. The new line segments are stored in newLS and the matching for all old line segments (_oldLS) to new line segments is stored in match. The matching is stored in matching and indicated by updating the id member and the color member of matched lines of newLS with the id and the color of the according line of oldLS. (Update of color member is nice for visualization of the tracking).

Parameters:
imagegreyvalue image to proceed in this step
oldLSpointer to the set of line segments of the last step
newLSpointer to the storage for the new line segments created in this step
matchstorage for the matching, assigns old lines new lines
schemeindicates the used tracking scheme
globalExtrFlagindicates if the global line segment extraction is applied on the image or not (LsExtractor::extractLineSegments() function)
colorImage(optional) image to draw lines during the tracking (for debugging)
void jafar::lines::LsTracker::setCannyPara ( int  lowerThresh,
int  higherThresh,
int  ap 
) [inline]

Set the parameters for Canny edge detector of lsExtractor.

Set the parameters for Canny edge detector of lsExtractor. The cvCanny() function is used in LsExtractor to find contour points. Here the parameters for tht call can be set.

Definition at line 192 of file lsTracker.hpp.

References lsExtractor.

void jafar::lines::LsTracker::setHistoThresh ( double  thresh) [inline]

Set the maximal difference of two histograms to be matched.

Set the maximal difference of two histograms to be matched. Only used in GLOB_LOC_SEARCH_HISTOGRAMS.

Definition at line 217 of file lsTracker.hpp.

References histoThresh.

void jafar::lines::LsTracker::setMinLength ( double  _minLength,
double  _minLengthFitting = 15 
) [inline]

Set the minimal length of new lines.

Set the minimal length of new lines extracted with global extraction with _minLength and for the local extraction (use of LineSegment::fitLineOrientation() function) with _minLengthFitting for some tracking schemes. It is usefull to have a smaller value for minLengthFitting (e.g. 15) At the moment only trackingScheme7 takes care of the minLengthFitting member.

Definition at line 208 of file lsTracker.hpp.

References minLength, and minLengthFitting.

void jafar::lines::LsTracker::setNextId ( uint  _nextId) [inline]

Update the nextId member.

Update the nextId member. This is neccessary if there is an ow ninstance of LsTracker for each iteration of the tracking or if the identifiers are managed outside of LsTracker.

Definition at line 200 of file lsTracker.hpp.

References nextId.

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a simple tracking, _image has to be a gradient image

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a simple tracking, gradX and gradY have to be gradient images lsA is old set, lsB new set

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a tracking approach, gradX and gradY have to be gradient images lsA is old set, lsB new set Here the two sets of line segments are clustered before processing Extends new set with fitted lines of old set and assigns an old line to each of the extended new lines set All lines should be oriented.

Parameters:
lsAreference to storage of lines of last tracking step
lsBreference to storage for the new lines
imagegreyvalue image to proceed in current step
gradXgradient image with gradient in x direction (e.g. with Sobel)
gradYgradient image with gradient in y direction (e.g. with Sobel)
matchstorage for the matching, assign old lines new lines
colorImage(optional) image to draw line segments during the tracking (for debugging)

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a tracking approach, gradX and gradY have to be gradient images lsA is old set, lsB new set Extends new set with fitted lines of old set and assigns an old line to each of the extended new lines set All lines should be oriented.

Parameters:
lsAreference to storage of lines of last tracking step
lsBreference to storage for the new lines
imagegreyvalue image to proceed in current step
gradXgradient image with gradient in x direction (e.g. with Sobel)
gradYgradient image with gradient in y direction (e.g. with Sobel)
matchstorage for the matching, assign old lines new lines
colorImage(optional) image to draw line segments during the tracking (for debugging)

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a tracking approach, gradX and gradY have to be gradient images lsA is old set, lsB new set Here the two sets of line segments are clustered before processing Extends new set with fitted lines of old set and assigns an old line to each of the extended new lines set All lines should be oriented.

Parameters:
lsAreference to storage of lines of last tracking step
lsBreference to storage for the new lines
imagegreyvalue image to proceed in current step
gradXgradient image with gradient in x direction (e.g. with Sobel)
gradYgradient image with gradient in y direction (e.g. with Sobel)
matchstorage for the matching, assign old lines new lines
colorImage(optional) image to draw line segments during the tracking (for debugging)

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a tracking approach, gradX and gradY have to be gradient images lsA is old set, lsB new set That function uses a matching with histograms for tracking. All lines should be oriented.

Parameters:
lsAreference to storage of lines of last tracking step
lsBreference to storage for the new lines
imagegreyvalue image to proceed in current step
gradXgradient image with gradient in x direction (e.g. with Sobel)
gradYgradient image with gradient in y direction (e.g. with Sobel)
matchstorage for the matching, assign old lines new lines
colorImage(optional) image to draw line segments during the tracking (for debugging)

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a tracking approach, gradX and gradY have to be gradient images lsA is old set, lsB new set Extends new set with fitted lines of old set and assigns an old line to each of the extended new lines set Similar to trackingScheme4 but uses histograms to verify the matchings and all the lines of fittingSet are used as new lines. If more than one of the fitted lines pass the histogram test all these matchings are skipped to reduce the number of false matchings All lines should be oriented.

Parameters:
lsAreference to storage of lines of last tracking step
lsBreference to storage for the new lines
imagegreyvalue image to proceed in current step
gradXgradient image with gradient in x direction (e.g. with Sobel)
gradYgradient image with gradient in y direction (e.g. with Sobel)
matchstorage for the matching, assign old lines new lines
colorImage(optional) image to draw line segments during the tracking (for debugging)

Internal function for tracking. Have a look at procTracking to proceed tracking.

This function provides a tracking approach, gradX and gradY have to be gradient images lsA is old set, lsB new set Extends new set with fitted lines of old set and assigns an old line to each of the extended new lines set Very similiar to trackingScheme4 but validates the matchings with histograms All lines should be oriented.

Parameters:
lsAreference to storage of lines of last tracking step
lsBreference to storage for the new lines
imagegreyvalue image to proceed in current step
gradXgradient image with gradient in x direction (e.g. with Sobel)
gradYgradient image with gradient in y direction (e.g. with Sobel)
matchstorage for the matching, assign old lines new lines
colorImage(optional) image to draw line segments during the tracking (for debugging)

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:42 for Jafar by doxygen 1.7.6.1
LAAS-CNRS