Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
7 changes: 7 additions & 0 deletions Formula/caffe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class Caffe < Formula
sha256 "472d4a06035497b180636d8a82667129960371375bd10fcb6df5c6c7631f25e0"
end

# Fix compilation with OpenCV 4
# https://github.com/BVLC/caffe/issues/6652
patch do
url "https://github.com/BVLC/caffe/pull/6638.diff?full_index=1"
sha256 "6a6368d715284fabfa96660b6d24d1f4f419f3e6cdddab9a7293954fee4ec2bc"
end

needs :cxx11

def install
Expand Down
3 changes: 0 additions & 3 deletions Formula/frei0r.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ class Frei0r < Formula

depends_on "autoconf" => :build
depends_on "pkg-config" => :build
depends_on "cairo" => :optional
depends_on "opencv@2" => :optional

def install
ENV["CAIRO_CFLAGS"] = "-I#{Formula["cairo"].opt_include}/cairo" if build.with? "cairo"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
Expand Down
19 changes: 7 additions & 12 deletions Formula/gmic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Gmic < Formula
homepage "https://gmic.eu/"
url "https://gmic.eu/files/source/gmic_2.1.5.tar.gz"
sha256 "2f3de90a09bba6d24c89258be016fd6992886bda13dbbcaf03de58c765774845"
revision 1
revision 2
head "https://github.com/dtschump/gmic.git"

bottle do
Expand All @@ -18,20 +18,15 @@ class Gmic < Formula
depends_on "fftw"
depends_on "jpeg"
depends_on "libpng"
depends_on "ffmpeg" => :optional
depends_on "libtiff" => :optional
depends_on "opencv@2" => :optional
depends_on "openexr" => :optional
depends_on "libtiff"

def install
cp "resources/CMakeLists.txt", buildpath
args = std_cmake_args
args << "-DENABLE_X=OFF"
args << "-DENABLE_FFMPEG=OFF" if build.without? "ffmpeg"
args << "-DENABLE_OPENCV=OFF" if build.without? "opencv"
args << "-DENABLE_OPENEXR=OFF" if build.without? "openexr"
args << "-DENABLE_TIFF=OFF" if build.without? "libtiff"
system "cmake", *args
system "cmake", *std_cmake_args,
"-DENABLE_FFMPEG=OFF",
"-DENABLE_OPENCV=OFF",
"-DENABLE_OPENEXR=OFF",
"-DENABLE_X=OFF"
system "make", "install"
end

Expand Down
1 change: 0 additions & 1 deletion Formula/gst-plugins-bad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class GstPluginsBad < Formula
depends_on "libexif" => :optional
depends_on "libnice" => :optional
depends_on "libvo-aacenc" => :optional
depends_on "opencv@2" => :optional
depends_on "rtmpdump" => :optional
depends_on "schroedinger" => :optional
depends_on "sound-touch" => :optional
Expand Down
15 changes: 8 additions & 7 deletions Formula/opencv.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class Opencv < Formula
desc "Open source computer vision library"
homepage "https://opencv.org/"
url "https://github.com/opencv/opencv/archive/3.4.5.tar.gz"
sha256 "0c57d9dd6d30cbffe68a09b03f4bebe773ee44dc8ff5cd6eaeb7f4d5ef3b428e"
revision 1
url "https://github.com/opencv/opencv/archive/4.0.1.tar.gz"
sha256 "7b86a0ee804244e0c407321f895b15e4a7162e9c5c0d2efc85f1cadec4011af4"

bottle do
sha256 "1d5b539888b6163e9e8b5e6944bafdfec126cae714a0f14dc914af6f810975dd" => :mojave
Expand All @@ -25,8 +24,8 @@ class Opencv < Formula
depends_on "tbb"

resource "contrib" do
url "https://github.com/opencv/opencv_contrib/archive/3.4.5.tar.gz"
sha256 "8f73d029887c726fed89c69a2b0fcb1d098099fcd81c1070e1af3b452669fbe2"
url "https://github.com/opencv/opencv_contrib/archive/4.0.1.tar.gz"
sha256 "0d8acbad4b7074cfaafd906a7419c23629179d5e98894714402090b192ef8237"
end

needs :cxx11
Expand Down Expand Up @@ -62,6 +61,7 @@ def install
-DBUILD_opencv_text=OFF
-DOPENCV_ENABLE_NONFREE=ON
-DOPENCV_EXTRA_MODULES_PATH=#{buildpath}/opencv_contrib/modules
-DOPENCV_GENERATE_PKGCONFIG=ON
-DWITH_1394=OFF
-DWITH_CUDA=OFF
-DWITH_EIGEN=ON
Expand Down Expand Up @@ -103,14 +103,15 @@ def install

test do
(testpath/"test.cpp").write <<~EOS
#include <opencv/cv.h>
#include <opencv2/opencv.hpp>
#include <iostream>
int main() {
std::cout << CV_VERSION << std::endl;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-o", "test"
system ENV.cxx, "-std=c++11", "test.cpp", "-I#{include}/opencv4",
"-o", "test"
assert_equal `./test`.strip, version.to_s

["python2.7", "python3"].each do |python|
Expand Down
14 changes: 9 additions & 5 deletions Formula/siril.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class Siril < Formula
homepage "https://free-astro.org/index.php/Siril"
url "https://free-astro.org/download/siril-0.9.9.tar.bz2"
sha256 "7958985393eca33b2db173090af78a46e42a7daefe7f6eaa7efa4ba261fa46f3"
revision 2
head "https://free-astro.org/svn/siril/", :using => :svn
revision 3
head "http://free-astro.org/svn/siril/", :using => :svn

bottle do
sha256 "13ab6b9ba68ed90b5d81a5f7a21d4ab046705b82e9ad77afe26d0b48f8bb76f1" => :mojave
Expand All @@ -19,7 +19,6 @@ class Siril < Formula
depends_on "cfitsio"
depends_on "ffms2"
depends_on "fftw"
depends_on "gcc" # for OpenMP
depends_on "gnuplot"
depends_on "gsl"
depends_on "gtk-mac-integration"
Expand All @@ -32,7 +31,12 @@ class Siril < Formula
depends_on "opencv"
depends_on "openjpeg"

fails_with :clang # no OpenMP support
# Upstream fix for compilation with OpenCV 4
# Remove in next version
patch do
url "https://gitlab.com/free-astro/siril/commit/c23c2cc829b2ad9444ccefeb865f7e1b3d49c282.diff"
sha256 "22e179e832c7f6a28d5f2bfb3953be477b15450df41ceeb353b77376bec7e048"
end

needs :cxx11

Expand All @@ -43,7 +47,7 @@ def install
# headers. Work around that by letting it find all includes.
ENV.append_to_cflags "-I#{HOMEBREW_PREFIX}/include"

system "./autogen.sh", "--prefix=#{prefix}", "--enable-openmp"
system "./autogen.sh", "--prefix=#{prefix}"
system "make", "install"
end

Expand Down
109 changes: 108 additions & 1 deletion Formula/visp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Visp < Formula
homepage "https://visp.inria.fr/"
url "https://gforge.inria.fr/frs/download.php/latestfile/475/visp-3.1.0.tar.gz"
sha256 "2a1df8195b06f9a057bd4c7d987697be2fdcc9d169e8d550fcf68e5d7f129d96"
revision 1
revision 2

bottle do
sha256 "86af46cedc6f6240d1e4f58f89909433936639989d3d6b35799524ddb654ff7b" => :mojave
Expand All @@ -21,7 +21,16 @@ class Visp < Formula
depends_on "opencv"
depends_on "zbar"

# Allow compilation with OpenCV 4, remove in next version
# https://github.com/lagadic/visp/issues/373
# https://github.com/lagadic/visp/commit/547041b8
patch :DATA

needs :cxx11

def install
ENV.cxx11

sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path

system "cmake", ".", "-DBUILD_DEMOS=OFF",
Expand Down Expand Up @@ -84,3 +93,101 @@ def install
assert_equal version.to_s, shell_output("./test").chomp
end
end

__END__
diff --git a/modules/core/include/visp3/core/vpImageConvert.h b/modules/core/include/visp3/core/vpImageConvert.h
index 65165748a9f6c2b2145d57247c4575dbfe96ef97..54d32b12e50d935b29656a2735d907e8212005d0 100644
--- a/modules/core/include/visp3/core/vpImageConvert.h
+++ b/modules/core/include/visp3/core/vpImageConvert.h
@@ -56,21 +56,26 @@
#include <visp3/core/vpRGBa.h>

#ifdef VISP_HAVE_OPENCV
-#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) // Require opencv >= 3.0.0
-#include <opencv2/core/core.hpp>
-#include <opencv2/highgui/highgui.hpp>
-#include <opencv2/imgproc/imgproc.hpp>
+#if (VISP_HAVE_OPENCV_VERSION >= 0x040000) // Require opencv >= 4.0.0
+# include <opencv2/imgproc/types_c.h>
+# include <opencv2/imgproc.hpp>
+# include <opencv2/imgcodecs.hpp>
+# include <opencv2/highgui.hpp>
+#elif (VISP_HAVE_OPENCV_VERSION >= 0x030000) // Require opencv >= 3.0.0
+# include <opencv2/core/core.hpp>
+# include <opencv2/highgui/highgui.hpp>
+# include <opencv2/imgproc/imgproc.hpp>
#elif (VISP_HAVE_OPENCV_VERSION >= 0x020408) // Require opencv >= 2.4.8
-#include <opencv2/core/core.hpp>
-#include <opencv2/highgui/highgui.hpp>
-#include <opencv2/imgproc/imgproc.hpp>
+# include <opencv2/core/core.hpp>
+# include <opencv2/highgui/highgui.hpp>
+# include <opencv2/imgproc/imgproc.hpp>
#elif (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1
-#include <opencv2/core/core.hpp>
-#include <opencv2/highgui/highgui.hpp>
-#include <opencv2/highgui/highgui_c.h>
-#include <opencv2/legacy/legacy.hpp>
+# include <opencv2/core/core.hpp>
+# include <opencv2/highgui/highgui.hpp>
+# include <opencv2/highgui/highgui_c.h>
+# include <opencv2/legacy/legacy.hpp>
#else
-#include <highgui.h>
+# include <highgui.h>
#endif
#endif

diff --git a/modules/vision/include/visp3/vision/vpKeyPoint.h b/modules/vision/include/visp3/vision/vpKeyPoint.h
index d269d22a0c4b2549b6df8f3cbccc8005651a4784..468241311eb87e8b12b8c261c39fc46396a0d549 100644
--- a/modules/vision/include/visp3/vision/vpKeyPoint.h
+++ b/modules/vision/include/visp3/vision/vpKeyPoint.h
@@ -57,7 +57,7 @@
#include <visp3/vision/vpBasicKeyPoint.h>
#include <visp3/vision/vpPose.h>
#ifdef VISP_HAVE_MODULE_IO
-#include <visp3/io/vpImageIo.h>
+# include <visp3/io/vpImageIo.h>
#endif
#include <visp3/core/vpConvert.h>
#include <visp3/core/vpCylinder.h>
@@ -68,20 +68,25 @@
// Require at least OpenCV >= 2.1.1
#if (VISP_HAVE_OPENCV_VERSION >= 0x020101)

-#include <opencv2/calib3d/calib3d.hpp>
-#include <opencv2/features2d/features2d.hpp>
-#include <opencv2/imgproc/imgproc.hpp>
-
-#if defined(VISP_HAVE_OPENCV_XFEATURES2D) // OpenCV >= 3.0.0
-#include <opencv2/xfeatures2d.hpp>
-#elif defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION >= 0x020400) && \
- (VISP_HAVE_OPENCV_VERSION < 0x030000)
-#include <opencv2/nonfree/nonfree.hpp>
-#endif
-
-#ifdef VISP_HAVE_XML2
-#include <libxml/xmlwriter.h>
-#endif
+# include <opencv2/calib3d/calib3d.hpp>
+# include <opencv2/features2d/features2d.hpp>
+# include <opencv2/imgproc/imgproc.hpp>
+
+# if (VISP_HAVE_OPENCV_VERSION >= 0x040000) // Require opencv >= 4.0.0
+# include <opencv2/imgproc/imgproc_c.h>
+# include <opencv2/imgproc.hpp>
+# endif
+
+# if defined(VISP_HAVE_OPENCV_XFEATURES2D) // OpenCV >= 3.0.0
+# include <opencv2/xfeatures2d.hpp>
+# elif defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION >= 0x020400) && \
+ (VISP_HAVE_OPENCV_VERSION < 0x030000)
+# include <opencv2/nonfree/nonfree.hpp>
+# endif
+
+# ifdef VISP_HAVE_XML2
+# include <libxml/xmlwriter.h>
+# endif

/*!
\class vpKeyPoint