TemplateTrackerMIForwardAdditional¶
- class TemplateTrackerMIForwardAdditional(self)¶
Bases:
TemplateTrackerMI
The algorithm implemented in this class is described in [12] and [31] .
Default constructor.
Methods
Default constructor.
Inherited Methods
HESSIAN_EXACT
HESSIAN_YOUCEF
Hessian computation.
HESSIAN_d2I
Set the pixel sampling parameters along the rows and the columns.
Initialize the reference template from a vector of points.
Select the reference template in image I using mouse click.
HESSIAN_0
BSPLINE_FOURTH_ORDER
Initialize the reference template from a vector of points.
BSPLINE_THIRD_ORDER
By default Brent usage is disabled.
Overloaded function.
USE_HESSIEN_BEST_COND
HESSIAN_NONSECOND
USE_HESSIEN_NORMAL
Set the threshold used to stop optimization loop.
Track the template on image I .
Hessian computation.
USE_HESSIEN_DESIRE
Reset the tracker by freeing the memory allocated by the template tracker during the initialization.
Hessian computation.
Set the number of pyramid levels used in the multi-resolution scheme.
Return the reference template zone.
Overloaded function.
Set the maximum number of iteration of the estimation scheme.
HESSIAN_NEW
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 MinimizationTypeMIForwardAdditional(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.TemplateTrackerMIForwardAdditional.MinimizationTypeMIForwardAdditional) 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.
- 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 ¶