CV-0.3.7: OpenCV based machine vision library

Safe HaskellNone

CV.Transforms

Description

Various image transformations from opencv and other sources.

Synopsis

Documentation

takeEvenSized :: Image c d -> Image c dSource

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 dSource

Perform Discrete Cosine Transform

idct :: Image GrayScale d -> Image GrayScale dSource

Perform Inverse Discrete Cosine Transform

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

Mirror an image over a cardinal axis

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

Rotate img angle radians.

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

Simulate a radial distortion over an image

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

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 D32Source

Scale an image with different ratios for axes

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

Scale an image to a given size

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

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

getHomography :: Real a => [(a, a)] -> [(a, a)] -> [CDouble]Source

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

evenize :: Image channels depth -> Image channels depthSource

Return a copy of an image with an even size

oddize :: Image channels depth -> Image channels depthSource

Return a copy of an image with an odd size

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

Pad images to same size

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

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

minEnlarge :: Image GrayScale D32 -> Image GrayScale D32Source

Enlargen the image so that its size is a power of two.

gaussianPyramid :: Image GrayScale D32 -> [Image GrayScale D32]Source

Calculate an infinite gaussian pyramid of an image while keeping track of various corner cases and gotchas.

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

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 D32Source

Reconstruct an image from a laplacian pyramid

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

Enlargen the image so that its size is divisible by 2^n. Fill the area outside the image with black.

enlargeShadow :: Int -> Image GrayScale D32 -> Image GrayScale D32Source

 Enlargen the image so that its size is is divisible by 2^n. Replicate the border of the image.

data DistanceType Source

Constructors

C 
L1 
L2 

Instances

data MaskSize Source

Mask sizes accepted by distanceTransform

Constructors

M3 
M5 

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

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

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

wrapWarpPerspective :: Ptr () -> Ptr () -> Ptr () -> IO ()Source

cvFindHomography :: Ptr () -> Ptr () -> Ptr () -> CInt -> CDouble -> Ptr () -> IO CIntSource

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

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

cvDistTransform :: Ptr () -> Ptr () -> CInt -> CInt -> Ptr CFloat -> Ptr () -> IO ()Source