Class List for drwnVision
- drwnColourHistogram : Specialized histogram for quantized 3-channel colour values (e.g., RGB).
- drwnFilterBankResponse : Holds the results of running an image through a bank of filters and allows for computation of features over rectangular regions.
- drwnGrabCutInstance : Implements the grabCut algorithm of Rother et al., SIGGRAPH 2004 for figure/ground segmentation.
- drwnHOGFeatures : Encapsulates histogram-of-gradient (HOG) feature computation.
- drwnImageCache : Caches images in memory up to a maximum number of images or memory limit.
- drwnImageInPainter : Performs exemplar-based image inpainting.
- drwnImagePyramidCache : Caches image pyramids in main memory up to a maximum number of images or memory limit.
- drwnMaskedPatchMatch : Implements the basic PatchMatch algorithm of Barnes et al., SIGGRAPH 2009 on masked images.
- drwnMultiSegRegionDefinitions : Provides a mechanism for mapping region IDs to colours and class names. Can be initialized from an XML configuration file or programmatically for a number of standard datasets.
- drwnMultiSegConfig : Manages configuration settings for multiple image segmentation.
- drwnMultiSegVis : Visualization routines for multi-class image segmentation.
- drwnObject : Encapsulates a 2D object in an image for object detection.
- drwnObjectList : List of objects for the same image (see drwnObject)
- drwnObjectSequence : Sequence of images, each with a list of objects (see drwnObjectList)
- drwnOpenCVUtils : Utilities for working with OpenCV.
- drwnPatchMatchEdge : Represents an edge in the drwnPatchMatchGraph.
- drwnPatchMatchGraph : Each image maintains a W-by-H-by-K array of match records referencing the (approximate) best K matches to other images. Image filename rather than the images themselves are stored. Duplicate filenames (images) are not allowed.
- drwnPatchMatchGraphLearner : Learns a PatchMatchGraph by iteratively performing search moves over the space of matches.
- drwnPatchMatchImagePyramid : Record of patch matches for mutliple levels each image.
- drwnPatchMatchImageRecord : Records matches for one level in an image pyramid.
- drwnPatchMatchNode : Represents a node in the drwnPatchMatchGraph.
- drwnPatchMatchRepaint :
- drwnPartsModel : Interface for implementing a part-based constellation model (i.e., pictorial structures model) for object detection.
- drwnPixelNeighbourContrasts : Convenience class for holding pixel contrast weights.
- drwnPixelSegCRFInference : Alpha-expansion inference for a pixel-level CRF model with unary, contrast-dependent pairwise, and custom higher-order terms.
- drwnPixelSegModel : Implements a pixel-level CRF model for multi-class image segmentation (pixel labeling).
- drwnRobustPottsCRFInference : and where 0.0 < < 0.5
- drwnSegImageInstance : Encapsulates a single instance of an image for multi-class pixel labeling problems (i.e., image segmentation).
- drwnSegImagePixelFeatures : Interface for generating per-pixel features for a drwnSegImageInstance object.
- drwnSegImageRegionFeatures : Interface for generating per-region (or per-superpixel) features for a drwnSegImageInstance object. The
superpixel
data member of the drwnSegImageInstance object must be populated.
- drwnSuperpixelContainer : Holds multiple oversegmentations for a given image.
- drwnTemplateMatcher : Utility class for computing multiple template matches.
- drwnTextonFilterBank : Implements a 17-dimensional filter bank.
- drwnVisionUtils : Computer vision utility functions (not dependent on OpenCV functions, but may use OpenCV data structures).
- drwnWeightedRobustPottsCRFInference : and where 0.0 < < 0.5, W_c = w_i
drwnVision API Examples
The following code shows an example of learning and then executing a pixel classifier based on RGB features. For more sophisticated pixel labeling see drwnSegImageInstance and drwnPixelSegModel.
cv::Mat img = cv::imread("image.png", CV_LOAD_IMAGE_COLOR);
MatrixXi labels;
for (int y = 0; y < img.rows; y++) {
for (int x = 0; x < img.cols; x++) {
if (labels(y, x) < 0) continue;
vector<double> features(3);
features[0] = img.at<Vec3b>(y, x)[0];
features[1] = img.at<Vec3b>(y, x)[1];
features[2] = img.at<Vec3b>(y, x)[2];
dataset.
append(features, labels(y, x));
}
}
DRWN_LOG_MESSAGE(
"dataset contains " << dataset.
size() <<
" training samples");
DRWN_LOG_MESSAGE(
"subsampled to " << dataset.
size() <<
" training samples");
const int nClasses = dataset.
maxTarget() + 1;
classifier.
train(dataset);
results.accumulate(dataset, &classifier);
results.printCounts();
The following code shows an example of drawing bounding boxes for a list of objects.
objects.
read(OBJECTS_FILENAME);
cv::Mat img = cv::imread(IMAGE_FILENAME, CV_LOAD_IMAGE_COLOR);
for (drwnObjectList::const_iterator it = objects.begin(); it != objects.end(); it++) {
}