FeatureVanishingPoint

class FeatureVanishingPoint(self)

Bases: BasicFeature

Class that defines 2D vanishing point visual features. Various features can be considered:

  • Either the cartesian coordinates \((x, y)\) of the vanishing point obtained from the intersection of two lines; in that case \({\bf s} = (x, y)\) and the corresponding interaction matrices are:

    \[L_x = \left[ \begin{array}{cccccc} 0 & 0 & 0 & x y & -(1 + x^2) & y \end{array} \right] \]
    \[L_y = \left[ \begin{array}{cccccc} 0 & 0 & 0 & 1 + y * y & -xy & -x \end{array} \right] \]
  • Rather features function of the polar coordinates of the vanishing point obtained themselves from the polar coordinates of the two lines \((\rho_1, \theta_1)\) and \((\rho_2, \theta_2)\) ; in that case \({\bf s} = (\arctan(1/\rho), 1/\rho, \alpha)\) with:

    \[1/\rho = \frac{\sin(\theta_1 - \theta_2)}{\sqrt{\rho_1^2 + \rho_2^2 - 2 \rho_1 \rho_2 cos(\theta_1 - \theta_2)}} \]
    \[\alpha = \frac{\rho_1 \cos \theta_2 - \rho_2 cos \theta_1}{\sqrt{\rho_1^2 + \rho_2^2 - 2 \rho_1 \rho_2 cos(\theta_1 - \theta_2)}} \]

The corresponding interaction matrices are:

\[L_{\arctan(\frac{1}{\rho})} = \left[ \begin{array}{cccccc} 0 & 0 & 0 & - \sin \alpha & \cos \alpha & 0 \end{array} \right] \]
\[L_{\frac{1}{\rho}} = \left[ \begin{array}{cccccc} 0 & 0 & 0 & -(1 + \frac{1}{\rho^2}) \sin \alpha & (1 + \frac{1}{\rho^2}) \cos \alpha & 0 \end{array} \right] \]
\[L_{\alpha} = \left[ \begin{array}{cccccc} 0 & 0 & 0 & \frac{\cos \alpha}{\rho} & \frac{\sin \alpha}{\rho} & -1 \end{array} \right] \]

Default constructor that calls init() .

Methods

__init__

Default constructor that calls init() .

buildFrom

Set vanishing point visual feature \({\bf s} = (x, y)\) from cartesian coordinates.

display

Overloaded function.

error

Overloaded function.

getAlpha

Get vanishing point feature \(\alpha\) value.

getAtanOneOverRho

Get vanishing point feature \(\arctan(1/\rho)\) value.

getOneOverRho

Get vanishing point feature \(1/\rho\) value.

get_x

Get vanishing point feature \(x\) value.

get_y

Get vanishing point feature \(y\) value.

init

Vanishing point visual feature initialization.

interaction

Compute the interaction matrix from a subset of the possible features.

print

Print vanishing point features values to stdout.

selectAlpha

Select \(s = \theta\) visual feature.

selectAtanOneOverRho

Select visual feature \(s = \arctan(1/\rho)\) .

selectOneOverRho

Select visual feature \(s = 1/\rho\) .

selectX

Select visual feature \(s = x\) .

selectY

Select visual feature \(s = y\) .

setAlpha

Set vanishing point feature \(\alpha\) value.

setAtanOneOverRho

Set vanishing point feature \(\arctan(1/\rho)\) value.

setOneOverRho

Set vanishing point feature \(1/\rho\) value.

set_x

Set vanishing point feature \(x\) value.

set_xy

Set vanishing point visual feature \({\bf s} = (x, y)\) from cartesian coordinates.

set_y

Set vanishing point feature \(y\) value.

Inherited Methods

user

BasicFeatureSelect

Indicates who should deallocate the feature.

setFlags

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

FEATURE_ALL

getDimension

Get the feature vector dimension.

getDeallocate

dimension_s

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

setDeallocate

selectAll

Select all the features.

get_s

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

BasicFeatureDeallocatorType

Indicates who should deallocate the feature.

vpServo

Operators

__doc__

__init__

Default constructor that calls init() .

__module__

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__(self)

Default constructor that calls init() .

buildFrom(self, x: float, y: float) None

Set vanishing point visual feature \({\bf s} = (x, y)\) from cartesian coordinates. Same as set_xy() .

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.FeatureVanishingPoint, cam: visp._visp.core.CameraParameters, I: visp._visp.core.ImageGray, color: visp._visp.core.Color = vpColor::green, thickness: int = 1) -> None

Display vanishing point feature.

Parameters:
cam

Camera parameters.

I

Image.

color

Color to use for the display.

thickness

Thickness of the feature representation.

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

Display vanishing point feature.

Parameters:
cam

Camera parameters.

I

color Image.

color

Color to use for the display.

thickness

Thickness of the feature representation.

error(*args, **kwargs)

Overloaded function.

  1. error(self: visp._visp.visual_features.FeatureVanishingPoint, s_star: visp._visp.visual_features.BasicFeature, select: int = (vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY())) -> visp._visp.core.ColVector

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

Parameters:
s_star

Desired visual feature \({\bf s}^*\) .

select

Feature selector. Value is either selectX() to select x visual feature, selectY() for y visual feature, selectOneOverRho() for \(1/\rho\) , or selectAlpha() for \(\alpha\) visual feature. You can also use a combination like selectX() | selectY() to select x and y visual features.

  1. error(self: visp._visp.visual_features.BasicFeature, 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.

getAlpha(self) float

Get vanishing point feature \(\alpha\) value.

getAtanOneOverRho(self) float

Get vanishing point feature \(\arctan(1/\rho)\) value.

getDeallocate(self) visp._visp.visual_features.BasicFeature.BasicFeatureDeallocatorType
getDimension(self, select: int = FEATURE_ALL) int

Get the feature vector dimension.

getOneOverRho(self) float

Get vanishing point feature \(1/\rho\) value.

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

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

get_x(self) float

Get vanishing point feature \(x\) value.

get_y(self) float

Get vanishing point feature \(y\) value.

init(self) None

Vanishing point visual feature initialization.

interaction(self: visp._visp.visual_features.FeatureVanishingPoint, select: int = (vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY())) visp._visp.core.Matrix

Compute the interaction matrix from a subset of the possible features.

Parameters:
select

Feature selector. Value is either selectX() to select x visual feature, selectY() for y visual feature, selectOneOverRho() for \(1/\rho\) , or selectAlpha() for \(\alpha\) visual feature. You can also use a combination like selectX() | selectY() to select x and y visual features.

print(self: visp._visp.visual_features.FeatureVanishingPoint, select: int = (vpFeatureVanishingPoint::selectX()|vpFeatureVanishingPoint::selectY())) None

Print vanishing point features values to stdout.

Parameters:
select

Use either selectX() to display x value, selectY() to display y value, select selectOneOverRho() to display \(1/\rho\) value, or selectAlpha() to display \(\alpha\) value. You can also use a combination like selectX() | selectY() to display x and y values.

static selectAll() int

Select all the features.

static selectAlpha() int

Select \(s = \theta\) visual feature.

static selectAtanOneOverRho() int

Select visual feature \(s = \arctan(1/\rho)\) .

static selectOneOverRho() int

Select visual feature \(s = 1/\rho\) .

static selectX() int

Select visual feature \(s = x\) .

static selectY() int

Select visual feature \(s = y\) .

setAlpha(self, alpha: float) None

Set vanishing point feature \(\alpha\) value.

setAtanOneOverRho(self, atan_one_over_rho: float) None

Set vanishing point feature \(\arctan(1/\rho)\) value.

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.

setOneOverRho(self, one_over_rho: float) None

Set vanishing point feature \(1/\rho\) value.

set_x(self, x: float) None

Set vanishing point feature \(x\) value.

set_xy(self, x: float, y: float) None

Set vanishing point visual feature \({\bf s} = (x, y)\) from cartesian coordinates. Same as buildFrom() .

set_y(self, y: float) None

Set vanishing point feature \(y\) value.