Post date: Apr 11, 2012 7:42:21 AM
I'm now saving images.
I found the proper method to use partially with the help of RobotGrrl and Birdmun from let's make robots.
Then through FUCKING HOURS of playing around and learning stuff about opencv/android.
In order to save the image I have to convert it back from a matrix (Mat) to a bitmap. RG helped me figure out that there IS a matToBitmap function in opencv. Once I got that going I ran into a number of issues pretty much all of which had to do with image format. First it was issues not understanding the image source format I was starting with and not realizing for some time that the number of channels was different between the mat and the bitmap I was trying to create. They must match.
Eventually I figured that out and was able to ensure the correct bit depth but I kept getting these black images instead of having anything in them. Then I figured out that opencv stores it's RGB images internally as BGR instead of RGB. There are functions to convert between the two.
I had fun trying to get the image with alpha channel to work.
In the end my biggest issue turned out to be that these conversion functions actually change the resolution of the image which was completely screwing me up over and over again. I was starting with an image that was 720x640. Somewhere in there it was convrting it to 640x480. So even if I did have an image in there it would come out as just a scan nightmare.
OpenCV I beat you again haha