DIP Exer 3
DIP Exer 3
College of Sciences
Computer Studies Department
1. Intensity Transformations:
• Linear Scaling: Multiply each pixel value by a constant factor and add another constant. It is often
used for contrast stretching or normalization.
• Logarithmic and Power-law Transformations: Used for adjusting the dynamic range of pixel
intensities.
2. Spatial Transformations:
• Translation: Shift the image in the x and y directions.
• Rotation: Rotate the image by a specified angle.
• Scaling: Resize the image by a scaling factor.
3. Geometric Transformations:
• Affine Transformation: Combines translation, rotation, scaling, and shearing.
• Projective Transformation (Homography): Used for perspective corrections.
4. Color Transformations:
• Grayscale Conversion: Convert a color image to grayscale using different methods.
• Color Space Conversion: Convert between different color representations (e.g., RGB to HSV).
5. Frequency Domain Transformations:
• Fourier Transform: Analyze the image in the frequency domain.
• Inverse Fourier Transform: Convert the frequency domain representation back to the spatial domain.
6. Histogram Transformations:
• Histogram Equalization: Enhance the contrast of an image by redistributing pixel intensities.
The choice of transformation depends on the specific requirements and objectives of the image processing task.
Implementation details may vary based on the programming language and libraries used.
% Rotation K=imrotate(j,60);
subplot(2,2,3); imshow(K); title('Rotated Image 60deg');
R=imrotate(j,45);
subplot(2,2,4); imshow(R); title('Rotated Image 45deg');
Prepared by: Demy Dizon
CS14/L – DIP subject
%Display the color image and its Resized images by different methods
1. Intensity Transformations:
• Linear Scaling: output_image = a * input_image + b
• Logarithmic and Power-law Transformations: output_image = c * log(1 + input_image) #
Logarithmic output_image = c * (input_image ** gamma) # Power-law
2. Spatial Transformations:
• Translation: T = [1 0 tx; 0 1 ty]; output_image = imwarp(input_image, affine2d(T));
• Rotation: output_image = imrotate(input_image, angle);
• Scaling: output_image = imresize(input_image, scale_factor);
3. Geometric Transformations:
• Affine Transformation: T = [a b 0; c d 0; tx ty 1]; output_image = imwarp(input_image, affine2d(T));
• Projective Transformation (Homography): tform = projective2d(H); output_image =
imwarp(input_image, tform);
4. Color Transformations:
• Grayscale Conversion: output_image = rgb2gray(input_image);
• Color Space Conversion: output_image = rgb2hsv(input_image);
5. Frequency Domain Transformations:
• Fourier Transform: F = fft2(input_image);
• Inverse Fourier Transform: output_image = ifft2(F);
6. Histogram Transformations:
• Histogram Equalization: output_image = histeq(input_image);
Name:
Year/Block:
Application/Software:
1. Codes
2. Output
3. Answer the following questions:
A. Intensity Transformations:
- Explain the importance of intensity transformations in image processing. How might linear scaling
and logarithmic transformations be used to enhance features such as terrain or vegetation?
B. Spatial Transformations:
- Discuss the significance of spatial transformations in image analysis. How could translation,
rotation, and scaling be applied to align images from different passes or correct for geometric
distortions?
C. Geometric Transformations:
- Elaborate on the role of geometric transformations, especially affine transformations and
projective transformations (homography), in image processing. Provide examples of real-world
scenarios where these transformations are crucial for accurate analysis.
D. Color Transformations:
- In the context of satellite imagery, explain why color transformations might be relevant. Discuss
scenarios where converting images to grayscale or transitioning between different color spaces
(e.g., RGB to HSV) could aid in better interpretation and analysis.
E. Frequency Domain Transformations:
- Explore the potential applications of Fourier Transform in image processing. How might analyzing
images in the frequency domain help identify patterns, anomalies, or specific environmental
features?
F. Histogram Transformations:
- Describe how histogram equalization could be beneficial in enhancing contrast in images. Discuss
any potential challenges or limitations when applying this technique to large datasets.