IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Public Member Functions | Public Attributes | List of all members
centroid Class Reference

Used to track the centroid of a target object. More...

Inheritance diagram for centroid:
Inheritance graph
[legend]
Collaboration diagram for centroid:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  iPt = None,
  params = CfgCentroid() 
)

Construction.

Parameters
[in]iPtInitial track point, if known/available.
[in]paramsConfiguration specification structure.

Reimplemented in centroidMulti.

Member Function Documentation

◆ adapt()

def adapt (   self)

Adapt internal tracking parameters.


For base class, adaptation is a no-op as nothing is really known.

◆ correct()

def correct (   self)

Correct track state based on predication and measurement.


For base class this is a no-op as there is no prediction.

◆ display_cv()

def display_cv (   self,
  I,
  ratio = None,
  window_name = "track point " 
)

Use opencv display routines to plot the trackpoint along with the given image.

Parameters
[in]IImage to display.
[in]ratioResize ratio (no resize if not given)
[in]window_nameName for window. default="track point"

◆ displayDebugState()

def displayDebugState (   self,
  dbstate = None 
)

Displays internally stored intermediate process output.

Currently, there is no intermediate output, though that might change in the future.

◆ displayState()

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.

Parameters
[in]dstateState to display (otherwise, use internal state).
[in]axAxis to display to (Uses matplotlibs I think?).

◆ emptyState()

def emptyState (   self)

Return an empty state structure (in python a dataclass).

Returns
The empty state structure.

◆ get()

def get (   self,
  fname 
)

Reimplemented in centroidMulti.

◆ getState()

def getState (   self)

Return the track-pointer state.

Parameters
[out]tstateThe track point state structure.

Reimplemented in boardMeasure, and FromLayer.

◆ measure()

def measure (   self,
  I 
)

Measure the track point from the given image.

Parameters
[in]IThe input image.
[out]mstateThe measured state.

Reimplemented in centroidMulti.

◆ offset()

def offset (   self,
  dp 
)

Apply a vector offset to the track point.

Parameters
[in]dpThe change in position to apply.

◆ predict()

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.

◆ process()

def process (   self,
  I 
)

Process the input image according to centroid tracking.

Parameters
[in]IThe input image.
[outtState The track state, if desired.

Reimplemented in centroidMulti.

◆ set()

def set (   self,
  fname,
  fval 
)

Reimplemented in centroidMulti.

◆ setIfMissing()

def setIfMissing (   self,
  params,
  pname,
  pval 
)

Set missing parameters in the registration parameters structure.

Parameters
[in]paramsThe parameter structure. pname Name of parameter. pval Value of parameter.
[out]paramsThe parameter structure.

◆ setState()

def setState (   self,
  dPt 
)

Use a track state element to define internal track state.

Parameters
[in]dPtDesired track point.

◆ transform()

def transform (   self,
  g 
)

Apply a Lie group transformation (linear/affine) to the track point.

Parameters
[in]gThe Lie group class instance to apply.

Member Data Documentation

◆ haveMeas

haveMeas

◆ params

params

◆ tpt

tpt

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