Skip to content

Commit

Permalink
Fix builds for OpenCV on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jan 15, 2024
1 parent ae35a30 commit 4aab6bb
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 30 deletions.
120 changes: 90 additions & 30 deletions opencv/opencv_contrib.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -ruN opencv_contrib-4.5.1/modules/bgsegm/src/bgfg_gsoc.cpp opencv_contrib-4.5.1-patch/modules/bgsegm/src/bgfg_gsoc.cpp
--- opencv_contrib-4.5.1/modules/bgsegm/src/bgfg_gsoc.cpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/bgsegm/src/bgfg_gsoc.cpp 2020-12-30 00:01:17.605076328 +0900
diff -ruN opencv_contrib-4.9.0/modules/bgsegm/src/bgfg_gsoc.cpp opencv_contrib-4.9.0-patch/modules/bgsegm/src/bgfg_gsoc.cpp
--- opencv_contrib-4.9.0/modules/bgsegm/src/bgfg_gsoc.cpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/bgsegm/src/bgfg_gsoc.cpp 2024-01-15 13:45:47.159154834 +0900
@@ -265,7 +265,7 @@

class BackgroundModelGSOC : public BackgroundModel<BackgroundSampleGSOC> {
Expand All @@ -19,9 +19,9 @@ diff -ruN opencv_contrib-4.5.1/modules/bgsegm/src/bgfg_gsoc.cpp opencv_contrib-4

int countMatches(int i, int j, const Point3f& color, int desc, float threshold, int descThreshold, float& minDist) const {
const int end = i * stride + (j + 1) * nSamples;
diff -ruN opencv_contrib-4.5.1/modules/face/include/opencv2/face/facemarkLBF.hpp opencv_contrib-4.5.1-patch/modules/face/include/opencv2/face/facemarkLBF.hpp
--- opencv_contrib-4.5.1/modules/face/include/opencv2/face/facemarkLBF.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/face/include/opencv2/face/facemarkLBF.hpp 2020-12-30 00:01:17.606076334 +0900
diff -ruN opencv_contrib-4.9.0/modules/face/include/opencv2/face/facemarkLBF.hpp opencv_contrib-4.9.0-patch/modules/face/include/opencv2/face/facemarkLBF.hpp
--- opencv_contrib-4.9.0/modules/face/include/opencv2/face/facemarkLBF.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/face/include/opencv2/face/facemarkLBF.hpp 2024-01-15 13:45:47.159154834 +0900
@@ -93,7 +93,7 @@

};
Expand All @@ -31,9 +31,9 @@ diff -ruN opencv_contrib-4.5.1/modules/face/include/opencv2/face/facemarkLBF.hpp
public:
BBox();
~BBox();
diff -ruN opencv_contrib-4.5.1/modules/quality/include/opencv2/quality/qualitymse.hpp opencv_contrib-4.5.1-patch/modules/quality/include/opencv2/quality/qualitymse.hpp
--- opencv_contrib-4.5.1/modules/quality/include/opencv2/quality/qualitymse.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/quality/include/opencv2/quality/qualitymse.hpp 2020-12-30 00:01:17.606076334 +0900
diff -ruN opencv_contrib-4.9.0/modules/quality/include/opencv2/quality/qualitymse.hpp opencv_contrib-4.9.0-patch/modules/quality/include/opencv2/quality/qualitymse.hpp
--- opencv_contrib-4.9.0/modules/quality/include/opencv2/quality/qualitymse.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/quality/include/opencv2/quality/qualitymse.hpp 2024-01-15 13:45:47.159154834 +0900
@@ -22,7 +22,7 @@
@param cmpImgs Comparison image(s)
@returns cv::Scalar with per-channel quality values. Values range from 0 (best) to potentially max float (worst)
Expand All @@ -50,9 +50,69 @@ diff -ruN opencv_contrib-4.5.1/modules/quality/include/opencv2/quality/qualityms
-#endif
\ No newline at end of file
+#endif
diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/feature.hpp opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/feature.hpp
--- opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/feature.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/feature.hpp 2020-12-30 00:01:17.607076341 +0900
diff -ruN opencv_contrib-4.9.0/modules/quality/include/opencv2/quality/qualityssim.hpp opencv_contrib-4.9.0-patch/modules/quality/include/opencv2/quality/qualityssim.hpp
--- opencv_contrib-4.9.0/modules/quality/include/opencv2/quality/qualityssim.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/quality/include/opencv2/quality/qualityssim.hpp 2024-01-15 13:45:47.159154834 +0900
@@ -56,7 +56,7 @@
using mat_type = QualityBase::_mat_type;

mat_type
- I
+ I_1
, I_2
, mu
, mu_2
@@ -73,7 +73,7 @@
_mat_data(InputArray);

// return flag if this is empty
- bool empty() const { return I.empty() && I_2.empty() && mu.empty() && mu_2.empty() && sigma_2.empty(); }
+ bool empty() const { return I_1.empty() && I_2.empty() && mu.empty() && mu_2.empty() && sigma_2.empty(); }

// computes ssim and quality map for single frame
static std::pair<cv::Scalar, mat_type> compute(const _mat_data& lhs, const _mat_data& rhs);
@@ -94,4 +94,4 @@
}; // QualitySSIM
} // quality
} // cv
-#endif
\ No newline at end of file
+#endif
diff -ruN opencv_contrib-4.9.0/modules/quality/src/qualityssim.cpp opencv_contrib-4.9.0-patch/modules/quality/src/qualityssim.cpp
--- opencv_contrib-4.9.0/modules/quality/src/qualityssim.cpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/quality/src/qualityssim.cpp 2024-01-15 13:47:05.476309868 +0900
@@ -26,9 +26,9 @@

QualitySSIM::_mat_data::_mat_data( const _mat_type& mat )
{
- this->I = mat;
- cv::multiply(this->I, this->I, this->I_2);
- this->mu = ::blur(this->I);
+ this->I_1 = mat;
+ cv::multiply(this->I_1, this->I_1, this->I_2);
+ this->mu = ::blur(this->I_1);
cv::multiply(this->mu, this->mu, this->mu_2);
this->sigma_2 = ::blur(this->I_2); // blur the squared img, subtract blurred_squared
cv::subtract(this->sigma_2, this->mu_2, this->sigma_2);
@@ -84,7 +84,7 @@
, sigma12
;

- cv::multiply(lhs.I, rhs.I, I1_I2);
+ cv::multiply(lhs.I_1, rhs.I_1, I1_I2);
cv::multiply(lhs.mu, rhs.mu, mu1_mu2);
cv::subtract(::blur(I1_I2), mu1_mu2, sigma12);

@@ -115,4 +115,4 @@
cv::mean(t3)
, std::move(t3)
};
-} // compute
\ No newline at end of file
+} // compute
diff -ruN opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/feature.hpp opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/feature.hpp
--- opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/feature.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/feature.hpp 2024-01-15 13:45:47.160154836 +0900
@@ -103,8 +103,6 @@
(p3) = (rect).x + (rect).width - (rect).height \
+ (step) * ((rect).y + (rect).width + (rect).height);
Expand Down Expand Up @@ -143,9 +203,9 @@ diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/feature
{
public:
virtual ~CvLBPEvaluator() CV_OVERRIDE
diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp
--- opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp 2020-12-30 00:01:17.608076348 +0900
diff -ruN opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp
--- opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/onlineBoosting.hpp 2024-01-15 13:45:47.160154836 +0900
@@ -62,7 +62,7 @@
class ClassifierThreshold;
class Detector;
Expand Down Expand Up @@ -200,9 +260,9 @@ diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/onlineB
{
public:

diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp
--- opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp 2020-12-30 12:12:08.477104867 +0900
diff -ruN opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp
--- opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/tracking_by_matching.hpp 2024-01-15 13:45:47.160154836 +0900
@@ -317,6 +317,7 @@
///
class CV_EXPORTS Track {
Expand All @@ -211,9 +271,9 @@ diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/trackin
///
/// \brief Track constructor.
/// \param objs Detected objects sequence.
diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/tracking_internals.hpp opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/tracking_internals.hpp
--- opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/tracking_internals.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/tracking/include/opencv2/tracking/tracking_internals.hpp 2020-12-30 00:01:53.529319146 +0900
diff -ruN opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/tracking_internals.hpp opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/tracking_internals.hpp
--- opencv_contrib-4.9.0/modules/tracking/include/opencv2/tracking/tracking_internals.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/tracking/include/opencv2/tracking/tracking_internals.hpp 2024-01-15 13:45:47.160154836 +0900
@@ -363,7 +363,7 @@
/** @overload
@param feature The TrackerContribFeature class
Expand All @@ -232,9 +292,9 @@ diff -ruN opencv_contrib-4.5.1/modules/tracking/include/opencv2/tracking/trackin

private:
std::vector<std::pair<String, Ptr<TrackerContribSamplerAlgorithm> > > samplers;
diff -ruN opencv_contrib-4.5.1/modules/tracking/src/trackerFeatureSet.cpp opencv_contrib-4.5.1-patch/modules/tracking/src/trackerFeatureSet.cpp
--- opencv_contrib-4.5.1/modules/tracking/src/trackerFeatureSet.cpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/tracking/src/trackerFeatureSet.cpp 2020-12-30 00:04:12.670259622 +0900
diff -ruN opencv_contrib-4.9.0/modules/tracking/src/trackerFeatureSet.cpp opencv_contrib-4.9.0-patch/modules/tracking/src/trackerFeatureSet.cpp
--- opencv_contrib-4.9.0/modules/tracking/src/trackerFeatureSet.cpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/tracking/src/trackerFeatureSet.cpp 2024-01-15 13:45:47.161154838 +0900
@@ -112,7 +112,7 @@
return true;
}
Expand All @@ -244,9 +304,9 @@ diff -ruN opencv_contrib-4.5.1/modules/tracking/src/trackerFeatureSet.cpp opencv
{
if( blockAddTrackerFeature )
{
diff -ruN opencv_contrib-4.5.1/modules/tracking/src/trackerSampler.cpp opencv_contrib-4.5.1-patch/modules/tracking/src/trackerSampler.cpp
--- opencv_contrib-4.5.1/modules/tracking/src/trackerSampler.cpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/tracking/src/trackerSampler.cpp 2020-12-30 00:03:43.908065214 +0900
diff -ruN opencv_contrib-4.9.0/modules/tracking/src/trackerSampler.cpp opencv_contrib-4.9.0-patch/modules/tracking/src/trackerSampler.cpp
--- opencv_contrib-4.9.0/modules/tracking/src/trackerSampler.cpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/tracking/src/trackerSampler.cpp 2024-01-15 13:45:47.161154838 +0900
@@ -107,7 +107,7 @@
return true;
}
Expand All @@ -256,9 +316,9 @@ diff -ruN opencv_contrib-4.5.1/modules/tracking/src/trackerSampler.cpp opencv_co
{
if( blockAddTrackerSampler )
{
diff -ruN opencv_contrib-4.5.1/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp opencv_contrib-4.5.1-patch/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp
--- opencv_contrib-4.5.1/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp 2020-12-22 03:14:07.000000000 +0900
+++ opencv_contrib-4.5.1-patch/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp 2020-12-30 00:01:17.610076361 +0900
diff -ruN opencv_contrib-4.9.0/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp opencv_contrib-4.9.0-patch/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp
--- opencv_contrib-4.9.0/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp 2023-12-27 06:24:58.000000000 +0900
+++ opencv_contrib-4.9.0-patch/modules/ximgproc/include/opencv2/ximgproc/brightedges.hpp 2024-01-15 13:45:47.161154838 +0900
@@ -1,4 +1,4 @@
-/*M///////////////////////////////////////////////////////////////////////////////////////
+/*M///////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public class opencv_quality extends org.bytedeco.opencv.presets.opencv_quality {
// cv
// #endif


// Parsed from <opencv2/quality/qualitygmsd.hpp>

// This file is part of OpenCV project.
Expand Down

0 comments on commit 4aab6bb

Please sign in to comment.