docs.rs failed to build find-subimage-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
find-subimage-0.1.12
Here's a simple example showing how to use the API:
use ;
// Make a dummy 128x128 black image with a red dot at (50, 0)
let = ;
let mut rgb_image = vec!;
rgb_image = 250;
// Make a dummy 32x32 black image
// with a white dot at (0, 0)
let = ;
let mut rgb_subimage = vec!;
rgb_subimage = 250;
let mut finder = new;
// These are (x, y, distance) where x and y are the position within the larger image
// and distance is the distance value, where a smaller distance means a mroe precise match
let positions: & =
finder.find_subimage_positions;
let max: = positions
.iter
.min_by;
println!;
assert_eq!;
// find_subimage_positions actually returns the results sorted by distance already,
// so we can skip finding the minimum
assert_eq!;
The most important functions provided are find_subimage_positions and find_subimage_positions_as_grayscale.
You may find their "_with_backend" versions useful.
By default, this library prunes results that are close together. You can disable (Set to 0) or tweak this using with_pruning.
You can look at the page for the [Backend] enum to learn about the possible backends.
There are some examples in the /examples folder in the repository.