SlideShare a Scribd company logo
1 of 15
Download to read offline
MATLAB & IMAGE PROCESSING 2
Presented by
Dr. M. Venkatanarayana, cri,ksrmce,kadapa
Getting image information
After completion of this topic, student will be able to use
● imfinfo()
● impixelinfo
● rgb2ind()
● colormap(jet)
The imfinfo() gives us lots of information
>> info=imfinfo('Sun.jpg')
info =
Querying a pixel info
● Because the image itself is an array, we can check the values it is storing.
For example, if we want to know the values of the pixel at (350, 250):For example, if we want to know the values of the pixel at (350, 250):
● >> img(350,250,:)
● ans(:,:,1) = 157
● ans(:,:,2) = 70
● ans(:,:,3) = 0
rgb2ind()
● "Indexed color saves a lot of memory, storage space, and transmission
time: using truecolor, each pixel needs 24 bits, or 3 bytes. A typicaltime: using truecolor, each pixel needs 24 bits, or 3 bytes. A typical
640x480 VGA resolution truecolor uncompressed image needs 640x480x3
= 921,600 bytes (900 KiB). Limiting the image colors to 256, every pixel
needs only 8 bits, or 1 byte each, so the example image now needs only
640x480x1 = 307,200 bytes (300 KiB), plus 256x3 = 768 additional bytes to
store the palette map in itself (assuming RGB), approx. one third of the
original size."
Code:
● img = imread('Sun.jpg');
● [IND,map] =
● img = imread('Sun.jpg');
● [IND,map] = ● [IND,map] =
rgb2ind(img,32);
● figure('Name','Indexed
image with 32 Colors');
● imagesc(IND);
● colormap(map);
● [IND,map] =
rgb2ind(img,32);
● figure('Name','Indexed
image with 32 Colors');
● imshow(IND);
● colormap(map);
200
400
600
200 400 600 800 1000 1200 1400 1600
800
1000
1200
Colormap(jet);colormap(spring)
200
400
600
200
400
600
200 400 600 800 1000 1200 1400 1600
600
800
1000
1200
200 400 600 800 1000 1200 1400 1600
600
800
1000
1200
Creating grayscale image: We're going to create two
grayscale images of size 320×240,320×240,one with pixels
all black and the other one all white:
h = 240;
w = 320;
white = uint8(255*ones(h,w));
black = uint8(zeros(h,w));
figure;figure;
subplot(121);
imshow(white);
subplot(122);
imshow(black);
Class - Data Type: There are one thing to keep in mind when we process
images: data type. Is my image in uint8or double? One of the most frequent
issues caused by the data type is imshow(). We converted the image to double
to do something with the image, and now we want to draw it
● img = imread('cameraman.tif');
● img_d = double(img);● img_d = double(img);
● % ... played with the image, now we want to display it
● imshow(img_d);
Result is white image rather than original image
The imshow() has two function overloading. It takes image with type uint8 as it ranges
between [0, 255], and takes image with type double as it ranges between [0, 1]. So, in our
case, every pixel with over 1 is considered saturated, and that's why we got white cameraman.
img = imread('cameraman.tif');
img_d = double(img);
imshow(img_d/255);
Data type conversion problems
Extracting bit-plane from Grayscale image With mod() operation, we can extract a bit-
plane image. The mod(img,2) gives us either 0 or 1
img = imread('cameraman.tif');
img = double(img);
bp0 = mod(img,2);
imshow(bp0);
title('bit-plane 0');
bit-plane 0 bit-plane 1
title('bit-plane 0');
bit-plane 2 bit-plane 3 bit-plane 4
bit-plane 5 bit-plane 6 bit-plane 7

More Related Content

What's hot

SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solutionSIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solutionKoji Asami
 
COMPUTER GRAPHICS
COMPUTER GRAPHICSCOMPUTER GRAPHICS
COMPUTER GRAPHICSJagan Raja
 
Deep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hullDeep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hullHanqing Wang
 
Mat lab lecture part 1
Mat lab lecture part 1Mat lab lecture part 1
Mat lab lecture part 1OmGulshan
 
Introductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT RoorkeeIntroductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT RoorkeeVinayak Sahai
 
Juggle: Hybrid Large-Scale Music Recommendation
Juggle: Hybrid Large-Scale Music RecommendationJuggle: Hybrid Large-Scale Music Recommendation
Juggle: Hybrid Large-Scale Music RecommendationJosé Devezas
 
Translating Linear Functions "I AM" Answer Key!
Translating Linear Functions "I AM" Answer Key!Translating Linear Functions "I AM" Answer Key!
Translating Linear Functions "I AM" Answer Key!Deborah_Johnson
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c versionMarwa Al-Rikaby
 
5.1 quadratic functions
5.1 quadratic functions5.1 quadratic functions
5.1 quadratic functionsmorrobea
 
Visualising Big Data
Visualising Big DataVisualising Big Data
Visualising Big DataAmit Kapoor
 
Terminado matematica ii
Terminado matematica iiTerminado matematica ii
Terminado matematica iiyonygerardo
 

What's hot (20)

Image processing
Image processingImage processing
Image processing
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solutionSIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
 
Ch22 28
Ch22 28Ch22 28
Ch22 28
 
Week 6
Week 6Week 6
Week 6
 
COMPUTER GRAPHICS
COMPUTER GRAPHICSCOMPUTER GRAPHICS
COMPUTER GRAPHICS
 
Deep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hullDeep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hull
 
Mat lab lecture part 1
Mat lab lecture part 1Mat lab lecture part 1
Mat lab lecture part 1
 
Introductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT RoorkeeIntroductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT Roorkee
 
Juggle: Hybrid Large-Scale Music Recommendation
Juggle: Hybrid Large-Scale Music RecommendationJuggle: Hybrid Large-Scale Music Recommendation
Juggle: Hybrid Large-Scale Music Recommendation
 
Translating Linear Functions "I AM" Answer Key!
Translating Linear Functions "I AM" Answer Key!Translating Linear Functions "I AM" Answer Key!
Translating Linear Functions "I AM" Answer Key!
 
Energía
EnergíaEnergía
Energía
 
ikh323-05
ikh323-05ikh323-05
ikh323-05
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
 
5.1 quadratic functions
5.1 quadratic functions5.1 quadratic functions
5.1 quadratic functions
 
Properties of-graphs-2.5
Properties of-graphs-2.5Properties of-graphs-2.5
Properties of-graphs-2.5
 
Visualising Big Data
Visualising Big DataVisualising Big Data
Visualising Big Data
 
Deep learning
Deep learningDeep learning
Deep learning
 
Terminado matematica ii
Terminado matematica iiTerminado matematica ii
Terminado matematica ii
 

Similar to Dip 2

Image processing basics using matlab
Image processing basics using matlabImage processing basics using matlab
Image processing basics using matlabAnkur Tyagi
 
Image processing tool box.pptx
Image processing tool box.pptxImage processing tool box.pptx
Image processing tool box.pptxAvinashJain66
 
Introduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABIntroduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABSriram Emarose
 
ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)Hasitha Ediriweera
 
Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for roboticsSALAAMCHAUS
 
We are restricted from importing cv2 numpy stats and other.pdf
We are restricted from importing cv2 numpy stats and other.pdfWe are restricted from importing cv2 numpy stats and other.pdf
We are restricted from importing cv2 numpy stats and other.pdfDARSHANACHARYA13
 
الوسائط المتعددة Multimedia تاج
الوسائط المتعددة  Multimedia تاجالوسائط المتعددة  Multimedia تاج
الوسائط المتعددة Multimedia تاجmaaz hamed
 
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 commandsLakshmi Sarvani Videla
 
Image Processing using Matlab . Useful for beginners to learn Image Processing
Image Processing using Matlab . Useful for beginners to learn Image ProcessingImage Processing using Matlab . Useful for beginners to learn Image Processing
Image Processing using Matlab . Useful for beginners to learn Image ProcessingAshok Kumar
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphicsmustafa_92
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfUmarMustafa13
 
Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptLOUISSEVERINOROMANO
 

Similar to Dip 2 (20)

Image processing basics using matlab
Image processing basics using matlabImage processing basics using matlab
Image processing basics using matlab
 
Image processing tool box.pptx
Image processing tool box.pptxImage processing tool box.pptx
Image processing tool box.pptx
 
Introduction to Image Processing with MATLAB
Introduction to Image Processing with MATLABIntroduction to Image Processing with MATLAB
Introduction to Image Processing with MATLAB
 
Dip syntax 4
Dip syntax 4Dip syntax 4
Dip syntax 4
 
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 1
Dip 1Dip 1
Dip 1
 
ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
Image processing for robotics
Image processing for roboticsImage processing for robotics
Image processing for robotics
 
Ec section
Ec section Ec section
Ec section
 
Image processing
Image processingImage processing
Image processing
 
Image processing
Image processingImage processing
Image processing
 
We are restricted from importing cv2 numpy stats and other.pdf
We are restricted from importing cv2 numpy stats and other.pdfWe are restricted from importing cv2 numpy stats and other.pdf
We are restricted from importing cv2 numpy stats and other.pdf
 
الوسائط المتعددة Multimedia تاج
الوسائط المتعددة  Multimedia تاجالوسائط المتعددة  Multimedia تاج
الوسائط المتعددة Multimedia تاج
 
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
 
Image Processing using Matlab . Useful for beginners to learn Image Processing
Image Processing using Matlab . Useful for beginners to learn Image ProcessingImage Processing using Matlab . Useful for beginners to learn Image Processing
Image Processing using Matlab . Useful for beginners to learn Image Processing
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphics
 
CE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdfCE344L-200365-Lab5.pdf
CE344L-200365-Lab5.pdf
 
Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.ppt
 

Recently uploaded

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
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
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
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
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
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
 

Recently uploaded (20)

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
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
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
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
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
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
 

Dip 2

  • 1. MATLAB & IMAGE PROCESSING 2 Presented by Dr. M. Venkatanarayana, cri,ksrmce,kadapa
  • 2. Getting image information After completion of this topic, student will be able to use ● imfinfo() ● impixelinfo ● rgb2ind() ● colormap(jet)
  • 3. The imfinfo() gives us lots of information >> info=imfinfo('Sun.jpg') info =
  • 4. Querying a pixel info ● Because the image itself is an array, we can check the values it is storing. For example, if we want to know the values of the pixel at (350, 250):For example, if we want to know the values of the pixel at (350, 250): ● >> img(350,250,:) ● ans(:,:,1) = 157 ● ans(:,:,2) = 70 ● ans(:,:,3) = 0
  • 5. rgb2ind() ● "Indexed color saves a lot of memory, storage space, and transmission time: using truecolor, each pixel needs 24 bits, or 3 bytes. A typicaltime: using truecolor, each pixel needs 24 bits, or 3 bytes. A typical 640x480 VGA resolution truecolor uncompressed image needs 640x480x3 = 921,600 bytes (900 KiB). Limiting the image colors to 256, every pixel needs only 8 bits, or 1 byte each, so the example image now needs only 640x480x1 = 307,200 bytes (300 KiB), plus 256x3 = 768 additional bytes to store the palette map in itself (assuming RGB), approx. one third of the original size."
  • 6.
  • 7. Code: ● img = imread('Sun.jpg'); ● [IND,map] = ● img = imread('Sun.jpg'); ● [IND,map] = ● [IND,map] = rgb2ind(img,32); ● figure('Name','Indexed image with 32 Colors'); ● imagesc(IND); ● colormap(map); ● [IND,map] = rgb2ind(img,32); ● figure('Name','Indexed image with 32 Colors'); ● imshow(IND); ● colormap(map);
  • 8.
  • 9. 200 400 600 200 400 600 800 1000 1200 1400 1600 800 1000 1200
  • 10. Colormap(jet);colormap(spring) 200 400 600 200 400 600 200 400 600 800 1000 1200 1400 1600 600 800 1000 1200 200 400 600 800 1000 1200 1400 1600 600 800 1000 1200
  • 11. Creating grayscale image: We're going to create two grayscale images of size 320×240,320×240,one with pixels all black and the other one all white: h = 240; w = 320; white = uint8(255*ones(h,w)); black = uint8(zeros(h,w)); figure;figure; subplot(121); imshow(white); subplot(122); imshow(black);
  • 12. Class - Data Type: There are one thing to keep in mind when we process images: data type. Is my image in uint8or double? One of the most frequent issues caused by the data type is imshow(). We converted the image to double to do something with the image, and now we want to draw it ● img = imread('cameraman.tif'); ● img_d = double(img);● img_d = double(img); ● % ... played with the image, now we want to display it ● imshow(img_d); Result is white image rather than original image The imshow() has two function overloading. It takes image with type uint8 as it ranges between [0, 255], and takes image with type double as it ranges between [0, 1]. So, in our case, every pixel with over 1 is considered saturated, and that's why we got white cameraman.
  • 13. img = imread('cameraman.tif'); img_d = double(img); imshow(img_d/255); Data type conversion problems
  • 14. Extracting bit-plane from Grayscale image With mod() operation, we can extract a bit- plane image. The mod(img,2) gives us either 0 or 1 img = imread('cameraman.tif'); img = double(img); bp0 = mod(img,2); imshow(bp0); title('bit-plane 0'); bit-plane 0 bit-plane 1 title('bit-plane 0');
  • 15. bit-plane 2 bit-plane 3 bit-plane 4 bit-plane 5 bit-plane 6 bit-plane 7