Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
23785faf
Commit
23785faf
authored
Aug 05, 2014
by
edgarriba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for NON BOOST libraries
parent
16e750dd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
23 deletions
+47
-23
CMakeLists.txt
...ial_code/calib3d/real_time_pose_estimation/CMakeLists.txt
+28
-4
CsvReader.cpp
..._code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
+9
-9
CsvWriter.cpp
..._code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp
+10
-10
No files found.
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt
View file @
23785faf
cmake_minimum_required
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
project
(
PNP_DEMO
)
project
(
PNP_DEMO
)
find_package
(
Boost REQUIRED
)
ADD_DEFINITIONS
(
-std=c++11
-std=c++0x
# Other flags
)
find_package
(
OpenCV REQUIRED
)
find_package
(
OpenCV REQUIRED
)
include_directories
(
include_directories
(
$
(
PNP_DEMO_SOURCE_DIR
)
/include
$
(
PNP_DEMO_SOURCE_DIR
)
/include
${
Boost_INCLUDE_DIR
}
${
OpenCV_INCLUDE_DIRS
}
${
OpenCV_INCLUDE_DIRS
}
)
)
...
@@ -23,6 +27,19 @@ pnp_registration
...
@@ -23,6 +27,19 @@ pnp_registration
src/RobustMatcher.cpp
src/RobustMatcher.cpp
)
)
add_executable
(
pnp_verification
src/main_verification.cpp
src/CsvReader.cpp
src/CsvWriter.cpp
src/ModelRegistration.cpp
src/Mesh.cpp
src/Model.cpp
src/PnPProblem.cpp
src/Utils.cpp
src/RobustMatcher.cpp
)
add_executable
(
add_executable
(
pnp_detection
pnp_detection
src/main_detection.cpp
src/main_detection.cpp
...
@@ -36,5 +53,12 @@ pnp_detection
...
@@ -36,5 +53,12 @@ pnp_detection
src/RobustMatcher.cpp
src/RobustMatcher.cpp
)
)
target_link_libraries
(
pnp_registration
${
Boost_LIBRARIES
}
${
OpenCV_LIBS
}
)
add_executable
(
target_link_libraries
(
pnp_detection
${
Boost_LIBRARIES
}
${
OpenCV_LIBS
}
)
pnp_test
src/test_pnp.cpp
)
target_link_libraries
(
pnp_registration
${
OpenCV_LIBS
}
)
target_link_libraries
(
pnp_verification
${
OpenCV_LIBS
}
)
target_link_libraries
(
pnp_detection
${
OpenCV_LIBS
}
)
target_link_libraries
(
pnp_test
${
OpenCV_LIBS
}
)
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp
View file @
23785faf
#include <
boost/lexical_cast.hpp
>
#include <
string
>
#include "CsvReader.h"
#include "CsvReader.h"
/** The default constructor of the CSV reader Class */
/** The default constructor of the CSV reader Class */
...
@@ -28,8 +28,8 @@ std::string line, tmp_str, n;
...
@@ -28,8 +28,8 @@ std::string line, tmp_str, n;
{
{
getline
(
liness
,
tmp_str
,
_separator
);
getline
(
liness
,
tmp_str
,
_separator
);
getline
(
liness
,
n
);
getline
(
liness
,
n
);
if
(
tmp_str
==
"vertex"
)
num_vertex
=
boost
::
lexical_cast
<
int
>
(
n
);
if
(
tmp_str
==
"vertex"
)
num_vertex
=
std
::
stoi
(
n
);
if
(
tmp_str
==
"face"
)
num_triangles
=
boost
::
lexical_cast
<
int
>
(
n
);
if
(
tmp_str
==
"face"
)
num_triangles
=
std
::
stoi
(
n
);
}
}
if
(
tmp_str
==
"end_header"
)
end_header
=
true
;
if
(
tmp_str
==
"end_header"
)
end_header
=
true
;
}
}
...
@@ -46,9 +46,9 @@ std::string line, tmp_str, n;
...
@@ -46,9 +46,9 @@ std::string line, tmp_str, n;
getline
(
liness
,
z
);
getline
(
liness
,
z
);
cv
::
Point3f
tmp_p
;
cv
::
Point3f
tmp_p
;
tmp_p
.
x
=
boost
::
lexical_cast
<
float
>
(
x
);
tmp_p
.
x
=
std
::
stof
(
x
);
tmp_p
.
y
=
boost
::
lexical_cast
<
float
>
(
y
);
tmp_p
.
y
=
std
::
stof
(
y
);
tmp_p
.
z
=
boost
::
lexical_cast
<
float
>
(
z
);
tmp_p
.
z
=
std
::
stof
(
z
);
list_vertex
.
push_back
(
tmp_p
);
list_vertex
.
push_back
(
tmp_p
);
count
++
;
count
++
;
...
@@ -68,9 +68,9 @@ std::string line, tmp_str, n;
...
@@ -68,9 +68,9 @@ std::string line, tmp_str, n;
getline
(
liness
,
id2
);
getline
(
liness
,
id2
);
std
::
vector
<
int
>
tmp_triangle
(
3
);
std
::
vector
<
int
>
tmp_triangle
(
3
);
tmp_triangle
[
0
]
=
boost
::
lexical_cast
<
int
>
(
id0
);
tmp_triangle
[
0
]
=
std
::
stoi
(
id0
);
tmp_triangle
[
1
]
=
boost
::
lexical_cast
<
int
>
(
id1
);
tmp_triangle
[
1
]
=
std
::
stoi
(
id1
);
tmp_triangle
[
2
]
=
boost
::
lexical_cast
<
int
>
(
id2
);
tmp_triangle
[
2
]
=
std
::
stoi
(
id2
);
list_triangles
.
push_back
(
tmp_triangle
);
list_triangles
.
push_back
(
tmp_triangle
);
count
++
;
count
++
;
...
...
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp
View file @
23785faf
#include <
boost/lexical_cast.hpp
>
#include <
string
>
#include "CsvWriter.h"
#include "CsvWriter.h"
CsvWriter
::
CsvWriter
(
const
std
::
string
&
path
,
const
std
::
string
&
separator
){
CsvWriter
::
CsvWriter
(
const
std
::
string
&
path
,
const
std
::
string
&
separator
){
...
@@ -17,9 +17,9 @@ void CsvWriter::writeXYZ(const std::vector<cv::Point3f> &list_points3d)
...
@@ -17,9 +17,9 @@ void CsvWriter::writeXYZ(const std::vector<cv::Point3f> &list_points3d)
std
::
string
x
,
y
,
z
;
std
::
string
x
,
y
,
z
;
for
(
unsigned
int
i
=
0
;
i
<
list_points3d
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
list_points3d
.
size
();
++
i
)
{
{
x
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points3d
[
i
].
x
);
x
=
std
::
to_string
(
list_points3d
[
i
].
x
);
y
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points3d
[
i
].
y
);
y
=
std
::
to_string
(
list_points3d
[
i
].
y
);
z
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points3d
[
i
].
z
);
z
=
std
::
to_string
(
list_points3d
[
i
].
z
);
_file
<<
x
<<
_separator
<<
y
<<
_separator
<<
z
<<
std
::
endl
;
_file
<<
x
<<
_separator
<<
y
<<
_separator
<<
z
<<
std
::
endl
;
}
}
...
@@ -31,18 +31,18 @@ void CsvWriter::writeUVXYZ(const std::vector<cv::Point3f> &list_points3d, const
...
@@ -31,18 +31,18 @@ void CsvWriter::writeUVXYZ(const std::vector<cv::Point3f> &list_points3d, const
std
::
string
u
,
v
,
x
,
y
,
z
,
descriptor_str
;
std
::
string
u
,
v
,
x
,
y
,
z
,
descriptor_str
;
for
(
int
i
=
0
;
i
<
list_points3d
.
size
();
++
i
)
for
(
int
i
=
0
;
i
<
list_points3d
.
size
();
++
i
)
{
{
u
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points2d
[
i
].
x
);
u
=
std
::
to_string
(
list_points2d
[
i
].
x
);
v
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points2d
[
i
].
y
);
v
=
std
::
to_string
(
list_points2d
[
i
].
y
);
x
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points3d
[
i
].
x
);
x
=
std
::
to_string
(
list_points3d
[
i
].
x
);
y
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points3d
[
i
].
y
);
y
=
std
::
to_string
(
list_points3d
[
i
].
y
);
z
=
boost
::
lexical_cast
<
std
::
string
>
(
list_points3d
[
i
].
z
);
z
=
std
::
to_string
(
list_points3d
[
i
].
z
);
_file
<<
u
<<
_separator
<<
v
<<
_separator
<<
x
<<
_separator
<<
y
<<
_separator
<<
z
;
_file
<<
u
<<
_separator
<<
v
<<
_separator
<<
x
<<
_separator
<<
y
<<
_separator
<<
z
;
for
(
int
j
=
0
;
j
<
32
;
++
j
)
for
(
int
j
=
0
;
j
<
32
;
++
j
)
{
{
std
::
cout
<<
descriptors
.
at
<
float
>
(
i
,
j
)
<<
std
::
endl
;
std
::
cout
<<
descriptors
.
at
<
float
>
(
i
,
j
)
<<
std
::
endl
;
descriptor_str
=
boost
::
lexical_cast
<
std
::
string
>
(
descriptors
.
at
<
float
>
(
i
,
j
));
descriptor_str
=
std
::
to_string
(
descriptors
.
at
<
float
>
(
i
,
j
));
_file
<<
_separator
<<
descriptor_str
;
_file
<<
_separator
<<
descriptor_str
;
}
}
_file
<<
std
::
endl
;
_file
<<
std
::
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment