TemplateTrackerMIInverseCompositional¶
- class TemplateTrackerMIInverseCompositional(self)¶
Bases:
TemplateTrackerMI
The algorithm implemented in this class is described in [12] and [31] .
Default constructor.
Methods
Default constructor.
- return:
A tuple containing:
Use only the strong gradient pixels to compute the Jabobian.
Inherited Methods
Set the number of pyramid levels used in the multi-resolution scheme.
HESSIAN_YOUCEF
HESSIAN_NONSECOND
USE_HESSIEN_NORMAL
Reset the tracker by freeing the memory allocated by the template tracker during the initialization.
Overloaded function.
Set the pixel sampling parameters along the rows and the columns.
Set the threshold used to stop optimization loop.
Hessian computation.
Select the reference template in image I using mouse click.
By default Brent usage is disabled.
Initialize the reference template from a vector of points.
HESSIAN_NEW
Track the template on image I .
Return the reference template zone.
HESSIAN_d2I
BSPLINE_FOURTH_ORDER
HESSIAN_EXACT
Hessian computation.
HESSIAN_0
Initialize the reference template from a vector of points.
USE_HESSIEN_DESIRE
USE_HESSIEN_BEST_COND
Hessian computation.
Overloaded function.
Set the maximum number of iteration of the estimation scheme.
BSPLINE_THIRD_ORDER
Operators
__doc__
Default constructor.
__module__
Attributes
BSPLINE_FOURTH_ORDER
BSPLINE_THIRD_ORDER
HESSIAN_0
HESSIAN_EXACT
HESSIAN_NEW
HESSIAN_NONSECOND
HESSIAN_YOUCEF
HESSIAN_d2I
USE_GRADIENT
USE_HESSIEN_BEST_COND
USE_HESSIEN_DESIRE
USE_HESSIEN_NORMAL
USE_LMA
USE_NEWTON
USE_QUASINEWTON
__annotations__
- class BsplineType(self, value: int)¶
Bases:
pybind11_object
Hessian computation.
Values:
BSPLINE_THIRD_ORDER
BSPLINE_FOURTH_ORDER
- class HessienApproximationType(self, value: int)¶
Bases:
pybind11_object
Hessian computation.
Values:
BSPLINE_THIRD_ORDER
BSPLINE_FOURTH_ORDER
- class HessienType(self, value: int)¶
Bases:
pybind11_object
Hessian computation.
Values:
BSPLINE_THIRD_ORDER
BSPLINE_FOURTH_ORDER
- class MinimizationTypeMIInverseCompositional(self, value: int)¶
Bases:
pybind11_object
Minimization method.
Values:
USE_NEWTON
USE_LMA
USE_GRADIENT
USE_QUASINEWTON
- __init__(self)¶
Default constructor.
- display(*args, **kwargs)¶
Overloaded function.
display(self: visp._visp.tt.TemplateTracker, I: visp._visp.core.ImageGray, col: visp._visp.core.Color = vpColor::green, thickness: int = 3) -> None
Display the warped reference template in an image.
The following code shows how to use display capabilities:
#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> #include <visp3/tt/vpTemplateTrackerWarpHomography.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpImage<unsigned char> I; vpTemplateTrackerWarpHomography warp; vpTemplateTrackerSSDInverseCompositional tracker(&warp); vpTemplateTrackerZone zoneRef, zoneWarped; // Display the warped zone tracker.display(I, vpColor::red); // Display the reference zone zoneRef = tracker.getZoneRef(); zoneRef.display(I, vpColor::green); // Display the warped zone vpColVector p = tracker.getp(); warp.warpZone(zoneRef, p, zoneWarped); zoneWarped.display(I, vpColor::blue); }
- Parameters:
- I
Image in which the warped zone has to be displayed.
- col
Color used to draw the triangle edges.
- thickness
Thickness of the lines.
display(self: visp._visp.tt.TemplateTracker, I: visp._visp.core.ImageRGBa, col: visp._visp.core.Color = vpColor::green, thickness: int = 3) -> None
Display the warped reference template in an image.
The following code shows how to use display capabilities:
#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> #include <visp3/tt/vpTemplateTrackerWarpHomography.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpImage<vpRGBa> I; vpTemplateTrackerWarpHomography warp; vpTemplateTrackerSSDInverseCompositional tracker(&warp); vpTemplateTrackerZone zoneRef, zoneWarped; // Display the warped zone tracker.display(I, vpColor::red); // Display the reference zone zoneRef = tracker.getZoneRef(); zoneRef.display(I, vpColor::green); // Display the warped zone vpColVector p = tracker.getp(); warp.warpZone(zoneRef, p, zoneWarped); zoneWarped.display(I, vpColor::blue); }
- Parameters:
- I
Image in which the warped zone has to be displayed.
- col
Color used to draw the triangle edges.
- thickness
Thickness of the lines.
- getCovarianceMatrix(self) visp._visp.core.Matrix ¶
- getG(self) visp._visp.core.ColVector ¶
- getH(self) visp._visp.core.Matrix ¶
- getMI(*args, **kwargs)¶
Overloaded function.
getMI(self: visp._visp.tt_mi.TemplateTrackerMI) -> float
getMI(self: visp._visp.tt_mi.TemplateTrackerMI, I: visp._visp.core.ImageGray, nc: int, bspline: int, tp: visp._visp.core.ColVector) -> tuple[float, int]
- Returns:
A tuple containing:
nc
- getMI256(self, I: visp._visp.core.ImageGray, tp: visp._visp.core.ColVector) float ¶
- getZoneRef(self) visp._visp.tt.TemplateTrackerZone ¶
Return the reference template zone.
- getdp(self) visp._visp.core.ColVector ¶
- getp(self) visp._visp.core.ColVector ¶
- initClick(self, I: visp._visp.core.ImageGray, delaunay: bool = false) None ¶
Select the reference template in image I using mouse click.
- Parameters:
- I: visp._visp.core.ImageGray¶
Image containing the reference template.
- delaunay: bool = false¶
Flag used to enable Delaunay triangulation.
If true, from the image points selected by the user, a Delaunay triangulation is performed to initialize the reference template.
A left click select a image point;
A right click select the last image point and ends the initialisation stage.
If false, the user select directly points as successive triangle corners. The size of v_ip vector should be a multiple of 3. It is not mandatory that triangles have one edge in common; they can define a discontinued area.
A left click select a triangle corner;
A right click select the last triangle corner and ends the initialisation stage. For example, to select the reference template as two triangles, the user has to left click five times and finish the selection on the sixth corner with a right click.
- initFromPoints(self, I: visp._visp.core.ImageGray, v_ip: list[visp._visp.core.ImagePoint], delaunay: bool = false) None ¶
Initialize the reference template from a vector of points.
- Parameters:
- I: visp._visp.core.ImageGray¶
Image containing the reference template.
- v_ip: list[visp._visp.core.ImagePoint]¶
Vector of image points defining the reference template.
- delaunay: bool = false¶
If true, from the image points defining the reference template enable Delaunay triangulation.
If false, the vector of image points define the reference template as a list of triangles. The size of v_ip vector should be a multiple of 3.
- initFromZone(self, I: visp._visp.core.ImageGray, zone: visp._visp.tt.TemplateTrackerZone) None ¶
Initialize the reference template from a vector of points.
- Parameters:
- I: visp._visp.core.ImageGray¶
Image containing the reference template.
- zone: visp._visp.tt.TemplateTrackerZone¶
The zone that describes the reference template.
- resetTracker(self) None ¶
Reset the tracker by freeing the memory allocated by the template tracker during the initialization.
- setApprocHessian(self, approx: visp._visp.tt_mi.TemplateTrackerMI.HessienApproximationType) None ¶
- setBspline(self, newbs: visp._visp.tt_mi.TemplateTrackerMI.BsplineType) None ¶
- setHDes(self, tH: visp._visp.core.Matrix) None ¶
- setHessianComputation(self, type: visp._visp.tt_mi.TemplateTrackerMI.HessienType) None ¶
- setMinimizationMethod(self, method: visp._visp.tt_mi.TemplateTrackerMIInverseCompositional.MinimizationTypeMIInverseCompositional) None ¶
- setPyramidal(self, nlevels: int = 2, level_to_stop: int = 1) None ¶
Set the number of pyramid levels used in the multi-resolution scheme. If nlevels > 1, the tracker uses a pyramidal approach.
- setSampling(self, sample_i: int, sample_j: int) None ¶
Set the pixel sampling parameters along the rows and the columns.
- setThresholdResidualDifference(self, threshold: float) None ¶
Set the threshold used to stop optimization loop. When the residual difference between two successive iterations becomes lower than the threshold we stop optimization loop.
Note
Increasing the default value allows to speed up the tracking.
- setUseTemplateSelect(self, b: bool) None ¶
Use only the strong gradient pixels to compute the Jabobian. By default this feature is disabled.
- setp(self, tp: visp._visp.core.ColVector) None ¶
- track(self, I: visp._visp.core.ImageGray) None ¶
Track the template on image I .
- Parameters:
- I: visp._visp.core.ImageGray¶
Image to process.
- trackRobust(self, I: visp._visp.core.ImageGray) None ¶