Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PointCloud
Flann
提交
852b8cd1
F
Flann
项目概览
PointCloud
/
Flann
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flann
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
852b8cd1
编写于
5月 04, 2018
作者:
M
Marius Muja
提交者:
GitHub
5月 04, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #371 from jannikboll/master
Minor fix to add/remove-point in python wrapper
上级
c26f687b
d21fd681
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
0 deletion
+18
-0
src/python/pyflann/flann_ctypes.py
src/python/pyflann/flann_ctypes.py
+9
-0
src/python/pyflann/index.py
src/python/pyflann/index.py
+9
-0
未找到文件。
src/python/pyflann/flann_ctypes.py
浏览文件 @
852b8cd1
...
...
@@ -256,6 +256,15 @@ flannlib.flann_load_index_%(C)s.argtypes = [
flann.load_index[%(numpy)s] = flannlib.flann_load_index_%(C)s
"""
)
flann
.
used_memory
=
{}
define_functions
(
r
"""
flannlib.flann_used_memory_%(C)s.restype = c_int
flannlib.flann_used_memory_%(C)s.argtypes = [
FLANN_INDEX, # index_id
]
flann.used_memory[%(numpy)s] = flannlib.flann_used_memory_%(C)s
"""
)
flann
.
add_points
=
{}
define_functions
(
r
"""
flannlib.flann_add_points_%(C)s.restype = None
...
...
src/python/pyflann/index.py
浏览文件 @
852b8cd1
...
...
@@ -212,6 +212,13 @@ class FLANN(object):
self
.
__curindex_data
=
pts
self
.
__curindex_type
=
pts
.
dtype
.
type
def
used_memory
(
self
):
"""
Returns the number of bytes consumed by the index.
"""
return
flann
.
used_memory
[
self
.
__curindex_type
](
self
.
__curindex
)
def
add_points
(
self
,
pts
,
rebuild_threshold
=
2.0
):
"""
Adds points to pre-built index.
...
...
@@ -228,12 +235,14 @@ class FLANN(object):
pts
=
ensure_2d_array
(
pts
,
default_flags
)
npts
,
dim
=
pts
.
shape
flann
.
add_points
[
self
.
__curindex_type
](
self
.
__curindex
,
pts
,
npts
,
dim
,
rebuild_threshold
)
self
.
__curindex_data
=
np
.
row_stack
((
self
.
__curindex_data
,
pts
))
def
remove_point
(
self
,
idx
):
"""
Removes a point from a pre-built index.
"""
flann
.
remove_point
[
self
.
__curindex_type
](
self
.
__curindex
,
idx
)
self
.
__curindex_data
=
np
.
delete
(
self
.
__curindex_data
,
idx
,
axis
=
0
)
def
nn_index
(
self
,
qpts
,
num_neighbors
=
1
,
**
kwargs
):
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录