Professional Documents
Culture Documents
: 2017-MC-303
Lab # 01
Getting started with Images and videos in Matlab
Task 01: Read any three images from matlab directory and display them in a subplot
and show appropriate titles.
Results:
CODE:
%% Task 1
subplot(1,3,1)
I=imread('cameraman.tif');
imshow(I);
title('cameraman')
subplot(1,3,2)
J=imread('blobs.png');
imshow(J);
title('blobs')
subplot(1,3,3)
K=imread('bag.png');
imshow(K);
title('bag')
Figure 1: Task 1
Task 02: You are given a folder of hand written digits, write an algorithm to specify
images folder using cd, and import all images and display them like a video.
Code:
%% Task 2
clc
clear all
1|Page
MCT-453: Machine Vision Reg. No.: 2017-MC-303
close all
cd 'C:\Program Files\MATLAB\R2017a\toolbox\nnet\nndemos\nndatasets\
DigitDataset\1'
dir
L = imread('image198.png');
imshow(L);
iNum = 4;
for n = 1:iNum
K = imread(['image',num2str(n),'.png']);
imshow(K);
pause(1);
end
cd 'C:\Program Files\MATLAB\R2017a\toolbox\nnet\nndemos\nndatasets\
DigitDataset\2'
dir
M = imread('image1540.png');
imshow(M);
iNum = 4;
for n = 1:iNum
N = imread(['image',num2str(n),'.png']);
imshow(N);
pause(1);
end
Snapshots from Video:
%% Task 3
cd ('C:\Users\hubia ijaz\Desktop\soft copies\8th semester\Machine vision\lab
1')
k= imread('303.jpg');
K= imcomplement (k)
J=imread('logo.jpg');
[r,c,n] = size(J)
2|Page
MCT-453: Machine Vision Reg. No.: 2017-MC-303
LOGO:
3|Page