Commit c47d820ac507a94127e23660e220e3ae09c509ba

fixed a few small issues
l03-fourier2d.hs
(2 / 0)
  
1818-- 24pix image of r1=3 and r2=9 white torus on black background
1919torus = torusGrayImage 24 3 9 1 0
2020storus = gaussian (3,3) torus
21-- 20pix image of r=5 white square on black background
2122square = squareGrayImage 20 5 1 0
2223ssquare = gaussian (3,3) square
24-- 20pix image of r=5 white diamond on black background
2325diamond = diamondGrayImage 20 5 1 0
2426sdiamond = gaussian (3,3) diamond
2527
l03-gabor.hs
(10 / 5)
  
44import CV.Filters
55import CV.ImageMath as IM hiding (div)
66import CV.ColourUtils
7import CV.Operations
78
89import Filters
10import Fourier
911import Gabor
1012
1113size = 7
1919main = do
2020 img <- readFromFile "park.png"
2121 let
22 (gimg1,gimg2) = filterGabor mask size center img
22 (gre,gim) = filterGabor mask size center img
23 (gamp,gpha) = dftToPolar2D (gre, gim)
2324 saveImage "gabor.png" $ montage (2,2) 2 $
24 [ stretchHistogram gimg1
25 , stretchHistogram gimg2
26 , stretchHistogram $ IM.sqrt $ (IM.add (IM.mul gimg1 gimg1) (IM.mul gimg2 gimg2))
27 , stretchHistogram $ IM.atan2 gimg2 gimg1
25 [ logNormalize gre
26 , logNormalize gim
27 , stretchHistogram gamp
28 --IM.sqrt $ (IM.add (IM.mul gimg1 gimg1) (IM.mul gimg2 gimg2))
29 , unitNormalize gpha
30 -- $ IM.atan2 gimg2 gimg1
2831 ]