Closed Bullesta closed 1 year ago
I forgot to add pub to function locate_img_center
Realized this is adding all my changes. Making it so that its only the screen mod.rs
Just leave the README.md out or merge information
As your crate is a wrapper, I feel it may be better for me to convert this into my own crate and add its dependency later so I can keep it maintained.
Created and implemented the first image recognition for this crate. It can search the entire screen 5x faster than pyautogui and does not require OpenCV for options like Confidence. I've also added an option called Tolerance that allows for leniency with pixel colors that are close to the original image's. Written in pure Rust.
img: required borrowed DynamicImage region: requires tuple BoundingBox (x, y, width, height) (Default Entire Screen) min_confidence: 0.1 - 1.0, percentage of how many of the pixels need to match (Default 0.95) tolerance: 0 - 255, range of pixels to accept from image's pixels. So if an image has a pixel of 234, 52, 245 with a tolerance of 10, then the locator will accept values ranging from 224, 42, 235 - 244, 62, 255. (Default 5)
All of these requires (except img) are optional and require either a Some() or None
Examples: