0% found this document useful (0 votes)
42 views

While End Global: 'Number of Rows in Image Using Imgetfile %D/N' 'Number of Columns in Image Using Imgetfile %D/N'

This document contains Matlab code to perform several image processing tasks: 1) It imports images from the hard disk using two different functions, imgetfile and uigetfile, and displays the images. 2) It previews video and converts video to a single image using getsnapshot. 3) It displays multiple images in the same figure window and adds Gaussian noise to an image.

Uploaded by

abhishek panda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

While End Global: 'Number of Rows in Image Using Imgetfile %D/N' 'Number of Columns in Image Using Imgetfile %D/N'

This document contains Matlab code to perform several image processing tasks: 1) It imports images from the hard disk using two different functions, imgetfile and uigetfile, and displays the images. 2) It previews video and converts video to a single image using getsnapshot. 3) It displays multiple images in the same figure window and adds Gaussian noise to an image.

Uploaded by

abhishek panda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

clc;

% matlab program to import image from hard disk using imgetfile and display
it in matlab
[f,uc]=imgetfile;
while(isempty(f))
[f,uc]=imgetfile;
end
global i1
i1=imread(f);
[row1,col1,dim1]=size(i1);
row1
col1
dim1
size(i1)
fprintf('Number of rows in image using imgetfile = %d\n',row1);
fprintf('Number of columns in image using imgetfile = %d\n',col1);
figure
imshow(i1)

% matlab program to import image from hard disk using uigetfile and display
it in matlab
[file,path]=uigetfile('');
filename=fullfile(path,file);
global i2
i2=imread(filename);
[row2,col2,dim2]=size(i2);
row2
col2
dim2
size(i2)
fprintf('Number of rows in image using uigetfile = %d\n',row2);
fprintf('Number of columns in image using uigetfile = %d\n',col2);
figure
imshow(i2)

%matlab program to preview video in matlab


%{
vid=videoinput('winvideo',1);
preview(vid)
%}

%matlab program for video to image converter in matlab


%{
vid=videoinput('winvideo',1);
set(vid,'ReturnedColorSpace','RGB');
global i3
i3=getsnapshot(vid);
[row3,col3,dim3]=size(i3);
row3
col3
dim3
size(i3)
fprintf('Number of rows in image using video to image converter =
%d\n',row3);
fprintf('Number of columns in image using video to image converter =
%d\n',col3);
figure
imshow(i3)
%}

%matlab program to show many images in single figure window in matlab


figure
subplot(2,1,1)
imshow(i1)
subplot(2,1,2)
imshow(i2)

%matlab program to add gaussian noise in image in matlab


global i1
m=0.1; % mean in gaussin noise
v=0.4; % variance in gaussian noise
gaussian_noise=imnoise(i1,'gaussian',m,v);
figure
subplot(2,1,1)
imshow(i1)
title('original image');
subplot(2,1,2)
imshow(gaussian_noise)
title('gaussian noise m = 0.1, v=0.4');

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy