refacto
This commit is contained in:
parent
1d61235e51
commit
2b0a2ce06d
3 changed files with 14 additions and 14 deletions
|
|
@ -2,8 +2,6 @@ use crate::transformer::Transformers;
|
|||
use crate::point::Point;
|
||||
use crate::worldstate::{WorldState,EDH};
|
||||
use serde::{Serialize,Deserialize};
|
||||
use log::debug;
|
||||
use nalgebra::Matrix1x3;
|
||||
|
||||
/// Homography
|
||||
|
||||
|
|
@ -15,15 +13,7 @@ impl Transformers for Homography {
|
|||
let edh : &EDH = &ws.edh;
|
||||
|
||||
point_list.iter()
|
||||
.map(| point | {
|
||||
let p = Matrix1x3::new(point.x, point.y, 1.0);
|
||||
let p = p * edh.matrix;
|
||||
let new_p = Point { x: p[0] / p[2], y: p[1] / p[2], ..*point };
|
||||
|
||||
debug!("{:?} => {:?}", point, new_p);
|
||||
|
||||
new_p
|
||||
})
|
||||
.map(| point | edh.apply(point))
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue