slam_cv/feature/keypoint.rs
1use nalgebra::Point2;
2
3use super::base::Feature;
4use crate::number::Number;
5
6pub trait KeyPoint
7where
8 Self: Feature,
9{
10 fn point_image(&self) -> Point2<Self::Number>;
11}
12
13impl<N> KeyPoint for Point2<N>
14where
15 N: 'static + Number,
16{
17 fn point_image(&self) -> Point2<Self::Number> {
18 *self
19 }
20}
21
22#[cfg(feature = "cv-core")]
23impl KeyPoint for cv_core::KeyPoint {
24 fn point_image(&self) -> Point2<Self::Number> {
25 self.0
26 }
27}