-
Notifications
You must be signed in to change notification settings - Fork 548
Expand file tree
/
Copy pathcanny.cpp
More file actions
34 lines (30 loc) · 1.09 KB
/
canny.cpp
File metadata and controls
34 lines (30 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*******************************************************
* Copyright (c) 2017, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <Array.hpp>
#include <canny.hpp>
#include <err_cuda.hpp>
#include <kernel/canny.hpp>
using af::dim4;
namespace arrayfire {
namespace cuda {
Array<float> nonMaximumSuppression(const Array<float>& mag,
const Array<float>& gx,
const Array<float>& gy) {
Array<float> out = createValueArray<float>(mag.dims(), 0);
kernel::nonMaxSuppression<float>(out, mag, gx, gy);
return out;
}
Array<char> edgeTrackingByHysteresis(const Array<char>& strong,
const Array<char>& weak) {
Array<char> out = createValueArray<char>(strong.dims(), 0);
kernel::edgeTrackingHysteresis<char>(out, strong, weak);
return out;
}
} // namespace cuda
} // namespace arrayfire