MarineRoboticsGroup / tonioviz

Finally, a nice C++ visualization tool.
5 stars 0 forks source link

Image viewer #2

Closed tonioteran closed 4 years ago

tonioteran commented 4 years ago

Trying to address #1 .

tonioteran commented 4 years ago

The same simple example should be running with Kurran's images, but you'll def need to change the path of the images.

tonioteran commented 4 years ago

Just got to:

@kurransingh @keevindoherty

Let me know if you can't run it. There's some weird stuff happening with the OpenCV image, but I'm sure I'm parsing something incorrectly either

keevindoherty commented 4 years ago

Probably expected, but this seg faults if you don't have the images :D

keevindoherty commented 4 years ago

I think the aforementioned bug is actually due to the use of cv::imread in mrg::LoadImages (see, for example: https://github.com/opencv/opencv/issues/14095)

My last commit should fix this. I'm not sure if AddImage should be sanitizing inputs (e.g. check for nullptr?)

Also, question for @tonioteran about code styling - is everything set up with linting etc with the pre-commit hooks? So can I assume if git doesn't yell at me when I commit changes my code is beautiful?

kurransingh commented 4 years ago

I had to upgrade to g++ 9 and gcc 9 to get the filesystem library to work as written, but seems fine other than that. Still trying to figure out the distorted image.

tonioteran commented 4 years ago

yea, i think we should try to sanitize the inputs, that'd be great!

tonioteran commented 4 years ago

Still trying to figure out the distorted image.

I thought that it could perhaps have something to do with the size? Or the number of channels? Or the way in which memory is allocated by OpenCV vs Pangolin (contiguous blocks vs not contiguous)? Or something like that?

This way that I'm doing works for my SPHERES images. We can try testing other types of images as well and remove the hardcoded image dimensions for the Blue ROV that I'm using right now.

tonioteran commented 4 years ago

Also, question for @tonioteran about code styling - is everything set up with linting etc with the pre-commit hooks? So can I assume if git doesn't yell at me when I commit changes my code is beautiful?

hahaha yea, if it doesn't complain, then you get A+ at Google hahah

Ok, i've added the stereo functionality for passing in two images, which to use you just need to change the mode to VisualizerMode::STEREO: https://github.com/MarineRoboticsGroup/tonioviz/blob/838a411148e0783bdd12c2b882103d4e426dfe92/examples/SimpleCheckout.cpp#L42 and to pass in the images using the Visualizer::AddStereo function: https://github.com/MarineRoboticsGroup/tonioviz/blob/838a411148e0783bdd12c2b882103d4e426dfe92/examples/SimpleCheckout.cpp#L76