Image segementation
Isis software documentation
Image segmentation
This library contains image segmentation routines, including chromakey
and several background difference algorithms. Images are handled
using the image buffer
protocol, which you should read about before using these
procedures.
Chromakey
(image-init-chromakey newkey-flag inbuf) # initialize chroma key
(image-chromakey inbuf outkeybuf outabuf) # chromakey image
Before this chromakey algorithm may be used, you must initialize it to
recognize certain blue values as being part of the background.
image-init-chromakey takes 2 arguments: a boolean
(newkey-flag) and an image buffer containing the background
blue. If this is the start of a new chromakey initialization, pass
True for the boolean, otherwise the buffer will be added to
the current initialization. The keying channel must be in the 3rd
channel of the buffer. The return value is the same buffer passed.
Once initialized, call image-chromakey with 3 arguments.
inbuf is a three-channel buffer with the original image (the
third channel--usually blue--must be the keying channel).
outkeybuf is a one-channel buffer that will hold the modified
third channel after chromkeying. This buffer must be different from
the original third channel buffer. outabuf should be a
one-channel buffer that will hold the result of the chromakey
(commonly called the alpha channel). The return value is the same
thing passed for outabuf.
Simple background difference
(image-segment-foreground fgbuf bgbuf abuf alphamap)
(image-segment-foreground-yuv fgbuf bgbuf abuf alphamap) # bufs are YUV format
Documentation forthcoming. Please contact Stefan for information.
Complex background difference
(image-bkseg-alloc-segmaps dims)
(image-bkseg-init-segmaps bgbuf luma-plus luma-minus
chroma-u chroma-v chroma-core segmaps)
(image-bkseg fgbuf bgbuf segmaps abuf)
Documentation forthcoming. Please contact Stefan for information.
Requirements:
Scripts:
| (load "image-segementation.isis")
|
Libraries:
| -lisis_seg
|
Headers:
| isis_seg.h
|
Binders:
| bind_seg_library(script);
|
Thanks to John Watlington for his contributions to this library.