Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Images - Segmentation - ChromaThresholdRGBC
 

  PUBLIC
ChromaThresholdRGBC::operator <<(ostream &,const ChromaThresholdRGBC &)
ChromaThresholdRGBC::operator >>(istream &,ChromaThresholdRGBC &)
ChromaThresholdRGBC::ChromaThresholdRGBC(void)
ChromaThresholdRGBC::ChromaThresholdRGBC(RealT,RealT,RealT,RealT,RealT,RealT,RealT,ByteT,ByteT,ByteT)
ChromaThresholdRGBC::ChromaThresholdRGBC(const ImageC &,RealT,RealT,ByteT,ByteT,ByteT)
ChromaThresholdRGBC::Apply(ImageC &,const ImageC &) const
ChromaThresholdRGBC::Apply(ImageC &,const ImageC &) const
ChromaThresholdRGBC::ApplyCopyAlpha(ImageC &,const ImageC &,ImageC &) const
ChromaThresholdRGBC::ApplyCopyAlpha(ImageC &,ImageC &)

   ChromaThresholdRGBC   
 
Chroma threholding
 
include "Ravl/Image/ChromaThreshold.hh"
Source file:Ravl/Image/Processing/Segmentation/ChromaThreshold.hh
User Level:Normal
Library:RavlImageProc
In Scope:RavlImageN

Comments:

This is a multi-purpose class for searching for a known colour in an rgb image. Can be used for skin colour detection, blue-screening, etc. Is intended as an easy way to try out new ideas, rather than a very efficient or accurate method.

RGB is normalised by intensity to be robust to illumination changes. The range of colours to be found are modelled as a gaussian. The (incorrect) assumption is made that normalised rgb components are independent, but this seems to work well for many applications. The gaussian can either be constructed directly, or computed from an example image containing only the required colour.

Variables:
RealT r0;

RealT g0;

RealT b0;

RealT rw;

RealT gw;

RealT bw;

RealT black_thresh;

ByteT label_match;

ByteT label_no_match;

ByteT label_black;

Methods:
ostream & operator <<(ostream & os,const ChromaThresholdRGBC & c)

istream & operator >>(istream & is,ChromaThresholdRGBC & c)

ChromaThresholdRGBC()
default constructor

ChromaThresholdRGBC(RealT nr0,RealT ng0,RealT nb0,RealT nrw = 33.33,RealT ngw = 33.33,RealT nbw = 33.33,RealT nblack_thresh = 0.1,ByteT nlabel_match = 255,ByteT nlabel_no_match = 0,ByteT nlabel_black = 0)
Construct with user-specified params of the gaussian
nr0mean red component
ng0mean green component
nb0mean blue component
nrwinverse variance of red component
ngwinverse variance of green component
nbwinverse variance of blue component
nblack_threshluminance in range (0,1] below which a pixel is considered black rather than coloured.
nlabel_matchlabel to give to pixels which match the specified colour
nlabel_no_matchlabel to give to pixels which do not match the specified colour
nlabel_blacklabel to give to black pixels (ones below nblack_thresh)
Should have nr0 + ng0 + nb0 = 1 for a valid model.

ChromaThresholdRGBC(const ImageC<ByteRGBValueC> & image,RealT tolerance = 1.0,RealT black_thresh = 0.01,ByteT nlabel_match = 255,ByteT nlabel_no_match = 0,ByteT nlabel_black = 0)
Construct from example image
imageexample image containing only the required colour
nblack_threshluminance in range (0,1] below which a pixel is considered black rather than coloured.
nlabel_matchlabel to give to pixels which match the specified colour
nlabel_no_matchlabel to give to pixels which do not match the specified colour
nlabel_blacklabel to give to black pixels (ones below nblack_thresh)

void Apply(ImageC<ByteT> & result,const ImageC<ByteRGBValueC> & image) const
perform threshold on RGB image and return binary result

void Apply(ImageC<ByteT> & result,const ImageC<ByteRGBAValueC> & image) const
perform threshold on RGB image and return binary result

void ApplyCopyAlpha(ImageC<ByteT> & result,const ImageC<ByteRGBAValueC> & image,ImageC<ByteRGBAValueC> & auximage) const
perform threshold on RGBA image, return binary result and copy results to alpha channel of aux image

void ApplyCopyAlpha(ImageC<ByteT> & result,ImageC<ByteRGBAValueC> & image)
perform threshold on RGBA image, return binary result and copy results to alpha channel of original image


Maintainer:Joel Mitchelson, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002