Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
2881f2a0
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2881f2a0
编写于
8月 06, 2014
作者:
E
edgarriba
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed warnings
上级
d2665b65
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
20 deletion
+21
-20
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
..._code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
+3
-3
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.h
...al_code/calib3d/real_time_pose_estimation/src/CsvReader.h
+2
-3
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp
..._code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp
+7
-7
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h
...al_code/calib3d/real_time_pose_estimation/src/CsvWriter.h
+9
-7
未找到文件。
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
浏览文件 @
2881f2a0
...
...
@@ -2,13 +2,13 @@
#include "Utils.h"
/** The default constructor of the CSV reader Class */
CsvReader
::
CsvReader
(
const
st
d
::
st
ring
&
path
,
const
char
&
separator
){
CsvReader
::
CsvReader
(
const
string
&
path
,
const
char
&
separator
){
_file
.
open
(
path
.
c_str
(),
ifstream
::
in
);
_separator
=
separator
;
}
/* Read a plane text file with .ply format */
void
CsvReader
::
readPLY
(
std
::
vector
<
cv
::
Point3f
>
&
list_vertex
,
std
::
vector
<
std
::
vector
<
int
>
>
&
list_triangles
)
void
CsvReader
::
readPLY
(
vector
<
Point3f
>
&
list_vertex
,
vector
<
vector
<
int
>
>
&
list_triangles
)
{
std
::
string
line
,
tmp_str
,
n
;
int
num_vertex
=
0
,
num_triangles
=
0
;
...
...
@@ -61,7 +61,7 @@ void CsvReader::readPLY(std::vector<cv::Point3f> &list_vertex, std::vector<std::
// read faces and add into 'list_triangles'
else
if
(
end_vertex
&&
count
<
num_triangles
)
{
st
d
::
st
ring
num_pts_per_face
,
id0
,
id1
,
id2
;
string
num_pts_per_face
,
id0
,
id1
,
id2
;
getline
(
liness
,
num_pts_per_face
,
_separator
);
getline
(
liness
,
id0
,
_separator
);
getline
(
liness
,
id1
,
_separator
);
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.h
浏览文件 @
2881f2a0
...
...
@@ -3,7 +3,6 @@
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
using
namespace
std
;
...
...
@@ -19,7 +18,7 @@ public:
* @param separator - The separator character between words per line
* @return
*/
CsvReader
(
const
st
d
::
st
ring
&
path
,
const
char
&
separator
=
' '
);
CsvReader
(
const
string
&
path
,
const
char
&
separator
=
' '
);
/**
* Read a plane text file with .ply format
...
...
@@ -28,7 +27,7 @@ public:
* @param list_triangle - The container of the triangles list of the mesh
* @return
*/
void
readPLY
(
std
::
vector
<
cv
::
Point3f
>
&
list_vertex
,
std
::
vector
<
std
::
vector
<
int
>
>
&
list_triangles
);
void
readPLY
(
vector
<
Point3f
>
&
list_vertex
,
vector
<
vector
<
int
>
>
&
list_triangles
);
private:
/** The current stream file for the reader */
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp
浏览文件 @
2881f2a0
#include "CsvWriter.h"
#include "Utils.h"
CsvWriter
::
CsvWriter
(
const
st
d
::
string
&
path
,
const
std
::
string
&
separator
){
_file
.
open
(
path
.
c_str
(),
std
::
ofstream
::
out
);
CsvWriter
::
CsvWriter
(
const
st
ring
&
path
,
const
string
&
separator
){
_file
.
open
(
path
.
c_str
(),
ofstream
::
out
);
_isFirstTerm
=
true
;
_separator
=
separator
;
}
...
...
@@ -12,9 +12,9 @@ CsvWriter::~CsvWriter() {
_file
.
close
();
}
void
CsvWriter
::
writeXYZ
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
)
void
CsvWriter
::
writeXYZ
(
const
vector
<
Point3f
>
&
list_points3d
)
{
st
d
::
st
ring
x
,
y
,
z
;
string
x
,
y
,
z
;
for
(
unsigned
int
i
=
0
;
i
<
list_points3d
.
size
();
++
i
)
{
x
=
FloatToString
(
list_points3d
[
i
].
x
);
...
...
@@ -26,9 +26,9 @@ void CsvWriter::writeXYZ(const std::vector<cv::Point3f> &list_points3d)
}
void
CsvWriter
::
writeUVXYZ
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
,
const
std
::
vector
<
cv
::
Point2f
>
&
list_points2d
,
const
cv
::
Mat
&
descriptors
)
void
CsvWriter
::
writeUVXYZ
(
const
vector
<
Point3f
>
&
list_points3d
,
const
vector
<
Point2f
>
&
list_points2d
,
const
Mat
&
descriptors
)
{
st
d
::
st
ring
u
,
v
,
x
,
y
,
z
,
descriptor_str
;
string
u
,
v
,
x
,
y
,
z
,
descriptor_str
;
for
(
unsigned
int
i
=
0
;
i
<
list_points3d
.
size
();
++
i
)
{
u
=
FloatToString
(
list_points2d
[
i
].
x
);
...
...
@@ -41,7 +41,7 @@ void CsvWriter::writeUVXYZ(const std::vector<cv::Point3f> &list_points3d, const
for
(
int
j
=
0
;
j
<
32
;
++
j
)
{
descriptor_str
=
FloatToString
(
(
float
)
descriptors
.
at
<
float
>
(
i
,
j
));
descriptor_str
=
FloatToString
(
descriptors
.
at
<
float
>
(
i
,
j
));
_file
<<
_separator
<<
descriptor_str
;
}
_file
<<
std
::
endl
;
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h
浏览文件 @
2881f2a0
#ifndef CSVWRITER_H
#define CSVWRITER_H
#include <fstream>
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
using
namespace
std
;
using
namespace
cv
;
class
CsvWriter
{
public:
CsvWriter
(
const
st
d
::
string
&
path
,
const
std
::
string
&
separator
=
" "
);
CsvWriter
(
const
st
ring
&
path
,
const
string
&
separator
=
" "
);
~
CsvWriter
();
void
writeXYZ
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
);
void
writeUVXYZ
(
const
std
::
vector
<
cv
::
Point3f
>
&
list_points3d
,
const
std
::
vector
<
cv
::
Point2f
>
&
list_points2d
,
const
cv
::
Mat
&
descriptors
);
void
writeXYZ
(
const
vector
<
Point3f
>
&
list_points3d
);
void
writeUVXYZ
(
const
vector
<
Point3f
>
&
list_points3d
,
const
vector
<
Point2f
>
&
list_points2d
,
const
Mat
&
descriptors
);
private:
std
::
ofstream
_file
;
st
d
::
st
ring
_separator
;
ofstream
_file
;
string
_separator
;
bool
_isFirstTerm
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录