Git Product home page Git Product logo

Comments (6)

MikoyChinese avatar MikoyChinese commented on June 16, 2024 1

@Jyurineko :), Hah, If you want to use opengl pipeline you need a monitor or headless opengl library. But I just think that you can just use CPU pipeline or OpenCL pipeline enough.

example code:

from pylibfreenect2 import Freenect2, SyncMultiFrameListener
from pylibfreenect2 import FrameType, Registration, Frame
from pylibfreenect2 import OpenCLPacketPipeline

pipeline = OpenCLPacketPipeline()

enable_rgb = True
enable_depth = True

fn = Freenect2()
num_devices = fn.enumerateDevices()
if num_devices == 0:
    print("No device connected!")
    sys.exit(1)

serial = fn.getDeviceSerialNumber(0)
device = fn.openDevice(serial, pipeline=pipeline)

types = 0
if enable_rgb:
    types |= FrameType.Color
if enable_depth:
    types |= (FrameType.Ir | FrameType.Depth)
listener = SyncMultiFrameListener(types)

# Register listeners
device.setColorFrameListener(listener)
device.setIrAndDepthFrameListener(listener)

if enable_rgb and enable_depth:
    device.start()
else:
    device.startStreams(rgb=enable_rgb, depth=enable_depth)

from pylibfreenect2.

r9y9 avatar r9y9 commented on June 16, 2024

I think it should work. Please make sure you have a libfreenect2.so or similar in your file system.

pylibfreenect2/setup.py

Lines 27 to 35 in 981d62a

if platform.system() == "Windows":
lib_candidates = list(filter(lambda l: l.startswith("freenect2."),
os.listdir(join(libfreenect2_library_path))))
else:
lib_candidates = list(filter(lambda l: l.startswith("libfreenect2."),
os.listdir(join(libfreenect2_library_path))))
if len(lib_candidates) == 0:
raise OSError("libfreenect2 library cannot be found")

from pylibfreenect2.

Jyurineko avatar Jyurineko commented on June 16, 2024

thx for reply, the setup.py install is successful.
i forget my is LD_LIBRARY_PATH=/root/freenect2

may i ask should i write OpenGL ES pipeline by myself?
or what should i do can create a visual window?
because everytime i run it shows


[Error] [OpenGLDepthPacketProcessorImpl] GLFW error 65543 GLX: Failed to create context: GLXBadFBConfig
[Error] [OpenGLDepthPacketProcessor] Failed to create opengl window.


sorry i am newbie :)

from pylibfreenect2.

r9y9 avatar r9y9 commented on June 16, 2024

You should first check if libfreenect2 works okay on your platform.

from pylibfreenect2.

MikoyChinese avatar MikoyChinese commented on June 16, 2024

@Jyurineko OpenGL pipeline need a monitor to run, or you can build a headless opengl library. I guessed that you run this on ssh tunnel without X forward, so you can try run this on other pipeline such as opencl or cpu or cuda. These all can work on host without monitor.

from pylibfreenect2.

Jyurineko avatar Jyurineko commented on June 16, 2024

@MikoyChinese i used VNC to remote the monitor, i try direct connect a monitor to run today,
but i also tried ssh -X pi@ip address. and using VNC still same error:(


pi@raspberrypi:~/Desktop/CGPraktikum/freenect2-python/examples $ sudo DISPLAY=0 python3 ir_camera.py
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 6 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @2:3 with serial 014443550647
[Info] [Freenect2Impl] found 1 devices
[Error] [OpenGLDepthPacketProcessorImpl] GLFW error 65544 X11: Failed to open display 0.0
[Error] [OpenGLDepthPacketProcessor] Failed to initialize GLFW.

from pylibfreenect2.

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.