ECE 354 Spring 2006 - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

ECE 354 Spring 2006

Description:

Download image data to NIOS II serially through the use of a UART. A handshaking protocol will be used to communicate with digital camera ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 19
Provided by: bendo9
Category:

less

Transcript and Presenter's Notes

Title: ECE 354 Spring 2006


1
ECE 354Spring 2006
  • Lab 2 Capturing and Displaying Digital Image

2
Big Picture Introduction
  • Capture an image using a digital camera
  • Download image data to NIOS II serially through
    the use of a UART
  • A handshaking protocol will be used to
    communicate with digital camera
  • Display the image on a CRT monitor with the use
    of a VGA controller
  • Perform simple image processing
  • Primarily written in C code
  • Use a preexisting SOPC system with some slight
    modifications

3
Additional Hardware
  • ITM-C-328 Serial Color Digital Camera
  • Serial Connector and Cable
  • CRT Monitor

4
Skills to learn
  • Integrate code with preexisting code
  • Understanding previously written code
  • Connect to a device that you did not design
  • Writing a communication protocol to somebody
    elses specifications

5
Steps taken to complete project
  • Begin by looking over ITM-C-328 camera
    documentation
  • Plan out the series of events needed to
    communicate with the camera
  • Write a C program to send a simple request
    message and receive a message in return
  • Build up the program until ready to receive image
    data
  • Image data should be stored in one continuous
    buffer in SDRAM (example char received64)
  • Gain knowledge of how the DE2_NIOS_HOST_MOUSE_VGA
    project displays an image to the CRT monitor
  • Use that knowledge to display your image
  • Finally have fun performing image processing

6
Communicating with the camera
  • Communication with the camera is accomplished
    through a series of commands
  • A single command consists of 6 continuous
    single-byte RS-232 transmissions
  • A listing and description of the command set can
    be found in ITM-C 328_Manual.pdf

7
Communicating with the camera (continued)
  • This is the command protocol to receive an
    uncompressed snapshot picture
  • Initial command to configure preview image size
    and color type
  • Snapshot command takes a snapshot and stores data
    in camera buffer
  • Get picture is used to transfer image data to
    host
  • Your task is to implement this in C code

8
Information for C program
  • To write/read to/from the UART
  • fd open(/dev/uart, O_RDWR O_NONBLOCK, 0)
  • charReceived read(fd, to, length)
  • write(fd, from, length)
  • I recommend looking over section II of the
    NIOS II Software Developers Handbook
  • A blocking read holds the program until the read
    operation completes with the length you specify
  • Think about why a nonblocking read is needed

9
Recommended C code functions
  • A function to
  • Establish a connection with the camera (Sync
    function)
  • Send a message to the camera
  • Receive and check a message from the camera
  • Receive image data from camera
  • Print bits of a byte received (debugging)
  • Print hex equivalent of a message received
    (debugging)

10
A little help
  • Use the form on the bottom of this slide to
  • hold messages that will be sent to camera
  • hold messages to check received messages against
  • The message can be written to the UART in the
    following way write(fd, SYNC, 6)

11
Additional information
  • The image should be 2-bit gray scale with a
    resolution of 640x480
  • Uncompressed image
  • I recommend starting with the smallest image
    resolution and work from there

12
Overview of DE2_NIOS_HOST_MOUSE_VGA project
  • Implements a monochrome display, with a preloaded
    image, where the user can draw on it with a mouse
  • USB mouse should be connected USB HOST port
  • CRT monitor should be connected to the VGA port
  • You will integrate your code so that the project
    displays the image received from digital camera

13
Displaying image through VGA controller
  • Look through VGA.h for VGA functions
  • Write C code similar to that shown below that
    calls functions from VGA.h to display each pixel
  • It is your job to come up with an equation to
    check each pixel in your receive buffer

14
Image Processing
  • It is required that you implement two forms of
    image processing
  • Recommendations include
  • Add timestamp onto image
  • Counter to keep track of number of pictures taken
  • Rotate, mirror, invert image
  • Simple edge detection (challenging)
  • Detect changes in images (challenging)

15
Where does this project lead?
  • Next lab will be on the topic sending data over a
    network
  • Sending image between DE2 boards
  • Using computer networking knowledge learned from
    Professor Ganzs course
  • Dont worry if you have not taken computer
    networking

16
References
  • Camera documentation (ITM-C-328)
  • http//www.tdc.co.uk/camera/
  • Information and Datasheets
  • DE2_NIOS_HOST_MOUSE_VGA project
  • NIOS II Software Developers Handbook
  • http//www.altera.com/literature/lit-nio2.jsp

17
Hints
  • You may need to slightly modify the SOPC system
    of the MOUSE_VGA project
  • Set the initial baud rate to what the camera
    initially wants
  • Attend my lab hours and ask lots of questions

18
Questions and Comments
Write a Comment
User Comments (0)
About PowerShow.com