pub fn run_cascade_mut(
        &self,
        image: &GrayImage,
        detections: &mut Vec<Detection>,
        params: &CascadeParameters,
    ) {
        let (width, height) = (image.width(), image.height());
        let mut size = params.min_size;

        while size <= params.max_size {
            let sizef = size as f32;
            let step = cmp::max((sizef * params.shift_factor) as usize, 1);
            let offset = size / 2 + 1;

            for y in (offset..(height - offset)).step_by(step) {
                for x in (offset..(width - offset)).step_by(step) {
                    if let Some(score) = self.classify_region(&image, &Point3::new(x, y, size)) {
                        detections.push(Detection::new(x as f32, y as f32, size as f32, score));
                    }
                }
            }
            size = (sizef * params.scale_factor) as u32;
        }
    }
/// Run cascade and push detections to the existing collection.
Run cascade and push detections to the existing collection.
Run cascade and push detections to the existing collection .
pub fn run_cascade_mut(
        &self,
        image: &GrayImage,
        detections: &mut Vec<Detection>,
        params: &CascadeParameters,
    ) {
        let (width, height) = (image.width(), image.height());
        let mut size = params.min_size;
        while size <= params.max_size {
            let sizef = size as f32;
            let step = cmp::max((sizef * params.shift_factor) as usize, 1);
            let offset = size / 2 + 1;
            for y in (offset..(height - offset)).step_by(step) {
                for x in (offset..(width - offset)).step_by(step) {
                    if let Some(score) = self.classify_region(&image, &Point3::new(x, y, size)) {
                        detections.push(Detection::new(x as f32, y as f32, size as f32, score));
                    }
                }
            }
            size = (sizef * params.scale_factor) as u32;
        }
    }
pub fn run_cascade_mut ( & self , image : & GrayImage , detections : & mut Vec < Detection > , params : & CascadeParameters , ) { let ( width , height ) = ( image . width ( ) , image . height ( ) ) ; let mut size = params . min_size ; while size <= params . max_size { let sizef = size as f32 ; let step = cmp :: max ( ( sizef * params . shift_factor ) as usize , 1 ) ; let offset = size / 2 + 1 ; for y in ( offset .. ( height - offset ) ) . step_by ( step ) { for x in ( offset .. ( width - offset ) ) . step_by ( step ) { if let Some ( score ) = self . classify_region ( & image , & Point3 :: new ( x , y , size ) ) { detections . push ( Detection :: new ( x as f32 , y as f32 , size as f32 , score ) ) ; } } } size = ( sizef * params . scale_factor ) as u32 ; } }
Run cascade and push detections to the existing collection.
Run cascade and push detections to the existing collection .
&self
image
&GrayImage
detections
&mut Vec<Detection>
params
&CascadeParameters
&self
image
&GrayImage
detections
&mut Vec<Detection>
params
&CascadeParameters