SlideShare a Scribd company logo
1 of 20
Download to read offline
ECE 354

Lab 2: Capturing and Displaying
Digital Image

ECE Department: University of Massachusetts, Amherst
Big Picture Introduction
 Understand the existing SOPC builder setup with new
modification
 Capturing image using camera
 Storing the captured image in the frame buffer
 Display the image on a CRT monitor with the use of a VGA
p y
g
controller
 Perform simple image processing
 Primarily written in C code

ECE 354

2
Additional Hardware
 TRDB_D5M Digital Camera
 S i lC
Serial Connector and
t
d
Cable
 CRT Monitor

ECE 354

3
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 else’s
specifications

ECE 354

4
Steps taken to complete project
Begin by looking over camera documentation
Understand SOPC builder setup given
Write a C program to capture data into FIFO buffer
C program to transfer data from FIFO to flash memory
Gain knowledge of how the DE2_NIOS_HOST_MOUSE_VGA
f
project displays an image to the CRT monitor
 Use that knowledge to display your image
 Finally have fun performing image processing






ECE 354

5
Lab2 Setup

[1]
[1] TRDB_D5M_Userguide
http://www.terasic.com.tw/attachment/archive/281/TRDB_D5M_UserGuide.pdf
p
_
_
p
ECE 354

6
Overview of DE2_NIOS_HOST_MOUSE_VGA project
DE2 NIOS HOST MOUSE VGA
 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

ECE 354

7
SOPC builder setup:










Based on DE2_NIOS_HOST_MOUSE_VGA
The program code is stored in SRAM memory
e p og a
s sto ed
S
e o y
Parallel Input/output interface(PIO) for LED, switches
Camera Avalon Interface(Camera_IF) helps in transferring
image data
The dedicated SDRAM is used as a frame buffer that holds
a single frame of video at the time.
The SDRAM is controlled and accessed by using the four
fourport controller hardware
 Controller can be used to read or write to the SDRAM
through its four FIFO buffers
buffers.
Flash controller is used to control the data transfer to flash
memory
VGA controller di l i
t ll displaying d t on t VGA
data
to

ECE 354

8
Block diagram of Terasic camera system



TRDB_D5M_Userguide
http://www.terasic.com.tw/attachment/archive/281/TRDB_D5M_UserGui
de.pdf

ECE 354

9
Hardware Modules for this Lab
 SDRAM-Multiport Controller:
This
Thi module i a generic 4 port SDRAM controller.
d l is
i
t
t ll
It uses two FIFO buffers for inputs (writing) and
two FIFO buffers for outputs. The FIFO buffers
are made using Altera MegaFunctions and are 16
bit wide and can hold up to 512 words of this
size.
size In this system the SDRAM controller is used
as a frame buffer to hold a single picture frame
 Flash Controller
 VGA controller
 Camera Avalon Interface module
ECE 354

10
To get started with the lab
 Run the DE2_NOIS_MOUSE_VGA_project present in the
project folder given to you
 Run SOPC builder and understand each of the components
added and configuration present
 Hardware component files are p
p
present under IP folder
•
•

It contains SDRAM_4 port controller components
Camera Avalon Interface

 Software components are present under the software folder
• Hello_led_0 has all the required software component files
• Some part of code is given in this project which is present in
file hello led.c
e e o_ ed c

ECE 354

11
Information for C program
 C code to capture camera data and store it in frame buffer
 Picture taken at 640x480 has 3 data per pixel times 8 bits
(at least) each, this would mean a total of 7,372800Mbit or
921,6 Kbyte
 So efficient storage design required
 Recommended C code function
• Camera Capture
• Copying RGB(pixels) d
(
l ) data f
from FIFO to Flash memory
l h
• Using flash memory to store the pixel data before
transferring to VGA output
 Program space memory is less (SRAM).Avoid unnecessary
buffers. Write programs as efficient as possible

ECE 354

12
Readout modes: D5M camera
 The Terasic D5M camera supports a function
called :
1. binning -This function reduces the resolution
of the image by averaging pixels together
g
y
g gp
g
2. Skipping - reduces the output resolution
without affecting th fi ld f i
ith t ff ti
the field-of-view. It does this by
d
thi b
not sampling entire rows and columns of pixels.
p
p
p
yp
A skip 2X mode skips one of pixels for every pair
of output.

ECE 354

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

ECE 354

14
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

ECE 354

15
Image Processing
 It is required that you implement two forms of
image processing
 Recommendations include:
•
•
•
•
•

ECE 354

Add timestamp onto image
p
g
Counter to keep track of number of pictures taken
Rotate, mirror, invert image
Simple edge detection (challenging)
Detect changes in images (challenging)

16
References for software and hardware design in Lab2
 I recommend looking over section II of the NIOS II Software
Developer’s Handbook
g project titled- Embedded Demonstrator for Video
 Go through p j
Presentation and Manipulation by Cato Marwell Jonasse (Google
it) to get clear insight on hardware description for this project
(
(You can g through chapter 9 specifically)
go
g
p
p
y)
 DE2_NIOS_HOST_MOUSE_VGA project
 NIOS II Software Developer’s Handbook
• http://www.altera.com/literature/lit-nio2.jsp
ECE 354

17
Where does this project lead?
 Next lab will be on the topic sending data over a network
• Sending image between DE2 boards
• Don’t worry if you have not taken computer networking

ECE 354

18
Questions and Comments

ECE 354

19
Back up

ECE 354

20

More Related Content

What's hot

Standard embedded c
Standard embedded cStandard embedded c
Standard embedded cTam Thanh
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniqAVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniqManicka Raja PL
 
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...Christopher Diamantopoulos
 
laptop repairing course in delhi
laptop repairing course in delhilaptop repairing course in delhi
laptop repairing course in delhiAmit Gupta
 
Final presentation on FPGA BASED TRAINER
Final presentation on FPGA BASED TRAINERFinal presentation on FPGA BASED TRAINER
Final presentation on FPGA BASED TRAINEREngr Fatima
 
SoftwareEngineer
SoftwareEngineerSoftwareEngineer
SoftwareEngineerTodd Nguyen
 
Software hardware co-design using xilinx zynq soc
Software hardware co-design using xilinx zynq socSoftware hardware co-design using xilinx zynq soc
Software hardware co-design using xilinx zynq socHossam Hassan
 
Оптимізація процесу відлагоджування Embedded рішень, Богдан Костів
Оптимізація процесу відлагоджування Embedded рішень, Богдан КостівОптимізація процесу відлагоджування Embedded рішень, Богдан Костів
Оптимізація процесу відлагоджування Embedded рішень, Богдан КостівSigma Software
 

What's hot (11)

Standard embedded c
Standard embedded cStandard embedded c
Standard embedded c
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
E.s unit 6
E.s unit 6E.s unit 6
E.s unit 6
 
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniqAVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
 
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
IMAGE CAPTURE, PROCESSING AND TRANSFER VIA ETHERNET UNDER CONTROL OF MATLAB G...
 
20 what’s next
20 what’s next20 what’s next
20 what’s next
 
laptop repairing course in delhi
laptop repairing course in delhilaptop repairing course in delhi
laptop repairing course in delhi
 
Final presentation on FPGA BASED TRAINER
Final presentation on FPGA BASED TRAINERFinal presentation on FPGA BASED TRAINER
Final presentation on FPGA BASED TRAINER
 
SoftwareEngineer
SoftwareEngineerSoftwareEngineer
SoftwareEngineer
 
Software hardware co-design using xilinx zynq soc
Software hardware co-design using xilinx zynq socSoftware hardware co-design using xilinx zynq soc
Software hardware co-design using xilinx zynq soc
 
Оптимізація процесу відлагоджування Embedded рішень, Богдан Костів
Оптимізація процесу відлагоджування Embedded рішень, Богдан КостівОптимізація процесу відлагоджування Embedded рішень, Богдан Костів
Оптимізація процесу відлагоджування Embedded рішень, Богдан Костів
 

Viewers also liked (12)

F ab 08.12.2016676767676
F ab 08.12.2016676767676F ab 08.12.2016676767676
F ab 08.12.2016676767676
 
5
55
5
 
6
66
6
 
7
77
7
 
4
44
4
 
2
22
2
 
1
11
1
 
11
1111
11
 
10
1010
10
 
8
88
8
 
3
33
3
 
9
99
9
 

Similar to Capturing and Displaying Digital Image

Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPguest022763
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPChema Alonso
 
10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)Akhila Dakshina
 
High-Definition Rugged DVR - Case Study
High-Definition Rugged DVR - Case StudyHigh-Definition Rugged DVR - Case Study
High-Definition Rugged DVR - Case StudyMistral Solutions
 
Multi Processor Architecture for image processing
Multi Processor Architecture for image processingMulti Processor Architecture for image processing
Multi Processor Architecture for image processingideas2ignite
 
chapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptxchapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptxSangeetaTripathi8
 
Developing new zynq based instruments
Developing new zynq based instrumentsDeveloping new zynq based instruments
Developing new zynq based instrumentsGraham NAYLOR
 
Expanding The Micro Blaze System
Expanding  The Micro Blaze  SystemExpanding  The Micro Blaze  System
Expanding The Micro Blaze Systemiuui
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfSamiraKids
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON
 
HKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with CoresightHKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with CoresightLinaro
 
10.1.1.184.6612
10.1.1.184.661210.1.1.184.6612
10.1.1.184.6612NITC
 
Escolhendo o Processador DaVinciTM para sua Aplicação de ...
Escolhendo o Processador DaVinciTM para sua Aplicação de ...Escolhendo o Processador DaVinciTM para sua Aplicação de ...
Escolhendo o Processador DaVinciTM para sua Aplicação de ...Videoguy
 

Similar to Capturing and Displaying Digital Image (20)

GPU Design on FPGA
GPU Design on FPGAGPU Design on FPGA
GPU Design on FPGA
 
Introduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSPIntroduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSP
 
Real Time Video Processing in FPGA
Real Time Video Processing in FPGA Real Time Video Processing in FPGA
Real Time Video Processing in FPGA
 
Video Streaming
Video StreamingVideo Streaming
Video Streaming
 
Dr.s.shiyamala fpga ppt
Dr.s.shiyamala  fpga pptDr.s.shiyamala  fpga ppt
Dr.s.shiyamala fpga ppt
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IP
 
Circuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IPCircuitos de Video Vigilancia IP
Circuitos de Video Vigilancia IP
 
10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)
 
High-Definition Rugged DVR - Case Study
High-Definition Rugged DVR - Case StudyHigh-Definition Rugged DVR - Case Study
High-Definition Rugged DVR - Case Study
 
Multi Processor Architecture for image processing
Multi Processor Architecture for image processingMulti Processor Architecture for image processing
Multi Processor Architecture for image processing
 
chapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptxchapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptx
 
Developing new zynq based instruments
Developing new zynq based instrumentsDeveloping new zynq based instruments
Developing new zynq based instruments
 
Flowframes
FlowframesFlowframes
Flowframes
 
Expanding The Micro Blaze System
Expanding  The Micro Blaze  SystemExpanding  The Micro Blaze  System
Expanding The Micro Blaze System
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
 
Ijetr011814
Ijetr011814Ijetr011814
Ijetr011814
 
HKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with CoresightHKG18-TR14 - Postmortem Debugging with Coresight
HKG18-TR14 - Postmortem Debugging with Coresight
 
10.1.1.184.6612
10.1.1.184.661210.1.1.184.6612
10.1.1.184.6612
 
Escolhendo o Processador DaVinciTM para sua Aplicação de ...
Escolhendo o Processador DaVinciTM para sua Aplicação de ...Escolhendo o Processador DaVinciTM para sua Aplicação de ...
Escolhendo o Processador DaVinciTM para sua Aplicação de ...
 

More from Integrated Circuit Design Research & Education Center (ICDREC)

More from Integrated Circuit Design Research & Education Center (ICDREC) (20)

SLIDE-NHÂN-TƯỚNG-Buổi-1-FPT.pptx.pdf
SLIDE-NHÂN-TƯỚNG-Buổi-1-FPT.pptx.pdfSLIDE-NHÂN-TƯỚNG-Buổi-1-FPT.pptx.pdf
SLIDE-NHÂN-TƯỚNG-Buổi-1-FPT.pptx.pdf
 
Xoa mu linux
Xoa mu linuxXoa mu linux
Xoa mu linux
 
Tu hoc su_dung_linux
Tu hoc su_dung_linuxTu hoc su_dung_linux
Tu hoc su_dung_linux
 
Tu hoc su dung linux 2
Tu hoc su dung linux 2Tu hoc su dung linux 2
Tu hoc su dung linux 2
 
Su dung linux shell
Su dung linux shellSu dung linux shell
Su dung linux shell
 
Step by-step installation of a secure linux web dns- and mail server
Step by-step installation of a secure linux web  dns- and mail serverStep by-step installation of a secure linux web  dns- and mail server
Step by-step installation of a secure linux web dns- and mail server
 
So tay nho lenh linux
So tay nho lenh linuxSo tay nho lenh linux
So tay nho lenh linux
 
Quan tri he dieu hanh linux
Quan tri he dieu hanh linuxQuan tri he dieu hanh linux
Quan tri he dieu hanh linux
 
Programming guide for linux usb device drivers
Programming guide for linux usb device driversProgramming guide for linux usb device drivers
Programming guide for linux usb device drivers
 
Nguyen lyhedieuhanh 14-15_hedieuhanhlinux
Nguyen lyhedieuhanh 14-15_hedieuhanhlinuxNguyen lyhedieuhanh 14-15_hedieuhanhlinux
Nguyen lyhedieuhanh 14-15_hedieuhanhlinux
 
Linux giaotrinh
Linux giaotrinhLinux giaotrinh
Linux giaotrinh
 
Linux security
Linux securityLinux security
Linux security
 
Linux cho nguoi_moi_dung
Linux cho nguoi_moi_dungLinux cho nguoi_moi_dung
Linux cho nguoi_moi_dung
 
Linux tieng viet
Linux tieng vietLinux tieng viet
Linux tieng viet
 
Liên kết động trong linux và windows (phần 2)
Liên kết động trong linux và windows (phần 2)Liên kết động trong linux và windows (phần 2)
Liên kết động trong linux và windows (phần 2)
 
Liên kết động trong linux và windows (phần 1)
Liên kết động trong linux và windows (phần 1)Liên kết động trong linux và windows (phần 1)
Liên kết động trong linux và windows (phần 1)
 
Kien.truc.unix.linux 2
Kien.truc.unix.linux 2Kien.truc.unix.linux 2
Kien.truc.unix.linux 2
 
Kien.truc.unix.linux
Kien.truc.unix.linuxKien.truc.unix.linux
Kien.truc.unix.linux
 
Huong dan cai_redhat_linux_fedora_core_4
Huong dan cai_redhat_linux_fedora_core_4Huong dan cai_redhat_linux_fedora_core_4
Huong dan cai_redhat_linux_fedora_core_4
 
Htc.kien.truc.unix.linux
Htc.kien.truc.unix.linuxHtc.kien.truc.unix.linux
Htc.kien.truc.unix.linux
 

Recently uploaded

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

Capturing and Displaying Digital Image

  • 1. ECE 354 Lab 2: Capturing and Displaying Digital Image ECE Department: University of Massachusetts, Amherst
  • 2. Big Picture Introduction  Understand the existing SOPC builder setup with new modification  Capturing image using camera  Storing the captured image in the frame buffer  Display the image on a CRT monitor with the use of a VGA p y g controller  Perform simple image processing  Primarily written in C code ECE 354 2
  • 3. Additional Hardware  TRDB_D5M Digital Camera  S i lC Serial Connector and t d Cable  CRT Monitor ECE 354 3
  • 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 else’s specifications ECE 354 4
  • 5. Steps taken to complete project Begin by looking over camera documentation Understand SOPC builder setup given Write a C program to capture data into FIFO buffer C program to transfer data from FIFO to flash memory Gain knowledge of how the DE2_NIOS_HOST_MOUSE_VGA f project displays an image to the CRT monitor  Use that knowledge to display your image  Finally have fun performing image processing      ECE 354 5
  • 7. Overview of DE2_NIOS_HOST_MOUSE_VGA project DE2 NIOS HOST MOUSE VGA  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 ECE 354 7
  • 8. SOPC builder setup:         Based on DE2_NIOS_HOST_MOUSE_VGA The program code is stored in SRAM memory e p og a s sto ed S e o y Parallel Input/output interface(PIO) for LED, switches Camera Avalon Interface(Camera_IF) helps in transferring image data The dedicated SDRAM is used as a frame buffer that holds a single frame of video at the time. The SDRAM is controlled and accessed by using the four fourport controller hardware  Controller can be used to read or write to the SDRAM through its four FIFO buffers buffers. Flash controller is used to control the data transfer to flash memory VGA controller di l i t ll displaying d t on t VGA data to ECE 354 8
  • 9. Block diagram of Terasic camera system  TRDB_D5M_Userguide http://www.terasic.com.tw/attachment/archive/281/TRDB_D5M_UserGui de.pdf ECE 354 9
  • 10. Hardware Modules for this Lab  SDRAM-Multiport Controller: This Thi module i a generic 4 port SDRAM controller. d l is i t t ll It uses two FIFO buffers for inputs (writing) and two FIFO buffers for outputs. The FIFO buffers are made using Altera MegaFunctions and are 16 bit wide and can hold up to 512 words of this size. size In this system the SDRAM controller is used as a frame buffer to hold a single picture frame  Flash Controller  VGA controller  Camera Avalon Interface module ECE 354 10
  • 11. To get started with the lab  Run the DE2_NOIS_MOUSE_VGA_project present in the project folder given to you  Run SOPC builder and understand each of the components added and configuration present  Hardware component files are p p present under IP folder • • It contains SDRAM_4 port controller components Camera Avalon Interface  Software components are present under the software folder • Hello_led_0 has all the required software component files • Some part of code is given in this project which is present in file hello led.c e e o_ ed c ECE 354 11
  • 12. Information for C program  C code to capture camera data and store it in frame buffer  Picture taken at 640x480 has 3 data per pixel times 8 bits (at least) each, this would mean a total of 7,372800Mbit or 921,6 Kbyte  So efficient storage design required  Recommended C code function • Camera Capture • Copying RGB(pixels) d ( l ) data f from FIFO to Flash memory l h • Using flash memory to store the pixel data before transferring to VGA output  Program space memory is less (SRAM).Avoid unnecessary buffers. Write programs as efficient as possible ECE 354 12
  • 13. Readout modes: D5M camera  The Terasic D5M camera supports a function called : 1. binning -This function reduces the resolution of the image by averaging pixels together g y g gp g 2. Skipping - reduces the output resolution without affecting th fi ld f i ith t ff ti the field-of-view. It does this by d thi b not sampling entire rows and columns of pixels. p p p yp A skip 2X mode skips one of pixels for every pair of output. ECE 354 13
  • 14. 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 ECE 354 14
  • 15. 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 ECE 354 15
  • 16. Image Processing  It is required that you implement two forms of image processing  Recommendations include: • • • • • ECE 354 Add timestamp onto image p g Counter to keep track of number of pictures taken Rotate, mirror, invert image Simple edge detection (challenging) Detect changes in images (challenging) 16
  • 17. References for software and hardware design in Lab2  I recommend looking over section II of the NIOS II Software Developer’s Handbook g project titled- Embedded Demonstrator for Video  Go through p j Presentation and Manipulation by Cato Marwell Jonasse (Google it) to get clear insight on hardware description for this project ( (You can g through chapter 9 specifically) go g p p y)  DE2_NIOS_HOST_MOUSE_VGA project  NIOS II Software Developer’s Handbook • http://www.altera.com/literature/lit-nio2.jsp ECE 354 17
  • 18. Where does this project lead?  Next lab will be on the topic sending data over a network • Sending image between DE2 boards • Don’t worry if you have not taken computer networking ECE 354 18