Commit cbd26a65 authored by Pavel Rojtberg's avatar Pavel Rojtberg

cnn_3dobj: fix demo_sphereview_data

parent 49399734
...@@ -112,8 +112,8 @@ int main(int argc, char *argv[]) ...@@ -112,8 +112,8 @@ int main(int argc, char *argv[])
int ite_depth = parser.get<int>("ite_depth"); int ite_depth = parser.get<int>("ite_depth");
String plymodel = parser.get<String>("plymodel"); String plymodel = parser.get<String>("plymodel");
String imagedir = parser.get<String>("imagedir"); String imagedir = parser.get<String>("imagedir");
string labeldir = parser.get<String>("labeldir"); String labeldir = parser.get<String>("labeldir");
String bakgrdir = parser.get<string>("bakgrdir"); String bakgrdir = parser.get<String>("bakgrdir");
int label_class = parser.get<int>("label_class"); int label_class = parser.get<int>("label_class");
int label_item = parser.get<int>("label_item"); int label_item = parser.get<int>("label_item");
float cam_head_x = parser.get<float>("cam_head_x"); float cam_head_x = parser.get<float>("cam_head_x");
...@@ -218,8 +218,7 @@ int main(int argc, char *argv[]) ...@@ -218,8 +218,7 @@ int main(int argc, char *argv[])
} }
} }
std::fstream imglabel; std::fstream imglabel;
char* p=(char*)labeldir.data(); imglabel.open(labeldir.c_str(), fstream::app|fstream::out);
imglabel.open(p, fstream::app|fstream::out);
bool camera_pov = true; bool camera_pov = true;
/* Create a window using viz. */ /* Create a window using viz. */
viz::Viz3d myWindow("Coordinate Frame"); viz::Viz3d myWindow("Coordinate Frame");
...@@ -227,7 +226,7 @@ int main(int argc, char *argv[]) ...@@ -227,7 +226,7 @@ int main(int argc, char *argv[])
myWindow.setWindowSize(Size(image_size,image_size)); myWindow.setWindowSize(Size(image_size,image_size));
/* Set background color. */ /* Set background color. */
myWindow.setBackgroundColor(viz::Color::gray()); myWindow.setBackgroundColor(viz::Color::gray());
myWindow.spin(); myWindow.spinOnce();
/* Create a Mesh widget, loading .ply models. */ /* Create a Mesh widget, loading .ply models. */
viz::Mesh objmesh = viz::Mesh::load(plymodel); 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*/ /* Get the center of the generated mesh widget, cause some .ply files, this could be ignored if you are using PASCAL database*/
...@@ -249,7 +248,7 @@ int main(int argc, char *argv[]) ...@@ -249,7 +248,7 @@ int main(int argc, char *argv[])
cam_y_dir.x = cam_head_x; cam_y_dir.x = cam_head_x;
cam_y_dir.y = cam_head_y; cam_y_dir.y = cam_head_y;
cam_y_dir.z = cam_head_z; cam_y_dir.z = cam_head_z;
char* temp = new char; char temp[1024];
std::vector<String> name_bkg; std::vector<String> name_bkg;
if (bakgrdir.size() != 0) if (bakgrdir.size() != 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment