[−][src]Struct cv::RelativeCameraPose
This contains a relative pose, which is a pose that transforms the CameraPoint
of one image into the corresponding CameraPoint
of another image. This transforms
the point from the camera space of camera A
to camera B
.
Camera space for a given camera is defined as thus:
- Origin is the optical center
- Positive z axis is forwards
- Positive y axis is up
- Positive x axis is right
Note that this is a left-handed coordinate space.
Implementations
impl RelativeCameraPose
[src]
pub fn from_parts(
rotation: Rotation<f64, U3>,
translation: Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
) -> RelativeCameraPose
[src]
rotation: Rotation<f64, U3>,
translation: Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3, U1>>::Buffer>
) -> RelativeCameraPose
Create the pose from rotation and translation.
pub fn essential_matrix(&self) -> EssentialMatrix
[src]
Generates an essential matrix corresponding to this relative camera pose.
If a point a
is transformed using [RelativeCameraPose::transform
] into
a point b
, then the essential matrix returned by this method will
give a residual of approximately 0.0
when you call
essential.residual(&FeatureMatch(a, b))
.
See the documentation of EssentialMatrix
for more information.
pub fn inverse(&self) -> RelativeCameraPose
[src]
Inverses the pose such that it now swaps which camera it is transfering from and to.
Methods from Deref<Target = Isometry<f64, U3, Rotation<f64, U3>>>
#[must_use = "Did you mean to use inverse_mut()?"]pub fn inverse(&self) -> Isometry<N, D, R>
[src]
Inverts self
.
Example
let iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2); let inv = iso.inverse(); let pt = Point2::new(1.0, 2.0); assert_eq!(inv * (iso * pt), pt);
pub fn inverse_mut(&mut self)
[src]
Inverts self
in-place.
Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2); let pt = Point2::new(1.0, 2.0); let transformed_pt = iso * pt; iso.inverse_mut(); assert_eq!(iso * transformed_pt, pt);
pub fn append_translation_mut(&mut self, t: &Translation<N, D>)
[src]
Appends to self
the given translation in-place.
Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2); let tra = Translation2::new(3.0, 4.0); // Same as `iso = tra * iso`. iso.append_translation_mut(&tra); assert_eq!(iso.translation, Translation2::new(4.0, 6.0));
pub fn append_rotation_mut(&mut self, r: &R)
[src]
Appends to self
the given rotation in-place.
Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::PI / 6.0); let rot = UnitComplex::new(f32::consts::PI / 2.0); // Same as `iso = rot * iso`. iso.append_rotation_mut(&rot); assert_relative_eq!(iso, Isometry2::new(Vector2::new(-2.0, 1.0), f32::consts::PI * 2.0 / 3.0), epsilon = 1.0e-6);
pub fn append_rotation_wrt_point_mut(&mut self, r: &R, p: &Point<N, D>)
[src]
Appends in-place to self
a rotation centered at the point p
, i.e., the rotation that
lets p
invariant.
Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2); let rot = UnitComplex::new(f32::consts::FRAC_PI_2); let pt = Point2::new(1.0, 0.0); iso.append_rotation_wrt_point_mut(&rot, &pt); assert_relative_eq!(iso * pt, Point2::new(-2.0, 0.0), epsilon = 1.0e-6);
pub fn append_rotation_wrt_center_mut(&mut self, r: &R)
[src]
Appends in-place to self
a rotation centered at the point with coordinates
self.translation
.
Example
let mut iso = Isometry2::new(Vector2::new(1.0, 2.0), f32::consts::FRAC_PI_2); let rot = UnitComplex::new(f32::consts::FRAC_PI_2); iso.append_rotation_wrt_center_mut(&rot); // The translation part should not have changed. assert_eq!(iso.translation.vector, Vector2::new(1.0, 2.0)); assert_eq!(iso.rotation, UnitComplex::new(f32::consts::PI));
pub fn transform_point(&self, pt: &Point<N, D>) -> Point<N, D>
[src]
Transform the given point by this isometry.
This is the same as the multiplication self * pt
.
Example
let tra = Translation3::new(0.0, 0.0, 3.0); let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2); let iso = Isometry3::from_parts(tra, rot); let transformed_point = iso.transform_point(&Point3::new(1.0, 2.0, 3.0)); assert_relative_eq!(transformed_point, Point3::new(3.0, 2.0, 2.0), epsilon = 1.0e-6);
pub fn transform_vector(
&self,
v: &Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
[src]
&self,
v: &Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
Transform the given vector by this isometry, ignoring the translation component of the isometry.
This is the same as the multiplication self * v
.
Example
let tra = Translation3::new(0.0, 0.0, 3.0); let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2); let iso = Isometry3::from_parts(tra, rot); let transformed_point = iso.transform_vector(&Vector3::new(1.0, 2.0, 3.0)); assert_relative_eq!(transformed_point, Vector3::new(3.0, 2.0, -1.0), epsilon = 1.0e-6);
pub fn inverse_transform_point(&self, pt: &Point<N, D>) -> Point<N, D>
[src]
Transform the given point by the inverse of this isometry. This may be less expensive than computing the entire isometry inverse and then transforming the point.
Example
let tra = Translation3::new(0.0, 0.0, 3.0); let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2); let iso = Isometry3::from_parts(tra, rot); let transformed_point = iso.inverse_transform_point(&Point3::new(1.0, 2.0, 3.0)); assert_relative_eq!(transformed_point, Point3::new(0.0, 2.0, 1.0), epsilon = 1.0e-6);
pub fn inverse_transform_vector(
&self,
v: &Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
[src]
&self,
v: &Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>
Transform the given vector by the inverse of this isometry, ignoring the translation component of the isometry. This may be less expensive than computing the entire isometry inverse and then transforming the point.
Example
let tra = Translation3::new(0.0, 0.0, 3.0); let rot = UnitQuaternion::from_scaled_axis(Vector3::y() * f32::consts::FRAC_PI_2); let iso = Isometry3::from_parts(tra, rot); let transformed_point = iso.inverse_transform_vector(&Vector3::new(1.0, 2.0, 3.0)); assert_relative_eq!(transformed_point, Vector3::new(-3.0, 2.0, 1.0), epsilon = 1.0e-6);
pub fn to_homogeneous(
&self
) -> Matrix<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output, <DefaultAllocator as Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>>::Buffer> where
D: DimNameAdd<U1>,
R: SubsetOf<Matrix<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output, <DefaultAllocator as Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>>::Buffer>>,
DefaultAllocator: Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>,
[src]
&self
) -> Matrix<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output, <DefaultAllocator as Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>>::Buffer> where
D: DimNameAdd<U1>,
R: SubsetOf<Matrix<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output, <DefaultAllocator as Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>>::Buffer>>,
DefaultAllocator: Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>,
Converts this isometry into its equivalent homogeneous transformation matrix.
Example
let iso = Isometry2::new(Vector2::new(10.0, 20.0), f32::consts::FRAC_PI_6); let expected = Matrix3::new(0.8660254, -0.5, 10.0, 0.5, 0.8660254, 20.0, 0.0, 0.0, 1.0); assert_relative_eq!(iso.to_homogeneous(), expected, epsilon = 1.0e-6);
Trait Implementations
impl AsMut<Isometry<f64, U3, Rotation<f64, U3>>> for RelativeCameraPose
[src]
impl AsMut<RelativeCameraPose> for UnscaledRelativeCameraPose
[src]
fn as_mut(&mut self) -> &mut RelativeCameraPose
[src]
impl AsRef<Isometry<f64, U3, Rotation<f64, U3>>> for RelativeCameraPose
[src]
impl AsRef<RelativeCameraPose> for UnscaledRelativeCameraPose
[src]
fn as_ref(&self) -> &RelativeCameraPose
[src]
impl Clone for RelativeCameraPose
[src]
fn clone(&self) -> RelativeCameraPose
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RelativeCameraPose
[src]
impl Debug for RelativeCameraPose
[src]
impl Deref for RelativeCameraPose
[src]
type Target = Isometry<f64, U3, Rotation<f64, U3>>
The resulting type after dereferencing.
fn deref(&self) -> &<RelativeCameraPose as Deref>::Target
[src]
impl DerefMut for RelativeCameraPose
[src]
fn deref_mut(&mut self) -> &mut <RelativeCameraPose as Deref>::Target
[src]
impl From<Isometry<f64, U3, Rotation<f64, U3>>> for RelativeCameraPose
[src]
impl From<RelativeCameraPose> for Isometry<f64, U3, Rotation<f64, U3>>
[src]
impl From<RelativeCameraPose> for UnscaledRelativeCameraPose
[src]
fn from(original: RelativeCameraPose) -> UnscaledRelativeCameraPose
[src]
impl From<UnscaledRelativeCameraPose> for RelativeCameraPose
[src]
fn from(original: UnscaledRelativeCameraPose) -> RelativeCameraPose
[src]
impl PartialEq<RelativeCameraPose> for RelativeCameraPose
[src]
fn eq(&self, other: &RelativeCameraPose) -> bool
[src]
fn ne(&self, other: &RelativeCameraPose) -> bool
[src]
impl Pose for RelativeCameraPose
[src]
type InputPoint = CameraPoint
type OutputPoint = CameraPoint
fn transform_jacobians(
&self,
input: <RelativeCameraPose as Pose>::InputPoint
) -> (<RelativeCameraPose as Pose>::OutputPoint, Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>, Matrix<f64, U6, U3, <DefaultAllocator as Allocator<f64, U6, U3>>::Buffer>)
[src]
&self,
input: <RelativeCameraPose as Pose>::InputPoint
) -> (<RelativeCameraPose as Pose>::OutputPoint, Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>, Matrix<f64, U6, U3, <DefaultAllocator as Allocator<f64, U6, U3>>::Buffer>)
fn update(
&mut self,
delta: Matrix<f64, U6, U1, <DefaultAllocator as Allocator<f64, U6, U1>>::Buffer>
)
[src]
&mut self,
delta: Matrix<f64, U6, U1, <DefaultAllocator as Allocator<f64, U6, U1>>::Buffer>
)
fn transform_jacobian_input(
&self,
input: Self::InputPoint
) -> (Self::OutputPoint, Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>)
[src]
&self,
input: Self::InputPoint
) -> (Self::OutputPoint, Matrix<f64, U3, U3, <DefaultAllocator as Allocator<f64, U3, U3>>::Buffer>)
fn transform_jacobian_pose(
&self,
input: Self::InputPoint
) -> (Self::OutputPoint, Matrix<f64, U6, U3, <DefaultAllocator as Allocator<f64, U6, U3>>::Buffer>)
[src]
&self,
input: Self::InputPoint
) -> (Self::OutputPoint, Matrix<f64, U6, U3, <DefaultAllocator as Allocator<f64, U6, U3>>::Buffer>)
fn transform(&self, input: Self::InputPoint) -> Self::OutputPoint
[src]
impl StructuralPartialEq for RelativeCameraPose
[src]
Auto Trait Implementations
impl RefUnwindSafe for RelativeCameraPose
impl Send for RelativeCameraPose
impl Sync for RelativeCameraPose
impl Unpin for RelativeCameraPose
impl UnwindSafe for RelativeCameraPose
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,