Jafar
|
Class Substracter Extracts an object over an image given a filled image and an empty image. More...
Class Substracter Extracts an object over an image given a filled image and an empty image.
Filled image stands for scene image with object in and empty image stands for image of the scene without the object. It uses standard opencv morphological operators to compute a black and white mask that is then applied on the filled image to extract the object. It handles also object image storage.
Definition at line 23 of file substracter.hpp.
#include <substracter.hpp>
Public Member Functions | |
Substracter () | |
Default constructor. | |
Substracter (const jafar::image::Image &_emptyImg, const jafar::image::Image &_filledImg) | |
Constructor with empty scene image and scene with object in it . | |
void | setEmptyImg (const jafar::image::Image &img) |
the empty scene image | |
void | setFilledImg (const jafar::image::Image &img) |
the image of the scene with object[s] | |
jafar::image::Image | getMaskImg () |
jafar::image::Image | getObjectImg () |
bool | loadEmptyImg (const char *fileName) |
loads the empty scene image from a file | |
bool | loadFilledImg (const char *fileName) |
loads the image of the scene with object[s] from a file | |
void | extractObjectOnImage (const float &threshold=250) |
extracts the object from the scene applying a a good value is in [250 254] | |
void | extractObjectOnImage (const JfrImage_TypeColorSpace &cs, const float &threshold=250) |
extracts the object from the scene applying a a good value is in [250 254]. | |
void | saveObjectImg (const char *fileName, const char *imgName) |
saves the computed image of object. Just set for conveniency | |
void | convertObjectImg (const JfrImage_TypeColorSpace &cs=JfrImage_CS_GRAY) |
converts computed object image to the specified color space | |
Protected Member Functions | |
jafar::image::Image | computeDifferenceImg () |
void | computeMaskImgOnGray (const jafar::image::Image &img, const float &threshold) |
void | computeMaskImgOnColor (const jafar::image::Image &img, const float &threshold) |
void | computeObjectImg () |
Private Attributes | |
jafar::image::Image | emptyImg |
jafar::image::Image | filledImg |
jafar::image::Image | maskImg |
jafar::image::Image | objectImg |
void jafar::cutter::Substracter::extractObjectOnImage | ( | const JfrImage_TypeColorSpace & | cs, |
const float & | threshold = 250 |
||
) |
extracts the object from the scene applying a a good value is in [250 254].
Besides the computed image is converted to color space
bool jafar::cutter::Substracter::loadEmptyImg | ( | const char * | fileName | ) |
loads the empty scene image from a file
bool jafar::cutter::Substracter::loadFilledImg | ( | const char * | fileName | ) |
loads the image of the scene with object[s] from a file
Generated on Wed Oct 15 2014 00:37:33 for Jafar by doxygen 1.7.6.1 |