Yggdrasil icon indicating copy to clipboard operation
Yggdrasil copied to clipboard

[OpenCV] Update to 4.12.0

Open mkitti opened this issue 1 month ago • 10 comments

Update OpenCV to 4.12.0 Also update dependencies

  • Qt6Base_jll to ~6.8.2
  • libcxxwrap_julia_jll to 0.14

mkitti avatar Nov 18 '25 00:11 mkitti

I would need to refactor the patches. This may take some time.

@barche I would appreciate any advice you may have to fix OpenCV up here.

mkitti avatar Nov 18 '25 04:11 mkitti

I have been looking at the error here: https://buildkite.com/julialang/yggdrasil/builds/25010/steps/table?sid=019a947f-78fe-492e-8223-05a0899a4461#019a947f-7967-4bd1-bdfd-da1c083941d8/7-19836

This seems to be caused by some changes in the header parsers provided by OpenCV, there must be a missing step to populate the compiler definitions, but I don't know how to do this. Is anyone familiar with the OpenCV source code involved in maintaining the Julia package?

barche avatar Nov 22 '25 16:11 barche

The compile definitions problem is fixed, but a lot more to do, this still won't build.

barche avatar Nov 22 '25 22:11 barche

Thank you. I will see what I can do.

mkitti avatar Nov 23 '25 14:11 mkitti

I found out that I still had an OpenCV fork with some patches, I should be able to publish something that works soon. We could then drop all the patches here and try to integrate the changes into opencv_contrib, and work from the fork until it is merged.

barche avatar Nov 23 '25 14:11 barche

Just seeing how https://github.com/barche/opencv_contrib/tree/julia-fixes fares on all platforms, tested this locally on x86_64 linux and it works with CxxWrap 0.17.4 and Julia 1.12.

Trying without any of the additional patches first.

barche avatar Nov 23 '25 20:11 barche

Seems in the last build it used an old cached copy of the opencv_contrib repository, hopefully the next build will go through.

barche avatar Nov 23 '25 21:11 barche

This PR also has conflicts with master...

fingolfin avatar Nov 23 '25 22:11 fingolfin

For me this looks good now, but it's best to test the binaries with OpenCV.jl before merging this.

barche avatar Dec 08 '25 06:12 barche

The OpenCV.jl test fails almost immediately with:

OpenCV: Error During Test at /home/bjanssens/src/julia/pkgdev/OpenCV/test/runtests.jl:16
  Got exception outside of a @test
  LoadError: MethodError: no method matching cvtColor(::Array{UInt8, 3}, ::Int64)
  The function `cvtColor` exists, but no method is defined for this combination of argument types.
  
  Closest candidates are:
    cvtColor(::Union{OpenCV.CxxMat, AbstractArray{T, 3} where T<:Union{Float32, Float64, Int16, Int32, Int8, UInt16, UInt8}}, ::Int64, ::Union{OpenCV.CxxMat, AbstractArray{T, 3} where T<:Union{Float32, Float64, Int16, Int32, Int8, UInt16, UInt8}}, ::Int64, ::Int64)
     @ OpenCV ~/src/julia/pkgdev/OpenCV_jll/override/OpenCV/src/cv_cxx_wrap.jl:1901

Not sure why, might be a change in API or an error I made in removing duplicate methods.

barche avatar Dec 09 '25 20:12 barche

Would it make sense to merge this, and then update the OpenCV.jl package to work correctly with these binaries? I suppose the current OpenCV.jl will need compat entries to not pick the new binaries in that case.

ViralBShah avatar Dec 20 '25 22:12 ViralBShah

Yea, I might edit the registry compat to make sure the current OpenCV.jl is not declared compatible with this.

mkitti avatar Dec 23 '25 00:12 mkitti

At the moment I am not sure if the errors are caused by wrong fixes I made to get the wrappers to compile with OpenCV 4.12.0 or because the Julia side needs updates. Ideally someone with better knowledge of the OpenCV API should look at this, it is quite easy to download the artifacts from the build here and test them without merging this by using dev_jll and then overwriting the binaries in the override dir of the JLL.

barche avatar Dec 24 '25 15:12 barche