Skip to content

TexasTorque/photon-libcamera-gl-driver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPU-Accelerated, dmabuf-based libcamera JNI

This repository provides GPU accelerated frame capture and preprocessing for Raspberry Pi platforms using libcamera and OpenGL. Currently, shaders exist for GPU-accelerated binary HSV thresholding and greyscaling, though others (such as adaptive threshold, like needed for apriltags) will be supported. This code is exposed via JNI for use in PhotonVision.

Building

We use CMake for our builds. The build should output both a shared library, libphotonlibcamera.so, and a executable for testing. Start by installing dependencies and cloning the repo:

sudo apt-get update
sudo apt-get install -y default-jdk libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev openjdk-11-jdk

git clone https://github.com/PhotonVision/photon-libcamera-gl-driver.git

Build with the following cmake commands:

cd photon-libcamera-gl-driver
mkdir build
cd build
cmake ..

make -j4

This should spit out the shared library into the build directory.

Running eglinfo

Compile with g++ -std=c++17 -o eglinfo eglinfo.c headless_opengl.cpp -lEGL -lGLESv2 -lgbm, and then run with ./eglinfo

About

GPU-accellerated libcamera

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 85.7%
  • C 11.8%
  • CMake 2.4%
  • Shell 0.1%