Friday, December 6, 2013

Demo System Revised (Camera Control)

Though a little belated, I’ve uploaded a renewed demo system.  The link to download the demo is the same (relm_demo.jar) as it was.

The new demo includes almost all the contents the previous demo had, however, these two versions has no software compatibility due to the changes in the new circuit.
From now on, I am planning to disclose references based on the specs of the new circuit.
I would be grateful for your understanding of this point.

The most crucial addition is a CMOS sensor camera control, while capability of SVGA resolution (800 x 600) and a warm reset function are also added.  The change in the JTAG communication specs has achieved a little bit faster image transfer.

The demo system includes the programs listed below.

This program is to execute warm reset.  In fact, it works like Vampire (or pit-trapper) in Core War, filling the whole memory with jump instructions to seize all threads.  If it fails to seize them all, LED light stays on and then you will need to execute cold reset by clicking “Config FPGA.”

The program is to output the contents of SDRAM at VGA resolution (640 x 480, 60Hz).  Please refer to the previous article about an external output circuit.  It enables writing image data to SDRAM by clicking “Send Image File…” or “Send Image URL…”

The program is to output the contents of SDRAM at SVGA resolution (800 x 600, 72Hz).  Some displays may not support this frequency.   Please execute warm reset prior to changing resolution.

The program is to scroll an image according to the value of accelerometer.  It requires either vga.rb or svga.rb to be on.  It moves viewing region in a virtual display of 2048 x 2048 pixels on memory.  By pressing a button on the board, you can invert scrolling (KEY1: normal, KEY0: inverted).

The program is to flash LED light in random order.  It is workable with DE0-Nano alone.

The program is to display images from CMOS sensor camera on screen in real time.  It requires either vga.rb or svga.rb to be on.  On receiving data in YUV format from CMOS sensor, it forces high-speed execution by consuming all the other threads for color conversion and dither display.  Unfortunately, DE0-Nano has only one SDRAM and so cannot allow simultaneous reading and writing for display.  Like single-ported VRAM of old days PC, reading data is disabled while writing in memory, resulting in black noise on the screen.  By pressing KEY0 button on the board, it toggles the mode of executing writing only in vertical blanking interval and then can reduce black noise at the price of display speed.  Pressing KEY1 button toggles the simple skin color detection mode.


External CMOS sensor uses aitendo’s camera module (OV9655).  Also with aitendo’s conversion PCB, as the FPGA pins are assigned in tune with this camera module, it requires no more burdensome wiring than attaching two pin sockets.
For camera angle, one of the two pin sockets needs to be right-angled.  You can make different camera configurations, depending on which one of the pin sockets is right-angled.


This demo is an example of displaying inputs from camera directly on the screen.  However, in case of applying this camera in robot control, the system bears the functions of image recognition and motor control instead of VGA output.  Just by mounting a simple face detection algorithm as image recognition, it easily realizes a robot to come towards a person’s face.
I bet this processor suits perfectly in robotics application which requires simultaneous control of many sensors and actuators.