Hi everyone,
I have a problem dealing with JPG images coming from a serial camera (Adafruit CMOS TTL Serial Camera). The camera gives me a 320x240 px JPG image that I have to process in Fez Cobra.
If I save the original image to SD card the quality of the jpg is a good. But if I decode the image in memory, using the Bitmap class, the quality is highly reduced and the picure loses color depth. In my application, the picture quality is critical, because I need to measure colors.
This is the code:
Byte[] jpg = camera.getPictureBytes(); //retrieves JPG byte array
//if I save jpg byte array to SD I get the good picture here
Bitmap bp = new Bitmap(jpg, Bitmap.BitmapImageType.Jpeg); //this gives me a reduced color picture
The builtin Bitmap decoder is fast, but does not suites my quality needs. Because of that, I’ve wrote 2 JPG decoders in RLP wich gives me the quality I nedd, but those algorithms (NanoJPG and other) and have very slow performance (6 seconds, and 10 seconds) when 2 secods max is acceptable por my application.
Is there anyway to get a good and fast JPEG decoder?
I’m using Fez Cobra with GHI Premium SDK.
If you can give me any advice I will appreciate very very much.
Thanks,
Paco