Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1064375 Details for
Bug 1246056
libkface: FTBFS against opencv3
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
libkface-15.04.2-opencv3.patch
libkface-15.04.2-opencv3.patch (text/plain), 10.20 KB, created by
Viktor Jancik
on 2015-08-18 16:32:35 UTC
(
hide
)
Description:
libkface-15.04.2-opencv3.patch
Filename:
MIME Type:
Creator:
Viktor Jancik
Created:
2015-08-18 16:32:35 UTC
Size:
10.20 KB
patch
obsolete
>diff -up libkface-15.04.2/CMakeLists.txt.opencv3 libkface-15.04.2/CMakeLists.txt >--- libkface-15.04.2/CMakeLists.txt.opencv3 2015-08-17 17:56:30.993545224 +0200 >+++ libkface-15.04.2/CMakeLists.txt 2015-08-17 18:20:33.845018676 +0200 >@@ -29,7 +29,7 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA > 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(3.0.0 core face highgui objdetect imgproc) > > include_directories(${OpenCV_INCLUDE_DIRS}) > >diff -up libkface-15.04.2/libkface/detection/opencvfacedetector.cpp.opencv3 libkface-15.04.2/libkface/detection/opencvfacedetector.cpp >--- libkface-15.04.2/libkface/detection/opencvfacedetector.cpp.opencv3 2015-08-17 17:55:42.914627820 +0200 >+++ libkface-15.04.2/libkface/detection/opencvfacedetector.cpp 2015-08-17 17:55:42.914627820 +0200 >@@ -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 -up libkface-15.04.2/libkface/facedetector.cpp.opencv3 libkface-15.04.2/libkface/facedetector.cpp >--- libkface-15.04.2/libkface/facedetector.cpp.opencv3 2015-08-17 17:55:42.918627813 +0200 >+++ libkface-15.04.2/libkface/facedetector.cpp 2015-08-17 17:55:42.914627820 +0200 >@@ -72,7 +72,7 @@ public: > cascadeDirs << KGlobal::dirs()->findDirs("xdgdata-apps", "../opencv/haarcascades"); > > // Last try to find OpenCV shared files, using cmake env variables. >- cascadeDirs << QString("%1/haarcascades").arg(OPENCV_ROOT_PATH); >+ cascadeDirs << QString("%1/haarcascades").arg(OPENCV_SHARED_PATH); > > kDebug() << "Try to find OpenCV Haar Cascade files in these directories: " << cascadeDirs; > >diff -up libkface-15.04.2/libkface/libopencv.h.cmake.in.opencv3 libkface-15.04.2/libkface/libopencv.h.cmake.in >--- libkface-15.04.2/libkface/libopencv.h.cmake.in.opencv3 2015-08-17 17:55:42.919627811 +0200 >+++ libkface-15.04.2/libkface/libopencv.h.cmake.in 2015-08-18 12:58:17.878796819 +0200 >@@ -27,7 +27,7 @@ > #define LIB_OPEN_CV_H > > // Used to find shared Haar Cascade files. >-#define OPENCV_ROOT_PATH "${OpenCV_DIR}" >+#define OPENCV_SHARED_PATH "${OpenCV_SHARED}" > > // Pragma directives to reduce warnings from OpenCV header files. > #if not defined(__APPLE__) && defined(__GNUC__) >@@ -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.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 -up libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.cpp.opencv3 libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.cpp >--- libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.cpp.opencv3 2015-08-17 17:55:42.918627813 +0200 >+++ libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.cpp 2015-08-17 17:55:42.918627813 +0200 >@@ -531,14 +531,5 @@ Ptr<LBPHFaceRecognizer> LBPHFaceRecogniz > 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 -up libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.h.opencv3 libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.h >--- libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.h.opencv3 2015-08-17 17:55:42.918627813 +0200 >+++ libkface-15.04.2/libkface/recognition-opencv-lbph/facerec_borrowed.h 2015-08-17 18:12:27.677869412 +0200 >@@ -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,30 @@ 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; } > >- // NOTE: Implementation done through CV_INIT_ALGORITHM macro from OpenCV. >- cv::AlgorithmInfo* info() const; >+ 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; } > > private: > >diff -up libkface-15.04.2/libkface/recognition-opencv-lbph/lbphfacemodel.cpp.opencv3 libkface-15.04.2/libkface/recognition-opencv-lbph/lbphfacemodel.cpp >--- libkface-15.04.2/libkface/recognition-opencv-lbph/lbphfacemodel.cpp.opencv3 2015-08-17 17:55:42.918627813 +0200 >+++ libkface-15.04.2/libkface/recognition-opencv-lbph/lbphfacemodel.cpp 2015-08-17 17:55:42.918627813 +0200 >@@ -61,7 +61,7 @@ LBPHFaceModel::LBPHFaceModel() > : cv::Ptr<LBPHFaceRecognizer>(LBPHFaceRecognizer::create()), > databaseId(0) > { >- ptr()->set("threshold", 100.0); >+ ptr()->setThreshold(100.0); > } > > LBPHFaceModel::~LBPHFaceModel() >@@ -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 = cv::Ptr<LBPHFaceRecognizer>::operator KFaceIface::LBPHFaceRecognizer*(); > > if (!ptr) > kWarning() << "LBPHFaceRecognizer pointer is null"; >@@ -90,47 +90,47 @@ const LBPHFaceRecognizer* LBPHFaceModel: > > 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 > 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::ve > > // 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 cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
kevin
: review+
Actions:
View
|
Diff
Attachments on
bug 1246056
: 1064375