Skip to content

Commit

Permalink
Tune up min_area a bit on segmenter
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaiid committed Dec 3, 2024
1 parent d7dabe2 commit b196cfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/segmenter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ pub fn analyze_image(image_path: &str) -> Result<String, Box<dyn std::error::Err

// Process regions
let mut regions = Vec::new();
let min_area = (width * height) as f32 * 0.01; // Assuming min_region_size is 0.01
let min_area = (width * height) as f32 * 0.001; // Assuming min_region_size is 0.01
println!("Min region area: {}", min_area);

for contour in contours {
let area = contour_area(&contour.points) as f32;
println!("Contour area: {}", area);

if area >= min_area {
let bounds = min_area_rect(&contour.points);
Expand Down

0 comments on commit b196cfc

Please sign in to comment.