1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![allow(unused_variables, dead_code)]
extern crate image;
extern crate ndarray;
extern crate structopt;
pub mod cli;
pub mod error;
pub mod hough_transform;
use cli::Config;
use error::HougseErr;
use hough_transform::image::ImageLumaArray;
pub fn run() -> Result<(), HougseErr> {
let conf = Config::parse()?;
let circles = match ImageLumaArray::new(conf.image_path.unwrap())? {
ImageLumaArray::ImageLumaU8(u8_array) => {
println!("Image: \n{}", u8_array);
hough_transform::hough_transform::<u8>(&u8_array, conf.circle_limits.unwrap())?
}
ImageLumaArray::ImageLumaU16(u16_array) => {
println!("Image: \n{}", u16_array);
hough_transform::hough_transform::<u16>(&u16_array, conf.circle_limits.unwrap())?
}
};
println!("Circles in the image: \n{:?}", circles.0);
Ok(())
}