From 9d711fd659971aadba596f9bb078dad79382f1fa Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Fri, 21 Feb 2014 12:44:17 -0500 Subject: [PATCH] Add documentation to WatershedSegmentation --- openbr/plugins/segmentation.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openbr/plugins/segmentation.cpp b/openbr/plugins/segmentation.cpp index cdd6f0a..f11532b 100644 --- a/openbr/plugins/segmentation.cpp +++ b/openbr/plugins/segmentation.cpp @@ -7,7 +7,12 @@ using namespace cv; namespace br { -class SegmentationTransform : public UntrainableTransform +/*! + * \ingroup transforms + * \brief Applies watershed segmentation. + * \author Austin Blanton \cite imaus10 + */ +class WatershedSegmentationTransform : public UntrainableTransform { Q_OBJECT void project(const Template &src, Template &dst) const @@ -27,8 +32,7 @@ class SegmentationTransform : public UntrainableTransform findContours(mod, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE); // draw the contour delineations as 1,2,3... for input to watershed - Mat markers(mod.size(), CV_32S); - Scalar::all(0); + Mat markers = Mat::zeros(mod.size(), CV_32S); int compCount=0; for (int idx=0; idx>=0; idx=hierarchy[idx][0], compCount++) { drawContours(markers, contours, idx, Scalar::all(compCount+1), -1, 8, hierarchy, INT_MAX); @@ -42,7 +46,7 @@ class SegmentationTransform : public UntrainableTransform dst.file.set("NumSegments", compCount); } }; -BR_REGISTER(Transform, SegmentationTransform) +BR_REGISTER(Transform, WatershedSegmentationTransform) } // namespace br -- libgit2 0.21.4