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

Function gradientMagnitude

src/api/c/canny.cpp:67–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66namespace {
67Array<float> gradientMagnitude(const Array<float>& gx, const Array<float>& gy,
68 const bool& isf) {
69 using detail::abs;
70 if (isf) {
71 Array<float> gx2 = abs<float, float>(gx);
72 Array<float> gy2 = abs<float, float>(gy);
73 return arithOp<float, af_add_t>(gx2, gy2, gx2.dims());
74 } else {
75 Array<float> gx2 = arithOp<float, af_mul_t>(gx, gx, gx.dims());
76 Array<float> gy2 = arithOp<float, af_mul_t>(gy, gy, gy.dims());
77 Array<float> sg = arithOp<float, af_add_t>(gx2, gy2, gx2.dims());
78 return unaryOp<float, af_sqrt_t>(sg);
79 }
80}
81
82Array<float> otsuThreshold(const Array<float>& in, const unsigned NUM_BINS,
83 const float maxVal) {

Callers 1

cannyHelperFunction · 0.85

Calls 1

dimsMethod · 0.45

Tested by

no test coverage detected