Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
b51d0df4
Commit
b51d0df4
authored
Oct 26, 2015
by
Wangyida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust pose of particular obj
parent
dd50d5bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
datagen_all.sh
modules/cnn_3dobj/samples/datagen_all.sh
+2
-7
datagen_front.sh
modules/cnn_3dobj/samples/datagen_front.sh
+7
-3
demo_sphereview_data.cpp
modules/cnn_3dobj/samples/demo_sphereview_data.cpp
+13
-3
No files found.
modules/cnn_3dobj/samples/datagen_all.sh
View file @
b51d0df4
...
...
@@ -82,9 +82,4 @@
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/01.ply
-label_class
=
11
-label_item
=
1
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/02.ply
-label_class
=
11
-label_item
=
2
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/03.ply
-label_class
=
11
-label_item
=
3
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/04.ply
-label_class
=
11
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/01.ply
-label_class
=
12
-label_item
=
1
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.5
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/02.ply
-label_class
=
12
-label_item
=
2
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.5
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/03.ply
-label_class
=
12
-label_item
=
3
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.5
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/04.ply
-label_class
=
12
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.5
\ No newline at end of file
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/04.ply
-label_class
=
11
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
\ No newline at end of file
modules/cnn_3dobj/samples/datagen_front.sh
View file @
b51d0df4
...
...
@@ -16,7 +16,6 @@
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/boat/01.ply
-label_class
=
3
-label_item
=
1
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/boat_pascal/
-z_range
=
0.6
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/boat/02.ply
-label_class
=
3
-label_item
=
2
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/boat_pascal/
-z_range
=
0.6
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/boat/03.ply
-label_class
=
3
-label_item
=
3
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/boat_pascal/
-z_range
=
0.6
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/boat/04.ply
-label_class
=
3
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/boat_pascal/
-z_range
=
0.6
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/boat/05.ply
-label_class
=
3
-label_item
=
5
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/boat_pascal/
-z_range
=
0.6
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/boat/06.ply
-label_class
=
3
-label_item
=
6
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/boat_pascal/
-z_range
=
0.6
-front_view
=
1
...
...
@@ -48,4 +47,9 @@
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/01.ply
-label_class
=
11
-label_item
=
1
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/02.ply
-label_class
=
11
-label_item
=
2
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/03.ply
-label_class
=
11
-label_item
=
3
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/04.ply
-label_class
=
11
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
-front_view
=
1
\ No newline at end of file
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/train/04.ply
-label_class
=
11
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/train_pascal/
-z_range
=
0.2
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/01.ply
-label_class
=
12
-label_item
=
1
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.3
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/02.ply
-label_class
=
12
-label_item
=
2
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.3
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/03.ply
-label_class
=
12
-label_item
=
3
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.3
-front_view
=
1
./sphereview_test
-plymodel
=
/Users/yidawang/Downloads/PASCAL3D+_release1.1/CAD/tvmonitor/04.ply
-label_class
=
12
-label_item
=
4
-bakgrdir
=
/Users/yidawang/Documents/database/backgrd_pascal/tvmonitor_pascal/
-z_range
=
0.3
-front_view
=
1
\ No newline at end of file
modules/cnn_3dobj/samples/demo_sphereview_data.cpp
View file @
b51d0df4
...
...
@@ -130,8 +130,11 @@ int main(int argc, char *argv[])
double
obj_dist
,
bg_dist
,
y_range
;
if
(
front_view
)
{
if
(
label_class
==
12
)
obj_dist
=
340
;
else
obj_dist
=
240
;
ite_depth
=
ite_depth
+
1
;
obj_dist
=
240
;
bg_dist
=
700
;
y_range
=
0.85
;
}
...
...
@@ -193,8 +196,6 @@ int main(int argc, char *argv[])
/* Set background color. */
myWindow
.
setBackgroundColor
(
viz
::
Color
::
gray
());
myWindow
.
spin
();
/* Add light. */
//myWindow.addLight(Vec3d(0,0,100000), Vec3d(0,0,0), viz::Color::white(), viz::Color::gray(), viz::Color::black(), viz::Color::white());
/* Create a Mesh widget, loading .ply models. */
viz
::
Mesh
objmesh
=
viz
::
Mesh
::
load
(
plymodel
);
/* Get the center of the generated mesh widget, cause some .ply files, this could be ignored if you are using PASCAL database*/
...
...
@@ -235,6 +236,11 @@ int main(int argc, char *argv[])
{
cnt_img
=
0
;
for
(
int
pose
=
0
;
pose
<
static_cast
<
int
>
(
campos
.
size
());
pose
++
){
/* Add light. */
// double alpha1 = rand()%(314/2)/100;
// double alpha2 = rand()%(314*2)/100;
// printf("%f %f %f/n", ceil(10000*sqrt(1 - sin(alpha1)*sin(alpha1))*sin(alpha2)), 10000*sqrt(1 - sin(alpha1)*sin(alpha1))*cos(alpha2), sin(alpha1)*10000);
// myWindow.addLight(Vec3d(10000*sqrt(1 - sin(alpha1)*sin(alpha1))*sin(alpha2),10000*sqrt(1 - sin(alpha1)*sin(alpha1))*cos(alpha2),sin(alpha1)*10000), Vec3d(0,0,0), viz::Color::white(), viz::Color::white(), viz::Color::black(), viz::Color::white());
int
label_x
,
label_y
,
label_z
;
label_x
=
static_cast
<
int
>
(
campos
.
at
(
pose
).
x
*
100
);
label_y
=
static_cast
<
int
>
(
campos
.
at
(
pose
).
y
*
100
);
...
...
@@ -245,6 +251,10 @@ int main(int argc, char *argv[])
imglabel
<<
filename
<<
' '
<<
label_class
<<
endl
;
filename
=
imagedir
+
filename
;
/* Get the pose of the camera using makeCameraPoses. */
if
(
front_view
)
{
cam_focal_point
.
y
=
cam_focal_point
.
y
-
label_x
/
30
;
}
Affine3f
cam_pose
=
viz
::
makeCameraPose
(
campos
.
at
(
pose
)
*
obj_dist
+
cam_focal_point
,
cam_focal_point
,
cam_y_dir
*
obj_dist
+
cam_focal_point
);
/* Get the transformation matrix from camera coordinate system to global. */
Affine3f
transform
=
viz
::
makeTransformToGlobal
(
Vec3f
(
1.0
f
,
0.0
f
,
0.0
f
),
Vec3f
(
0.0
f
,
1.0
f
,
0.0
f
),
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
),
campos
.
at
(
pose
));
...
...
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