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.

Hey crackwitz, I would love to help the maintainer there in opencv_contrib for help with the Julia Bindings but opencv seems like a big maze to traverse. I have tried building opencv from source and it takes a surprising amount of time to build :joy: :smiley:

What I find confusing is where to start?Can you provide me some direction?

From my perspective,

  • I can setup according to this:
    OpenCV: Introduction to Julia OpenCV Binding
    which I already have but the build time :smiling_face_with_tear: and try to build a single module and try to make that work for Julia
  • opencv/opencv_contrib/blob/4.x/modules/julia/README.md
    has some interesting information too

I already have used OpenCV.jl and made even a project using it. I think it deserves a lot more attention and is needed to be better supported as it could have a good impact on computer vision community in Julia.

I am part of GSOC’22 with Julia Lang for ImagesIO support which provides support EXIF, GIF, JPEG2000 in Julia by writing bindings/wrappers for the corresponding C libraries namely LibExif, GifLib and OpenJpeg. I mean I am reasonably confident I can tackle this with some help and have experience on something similar despite it looking somewhat hard .

1 Like