Author: Rahul Patel
Roll No: UI22EC58
Repository Name: MATLAB-ImageProcessing-Lab-01
This project is divided into three tasks:
- Task 1: Perform operations on an RGB color image to convert it to grayscale, indexed, and binary images.
- Task 2: Generate black, white, and black-in-white/white-in-black images from a sample image.
- Task 3: Plot a 2D function of the form
f(x, y) = a * sin(u(x) * x + v(y) * y)
.
The code demonstrates basic image processing techniques and 2D plotting in MATLAB.
-
Original Image
This is the original color image (peppers.png
) used in the image processing operations. -
Gray Image (Built-in Function)
The color image was converted to grayscale using thergb2gray
MATLAB function. -
Gray Image (Average Method)
Grayscale conversion using the average of the R, G, and B channel values.
- Gray Image (Weighted Method)
Grayscale conversion using the weighted sum of R, G, and B channels (0.3, 0.59, 0.11 respectively).
-
RGB to Indexed Image
The RGB image was converted to an indexed image with 16 colors. -
Binary Image (Built-in Function)
Conversion of the grayscale image to a binary image using MATLAB’sim2bw
function. -
Binary Image (Manual Threshold)
Manual conversion to binary using a threshold value of 128.
- Black Image
A black image generated using zeros in MATLAB.
-
White Image
A white image generated using ones in MATLAB. -
Black-in-White Image
An image where black pixels are set within a white background. -
White-in-Black Image
An image where white pixels are set within a black background.
This task involved plotting a 2D function of the form f(x, y) = a * sin(u(x) * x + v(y) * y)
.
To run this code:
- Download or clone this repository.
- Open MATLAB and navigate to the folder where the code is located.
- Run the
lab_01.m
script in MATLAB.
This project demonstrates basic image processing operations and 2D function plotting using MATLAB. The outputs include grayscale, binary, indexed images, and visual manipulations of chessboard-like images, along with a plotted sine wave in 2D space.
Repository: MATLAB-ImageProcessing-Lab-01