diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 03e45ab..7bb77ef 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -269,67 +269,6 @@ class matrixGallery : public Gallery BR_REGISTER(Gallery, matrixGallery) /*! - * \ingroup galleries - * \brief Treat a video as a gallery, making a single template from each frame - * \author Charles Otto \cite caotto - */ -class aviGallery : public Gallery -{ - Q_OBJECT - - TemplateList output_set; - QScopedPointer videoOut; - - ~aviGallery() - { - if (videoOut && videoOut->isOpened()) videoOut->release(); - } - - TemplateList readBlock(bool * done) - { - std::string fname = file.name.toStdString(); - *done = true; - - TemplateList output; - if (!file.exists()) - return output; - - cv::VideoCapture videoReader(file.name.toStdString()); - - bool open = videoReader.isOpened(); - - while (open) { - cv::Mat frame; - - open = videoReader.read(frame); - if (!open) break; - output.append(Template()); - output.back() = frame.clone(); - } - - return TemplateList(); - } - - void write(const Template & t) - { - if (videoOut.isNull() || !videoOut->isOpened()) { - int fourcc = OpenCVUtils::getFourcc(); - videoOut.reset(new cv::VideoWriter(qPrintable(file.name), fourcc, 30, t.m().size())); - } - - if (!videoOut->isOpened()) { - qWarning("Failed to open %s for writing\n", qPrintable(file.name)); - return; - } - - foreach(const cv::Mat & m, t) { - videoOut->write(m); - } - } -}; -BR_REGISTER(Gallery, aviGallery) - -/*! * \ingroup initializers * \brief Initialization support for memGallery. * \author Josh Klontz \cite jklontz