[go: up one dir, main page]

0% found this document useful (0 votes)
7 views10 pages

Assignment 2 Yahya SABBAGH

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 10

Assignment 2

Yahya SABBAGH
November 19, 2024

Report: Image Processing


1. Image distance

1.1. Use the example given in (bwdist) function to compare the 2-D
distance transforms for each of the supported distance methods.

Each figure depicts the binary of the image along with its Euclidean, Cityblock,
and Chessboard distance transforms. This comparison depicts how the different
metrics affect the distance contours of each image.
1.2. Construct the distance transform for the image ‘leaf’ for each of
distance methods. What aboutthe robustness to noise using ‘leafnoisy’
image?
• Euclidean Distance Transform: The distance contours in the noisy image
appear slightly distorted near the leaf's boundary due to the added noise,
but the central structure remains relatively unaffected.
• Cityblock (Manhattan) Distance Transform: The noise slightly alters the
boundary's distance gradient, but overall, the transform remains stable,
showing similar contours to the clean image.
• Chessboard Distance Transform: Chessboard distance transformation
also presents slight boundary distortions under noise, while keeping its
main structure stable in the central regions.
2. Arithmetic operations

2.1. Implement a simple code to find the differences between two images.
See the operator –between images, without any loop. Use it with images
‘original’ and ‘original2’. Comments withthe visual inspection... How then
to count these five “errors”? It is not necessary to precisely do it,just
assume the eventual problems and how to implement it.
Estimation Approach:
Thresholding: The use of a threshold will enable us to filter out minor,
insignificant differences and tend to those that are larger.
Counting: An estimate of the count of the errors is reached by counting the
number of pixels above threshold.
2.2. Make now the difference between ‘chroOp’ and ‘chroL’. According to
you, what kind of information is in that way highlighted? Try to mask the
original image ‘chro’ with these results in color in order to highlight
particular parts of objects directly. The image ‘result’ is the good one…cat
function can be used if necessary to create 3 planes image from one with
only 1.
The following can be obtained from the result:
Difference Image: This image points to the regions where chroOp and chroL
differ. Contours around every highlight show where these changes take place,
which might indicate the boundary of possible objects or structural changes.

Original Image with Highlighted Differences: Overlapping the edge-detected


differences in red onto the original chro image allows direct visualization and
highlighting of parts of objects. The red outlines now emphasize the boundaries
where chroOp and chroL differ, and this could be a possible area of interest or a
region of structural changes.
3.Convolution

Define a signal f and convolve it with itself to get g. Repeat this


procedure three times and plot your results.
Now, define a Gaussian convolution kernel (look at function fspecial)

Successive convolutions of the signal f with itself yield peaks that are
progressively smoother and wider, each such convolution spreads and smooths
the original signal. At each iteration this is increasingly a Gaussian-like shape
typical of repeated self-convolution of a Gaussian shape.
Convolve an image with the defined convolution kernel (look at function
conv2). Test what you will obtain if you convolve the image with itself.
Justify your observations.
Original Image Section: Provides the original section image with fine pixelated
detail.
Gaussian-convolved section: The Gaussian convolution has smoothed out the
details. It contains much less noise, but larger-scale patterns are enhanced.
This is a general result of Gaussian convolution, where the high-frequency
details become smeared out, while the general structure is preserved.
4.Dirac Delta Function Integrals
1. Integral 1:
∫₋∞⁺∞ δ(x)f(x) dx = 1.00

2. Integral 2:
∫₋∞⁺∞ δ(g(x))f(x) dx = 0.50 (for g(x) = x² - 4)

3. Integral 3:
∫₋∞⁺∞ δ(a*x - b*x²)f(x) dx = 2.91 (with a = 1 and b = 0.5)

4. Integral 4:
∫₋∞⁺∞ δ(x₀ - x)e³x dx = 20.09 (for x₀ = 1)

Result: [1.0000000000000004, 0.5, 2.909297426825682,


20.085536923187668]

Code Link : Assignment 2 Yahya SABBAGH

You might also like