FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrayfire/src/api/cpp/sobel.cpp at master · arrayfire/arrayfire · GitHub
arrayfire
arrayfire
Repository navigation
Code
Issues
292
(292)
Pull requests
39
(39)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
arrayfire
/
src
/
api
/
cpp
/
sobel.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (31 loc) · 953 Bytes
Breadcrumbs
arrayfire
/
src
/
api
/
cpp
/
sobel.cpp
Copy path
File metadata and controls
36 lines (31 loc) · 953 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
35
36
/*
******************************************************
* Copyright (c) 2014, 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
<
af/arith.h
>
#
include
<
af/array.h
>
#
include
<
af/image.h
>
#
include
"
error.hpp
"
namespace
af
{
void
sobel
(array &dx, array &dy,
const
array &img,
const
unsigned
ker_size) {
af_array af_dx =
0
;
af_array af_dy =
0
;
AF_THROW
(
af_sobel_operator
(&af_dx, &af_dy, img.
get
(), ker_size));
dx =
array
(af_dx);
dy =
array
(af_dy);
}
array
sobel
(
const
array &img,
const
unsigned
ker_size,
const
bool
isFast) {
array dx;
array dy;
sobel
(dx, dy, img, ker_size);
if
(isFast) {
return
abs
(dx) +
abs
(dy);
}
else
{
return
sqrt
(dx * dx + dy * dy);
}
}
}
//
namespace af
Back
|
FazBrowse Home
|
New Git URL