Friday, December 21, 2012

Sobel Filter Application on the Xilinx Zynq Zedboard

Here are the steps for getting the Sobel Filter application running on the Zynq Zedboard using a webcam for the input data stream while the output frame is shown in the HDMI display. The Sobel Filter is implemented as a hardware accelerator on the fpga as well as an openCV software implementation on the arm processor.



Download Link:
Git Link:
UBoot File used:

Steps to get the application running on the board:

1. Connect Power, HDMI display, USB HUB with keyboard, mouse and webcam (I used a Logitech webcam) to the Zedboard.

2. Format the SD Card using the instructions as given in the link below:
http://wiki.analog.com/resources/tools-software/linux-drivers/platforms/zynq#enable_xf86-video-modesetting_xorg_driver
The first partition needs to have the  boot.bin,  zImage,  and dts files. These can be found on the SD_card folder in the zip file. The second partition needs to have the Linaro file system (also found at the above link).

3. Set mode on the Zedboard to SD card boot mode.

4. Power on and boot into linux.

5. Install OpenCv by using the command "sudo apt-get install libopencv-dev" (sudo password is linaro).

6. Connect an ethernet cable and copy folder test_app in the zipfile to the filesystem.
(cf_adv7511_zed\workspace\test_app).

7. Run command "cmake ."

8. Run "make"

9. Run "sudo ./camera"

10. It will display the original webcam stream and you can enable hardware sobel filtering and software sobel filtering using "h" and "s" respectively. Original stream can be enabled with "o". Press escape to exit anytime.

Note. This design is not fully optimized  as there is a significant communication bottleneck. This bottleneck is caused while copying the video stream buffer to the DMA region and back, as well as due to the slow latency of the DDR. For the first problem, I am looking into upgrading the kernel to the 3.8 version to use the DMA buffer sharing options. For the second problem, I'm working on using the Accelerator Coherency Port, as it provides a low latency path directly from the cache to the accelerator.

An EDK project is also shared with a bare metal application to test the hardware without the linux kernel.

This reference design was made available from the PARSE Research group at TU/e.

References-
http://wiki.analog.com/resources/tools-software/linux-drivers/platforms/zynq#enable_xf86-video-modesetting_xorg_driver
http://wiki.xilinx.com/zynq-base-trd-14-3
http://ez.analog.com/message/70323#70323