0% found this document useful (0 votes)
3 views2 pages

PRc-1 Code

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

PRc-1 Code

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

clc;

clear all;

close all;

% image reading

ori_im=imread("D:\BIP PRACTICALS\sample images\eye.png");

%image display

figure,subplot(2,2,1),imshow(ori_im);title('Original color image')

% convert color image to gray scale

g_im=rgb2gray(ori_im);

subplot(2,2,2),imshow(g_im),title('Gray color image')

% information of image file

a=size(ori_im);
[m,n]=size(g_im);

whos g;

whos im;

k1= imfinfo("D:\BIP PRACTICALS\sample images\eye.png");

% write image

filename=(strcat("D:\BIP Yash\Write","Yash.png"));

imwrite(g_im,filename);

k2= imfinfo("D:\BIP PRACTICALS\sample images\coins.png");

% different image format

d=im2double(g_im);

u1=im2uint16(g_im);

b1=im2bw(g_im);

subplot(2,2,3),imshow(b1);title('Binary image')
% DICOM IMAGE READ

dic1 = dicomread("D:\BIP PRACTICALS\sample images\I0000442_anon.dcm");

%DICOM IMAGE DISPLAY

figure,subplot(2,3,1),imagesc(dic1);title('MRI Image in DICOM Format ');

u1=im2uint16(dic1);

% Display image in Image tool to analyze pixel intensity

imtool(g_im);

% basic operations of image

% 1) Image addition

dic2 = dicomread("D:\BIP PRACTICALS\sample images\I0000470_anon.dcm");

ad1=imadd(dic1,dic2);

figure,subplot(2,3,1),imagesc(dic1);colormap('gray');title('Image 1');

subplot(2,3,2),imagesc(dic2);colormap('gray');title('Image 2');

subplot(2,3,3),imagesc(ad1);colormap('gray');title('Image Addition');

% 2) Image subtraction

as1=imsubtract(dic1,dic2);

subplot(2,3,4),imagesc(as1);title('Image subtraction');

% 3) Image Multiplication

am1=immultiply(dic1,10);

subplot(2,3,5),imagesc(am1);title('Image Multiplication');

% 3) Image Division

ad2=imdivide(dic1,10);

subplot(2,3,6),imagesc(ad2);title('Image Division');

You might also like