TemplateTrackerSSDForwardCompositional¶
- class TemplateTrackerSSDForwardCompositional¶
Bases:
TemplateTrackerSSD
The algorithm implemented in this class is described in [1] and [31] .
Methods
Inherited Methods
Set the threshold used to stop optimization loop.
Set the convergence gain used in the estimation scheme.
Track the template on image I .
Set the pixel sampling parameters along the rows and the columns.
Reset the tracker by freeing the memory allocated by the template tracker during the initialization.
Initialize the reference template from a vector of points.
Select the reference template in image I using mouse click.
Set the number of pyramid levels used in the multi-resolution scheme.
Initialize the reference template from a vector of points.
Return the reference template zone.
By default Brent usage is disabled.
Overloaded function.
Overloaded function.
Set the maximum number of iteration of the estimation scheme.
Operators
__doc__
__module__
Attributes
__annotations__
- __init__(*args, **kwargs)¶
- 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.
- getG(self) visp._visp.core.ColVector ¶
- getH(self) visp._visp.core.Matrix ¶
- getSSD(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.
- setGain(*args, **kwargs)¶
Overloaded function.
setGain(self: visp._visp.tt.TemplateTrackerSSD, g: float) -> None
setGain(self: visp._visp.tt.TemplateTracker, g: float) -> None
- setHDes(self, tH: visp._visp.core.Matrix) 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 ¶