Git Product home page Git Product logo

Comments (9)

WASCHMASCHINE avatar WASCHMASCHINE commented on July 30, 2024

Hey santonatos,

  1. You should use sl::MEM_CPU to download the disparity measure to CPU, since you are not using the GPU I assume.
  2. I assume you know what a disparity map is. The image consists of a single channel, unlike an RGB image with 3 color channels, and the data are floats. Again in the image, they would be uchars.
  3. You can use OpenCV to display float images. There is a function called slMat2cvMat included in the OpenCV example of StereoLabs. You can get a cv::Mat from it and can display it with cv::imshow. You will need to scale the image values between 0 and 1, although. So divide it by 50 or something.

from zed-sdk.

santonatos avatar santonatos commented on July 30, 2024

hi waschmachine, I am aware of what you are describing, but I am not sure if you can display a disparity map this way, i think it does not work with a depth map for sure (the depth map uses an openGL viewer, the depth image uses what you are describing)
I will try it, but I am not sure if it will work

from zed-sdk.

WASCHMASCHINE avatar WASCHMASCHINE commented on July 30, 2024

I can confirm it is working flawlessly with OpenCV and the sl2Mat2cvMat function for the depth measure. I've scaled it by 1/20 for visualization purposes, because maximum depth range is 20m. It works even for float32 images.

from zed-sdk.

santonatos avatar santonatos commented on July 30, 2024

ok i ll try it. but i care about the disparity not the depth. but the description has them with similar characteristics so that shouldnt be an issue

from zed-sdk.

obraun-sl avatar obraun-sl commented on July 30, 2024

Hi,
You can do the same with disparity but you need to take care in the "scaling" that disparity is a negative value.
/OB/

from zed-sdk.

santonatos avatar santonatos commented on July 30, 2024

Do you both mean that I would have to go through all the values in the Mat and 'scale them'? How would I scale the values?

from zed-sdk.

WASCHMASCHINE avatar WASCHMASCHINE commented on July 30, 2024

Come on. Google it.
cv::Mat newImg = oldDepthImg * 0.05f;

from zed-sdk.

santonatos avatar santonatos commented on July 30, 2024

lol just that? interesting, This must be a property of the Mat that I am not aware of

from zed-sdk.

obraun-sl avatar obraun-sl commented on July 30, 2024

Property of cv::Mat, not sl::Mat ( we did not implement it yet).
Therefore just "cast" a sl::Mat into a cv::Mat and then use all the properties of a cv::Mat.

from zed-sdk.

Related Issues (20)

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.