Git Product home page Git Product logo

Comments (16)

abdur4373 avatar abdur4373 commented on August 14, 2024 1

Yup @fulkast usage was the issue... Just did cv::waitKey(30); and both windows worked like a charm... Thanks a lot for the tip.
DebugWindow Depth result
screenshot from 2019-02-19 11-32-49
PointCloud Viewer Result
screenshot from 2019-02-19 11-33-05

from lsd_slam.

kevin-george avatar kevin-george commented on August 14, 2024

Are you talking about the grayed out DepthMap window that pops up?
If yes, I haven't gotten that to work either. I have been using the library as a visual odometry source with ROS and it's working as expected.

from lsd_slam.

Minimartian avatar Minimartian commented on August 14, 2024

Thanks for the quick reply!

I was interested in observing the depth map to see if we could use lsd_slam for our project which is set up on kinetic.

Not to worry! I'll see if i can install lsd on indigo just to test it, or use Rviz in some way.

Thanks again

from lsd_slam.

OAkyildiz avatar OAkyildiz commented on August 14, 2024

The windows version of that code had no concept of reference frames or a viewport and it looked like a placeholder. I think RViz is your best bet to test the KeyFrames. As far as I can remember, the keyframes and frames (and their clouds) are being processed and transformed from world to camera properly or at least it is easy to handle that with a few calls to ros.tf in ROS

from lsd_slam.

fulkast avatar fulkast commented on August 14, 2024

@kevin-george I have gotten the DepthMap to work on my machine. This is a similar issue that has been faced by ORB-SLAM on Ubuntu 16.04 as well.

While I don't know the exact low-level issue, from a higher level, I think this happens because of clashes between different Qt threads. One such thread is the one in charge of displaying the depthMap. I traced the Util::displayImage method which displays the depthMap and it eventually led to the cv::namedWindow method. I think that if your OpenCV was compiled with Qt, then calling namedWindow would generate a Qt thread. This then would clash with some other Qt thread in charge of another SLAM task.

This is my hypothesis. The things I haven't check are the follows:

  1. Is ros-kinetic-opencv3 built with Qt?
  2. Which qt threads are active in other LSD-SLAM tasks?

For now this one thing is certain. I have removed my ros-kinetic-opencv3, pulled cv-bridge from github into my catkin_ws and also built and installed OpenCV 3 from source without Qt.

The depthMap display works on my machine Ubuntu 16.04 and I don't get any errors regarding QObject.

from lsd_slam.

kevin-george avatar kevin-george commented on August 14, 2024

@fulkast Thank you for that tip! I'll be trying to fix this without having to re-install opencv. If you find a way to do that, please do let me know :)

from lsd_slam.

fulkast avatar fulkast commented on August 14, 2024

@kevin-george Good call! Installing OpenCV from source takes quite some time. I lucked out as I already had a version of OpenCV installed which didn't have Qt.

Are you using OpenCV 3 installed through the ros-kinetic-opencv3 package?

from lsd_slam.

kevin-george avatar kevin-george commented on August 14, 2024

Yeah, ROS ported over to opencv3 and I'm using the default package.
I wonder if we can get away with not installing Qt and use the one installed with ROS instead? Seems like the easiest fix(no code fixes that is)

from lsd_slam.

sujaymanb avatar sujaymanb commented on August 14, 2024

Has anyone found a way to fix this? I am trying to use lsd slam as a vision based odometry solution (for drone). How did you use the odometry? I keep losing trace after a few seconds of starting lsd slam.

from lsd_slam.

abdur4373 avatar abdur4373 commented on August 14, 2024

Hello! @kevin-george Did you find any solution for displaying depth map without removing ros-kinetic-opencv3?

from lsd_slam.

abdur4373 avatar abdur4373 commented on August 14, 2024

Hello! @kevin-george @fulkast
I have found a solution to DepthMap window greyed out issue. Got a hint of the issue from herehttp://answers.opencv.org/question/174121/v33-imshow-no-response/.
With issue#2 resolved from the pull request#8, i have added cv::waitKey();
here:- void displayThreadLoop() . . } cv::imshow(displayQueue.back().name, displayQueue.back().img); cv::waitKey(); displayQueue.pop_back(); } . . printf("ended image display thread!\n"); }
in file "~/catkin_ws/src/lsd_slam/lsd_slam_core/src/IOWrapper/OpenCV/ImageDisplay_OpenCV.cpp".
And pressing hotkey "d" or "e" while DepthMap window is selected. DepthMap as well as Point Cloud both gets updated.

Now if you can help me out why there is need to press this hotkey for this to work? What can i add to the code so it can run by itself?
Thanks

from lsd_slam.

fulkast avatar fulkast commented on August 14, 2024

@abdur4373 if you just added an integer to the cv::waitKey() function , that isn't 0.

That is for example, use:

cv::waitKey(1);

Here's a detailed explanation of the waitKey function: https://stackoverflow.com/questions/5217519/what-does-opencvs-cvwaitkey-function-do

from lsd_slam.

vyi avatar vyi commented on August 14, 2024

@abdur4373 Didn't work for me :(
Tried with different values but no luck!
I'm on kinetic.

from lsd_slam.

zhangliyun9120 avatar zhangliyun9120 commented on August 14, 2024

@abdur4373 Didn't work for me :(
Tried with different values but no luck!
I'm on kinetic.


same to yours, have you found the solution? thx

from lsd_slam.

kanishkanarch avatar kanishkanarch commented on August 14, 2024

Yup, @fulkast usage was the issue... I just did cv::waitKey(30); and both windows worked like a charm... Thanks a lot for the tip.
DebugWindow Depth result
screenshot from 2019-02-19 11-32-49
PointCloud Viewer Result
screenshot from 2019-02-19 11-33-05

@abdur4373, writing cv::waitKey(30) there got my depth window working, but it seems like it 'refreshes' only when a key is pressed. How do I get it working automatically? Any leads?

from lsd_slam.

OAkyildiz avatar OAkyildiz commented on August 14, 2024

@Kanishk598 that should not be the case, cv::waitKey(30) will wait for a key for 30 ms. Somehow you are waiting for a key forever, then

from lsd_slam.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.