Safe Haskell | None |
---|
Various image transformations from opencv and other sources.
- takeEvenSized :: Image c d -> Image c d
- dct :: Image GrayScale d -> Image GrayScale d
- idct :: Image GrayScale d -> Image GrayScale d
- data MirrorAxis
- = Vertical
- | Horizontal
- flip :: CreateImage (Image c d) => MirrorAxis -> Image c d -> Image c d
- rotate :: Double -> Image c d -> Image c d
- data Interpolation
- = NearestNeighbour
- | Linear
- | Area
- | Cubic
- radialDistort :: Image GrayScale D32 -> Double -> Image GrayScale D32
- scaleSingleRatio :: (RealFloat a, CreateImage (Image c D32)) => Interpolation -> a -> Image c D32 -> Image c D32
- scale :: (CreateImage (Image c D32), RealFloat a) => Interpolation -> (a, a) -> Image c D32 -> Image c D32
- scaleToSize :: CreateImage (Image c D32) => Interpolation -> Bool -> (Int, Int) -> Image c D32 -> Image c D32
- perspectiveTransform :: Real a => Image c d -> [a] -> Image c d
- perspectiveTransform' :: CreateImage (Image c d) => Matrix Float -> Image c d -> (Int, Int) -> Image c d
- getHomography :: Real a => [(a, a)] -> [(a, a)] -> [CDouble]
- data HomographyMethod
- getHomography' :: Matrix Float -> Matrix Float -> HomographyMethod -> Float -> Matrix Float
- evenize :: Image channels depth -> Image channels depth
- oddize :: Image channels depth -> Image channels depth
- sameSizePad :: Image channels depth -> Image c d -> Image channels depth
- cv_Gaussian :: CInt
- pyrDown :: CreateImage (Image GrayScale a) => Image GrayScale a -> Image GrayScale a
- pyrUp :: CreateImage (Image GrayScale a) => Image GrayScale a -> Image GrayScale a
- safePyrDown :: CreateImage (Image GrayScale depth) => Image GrayScale depth -> Image GrayScale depth
- minEnlarge :: Image GrayScale D32 -> Image GrayScale D32
- gaussianPyramid :: Image GrayScale D32 -> [Image GrayScale D32]
- laplacianPyramid :: Int -> Image GrayScale D32 -> [Image GrayScale D32]
- reconstructFromLaplacian :: [Image GrayScale D32] -> Image GrayScale D32
- enlarge :: Int -> Image GrayScale D32 -> Image GrayScale D32
- enlargeShadow :: Int -> Image GrayScale D32 -> Image GrayScale D32
- data DistanceType
- data MaskSize
- distanceTransform :: DistanceType -> MaskSize -> Image GrayScale D8 -> Image GrayScale D32
- cvDCT :: Ptr () -> Ptr () -> CInt -> IO ()
- cvFlip :: Ptr () -> Ptr () -> CInt -> IO ()
- rotateImage :: Ptr BareImage -> CDouble -> CDouble -> IO (Ptr BareImage)
- radialRemap :: Ptr BareImage -> Ptr BareImage -> CDouble -> IO ()
- cvResize :: Ptr () -> Ptr () -> CInt -> IO ()
- wrapPerspective :: Ptr BareImage -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> IO (Ptr BareImage)
- wrapWarpPerspective :: Ptr () -> Ptr () -> Ptr () -> IO ()
- findHomography :: Ptr CDouble -> Ptr CDouble -> CInt -> Ptr CDouble -> IO ()
- cvFindHomography :: Ptr () -> Ptr () -> Ptr () -> CInt -> CDouble -> Ptr () -> IO CInt
- makeEvenUp :: Ptr BareImage -> IO (Ptr BareImage)
- padUp :: Ptr BareImage -> CInt -> CInt -> IO (Ptr BareImage)
- cvPyrDown :: Ptr () -> Ptr () -> CInt -> IO ()
- cvPyrUp :: Ptr () -> Ptr () -> CInt -> IO ()
- blitShadow :: Ptr BareImage -> Ptr BareImage -> IO ()
- cvDistTransform :: Ptr () -> Ptr () -> CInt -> CInt -> Ptr CFloat -> Ptr () -> IO ()
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.
flip :: CreateImage (Image c d) => MirrorAxis -> Image c d -> Image c dSource
Mirror an image over a cardinal axis
data Interpolation Source
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.
perspectiveTransform' :: CreateImage (Image c d) => Matrix Float -> Image c d -> (Int, Int) -> Image c dSource
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.
getHomography' :: Matrix Float -> Matrix Float -> HomographyMethod -> Float -> Matrix FloatSource
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.
safePyrDown :: CreateImage (Image GrayScale depth) => Image GrayScale depth -> Image GrayScale depthSource
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.
Mask sizes accepted by distanceTransform
distanceTransform :: DistanceType -> MaskSize -> Image GrayScale D8 -> Image GrayScale D32Source