Huh? or Fun Writing Images to File

Post date: Apr 02, 2012 11:7:25 PM

So I'm totally baffled trying to figure out how to write an image to a file. This doesn't make sense to me but it is so.

I've found a bunch of references on how to write to sdcard from android, how to write a file with java, how to write a file from opencv to disk if you're writing C code.

I have however yet to find any reference to writing a Mat to the SDCard on android. If I could figure out how to convert Mat to Byte[] I could use fileOutputStream from java and write that.

I am going to have to figure out how to do this at some point if I plan on munging the image before writing it back out.

For now I'm going to see if I can just circumvent it. I'll use the mat to figure out if the center goes dark and then just grab a frame from the camera and write it. I'm concerned that I'm going to have a permissions issue since the code has already got the camera open and this is a separate portion of the code which might not have access to that same object yet.

...

Let's find out.