package nl.ru.ai.projects.parrot.poledetection;
import java.nio.ByteBuffer;
import nl.ru.ai.projects.parrot.dronecontrol.VideoPollInterface;
private static native void init0(
int width,
int height,
boolean hexel,
double hexelDiameter,
boolean colorspace,
boolean convert,
int l,
int m,
int s,
boolean normalize,
boolean lateral);
public static synchronized native void setData(ByteBuffer data);
static {
System.loadLibrary("PoleDetector");
final Object sync = new Object();
synchronized (sync) {
Thread poleDetectorThread = new Thread(new Runnable() {
@Override
synchronized (CPPPoleDetector.class) {
synchronized (sync) {
sync.notifyAll();
}
init0(VideoPollInterface.FRONT_VIDEO_FRAME_WIDTH, VideoPollInterface.FRONT_VIDEO_FRAME_HEIGHT, true, 3.6, true, true, 1, 0, 0, false, true);
}
}
});
poleDetectorThread.setDaemon(true);
poleDetectorThread.start();
try {
sync.wait();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
};