FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrayfire-python/arrayfire/features.py at master · arrayfire/arrayfire-python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
arrayfire
/
arrayfire-python
Public
Notifications
You must be signed in to change notification settings
Fork
64
Star
422
Code
Issues
57
Pull requests
3
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
arrayfire-python
/
arrayfire
/
features.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
89 lines (76 loc) · 2.42 KB
Breadcrumbs
arrayfire-python
/
arrayfire
/
features.py
Copy path
File metadata and controls
89 lines (76 loc) · 2.42 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#######################################################
# Copyright (c) 2015, 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
########################################################
"""
Features class used for Computer Vision algorithms.
"""
from
.
library
import
*
from
.
array
import
*
import
numbers
class
Features
(
object
):
"""
A container class used for various feature detectors.
Parameters
----------
num: optional: int. default: 0.
Specifies the number of features.
"""
def
__init__
(
self
,
num
=
0
):
self
.
feat
=
c_void_ptr_t
(
0
)
if
num
is
not
None
:
assert
(
isinstance
(
num
,
numbers
.
Number
))
safe_call
(
backend
.
get
().
af_create_features
(
c_pointer
(
self
.
feat
),
c_dim_t
(
num
)))
def
__del__
(
self
):
"""
Release features' memory
"""
if
self
.
feat
:
backend
.
get
().
af_release_features
(
self
.
feat
)
self
.
feat
=
None
def
num_features
(
self
):
"""
Returns the number of features detected.
"""
num
=
c_dim_t
(
0
)
safe_call
(
backend
.
get
().
af_get_features_num
(
c_pointer
(
num
),
self
.
feat
))
return
num
def
get_xpos
(
self
):
"""
Returns the x-positions of the features detected.
"""
out
=
Array
()
safe_call
(
backend
.
get
().
af_get_features_xpos
(
c_pointer
(
out
.
arr
),
self
.
feat
))
return
out
def
get_ypos
(
self
):
"""
Returns the y-positions of the features detected.
"""
out
=
Array
()
safe_call
(
backend
.
get
().
af_get_features_ypos
(
c_pointer
(
out
.
arr
),
self
.
feat
))
return
out
def
get_score
(
self
):
"""
Returns the scores of the features detected.
"""
out
=
Array
()
safe_call
(
backend
.
get
().
af_get_features_score
(
c_pointer
(
out
.
arr
),
self
.
feat
))
return
out
def
get_orientation
(
self
):
"""
Returns the orientations of the features detected.
"""
out
=
Array
()
safe_call
(
backend
.
get
().
af_get_features_orientation
(
c_pointer
(
out
.
arr
),
self
.
feat
))
return
out
def
get_size
(
self
):
"""
Returns the sizes of the features detected.
"""
out
=
Array
()
safe_call
(
backend
.
get
().
af_get_features_size
(
c_pointer
(
out
.
arr
),
self
.
feat
))
return
out
Back
|
FazBrowse Home
|
New Git URL