tvelliott wrote:WickedMinds wrote:
Lets plug it into the camera/color mapping board
I'm also interested in color/object tracking, so I'm curious about your color mapping board. You mentioned it in a couple of posts. Is this another piece of hardware that you have not described in detail? I was thinking it might be some type of hardware-based color transform / lookup?
Yes, it is a separate board from the frame buffer. The color mapping board has the ability to route the YUV data through an EEPROM which acts as a hardware look up. You'll notice in the screen shots of my UI that there is a visual representation of the color map on the left. This allows me to assign a color index (Segment) to any given YUV value by just painting on the grid using the defined Segments as a palette. When I have my color map the way I like it, the color map is sent over USB serial to Arduino which then forwards it to a couple of I2C I/O expanders connected to the EEPROM to flash it.
When in raw mode, the color map board bypasses the EEPROM and raw YUV data is stored to the frame buffer allowing me to view and analyze raw frame dumps. This gives me the information I need to create/modify the color map.
When in color map mode, the upper 4 bits of Y and upper 6 bits of U and V are used to address the EEPROM (16 x 64 x 64 = 64k Color Map/EEPROM). The color mapped output of the EEPROM is written to the frame buffer. Since the raw YUV 4 byte pixels are mapped to single byte color indexes, the total memory size of a frame is 1/4th the size of a raw frame. This also means that the color data is output at 1/4th the pixel clock. This brings us closer to being able to read the frame data real time by an Arduino etc.
Next thing I am attempting to do is add hardware RLE encoding of the color mapped data before it hits the frame buffer. This would result in the MCU only needing to read two bytes (color index and run length) each time the color changes. Well within the abilities of a 16MHz MCU etc.
So far the only drawback is that I am colorblind and my wife has to help me with defining color maps