IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
|
Used to track the centroid of a target object. More...
Public Member Functions | |
def | __init__ (self, iPt=None, params=CfgCentroid()) |
Construction. More... | |
def | adapt (self) |
Adapt internal tracking parameters. More... | |
def | correct (self) |
Correct track state based on predication and measurement. More... | |
def | display_cv (self, I, ratio=None, window_name="track point ") |
Use opencv display routines to plot the trackpoint along with the given image. More... | |
def | displayDebugState (self, dbstate=None) |
Displays internally stored intermediate process output. More... | |
def | displayState (self, dstate=None, ax=None) |
Displays the current track pointer measurement. More... | |
def | emptyState (self) |
Return an empty state structure (in python a dataclass). More... | |
def | get (self, fname) |
def | getState (self) |
Return the track-pointer state. More... | |
def | measure (self, I) |
Measure the track point from the given image. More... | |
def | offset (self, dp) |
Apply a vector offset to the track point. More... | |
def | predict (self) |
Predict next track state based on current track state. More... | |
def | process (self, I) |
Process the input image according to centroid tracking. More... | |
def | set (self, fname, fval) |
def | setIfMissing (self, params, pname, pval) |
Set missing parameters in the registration parameters structure. More... | |
def | setState (self, dPt) |
Use a track state element to define internal track state. More... | |
def | transform (self, g) |
Apply a Lie group transformation (linear/affine) to the track point. More... | |
Public Attributes | |
haveMeas | |
params | |
tpt | |
Used to track the centroid of a target object.
Centroid track pointer interface object. Basically performs tracking of an object by computing its centroid.
There are two ways to perform centroid tracking. One is to presume that the object to track has already been binarized and it is simply a matter of computing the centroid. The other is that the binarization needs to first be computed, then the centroid calculated. If binarization of the input is desired, use the improcessor to perform the binarization as a pre-processing step. If the binarization is too complicated for an improcess procedure, then write a tracker wrapper around the binarization + tracking combination. It will usually then become a perceiver
object.
More generically, the preprocessor can be used to take a non-track signal or more complex signal and recover only the "track point" equivalent sub-signal.
def __init__ | ( | self, | |
iPt = None , |
|||
params = CfgCentroid() |
|||
) |
Construction.
[in] | iPt | Initial track point, if known/available. |
[in] | params | Configuration specification structure. |
Reimplemented in centroidMulti.
def adapt | ( | self | ) |
Adapt internal tracking parameters.
For base class, adaptation is a no-op as nothing is really known.
def correct | ( | self | ) |
Correct track state based on predication and measurement.
For base class this is a no-op as there is no prediction.
def display_cv | ( | self, | |
I, | |||
ratio = None , |
|||
window_name = "track point " |
|||
) |
Use opencv display routines to plot the trackpoint along with the given image.
[in] | I | Image to display. |
[in] | ratio | Resize ratio (no resize if not given) |
[in] | window_name | Name for window. default="track point" |
def displayDebugState | ( | self, | |
dbstate = None |
|||
) |
Displays internally stored intermediate process output.
Currently, there is no intermediate output, though that might change in the future.
def displayState | ( | self, | |
dstate = None , |
|||
ax = None |
|||
) |
Displays the current track pointer measurement.
Assumes that the current figure to plot to is activate. If the plot has existing elements that should remain, then hold should be enabled prior to invoking this function.
[in] | dstate | State to display (otherwise, use internal state). |
[in] | ax | Axis to display to (Uses matplotlibs I think?). |
def emptyState | ( | self | ) |
Return an empty state structure (in python a dataclass).
def get | ( | self, | |
fname | |||
) |
Reimplemented in centroidMulti.
def getState | ( | self | ) |
Return the track-pointer state.
[out] | tstate | The track point state structure. |
Reimplemented in boardMeasure, and FromLayer.
def measure | ( | self, | |
I | |||
) |
Measure the track point from the given image.
[in] | I | The input image. |
[out] | mstate | The measured state. |
Reimplemented in centroidMulti.
def offset | ( | self, | |
dp | |||
) |
Apply a vector offset to the track point.
[in] | dp | The change in position to apply. |
def predict | ( | self | ) |
Predict next track state based on current track state.
For base version, this is a no-op. More complex versions, possibly with motion models, should override this.
def process | ( | self, | |
I | |||
) |
Process the input image according to centroid tracking.
[in] | I | The input image. |
[out | tState The track state, if desired. |
Reimplemented in centroidMulti.
def set | ( | self, | |
fname, | |||
fval | |||
) |
Reimplemented in centroidMulti.
def setIfMissing | ( | self, | |
params, | |||
pname, | |||
pval | |||
) |
Set missing parameters in the registration parameters structure.
[in] | params | The parameter structure. pname Name of parameter. pval Value of parameter. |
[out] | params | The parameter structure. |
def setState | ( | self, | |
dPt | |||
) |
Use a track state element to define internal track state.
[in] | dPt | Desired track point. |
def transform | ( | self, | |
g | |||
) |
Apply a Lie group transformation (linear/affine) to the track point.
[in] | g | The Lie group class instance to apply. |
haveMeas |
params |
tpt |