Skip to content

Commit

Permalink
Disable writing most debug images
Browse files Browse the repository at this point in the history
  • Loading branch information
knoellle committed May 20, 2024
1 parent db9323b commit 449d5d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ use image::DynamicImage;
use notify::{watcher, RecursiveMode, Watcher};
use xcap::Window;

use wfinfo::ocr::{normalize_string, reward_image_to_reward_names};
use wfinfo::{database::Database, ocr::OCR};
use wfinfo::{
database::Database,
ocr::{normalize_string, reward_image_to_reward_names, OCR},
};

fn run_detection(capturer: &Window, db: &Database) {
let frame = capturer.capture_image().unwrap();
Expand Down
18 changes: 9 additions & 9 deletions src/ocr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn extract_parts(image: &DynamicImage, theme: Theme) -> Vec<DynamicImage> {
(most_bot - most_top) as u32,
);
let mut prefilter_draw = prefilter.clone().into_rgb8();
prefilter.save("prefilter.png").unwrap();
// prefilter.save("prefilter.png").unwrap();

let mut rows = Vec::<usize>::new();
for y in 0..prefilter.height() {
Expand Down Expand Up @@ -240,9 +240,9 @@ pub fn extract_parts(image: &DynamicImage, theme: Theme) -> Vec<DynamicImage> {
}
}

prefilter_draw.save("prefilter.png").unwrap();
// prefilter_draw.save("prefilter.png").unwrap();

partial_screenshot.save("partial_screenshot.png").unwrap();
// partial_screenshot.save("partial_screenshot.png").unwrap();

filter_and_separate_parts_from_part_box(partial_screenshot, theme)
}
Expand Down Expand Up @@ -290,9 +290,9 @@ pub fn filter_and_separate_parts_from_part_box(
}
}

filtered
.save("filtered.png")
.expect("Failed to write filtered image");
// filtered
// .save("filtered.png")
// .expect("Failed to write filtered image");

if total_even == 0.0 && total_odd == 0.0 {
return vec![];
Expand All @@ -318,9 +318,9 @@ pub fn filter_and_separate_parts_from_part_box(
let dynamic_image = DynamicImage::ImageRgb8(filtered);
for i in 0..player_count {
let cropped = dynamic_image.crop_imm(curr_left + i * box_width, 0, box_width, box_height);
cropped
.save(format!("part-{}.png", i))
.expect("Failed to write image");
// cropped
// .save(format!("part-{}.png", i))
// .expect("Failed to write image");
images.push(cropped);
}

Expand Down

0 comments on commit 449d5d7

Please sign in to comment.