OpenCV bindings for Julia in Windows

Has anyone tried creating OpenCV bindings for Julia on Windows?

I’m using the latest Julia version 1.6.3 for Windows.
I can add the OpenCV package to Julia without error:
Pkg.add(“OpenCV”)
and can correctly read an image from disk:
img = OpenCV.imread(“c:/myimg.jpg”)
but I cannot write the image back to the disk (no matching method… error):
OpenCV.imwrite(“c:/myimg2.jpg”, img)
OpenCV.imshow(“mywnd”, img) crashes at Julia
OpenCV.waitKey(Int32(27)) returns -1 result immediately

you could try to run the tests
if they fail, you have material for an official issue

OpenCV.waitKey(Int32(27)) returns -1 result immediately

the argument there is the ‘time to wait’ ,
not the ‘key to wait for’ (it returns the key, if any was pressed at all).
maybe you confused this ?
-1 is ok, if no key was pressed

You are partly correct, waitKey needs time but it cannot be interrupted while it’s waiting.
imwrite and imshow don’t work.
Tests are without test data (only code) :frowning:

Do you know if OpenCV bindings for Julia is with/without Intel IPP?

i have no idea, but you could look it up from cv.getBuildInformation() or the cmake output (if you still have it)

yea sorry, did not think of it.
test data is here but it’s probably too much trouble getting it ;(

imho, you should still raise an issue, using some minimal example like in the question

According to the OpenCV bindings developer, the Julia package should contain OpenCV 4.5.4, but it actually contains 4.5.2. The Julia package developer has been ignoring all the questions for over a month now. The useless state of the Julia OpenCV package should be clearly stated (at least for Windows) :slight_smile:

what about building from src ?

It doesn’t seem trivial…

In the new Julia 1.7, the Windows OpenCV package cannot even be precompiled …

If I remember correctly, it was a Google Summer of Code project. The summer is over, and the code is semi-abandoned. I would not attempt a serious project with OpenCV Julia bindings. Python bindings seem to be in a good shape, if that’s of any help to you.

or, instead of hoping that stuff will happen – if one has enough interest in these Julia bindings – one could consider helping the maintainer. they’ll probably be happy for the help. the more the merrier.

Julia without OpenCV (and IPP) seems useless for image processing.
There is probably something wrong with Julia, if it’s more difficult to wrap OpenCV than in Python. Using the Julia → Python → OpenCV bridge in the production code actually seems like a joke!

There is nothing fundamentally wrong with Julia. OpenCV is quite difficult to wrap. I mentioned Python/OpenCV as a mature alternative to Julia/Open CV.