DIP_ASSIGNMENT_RAhul[1]
DIP_ASSIGNMENT_RAhul[1]
DIP_ASSIGNMENT_RAhul[1]
ALGORITHM:
1. Start the program by clearing the workspace and command window.
4. Display the image using the `imshow` function within a figure window.
5. Retrieve and display the size (dimensions) and data type of the image.
CODE:
img = imread(filename); % Reading File %
MATHEMATICAL EXPRESSION:
No specific mathematical expressions are involved in this task. The code primarily handles
image data as arrays of pixel values, and MATLAB functions perform the underlying
operations.
OUTPUT:
ASSIGNMENT 3
AIM: To write a MATLAB program to convert an RGB
image to grayscale and display both the original and
grayscale images using the subplot function.
THEORY:
Grayscale conversion is a common image processing task where a color image is transformed
into a grayscale image, reducing the color channels to a single channel representing intensity.
The rgb2gray function in MATLAB performs this conversion. Displaying multiple images in
a single figure can be efficiently done using the subplot function, which allows arranging
images in a grid within the figure window.
ALGORITHM:
1. Start by clearing the workspace and command window.
5. Create a figure window and use `subplot` to display the original and grayscale images side
by side.
6. Display the image size for both the original and grayscale images in the console.
CODE:
color_img = imread(filename); % Reading File %
subplot(1, 2, 1);
imshow(color_img); % Showing Original Image %
subplot(1, 2, 2);
imshow(gray_img); % Showing Grayscale Image %
MATHEMATICAL EXPRESSION:
�ℎ� ��������� ����� �� ���������� ����� � ����ℎ��� ��� �� �ℎ� ��� �ℎ������ :[Gray = �. ���� ×
� + �. ���� × � + �. ���� × �]
TUTORIAL:
OUTPUT:
TUTORIAL
OUTPUT:
ASSIGNMENT 4
AIM: Write a program for Histogram Calculation and
equalization.
THEORY:
1. Histogram Calculation
2. Histogram Equalization
ALGO:
How to Calculate Histogram:
For Grayscale Images: Each pixel value in a grayscale image ranges from 0 (black) to 255
(white). To calculate the histogram:
Create a vector hist of size 256 (for 8-bit images) initialized to zero.
For each pixel intensity value, increment the corresponding index in the histogram vector.
MATLAB Functions:
TUTORIAL
OUTPUT: