CV-0.3.6.0: OpenCV based machine vision library

Safe HaskellSafe-Infered

CV.Matrix

Description

This module provides wrappers for CvMat type. This is still preliminary as the type of the matrix isn't coded in the haskell type.

Synopsis

Documentation

emptyMatrix :: Exists (Matrix a) => Args (Matrix a) -> Matrix aSource

Create an empty matrix of given dimensions

fromFunction :: (Storable t, Exists (Matrix t), Args (Matrix t) ~ (Int, Int)) => (Int, Int) -> ((Int, Int) -> t) -> Matrix tSource

Generate a matrix from a index function

fromList :: forall t. (Storable t, Exists (Matrix t), Args (Matrix t) ~ (Int, Int)) => (Int, Int) -> [t] -> Matrix tSource

toList :: Storable a => Matrix a -> [a]Source

 Convert a matrix to flat list (row major order)

toRows :: forall t. Storable t => Matrix t -> [[t]]Source

Convert matrix to rows represented as nested lists

toCols :: forall t. Storable t => Matrix t -> [[t]]Source

Convert matrix to cols represented as nested lists

get :: forall t. Storable t => Matrix t -> Int -> Int -> IO tSource

 Get an element of the matrix

put :: forall t. Storable t => Matrix t -> Int -> Int -> t -> IO ()Source

 Write an element to a matrix

withMatPtr :: Matrix x -> (Ptr C'CvMat -> IO a) -> IO aSource

transpose :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix aSource

Transpose a matrix. Does not do complex conjugation for complex matrices

mxm :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix a -> Matrix aSource

 Ordinary matrix multiplication

rodrigues2 :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix aSource

Convert a rotation vector to a rotation matrix (1x3 -> 3x3)

identity :: (Num a, Sized (Matrix a), Args (Matrix a) ~ (Int, Int), Size (Matrix a) ~ (Int, Int), Storable a, Exists (Matrix a)) => Matrix a -> Matrix aSource

 Create an identity matrix