Can I use Distance info from Kinect in OpenCv?

Home Forums AR Sandbox Forum Can I use Distance info from Kinect in OpenCv?

Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #118364
    Dima
    Participant

    I want to build a sandbox, but I want to add some functionality using OpenCv, can I somehow get a distance map from Kinect? Or does the sandbox program reserve kinect only for themselves?

    #118371
    Oliver Kreylos
    Keymaster

    The SARndbox application talks to the Kinect camera at the USB device level, and only one application can open a USB device at a time.

    If you want to feed a depth map into another application, you will have to modify the SARndbox application’s source code to intercept depth maps either directly where it receives them from the Kinect driver or after depth filtering, and send them to another library in-process, or to another application via IPC.

    #118418
    Dima
    Participant

    Hello!
    I’m trying to get depth data from the sandbox to detect relief features.

    I was able to get raw depth buffer data by saving the buffer from
    rawDepthFrameDispatcher()
    But there’s just a lot of garbage data in there that i dont need.

    Is it possible to get the already filtered depth buffer, of only the sandbox region (that the Sandbox uses to draw height map)?
    Could you point me to roughly the place in the code where I could get such data?

    #118421
    SANDpet
    Participant

    What I want is: https://www.youtube.com/watch?v=RyAMAPIUyZ4

    My first step would be to configure OpenCv at VRUI-makefile and so on, is it right?

    Need help

    #118422
    ilansuriyeli
    Participant
    #123955
    parkinsonl
    Participant

    I’m trying to use opencv with the ar-sandbox too but I’m stuggling to link the libraries. I can get it to work for regular makefiles but what makefile do I modify in the sandbox code? I’ve tried adding the libraries to the Vrui.makeinclude file but it doesn’t seem to be enough

    #123956
    parkinsonl
    Participant

    I made a temporary fix by adding this to usr/local/share/Vrui-4.6/make/BasicMakefile after # Generate the list of libraries from list of packages

    LINKLIBFLAGS += (backtick)pkg-config --libs opencv(backtick)

    replace (backtick) with the backtick character

    I am not sure how I would have a more permanent fix, but I guess it would be creating a Packages.OpenCv file but I do not know what to put in it.

    • This reply was modified 1 week, 3 days ago by parkinsonl.
    #123974
    Oliver Kreylos
    Keymaster

    The simplest way to add custom packages to individual projects if you’re using Vrui’s build system (Packages.*, BasicMakefile etc.) is to put a package definition somewhere in the project’s makefile. For example, here is a snippet from my own Packages.local file:

    OPENCV_BASEDIR = /usr
    OPENCV_DEPENDS = 
    OPENCV_INCLUDE = -I$(OPENCV_BASEDIR)/$(INCLUDEEXT)/opencv
    OPENCV_LIBDIR  = -L$(OPENCV_BASEDIR)/$(LIBEXT)
    OPENCV_LIBS    = -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann \
                     -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect \
                     -lopencv_ocl -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts \
                     -lopencv_video -lopencv_videostab

    (This might be for an older OpenCV version.)

    Then use the package by adding OPENCV to the list of packages used by a make product, for example

    $(EXEDIR)/SARndbox: PACKAGES += OPENCV

    #123975
    Oliver Kreylos
    Keymaster

    You can also use pkg-config to fill in the per-package settings:

    OPENCV_BASEDIR = 
    OPENCV_DEPENDS = 
    OPENCV_INCLUDE = $(shell pkg-config --cflags-only-I opencv)
    OPENCV_CFLAGS = $(shell pkg-config --cflags-only-other opencv)
    OPENCV_LIBDIR = $(shell pkg-config --libs-only-L opencv)
    OPENCV_LIBS = $(shell pkg-config --libs-only-l opencv)
    OPENCV_LINKLIBFLAGS = $(shell pkg-config --libs-only-other opencv)
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Comments are closed.