MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / threshold

Function threshold

src/api/c/imgproc_common.hpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template<typename T>
33detail::Array<T> threshold(const detail::Array<T>& in, T min, T max) {
34 const af::dim4 inDims = in.dims();
35
36 auto MN = detail::createValueArray(inDims, min);
37 auto MX = detail::createValueArray(inDims, max);
38 auto below = detail::logicOp<T, af_le_t>(in, MX, inDims);
39 auto above = detail::logicOp<T, af_ge_t>(in, MN, inDims);
40 auto valid = detail::logicOp<char, af_and_t>(below, above, inDims);
41
42 return detail::arithOp<T, af_mul_t>(in, common::cast<T, char>(valid),
43 inDims);
44}
45
46template<typename To, typename Ti>
47detail::Array<To> convRange(const detail::Array<Ti>& in,

Callers

nothing calls this directly

Calls 2

createValueArrayFunction · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected