Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Member Functions | Private Attributes
jafar::cutter::Grabber Class Reference

Class Grabber This class operates on an image and extracts the region of interest on either a clear or a dark region. More...


Detailed Description

Class Grabber This class operates on an image and extracts the region of interest on either a clear or a dark region.

The only assumptions are: the object lies in this region and it is the largest inner region i.e. the image is focused on the object.

Definition at line 29 of file grabber.hpp.

#include <grabber.hpp>

List of all members.

Public Types

enum  surface_type { DARK, LIGHT }
 tells if background of interest is rather dark or light

Public Member Functions

 Grabber (const image::Image &image, surface_type surface=LIGHT)
 constructor that takes an image
 Grabber (const std::string &imageFile, surface_type surface=LIGHT)
 constructor that takes the image file name
void run ()
 finds contours of interest then runs grab cut algo on source image
const image::Imagesource () const
const image::Imageresult () const
void writeImages (const std::string &srcFileName="source.png", const std::string &objFileName="result.png")
 writes both images (source and segmented) into files.
const cv::Rect & backgroundBorders () const
const cv::Rect & objectBorders () const

Private Member Functions

void findContoursOfInterest ()
 finds the contours of the background and plausible object
void grab ()
 apply grabcut algo on the image

Private Attributes

jafar::image::Image m_image
jafar::image::Image m_result
std::multimap< unsigned int, int > boxes
cv::Rect largest
cv::Rect plausible
surface_type m_surface
 type of the surface

Member Function Documentation

const cv::Rect& jafar::cutter::Grabber::backgroundBorders ( ) const
Returns:
the background borders
const cv::Rect& jafar::cutter::Grabber::objectBorders ( ) const
Returns:
the object borders
Returns:
segmented image
Returns:
source image
void jafar::cutter::Grabber::writeImages ( const std::string &  srcFileName = "source.png",
const std::string &  objFileName = "result.png" 
)

writes both images (source and segmented) into files.

It is a dummy solution to avoid headache in scripting.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:33 for Jafar by doxygen 1.7.6.1
LAAS-CNRS