I want to show a pointcloud generated by myself with the function reprojectImageto3D() of opencv. The opencv type of this pointcloud is CV_32FC3 and its called 'xyz' in my code.
I have done the next inside of a properly main() with the properly libraries aswell:
......
/// Create a window
viz::Viz3d myWindow("Viz Demo");
/// Start event loop
myWindow.spin();
/// Event loop is over when pressed q, Q, e, E
cout << "First event loop is over" << endl;
/// Access window via its name
viz::Viz3d sameWindow = viz::getWindowByName("Viz Demo");
/// Start event loop
sameWindow.spin();
/// Event loop is over when pressed q, Q, e, E
cout << "Second event loop is over" << endl;
/// Event loop is over when pressed q, Q, e, E
/// Start event loop once for 1 millisecond
sameWindow.spinOnce(1, true);
while(!sameWindow.wasStopped())
{
/// Interact with window
/// Create a cloud widget
viz::WCloud cw(xyz, viz::Color::red());
/// Display it in a window
myWindow.showWidget("CloudWidget1", cw);
/// Event loop for 1 millisecond
sameWindow.spinOnce(1, true);
}
/// Once more event loop is stopped
cout << "Last event loop is over" << endl;
.......
The problem is that i cant see the pointcloud in the window but there are not compiling erros. I press 'q' to exit the properly loops and wait but nothing appears in the window.