This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HelloJNI { | |
static { | |
System.loadLibrary("hello"); // loads libhello.so | |
} | |
private native void sayHello(String name); | |
public static void main(String[] args) { | |
new HelloJNI().sayHello("Dave"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
# Find python and Boost - both are required dependencies | |
find_package(PythonLibs 2.7 REQUIRED) | |
find_package(Boost COMPONENTS python REQUIRED) | |
# Without this, any build libraries automatically have names "lib{x}.so" | |
set(CMAKE_SHARED_MODULE_PREFIX "") | |
# Add a shared module - modules are intended to be imported at runtime. |
Unfortunately, NVidia Jetpack 4.5.x for Jetson Nano, Xavier etc. comes with OpenCV 4.1.1 and FFMPEG 3.4.8 compiled without any hardware (GPU, CUDA) acceleration and without SRT support.
Retrieving current OpenCV build information:
$ python3
import cv2