diff --git a/openbr/plugins/gui/drawsegmentation.cpp b/openbr/plugins/gui/drawsegmentation.cpp deleted file mode 100644 index 1d63c43..0000000 --- a/openbr/plugins/gui/drawsegmentation.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright 2012 The MITRE Corporation * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include - -#include - -using namespace std; -using namespace cv; - -namespace br -{ - -/*! - * \ingroup transforms - * \brief Fill in the segmentations or draw a line between intersecting segments. - * \author Austin Blanton \cite imaus10 - */ -class DrawSegmentation : public UntrainableTransform -{ - Q_OBJECT - Q_PROPERTY(bool fillSegment READ get_fillSegment WRITE set_fillSegment RESET reset_fillSegment STORED false) - BR_PROPERTY(bool, fillSegment, true) - - void project(const Template &src, Template &dst) const - { - if (!src.file.contains("SegmentsMask") || !src.file.contains("NumSegments")) qFatal("Must supply a Contours object in the metadata to drawContours."); - Mat segments = src.file.get("SegmentsMask"); - int numSegments = src.file.get("NumSegments"); - - dst.file = src.file; - Mat drawn = fillSegment ? Mat(segments.size(), CV_8UC3, Scalar::all(0)) : src.m(); - - for (int i=1; i > contours; - Scalar color(0,255,0); - findContours(mask, contours, RETR_LIST, CHAIN_APPROX_NONE); - drawContours(drawn, contours, -1, color); - } - } - - dst.m() = drawn; - } -}; - -BR_REGISTER(Transform, DrawSegmentation) - -} // namespace br - -#include "gui/drawsegmentation.moc"