Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
za0612
pcl
提交
b0e579f0
P
pcl
项目概览
za0612
/
pcl
与 Fork 源项目一致
从无法访问的项目Fork
通知
13
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pcl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b0e579f0
编写于
1月 22, 2020
作者:
S
Sergey Alexandrov
提交者:
GitHub
1月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
[cuda/apps] Fixing memory leaks (#3587)
[cuda/apps] Fixing memory leaks
上级
3f105c79
5079ec17
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
56 addition
and
64 deletion
+56
-64
cuda/apps/src/kinect_mapping.cpp
cuda/apps/src/kinect_mapping.cpp
+5
-5
cuda/apps/src/kinect_normals_cuda.cpp
cuda/apps/src/kinect_normals_cuda.cpp
+10
-11
cuda/apps/src/kinect_planes_cuda.cpp
cuda/apps/src/kinect_planes_cuda.cpp
+11
-14
cuda/apps/src/kinect_ransac.cpp
cuda/apps/src/kinect_ransac.cpp
+10
-12
cuda/apps/src/kinect_segmentation_cuda.cpp
cuda/apps/src/kinect_segmentation_cuda.cpp
+10
-10
cuda/apps/src/kinect_segmentation_planes_cuda.cpp
cuda/apps/src/kinect_segmentation_planes_cuda.cpp
+10
-12
未找到文件。
cuda/apps/src/kinect_mapping.cpp
浏览文件 @
b0e579f0
...
...
@@ -237,33 +237,33 @@ class MultiRansac
{
this
->
use_viewer
=
use_viewer
;
//cudaDeviceSetCacheConfig (cudaFuncCachePreferL1);
pcl
::
Grabber
*
interface
=
new
pcl
::
OpenNIGrabber
()
;
pcl
::
OpenNIGrabber
interface
{}
;
boost
::
signals2
::
connection
c
;
if
(
use_device
)
{
std
::
cerr
<<
"[RANSAC] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
MultiRansac
::
cloud_cb
<
pcl_cuda
::
Device
>
,
this
,
_1
,
_2
,
_3
);
c
=
interface
->
registerCallback
(
f
);
c
=
interface
.
registerCallback
(
f
);
}
else
{
std
::
cerr
<<
"[RANSAC] Using CPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
MultiRansac
::
cloud_cb
<
pcl_cuda
::
Host
>
,
this
,
_1
,
_2
,
_3
);
c
=
interface
->
registerCallback
(
f
);
c
=
interface
.
registerCallback
(
f
);
}
if
(
use_viewer
)
viewer
.
runOnVisualizationThread
(
std
::
bind
(
&
MultiRansac
::
viz_cb
,
this
,
_1
),
"viz_cb"
);
interface
->
start
();
interface
.
start
();
while
(
!
viewer
.
wasStopped
())
{
sleep
(
1
);
}
interface
->
stop
();
interface
.
stop
();
}
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
logo_cloud_
;
...
...
cuda/apps/src/kinect_normals_cuda.cpp
浏览文件 @
b0e579f0
...
...
@@ -183,62 +183,61 @@ class NormalEstimation
{
if
(
use_file
)
{
pcl
::
Grabber
*
filegrabber
=
0
;
float
frames_per_second
=
1
;
bool
repeat
=
false
;
std
::
string
path
=
"./frame_0.pcd"
;
filegrabber
=
new
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
(
path
,
frames_per_second
,
repeat
)
;
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
filegrabber
{
path
,
frames_per_second
,
repeat
}
;
if
(
use_device
)
{
std
::
cerr
<<
"[NormalEstimation] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
&
)
>
f
=
std
::
bind
(
&
NormalEstimation
::
file_cloud_cb
<
Device
>
,
this
,
_1
);
filegrabber
->
registerCallback
(
f
);
filegrabber
.
registerCallback
(
f
);
}
else
{
std
::
cerr
<<
"[NormalEstimation] Using CPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
&
)
>
f
=
std
::
bind
(
&
NormalEstimation
::
file_cloud_cb
<
Host
>
,
this
,
_1
);
filegrabber
->
registerCallback
(
f
);
filegrabber
.
registerCallback
(
f
);
}
filegrabber
->
start
();
filegrabber
.
start
();
while
(
go_on
)
//!viewer.wasStopped () && go_on)
{
pcl_sleep
(
1
);
}
filegrabber
->
stop
();
filegrabber
.
stop
();
}
else
{
pcl
::
Grabber
*
grabber
=
new
pcl
::
OpenNIGrabber
()
;
pcl
::
OpenNIGrabber
grabber
{}
;
boost
::
signals2
::
connection
c
;
if
(
use_device
)
{
std
::
cerr
<<
"[NormalEstimation] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
NormalEstimation
::
cloud_cb
<
Device
>
,
this
,
_1
,
_2
,
_3
);
c
=
grabber
->
registerCallback
(
f
);
c
=
grabber
.
registerCallback
(
f
);
}
else
{
std
::
cerr
<<
"[NormalEstimation] Using CPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
NormalEstimation
::
cloud_cb
<
Host
>
,
this
,
_1
,
_2
,
_3
);
c
=
grabber
->
registerCallback
(
f
);
c
=
grabber
.
registerCallback
(
f
);
}
viewer
.
runOnVisualizationThread
(
std
::
bind
(
&
NormalEstimation
::
viz_cb
,
this
,
_1
),
"viz_cb"
);
grabber
->
start
();
grabber
.
start
();
while
(
!
viewer
.
wasStopped
())
{
pcl_sleep
(
1
);
}
grabber
->
stop
();
grabber
.
stop
();
}
}
...
...
cuda/apps/src/kinect_planes_cuda.cpp
浏览文件 @
b0e579f0
...
...
@@ -248,45 +248,42 @@ class MultiRansac
{
this
->
use_viewer
=
use_viewer
;
//cudaDeviceSetCacheConfig (cudaFuncCachePreferL1);
pcl
::
Grabber
*
interface
=
new
pcl
::
OpenNIGrabber
()
;
pcl
::
OpenNIGrabber
interface
{}
;
boost
::
signals2
::
connection
c
;
if
(
use_device
)
{
std
::
cerr
<<
"[RANSAC] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
MultiRansac
::
cloud_cb
<
Device
>
,
this
,
_1
,
_2
,
_3
);
c
=
interface
->
registerCallback
(
f
);
c
=
interface
.
registerCallback
(
f
);
}
else
{
std
::
cerr
<<
"[RANSAC] Using CPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
MultiRansac
::
cloud_cb
<
Host
>
,
this
,
_1
,
_2
,
_3
);
c
=
interface
->
registerCallback
(
f
);
c
=
interface
.
registerCallback
(
f
);
}
if
(
use_viewer
)
viewer
.
runOnVisualizationThread
(
std
::
bind
(
&
MultiRansac
::
viz_cb
,
this
,
_1
),
"viz_cb"
);
interface
->
start
();
interface
.
start
();
//--------------------- load pcl logo file
//pcl::Grabber* filegrabber = 0;
//float frames_per_second = 1;
//bool repeat = false;
//std::string path = "./pcl_logo.pcd";
//if (
!path.empty() &&
boost::filesystem::exists (path))
//if (
path.empty() || !
boost::filesystem::exists (path))
//{
// filegrabber = new pcl::PCDGrabber<pcl::PointXYZRGB > (path, frames_per_second, repeat);
//}
//else
// std::cerr << "did not find file" << std::endl;
//}
//pcl::PCDGrabber<pcl::PointXYZRGB> filegrabber {path, frames_per_second, repeat};
//
//std::function<void(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&) > f = std::bind (&MultiRansac::logo_cb, this, _1);
//boost::signals2::connection c1 = filegrabber
->
registerCallback (f);
//boost::signals2::connection c1 = filegrabber
.
registerCallback (f);
//filegrabber
->
start ();
//filegrabber
.
start ();
//------- END --------- load pcl logo file
//
while
(
!
viewer
.
wasStopped
())
...
...
@@ -294,8 +291,8 @@ class MultiRansac
pcl_sleep
(
1
);
}
//filegrabber
->
stop ();
interface
->
stop
();
//filegrabber
.
stop ();
interface
.
stop
();
}
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
logo_cloud_
;
...
...
cuda/apps/src/kinect_ransac.cpp
浏览文件 @
b0e579f0
...
...
@@ -164,57 +164,55 @@ class SimpleKinectTool
bool
repeat
=
false
;
std
::
string
path
=
"./frame_0.pcd"
;
filegrabber
=
new
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
(
path
,
frames_per_second
,
repeat
);
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
filegrabber
(
path
,
frames_per_second
,
repeat
);
if
(
use_device
)
{
std
::
cerr
<<
"[RANSAC] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
&
)
>
f
=
std
::
bind
(
&
SimpleKinectTool
::
file_cloud_cb
<
pcl_cuda
::
Device
>
,
this
,
_1
);
filegrabber
->
registerCallback
(
f
);
filegrabber
.
registerCallback
(
f
);
}
else
{
std
::
cerr
<<
"[RANSAC] Using CPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
&
)
>
f
=
std
::
bind
(
&
SimpleKinectTool
::
file_cloud_cb
<
pcl_cuda
::
Host
>
,
this
,
_1
);
filegrabber
->
registerCallback
(
f
);
filegrabber
.
registerCallback
(
f
);
}
filegrabber
->
start
();
filegrabber
.
start
();
while
(
go_on
)
//!viewer.wasStopped () && go_on)
{
sleep
(
1
);
}
filegrabber
->
stop
();
filegrabber
.
stop
();
//------- END --------- load pcl logo file
#else
pcl
::
Grabber
*
interface
=
new
pcl
::
OpenNIGrabber
();
pcl
::
OpenNIGrabber
interface
{};
boost
::
signals2
::
connection
c
;
if
(
use_device
)
{
std
::
cerr
<<
"[RANSAC] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
SimpleKinectTool
::
cloud_cb
<
pcl_cuda
::
Device
>
,
this
,
_1
,
_2
,
_3
);
c
=
interface
->
registerCallback
(
f
);
c
=
interface
.
registerCallback
(
f
);
}
else
{
std
::
cerr
<<
"[RANSAC] Using CPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
SimpleKinectTool
::
cloud_cb
<
pcl_cuda
::
Host
>
,
this
,
_1
,
_2
,
_3
);
c
=
interface
->
registerCallback
(
f
);
c
=
interface
.
registerCallback
(
f
);
}
//viewer.runOnVisualizationThread (fn, "viz_cb");
interface
->
start
();
interface
.
start
();
while
(
!
viewer
.
wasStopped
())
{
sleep
(
1
);
}
interface
->
stop
();
interface
.
stop
();
#endif
}
...
...
cuda/apps/src/kinect_segmentation_cuda.cpp
浏览文件 @
b0e579f0
...
...
@@ -363,56 +363,56 @@ class Segmentation
bool
repeat
=
false
;
std
::
string
path
=
"./frame_0.pcd"
;
filegrabber
=
new
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
(
path
,
frames_per_second
,
repeat
)
;
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
filegrabber
{
path
,
frames_per_second
,
repeat
}
;
if
(
use_device
)
{
std
::
cerr
<<
"[Segmentation] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
&
)
>
f
=
std
::
bind
(
&
Segmentation
::
file_cloud_cb
<
Device
>
,
this
,
_1
);
filegrabber
->
registerCallback
(
f
);
filegrabber
.
registerCallback
(
f
);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&Segmentation::file_cloud_cb<Host>, this, _1);
// filegrabber
->
registerCallback (f);
// filegrabber
.
registerCallback (f);
}
filegrabber
->
start
();
filegrabber
.
start
();
while
(
go_on
)
//!viewer.wasStopped () && go_on)
{
pcl_sleep
(
1
);
}
filegrabber
->
stop
();
filegrabber
.
stop
();
}
else
{
pcl
::
Grabber
*
grabber
=
new
pcl
::
OpenNIGrabber
()
;
pcl
::
OpenNIGrabber
grabber
{}
;
boost
::
signals2
::
connection
c
;
if
(
use_device
)
{
std
::
cerr
<<
"[Segmentation] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
Segmentation
::
cloud_cb
<
Device
>
,
this
,
_1
,
_2
,
_3
);
c
=
grabber
->
registerCallback
(
f
);
c
=
grabber
.
registerCallback
(
f
);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const openni_wrapper::Image::Ptr& image, const openni_wrapper::DepthImage::Ptr& depth_image, float)> f = std::bind (&Segmentation::cloud_cb<Host>, this, _1, _2, _3);
// c = grabber
->
registerCallback (f);
// c = grabber
.
registerCallback (f);
}
viewer
.
runOnVisualizationThread
(
std
::
bind
(
&
Segmentation
::
viz_cb
,
this
,
_1
),
"viz_cb"
);
grabber
->
start
();
grabber
.
start
();
while
(
!
viewer
.
wasStopped
())
{
pcl_sleep
(
1
);
}
grabber
->
stop
();
grabber
.
stop
();
}
}
...
...
cuda/apps/src/kinect_segmentation_planes_cuda.cpp
浏览文件 @
b0e579f0
...
...
@@ -232,62 +232,60 @@ class Segmentation
{
if
(
use_file
)
{
pcl
::
Grabber
*
filegrabber
=
0
;
float
frames_per_second
=
1
;
bool
repeat
=
false
;
std
::
string
path
=
"./frame_0.pcd"
;
filegrabber
=
new
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
(
path
,
frames_per_second
,
repeat
)
;
pcl
::
PCDGrabber
<
pcl
::
PointXYZRGB
>
filegrabber
{
path
,
frames_per_second
,
repeat
}
;
if
(
use_device
)
{
std
::
cerr
<<
"[Segmentation] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
&
)
>
f
=
std
::
bind
(
&
Segmentation
::
file_cloud_cb
<
Device
>
,
this
,
_1
);
filegrabber
->
registerCallback
(
f
);
filegrabber
.
registerCallback
(
f
);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&)> f = std::bind (&Segmentation::file_cloud_cb<Host>, this, _1);
// filegrabber
->
registerCallback (f);
// filegrabber
.
registerCallback (f);
}
filegrabber
->
start
();
filegrabber
.
start
();
while
(
go_on
)
//!viewer.wasStopped () && go_on)
{
pcl_sleep
(
1
);
}
filegrabber
->
stop
();
filegrabber
.
stop
();
}
else
{
pcl
::
Grabber
*
grabber
=
new
pcl
::
OpenNIGrabber
()
;
pcl
::
OpenNIGrabber
grabber
{}
;
boost
::
signals2
::
connection
c
;
if
(
use_device
)
{
std
::
cerr
<<
"[Segmentation] Using GPU..."
<<
std
::
endl
;
std
::
function
<
void
(
const
openni_wrapper
::
Image
::
Ptr
&
image
,
const
openni_wrapper
::
DepthImage
::
Ptr
&
depth_image
,
float
)
>
f
=
std
::
bind
(
&
Segmentation
::
cloud_cb
<
Device
>
,
this
,
_1
,
_2
,
_3
);
c
=
grabber
->
registerCallback
(
f
);
c
=
grabber
.
registerCallback
(
f
);
}
else
{
// std::cerr << "[Segmentation] Using CPU..." << std::endl;
// std::function<void (const openni_wrapper::Image::Ptr& image, const openni_wrapper::DepthImage::Ptr& depth_image, float)> f = std::bind (&Segmentation::cloud_cb<Host>, this, _1, _2, _3);
// c = grabber
->
registerCallback (f);
// c = grabber
.
registerCallback (f);
}
viewer
.
runOnVisualizationThread
(
std
::
bind
(
&
Segmentation
::
viz_cb
,
this
,
_1
),
"viz_cb"
);
grabber
->
start
();
grabber
.
start
();
while
(
!
viewer
.
wasStopped
())
{
pcl_sleep
(
1
);
}
grabber
->
stop
();
grabber
.
stop
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录