same error for me. I am using this code:
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
State state = mRenderer.begin();
Image imageRGB565 = null;
Frame frame = state.getFrame();
for (int i = 0; i < frame.getNumImages(); ++i) {
Image image = frame.getImage(i);
if (image.getFormat() == PIXEL_FORMAT.RGB565) {
imageRGB565 = image;
break;
}
Log.e(LOGTAG, "Entra 1");
}
if (imageRGB565 != null) {
int imageWidth = imageRGB565.getWidth();
int imageHeight = imageRGB565.getHeight();
int stride = imageRGB565.getStride();
Log.d("Image", "Image width: " + imageWidth);
Log.d("Image", "Image height: " + imageHeight);
Log.d("Image", "Image stride: " + stride);
ByteBuffer pixels = imageRGB565.getPixels();
byte[] pixelArray = pixels.array();
Log.d("Image", "First pixel byte: " + pixelArray[0]);
Log.e(LOGTAG, "Entra 2");
}
and the error log:
09-02 20:36:17.718: E/AndroidRuntime(9134): Process: com.qualcomm.vuforia.samples.VuforiaSamples, PID: 9134
09-02 20:36:17.718: E/AndroidRuntime(9134): java.lang.UnsupportedOperationException
09-02 20:36:17.718: E/AndroidRuntime(9134): at java.nio.DirectByteBuffer.protectedArray(DirectByteBuffer.java:92)
09-02 20:36:17.718: E/AndroidRuntime(9134): at java.nio.ByteBuffer.array(ByteBuffer.java:129)
09-02 20:36:17.718: E/AndroidRuntime(9134): at com.qualcomm.vuforia.samples.VuforiaSamples.app.ImageTargets.ImageTargetRenderer.renderFrame(ImageTargetRenderer.java:210)
You should not use the BitmapFactory.decodebytearray() method, as the camera image is not a PNG or JPEG image.
The correct solution is posted here:
https://developer.vuforia.com/forum/android/camera-image-returns-black
Please follow up in that thread.
(I'll close this one).