FeatureMomentCInvariant

class FeatureMomentCInvariant

Bases: FeatureMoment

Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature. Computes the interaction matrix associated with vpMomentCInvariant .

The interaction matrix for the moment feature can be deduced from [40] , equations (9). To do so, one must derive them and obtain a combination of interaction matrices by using (1). It allows to compute the interaction matrix for \(c_i, i \in [1..10]\) .

These interaction matrices may be selected afterwards by calling vpFeatureMomentCInvariant::interaction() . The selection by the vpFeatureMomentCInvariant::selectCi method for \(L_{c_i}\) . For example, to select \(L_{c_1}\) you should input vpFeatureMomentCInvariant::selectC1() into ViSP’s selector. Special matrices for features \(S_x\) and \(S_y\) are selected by vpFeatureMomentCInvariant::selectSx() and vpFeatureMomentCInvariant::selectSy() respectively. Special matrices for features \(P_x\) and \(P_y\) are selected by vpFeatureMomentCInvariant::selectPx() and vpFeatureMomentCInvariant::selectPy() respectively.

These features are often used in moment-based visual servoing to control the two out-of-plane rotations.

Be careful about the nature of your object when selecting the right features. Use \(L_{S_{x}}\) and \(L_{S_{y}}\) when you’re dealing with a symmetric object all other features otherwise.

Minimum vpMomentObject order needed to compute this feature: 6. This is the highest order required by classic features.

This feature depends on:

  • vpMomentCentered

  • vpFeatureMomentCentered

  • vpMomentCInvariant

  • vpFeatureMomentBasic

An example of how to use vpFeatureMomentCInvariant in a complete visual servoing example is given in vpFeatureMomentCommon .

Methods

__init__

compute_interaction

Overloaded function.

momentName

Associated moment name.

name

Feature name.

printLsofInvariants

Print all the interaction matrices of the moment invariants

selectC1

Shortcut selector for \(C_1\) .

selectC10

Shortcut selector for \(C_{10}\) .

selectC2

Shortcut selector for \(C_2\) .

selectC3

Shortcut selector for \(C_3\) .

selectC4

Shortcut selector for \(C_4\) .

selectC5

Shortcut selector for \(C_5\) .

selectC6

Shortcut selector for \(C_6\) .

selectC7

Shortcut selector for \(C_7\) .

selectC8

Shortcut selector for \(C_8\) .

selectC9

Shortcut selector for \(C_9\) .

selectPx

Shortcut selector for \(P_x\) .

selectPy

Shortcut selector for \(P_y\) .

selectSx

Shortcut selector for \(S_x\) .

selectSy

Shortcut selector for \(S_y\) .

Inherited Methods

user

BasicFeatureSelect

Indicates who should deallocate the feature.

error

Compute the error between two visual features from a subset of the possible features.

setFlags

Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.

FEATURE_ALL

getDimension

Overloaded function.

linkTo

Links the feature to the feature's database.

getDeallocate

init

Initialize common parameters for moment features.

interaction

Retrieves the interaction matrix.

dimension_s

Return the dimension of the feature vector \(\bf s\) .

setDeallocate

selectAll

Select all the features.

printDependencies

Interface function to display the moments and other interaction matrices on which a particular vpFeatureMoment is dependent upon Not made pure to maintain compatibility Recommended : Types inheriting from vpFeatureMoment should implement this function.

display

Overloaded function.

update

Updates the interaction matrices with the image plane the camera is facing.

get_s

Get the feature vector \(\bf s\) .

BasicFeatureDeallocatorType

Indicates who should deallocate the feature.

vpServo

print

Outputs the content of the feature: it's corresponding selected moments.

Operators

__doc__

__init__

__module__

__repr__

Attributes

FEATURE_ALL

__annotations__

user

vpServo

class BasicFeatureDeallocatorType(self, value: int)

Bases: pybind11_object

Indicates who should deallocate the feature.

Values:

  • user

  • vpServo

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
class BasicFeatureSelect(self, value: int)

Bases: pybind11_object

Indicates who should deallocate the feature.

Values:

  • user

  • vpServo

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__init__(*args, **kwargs)
compute_interaction(*args, **kwargs)

Overloaded function.

  1. compute_interaction(self: visp._visp.visual_features.FeatureMomentCInvariant) -> None

Computes interaction matrix for space-scale-rotation invariants. Called internally. The moment primitives must be computed before calling this. This feature depends on:

  • vpMomentCentered

  • vpFeatureMomentCentered

  • vpMomentCInvariant

  • vpFeatureMomentBasic

  1. compute_interaction(self: visp._visp.visual_features.FeatureMoment) -> None

dimension_s(self) int

Return the dimension of the feature vector \(\bf s\) .

display(*args, **kwargs)

Overloaded function.

  1. display(self: visp._visp.visual_features.FeatureMoment, cam: visp._visp.core.CameraParameters, I: visp._visp.core.ImageGray, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Not implemented since visual representation of a moment doesn’t often make sense.

  1. display(self: visp._visp.visual_features.FeatureMoment, cam: visp._visp.core.CameraParameters, I: visp._visp.core.ImageRGBa, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Not implemented since visual representation of a moment doesn’t often make sense.

error(self, s_star: visp._visp.visual_features.BasicFeature, select: int = FEATURE_ALL) visp._visp.core.ColVector

Compute the error between two visual features from a subset of the possible features.

getDeallocate(self) visp._visp.visual_features.BasicFeature.BasicFeatureDeallocatorType
getDimension(*args, **kwargs)

Overloaded function.

  1. getDimension(self: visp._visp.visual_features.FeatureMoment, select: int = FEATURE_ALL) -> int

Feature’s dimension according to selection.

  1. getDimension(self: visp._visp.visual_features.BasicFeature, select: int = FEATURE_ALL) -> int

Get the feature vector dimension.

get_s(self, select: int = FEATURE_ALL) visp._visp.core.ColVector

Get the feature vector \(\bf s\) .

init(self) None

Initialize common parameters for moment features.

interaction(self, select: int = FEATURE_ALL) visp._visp.core.Matrix

Retrieves the interaction matrix. No computation is done.

There is no rule about the format of the feature selector. It may be different for different features. For example, for vpFeatureMomentBasic or vpFeatureMomentCentered features, select may refer to the \((i,j)\) couple in the \(j \times order + i\) format, but for vpFeatureMomentCInvariant the selector allows to select couples \((i,j,k,l...)\) in the following format: 1 << i

  • 1 << j + 1 << k + 1 << l.

Parameters:
select: int = FEATURE_ALL

Feature selector.

Returns:

The corresponding interaction matrix.

linkTo(self, featureMoments: visp._visp.visual_features.FeatureMomentDatabase) None

Links the feature to the feature’s database.

Note

The feature’s database is different from the moment’s database.

Parameters:
featureMoments: visp._visp.visual_features.FeatureMomentDatabase

database in which the moment features are stored.

momentName(self) str

Associated moment name.

name(self) str

Feature name.

print(self, select: int = FEATURE_ALL) None

Outputs the content of the feature: it’s corresponding selected moments.

printDependencies(self: visp._visp.visual_features.FeatureMoment, os: std::ostream) None

Interface function to display the moments and other interaction matrices on which a particular vpFeatureMoment is dependent upon Not made pure to maintain compatibility Recommended : Types inheriting from vpFeatureMoment should implement this function.

printLsofInvariants(self: visp._visp.visual_features.FeatureMomentCInvariant, os: std::ostream) None

Print all the interaction matrices of the moment invariants

Print out all invariants that were computed There are 15 of them, as in [Point-based and region based.ITRO05] [40]

static selectAll() int

Select all the features.

static selectC1() int

Shortcut selector for \(C_1\) .

static selectC10() int

Shortcut selector for \(C_{10}\) .

static selectC2() int

Shortcut selector for \(C_2\) .

static selectC3() int

Shortcut selector for \(C_3\) .

static selectC4() int

Shortcut selector for \(C_4\) .

static selectC5() int

Shortcut selector for \(C_5\) .

static selectC6() int

Shortcut selector for \(C_6\) .

static selectC7() int

Shortcut selector for \(C_7\) .

static selectC8() int

Shortcut selector for \(C_8\) .

static selectC9() int

Shortcut selector for \(C_9\) .

static selectPx() int

Shortcut selector for \(P_x\) .

static selectPy() int

Shortcut selector for \(P_y\) .

static selectSx() int

Shortcut selector for \(S_x\) .

static selectSy() int

Shortcut selector for \(S_y\) .

setDeallocate(self, d: visp._visp.visual_features.BasicFeature.BasicFeatureDeallocatorType) None
setFlags(self) None

Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.

update(self, A: float, B: float, C: float) None

Updates the interaction matrices with the image plane the camera is facing. The plane must be in the format: \(\frac{1}{Z}=Ax+By+C\) . The moment primitives MUST be updated before calling this function.

This method also computes the interaction matrix. Therefore, you must call vpFeatureMoment::update before calling vpFeatureMoment::interaction .

Warning

The behaviour of this method is not the same as vpMoment::update which only acknowledges the new object. This method also computes the interaction matrices.