Skip to content

Commit

Permalink
Merge pull request #185 from FungusOVO/yas
Browse files Browse the repository at this point in the history
使用多个颜色判断加锁状态
  • Loading branch information
wormtql authored Sep 30, 2024
2 parents e826374 + 944f43d commit 4ce30d1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ use std::sync::mpsc::Receiver;
use std::thread::JoinHandle;

use anyhow::Result;
use image::Rgb;
use image::{GenericImageView, RgbImage};
use log::{error, info, warn};

use yas::ocr::ImageToText;
use yas::ocr::yas_ocr_model;
use yas::positioning::{Pos, Rect};
use yas::utils::color_distance;

use crate::scanner::artifact_scanner::artifact_scanner_window_info::ArtifactScannerWindowInfo;
use crate::scanner::artifact_scanner::GenshinArtifactScannerConfig;
Expand Down Expand Up @@ -130,7 +132,7 @@ impl ArtifactScannerWorker {
let color = list_image
.get_pixel((pos_x as i32 + dx) as u32, (pos_y as i32 + dy) as u32);

if color.0[0] > 200 {
if color_distance(color, &Rgb([255, 138, 117])) < 30 {
locked = true;
break 'sq;
}
Expand Down

0 comments on commit 4ce30d1

Please sign in to comment.