Skip to content

Commit

Permalink
Finished draft of the report and update estimators
Browse files Browse the repository at this point in the history
  • Loading branch information
h33p committed Apr 7, 2022
1 parent 96d8001 commit b107b5a
Show file tree
Hide file tree
Showing 42 changed files with 4,162 additions and 366 deletions.
18 changes: 17 additions & 1 deletion almeida-estimator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub struct AlmeidaEstimator {
use_ransac: bool,
/// Number of iterations for ransac.
num_iters: usize,
cnt: usize,
}

impl Properties for AlmeidaEstimator {
Expand Down Expand Up @@ -92,13 +93,25 @@ impl Estimator for AlmeidaEstimator {
motion_vectors.iter().copied().collect()
};

let limit = (15.0 / ALPHA).ceil() as usize;
let limit = 5;//(15.0 / ALPHA).ceil() as usize;

self.cnt += 1;
println!("{}", self.cnt);

use std::io::Write;

for i in 0..limit {
let model = if i == 0 && self.use_ransac {
let (model, new_inliers) =
solve_ypr_ransac(motion_vectors, camera, self.num_iters, eps);
inliers = new_inliers;

let mut f = std::fs::File::create("docs/report/mfield/base.csv").unwrap();
write!(&mut f, "x,y,u,v\n").unwrap();
for (pos, motion) in &inliers {
write!(&mut f, "{},{},{},{}\n", pos.coords.x, pos.coords.y, motion.x, motion.y).unwrap();
}

model
} else {
solve_ypr(camera, &inliers, eps)
Expand All @@ -122,8 +135,11 @@ impl Estimator for AlmeidaEstimator {
let rotm =
na::UnitQuaternion::from_euler_angles(-model.y, model.x, -model.z).to_homogeneous();

let mut f = std::fs::File::create(format!("docs/report/mfield/{i}.csv")).unwrap();
write!(&mut f, "x,y,u,v\n").unwrap();
for (pos, motion) in &mut inliers {
let delta = camera.delta(*pos, rotm);
write!(&mut f, "{},{},{},{}\n", pos.coords.x, pos.coords.y, delta.x, delta.y).unwrap();
*pos += delta;
*motion -= delta;
}
Expand Down
4 changes: 3 additions & 1 deletion block-motion-detector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ impl Detector for BlockMotionDetection {

// Add all the motion to the field densifier.
let mut mf = MotionFieldDensifier::new(block_dim, block_dim);
motion.for_each(|(pos, motion)| mf.add_vector(pos, motion));
motion.for_each(|(pos, motion)| {
mf.add_vector(pos, motion);
});
let mf = MotionField::from(mf);

let mut map = vec![vec![false; block_dim]; block_dim];
Expand Down
4 changes: 0 additions & 4 deletions docs/report.bib
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ @misc{libmv

@misc{blender-motion-tracking, author={Blender}, title = {Motion Tracking Introduction}, url = {https://docs.blender.org/manual/en/latest/movie_clip/tracking/introduction.html}}

@misc{fc7f41a484c3cb8df94e71b591076ab3c9e84827, author={Aurimas Blažulionis}, title = {Commit fc7f41}, url = {https://github.com/h33p/libmv/commit/fc7f41a484c3cb8df94e71b591076ab3c9e84827}}

@misc{14ba45e82847ff6bc98edad5abfd67c212328482, author={Aurimas Blažulionis}, title = {Commit 14ba45}, url = {https://github.com/h33p/libmv/commit/14ba45e82847ff6bc98edad5abfd67c212328482}}

@misc{libmv-fork, author={Aurimas Blažulionis}, title = {Libmv fork}, url = {https://github.com/h33p/libmv}}

@inproceedings{zhao2020maskflownet,
Expand Down
533 changes: 429 additions & 104 deletions docs/report.tex

Large diffs are not rendered by default.

Binary file added docs/report/detection.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/report/distortion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report/epipolar-geometry.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report/epipolar-view1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report/farneback-vs-rlof.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report/feature-tracking.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/report/gunnar-farneback-mask.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
401 changes: 401 additions & 0 deletions docs/report/mfield/0.csv

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions docs/report/mfield/1.csv

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions docs/report/mfield/2.csv

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions docs/report/mfield/3.csv

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions docs/report/mfield/4.csv

Large diffs are not rendered by default.

Loading

0 comments on commit b107b5a

Please sign in to comment.