FeatureMomentAlpha

class FeatureMomentAlpha

Bases: FeatureMoment

Functionality computation for in-plane rotation moment feature \(\alpha\) : computes the interaction matrix associated with vpMomentAlpha .

The interaction matrix for the feature can be deduced from [42] .

This class computes the interaction matrix associated to \(\alpha = \frac{1}{2} arctan(\frac{2\mu_{11}}{\mu_{20}-\mu_{02}})\) moment primitive.

The interaction matrix for the feature has the following form:

\[\begin{split}{ \left[ \begin {array}{c} {\frac {\mu_{{1,1}}{\it DA}\,A}{d}}+{\frac { \left( {\it DA}\,\mu_{{0,2}}+1/2\,d-1/2\,{{\it DA}}^{2} \right) B}{d} }\\\noalign{\medskip}{\frac { \left( {\it DA}\,\mu_{{0,2}}-1/2\,d-1/2 \,{{\it DA}}^{2} \right) A}{d}}-{\frac {B\mu_{{1,1}}{\it DA}}{d}} \\\noalign{\medskip}Bw_{{x}}-Aw_{{y}}\\\noalign{\medskip}{\frac { \beta\, \left( \mu_{{1,2}} \left( \mu_{{2,0}}-\mu_{{0,2}} \right) +\mu _{{1,1}} \left( \mu_{{0,3}}-\mu_{{2,1}} \right) \right) +\gamma\,x_{{ g}} \left( \mu_{{0,2}} \left( \mu_{{2,0}}-\mu_{{0,2}} \right) -2\,{\mu _{{1,1}}}^{2} \right) +\gamma\,y_{{g}}\mu_{{1,1}} \left( \mu_{{2,0}}+ \mu_{{0,2}} \right) }{d}}\\\noalign{\medskip}{\frac {\beta\, \left( \mu_{{2,1}} \left( \mu_{{0,2}}-\mu_{{2,0}} \right) +\mu_{{1,1}} \left( \mu_{{3,0}}-\mu_{{1,2}} \right) \right) +\gamma\,x_{{g}}\mu_{ {1,1}} \left( \mu_{{2,0}}+\mu_{{0,2}} \right) +\gamma\,y_{{g}} \left( \mu_{{2,0}} \left( \mu_{{0,2}}-\mu_{{2,0}} \right) -2\,{\mu_{{1,1}}}^{ 2} \right) }{d}}\\\noalign{\medskip}-1\end {array} \right] }^t \end{split}\]

with \({\it DA} = \mu_{{2,0}}-\mu_{{0,2}}\) and \({\it d} = DA^2+4{\mu_{1,1}}^2\) .

  • In the discrete case: \(beta = 4\) , \(gamma = 2\) .

  • In the dense case: \(beta = 5\) , \(gamma = 1\) .

The interaction matrix computed is single-dimension (no selection possible) and can be obtained by calling vpFeatureMomentAlpha::interaction() .

This feature is often used in moment-based visual servoing to control the planar rotation parameter.

Minimum vpMomentObject order needed to compute this feature: 4.

This feature depends on:

  • vpMomentCentered

  • vpMomentGravityCenter

Methods

__init__

compute_interaction

Overloaded function.

error

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

momentName

Associated moment name.

name

Feature name.

Inherited Methods

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.

BasicFeatureSelect

Indicates who should deallocate the feature.

vpServo

deallocate

dimension_s

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

linkTo

Links the feature to the feature's database.

s

user

getDeallocate

nbParameters

print

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

BasicFeatureDeallocatorType

Indicates who should deallocate the feature.

selectAll

Select all the features.

setDeallocate

dim_s

interaction

Retrieves the interaction matrix.

get_s

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

update

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

FEATURE_ALL

setFlags

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

display

Overloaded function.

init

Initialize common parameters for moment features.

getDimension

Overloaded function.

Operators

__doc__

__init__

__module__

Attributes

FEATURE_ALL

__annotations__

deallocate

dim_s

nbParameters

s

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.FeatureMomentAlpha) -> None

Computes interaction matrix for alpha moment. Called internally. The moment primitives must be computed before calling this. This feature depends on:

  • vpMomentCentered

  • vpMomentGravityCenter

  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.

static selectAll() int

Select all the features.

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.