Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to properly convert a byte array to a matrix?

$
0
0
I've posted a question on Stack Overflow just before the weekend. The gist of it is that I want to change the the bytes from the `onPitctureTaken()` to a OpenCV matrix, but my app freezes when I try to do this. This is what I have at the moment: @Override public void onPictureTaken(byte[] bytes, Camera camera) { Log.w(TAG, "picture taken!"); if (bytes != null) { Bitmap image = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); Mat matImage = new Mat(); // This is where my app freezes. Utils.bitmapToMat(image, matImage); Log.w(TAG, matImage.dump()); } mCamera.startPreview(); mCamera.setPreviewCallback(this); } I've also tried several "solutions" I've found on stack overflow to similar problems, without any success. link to the original Stack Overflow post: http://stackoverflow.com/questions/36794243/how-to-process-an-image-with-opencv-onpicturetaken

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>