Commit 6a7b6b64f65d195bb61dfcde842c7bac4e98839c
1 parent
d708c166
Remove aviGallery, it is outdated and inconsistent with current plans
Showing
1 changed file
with
0 additions
and
61 deletions
openbr/plugins/gallery.cpp
| @@ -269,67 +269,6 @@ class matrixGallery : public Gallery | @@ -269,67 +269,6 @@ class matrixGallery : public Gallery | ||
| 269 | BR_REGISTER(Gallery, matrixGallery) | 269 | BR_REGISTER(Gallery, matrixGallery) |
| 270 | 270 | ||
| 271 | /*! | 271 | /*! |
| 272 | - * \ingroup galleries | ||
| 273 | - * \brief Treat a video as a gallery, making a single template from each frame | ||
| 274 | - * \author Charles Otto \cite caotto | ||
| 275 | - */ | ||
| 276 | -class aviGallery : public Gallery | ||
| 277 | -{ | ||
| 278 | - Q_OBJECT | ||
| 279 | - | ||
| 280 | - TemplateList output_set; | ||
| 281 | - QScopedPointer<cv::VideoWriter> videoOut; | ||
| 282 | - | ||
| 283 | - ~aviGallery() | ||
| 284 | - { | ||
| 285 | - if (videoOut && videoOut->isOpened()) videoOut->release(); | ||
| 286 | - } | ||
| 287 | - | ||
| 288 | - TemplateList readBlock(bool * done) | ||
| 289 | - { | ||
| 290 | - std::string fname = file.name.toStdString(); | ||
| 291 | - *done = true; | ||
| 292 | - | ||
| 293 | - TemplateList output; | ||
| 294 | - if (!file.exists()) | ||
| 295 | - return output; | ||
| 296 | - | ||
| 297 | - cv::VideoCapture videoReader(file.name.toStdString()); | ||
| 298 | - | ||
| 299 | - bool open = videoReader.isOpened(); | ||
| 300 | - | ||
| 301 | - while (open) { | ||
| 302 | - cv::Mat frame; | ||
| 303 | - | ||
| 304 | - open = videoReader.read(frame); | ||
| 305 | - if (!open) break; | ||
| 306 | - output.append(Template()); | ||
| 307 | - output.back() = frame.clone(); | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - return TemplateList(); | ||
| 311 | - } | ||
| 312 | - | ||
| 313 | - void write(const Template & t) | ||
| 314 | - { | ||
| 315 | - if (videoOut.isNull() || !videoOut->isOpened()) { | ||
| 316 | - int fourcc = OpenCVUtils::getFourcc(); | ||
| 317 | - videoOut.reset(new cv::VideoWriter(qPrintable(file.name), fourcc, 30, t.m().size())); | ||
| 318 | - } | ||
| 319 | - | ||
| 320 | - if (!videoOut->isOpened()) { | ||
| 321 | - qWarning("Failed to open %s for writing\n", qPrintable(file.name)); | ||
| 322 | - return; | ||
| 323 | - } | ||
| 324 | - | ||
| 325 | - foreach(const cv::Mat & m, t) { | ||
| 326 | - videoOut->write(m); | ||
| 327 | - } | ||
| 328 | - } | ||
| 329 | -}; | ||
| 330 | -BR_REGISTER(Gallery, aviGallery) | ||
| 331 | - | ||
| 332 | -/*! | ||
| 333 | * \ingroup initializers | 272 | * \ingroup initializers |
| 334 | * \brief Initialization support for memGallery. | 273 | * \brief Initialization support for memGallery. |
| 335 | * \author Josh Klontz \cite jklontz | 274 | * \author Josh Klontz \cite jklontz |