 
 import C2HSTools
 
-sobelOp :: (Int,Int) -> Int -> ImageOperation GrayScale D32
-sobelOp (dx,dy) aperture 
+-- | Perform Sobel filtering on image. First argument gives order of horizontal and vertical
+--   derivative estimates and second one is the aperture. This function can also calculate
+--   Scharr filter with aperture specification of sScharr
+-- TODO: Type the aperture size and possibly the derivative orders as well
+-- TODO: It is possible to define sobel with different target image with other bit depths.
+sobelOp :: (Int,Int) -> SobelAperture -> ImageOperation GrayScale D32
+sobelOp (dx,dy) (Sb aperture)
     | dx >=0 && dx <3
-    && aperture `elem` [-1,1,3,5,7]
     && not ((aperture == -1) && (dx>1 || dy>1))
     && dy >=0 && dy<3 = ImgOp $ \i -> withGenImage i $ \image ->
                                       ({#call cvSobel#} image image cdx cdy cap)

{-#LANGUAGE ForeignFunctionInterface#-}
#include "cvWrapLEO.h"
module CV.Edges where
import Foreign.C.Types
import Foreign.C.String
import Foreign.ForeignPtr

                               
                            
                             
-- | SUSAN edge detection filter, see http://users.fmrib.ox.ac.uk/~steve/susan/susan/susan.html
-- TODO: Should return a binary image
susan :: (Int,Int) -> D32 -> Image GrayScale D32 -> Image GrayScale D8
susan (w,h) t image = unsafePerformIO $ do
                    withGenImage image $ \img ->
