Opened 12 years ago

Closed 3 years ago

#32528 closed enhancement (fixed)

opencv @2.3.1a fixes and improvements: eigen, ffmpeg, docs, opengl, python, shared+static, tbb

Reported by: marin.saric@… Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: haspatch Cc: marin@…, raphael-st (Raphael Straub), chrstphrchvz (Christopher Chavez)
Port: opencv

Description

I probably left something out, but here's a list of fixes I can come up with right now:

Fixes:

  • Fix FFmpeg dependencies: (a hidden dependency on orc)
  • Fix FFmpeg dependencies: rely on ffmpeg port to find the dependent ports
  • Fix the search for Thread Building Blocks: rely on proper CMake prefix instead of hardcoding the TBB path
  • Python: Python is run during CMake, make sure the correct version of Python is run
  • Python: Interfaces never built if the right version of numpy was not present. Fixed.
  • Remove hardcoding the MacPorts Python path through reinplace, use the already available cache variables instead
  • The C/C++ sample code was built: sample code executable only install on Win32
  • The C/C++ sample code never made it into destroot
  • Fix uppercase/lowercase differences in path componets (breaks on non-HFS volumes): ${prefix}/opencv and ${prefix}/OpenCV both used for path. Use OpenCV (per CMake guidelines)
  • Find the right version of Sphinx based on the version of python installed (build-sphinx-python.ver)
  • The Python code never made it into destroot
  • The build_all.sh script to run/compile example code did not recognize cpp files if listed as a paramter
  • The build_all.sh script worked incorrectly if a directory contained zero c files or zero cpp files
  • The build_all.sh script wasn't present in the cpp directory
  • The sample code permissions were wronged (read-only for user, build_all.sh not executable)
  • The documentation was never installed
  • Remove hardcoding linker flags such as "-lbz2", etc. Rely on CMake to do the right thing
  • Remove JPEG2000 during static build (due to a collision with OpenJPEG used by FFmpeg)

Enhancements:

  • Link against Eigen2/Eigen3
  • Build both the dynamic and static versions of OpenCV
  • Allow the user to strip down OpenCV by removing dependencies on ffmpeg, tbb, eigen, etc. etc. through more variants
  • Enable OpenGL extensions if QT4 is on.

Tested with and without QT4, with and without full docs, with and without tbb in static and dynamic builds, c, c++ and python sample code run, tested building full docs.

Attachments (8)

Portfile-opencv.diff (14.7 KB) - added by marin.saric@… 12 years ago.
OpenCV 2.3.1a fixed Portfile
patch-CMakeLists.txt.diff (3.1 KB) - added by marin.saric@… 12 years ago.
patch-modules_highgui_CMakeLists.txt.diff (526 bytes) - added by marin.saric@… 12 years ago.
patch-OpenCVConfig.cmake.in.diff (1.5 KB) - added by marin.saric@… 12 years ago.
patch-samples_c_build_all.sh.diff (1.1 KB) - added by marin.saric@… 12 years ago.
patch-samples_c_CMakeLists.txt.diff (1020 bytes) - added by marin.saric@… 12 years ago.
patch-samples_CMakeLists.txt.diff (672 bytes) - added by marin.saric@… 12 years ago.
patch-samples_cpp_CMakeLists.txt.diff (562 bytes) - added by marin.saric@… 12 years ago.

Download all attachments as: .zip

Change History (18)

Changed 12 years ago by marin.saric@…

Attachment: Portfile-opencv.diff added

OpenCV 2.3.1a fixed Portfile

Changed 12 years ago by marin.saric@…

Attachment: patch-CMakeLists.txt.diff added

Changed 12 years ago by marin.saric@…

Changed 12 years ago by marin.saric@…

Changed 12 years ago by marin.saric@…

Changed 12 years ago by marin.saric@…

Changed 12 years ago by marin.saric@…

Changed 12 years ago by marin.saric@…

comment:1 Changed 12 years ago by raphael-st (Raphael Straub)

Sorry, I just saw your improvements to OpenCV after updating it to version 2.4.0 in r93038. I think that I addressed only some of your fixes and enhancements. Do you still want to take maintainership for OpenCV and could you provide patches for the new version?

comment:2 Changed 12 years ago by raphael-st (Raphael Straub)

Cc: raphael@… added

Cc Me!

comment:3 Changed 12 years ago by marin@…

Owner: changed from macports-tickets@… to marin@…
Status: newassigned

comment:4 Changed 12 years ago by marin@…

I'll try to merge these changes with 2.4.0. I'll need to re-verify everything and validate building all the variants. Its just sad for this port to hang around with nomaintainer, I'd love to share maintenance with someone else or even hand it over..

comment:5 in reply to:  4 Changed 12 years ago by raphael-st (Raphael Straub)

Replying to marin@…:

I'll try to merge these changes with 2.4.0. I'll need to re-verify everything and validate building all the variants.

I think, it would be better to strip down the number of variants. The only variants I would keep would be qt4, doc (because of the texlive dependencies) and the python variants. I don't know if building static libraries is really useful. A port with fewer variants would be much shorter and easier to maintain.

Its just sad for this port to hang around with nomaintainer, I'd love to share maintenance with someone else or even hand it over..

You can add me as co-maintainer and make the port openmaintainer.

comment:6 Changed 11 years ago by jmroot (Joshua Root)

Cc: marin@… added
Owner: changed from marin@… to stromnov@…
Status: assignednew

comment:7 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

opencv has since been updated to 3.4.8. Are any of these improvements applicable, or should this ticket just be closed?

comment:8 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:9 Changed 3 years ago by mascguy (Christopher Nielsen)

Numerous folks have contributed changes over the past 5+ years, covering many of the items mentioned.

Some further additions are pending, via pull request:

https://github.com/macports/macports-ports/pull/9555

One item that will likely not be implemented, though, is support for static libraries. The reasons have been discussed at length on the mailing lists.

comment:10 Changed 3 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: newclosed

In ca9ffa681f453399942385f9ef34cf1c124b6ea4/macports-ports (master):

opencv/opencv4: eliminate conflicts, improve consistency, add variants; update gerbil and py-pytorch for opencv4 changes

opencv: eliminate conflict with opencv4; add variants debug, nonfree, tests
opencv4: eliminate conflict with opencv; switch to shared libs; rename variant opencv_contrib to contrib, to match opencv; add variants debug, java, python35..39, qt4, qt5, tbb, tests, vtk
gerbil: update for opencv4 library move
py-pytorch: update for opencv4 library move

Fixes: #61912
Fixes: #61801
Fixes: #60118
Fixes: #58845
Fixes: #57640
Fixes: #51734
Fixes: #48218
Fixes: #32528

Note: See TracTickets for help on using tickets.