pub struct TemplateStats { /* private fields */ }Expand description
A template prepared for repeated scoring: its masked pixels, their values, and the moments correlation needs.
Preparing it is where a crop with nothing to match — no visible pixels, or one flat colour — is refused. A caller that polls therefore cannot discover that on poll sixty: it finds out before the loop, with the reason.
Implementations§
Source§impl TemplateStats
impl TemplateStats
Sourcepub fn prepare(tpl: &Template) -> Result<Self, LocateError>
pub fn prepare(tpl: &Template) -> Result<Self, LocateError>
Prepare tpl for scoring, refusing a crop that cannot match.
Sourcepub fn score_at(
&self,
screen: &GrayImage,
at: Point,
) -> Result<f64, LocateError>
pub fn score_at( &self, screen: &GrayImage, at: Point, ) -> Result<f64, LocateError>
Normalized cross-correlation with the template placed at at.
Fixed-location scoring: no search and no ambiguity, which is
locate’s job. This is what wait polls with — a region that has
not moved is answered by reading its own pixels, rather than
re-scanning a whole frame to rediscover where it already is.
Trait Implementations§
Source§impl Clone for TemplateStats
impl Clone for TemplateStats
Source§fn clone(&self) -> TemplateStats
fn clone(&self) -> TemplateStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TemplateStats
impl RefUnwindSafe for TemplateStats
impl Send for TemplateStats
impl Sync for TemplateStats
impl Unpin for TemplateStats
impl UnsafeUnpin for TemplateStats
impl UnwindSafe for TemplateStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more