Realm

oa::image::match_template

Slide a single-plane template over each image plane and write the per-position match score to a Matrix, following matchTemplate. The template’s channel count must equal the input’s; the output carries the input’s leading plane dimensions plus (height - th + 1) x (width - tw + 1) score elements computed by a serial per-position reduction over the template window. Errors Returns an error unless both images are nonempty FP32 NCHW/CHW images with matching channel counts, a single-plane template no larger than the image planes, and sizes that fit the shader ABI.

FnRust public API

Function Documentation

pub fn match_template( input: &Image, template: &Image, method: MatchTemplate ) -> Result<Matrix>
Slide a single-plane template over each image plane and write the per-position match score to a Matrix, following matchTemplate. The template’s channel count must equal the input’s; the output carries the input’s leading plane dimensions plus (height - th + 1) x (width - tw + 1) score elements computed by a serial per-position reduction over the template window. Errors Returns an error unless both images are nonempty FP32 NCHW/CHW images with matching channel counts, a single-plane template no larger than the image planes, and sizes that fit the shader ABI.