Add support for OpenCV to Java wrappers.

This commit is contained in:
Peter Johnson
2016-10-21 14:50:24 -07:00
parent 6641612de5
commit 017ec83ce3
5 changed files with 47 additions and 7 deletions

View File

@@ -7,6 +7,8 @@
package edu.wpi.cameraserver;
import org.opencv.core.Mat;
/// A sink for user code to accept video frames as OpenCV images.
public class CvSink extends VideoSink {
/// Create a sink for accepting OpenCV images.
@@ -33,9 +35,9 @@ public class CvSink extends VideoSink {
/// Wait for the next frame and get the image.
/// @return Frame time, or 0 on error (call GetError() to obtain the error
/// message);
//public long grabFrame(CvMat image) {
// return CameraServerJNI.grabSinkFrame(m_handle, image);
//}
public long grabFrame(Mat image) {
return CameraServerJNI.grabSinkFrame(m_handle, image.nativeObj);
}
/// Get error string. Call this if WaitForFrame() returns 0 to determine
/// what the error is.