Realm

oa::image::calc_hist

Accumulate a per-plane histogram over an FP32 NCHW or CHW image. Each (batch, channel) plane contributes one row of bins buckets to the U32 result whose leading dimensions mirror the image; [B,C,H,W] and [C,H,W] inputs produce [B,C,bins] and [C,bins] results. Values below lower or at or above upper are ignored; in-range values map uniformly onto [0, bins). The accumulator is cleared inside the operation, so a captured plan replays the same counts. Errors Returns an error unless bins is in 1..=256, lower and upper are finite with lower < upper, the image is nonempty FP32 NCHW/CHW, and all sizes fit the shader ABI.

FnRust public API

Function Documentation

pub fn calc_hist( input: &Image, bins: u32, lower: f32, upper: f32 ) -> Result<Matrix>
Accumulate a per-plane histogram over an FP32 NCHW or CHW image. Each (batch, channel) plane contributes one row of bins buckets to the U32 result whose leading dimensions mirror the image; [B,C,H,W] and [C,H,W] inputs produce [B,C,bins] and [C,bins] results. Values below lower or at or above upper are ignored; in-range values map uniformly onto [0, bins). The accumulator is cleared inside the operation, so a captured plan replays the same counts. Errors Returns an error unless bins is in 1..=256, lower and upper are finite with lower < upper, the image is nonempty FP32 NCHW/CHW, and all sizes fit the shader ABI.