MeSite¶
- class MeSite(*args, **kwargs)¶
Bases:
pybind11_object
Performs search in a given direction(normal) for a given distance(pixels) for a given ‘site’. Gives the most likely site given the probability from an ME mask.
Bug fix: rewrote application of masks to use the temporal information instead of applying both temporal masks to the same image. ie: spatial -> spatio/temporal
Added new tracking function to choose the most similar edge amongst all edges found.
sample step.
Overloaded function.
__init__(self: visp._visp.me.MeSite) -> None
Default constructor.
__init__(self: visp._visp.me.MeSite, ip: float, jp: float) -> None
Constructor from pixel coordinates.
__init__(self: visp._visp.me.MeSite, mesite: visp._visp.me.MeSite) -> None
Copy constructor.
Methods
Overloaded function.
Get the final computed likelihood threshold value, depending on the likelihood threshold type and ME settings.
Overloaded function.
Overloaded function.
Compute the square root distance between two moving-edges sites \(|S1 - S2| = \sqrt{(i_1-i_2)^2+(j_1-j_2)^2}\)
Get the angle of tangent at site.
Get the contrast threshold of the site.
Get the state of the site.
Return site weight or uncertainty as a probability between 0 and 1.
Return integer coordinate along i (rows).
Return subpixel coordinate along i (rows).
Return integer coordinate along j (columns).
Return subpixel coordinate along j (columns).
Overloaded function.
Set the angle of tangent at site.
Set the contrast threshold of the site.
Display selector.
Set the weight or uncertainty of the site.
Compute the square distance between two moving-edges sites \(|S1 - S2| = (i_1-i_2)^2+(j_1-j_2)^2\)
Similar to the track() function, but stores the best numCandidates hypotheses in outputHypotheses .
Inherited Methods
Operators
__doc__
Overloaded function.
__module__
Comparison operator.
__repr__
Attributes
CONTRAST
M_ESTIMATOR
NONE
NO_SUPPRESSION
OUTSIDE_ROI_MASK
RANGE
RANGE_RESULT
RESULT
THRESHOLD
TOO_NEAR
UNKNOW
__annotations__
alpha
contrastThreshold
convlt
i
ifloat
j
jfloat
mask_sign
normGradient
weight
- class MeSiteDisplayType(self, value: int)¶
Bases:
pybind11_object
Moving-edge site state
Values:
NO_SUPPRESSION: Point successfully tracked.
CONTRAST: Point not tracked due to a contrast problem, but retained in the ME list.
CONSTRAST: Deprecated. Point not tracked due to a likelihood problem, but retained in the ME list. Use instead CONTRAST.
THRESHOLD: Point not tracked due to the likelihood that is below the threshold, but retained in the ME list.
M_ESTIMATOR: Point detected as an outlier during virtual visual-servoing.
TOO_NEAR: Point not tracked anymore, since too near from its neighbor.
UNKNOW: Reserved.
OUTSIDE_ROI_MASK: Point is outside the region of interest mask, but retained in the ME list.
- class MeSiteState(self, value: int)¶
Bases:
pybind11_object
Moving-edge site state
Values:
NO_SUPPRESSION: Point successfully tracked.
CONTRAST: Point not tracked due to a contrast problem, but retained in the ME list.
CONSTRAST: Deprecated. Point not tracked due to a likelihood problem, but retained in the ME list. Use instead CONTRAST.
THRESHOLD: Point not tracked due to the likelihood that is below the threshold, but retained in the ME list.
M_ESTIMATOR: Point detected as an outlier during virtual visual-servoing.
TOO_NEAR: Point not tracked anymore, since too near from its neighbor.
UNKNOW: Reserved.
OUTSIDE_ROI_MASK: Point is outside the region of interest mask, but retained in the ME list.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.me.MeSite) -> None
Default constructor.
__init__(self: visp._visp.me.MeSite, ip: float, jp: float) -> None
Constructor from pixel coordinates.
__init__(self: visp._visp.me.MeSite, mesite: visp._visp.me.MeSite) -> None
Copy constructor.
- __ne__(self, m: visp.me.MeSite) int ¶
Comparison operator.
- computeFinalThreshold(self, me: visp.me.Me) float ¶
Get the final computed likelihood threshold value, depending on the likelihood threshold type and ME settings.
- Returns:
value of the contrast threshold of the site.
- display(*args, **kwargs)¶
Overloaded function.
display(self: visp._visp.me.MeSite, I: visp._visp.core.ImageGray) -> None
Display moving edges in image I.
- Parameters:
- I
Input image.
display(self: visp._visp.me.MeSite, I: visp._visp.core.ImageRGBa) -> None
Display moving edges in image I.
- Parameters:
- I
Input image.
- static displayMeSite(*args, **kwargs)¶
Overloaded function.
displayMeSite(I: visp._visp.core.ImageGray, i: float, j: float, state: visp._visp.me.MeSite.MeSiteState = NO_SUPPRESSION) -> None
displayMeSite(I: visp._visp.core.ImageRGBa, i: float, j: float, state: visp._visp.me.MeSite.MeSiteState = NO_SUPPRESSION) -> None
- static distance(S1: visp.me.MeSite, S2: visp.me.MeSite) float ¶
Compute the square root distance between two moving-edges sites \(|S1 - S2| = \sqrt{(i_1-i_2)^2+(j_1-j_2)^2}\)
Note
See sqrDistance()
- Parameters:
- S1: visp.me.MeSite¶
First site
- S2: visp.me.MeSite¶
Second site
- Returns:
the distance between the two sites.
- getContrastThreshold(self) float ¶
Get the contrast threshold of the site.
- Returns:
value of the contrast threshold of the site.
- getState(self) visp.me.MeSite.MeSiteState ¶
Get the state of the site.
- Returns:
flag corresponding to vpMeSiteState
- init(*args, **kwargs)¶
Overloaded function.
init(self: visp._visp.me.MeSite) -> None
Initialize moving-edge site with default parameters.
init(self: visp._visp.me.MeSite, ip: float, jp: float, alphap: float) -> None
Initialize moving-edge site parameters.
init(self: visp._visp.me.MeSite, ip: float, jp: float, alphap: float, convltp: float) -> None
Initialize moving-edge site parameters.
init(self: visp._visp.me.MeSite, ip: float, jp: float, alphap: float, convltp: float, sign: int) -> None
Initialize moving-edge site parameters.
init(self: visp._visp.me.MeSite, ip: float, jp: float, alphap: float, convltp: float, sign: int, contrastThreshold: float) -> None
Initialize moving-edge site parameters.
- setContrastThreshold(self, thresh: float, me: visp.me.Me) None ¶
Set the contrast threshold of the site. If the vpMe::m_useAutomaticThreshold is set to false, the contrast threshold is set to the global value retrieved using vpMe::getThreshold() . This value can be set using vpMe::setThreshold() . Otherwise, the contrast threshold will be set to the highest value between thresh and the minimum value set by vpMe::setMinThreshold() that could be retrieved using vpMe::getMinThreshold() .
- Parameters:
- thresh: float¶
new value of contrast threshold
- me: visp.me.Me¶
moving-edge parameters
- setDisplay(self, select: visp.me.MeSite.MeSiteDisplayType) None ¶
Display selector.
- setState(self, flag: visp.me.MeSite.MeSiteState) None ¶
- static sqrDistance(S1: visp.me.MeSite, S2: visp.me.MeSite) float ¶
Compute the square distance between two moving-edges sites \(|S1 - S2| = (i_1-i_2)^2+(j_1-j_2)^2\)
Note
See distance()
- Parameters:
- S1: visp.me.MeSite¶
First site
- S2: visp.me.MeSite¶
Second site
- Returns:
The square distance between the two sites.
- trackMultipleHypotheses(self, I: visp.core.ImageGray, me: visp.me.Me, test_contrast: bool, outputHypotheses: list[visp.me.MeSite], numCandidates: int) list[visp.me.MeSite] ¶
Similar to the track() function, but stores the best numCandidates hypotheses in outputHypotheses . The best matching hypotheses (if it is not suppressed) is assigned to this and is stored as the first element of outputHypotheses . The hypotheses are sorted from best to worst match in the vector. A match may be in the vector but mark as suppressed. If this is undesired, you should filter them afterwards.
Warning
To display the moving edges graphics a call to vpDisplay::flush() is needed after this function.
- Returns:
A tuple containing:
outputHypotheses