https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #18 from Adam Stylinski <[hidden email]> --- I have what looks like 12,014 HaarMatrices: SELECT COUNT(*) FROM digikam.ImageHaarMatrix; 12014 I'm assuming some of these I had generated prior to updating. Hopefully OpenCV didn't modify how these things are serialized... -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #19 from Gilles Caulier <[hidden email]> --- No HaarMatrix are not generated by libkface, but by digiKam through FindDupplicates items feature. This has nothing to see with faces managament. The Faces database is Sqlite3 only located in a dedicated database file. Look API doc for details : http://api.kde.org/4.x-api/kdegraphics-apidocs/libs/libkface/libkface/html/index.html Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #20 from Gilles Caulier <[hidden email]> --- m_histograms dysfunction is certainly due to haar cascade files from OpenCV not loaded. But in this case, libkexiv2 must generate a warning in the console. Also, take a care that harr cascade XML files from openCV 3 can be different than OpenCV 2, and placed at a different place (OpenCV is a big puzzle). Perhaps the path to parse from system to find haar cascade files must be patch to support OpenCV 3. Note: haar cascades files included in libkface as well are for Windows only, as under windows, OpenCV 2 do not install these files... Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
Viktor Jancik <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94096|0 |1 is obsolete| | --- Comment #21 from Viktor Jancik <[hidden email]> --- Created attachment 94108 --> https://bugs.kde.org/attachment.cgi?id=94108&action=edit libkface-15.04.2-opencv3.patch I messed up. After better inspection, OpenCV_SHARED is a boolean variable, which is used inside the Config script as an identifier whether OpenCV was build as a shared library or static. So it has nothing to do with the shared files path. I found no other CMake variable pointing to the shared directory so I hardcoded the path for now. Both OpenCV 2.4 and OpenCV 3 put haarcascades in this folder on Fedora. It should definitely find them now. Does that fix the issue? -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #22 from Gilles Caulier <[hidden email]> --- Victor, To make whole digiKam Software collection compatible with OpenCV 3, there are 2 others parts to port : - Kipi-plugins : there are OpenCV API used in RemoveRedEyes tool (can be long to do but more simpler in all cases than libkface). - digiKam : in tests code some implementations use OpenCV API (nothing hard to do). To enable test code compilation with digiKam use -DKDE4_BUILD_TESTS=ON" cmake flag at configuration time. Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #23 from Adam Stylinski <[hidden email]> --- Welp, at 40% so far (churning on all cores) for detect and recognize option in kface plugin. Hasn't crashed yet, we'll see how this turns out. I chose the "merge" scan instead of skip (and after forcing the algorithm it retrain, building a new local database). A lot of false positives on the faces, but a lot of true ones too, so I would say that that portion is working. Given the size of my training set and the percentage threshold a specified it unsurprisingly is not trying to tag many of my images. It's tagged a few, mostly wrong but a few right, but I may be expecting way too much from a machine learning technique (having implemented a few computer vision algorithms myself, I know how finnicky they can be). I'm guessing this is the status quo with KFace (judging based on the "experimental" label on the radio button). Would I be wrong? -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #24 from Viktor Jancik <[hidden email]> --- Adam, Thank you for your help. Could I ask you for one more test? Would you try comparing the face recognition in the patched Digikam and libkface with OpenCV 3 against the original ones with OpenCV 2? That should decide how badly it's broken. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #25 from Adam Stylinski <[hidden email]> --- Detection or recognition? I think it will be hard to determine what degree of correctness either of them have for recognition considering it's a machine learning algorithm. I can give it the same faces to train on but I suspect the results won't be qualitatively different. It may need to wait until later in the week when I have some time in the evening. Is there a good way to throw out all of the tags digikam assigned during the recognition phase without manually going through each person tag and removing the tag? -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
Willy Sudiarto Raharjo <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] --- Comment #26 from Willy Sudiarto Raharjo <[hidden email]> --- Hi If OpenCV 3.0 built with IPP feature turned ON (which is by default, unless turned OFF with WITH_IPP=OFF), will cause digikam failed to build at linking process. If IPP feature are turned OFF, digikam can be compiled nicely, but it will require DIGIKAMSC_COMPILE_LIBKFACE=OFF to be set and this will make digikam loose it's face detection feature. I used Viktor's digikam-4.12.0-opencv3.patch to build digiKam in SBo repository http://slackbuilds.org/cgit/slackbuilds/commit/?h=opencv-review&id=6042dbc90c29beb20290d9a2d5cb92dc44e1480f i tried to include libkface-15.04.2-opencv3.patch as well, but it still failed to build. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
Gilles Caulier <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93709|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #27 from Willy Sudiarto Raharjo <[hidden email]> --- Here's the failure point [ 1%] Building CXX object extra/libkface/libkface/CMakeFiles/kface.dir/facedetector.cpp.o cd /tmp/SBo/digikam-4.12.0/build/extra/libkface/libkface && /usr/bin/c++ -DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=8 -DKDE_DEFAULT_DEBUG_AREA=51005 -DKDE_DEPRECATED_WARNINGS -DMAKE_KFACE_LIB -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_REENTRANT -D_XOPEN_SOURCE=500 -lMagick++-6.Q16 -lMagickWand-6.Q16 -lMagickCore-6.Q16 -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -O2 -DNDEBUG -DQT_NO_DEBUG -fPIC -I/tmp/SBo/digikam-4.12.0/build/extra/libkface/libkface -I/tmp/SBo/digikam-4.12.0/extra/libkface/libkface -I/tmp/SBo/digikam-4.12.0/extra/libkface/libkface/database -I/tmp/SBo/digikam-4.12.0/extra/libkface/libkface/detection -I/tmp/SBo/digikam-4.12.0/extra/libkface/libkface/recognition-opencv-lbph -I/tmp/SBo/digikam-4.12.0/extra/libkface/libkface/alignment-congealing -I/usr/include/KDE -I/usr/lib/qt/include/QtXmlPatterns -I/usr/lib/qt/include/QtXml -I/usr/lib/qt/include/QtWebKit -I/usr/lib/qt/include/QtUiTools -I/usr/lib/qt/include/QtTest -I/usr/lib/qt/include/QtSvg -I/usr/lib/qt/include/QtSql -I/usr/lib/qt/include/QtScriptTools -I/usr/lib/qt/include/QtScript -I/usr/lib/qt/include/QtOpenGL -I/usr/lib/qt/include/QtNetwork -I/usr/lib/qt/include/QtMultimedia -I/usr/lib/qt/include/QtHelp -I/usr/lib/qt/include/QtDesigner -I/usr/lib/qt/include/QtDeclarative -I/usr/lib/qt/include/QtDBus -I/usr/lib/qt/include/Qt3Support -I/usr/lib/qt/include/QtGui -I/usr/lib/qt/include/QtCore -I/usr/lib/qt/include/Qt -I/usr/lib/qt/mkspecs/default -I/usr/include/opencv -fexceptions -UQT_NO_EXCEPTIONS -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o CMakeFiles/kface.dir/facedetector.cpp.o -c /tmp/SBo/digikam-4.12.0/extra/libkface/libkface/facedetector.cpp In file included from /tmp/SBo/digikam-4.12.0/extra/libkface/libkface/detection/opencvfacedetector.h:40:0, from /tmp/SBo/digikam-4.12.0/extra/libkface/libkface/facedetector.cpp:29: /tmp/SBo/digikam-4.12.0/build/extra/libkface/libkface/libopencv.h:54:36: fatal error: opencv2/face/facerec.hpp: No such file or directory #include <opencv2/face/facerec.hpp> ^ compilation terminated. make[2]: *** [extra/libkface/libkface/CMakeFiles/kface.dir/facedetector.cpp.o] Error 1 make[2]: Leaving directory `/tmp/SBo/digikam-4.12.0/build' make[1]: *** [extra/libkface/libkface/CMakeFiles/kface.dir/all] Error 2 make[1]: Leaving directory `/tmp/SBo/digikam-4.12.0/build' make: *** [all] Error 2 -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #28 from Adam Stylinski <[hidden email]> --- It doesn't appear you've applied both patches. Can you paste the output of your patch command? -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #29 from Willy Sudiarto Raharjo <[hidden email]> --- cat opencv.patch libkface.patch diff -up digikam-4.12.0/core/app/utils/libopencv.h.opencv3 digikam-4.12.0/core/app/utils/libopencv.h --- digikam-4.12.0/core/app/utils/libopencv.h.opencv3 2015-08-18 15:32:24.635326685 +0200 +++ digikam-4.12.0/core/app/utils/libopencv.h 2015-08-18 16:51:00.716761209 +0200 @@ -46,17 +46,19 @@ #define OPENCV_MAKE_VERSION(major,minor,patch) (((major) << 16) | ((minor) << 8) | (patch)) #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION) -#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION >= OPENCV_MAKE_VERSION(major,minor,patch) ) +#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION < OPENCV_MAKE_VERSION(major,minor,patch) ) -#if OPENCV_TEST_VERSION(2,3,0) +#if OPENCV_TEST_VERSION(2,5,0) # include <opencv2/opencv.hpp> # include <opencv2/legacy/compat.hpp> # include <opencv/cvaux.h> +# include <opencv2/imgproc/imgproc.hpp> #else # include <opencv/cv.h> # include <opencv/cvaux.h> # include <opencv/cxcore.h> # include <opencv/highgui.h> +# include <opencv2/imgproc.hpp> #endif // Restore warnings diff -up digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp.opencv3 digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp --- digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp.opencv3 2015-08-18 17:17:24.003431310 +0200 +++ digikam-4.12.0/core/libs/database/imgqsort/imgqsort.cpp 2015-08-18 17:25:14.761703338 +0200 @@ -284,8 +284,8 @@ void ImgQSort::readImage() const mixer.startFilterDirectly(); d->image.putImageData(mixer.getTargetImage().bits()); - d->src = cvCreateMat(d->image.numPixels(), 3, CV_8UC3); // Create a matrix containing the pixel values of original image - d->src_gray = cvCreateMat(d->image.numPixels(), 1, CV_8UC1); // Create a matrix containing the pixel values of grayscaled image + d->src = Mat(d->image.numPixels(), 3, CV_8UC3); // Create a matrix containing the pixel values of original image + d->src_gray = Mat(d->image.numPixels(), 1, CV_8UC1); // Create a matrix containing the pixel values of grayscaled image if (d->imq.detectNoise) { @@ -660,7 +660,7 @@ int ImgQSort::compressiondetector() cons int countblocks = 0; int number_of_blocks = 0; int sum = 0; - vector<int> average_bottom, average_middle, average_top; + std::vector<int> average_bottom, average_middle, average_top; // Go through 8 blocks at a time horizontally // iterating through columns. @@ -797,7 +797,7 @@ int ImgQSort::compressiondetector() cons int ImgQSort::exposureamount() const { /// Separate the image in 3 places ( B, G and R ) - vector<Mat> bgr_planes; + std::vector<Mat> bgr_planes; split(d->src, bgr_planes); /// Establish the number of bins diff -up digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h.opencv3 digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h --- digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h.opencv3 2015-08-18 17:17:54.923383497 +0200 +++ digikam-4.12.0/core/libs/database/imgqsort/imgqsort.h 2015-08-18 17:27:54.225449446 +0200 @@ -25,6 +25,10 @@ #ifndef IMGQSORT_H #define IMGQSORT_H +// Global includes + +#include <vector> + // Local includes #include "dimg.h" diff -up digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp.opencv3 digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp --- digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp.opencv3 2015-08-18 16:06:08.240514617 +0200 +++ digikam-4.12.0/extra/kipi-plugins/removeredeyes/detection/locators/haarclassifier/haarclassifierlocator.cpp 2015-08-18 16:19:07.774476511 +0200 @@ -89,6 +89,13 @@ const QString HaarClassifierLocator::Pri const QString HaarClassifierLocator::Private::configClassifierEntry("Classifier"); // -------------------------------------------------------- +#if !(OPENCV_TEST_VERSION(2,5,0)) +static void cvFillImage( CvArr* mat, double color) +{ + cvSet( mat, cvColorToScalar(color, cvGetElemType(mat)), 0); +} +#endif + int HaarClassifierLocator::findPossibleEyes(double csf, int ngf, const char* classifierFile) { diff -up digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h.opencv3 digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h --- digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h.opencv3 2015-08-18 13:43:10.380772123 +0200 +++ digikam-4.12.0/extra/kipi-plugins/removeredeyes/plugin/libopencv.h 2015-08-18 14:18:27.999977347 +0200 @@ -53,12 +53,13 @@ #define OPENCV_MAKE_VERSION(major,minor,patch) (((major) << 16) | ((minor) << 8) | (patch)) #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION) -#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION >= OPENCV_MAKE_VERSION(major,minor,patch) ) +#define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION < OPENCV_MAKE_VERSION(major,minor,patch) ) -#if OPENCV_TEST_VERSION(2,3,0) +#include <opencv2/core/core_c.h> + +#if OPENCV_TEST_VERSION(2,5,0) #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui_c.h> -#include <opencv2/core/core_c.h> #include <opencv2/legacy/compat.hpp> #include <opencv/cvaux.h> #else diff -up digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt.opencv3 digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt --- digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt.opencv3 2015-08-18 15:08:31.973733608 +0200 +++ digikam-4.12.0/extra/kipi-plugins/removeredeyes/test/CMakeLists.txt 2015-08-18 15:22:40.113991709 +0200 @@ -4,7 +4,7 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -if(NOT WIN32) +if(NOT WIN32 AND (${OpenCV_VERSION} VERSION_LESS 3.0.0)) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../plugin ${CMAKE_CURRENT_SOURCE_DIR}/../libcvblobs diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e83c8b..e399a25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=${LIBKFACE_AREA_CODE_GENERAL}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) include(MacroOpenCV) -DETECT_OPENCV(2.4.9 core highgui objdetect contrib legacy imgproc) +DETECT_OPENCV(2.4.9 core highgui objdetect face legacy imgproc) include_directories(${OpenCV_INCLUDE_DIRS}) diff --git a/cmake/modules/modules_opencv/FindOpenCV.cmake b/cmake/modules/modules_opencv/FindOpenCV.cmake index 7580b32..6d3da76 100644 --- a/cmake/modules/modules_opencv/FindOpenCV.cmake +++ b/cmake/modules/modules_opencv/FindOpenCV.cmake @@ -173,7 +173,6 @@ find_library(OpenCV_ML_LIBRARY find_library(OpenCV_TRS_LIBRARY NAMES trs PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) - # # Logic selecting required libs and headers # diff --git a/libkface/detection/opencvfacedetector.cpp b/libkface/detection/opencvfacedetector.cpp index 7c420ae..28edeea 100644 --- a/libkface/detection/opencvfacedetector.cpp +++ b/libkface/detection/opencvfacedetector.cpp @@ -138,11 +138,12 @@ public: { // This is a HACK which may break any time. Work around the fact that getOriginalWindowSize() // always returns (0,0) and we need these values. +/* if (oldCascade) { return oldCascade->orig_window_size; } - +*/ return cv::Size(0, 0); } diff --git a/libkface/libopencv.h.cmake.in b/libkface/libopencv.h.cmake.in index 0a1a958..e70fc0c 100644 --- a/libkface/libopencv.h.cmake.in +++ b/libkface/libopencv.h.cmake.in @@ -51,13 +51,11 @@ #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION) #define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION >= OPENCV_MAKE_VERSION(major,minor,patch) ) -#include <opencv2/core/core.hpp> -#include <opencv2/core/internal.hpp> -#include <opencv2/contrib/contrib.hpp> +#include <opencv2/face/facerec.hpp> +#include <opencv2/core.hpp> // for old-style code #include <opencv2/opencv.hpp> -#include <opencv2/legacy/compat.hpp> #include <opencv2/highgui/highgui_c.h> #include <opencv/cvaux.h> diff --git a/libkface/recognition-opencv-lbph/facerec_borrowed.cpp b/libkface/recognition-opencv-lbph/facerec_borrowed.cpp index 935a3d0..11aee02 100644 --- a/libkface/recognition-opencv-lbph/facerec_borrowed.cpp +++ b/libkface/recognition-opencv-lbph/facerec_borrowed.cpp @@ -531,14 +531,5 @@ Ptr<LBPHFaceRecognizer> LBPHFaceRecognizer::create(int radius, int neighbors, in return ptr; } -CV_INIT_ALGORITHM(LBPHFaceRecognizer, "FaceRecognizer.LBPH-KFaceIface", - obj.info()->addParam(obj, "radius", obj.m_radius); - obj.info()->addParam(obj, "neighbors", obj.m_neighbors); - obj.info()->addParam(obj, "grid_x", obj.m_grid_x); - obj.info()->addParam(obj, "grid_y", obj.m_grid_y); - obj.info()->addParam(obj, "threshold", obj.m_threshold); - obj.info()->addParam(obj, "histograms", obj.m_histograms); // modification: Make Read/Write - obj.info()->addParam(obj, "labels", obj.m_labels); // modification: Make Read/Write - obj.info()->addParam(obj, "statistic", obj.m_statisticsMode)); // modification: Add parameter } // namespace KFaceIface diff --git a/libkface/recognition-opencv-lbph/facerec_borrowed.h b/libkface/recognition-opencv-lbph/facerec_borrowed.h index dd1ab16..22b14ac 100644 --- a/libkface/recognition-opencv-lbph/facerec_borrowed.h +++ b/libkface/recognition-opencv-lbph/facerec_borrowed.h @@ -45,7 +45,7 @@ namespace KFaceIface { -class LBPHFaceRecognizer : public cv::FaceRecognizer +class LBPHFaceRecognizer : public cv::face::FaceRecognizer { public: @@ -99,8 +99,8 @@ public: ~LBPHFaceRecognizer() {} - using cv::FaceRecognizer::save; - using cv::FaceRecognizer::load; + using cv::face::FaceRecognizer::save; + using cv::face::FaceRecognizer::load; static cv::Ptr<LBPHFaceRecognizer> create(int radius=1, int neighbors=8, int grid_x=8, int grid_y=8, double threshold = DBL_MAX, PredictionStatistics statistics = NearestNeighbor); @@ -139,13 +139,31 @@ public: /** * Getter functions. */ - int neighbors() const { return m_neighbors; } - int radius() const { return m_radius; } - int grid_x() const { return m_grid_x; } - int grid_y() const { return m_grid_y; } + int getNeighbors() const { return m_neighbors; } + void setNeighbors(int _neighbors) { m_neighbors = _neighbors; } + + int getRadius() const { return m_radius; } + void setRadius(int radius) { m_radius = radius; } + + int getGrid_x() const { return m_grid_x; } + void setGrid_x(int _grid_x) { m_grid_x = _grid_x; } + + int getGrid_y() const { return m_grid_y; } + void setGrid_y(int _grid_y) { m_grid_y = _grid_y; } + + + double getThreshold() const { return m_threshold; } + void setThreshold(double _threshold) { m_threshold = _threshold; } + + void setHistograms(std::vector<cv::Mat> _histograms) { m_histograms = _histograms; } + std::vector<cv::Mat> getHistograms() const { return m_histograms; } + + void setLabels(cv::Mat _labels) { m_labels = _labels; } + cv::Mat getLabels() const { return m_labels; } + + void setStatistic(int _statistic) { m_statisticsMode = _statistic; } + int getStatistic() const { return m_statisticsMode; } - // NOTE: Implementation done through CV_INIT_ALGORITHM macro from OpenCV. - cv::AlgorithmInfo* info() const; private: diff --git a/libkface/recognition-opencv-lbph/lbphfacemodel.cpp b/libkface/recognition-opencv-lbph/lbphfacemodel.cpp index af8c6a5..75c5863 100644 --- a/libkface/recognition-opencv-lbph/lbphfacemodel.cpp +++ b/libkface/recognition-opencv-lbph/lbphfacemodel.cpp @@ -61,7 +61,7 @@ LBPHFaceModel::LBPHFaceModel() : cv::Ptr<LBPHFaceRecognizer>(LBPHFaceRecognizer::create()), databaseId(0) { - ptr()->set("threshold", 100.0); + ptr()->setThreshold(100.0); } LBPHFaceModel::~LBPHFaceModel() @@ -70,7 +70,7 @@ LBPHFaceModel::~LBPHFaceModel() LBPHFaceRecognizer* LBPHFaceModel::ptr() { - LBPHFaceRecognizer* const ptr = cv::Ptr<LBPHFaceRecognizer>::operator KFaceIface::LBPHFaceRecognizer*(); + LBPHFaceRecognizer* const ptr = get(); if (!ptr) kWarning() << "LBPHFaceRecognizer pointer is null"; @@ -80,7 +80,7 @@ LBPHFaceRecognizer* LBPHFaceModel::ptr() const LBPHFaceRecognizer* LBPHFaceModel::ptr() const { - const LBPHFaceRecognizer* const ptr = cv::Ptr<LBPHFaceRecognizer>::operator const KFaceIface::LBPHFaceRecognizer*(); + const LBPHFaceRecognizer* const ptr = get(); if (!ptr) kWarning() << "LBPHFaceRecognizer pointer is null"; @@ -90,47 +90,47 @@ const LBPHFaceRecognizer* LBPHFaceModel::ptr() const int LBPHFaceModel::radius() const { - return ptr()->get<int>("radius"); + return ptr()->getRadius(); } void LBPHFaceModel::setRadius(int radius) { - ptr()->set("radius", radius); + ptr()->setRadius(radius); } int LBPHFaceModel::neighbors() const { - return ptr()->get<int>("neighbors"); + return ptr()->getNeighbors(); } void LBPHFaceModel::setNeighbors(int neighbors) { - ptr()->set("neighbors", neighbors); + ptr()->setNeighbors(neighbors); } int LBPHFaceModel::gridX() const { - return ptr()->get<int>("grid_x"); + return ptr()->getGrid_x(); } void LBPHFaceModel::setGridX(int grid_x) { - ptr()->set("grid_x", grid_x); + ptr()->setGrid_x(grid_x); } int LBPHFaceModel::gridY() const { - return ptr()->get<int>("grid_y"); + return ptr()->getGrid_y(); } void LBPHFaceModel::setGridY(int grid_y) { - ptr()->set("grid_y", grid_y); + ptr()->setGrid_y(grid_y); } OpenCVMatData LBPHFaceModel::histogramData(int index) const { - return OpenCVMatData(ptr()->get<std::vector<cv::Mat> >("histograms").at(index)); + return OpenCVMatData(ptr()->getHistograms().at(index)); } QList<LBPHistogramMetadata> LBPHFaceModel::histogramMetadata() const @@ -168,12 +168,12 @@ void LBPHFaceModel::setHistograms(const QList<OpenCVMatData>& histograms, const m_histogramMetadata << metadata; } - std::vector<cv::Mat> currentHistograms = ptr()->get<std::vector<cv::Mat> >("histograms"); - cv::Mat currentLabels = ptr()->get<cv::Mat>("labels"); + std::vector<cv::Mat> currentHistograms = ptr()->getHistograms(); + cv::Mat currentLabels = ptr()->getLabels(); currentHistograms.insert(currentHistograms.end(), newHistograms.begin(), newHistograms.end()); currentLabels.push_back(newLabels); - ptr()->set("histograms", currentHistograms); - ptr()->set("labels", currentLabels); + ptr()->setHistograms(currentHistograms); + ptr()->setLabels(currentLabels); /* //Most cumbersome and inefficient way through a file storage which we were forced to use if we used standard OpenCV @@ -215,7 +215,7 @@ void LBPHFaceModel::update(const std::vector<cv::Mat>& images, const std::vector // Update local information // We assume new labels are simply appended - cv::Mat currentLabels = ptr()->get<cv::Mat>("labels"); + cv::Mat currentLabels = ptr()->getLabels(); for (int i = m_histogramMetadata.size() ; i < currentLabels.rows ; i++) { -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #30 from Adam Stylinski <[hidden email]> --- Right, those are the patch files, can you give me the output from the patch command when using these patch files? If the patches applied successfully and you have all of opencv 3 installed (including the shared libs from the separate contrib repo), then it should compile without issue. My money says you are missing opencv-contrib. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #31 from Willy Sudiarto Raharjo <[hidden email]> --- here's the cmake for opencv mkdir -p build cd build cmake \ -DCMAKE_C_FLAGS="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \ -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DINSTALL_MAN_DIR=man \ -DINSTALL_DOC_DIR=doc/$PRGNAM-$VERSION \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_PRECOMPILED_HEADERS=OFF \ -DWITH_QT=ON \ -DWITH_IPP=OFF \ -DLIB_SUFFIX=$LIBDIRSUFFIX \ -DLIB_INSTALL_DIR=/usr/lib$LIBDIRSUFFIX \ .. make VERBOSE=1 make install DESTDIR=$PKG anything i miss to build opencv-contrib? -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #32 from Willy Sudiarto Raharjo <[hidden email]> --- Ohh they move it to another project : https://github.com/Itseez/opencv_contrib/ i will try to add this on top of my opencv installation and see if it works -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #33 from Willy Sudiarto Raharjo <[hidden email]> --- Hi all I have tested to build opencv_contrib as part of opencv and rebuilt digiKam along with digikam-4.12.0-opencv3.patch and libkface-15.04.2-opencv3.patch and i confirmed that the face detection is now working again Thanks to all -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
--- Comment #34 from Gilles Caulier <[hidden email]> --- Thanks for the feedback to all. I will review the patch and integrate it to next 4.14.0 release. 4.13.0 is under packaging for release time. Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
Gilles Caulier <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94088|0 |1 is obsolete| | --- Comment #35 from Gilles Caulier <[hidden email]> --- Comment on attachment 94088 --> https://bugs.kde.org/attachment.cgi?id=94088 completed patch >diff --git a/CMakeLists.txt b/CMakeLists.txt >index 4e83c8b..e399a25 100644 >--- a/CMakeLists.txt >+++ b/CMakeLists.txt >@@ -30,7 +30,7 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=${LIBKFACE_AREA_CODE_GENERAL}) > set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) > > include(MacroOpenCV) >-DETECT_OPENCV(2.4.9 core highgui objdetect contrib legacy imgproc) >+DETECT_OPENCV(2.4.9 core highgui objdetect face legacy imgproc) > > include_directories(${OpenCV_INCLUDE_DIRS}) > >diff --git a/cmake/modules/modules_opencv/FindOpenCV.cmake b/cmake/modules/modules_opencv/FindOpenCV.cmake >index 7580b32..6d3da76 100644 >--- a/cmake/modules/modules_opencv/FindOpenCV.cmake >+++ b/cmake/modules/modules_opencv/FindOpenCV.cmake >@@ -173,7 +173,6 @@ find_library(OpenCV_ML_LIBRARY > find_library(OpenCV_TRS_LIBRARY > NAMES trs > PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) >- > # > # Logic selecting required libs and headers > # >diff --git a/libkface/detection/opencvfacedetector.cpp b/libkface/detection/opencvfacedetector.cpp >index 7c420ae..28edeea 100644 >--- a/libkface/detection/opencvfacedetector.cpp >+++ b/libkface/detection/opencvfacedetector.cpp >@@ -138,11 +138,12 @@ public: > { > // This is a HACK which may break any time. Work around the fact that getOriginalWindowSize() > // always returns (0,0) and we need these values. >+/* > if (oldCascade) > { > return oldCascade->orig_window_size; > } >- >+*/ > return cv::Size(0, 0); > } > >diff --git a/libkface/libopencv.h.cmake.in b/libkface/libopencv.h.cmake.in >index 0a1a958..e70fc0c 100644 >--- a/libkface/libopencv.h.cmake.in >+++ b/libkface/libopencv.h.cmake.in >@@ -51,13 +51,11 @@ > #define OPENCV_VERSION OPENCV_MAKE_VERSION(CV_MAJOR_VERSION,CV_MINOR_VERSION,CV_SUBMINOR_VERSION) > #define OPENCV_TEST_VERSION(major,minor,patch) ( OPENCV_VERSION >= OPENCV_MAKE_VERSION(major,minor,patch) ) > >-#include <opencv2/core/core.hpp> >-#include <opencv2/core/internal.hpp> >-#include <opencv2/contrib/contrib.hpp> >+#include <opencv2/face/facerec.hpp> >+#include <opencv2/core.hpp> > > // for old-style code > #include <opencv2/opencv.hpp> >-#include <opencv2/legacy/compat.hpp> > #include <opencv2/highgui/highgui_c.h> > #include <opencv/cvaux.h> > >diff --git a/libkface/recognition-opencv-lbph/facerec_borrowed.cpp b/libkface/recognition-opencv-lbph/facerec_borrowed.cpp >index 935a3d0..11aee02 100644 >--- a/libkface/recognition-opencv-lbph/facerec_borrowed.cpp >+++ b/libkface/recognition-opencv-lbph/facerec_borrowed.cpp >@@ -531,14 +531,5 @@ Ptr<LBPHFaceRecognizer> LBPHFaceRecognizer::create(int radius, int neighbors, in > return ptr; > } > >-CV_INIT_ALGORITHM(LBPHFaceRecognizer, "FaceRecognizer.LBPH-KFaceIface", >- obj.info()->addParam(obj, "radius", obj.m_radius); >- obj.info()->addParam(obj, "neighbors", obj.m_neighbors); >- obj.info()->addParam(obj, "grid_x", obj.m_grid_x); >- obj.info()->addParam(obj, "grid_y", obj.m_grid_y); >- obj.info()->addParam(obj, "threshold", obj.m_threshold); >- obj.info()->addParam(obj, "histograms", obj.m_histograms); // modification: Make Read/Write >- obj.info()->addParam(obj, "labels", obj.m_labels); // modification: Make Read/Write >- obj.info()->addParam(obj, "statistic", obj.m_statisticsMode)); // modification: Add parameter > > } // namespace KFaceIface >diff --git a/libkface/recognition-opencv-lbph/facerec_borrowed.h b/libkface/recognition-opencv-lbph/facerec_borrowed.h >index dd1ab16..22b14ac 100644 >--- a/libkface/recognition-opencv-lbph/facerec_borrowed.h >+++ b/libkface/recognition-opencv-lbph/facerec_borrowed.h >@@ -45,7 +45,7 @@ > namespace KFaceIface > { > >-class LBPHFaceRecognizer : public cv::FaceRecognizer >+class LBPHFaceRecognizer : public cv::face::FaceRecognizer > { > public: > >@@ -99,8 +99,8 @@ public: > > ~LBPHFaceRecognizer() {} > >- using cv::FaceRecognizer::save; >- using cv::FaceRecognizer::load; >+ using cv::face::FaceRecognizer::save; >+ using cv::face::FaceRecognizer::load; > > static cv::Ptr<LBPHFaceRecognizer> create(int radius=1, int neighbors=8, int grid_x=8, int grid_y=8, double threshold = DBL_MAX, PredictionStatistics statistics = NearestNeighbor); > >@@ -139,13 +139,31 @@ public: > /** > * Getter functions. > */ >- int neighbors() const { return m_neighbors; } >- int radius() const { return m_radius; } >- int grid_x() const { return m_grid_x; } >- int grid_y() const { return m_grid_y; } >+ int getNeighbors() const { return m_neighbors; } >+ void setNeighbors(int _neighbors) { m_neighbors = _neighbors; } >+ >+ int getRadius() const { return m_radius; } >+ void setRadius(int radius) { m_radius = radius; } >+ >+ int getGrid_x() const { return m_grid_x; } >+ void setGrid_x(int _grid_x) { m_grid_x = _grid_x; } >+ >+ int getGrid_y() const { return m_grid_y; } >+ void setGrid_y(int _grid_y) { m_grid_y = _grid_y; } >+ >+ >+ double getThreshold() const { return m_threshold; } >+ void setThreshold(double _threshold) { m_threshold = _threshold; } >+ >+ void setHistograms(std::vector<cv::Mat> _histograms) { m_histograms = _histograms; } >+ std::vector<cv::Mat> getHistograms() const { return m_histograms; } >+ >+ void setLabels(cv::Mat _labels) { m_labels = _labels; } >+ cv::Mat getLabels() const { return m_labels; } >+ >+ void setStatistic(int _statistic) { m_statisticsMode = _statistic; } >+ int getStatistic() const { return m_statisticsMode; } > >- // NOTE: Implementation done through CV_INIT_ALGORITHM macro from OpenCV. >- cv::AlgorithmInfo* info() const; > > private: > >diff --git a/libkface/recognition-opencv-lbph/lbphfacemodel.cpp b/libkface/recognition-opencv-lbph/lbphfacemodel.cpp >index af8c6a5..75c5863 100644 >--- a/libkface/recognition-opencv-lbph/lbphfacemodel.cpp >+++ b/libkface/recognition-opencv-lbph/lbphfacemodel.cpp >@@ -61,7 +61,7 @@ LBPHFaceModel::LBPHFaceModel() > : cv::Ptr<LBPHFaceRecognizer>(LBPHFaceRecognizer::create()), > databaseId(0) > { >- ptr()->set("threshold", 100.0); >+ ptr()->setThreshold(100.0); > } > > LBPHFaceModel::~LBPHFaceModel() >@@ -70,7 +70,7 @@ LBPHFaceModel::~LBPHFaceModel() > > LBPHFaceRecognizer* LBPHFaceModel::ptr() > { >- LBPHFaceRecognizer* const ptr = cv::Ptr<LBPHFaceRecognizer>::operator KFaceIface::LBPHFaceRecognizer*(); >+ LBPHFaceRecognizer* const ptr = get(); > > if (!ptr) > kWarning() << "LBPHFaceRecognizer pointer is null"; >@@ -80,7 +80,7 @@ LBPHFaceRecognizer* LBPHFaceModel::ptr() > > const LBPHFaceRecognizer* LBPHFaceModel::ptr() const > { >- const LBPHFaceRecognizer* const ptr = cv::Ptr<LBPHFaceRecognizer>::operator const KFaceIface::LBPHFaceRecognizer*(); >+ const LBPHFaceRecognizer* const ptr = get(); > > if (!ptr) > kWarning() << "LBPHFaceRecognizer pointer is null"; >@@ -90,47 +90,47 @@ const LBPHFaceRecognizer* LBPHFaceModel::ptr() const > > int LBPHFaceModel::radius() const > { >- return ptr()->get<int>("radius"); >+ return ptr()->getRadius(); > } > > void LBPHFaceModel::setRadius(int radius) > { >- ptr()->set("radius", radius); >+ ptr()->setRadius(radius); > } > > int LBPHFaceModel::neighbors() const > { >- return ptr()->get<int>("neighbors"); >+ return ptr()->getNeighbors(); > } > > void LBPHFaceModel::setNeighbors(int neighbors) > { >- ptr()->set("neighbors", neighbors); >+ ptr()->setNeighbors(neighbors); > } > > int LBPHFaceModel::gridX() const > { >- return ptr()->get<int>("grid_x"); >+ return ptr()->getGrid_x(); > } > > void LBPHFaceModel::setGridX(int grid_x) > { >- ptr()->set("grid_x", grid_x); >+ ptr()->setGrid_x(grid_x); > } > > int LBPHFaceModel::gridY() const > { >- return ptr()->get<int>("grid_y"); >+ return ptr()->getGrid_y(); > } > > void LBPHFaceModel::setGridY(int grid_y) > { >- ptr()->set("grid_y", grid_y); >+ ptr()->setGrid_y(grid_y); > } > > OpenCVMatData LBPHFaceModel::histogramData(int index) const > { >- return OpenCVMatData(ptr()->get<std::vector<cv::Mat> >("histograms").at(index)); >+ return OpenCVMatData(ptr()->getHistograms().at(index)); > } > > QList<LBPHistogramMetadata> LBPHFaceModel::histogramMetadata() const >@@ -168,12 +168,12 @@ void LBPHFaceModel::setHistograms(const QList<OpenCVMatData>& histograms, const > m_histogramMetadata << metadata; > } > >- std::vector<cv::Mat> currentHistograms = ptr()->get<std::vector<cv::Mat> >("histograms"); >- cv::Mat currentLabels = ptr()->get<cv::Mat>("labels"); >+ std::vector<cv::Mat> currentHistograms = ptr()->getHistograms(); >+ cv::Mat currentLabels = ptr()->getLabels(); > currentHistograms.insert(currentHistograms.end(), newHistograms.begin(), newHistograms.end()); > currentLabels.push_back(newLabels); >- ptr()->set("histograms", currentHistograms); >- ptr()->set("labels", currentLabels); >+ ptr()->setHistograms(currentHistograms); >+ ptr()->setLabels(currentLabels); > > /* > //Most cumbersome and inefficient way through a file storage which we were forced to use if we used standard OpenCV >@@ -215,7 +215,7 @@ void LBPHFaceModel::update(const std::vector<cv::Mat>& images, const std::vector > > // Update local information > // We assume new labels are simply appended >- cv::Mat currentLabels = ptr()->get<cv::Mat>("labels"); >+ cv::Mat currentLabels = ptr()->getLabels(); > > for (int i = m_histogramMetadata.size() ; i < currentLabels.rows ; i++) > { -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by Detlef
https://bugs.kde.org/show_bug.cgi?id=349601
Gilles Caulier <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94358|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |