SlideShare a Scribd company logo
1 of 20
Presented by:
Dr. Moe Moe Myint
Information Technology Department
Technological University (Kyaukse), Myanmar
Digital Image Processing
moemoemyint@moemyanmar.ml
www.slideshare.net/MoeMoeMyint
• Only Original Owner has full rights reserved for copied images.
• This PPT is only for fair academic use.
Image Arithmetic (Lab 6)
- the implementation of standard arithmetic operations,
such as addition, subtraction, multiplication, and
division, on images
- many uses in image processing both as a preliminary
step in more complex operations and by itself
M. M. Myint
Dr. Moe Moe Myint
Information Technology Department
Technological University (Kyaukse)
Objectives
• To display the absolute difference between a filtered image and the original
• To add two images together, specify an output class and reverse black and
white in a binary image
• To divide one image into another
• To multiply two images
• To subtract one image from another
Required Equipment
• Computers with MATLAB software and Projector
Practical Procedures
• Read the image and then calculate the absolute difference of two images,
use the imabsdiff command
• To add two images, use the imadd command
• To complement image, use the imcomplement command
• To divide one image into another , use the imdivide command
• To multiply two images, use the immultiply command
• To subtract one image from another, use the imsubtract command
Image Arithmetic
• Imabsdiff Absolute difference of two images
• Imadd Add two images or add constant to image
• Imcomplement Complement image
• Imdivide Divide one image into another or divide image by
constant
• Imlincomb Linear combination of images
• Immultiply Multiply tow images or multiply image by constant
• Imsubtract Subtract one image from another or subtract constant
from image
imabsdiff
• Absolute difference of two images
Syntax
Z = imabsdiff(X,Y)
Examples
• Calculate the absolute difference between two uint8 arrays. Note that the
absolute value prevents negative values from being rounded to zero in the
result, as they are with imsubtract.
X = uint8([ 255 10 75; 44 225 100]);
Y = uint8([ 50 50 50; 50 50 50 ]);
Z = imabsdiff(X,Y)
• Display the absolute difference between a filtered image and the original.
I = imread('cameraman.tif');
imshow(I),title('OI');
J = uint8(filter2(fspecial('gaussian'), I));
figure,imshow(J),title('FI');
K = imabsdiff(I,J);
figure,imshow(K,[]),title('AI');
imadd
• Add two images or add constant to image
Syntax
Z = imadd(X,Y)
Examples
• Add two uint8 arrays. Note the truncation that occurs when the values
exceed 255.
X = uint8([ 255 0 75; 44 225 100]);
Y = uint8([ 50 50 50; 50 50 50 ]);
Z = imadd(X,Y)
• Add two images together and specify an output class.
I = imread('rice.png');
J = imread('cameraman.tif');
K = imadd(I,J,'uint16');
imshow(K,[])
• Add a constant to an image.
I = imread('rice.png');
J = imadd(I,50);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)
imcomplement
• Complement image
Syntax
IM2 = imcomplement(IM)
In the complement of a binary image, zeros become ones and
ones become zeros; black and white are reversed. In the
complement of an intensity or RGB image, each pixel value is
subtracted from the maximum pixel value supported by the class
(or 1.0 for double-precision images) and the difference is used as
the pixel value in the output image. In the output image, dark
areas become lighter and light areas become darker.
Examples
• Create the complement of a uint8 array.
X = uint8([ 255 10 75; 44 225 100]);
X2 = imcomplement(X)
• Reverse black and white in a binary image.
bw = imread('text.png');
bw2 = imcomplement(bw);
subplot(1,2,1),imshow(bw)
subplot(1,2,2),imshow(bw2)
• Create the complement of an intensity image.
I = imread('glass.png');
J = imcomplement(I);
imshow(I), figure, imshow(J)
imdivide
• Divide one image into another or divide image by
constant
Syntax
Z = imdivide(X,Y)
Examples
• Divide two uint8 arrays. Note that fractional values greater than or
equal to 0.5 are rounded up to the nearest integer.
X = uint8([ 255 10 75; 44 225 100]);
Y = uint8([ 50 20 50; 50 50 50 ]);
Z = imdivide(X,Y)
• Estimate and divide out the background of the rice image.
I = imread('rice.png'); imshow(I), title('O');
background = imopen(I,strel('disk',15));
figure,imshow(background);title('Morphological image');
Ip = imdivide(I,background); figure,imshow(Ip,[]),title('Divide I');
• Divide an image by a constant factor.
I = imread('rice.png');
J = imdivide(I,2);
subplot(1,2,1), imshow(I);subplot(1,2,2), imshow(J)
imlincomb
• Linear combination of images
Syntax
Z = imlincomb(K1,A1,K2,A2,...,Kn,An)
Description
Z = imlincomb(K1,A1,K2,A2,...,Kn,An) computes
K1*A1 + K2*A2 + ... + Kn*An
Example 1
• Scale an image by a factor of 2.
I = imread('cameraman.tif');
J = imlincomb(2,I);
imshow(J)
Example 2
• Form a difference image with the zero value shifted to 128.
I = imread('cameraman.tif');
J = uint8(filter2(fspecial('gaussian'), I));
K = imlincomb(1,I,-1,J,128); % K(r,c) = I(r,c) - J(r,c) + 128
figure, imshow(K)
immultiply
• Multiply two images or multiply image by constant
Syntax
Z = immultiply(X,Y)
Examples
• Multiply an image by itself. Note how the example converts the
class of the image from uint8 to uint16 before performing the
multiplication to avoid truncating the results.
I = imread('moon.tif');
I16 = uint16(I);
J = immultiply(I16,I16);
imshow(I), figure, imshow(J)
• Scale an image by a constant factor:
I = imread('moon.tif');
J = immultiply(I,0.5);
subplot(1,2,1), imshow(I)
subplot(1,2,2), imshow(J)
imsubtract
• Subtract one image from another or subtract
constant from image
Syntax
Z = imsubtract(X,Y)
Examples
• Subtract two uint8 arrays. Note that negative results are rounded to 0.
X = uint8([ 255 10 75; 44 225 100]);
Y = uint8([ 50 50 50; 50 50 50 ]);
Z = imsubtract(X,Y)
• Estimate and subtract the background of an image:
I = imread('rice.png');
background = imopen(I,strel('disk',15));
Ip = imsubtract(I,background);
imshow(Ip,[])
• Subtract a constant value from an image:
I = imread('rice.png');
Iq = imsubtract(I,50);
figure, imshow(I), figure, imshow(Iq)
Questions?

More Related Content

What's hot

Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compressionasodariyabhavesh
 
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques sudarmani rajagopal
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image CompressionMathankumar S
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesDiwaker Pant
 
Transform coding
Transform codingTransform coding
Transform codingNancy K
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesAnkit Garg
 
Composite transformation
Composite transformationComposite transformation
Composite transformationPooja Dixit
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point ProcessingGayathri31093
 
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)Shajun Nisha
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2Gichelle Amon
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpeningarulraj121
 
Boundary Extraction
Boundary ExtractionBoundary Extraction
Boundary ExtractionMaria Akther
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancyNaveen Kumar
 

What's hot (20)

Image restoration
Image restorationImage restoration
Image restoration
 
Chapter 8 image compression
Chapter 8 image compressionChapter 8 image compression
Chapter 8 image compression
 
mean_filter
mean_filtermean_filter
mean_filter
 
Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques Digital image processing- Compression- Different Coding techniques
Digital image processing- Compression- Different Coding techniques
 
Digital Image Processing - Image Compression
Digital Image Processing - Image CompressionDigital Image Processing - Image Compression
Digital Image Processing - Image Compression
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
Huffman coding
Huffman coding Huffman coding
Huffman coding
 
Transform coding
Transform codingTransform coding
Transform coding
 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
 
Psuedo color
Psuedo colorPsuedo color
Psuedo color
 
Composite transformation
Composite transformationComposite transformation
Composite transformation
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpening
 
Boundary Extraction
Boundary ExtractionBoundary Extraction
Boundary Extraction
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 

Viewers also liked

Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)Moe Moe Myint
 
Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)Moe Moe Myint
 
Digital Image Processing (Lab 09 and 10)
Digital Image Processing (Lab 09 and 10)Digital Image Processing (Lab 09 and 10)
Digital Image Processing (Lab 09 and 10)Moe Moe Myint
 
Digital Image Processing (Lab 08)
Digital Image Processing (Lab 08)Digital Image Processing (Lab 08)
Digital Image Processing (Lab 08)Moe Moe Myint
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portionMoe Moe Myint
 
Procesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlabProcesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlabPercy Julio Chambi Pacco
 

Viewers also liked (6)

Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)Digital Image Processing (Lab 07)
Digital Image Processing (Lab 07)
 
Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)Digital Image Processing (Lab 05)
Digital Image Processing (Lab 05)
 
Digital Image Processing (Lab 09 and 10)
Digital Image Processing (Lab 09 and 10)Digital Image Processing (Lab 09 and 10)
Digital Image Processing (Lab 09 and 10)
 
Digital Image Processing (Lab 08)
Digital Image Processing (Lab 08)Digital Image Processing (Lab 08)
Digital Image Processing (Lab 08)
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
Procesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlabProcesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlab
 

Similar to Digital Image Processing (Lab 06)

Similar to Digital Image Processing (Lab 06) (20)

CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdf
 
Dip Morphological
Dip MorphologicalDip Morphological
Dip Morphological
 
1.arithmetic & logical operations
1.arithmetic & logical operations1.arithmetic & logical operations
1.arithmetic & logical operations
 
Image processing in MATLAB
Image processing in MATLABImage processing in MATLAB
Image processing in MATLAB
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
 
Dip iit workshop
Dip iit workshopDip iit workshop
Dip iit workshop
 
Simple Matlab tutorial using matlab inbuilt commands
Simple Matlab tutorial using matlab inbuilt commandsSimple Matlab tutorial using matlab inbuilt commands
Simple Matlab tutorial using matlab inbuilt commands
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
CE344L-200365-Lab7.pdf
CE344L-200365-Lab7.pdfCE344L-200365-Lab7.pdf
CE344L-200365-Lab7.pdf
 
openFrameworks 007 - graphics
openFrameworks 007 - graphicsopenFrameworks 007 - graphics
openFrameworks 007 - graphics
 
3.point operation and histogram based image enhancement
3.point operation and histogram based image enhancement3.point operation and histogram based image enhancement
3.point operation and histogram based image enhancement
 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processing
 
image_enhancement_spatial
 image_enhancement_spatial image_enhancement_spatial
image_enhancement_spatial
 
Dip syntax 4
Dip syntax 4Dip syntax 4
Dip syntax 4
 
Dital Image Processing (Lab 2+3+4)
Dital Image Processing (Lab 2+3+4)Dital Image Processing (Lab 2+3+4)
Dital Image Processing (Lab 2+3+4)
 
Progre ppt
Progre  pptProgre  ppt
Progre ppt
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for robotics
 
study Seam Carving For Content Aware Image Resizing
study Seam Carving For Content Aware Image Resizingstudy Seam Carving For Content Aware Image Resizing
study Seam Carving For Content Aware Image Resizing
 
Matlab
MatlabMatlab
Matlab
 
Of class1
Of class1Of class1
Of class1
 

More from Moe Moe Myint

Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Moe Moe Myint
 
Chapter 8 Embedded Hardware Design and Development (third portion)
Chapter 8 Embedded Hardware Design and Development (third portion)Chapter 8 Embedded Hardware Design and Development (third portion)
Chapter 8 Embedded Hardware Design and Development (third portion)Moe Moe Myint
 
Chapter 8 Embedded Hardware Design and Development (second portion)
Chapter 8 Embedded Hardware Design and Development (second portion)Chapter 8 Embedded Hardware Design and Development (second portion)
Chapter 8 Embedded Hardware Design and Development (second portion)Moe Moe Myint
 
Schematic and PCB Design Using Eagle
Schematic and PCB Design Using EagleSchematic and PCB Design Using Eagle
Schematic and PCB Design Using EagleMoe Moe Myint
 
Chapter 4 Embedded System: Application and Domain Specific
Chapter 4 Embedded System: Application and Domain SpecificChapter 4 Embedded System: Application and Domain Specific
Chapter 4 Embedded System: Application and Domain SpecificMoe Moe Myint
 
Chapter 3 Charateristics and Quality Attributes of Embedded System
Chapter 3 Charateristics and Quality Attributes of Embedded SystemChapter 3 Charateristics and Quality Attributes of Embedded System
Chapter 3 Charateristics and Quality Attributes of Embedded SystemMoe Moe Myint
 
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)Moe Moe Myint
 
Introduction to Embedded System: Chapter 2 (4th portion)
Introduction to Embedded System:  Chapter 2 (4th portion)Introduction to Embedded System:  Chapter 2 (4th portion)
Introduction to Embedded System: Chapter 2 (4th portion)Moe Moe Myint
 
Introduction to Embedded System I : Chapter 2 (3rd portion)
Introduction to Embedded System I : Chapter 2 (3rd portion)Introduction to Embedded System I : Chapter 2 (3rd portion)
Introduction to Embedded System I : Chapter 2 (3rd portion)Moe Moe Myint
 
Introduction to Embedded System I : Chapter 2 (2nd portion)
Introduction to Embedded System I : Chapter 2 (2nd portion)Introduction to Embedded System I : Chapter 2 (2nd portion)
Introduction to Embedded System I : Chapter 2 (2nd portion)Moe Moe Myint
 
Introduction to Embedded Systems I: Chapter 2 (1st portion)
Introduction to Embedded Systems I: Chapter 2 (1st portion)Introduction to Embedded Systems I: Chapter 2 (1st portion)
Introduction to Embedded Systems I: Chapter 2 (1st portion)Moe Moe Myint
 
Introduction to Embedded Systems I : Chapter 1
Introduction to Embedded Systems I : Chapter 1Introduction to Embedded Systems I : Chapter 1
Introduction to Embedded Systems I : Chapter 1Moe Moe Myint
 
Lect 02 second portion
Lect 02  second portionLect 02  second portion
Lect 02 second portionMoe Moe Myint
 
Lect 02 first portion
Lect 02   first portionLect 02   first portion
Lect 02 first portionMoe Moe Myint
 
Lect 02 first portion
Lect 02   first portionLect 02   first portion
Lect 02 first portionMoe Moe Myint
 
Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Moe Moe Myint
 
Digital image processing lab 1
Digital image processing lab 1Digital image processing lab 1
Digital image processing lab 1Moe Moe Myint
 

More from Moe Moe Myint (18)

Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
 
Chapter 8 Embedded Hardware Design and Development (third portion)
Chapter 8 Embedded Hardware Design and Development (third portion)Chapter 8 Embedded Hardware Design and Development (third portion)
Chapter 8 Embedded Hardware Design and Development (third portion)
 
Chapter 8 Embedded Hardware Design and Development (second portion)
Chapter 8 Embedded Hardware Design and Development (second portion)Chapter 8 Embedded Hardware Design and Development (second portion)
Chapter 8 Embedded Hardware Design and Development (second portion)
 
Schematic and PCB Design Using Eagle
Schematic and PCB Design Using EagleSchematic and PCB Design Using Eagle
Schematic and PCB Design Using Eagle
 
Chapter 4 Embedded System: Application and Domain Specific
Chapter 4 Embedded System: Application and Domain SpecificChapter 4 Embedded System: Application and Domain Specific
Chapter 4 Embedded System: Application and Domain Specific
 
Chapter 3 Charateristics and Quality Attributes of Embedded System
Chapter 3 Charateristics and Quality Attributes of Embedded SystemChapter 3 Charateristics and Quality Attributes of Embedded System
Chapter 3 Charateristics and Quality Attributes of Embedded System
 
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)
 
Introduction to Embedded System: Chapter 2 (4th portion)
Introduction to Embedded System:  Chapter 2 (4th portion)Introduction to Embedded System:  Chapter 2 (4th portion)
Introduction to Embedded System: Chapter 2 (4th portion)
 
Introduction to Embedded System I : Chapter 2 (3rd portion)
Introduction to Embedded System I : Chapter 2 (3rd portion)Introduction to Embedded System I : Chapter 2 (3rd portion)
Introduction to Embedded System I : Chapter 2 (3rd portion)
 
Introduction to Embedded System I : Chapter 2 (2nd portion)
Introduction to Embedded System I : Chapter 2 (2nd portion)Introduction to Embedded System I : Chapter 2 (2nd portion)
Introduction to Embedded System I : Chapter 2 (2nd portion)
 
Introduction to Embedded Systems I: Chapter 2 (1st portion)
Introduction to Embedded Systems I: Chapter 2 (1st portion)Introduction to Embedded Systems I: Chapter 2 (1st portion)
Introduction to Embedded Systems I: Chapter 2 (1st portion)
 
Introduction to Embedded Systems I : Chapter 1
Introduction to Embedded Systems I : Chapter 1Introduction to Embedded Systems I : Chapter 1
Introduction to Embedded Systems I : Chapter 1
 
Lect 06
Lect 06 Lect 06
Lect 06
 
Lect 02 second portion
Lect 02  second portionLect 02  second portion
Lect 02 second portion
 
Lect 02 first portion
Lect 02   first portionLect 02   first portion
Lect 02 first portion
 
Lect 02 first portion
Lect 02   first portionLect 02   first portion
Lect 02 first portion
 
Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)Lecture 1 for Digital Image Processing (2nd Edition)
Lecture 1 for Digital Image Processing (2nd Edition)
 
Digital image processing lab 1
Digital image processing lab 1Digital image processing lab 1
Digital image processing lab 1
 

Recently uploaded

Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Digital Image Processing (Lab 06)

  • 1. Presented by: Dr. Moe Moe Myint Information Technology Department Technological University (Kyaukse), Myanmar Digital Image Processing moemoemyint@moemyanmar.ml www.slideshare.net/MoeMoeMyint
  • 2. • Only Original Owner has full rights reserved for copied images. • This PPT is only for fair academic use.
  • 3. Image Arithmetic (Lab 6) - the implementation of standard arithmetic operations, such as addition, subtraction, multiplication, and division, on images - many uses in image processing both as a preliminary step in more complex operations and by itself M. M. Myint Dr. Moe Moe Myint Information Technology Department Technological University (Kyaukse)
  • 4. Objectives • To display the absolute difference between a filtered image and the original • To add two images together, specify an output class and reverse black and white in a binary image • To divide one image into another • To multiply two images • To subtract one image from another Required Equipment • Computers with MATLAB software and Projector Practical Procedures • Read the image and then calculate the absolute difference of two images, use the imabsdiff command • To add two images, use the imadd command • To complement image, use the imcomplement command • To divide one image into another , use the imdivide command • To multiply two images, use the immultiply command • To subtract one image from another, use the imsubtract command
  • 5. Image Arithmetic • Imabsdiff Absolute difference of two images • Imadd Add two images or add constant to image • Imcomplement Complement image • Imdivide Divide one image into another or divide image by constant • Imlincomb Linear combination of images • Immultiply Multiply tow images or multiply image by constant • Imsubtract Subtract one image from another or subtract constant from image
  • 6. imabsdiff • Absolute difference of two images Syntax Z = imabsdiff(X,Y)
  • 7. Examples • Calculate the absolute difference between two uint8 arrays. Note that the absolute value prevents negative values from being rounded to zero in the result, as they are with imsubtract. X = uint8([ 255 10 75; 44 225 100]); Y = uint8([ 50 50 50; 50 50 50 ]); Z = imabsdiff(X,Y) • Display the absolute difference between a filtered image and the original. I = imread('cameraman.tif'); imshow(I),title('OI'); J = uint8(filter2(fspecial('gaussian'), I)); figure,imshow(J),title('FI'); K = imabsdiff(I,J); figure,imshow(K,[]),title('AI');
  • 8. imadd • Add two images or add constant to image Syntax Z = imadd(X,Y)
  • 9. Examples • Add two uint8 arrays. Note the truncation that occurs when the values exceed 255. X = uint8([ 255 0 75; 44 225 100]); Y = uint8([ 50 50 50; 50 50 50 ]); Z = imadd(X,Y) • Add two images together and specify an output class. I = imread('rice.png'); J = imread('cameraman.tif'); K = imadd(I,J,'uint16'); imshow(K,[]) • Add a constant to an image. I = imread('rice.png'); J = imadd(I,50); subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(J)
  • 10. imcomplement • Complement image Syntax IM2 = imcomplement(IM) In the complement of a binary image, zeros become ones and ones become zeros; black and white are reversed. In the complement of an intensity or RGB image, each pixel value is subtracted from the maximum pixel value supported by the class (or 1.0 for double-precision images) and the difference is used as the pixel value in the output image. In the output image, dark areas become lighter and light areas become darker.
  • 11. Examples • Create the complement of a uint8 array. X = uint8([ 255 10 75; 44 225 100]); X2 = imcomplement(X) • Reverse black and white in a binary image. bw = imread('text.png'); bw2 = imcomplement(bw); subplot(1,2,1),imshow(bw) subplot(1,2,2),imshow(bw2) • Create the complement of an intensity image. I = imread('glass.png'); J = imcomplement(I); imshow(I), figure, imshow(J)
  • 12. imdivide • Divide one image into another or divide image by constant Syntax Z = imdivide(X,Y)
  • 13. Examples • Divide two uint8 arrays. Note that fractional values greater than or equal to 0.5 are rounded up to the nearest integer. X = uint8([ 255 10 75; 44 225 100]); Y = uint8([ 50 20 50; 50 50 50 ]); Z = imdivide(X,Y) • Estimate and divide out the background of the rice image. I = imread('rice.png'); imshow(I), title('O'); background = imopen(I,strel('disk',15)); figure,imshow(background);title('Morphological image'); Ip = imdivide(I,background); figure,imshow(Ip,[]),title('Divide I'); • Divide an image by a constant factor. I = imread('rice.png'); J = imdivide(I,2); subplot(1,2,1), imshow(I);subplot(1,2,2), imshow(J)
  • 14. imlincomb • Linear combination of images Syntax Z = imlincomb(K1,A1,K2,A2,...,Kn,An) Description Z = imlincomb(K1,A1,K2,A2,...,Kn,An) computes K1*A1 + K2*A2 + ... + Kn*An
  • 15. Example 1 • Scale an image by a factor of 2. I = imread('cameraman.tif'); J = imlincomb(2,I); imshow(J) Example 2 • Form a difference image with the zero value shifted to 128. I = imread('cameraman.tif'); J = uint8(filter2(fspecial('gaussian'), I)); K = imlincomb(1,I,-1,J,128); % K(r,c) = I(r,c) - J(r,c) + 128 figure, imshow(K)
  • 16. immultiply • Multiply two images or multiply image by constant Syntax Z = immultiply(X,Y)
  • 17. Examples • Multiply an image by itself. Note how the example converts the class of the image from uint8 to uint16 before performing the multiplication to avoid truncating the results. I = imread('moon.tif'); I16 = uint16(I); J = immultiply(I16,I16); imshow(I), figure, imshow(J) • Scale an image by a constant factor: I = imread('moon.tif'); J = immultiply(I,0.5); subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(J)
  • 18. imsubtract • Subtract one image from another or subtract constant from image Syntax Z = imsubtract(X,Y)
  • 19. Examples • Subtract two uint8 arrays. Note that negative results are rounded to 0. X = uint8([ 255 10 75; 44 225 100]); Y = uint8([ 50 50 50; 50 50 50 ]); Z = imsubtract(X,Y) • Estimate and subtract the background of an image: I = imread('rice.png'); background = imopen(I,strel('disk',15)); Ip = imsubtract(I,background); imshow(Ip,[]) • Subtract a constant value from an image: I = imread('rice.png'); Iq = imsubtract(I,50); figure, imshow(I), figure, imshow(Iq)

Editor's Notes

  1. Image arithmetic is the implementation of standard arithmetic operations, such as addition, subtraction, multiplication, and division, on images. Image arithmetic has many uses in image processing both as a preliminary step in more complex operations and by itself. For example, image subtraction can be used to detect differences between two or more images of the same scene or object.