SlideShare a Scribd company logo
1 of 30
1
ECE 472/572 - Digital Image
Processing
Lecture 1 - Introduction
08/18/11
2
What is an image? - The bitmap
representation
Also called “raster or pixel maps”
representation
An image is broken up into a grid
pixel
Gray level
Original picture Digital image
f(x, y) I[i, j] or I[x, y]
x
y
3
What is an image? - The vector
representation
Object-oriented representation
Does not show information of individual
pixel, but information of an object (circle,
line, square, etc.)
Circle(100, 20, 20)
Line(xa1, ya1, xa2, ya2)
Line(xb1, yb1, xb2, yb2)
Line(xc1, yc1, xc2, yc2)
Line(xd1, yd1, xd2, yd2)
4
Comparison
 Bitmap
– Can represent images with
complex variations in
colors, shades, shapes.
– Larger image size
– Fixed resolution
– Easier to implement
 Vector
– Can only represent simple
line drawings (CAD),
shapes, shadings, etc.
– Efficient
– Flexible
– Difficult to implement
5
How did it start?
 Early 1960s
 NASA’s Jet Propulsion Laboratory (JPL)
 Process video images from spacecraft (Ranger)
 IBM 360 Computer
Images from H. Andrews and B. Hunt, Digital Image Restoration, Prentice-Hall, 1977.
6
Why image processing?
 Application
– Fingerprint retrieval
– Automatic target recognition
– Industrial inspection
– Medical imaging
– and more …
 Can commercial software do all the work?
7
Histogram Equalization
GLG in HSI space – better than Photoshop result
GLG in RGB space
Photoshop “Auto Contrast”
result
1
.
42
=
APDG 1
.
12
=
TEN 4
.
28
=
APDG 0
.
22
=
TEN 9
.
72
=
APDG 8
.
20
=
TEN
3
.
76
=
APDG 0
.
27
=
TEN 6
.
78
=
APDG 6
.
26
=
TEN
GLG-RGB GLG-HSI
Photoshop
Original image of
Mars and its moon
From Zhiyu Chen’s preliminary proposal defense, January 2009
8
Some clarification
Image & Graphics
Image processing & Computer vision
Image processing & Image understanding
Image processing & Pattern recognition
– Image Processing: ECE472, ECE572
– Pattern Recognition: ECE471, ECE571
– Computer Vision: ECE573
– Computer Graphics: CS494, CS594
9
Goals of image processing
Image improvement
– Improving the visual appearance of images to
a human viewer
Image analysis
– Preparing images for measurement of the
features and structures present
10
What to learn?
Image
Acquisition
Image
Enhancement
Image
Restoration
Image
Compression
Image
Segmentation
Representation
& Description
Recognition &
Interpretation
Knowledge Base
Preprocessing – low level
Image Improvement
Image
Coding
Morphological
Image Processing
Wavelet
Analysis
High-level IP
Image Analysis
11
Image acquisition
 Video camera
 Infrared camera
 Range camera
 Line-scan camera
 Hyperspectral camera
 Omni-directional camera
 and more …
12
Some simple operations
13
Image enhancement
14
Movie film restoration
15
Image restoration
16
Image correction
Geometric correction
Radiometric correction
Image warping – geometric
transformation
18
Image warping – another
example
From Joey Howell and Cory McKay, ECE472, Fall 2000
19
Image segmentation
20
Image description
OCR – optical character
recognition, license plate
recognition
21
Beyond
Content-based image retrieval
Human identification
Multi-sensor data fusion
Hexagonal pixel
Steganography
22
Image processing for fine arts
23
Real-world reasoning demo
24
How to address pixels of an
image?
int i, j, k;
int nr, // number of rows
nc, // number of columns
nchan;// number of channels
nr = 128; nc = 128; nchan = 3;
for (i=0; i<nr; i++) {
for (j=0; j<nc; j++) {
for (k=0; k<nchan; j++) {
do the processing on (i,j,k);
………
}
}
}
25
j
(i, j) (i, j+1)
(i, j-1)
(i-1, j) (i-1, j+1)
(i+1, j+1)
(i+1, j)
(i-1, j-1)
(i+1, j-1)
i
(row)
(column)
4-neighborhood 8-neighborhood
Types of neighborhoods
Neighbors of a pixel
26
Closedness ambiguity
27
The Image library
/include: the header file
– Image.h
– Dip.h
/lib: image processing routines
– Image.cpp
– colorProcessing.cpp
– imageIO.cpp
– matrixProcessing.cpp
– cs.cpp
– Makefile
/test: the test code
28
// Test code to show how to read and write an image
#include "Image.h" // need to include the image library header
#include "Dip.h"
#include <iostream>
#include <cstdlib>
using namespace std;
#define Usage "./readwrite input-img output-img n"
int main(int argc, char **argv)
{
Image img1, img2;
int nr, nc, ntype, nchan, i, j, k;
if (argc < 3) {
cout << Usage;
exit(3);
}
img1 = readImage(argv[1]); // readImage is a member func in the Image lib
nr = img1.getRow(); // obtain the nr of rows and col
nc = img1.getCol();
ntype = img1.getType(); // obtain the type of the image
nchan = img1.getChannel(); // obtain the nr of channels of the image
img2.createImage(nr, nc, ntype); // write it to the output image
for (i=0; i<nr; i++) {
for (j=0; j<nc; j++) {
for (k=0; k<nchan; k++)
img2(i, j, k) = img1(i, j, k);
}
}
writeImage(img2, argv[2]);
return 0;
29
The course website
http://web.eecs.utk.edu/~qi/ece472-572
Course information
Official language: C++
Pre-homework assignment
– Subscribe to mailing list,
dip@aicip.ece.utk.edu
Grading policy: 72 late hour rule
30
What to do?
Subscribe to the mailing list
– dip@aicip.ece.utk.edu
Apply for an account in FH417
Get started on project 1
– Start early and finish early

More Related Content

Similar to ip111.ppt

Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image ProcessingReshma KC
 
Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7Emily Kapoor
 
Image Processing Training in Chandigarh
Image Processing Training in Chandigarh Image Processing Training in Chandigarh
Image Processing Training in Chandigarh E2Matrix
 
IP_Fundamentals.ppt
IP_Fundamentals.pptIP_Fundamentals.ppt
IP_Fundamentals.pptKARTHICKT41
 
Labcamp - working with image processing
Labcamp - working with image processingLabcamp - working with image processing
Labcamp - working with image processingRenato Souza
 
Fundamentals Image and Graphics
Fundamentals Image and GraphicsFundamentals Image and Graphics
Fundamentals Image and GraphicsShrawan Adhikari
 
Matlab Training in Jalandhar | Matlab Training in Phagwara
Matlab Training in Jalandhar | Matlab Training in PhagwaraMatlab Training in Jalandhar | Matlab Training in Phagwara
Matlab Training in Jalandhar | Matlab Training in PhagwaraE2Matrix
 
Matlab Training in Chandigarh
Matlab Training in ChandigarhMatlab Training in Chandigarh
Matlab Training in ChandigarhE2Matrix
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image ProcessingAzharo7
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection SystemAbhiroop Ghatak
 
Introduction_image_processing_and_applications_.pptx
Introduction_image_processing_and_applications_.pptxIntroduction_image_processing_and_applications_.pptx
Introduction_image_processing_and_applications_.pptxVINOTHRAJR1
 
Object Shape Representation by Kernel Density Feature Points Estimator
Object Shape Representation by Kernel Density Feature Points Estimator Object Shape Representation by Kernel Density Feature Points Estimator
Object Shape Representation by Kernel Density Feature Points Estimator cscpconf
 

Similar to ip111.ppt (20)

Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7
 
Image Processing Training in Chandigarh
Image Processing Training in Chandigarh Image Processing Training in Chandigarh
Image Processing Training in Chandigarh
 
IP_Fundamentals.ppt
IP_Fundamentals.pptIP_Fundamentals.ppt
IP_Fundamentals.ppt
 
IP_Fundamentals.ppt
IP_Fundamentals.pptIP_Fundamentals.ppt
IP_Fundamentals.ppt
 
Labcamp - working with image processing
Labcamp - working with image processingLabcamp - working with image processing
Labcamp - working with image processing
 
Image processing
Image processingImage processing
Image processing
 
Ch1.pptx
Ch1.pptxCh1.pptx
Ch1.pptx
 
Fundamentals Image and Graphics
Fundamentals Image and GraphicsFundamentals Image and Graphics
Fundamentals Image and Graphics
 
DIP-Unit1-Session1.pdf
DIP-Unit1-Session1.pdfDIP-Unit1-Session1.pdf
DIP-Unit1-Session1.pdf
 
Matlab Training in Jalandhar | Matlab Training in Phagwara
Matlab Training in Jalandhar | Matlab Training in PhagwaraMatlab Training in Jalandhar | Matlab Training in Phagwara
Matlab Training in Jalandhar | Matlab Training in Phagwara
 
Matlab Training in Chandigarh
Matlab Training in ChandigarhMatlab Training in Chandigarh
Matlab Training in Chandigarh
 
1 dip introduction
1 dip introduction1 dip introduction
1 dip introduction
 
Seema dip
Seema dipSeema dip
Seema dip
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
OpenCV+Android.pptx
OpenCV+Android.pptxOpenCV+Android.pptx
OpenCV+Android.pptx
 
1st section
1st section1st section
1st section
 
Automated Face Detection System
Automated Face Detection SystemAutomated Face Detection System
Automated Face Detection System
 
Introduction_image_processing_and_applications_.pptx
Introduction_image_processing_and_applications_.pptxIntroduction_image_processing_and_applications_.pptx
Introduction_image_processing_and_applications_.pptx
 
Object Shape Representation by Kernel Density Feature Points Estimator
Object Shape Representation by Kernel Density Feature Points Estimator Object Shape Representation by Kernel Density Feature Points Estimator
Object Shape Representation by Kernel Density Feature Points Estimator
 

Recently uploaded

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...Health
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 

Recently uploaded (20)

Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 

ip111.ppt

  • 1. 1 ECE 472/572 - Digital Image Processing Lecture 1 - Introduction 08/18/11
  • 2. 2 What is an image? - The bitmap representation Also called “raster or pixel maps” representation An image is broken up into a grid pixel Gray level Original picture Digital image f(x, y) I[i, j] or I[x, y] x y
  • 3. 3 What is an image? - The vector representation Object-oriented representation Does not show information of individual pixel, but information of an object (circle, line, square, etc.) Circle(100, 20, 20) Line(xa1, ya1, xa2, ya2) Line(xb1, yb1, xb2, yb2) Line(xc1, yc1, xc2, yc2) Line(xd1, yd1, xd2, yd2)
  • 4. 4 Comparison  Bitmap – Can represent images with complex variations in colors, shades, shapes. – Larger image size – Fixed resolution – Easier to implement  Vector – Can only represent simple line drawings (CAD), shapes, shadings, etc. – Efficient – Flexible – Difficult to implement
  • 5. 5 How did it start?  Early 1960s  NASA’s Jet Propulsion Laboratory (JPL)  Process video images from spacecraft (Ranger)  IBM 360 Computer Images from H. Andrews and B. Hunt, Digital Image Restoration, Prentice-Hall, 1977.
  • 6. 6 Why image processing?  Application – Fingerprint retrieval – Automatic target recognition – Industrial inspection – Medical imaging – and more …  Can commercial software do all the work?
  • 7. 7 Histogram Equalization GLG in HSI space – better than Photoshop result GLG in RGB space Photoshop “Auto Contrast” result 1 . 42 = APDG 1 . 12 = TEN 4 . 28 = APDG 0 . 22 = TEN 9 . 72 = APDG 8 . 20 = TEN 3 . 76 = APDG 0 . 27 = TEN 6 . 78 = APDG 6 . 26 = TEN GLG-RGB GLG-HSI Photoshop Original image of Mars and its moon From Zhiyu Chen’s preliminary proposal defense, January 2009
  • 8. 8 Some clarification Image & Graphics Image processing & Computer vision Image processing & Image understanding Image processing & Pattern recognition – Image Processing: ECE472, ECE572 – Pattern Recognition: ECE471, ECE571 – Computer Vision: ECE573 – Computer Graphics: CS494, CS594
  • 9. 9 Goals of image processing Image improvement – Improving the visual appearance of images to a human viewer Image analysis – Preparing images for measurement of the features and structures present
  • 10. 10 What to learn? Image Acquisition Image Enhancement Image Restoration Image Compression Image Segmentation Representation & Description Recognition & Interpretation Knowledge Base Preprocessing – low level Image Improvement Image Coding Morphological Image Processing Wavelet Analysis High-level IP Image Analysis
  • 11. 11 Image acquisition  Video camera  Infrared camera  Range camera  Line-scan camera  Hyperspectral camera  Omni-directional camera  and more …
  • 17. Image warping – geometric transformation
  • 18. 18 Image warping – another example From Joey Howell and Cory McKay, ECE472, Fall 2000
  • 20. 20 Image description OCR – optical character recognition, license plate recognition
  • 21. 21 Beyond Content-based image retrieval Human identification Multi-sensor data fusion Hexagonal pixel Steganography
  • 24. 24 How to address pixels of an image? int i, j, k; int nr, // number of rows nc, // number of columns nchan;// number of channels nr = 128; nc = 128; nchan = 3; for (i=0; i<nr; i++) { for (j=0; j<nc; j++) { for (k=0; k<nchan; j++) { do the processing on (i,j,k); ……… } } }
  • 25. 25 j (i, j) (i, j+1) (i, j-1) (i-1, j) (i-1, j+1) (i+1, j+1) (i+1, j) (i-1, j-1) (i+1, j-1) i (row) (column) 4-neighborhood 8-neighborhood Types of neighborhoods Neighbors of a pixel
  • 27. 27 The Image library /include: the header file – Image.h – Dip.h /lib: image processing routines – Image.cpp – colorProcessing.cpp – imageIO.cpp – matrixProcessing.cpp – cs.cpp – Makefile /test: the test code
  • 28. 28 // Test code to show how to read and write an image #include "Image.h" // need to include the image library header #include "Dip.h" #include <iostream> #include <cstdlib> using namespace std; #define Usage "./readwrite input-img output-img n" int main(int argc, char **argv) { Image img1, img2; int nr, nc, ntype, nchan, i, j, k; if (argc < 3) { cout << Usage; exit(3); } img1 = readImage(argv[1]); // readImage is a member func in the Image lib nr = img1.getRow(); // obtain the nr of rows and col nc = img1.getCol(); ntype = img1.getType(); // obtain the type of the image nchan = img1.getChannel(); // obtain the nr of channels of the image img2.createImage(nr, nc, ntype); // write it to the output image for (i=0; i<nr; i++) { for (j=0; j<nc; j++) { for (k=0; k<nchan; k++) img2(i, j, k) = img1(i, j, k); } } writeImage(img2, argv[2]); return 0;
  • 29. 29 The course website http://web.eecs.utk.edu/~qi/ece472-572 Course information Official language: C++ Pre-homework assignment – Subscribe to mailing list, dip@aicip.ece.utk.edu Grading policy: 72 late hour rule
  • 30. 30 What to do? Subscribe to the mailing list – dip@aicip.ece.utk.edu Apply for an account in FH417 Get started on project 1 – Start early and finish early