cv-combinators-0.1.2.2: Functional Combinators for Computer VisionSource codeContentsIndex
AI.CV.ImageProcessors
Portabilitytested on GHC only
Stabilityexperimental
MaintainerNoam Lewis <jones.noamle@gmail.com>
Description

ImageProcessors is a functional (Processor-based) interface to computer vision using OpenCV.

The Processor interface allows the primitives in this library to take care of all the allocation / deallocation of resources and other setup/teardown requirements, and to appropriately nest them when combining primitives.

Simple example:

 win = window 0        -- The number is essentially a label for the window
 cam = camera 0        -- Autodetect camera
 edge = canny 30 190 3 -- Edge detecting processor using canny operator

 test = cam >>> edge >>> win   

The last expression is a processor that captures frames from camera and displays edge-detected version in the window.

Synopsis
type ImageSink = IOSink Image
type ImageSource = IOSource () Image
type ImageProcessor = IOProcessor Image Image
type Image = PImage
camera :: Int -> ImageSource
videoFile :: String -> ImageSource
window :: Int -> ImageSink
resize :: Int -> Int -> InterpolationMethod -> ImageProcessor
dilate :: Int -> ImageProcessor
canny :: Int -> Int -> Int -> ImageProcessor
haarDetect :: String -> Double -> Int -> HaarDetectFlag -> CvSize -> IOProcessor Image [CvRect]
drawRects :: IOProcessor (Image, [CvRect]) Image
runTill :: IOProcessor () b -> (b -> IO Bool) -> IO b
runTillKeyPressed :: Show a => IOProcessor () a -> IO ()
keyPressed :: Show a => a -> IO Bool
Documentation
type ImageSink = IOSink ImageSource
type ImageSource = IOSource () ImageSource
type ImageProcessor = IOProcessor Image ImageSource
type Image = PImageSource
camera :: Int -> ImageSourceSource
A capture device, using OpenCV's HighGui lib's cvCreateCameraCapture should work with most webcames. See OpenCV's docs for information. This processor outputs the latest image from the camera at each invocation.
videoFile :: String -> ImageSourceSource
window :: Int -> ImageSinkSource
A window that displays images. Note: windows with the same index will be the same window....is this ok?
resize :: Int -> Int -> InterpolationMethod -> ImageProcessorSource
OpenCV's cvResize
dilate :: Int -> ImageProcessorSource
OpenCV's cvDilate
cannySource
:: IntThreshold 1
-> IntThreshold 2
-> IntSize
-> ImageProcessor
OpenCV's cvCanny
haarDetectSource
:: StringCascade filename (OpenCV comes with several, including ones for face detection)
-> Doublescale factor
-> Intmin neighbors
-> HaarDetectFlagflags
-> CvSizemin size
-> IOProcessor Image [CvRect]
Wrapper for OpenCV's cvHaarDetectObjects and the surrounding required things (mem storage, cascade loading, etc).
drawRects :: IOProcessor (Image, [CvRect]) ImageSource
OpenCV's cvRectangle, currently without width, color or line type control
runTill :: IOProcessor () b -> (b -> IO Bool) -> IO bSource
Runs the processor until a predicate is true, for predicates, and processors that take () as input (such as chains that start with a camera).
runTillKeyPressed :: Show a => IOProcessor () a -> IO ()Source
Name (and type) says it all.
keyPressed :: Show a => a -> IO BoolSource

Some general utility functions for use with Processors and OpenCV

Predicate for pressed keys

Produced by Haddock version 2.7.2