|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodeanticode.progpuklt.FeatureTracker
public class FeatureTracker
This class encapsulates the GPU implementation of the KLT feature tracker, developed
by Christopher Zach at the University of North Carolina at Chapel Hill.
Features are defined to be corners points (pixels with large intensity variations along
the x and y directions) found in the image, and the algorithm is able to follow these
feature points through successive frames, until they disappear and are replaced by new
features.
This GPU implementation is substantially faster than a regular CPU version.
More information about the KLT tracker can be found in the following pages:
Christopher Zach's GPU-KLT page
CPU implementation of KLT by Stan Birchfield
Wikipedia entry about the KLT algorithm
Page about KLT tracker in computer vision tutorial
Constructor Summary | |
---|---|
FeatureTracker(processing.core.PApplet parent,
int imgWidth,
int imgHeight,
int nFeatures)
Creates an instance of FeatureTracker to track nFeatures features on images with a resolution of imgWidth x imgHeight pixels. |
|
FeatureTracker(processing.core.PApplet parent,
int imgWidth,
int imgHeight,
int nFeatures,
FeatureTrackerParameters params)
Creates an instance of FeatureTracker to track nFeatures features on images with a resolution of imgWidth x imgHeight pixels. |
Method Summary | |
---|---|
void |
drawFeatures(float diam)
Draws the current positions of all the feature points using circles of diameter diam. |
void |
drawFeatures(float x,
float y,
float w,
float h,
float diam)
Draws the current positions of all the feature points using circles of diameter diam. |
void |
drawTracks()
Draws the tracks for all the feature points using lines connecting successive positions. |
void |
drawTracks(float x,
float y,
float w,
float h)
Draws the tracks for all the feature points using lines connecting successive positions. |
int |
getHeight()
Returns the supported image height. |
int |
getMaxTrackLength()
Returns the maximum track length. |
int |
getNDetectedFeatures()
Returns the number of detected features when running the track method for the first time. |
int |
getNFeatures()
Returns the number of features being detected and tracked. |
int |
getNNewFeatures()
Returns the number of re-detected features. |
int |
getNPresentFeatures()
Returns the number of present features being tracked. |
float |
getPosX(int i)
Returns the current x coordinate feature i. |
float |
getPosY(int i)
Returns the current y coordinate feature i. |
FeatureTrack |
getTrack(int i)
Returns the entire track of feature i. |
int |
getTrackLength(int i)
Returns the current track length of feature i. |
float |
getTrackX(int i,
int t)
Returns the x coordinate of position of feature i at frame t. |
float |
getTrackY(int i,
int t)
Returns the y coordinate of position of feature i at frame t. |
int |
getWidth()
Returns the supported image width. |
static void |
setMaxTrackLength(int mLength)
Sets the maximum length of a feature track (in frames), i.e., how many post positions will be stored for a given feature point until it disappears from the image. |
void |
stop()
Stops the tracker. |
void |
track(int texID)
Track features in the image stored in the OpenGL texture with id texID. |
void |
track(int[] pixels)
Track features in the image stored in the pixels array. |
void |
track(processing.core.PImage image)
Track features in the image stored in the PImage object. |
boolean |
trackRestarted(int i)
Returns true or false depending on weather feature i has been restarted or not. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FeatureTracker(processing.core.PApplet parent, int imgWidth, int imgHeight, int nFeatures)
parent
- PAppletimgWidth
- intimgHeight
- intnFeatures
- intgetNFeatures
public FeatureTracker(processing.core.PApplet parent, int imgWidth, int imgHeight, int nFeatures, FeatureTrackerParameters params)
parent
- PAppletimgWidth
- intimgHeight
- intnFeatures
- intparams
- FeatureTrackerParametersgetNFeatures
,
FeatureTrackerParameters
Method Detail |
---|
public static void setMaxTrackLength(int mLength)
mLength
- intpublic void track(int texID)
texID
- intpublic void track(processing.core.PImage image)
image
- PImagepublic void track(int[] pixels)
pixels
- int[]public void stop()
public int getNFeatures()
public int getNDetectedFeatures()
public int getNNewFeatures()
FeatureTrackerParameters
public int getNPresentFeatures()
public int getWidth()
public int getHeight()
public int getMaxTrackLength()
public int getTrackLength(int i)
i
- int
public boolean trackRestarted(int i)
i
- int
public float getPosX(int i)
i
- int
public float getPosY(int i)
i
- int
public float getTrackX(int i, int t)
i
- intt
- int
public float getTrackY(int i, int t)
i
- intt
- int
public FeatureTrack getTrack(int i)
i
- int
FeatureTrack
public void drawTracks()
public void drawTracks(float x, float y, float w, float h)
x
- floaty
- floatw
- floath
- floatpublic void drawFeatures(float diam)
diam
- floatpublic void drawFeatures(float x, float y, float w, float h, float diam)
diam
- floatx
- floaty
- floatw
- floath
- float
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |