home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / softsys / khoros / 2928 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  3.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!mimbres.cs.unm.edu!pprg.unm.edu!daemon
  2. From: donohoe@jemez.eece.unm.edu
  3. Newsgroups: comp.soft-sys.khoros
  4. Subject: Image deblurring
  5. Message-ID: <41637@pprg.eece.unm.edu.pprg.unm.edu>
  6. Date: 13 Nov 92 16:01:16 GMT
  7. Sender: news@pprg.unm.edu
  8. Lines: 75
  9.  
  10.  
  11. >From article <41581@pprg.eece.unm.edu.pprg.unm.edu>, by "Mario Errico" <errico@staff.tc.umn.edu>:
  12. > Hello Mathew, khorosers,
  13. > speaking of Image Restoration, are RLAB or other khoros routines usable for 
  14. > improving the quality of images degraded by out-of-focus: for example obtained 
  15. > with a video or still camera not foucused correctly (or just because of shallow 
  16. > depth-of-field)?
  17. > Thanks a lot,
  18. > Mario
  19. >
  20. + From: teague@a.cs.okstate.edu (Keith Teague)
  21. + I am also interested in answers to this question. Please post replies.
  22. + Thanks in advance.
  23. + Keith Teague
  24. +  
  25.  
  26. In the regular VIPL library there are two routines,  both under
  27. IMAGE PROCESSING | Frequency Filters in the canata master form.
  28.  
  29. One is vinverse,  which is a frequency-domain inverse filter.  If 
  30. you model the blur function as a linear operator, then blurring image f(x,y)
  31. by blurring function h(x,y) to produce blurred image g(x,y) is produced
  32. by a convolution:  g(x,y) = f(x,y) * h(x,y).  In the frequency domain,
  33. this is becomes a point-by-point multiplicationG(u,v) = F(u,v) H(u,v),
  34. where F(u,v) is the Discrete Fourier Transform of f().  
  35.  
  36. To 'undo' the blur, in the frequency domain, 
  37. just divide: F(u,v) = G(u,v)/H(u,v);  this is what vinverse does.  
  38. This scheme is frustrated by noise
  39. and the possibility of division by zero.  Therefore,  vinverse lets
  40. you specify a threshold value for 1/H(u,v) to make it behave better.
  41.  
  42. The Wiener filter is similar,  but takes noise and image properties
  43. into account to give better results.  The version in Khoros is the para-
  44. metric Wiener filter,  with some simplifying assumptions made (See
  45. R.C. Gonzalez and R.E. Woods, Digital Image Processing, Addison-Wesley,
  46. 1992, pp 170-282, esp. Equation (5.5-10)).  Vwiener gives good results
  47. if the noise isn't too bad and the blur function not too extreme.
  48. The flexibility of Khoros lets you construction better Wiener filters
  49. as workspaces;  the more you know or can assume about your problem,
  50. the better you can tailer the filter to it,  and you'll get better
  51. results.
  52.  
  53. A central problem is coming up with the blur function, H(u,v).  one
  54. way is to do a test, if this is possible -- image a point source of
  55. light,  record the "fuzzy" point,  use this as h(x,y),  and use vfft
  56. to get H(u,v).  Optical blur functions are often modelled as sin(x)/x
  57. or as Bessel functions:  these have lots of zeroes,  which produce
  58. numerical instability.  You can often get by with a Gaussian approxim-
  59. ation,  easily generated with vggauss.  More sophisticated approaches
  60. use the Cepstrum (DFT of the log of the image) to estimate blur functions.
  61.  
  62. I'm sure some of the users out there have fancier toolboxes -- maybe
  63. they'll reply as well.
  64.  
  65. Good luck.
  66.  
  67. ====================================================================
  68. Greg Donohoe, Ph.D.
  69. Assistant Professor
  70. Electrical and Computer Engineering
  71. University of New Mexico     Tel: 505-277-6724
  72. Albuquerque, NM 87131       email: donohoe@chama.eece.unm.edu
  73.  
  74. Fortuen cookie:  "You learn from your mistakes. You will learn much
  75. today."
  76. ====================================================================
  77.  
  78.