You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, to create, say a NV12 image, one needs to do these 2 steps:
opencv_core.CvMat nv21Image = opencv_core.CvMat.create((int)(1.5 * height),
width, opencv_core.CV_8UC2);
nv21Image.getByteBuffer().put(image_data); // byte[] image_data
Most of the time though, the image is placed into the same buffer by the
caller. So, if we wrapped opencv_core.CvMat over an existing buffer, this would
save some time on not having to copy the bytes over.
Original issue reported on code.google.com by eug...@wearableintelligence.com on 10 Feb 2014 at 9:52
The text was updated successfully, but these errors were encountered:
The problem is with byte[]: It can't be pinned down across native function
calls. There's a way to optimize that within a single JNI call by using
GetPrimitiveArrayCritical() but I'm not sure how we could take advantage of
that at a higher level... That would be a request for JavaCPP though:
http://code.google.com/p/javacpp/issues/
This difficult of Java array to be used on the native side efficiently is what
prompted Sun to create direct NIO buffers in the first place, so we should ask
Google to add support for NIO buffers there :)
BTW, there appears to be a better hack to capture from the camera on Android,
as mentioned at issue #422.
Original comment by samuel.a...@gmail.com on 11 Feb 2014 at 1:52
Original issue reported on code.google.com by
eug...@wearableintelligence.com
on 10 Feb 2014 at 9:52The text was updated successfully, but these errors were encountered: