diff --git a/CMakeLists.txt b/CMakeLists.txt index 6724fd3..18d13fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,7 @@ set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${QT_LIBRARIES}) # Find OpenCV find_package(OpenCV REQUIRED) set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${OpenCV_LIBS}) -set(OPENCV_DEPENDENCIES calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo stitching ts video videostab) +set(OPENCV_DEPENDENCIES calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo stitching video videostab) # Enable Testing include(CppcheckTargets) diff --git a/app/openbr-gui/imageviewer.cpp b/app/openbr-gui/imageviewer.cpp index 834b1a0..a0dbe54 100644 --- a/app/openbr-gui/imageviewer.cpp +++ b/app/openbr-gui/imageviewer.cpp @@ -15,6 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include #include @@ -28,22 +29,20 @@ br::ImageViewer::ImageViewer(QWidget *parent) setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); } -void br::ImageViewer::setDefaultText(const QString &text, bool async) +void br::ImageViewer::setDefaultText(const QString &text) { defaultText = text; - updatePixmap(async); } void br::ImageViewer::setImage(const QString &file, bool async) { src = QImage(file); updatePixmap(async); - } void br::ImageViewer::setImage(const QImage &image, bool async) { - src = image; + src = image.copy(); updatePixmap(async); } @@ -61,10 +60,12 @@ void br::ImageViewer::updatePixmap(bool async) return; } - if (src.isNull()) { + QMutexLocker locker(&mutex); + if (src.isNull() || size().isNull()) { QLabel::setPixmap(QPixmap()); - setText(defaultText); + QLabel::setText(defaultText); } else { + QLabel::clear(); QLabel::setPixmap(QPixmap::fromImage(src.scaled(size(), Qt::KeepAspectRatio))); } } diff --git a/app/openbr-gui/imageviewer.h b/app/openbr-gui/imageviewer.h index f0a117b..43328bf 100644 --- a/app/openbr-gui/imageviewer.h +++ b/app/openbr-gui/imageviewer.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -33,12 +34,13 @@ namespace br class BR_EXPORT_GUI ImageViewer : public QLabel { Q_OBJECT + QMutex mutex; QString defaultText; QImage src; public: explicit ImageViewer(QWidget *parent = 0); - void setDefaultText(const QString &text, bool async = false); + void setDefaultText(const QString &text); void setImage(const QString &file, bool async = false); void setImage(const QImage &image, bool async = false); void setImage(const QPixmap &pixmap, bool async = false); diff --git a/sdk/core/core.cpp b/sdk/core/core.cpp index fa6cf6d..9da8839 100644 --- a/sdk/core/core.cpp +++ b/sdk/core/core.cpp @@ -107,11 +107,13 @@ struct AlgorithmCore FileList enroll(File input, File gallery = File()) { + FileList fileList; + try { if (gallery.isNull()) gallery = getMemoryGallery(input); QScopedPointer g(Gallery::make(gallery)); if (g.isNull()) return FileList(); - FileList fileList = g->files(); + fileList = g->files(); if (!fileList.isEmpty() && gallery.contains("cache")) return fileList; // Already enrolled @@ -165,7 +167,9 @@ struct AlgorithmCore fprintf(stderr, "\rSPEED=%.1e SIZE=%.4g FAILURES=%d/%d \n", speed, totalBytes/totalCount, failureCount, totalCount); Globals->totalSteps = 0; - + } catch (...) { + qFatal("Exception triggered during enrollment!"); + } return fileList; } @@ -183,6 +187,7 @@ struct AlgorithmCore void compare(File targetGallery, File queryGallery, File output) { + try { if (output.exists() && output.getBool("cache")) return; if (queryGallery == ".") queryGallery = targetGallery; @@ -221,6 +226,9 @@ struct AlgorithmCore const float speed = 1000 * Globals->totalSteps / Globals->startTime.elapsed() / std::max(1, abs(Globals->parallelism)); if (!Globals->quiet && (Globals->totalSteps > 1)) fprintf(stderr, "\rSPEED=%.1e \n", speed); Globals->totalSteps = 0; + } catch (...) { + qFatal("Exception triggered during comparison!"); + } } private: diff --git a/sdk/plugins/gallery.cpp b/sdk/plugins/gallery.cpp index 83b53cb..d46d388 100644 --- a/sdk/plugins/gallery.cpp +++ b/sdk/plugins/gallery.cpp @@ -62,6 +62,7 @@ class galGallery : public Gallery while ((templates.size() < Globals->blockSize) && !stream.atEnd()) { Template m; stream >> m; + //qWarning("?? %s\n", qPrintable(m.file.name)); templates.append(m); } @@ -71,6 +72,7 @@ class galGallery : public Gallery void write(const Template &t) { + //qWarning("$$ %s\n", qPrintable(t.file.name)); stream << t; } }; diff --git a/share/openbr/cmake/InstallDependencies.cmake b/share/openbr/cmake/InstallDependencies.cmake index 4d260c3..44a1dbc 100644 --- a/share/openbr/cmake/InstallDependencies.cmake +++ b/share/openbr/cmake/InstallDependencies.cmake @@ -71,7 +71,7 @@ function(install_compiler_libraries) set(MINGW_DIR "MINGW_DIR-NOTFOUND" CACHE PATH "MinGW Path") get_filename_component(MINGW_DIR ${CMAKE_CXX_COMPILER} PATH) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - install(FILES ${MINGW_DIR}/libgcc_s_sjlj-1.dll DESTINATION bin) + install(FILES ${MINGW_DIR}/libgcc_s_sjlj-1.dll ${MINGW_DIR}/libstdc++-6.dll DESTINATION bin) else() install(FILES ${MINGW_DIR}/libgcc_s_dw2-1.dll ${MINGW_DIR}/libstdc++-6.dll DESTINATION bin) endif() diff --git a/share/openbr/models b/share/openbr/models index 5bfe098..b560a33 160000 --- a/share/openbr/models +++ b/share/openbr/models @@ -1 +1 @@ -Subproject commit 5bfe0988716f6e7b926910d74f9696f002cdbfb6 +Subproject commit b560a337e5b47770234d4ab554c563b5043e3595