Realm

oa::image::compare_hist

Compare two same-shape U32 histogram matrices row by row. The last dimension is the bucket axis; every leading index is an independent row, so [B,C,bins] histograms produce a [B,C] FP32 score matrix. Correlation, chi-square, intersection, and Bhattacharyya follow the OpenCV compareHist formulas; degenerate rows return 0.0 rather than propagating a zero denominator. Errors Returns an error unless both inputs are same-shape nonempty U32 matrices of rank at least two on one runtime, and all sizes fit the shader ABI.

FnRust public API

Function Documentation

pub fn compare_hist( first: &Matrix, second: &Matrix, method: HistogramComparison ) -> Result<Matrix>
Compare two same-shape U32 histogram matrices row by row. The last dimension is the bucket axis; every leading index is an independent row, so [B,C,bins] histograms produce a [B,C] FP32 score matrix. Correlation, chi-square, intersection, and Bhattacharyya follow the OpenCV compareHist formulas; degenerate rows return 0.0 rather than propagating a zero denominator. Errors Returns an error unless both inputs are same-shape nonempty U32 matrices of rank at least two on one runtime, and all sizes fit the shader ABI.