CV- OpenCV based machine vision library

Safe HaskellSafe-Infered




This module contains functions for extracting features from connected components of black and white images as well as extracting other shape related features.


Working with connected components

selectSizedComponents :: Double -> Double -> Image GrayScale D8 -> Image GrayScale D8Source

Remove all connected components that fall outside of given size range from the image.

countBlobs :: Image GrayScale D8 -> IntSource

Count the number of connected components in the image

Working with Image moments

Note that these functions should probably go to a different module, since they deal with entire moments of entire images.

spatialMoments :: Image GrayScale D32 -> Bool -> [Double]Source

Extract raw spatial moments of the image.

centralMoments :: Image GrayScale D32 -> Bool -> [Double]Source

Extract central moments of the image. These are useful for describing the object shape for a classifier system.

normalizedCentralMoments :: Image GrayScale D32 -> Bool -> [Double]Source

Extract normalized central moments of the image.

huMoments :: Image GrayScale D32 -> Bool -> [Double]Source

Extract Hu-moments of the image. These features are rotation invariant.

Working with component contours aka. object boundaries.

This part is really old code and probably could be improved a lot.

data Contours Source

Structure that contains the opencv sequence holding the contour data.

getContours :: Image GrayScale D8 -> ContoursSource

Extract contours of connected components of the image.

contourArea :: ContourFunctionUS DoubleSource

The area of a contour.

contourPerimeter :: ContourFunctionUS DoubleSource

Get the perimeter of a contour.

contourPoints :: ContourFunctionUS [(Double, Double)]Source

Get a list of the points in the contour.

mapContours :: ContourFunctionUS a -> Contours -> [a]Source

This function maps an opencv contour calculation over all contours of the image.

contourHuMoments :: ContourFunctionUS [Double]Source

 Operation for extracting Hu-moments from a contour