Documente Academic
Documente Profesional
Documente Cultură
Presented by:
Ryan Merghani Ahmed
Group (B)
Regardless of the method used, however, image enhancement is one of the most
interesting and visually appealing areas of image processing. Image enhancement
approaches fall into two broad categories: spatial domain methods and frequency
domain methods. The term spatial domain refers to the image plane itself, and
approaches in this category are based on direct manipulation of pixels in an image.
Frequency domain processing techniques are based on modifying the Fourier
transform of an image.
The term spatial domain refers to the aggregate of pixels composing an image.
Spatial domain methods are procedures that operate directly on these pixels.
Spatial domain processes will be denoted by the expression
g ( x, y ) [ f ( x, y )]
Where f(x, y) is the input image, g(x, y) is the processed image, and T is an
operator on f, defined over some neighborhood of (x, y).
Firstly (imread) function was used to read image from graphics file, then
(imshow) function used to display the original image, after that (imhist) used to
display histogram of image data, then (histeq) function was used to enhances the
contrast of original image, so that the histogram of the output image approximately
matches a specified histogram, finally we display the enhanced image to make a
comparison.
2.
Here to reduce noise we use filtering operations that are performed directly on the
pixels of an image. We use the term spatial filtering. The process consists simply
of moving the filter mask from point to point in an image. At each point (x, y), the
response of the filter at that point is calculated using a predefined relationship.
Two types of filter were used the first one was a smoothing filter (average filter)
with 3*3 dimension; it was applied using (filter2) function, the second filter used
was an Order-Statistics Filter (median filter) with 3*3 dimension, function
(medfilt2) was used for this purpose, also the function (imshow) was used to
display the original image after been filtered.
3.
Here to enhance these images Laplacian and gradient filters were used to highlight
fine detail, and to enhance prominent edges respectively, first laplacian filter was
used to highlight fine detail, the resultant image was scaled using scaling
technique. Sharpened noisy image was obtained by adding the scaled image to the
original image (assume the obtained image is a), after that we apply gradient filter
on the original image and smooth it using (5*5) average filter (assume the obtained
image is b), then we use the image b as a mask; which had been applied on a, the
result was added to the original image to obtain a final sharpened image, in the
final step a power law transformation was applied to the sharpened image.
All above steps were done using MATLAB function like: imfilter, imshow,
imread and im2double.
Discussion of results
1.
We can notice that the original image in figure (1) (Result1) is a low contrast
image; this observation is from its histogram, original image in figure (2) classified
as a dark Image, figures in (Result1) show that histogram equalization techniques
significantly improve original images quality. We can also see that although the
two original images were different (thus have different histogram); the histogram
equalized images are visually very similar.
2.
From the figure in (Result2) we can notice that averaging filter reduce noise in a
good way, but the resulting image become less sharp and significantly blurring,
unlike median filter which give a sharper image besides reducing noise. In general
we can say that median filtering is much better suited than averaging for the
removal of additive salt-and-pepper noise.
3.
Our objective is to enhance this image by sharpening it and by bringing out more
of the skeletal detail. From the figures in (Result3) we can notice that:
- Image background become gray after applying laplacian filter [as observed
in figure (1)] because the scaling technique which had been used to avoid the
negative values.
- When we add the original image to the laplacian image we obtain image that
is noisy and sharper [as observed in figure (2)].
- When we apply gradient filter on the original image we can observe that
edges are much more dominant in this image than in the Laplacian image [as
observed in figure (2)].
- When we apply gradient filter on the original image and multiply the
smoothed result with the scaled laplacian image we can get preserve details
in the strong areas while reducing noise in the relatively flat areas [as
observed in figure (3)].
- Adding the product image to the original image resulted in a sharpened
image observed in figure (4).Final result obtained by applying a power-law
transformation to the above image to increase the dynamic range of the
sharpened image. We see that significant new detail is visible in the final
figure. The areas around the wrists, hands, ankles, and feet are good
examples of this. The skeletal bone structure also is much more pronounced,
including the arm and leg bones.
The significant increase in sharpness of detail in this image over the original is
evident in most parts of the image, including the ribs, spinal cord, pelvis, and skull.
This type of improvement would not have been possible by using the Laplacian or
gradient alone.
Results
Result1
Figure (1)
6000
4000
2000
0
0 100 200
6000
4000
2000
0
0 100 200
Figure (2)
4000
2000
0
0 100 200
4000
2000
0
0 100 200
Result2
Figure (2)
Figure (4)
low=imread('1.tif');
figure(1);
subplot(2,2,1);
imshow(low),title('original image');
subplot(2,2,2);
imhist(low),title('original image histogram');
loweq=histeq(low);
subplot(2,2,3);
imshow(loweq),title('enhanced image');
subplot(2,2,4);
imhist(loweq),title('enhanced image histogram');
dark=imread('2.tif');
figure(2);
subplot(2,2,1);
imshow(dark),title('original image'),
subplot(2,2,2);
imhist(dark),title('original image histogram');
darkeq=histeq(dark);
subplot(2,2,3);
imshow(darkeq),title('enhanced image');
subplot(2,2,4);
imhist(darkeq),title('enhanced image histogram');
noisy=imread('3.tif');
subplot(2,2,1)
imshow(noisy),title('noisy image');
enhanced=filter2(fspecial('average',3),noisy)/255;
subplot(2,2,2)
imshow(enhanced),title('image enhanced using average filter');
noisy=imread('3.tif');
subplot(2,2,3)
imshow(noisy),title('noisy image');
enhanced1=medfilt2(noisy,[3 3]);
subplot(2,2,4)
imshow(enhanced1),title('image enhanced using median filter');
3. Program for proj.3
bodybone=imread('4.tif');
figure(1)
subplot(1,2,1)
imshow(bodybone),title('original image');
bodybone1=im2double(bodybone);
laplacianmask=[-1 -1 -1;-1 8 -1;-1 -1 -1];
laplacian=imfilter(bodybone1,laplacianmask,'replicate');
scaledlaplacian=(laplacian+0.8157);
scaledlaplacian1=scaledlaplacian/1.6314;
subplot(1,2,2)
imshow(scaledlaplacian1,[]),title('scaled laplacian image');
Sharpenlaplacian=scaledlaplacian1+bodybone1;
figure(2)
subplot(1,2,1)
imshow(Sharpenlaplacian,[]),title('Sharped laplacian image');
gradientmask=[-1 -2 -1;0 0 0;1 2 1];
gradient=imfilter(bodybone1,gradientmask,'replicate');
scaledgradient=(gradient+1.2392);
scaledgradient1=scaledgradient/3.0392;
sharpgradient=scaledgradient1+bodybone1;
subplot(1,2,2)
imshow(sharpgradient,[]),title('sharped scaled gradient image');
enhancedgradient=filter2(fspecial('average',5),sharpgradient)/255;
figure(3)
subplot(1,2,1)
imshow(enhancedgradient,[]),title('enhanced gradient image');
finalmask=Sharpenlaplacian.*enhancedgradient;
subplot(1,2,2)
imshow(finalmask,[]),title('final mask image');
sharpe=bodybone1+finalmask;
figure(4)
subplot(1,2,1)
imshow(sharpe,[]),title('sharpe image');
sharpe1=sharpe.^0.5;
subplot(1,2,2)
imshow(sharpe1,[]),title('power law image');