Clean tryouts
This commit is contained in:
parent
7c3968d2dc
commit
e8fec78250
1 changed files with 2 additions and 22 deletions
|
@ -316,26 +316,6 @@ impl Filter for PincushionFilter {
|
||||||
let projected_positions: Vec<laser::Point> = points.points.iter().map(|point| {
|
let projected_positions: Vec<laser::Point> = points.points.iter().map(|point| {
|
||||||
let p = point.position;
|
let p = point.position;
|
||||||
|
|
||||||
|
|
||||||
// formula by Ilya Sinenko: https://hackernoon.com/galvo-scanner-pillow-and-barrel-distortions-correction
|
|
||||||
// who states: x_angle = atan(x_cord / (sqrt(pow(d,2)+pow(y_cord,2))+e))
|
|
||||||
// let x = (p[0] / (p[1].abs() + self.k_x )).atan();
|
|
||||||
// let new_position = [x, p[1]];
|
|
||||||
|
|
||||||
// Adapted from https://www.geeks3d.com/20140213/glsl-shader-library-fish-eye-and-dome-and-barrel-distortion-post-processing-filters/2/
|
|
||||||
// let mut radius = (p[0].powi(2) + p[1].powi(2)).sqrt();
|
|
||||||
// let new_position = if radius > 0. {
|
|
||||||
// let theta = p[1].atan2(p[0]);
|
|
||||||
// let radius_x = radius.powf(self.k_x);
|
|
||||||
// let radius_y = radius.powf(self.k_y);
|
|
||||||
// let x = radius_x * theta.cos();
|
|
||||||
// let y = radius_y * theta.sin();
|
|
||||||
// [x, y]
|
|
||||||
// } else {
|
|
||||||
// p
|
|
||||||
// };
|
|
||||||
|
|
||||||
|
|
||||||
// Apply Brown-Conrady model of distortion
|
// Apply Brown-Conrady model of distortion
|
||||||
|
|
||||||
// https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction
|
// https://en.wikipedia.org/wiki/Distortion_(optics)#Software_correction
|
||||||
|
|
Loading…
Reference in a new issue