CV-0.3.5.3: OpenCV based machine vision library

Safe HaskellSafe-Infered

CV.Transforms

Description

Various image transformations from opencv and other sources.

Synopsis

Documentation

takeEvenSized :: Image c d -> Image c d

Since DCT is valid only for even sized images, we provide a function to crop images to even sizes.

dct :: Image GrayScale d -> Image GrayScale d

Perform Discrete Cosine Transform

idct :: Image GrayScale d -> Image GrayScale d

Perform Inverse Discrete Cosine Transform

data MirrorAxis

Constructors

Vertical 
Horizontal 

flip :: CreateImage (Image c d) => MirrorAxis -> Image c d -> Image c d

Mirror an image over a cardinal axis

rotate :: Double -> Image c d -> Image c d

Rotate img angle radians.

radialDistort :: Image GrayScale D32 -> Double -> Image GrayScale D32

Simulate a radial distortion over an image

scaleSingleRatio :: (RealFloat a, CreateImage (Image c D32)) => Interpolation -> a -> Image c D32 -> Image c D32

Scale image by one ratio on both of the axes

scale :: (CreateImage (Image c D32), RealFloat a) => Interpolation -> (a, a) -> Image c D32 -> Image c D32

Scale an image with different ratios for axes

scaleToSize :: CreateImage (Image c D32) => Interpolation -> Bool -> (Int, Int) -> Image c D32 -> Image c D32

Scale an image to a given size

perspectiveTransform :: Real a => Image c d -> [a] -> Image c d

Apply a perspective transform to the image. The transformation 3x3 matrix is supplied as a row ordered, flat, list.

getHomography :: [(CDouble, CDouble)] -> [(CDouble, CDouble)] -> [CDouble]

Find a homography between two sets of points in. The resulting 3x3 matrix is returned as a list.

evenize :: Image channels depth -> Image channels depth

Return a copy of an image with an even size

oddize :: Image channels depth -> Image channels depth

Return a copy of an image with an odd size

sameSizePad :: Image channels depth -> Image c d -> Image channels depth

Pad images to same size

pyrDown :: CreateImage (Image GrayScale a) => Image GrayScale a -> Image GrayScale a

Downsize image by 50% efficiently. Image dimensions must be even.

laplacianPyramid :: Int -> Image GrayScale D32 -> [Image GrayScale D32]

Calculate the laplacian pyramid of an image up to the nth level. Notice that the image size must be divisible by 2^n or opencv will abort (TODO!)

reconstructFromLaplacian :: [Image GrayScale D32] -> Image GrayScale D32

Reconstruct an image from a laplacian pyramid

enlarge :: Int -> Image GrayScale D32 -> Image GrayScale D32

Enlarge image so, that it's size is divisible by 2^n

data DistanceType

Constructors

C 
L1 
L2 

Instances

data MaskSize

Mask sizes accepted by distanceTransform

Constructors

M3 
M5 

cvDCT :: Ptr () -> Ptr () -> CInt -> IO ()

cvFlip :: Ptr () -> Ptr () -> CInt -> IO ()

cvResize :: Ptr () -> Ptr () -> CInt -> IO ()

cvPyrDown :: Ptr () -> Ptr () -> CInt -> IO ()

cvPyrUp :: Ptr () -> Ptr () -> CInt -> IO ()