Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

IMP Activity 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Activity – 1

Image Processing

G Rithik Savio
ECE Department
311121106049
CEC366 – IMAGE PROCESSING ACTIVITY –I
III YEAR/V SEM ECE AY 2023-24

EXPERIENTIAL LEARNING

Outcomes :

CO1 - Know and understand the basics and fundamentals of digital image processing, such as digitization,
sampling, quantization, and 2D-transforms

CO2 - Operate on images using the techniques of smoothing, sharpening and enhancement. PO’s

mapped :

PO1, PO2, PO3, PO4, PO5,PO10, PO12

Name of the Student : G Rithik Savio


Reg No : 311121106049
Course Instructor : Dr.A.Anitha Juliette/Assoc. Prof/ECE

Activity Given : 14.08.23


Activity Due : 21.08.23

Activity Submission Date : 21.08.23

Rubrics for Assessment of Activity:

Note : Submissions beyond the Due date will not be considered for assessment
Criteria for Assessment Score
(10)

Number Both I & II Both I & Either I or II Incorrect ___ / 6


of solved II solved answers
questions completely solved partially ( 2 to 1
solved ( 6 marks ) partially (3 marks) marks)
(6 marks) ( 4-5 marks
)

Report Well written report Average Poor quality of ___ / 4


( 4 marks) with quality of report
images and report ( 1 marks )
comments ( 3-2
( 4 marks) marks)

TOTAL SCORE
I. Using MATLAB or Python environment, experiment the following:
1. Select an RGB image of your choice
2. Separate the three color planes in an image and display them as gray scale images. 3. Combine
two planes at a time and comment on the results.
4. Convert the RGB image into HSI image space.

II. Using MATLAB or Python environment, perform Image enhancement in spatial


domain(Intensity transformation techniques)
Consider the following Gray scale image

1. Apply negative transformation to obtain the negative of the image.


2. Apply log transformation on the image.
3. Apply power law transformation on the image

For each of the above cases, mention the transformation algorithm, MATLAB code,
corresponding output images and comment on the results.

1) RGB Image
Matlab Code :-
parrot = imread("parrot.png")

%Seperation of 3 channels
[R,G,B] = imsplit(parrot)
figure
subplot(3,1,1)
imshow(R)
subplot(3,1,2)
imshow(G)
subplot(3,1,3)
imshow(B)

% Combination of 2 channels

% Combine green and red


figure
blackImage = zeros(size(R), 'uint8');
CombinedRGImage = cat(3,R,G,blackImage);
imshow(CombinedRGImage);

%Combine green and blue


figure
blackImage = zeros(size(B), 'uint8');
imshow(blackImage);
CombinedRBImage = cat(3,G,B,blackImage);
imshow(CombinedRBImage);

%Convert RGB image to HSI image


imdouble = im2double(parrot)
figure
hsi_parrot = rgb2hsv(imdouble);
imshow(hsi_parrot)

Output:-

Original Image
i) Image Splitting :-

RED Channel Image Blue Channel Image

Observations:-

1) The Red channel is individually splitted from the


original image, basically the array of the original image is 3
dimensional made up of (R,G and B dimensions ),

2) in the first we picture we can see that the red


dimension is individually separated or slitted from the
whole image and is given the intensity of red (0- 255), the
most reddest area will be the brightest and the least will
be the darkest,

Green Channel Image 3) similarly we have the outputs of all the other
dimensions or channels .
ii) Combination of 2 channels

RED Channel Image + Green Channel Image =

Blue Channel Image + Green Channel Image =

Observations:-

1) The Given 2 images are made using the combination


of 2 different channels in the first case it is R + G,

2) In the second case it is G + B.

3) The combination of the 2 channels were


implemented using the concatenate ( cat ) function,
first we create a black image array of the size of R
channel, and then we simply use the cat function.

iii) Conversion from RGB to HSI Model

Observations:-

1) The Given RGB Image is converted to the HSI Model


Image, using the function rgb2hsv(), firstly we
convert the image to a double value and convert
the image to HSI Model
2) Image Transformations

Original Image
Matlab Code :-
strawberrylowcon = imread("strawberry.jpg")

%Negative Transformation
strawberrylowconneg = 255 - strawberrylowcon

%log transformation
r = double(strawberrylowcon);
c = 1;
s = c*(log(1+r));
t = 255/(c*log(256));
strawberrylowconlog = uint8(t*s);

%Power law transformation


G = 0.6;
S = c * (r .^G);
T = 255/(c * (255 .^G))
strawberrylowconpower = uint8(T*S)

figure
subplot(1,3,1)
imshow(strawberrylowcon)
subplot(1,3,2:3)
imshow(strawberrylowconneg)

figure
subplot(1,3,1)
imshow(strawberrylowcon)
subplot(1,3,2:3)
imshow(strawberrylowconlog)

figure
subplot(1,3,1)
imshow(strawberrylowcon)
subplot(1,3,2:3)
imshow(strawberrylowconpower)
i) Negative Transformation of an Image

Original Image Negative of an Image

Observations:-
1) The given Negative Image is simply produced, by subtracting the image from 255 (the highest Intensity
value )

2) The negative of the image is said so due to the appearance the brightest pixel in the original image,
converted to the darkest pixel in the Negative image, (vice versa )

ii) Log Transformation

Original Image log of an Image

Observations:-
1) In the given input image , we firstly convert the image
into the double values and then apply it to formula of
s = (c*(log(1+r)), and then we simply multiply the
normalized value of T, and we get the output.

2) we can observe that the log function maps a narrow


range of dark input values into a wider range of
output values and with the opposite being true for
higher values of input.
iii) Power Law Transformation

Original Image (x2) power of an Image

Observations:-
1) In the given input image , we firstly convert the image into the double values and then apply it to
formula of s = (r*G), where G is said to be the power factor, and then we simply multiply the normalized
value of T, and we get the output.
2) The exponential and `raise to power' operators are two anamorphosis operators which can be applied
to grayscale images. Like the logarithmic transform, they are used to change the dynamic range of an
image. However, in contrast to the logarithmic operator, they enhance high intensity pixel values.
Thank You

You might also like