Experiment #1 Introduction to MATLAB Digital Image Processing Toolbox.
To get familiar with some
simple commands related to reading images using MATLAB.
Experiment #2 To understand and apply MATLAB commands for displaying images, adjusting intensity
ranges, and using multiple figure windows to visualize image variations.
[ Task #1: Home Task 1: Image Brightness Adjustment
Load the 'cameraman.tif' image into MATLAB.
Modify the brightness by adding and subtracting intensity values.
Display the original and brightness-adjusted images using imshow with different intensity shifts.
Display the results using both methods:
Method 1 (subplot): Show the original, brightened, and darkened images in a single figure using the
subplot function.
Method 2 (figure): Show each image in a separate figure window using the figure command.
Analyze how increasing or decreasing intensity values affects image visibility.
[Task # 2: Home Task 2: Intensity Clipping and Display Adjustment
Load the cell.tif image.
Display the image using imshow(f) to observe its original intensity range.
•
Adjust the intensity display range using imshow(f, [low high]) by selecting different values of low and
high.
Experiment with at least three different intensity ranges and observe how the image changes.
Display the original and adjusted images side by side using subplot.
Discuss the effect of intensity range adjustment on image visibility.
Experiment #3 To get familiar with MATLAB commands related to writing, saving, and managing image
files on disk.
Check Experiment #3 for this task
[Task#1: Take two images from uint8 and logical classes each and differentiate the images by displaying
information of these images using structure variables. (Hint: Cameraman.tif, coins.png) ]
Experiment #4 To understand different image data types (classes) and how to convert between them in
MATLAB.
Check Experiment # 4 for these tasks
[ Task #1: Load a built-in image of class uint8 in MATLAB, convert it to class double, and display both
versions using imshow. Observe any visible differences and explain the reason behind them, highlighting
how MATLAB handles different data types in image display.]
[Task#2: Create a matrix h = uint8([25 50; 128 200]), and convert it to double using both im2double and
mat2gray. Compare the outputs and explain how each function works—especially how im2double
converts without scaling while mat2gray normalizes the values between 0 and 1 based on the matrix
range.]
[Task#3: Use the matrix h = [1 2; 3 4], convert it to a grayscale image using mat2gray, then apply two
different thresholds to generate binary images. Convert the resulting binary image to uint8, and then to
double, ensuring that the actual numerical values remain unchanged throughout these type
conversions.]
Experiment #5 Matrix Manipulation for Image Transformation: Cropping, Rotation, and Compression in
MATLAB
Check Experiment #5 for these tasks
[Task 1.1:
What do the following commands do?
v(1:2:end)
v(end:-2:1)
Now use these commands to create a vector w that has the same elements as v but in reverse order.]
[Task 2.1: Row Swapping in a Matrix
Create a 5x5 matrix A with any elements.
Create a new matrix B by swapping:
First and last rows
Second and second-last rows
Hint: Use end and row indexing]
[Task 2.2: Row Swapping in an Image
Read the built-in cameraman.tif image:
f = imread('cameraman.tif');
Swap its rows as in Task 2.1.
Display the original and row-swapped images using subplot.
Question: What effect do you observe in the row-swapped image?]
[Task 2.3: Image Rotation
Use subplot to show four images in one figure:
Original cameraman.tif image.
90° clockwise rotation of image 1.
90° clockwise rotation of image 2.
90° clockwise rotation of image 3.
Use the rot90 function:
rotated = rot90(image, -1); % 90° clockwise rotation]
[Task 2.4: Image Cropping and Compression
Crop the image using:
s = f(50:200, 50:200);
Compress the image by skipping rows/columns:
fs1 = f(1:2:end, 1:2:end); % Every 2nd row/column
fs2 = f(1:5:end, 1:5:end); % Every 5th
fs3 = f(1:10:end, 1:10:end); % Every 10th
•
Show the original and three compressed images using subplot.
Question: Compare the size and quality of the compressed images with the original.]
Experiment # 6 Enhancing Image Detail and Visibility through Matrix Manipulation for Spatial Domain
Image Enhancement: Negative, Gamma, and Log Adjustments
Check Experiment #6 for these tasks
[Task 01:
Read the image spine.tif.
Take its complement and save it in g.
Apply imadjust with different gamma values.
Plot all resulting images in a single figure, and display the gamma value above each image.]
[Task 02:
Read the image spine.tif.
Take its complement and save it in g.
Apply the logarithmic transformation on g.
Plot both the original and transformed images in a single figure.]
You only have to solve tasks of all experiment. Just mention above experiment number and then solve
his tasks using his data. also if it is possible to to include Roll Number as (FA21-CSE-065) & Name as (M
Tahoor Ahsan) within some codes where is printing required. if it makes task messy then leave it but if
possible then do. also make presentation good looking . first page only for student details: NAME, ROLL
NO, SUBJECT NAME, DEPARTMENT, UNIVERSITY etc