Skip to content

Commit

Permalink
optical flow code
Browse files Browse the repository at this point in the history
  • Loading branch information
misha7b committed Oct 7, 2024
1 parent 5a6e352 commit 9a8992d
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions lib/localisation/preprocessing/src/preprocess_optical.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
pub fn process_optical(){

println!("hello!");
//TODO: Implement properly!
fn main() {
let raw_optical_data = vec![vec1[1.0, 2.0], vec![3.0, 4.0], vec![5.0, 6.0]];
let optical_data = process_optical(&raw_optical_data);
println!("{:?}", optical_data);
}

pub fn process_optical(raw_optical_data: &Vec<f64>) -> Vec<f64> {

let mut optical_data = Vec::with_capacity(raw_optical_data.len());

for i in 0..raw_optical_data.len() {

let mut magnitude = 0.0;

for j in 0..raw_optical_data[i].len() {
magnitude += raw_optical_data[i][j].powi(2);
}

}

optical_data

}

0 comments on commit 9a8992d

Please sign in to comment.