Not very happy with the performance I get from Processing in displaying the images coming from my Arduino Module I decided to build a dedicated application to “see” the image instead. Is part of a bigger project, my “stereoscopic vision” project ^_^ Kind of a long shot, but sounds like a lot of fun.
Anyway, I start learning VB and for the past 2 days I tried to code a small application that connects to the serial port, retrieve the data streamed by the camera and display it at high-speed (hmm… sort of anyway) in a window.
First, I am planning to use 8 bit per pixel, however, not happy with the 256 color per pixel option, looking more for a 4096 colors per pixel instead, so I decided to get pump 12 bits per pixel in only 8 bits… Cool, right? The trick is simple: for each pixel I stream 8 bits, each bit contain 4 bits for green (G) and 4 bits for blue (B) and next one 4 bits for green and 4 bits for red (R) so 2 adjacent pixels share the same B or R information at 12 bits per pixels, voila! got 50% compression of the data sent while getting 16 times more colors and images looks much better.
Next step is to understand how the VB 2010 works and how to handle the serial port and then… how to draw pixels… Last was the worse part, basically could not find much about it and when I could I realized that was damn simple…
Anyway, while is not yet extremely stable and fast (320 x 240 = 76,800 bytes + some synchronization data, around 80+ Kbytes of data over serial port at 600,000 Bps take a bit less than 2 seconds per frame) is kind of working, however need to work a bit on the speed and to detect the errors and drop the lines that are not received properly.