0% found this document useful (0 votes)
21 views

Problem Statement 40

The document discusses various methods for enhancing medical images to improve edge information, including histogram equalization, Laplacian of Gaussian (LoG) filtering, and Sobel filtering. These techniques aim to make transitions between different image regions or objects more prominent to facilitate image analysis tasks. Code examples apply these methods to a sample leg image and visualize the results, demonstrating enhanced edge detection.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Problem Statement 40

The document discusses various methods for enhancing medical images to improve edge information, including histogram equalization, Laplacian of Gaussian (LoG) filtering, and Sobel filtering. These techniques aim to make transitions between different image regions or objects more prominent to facilitate image analysis tasks. Code examples apply these methods to a sample leg image and visualize the results, demonstrating enhanced edge detection.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Aim : Take some X-ray\ MRI images.

Apply various methods to


produce enhanced images with improved edge information.

Theory : The concept of improved edge information in image


processing is rooted in the understanding of edges as important
features that provide crucial information about the boundaries and
contours of objects within an image. Edges correspond to significant
changes in pixel intensity, and their accurate detection and
enhancement are essential for various image analysis and computer
vision tasks.
Edges can be considered as regions of high-frequency information in
an image, representing transitions between different image regions or
objects. By enhancing the edge information, we aim to make these
transitions more prominent and distinguishable, leading to improved
visual perception and facilitating subsequent image processing tasks.
There are several methods to produce enhanced images with
improved edge information. Here are a few commonly used
techniques:
1) Histogram Equalization: histogram equalization is a technique
used in image processing to improve the contrast and enhance
the visual appearance of an image. It aims to redistribute the
pixel intensities in such a way that the histogram of the image
becomes more evenly distributed across the available intensity
range.
The histogram of an image represents the frequency
distribution of pixel intensities. It provides information about
the number of pixels that have a particular intensity value. In an
ideal case, a well-distributed histogram would have a relatively
uniform distribution across the entire intensity range, ensuring
that the full range of intensities is utilized.
2) Laplacian of Gaussian (LoG) Filtering:
The Laplacian of Gaussian (LoG) filtering is a commonly used
technique in image processing for edge detection and image
enhancement. It combines the concepts of the Laplacian
operator and the Gaussian smoothing function to identify
significant intensity variations, which correspond to edges, in an
image.

The Laplacian operator is a mathematical operator that


calculates the second derivative of an image. It measures the
rate of change of intensity at each pixel location and is sensitive
to rapid intensity changes. The Laplacian operator is defined as
the sum of the second-order partial derivatives in the x and y
directions:
Δ^2f = ∂^2f/∂x^2 + ∂^2f/∂y^2

3) Sobel filter: The Sobel filter is a widely used image processing


technique for edge detection and enhancement. It is named after
its inventor, Irwin Sobel, and is based on the concept of
computing the image gradient to identify regions of significant
intensity changes, which correspond to edges. The Sobel filter
operates by convolving the image with two separate kernels, one
for horizontal changes (Sobel-X) and the other for vertical
changes (Sobel-Y). These kernels are 3x3 matrices of
predefined coefficients. The Sobel-X kernel detects horizontal
edges, while the Sobel-Y kernel detects vertical edges.
Code and Outputs
Histogram Equalization
> I= imread("C:\Users\Vijay\Downloads\legImage.png");
>> figure
subplot(1,3,1)
imshow(I)
subplot(1,3,2:3)
imhist(I)
>> J = histeq(I);
>> figure
subplot(1,3,1)
imshow(J)
subplot(1,3,2:3)
imhist(J)
>> nbins = 10;
K = histeq(I,nbins);
>> figure
subplot(1,3,1)
imshow(K)
subplot(1,3,2:3)
imhist(K)
>> target = 256:-4:4;
figure
bar(4:4:256,target)
>> L = histeq(I,target);
>> figure
subplot(1,3,1)
imshow(L)
subplot(1,3,2:3)
imhist(L)

Fig. 40.1 Histogram Equalization of Original Image


Fig. 40.2 Histogram Equalization of Enhanced Image

Fig. 40.3 Frequency v/s Intensity Histogram


Filtering techniques
Laplacian filter
A=imread("C:\Users\Vijay\Downloads\legImage.png");
sigma = 0.4;
alpha = 0.5;
B = locallapfilt(A, sigma, alpha);
imshowpair(A, B, 'montage')

Fig. 40.4 Laplacian Filter Image


Sobel filter

cc = imread('C:\Users\Vijay\Downloads\legImage.png');
cc = uint8(cc);
figure, imshow(cc); title('cc');
cc = rgb2gray(cc);

cc = double(cc);
edg = edgy(cc);
% Pre-allocate the filtered_image matrix with zeros
edg = zeros(size(cc));
Mx = [-1 0 1; -2 0 2; -1 0 1];
My = [-1 -2 -1; 0 0 0; 1 2 1];
for i = 1:size(cc, 1) - 2
for j = 1:size(cc, 2) - 2
% Gradient approximations
Gx = sum(sum(Mx.*cc(i:i+2, j:j+2)));
Gy = sum(sum(My.*cc(i:i+2, j:j+2)));

% Calculate magnitude of vector


edg(i+1, j+1) = sqrt(Gx.^2 + Gy.^2);

end
end
edg = uint8(edg);
figure, imshow(edg); title('edg');
thresholdValue = 100; % varies between [0 255]
output_image = max(edg, thresholdValue);
output_image(output_image == round(thresholdValue)) = 0;
output_image = im2bw(output_image);
figure, imshow(output_image); title('Edge Detected Image');

Fig. 40.5 Sobel Filtered Image

Result : Various Method of image enhancing are


applied and edges are detected with improved
information.

You might also like