Download - DIP Realized by IDL
![Page 1: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/1.jpg)
DIP Realized by IDL
Author: Ying Li
Course: computer for imaging science
![Page 2: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/2.jpg)
Program Overview
My project has 5 modules: 1. Zooming module 2. Filter module 3. Fourier transform module 4. Histogram module 5. Motion blur and restoration module
![Page 3: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/3.jpg)
Zooming Module Interface
![Page 4: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/4.jpg)
Filter module Interface
![Page 5: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/5.jpg)
Fourier transform module
![Page 6: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/6.jpg)
Histogram module interface
![Page 7: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/7.jpg)
Motion blur and restoration
![Page 8: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/8.jpg)
Interface Architecture
Selection Base
Menu bar
Zoomingbase
Displaywindow
![Page 9: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/9.jpg)
Zooming module
![Page 10: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/10.jpg)
![Page 11: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/11.jpg)
Zooming Module
Color table Keep track of the button status Restrict the rectangle from going
outside of the image Erase old rectangles
![Page 12: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/12.jpg)
Color Table
I want to display a gray level image with a red region of interest displayed on it. So I need a color table of my own.
![Page 13: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/13.jpg)
I set a flag variable to keep track of the mouse buttons’ status. So user can only drag the red rectangle with the mouse button pressed down.
The program calculated carefully to prevent the red rectangle from going outside of the image.
![Page 14: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/14.jpg)
Erase old rectangle
In order for the red rectangle to go with the mouse, the program must erase the old rectangle and draw a new rectangle at the new position.
To do this I use a hidden draw widget to display the image at exactly the same position, and erase old rectangle by copy data from the hidden window.
![Page 15: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/15.jpg)
Filter Module
In this module I realized four kind of filters:
Ideal low pass filter Ideal high pass filter Ideal band pass filter Butterworth low pass filter
![Page 16: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/16.jpg)
![Page 17: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/17.jpg)
Ideal low pass filter
![Page 18: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/18.jpg)
Ideal high pass filter
![Page 19: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/19.jpg)
Butterworth filter
![Page 20: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/20.jpg)
Butterworth Filter:
We know because of the the sharp edge of the ideal filters, there will be some oscillation on the output signal of ideal filters.
![Page 21: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/21.jpg)
This is the output of a STEP function go through an ideal low pass filter
![Page 22: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/22.jpg)
So, we want a kind of filter whose edges go down slowly. Butterworth filter was introduced.
This is the equation of a 1-D Butterworth filter:
Here N is the order of the Butterworth filter and c is the frequency cutoff
Nc
B2)/(1
1|)(|
![Page 23: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/23.jpg)
N=2 N=6
![Page 24: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/24.jpg)
Restore this degraded image:
![Page 25: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/25.jpg)
Go through a ideal low pass filter
![Page 26: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/26.jpg)
Go through a Butterworth filter
![Page 27: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/27.jpg)
Fourier Transform Module
![Page 28: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/28.jpg)
Histogram module
![Page 29: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/29.jpg)
Histogram module
![Page 30: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/30.jpg)
Motion Blur Restoration
Using a Inverse Filter to deconvolve the point spread function
Using convolve method to get ride of the blur coursed by the motion of the detector or the object
![Page 31: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/31.jpg)
Inverse Filter
Before image restoration can be accomplished, the PSF of the blurring function(that is the system transfer function of the degrading system) must be known. Actually most system that course the degrading of images are linear shift invariant system.
![Page 32: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/32.jpg)
Degradation model:
![Page 33: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/33.jpg)
Solve by inverse filter:
Here if the noise is very small and can be neglected. Then we can restore the image by a reverse filter:
),(),(),(),( NFHG
HGF /
![Page 34: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/34.jpg)
PSF:
The point spread function is a line here, if the exposure time is small enough.
![Page 35: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/35.jpg)
Result of inverse filter method:
![Page 36: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/36.jpg)
Convolution Method:
We still have some other ways to restore a motion blurred image. The motion blur is coursed by the moving of the detector or the object within the exposure thim T. That is:
T
dttyytxxgyxf0 00 ))(),(().(
![Page 37: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/37.jpg)
Convolution method:
iterate the procedure we can get the follow equation:
)()(')(')(
)()(')(
)()()('
xxfaxfaxg
xxfxg
axgxgxf
m
l
xlaxfmaxg0
)()(')(
![Page 38: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/38.jpg)
Convolution method:
From that we can see that the result is the convolution of the derivation of the degraded image with a comb function
![Page 39: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/39.jpg)
Result of convolution method
![Page 40: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/40.jpg)
Result of convolution method
![Page 41: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/41.jpg)
Result of convolution method
![Page 42: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/42.jpg)
Result of convolution method
![Page 43: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/43.jpg)
Conclusion:
In this project I used such widgets: labels, texts, draws,bases,drop lists, radio buttons, slider bars, menus, module dialogue form.
I realized such functions: Region of interest, ideal low pass filter, ideal high pass filter, ideal band pass filter, butterworth filter, with different parameters, fourier transform, image histogram, histogram equalization, image blur, a inverse filter, convolution method to restore motion blur, a module dialogue form
![Page 44: DIP Realized by IDL](https://reader035.vdocuments.site/reader035/viewer/2022062222/5681516d550346895dbf9d00/html5/thumbnails/44.jpg)