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
2848f43a
Commit
2848f43a
authored
Jul 30, 2014
by
edgarriba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code tutorial
parent
319dbd2e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
0 deletions
+84
-0
CsvReader.h
...ode/calib3d/real_time_pose_estimation/include/CsvReader.h
+41
-0
ModelRegistration.h
...b3d/real_time_pose_estimation/include/ModelRegistration.h
+43
-0
No files found.
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/include/CsvReader.h
0 → 100644
View file @
2848f43a
#ifndef CSVREADER_H
#define CSVREADER_H
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include "Mesh.h"
using
namespace
std
;
using
namespace
cv
;
class
CsvReader
{
public
:
/**
* The default constructor of the CSV reader Class.
* The default separator is ' ' (empty space)
*
* @param path - The path of the file to read
* @param separator - The separator character between words per line
* @return
*/
CsvReader
(
const
std
::
string
&
path
,
const
char
&
separator
=
' '
);
/**
* Read a plane text file with .ply format
*
* @param list_vertex - The container of the vertices list of the mesh
* @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
);
private
:
/** The current stream file for the reader */
ifstream
_file
;
/** The separator character between words for each line */
char
_separator
;
};
#endif
samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/include/ModelRegistration.h
0 → 100644
View file @
2848f43a
/*
* ModelRegistration.h
*
* Created on: Apr 18, 2014
* Author: edgar
*/
#ifndef MODELREGISTRATION_H_
#define MODELREGISTRATION_H_
#include <iostream>
#include <opencv2/core/core.hpp>
class
ModelRegistration
{
public
:
ModelRegistration
();
virtual
~
ModelRegistration
();
void
setNumMax
(
int
n
)
{
max_registrations_
=
n
;
}
std
::
vector
<
cv
::
Point2f
>
get_points2d
()
const
{
return
list_points2d_
;
}
std
::
vector
<
cv
::
Point3f
>
get_points3d
()
const
{
return
list_points3d_
;
}
int
getNumMax
()
const
{
return
max_registrations_
;
}
int
getNumRegist
()
const
{
return
n_registrations_
;
}
bool
is_registrable
()
const
{
return
(
n_registrations_
<
max_registrations_
);
}
void
registerPoint
(
const
cv
::
Point2f
&
point2d
,
const
cv
::
Point3f
&
point3d
);
void
reset
();
private
:
/** The current number of registered points */
int
n_registrations_
;
/** The total number of points to register */
int
max_registrations_
;
/** The list of 2D points to register the model */
std
::
vector
<
cv
::
Point2f
>
list_points2d_
;
/** The list of 3D points to register the model */
std
::
vector
<
cv
::
Point3f
>
list_points3d_
;
};
#endif
/* MODELREGISTRATION_H_ */
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