openpnp / opencv

OpenCV Java bindings packaged with native libraries, seamlessly delivered as a turn-key Maven dependency.
Other
321 stars 93 forks source link

Include opencv-contrib #83

Open cole-dda opened 1 year ago

cole-dda commented 1 year ago

compile with opencv contrib?

vonnieda commented 1 year ago

Builds scripts are here: https://github.com/openpnp/opencv/blob/develop/.github/workflows/build.yml

Pull requests are welcome!

qwelyt commented 1 year ago

Opened a pull request for this. It builds for the more common platforms. (x64 mac, linux. windows) but seems to have trouble for arm an aarch. But those seem to have had trouble even before adding contrib.

Maybe you could have a look at it @vonnieda ? Many thanks for this package btw!

Jotschi commented 1 year ago

Great work! I was also just digging into the codebase when I noticed FacemarkKazemi is also part of contrib. I'll rebase my fork with your changes if needed to to 4.6.0. I'll test contrib packages locally in the meanwhile.

One thing that put me off was the step to figure out that upstream is meant to contain the OpenCV project build. I was looking for a git submodule or build step but did not find it since it was hidden in the github actions workflow.

I assume the debian / ubuntu version of OpenCV is not build using contrib? (Haven't checked)

qwelyt commented 1 year ago

The official OpenCV does not provide the compiled contrib at all, as can be read in their readme over at https://github.com/opencv/opencv_contrib

You can't run the contrib parts without the core, so a submodule where you only get the contrib would be non-functioning.

If it is possible to get this to compile with contrib (which I should be, somehow...) then I would think it would make sense for openpnp to release two maven packages. One that only provides OpenCV, and one that provides OpenCV with contrib. Until a valid build with contrib is produced that is quite the non-issue though.

If anyone can figure out how to make opencv_contrib produce functioning windows build then please have a go at it. All the other OSes works. Just that dang windows build that has me stumped.

Jotschi commented 1 year ago

I added the needed sources to my upstream build folder and generated the jar file which contained my needed FaceMarker classes. I was able to get my OpenCV code working (Face Landmark extraction) because I have libopencv-contrib406:amd65 installed on my debian OS.

I unfortunately can't give input on the windows issue.

vonnieda commented 1 year ago

I'm consolidating other requests to include opencv-contrib here, and will point others here in the future. If this is something you'd like to see implemented, please consider submitting or sponsoring a PR to implement it.