|
|
|
@ -342,7 +342,8 @@ impl HaarClassifier {
@@ -342,7 +342,8 @@ impl HaarClassifier {
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/// take an ImageBuffer and scan it for faces.
|
|
|
|
|
pub fn scan_image(&self, frame: image::ImageBuffer<image::Rgb<u8>, Vec<u8>>, heatmap: &Option<heatmap::Heatmap>) -> Result<Outcome, String> { |
|
|
|
|
/// min_face_factor parameter gives starting size of scan window (frame height / factor). So higher number scans for smaller faces.
|
|
|
|
|
pub fn scan_image(&self, frame: image::ImageBuffer<image::Rgb<u8>, Vec<u8>>, heatmap: &Option<heatmap::Heatmap>, min_face_factor: u32) -> Result<Outcome, String> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let sw = Stopwatch::start_new(); |
|
|
|
@ -365,7 +366,7 @@ impl HaarClassifier {
@@ -365,7 +366,7 @@ impl HaarClassifier {
|
|
|
|
|
// let rect = integral.slice(s![3..5, 2..4]);
|
|
|
|
|
|
|
|
|
|
// let min_size = self.width;
|
|
|
|
|
let min_size = frame.height() / 3; // TODO: Make min face size (or factor) variable
|
|
|
|
|
let min_size = frame.height() / min_face_factor; // TODO: Make min face size (or factor) variable
|
|
|
|
|
let max_window_size = std::cmp::min(img_bw.dimensions().0, img_bw.dimensions().1) as usize; |
|
|
|
|
|
|
|
|
|
let mut window_size: usize = min_size.clone() as usize; |
|
|
|
|