13 #include <opencv2/core.hpp> 
   14 #include <opencv2/imgcodecs.hpp> 
   15 #include <opencv2/imgproc.hpp> 
   17 #include <boost/archive/iterators/base64_from_binary.hpp> 
   18 #include <boost/archive/iterators/binary_from_base64.hpp> 
   19 #include <boost/archive/iterators/transform_width.hpp> 
   20 #include <boost/archive/iterators/insert_linebreaks.hpp> 
   21 #include <boost/archive/iterators/remove_whitespace.hpp> 
   23 #include "pybind11_opencv_numpy/pybind11/pybind11.h" 
   24 #include "pybind11_opencv_numpy/pybind11/stl.h" 
   25 #include "pybind11_opencv_numpy/ndarray_converter.h" 
   27 #include "jsoncpp/json/json.h" 
   44 typedef boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<boost::archive::iterators::remove_whitespace<std::string::const_iterator> > ,8,6> it_binary_t;
 
   45 typedef boost::archive::iterators::insert_linebreaks<boost::archive::iterators::base64_from_binary<boost::archive::iterators::transform_width<std::string::const_iterator,6,8> >, 72 > it_base64_t;
 
   65     void setPolygon(std::vector<cv::Point> new_polygon);
 
   70     void setName(std::string new_name);
 
   98     std::vector<cv::Point> polygon;
 
  122     void loadFile(std::string filename);
 
  151     cv::Vec3b getRandomColor();
 
  152     cv::Mat createLabelImage();
 
  153     cv::Mat createRGBImage(Json::Value img_data);
 
  155     std::vector<LabeledObject> obj_vector;
 
  157     cv::Mat label_overlay;
 
  159     std::vector<classColor> class_info;
 
  160     std::map<std::string,cv::Vec3b> class_map;
 
  163 #endif // LABELFILE_H 
The LabelFile class allows an interface to read and process CSAIL/LabelMe style label (...
 
std::vector< classColor > getClassInfo()
Get vector of class name and color associations. 
 
cv::Vec3b getColor()
Gets color of LabeledObject. 
 
The LabeledObject class represents one labeled object in an image with all the necessary information ...
 
void setColor(cv::Vec3b new_color)
Sets color of object for label image. 
 
void loadFile(std::string filename)
Load file on disk into LabelFile instance. 
 
void setPolygon(std::vector< cv::Point > new_polygon)
Sets the object defining polygon to a new set of points. 
 
void setName(std::string new_name)
Sets name of object. 
 
cv::Mat getViewingImage()
Get image showing RGB scene with class information overlaid in semi-transparent color. Designed for human viewing, not computer analysis. 
 
std::pair< cv::Vec3b, std::string > colorClass
The colorClass typedef creates a simple interface that is reversed from classColor, for ease of use in creating Python dict() types relating a color to a class. 
 
LabelFile()
Default constructor for LabelFile. 
 
std::string getName()
Gets name of LabeledObject. 
 
std::pair< std::string, cv::Vec3b > classColor
The classColor typedef creates a simple interface for pairing a class name with a specific OpenCV col...
 
cv::Mat getLabelImage()
Get image showing class colors and contours for whole label file. 
 
cv::Mat getRGBImage()
Get RGB image of original scene the labels were generated from. 
 
LabeledObject()
Default Constructor for LabeledObject. 
 
std::vector< cv::Point > getPolygon()
Gets shape polygon of LabeledObject. 
 
std::vector< colorClass > getColorInfo()
Get vector of colorClass objects made from name and color associations. 
 
classColor getInfo()
Gets class and name association info.