# OpenCV package - not properly supported

**URL:** https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389
**Category:** Visualization
**Tags:** images
**Created:** [October 26, 2021, 8:50am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389 "2021-10-26T08:50:22Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![vladimr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladimr/32/30202_2.png) [@vladimr](https://discourse.julialang.org/u/vladimr)
#### Post date: [October 26, 2021, 8:50am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/1 "2021-10-26T08:50:22Z")

</div>

Professional Image Processing in Julia is impossible without the OpenCV package.  
But this package doesn’t seem properly supported, at least the Windows x64 version - basic functionality doesn’t work.  
Is there any idea about the future of this very important package?

---

<div class="post-metadata">

### Author: ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)
#### Post date: [October 26, 2021, 11:23am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/2 "2021-10-26T11:23:27Z")

</div>

One could use the julia written [https://github.com/JuliaImages/Images.jl](https://github.com/JuliaImages/Images.jl) ecossystem for most things, and if there are some specific openCV things you need a workaround for now is using pycall to call openCV via python. Tho you might have to do some simple conversion because openCV and julia store images in a different way

---

<div class="post-metadata">

### Author: ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)
#### Post date: [October 28, 2021, 9:11am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/3 "2021-10-28T09:11:29Z")

</div>

If you’re familiar with OpenCV from the C++ side, Julia’s storage is actually more similar than Python’s: we don’t use an array dimension to encode color because we, like OpenCV/C++, have real color types. It’s just the OpenCV Python wrapper that encodes color via an extra array dimension.

@vladimir, I agree the OpenCV package needs work. Since you care a lot about that, obviously it would be great if you’d help out. Alternatively, echoing @gbaraldi’s comment, what is JuliaImages missing? I know OpenCV has a lot of stuff JuliaImages doesn’t have, but the converse is also true: we’re actually much better for certain tasks than OpenCV. Consequently, a specific list of requirements would be more useful than “necessary for professional image processing.”

If you’re worried about performance, don’t be: we’re only now starting to put together benchmarks, but the preliminary results are quite encouraging 🙂 . Do report any issues you discover, as most bottlenecks are fixable.

---

<div class="post-metadata">

### Author: ![vladimr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladimr/32/30202_2.png) [@vladimr](https://discourse.julialang.org/u/vladimr)
#### Post date: [November 11, 2021, 6:50pm UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/4 "2021-11-11T18:50:07Z")

</div>

This sounds a bit too optimistic compared to Intel’s long-term development of OpenCV.  
Why reinvent the wheel?

---

<div class="post-metadata">

### Author: ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)
#### Post date: [November 11, 2021, 7:23pm UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/5 "2021-11-11T19:23:27Z")

</div>

There are some advantages with a pure julia implementation.  
Performance is probably not one of them since OpenCV is already very optimized.

This is a case of the 2 language problem, if one is using OpenCV in python, the package is very much a black box and C++ isn’t famous for it’s readability/ease of use.

With everything being julia, the user can probably read the code any function that he’s using and, more importantly, can hope to either modify or extend that code.

Another advantage is composability. The methods defined by images aren’t limited to using just images, and they might even work with a custom type if you define the correct methods, that would be impossible in python or C++.

---

<div class="post-metadata">

### Author: ![vladimr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladimr/32/30202_2.png) [@vladimr](https://discourse.julialang.org/u/vladimr)
#### Post date: [December 12, 2021, 4:09pm UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/6 "2021-12-12T16:09:31Z")

</div>

In Julia 1.7, OpenCV cannot be precompiled…

---

<div class="post-metadata">

### Author: ![cripcate](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cripcate/32/34170_2.png) [@cripcate](https://discourse.julialang.org/u/cripcate)
#### Post date: [December 14, 2021, 7:33am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/7 "2021-12-14T07:33:45Z")

</div>

To hijack this thread…

I know there is ImageSegmentation.jl, but is there any library to measure the labels in segmented images and get, e.g., area, diameter, centroid etc.? This is something I regularly use from OpenCV / scikit-image.

---

<div class="post-metadata">

### Author: ![vladimr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladimr/32/30202_2.png) [@vladimr](https://discourse.julialang.org/u/vladimr)
#### Post date: [December 15, 2021, 9:19am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/8 "2021-12-15T09:19:09Z")

</div>

Why is it easier to wrap OpenCV in Python than in Julia?  
Are there any Julia design limitations for wrapping C++ versus Python?  
Using the Julia → Python → OpenCV bridge doesn’t seem like a good idea for production high performance code…

---

<div class="post-metadata">

### Author: ![vladimr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladimr/32/30202_2.png) [@vladimr](https://discourse.julialang.org/u/vladimr)
#### Post date: [December 15, 2021, 9:29am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/9 "2021-12-15T09:29:34Z")

</div>

We probably need something like Cython in Python or managed C ++ in .NET…  
The problem is not only with OpenCV, with using any large C ++ project inside Julia.

---

<div class="post-metadata">

### Author: ![originalsouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/originalsouth/32/32061_2.png) [@originalsouth](https://discourse.julialang.org/u/originalsouth)
#### Post date: [December 15, 2021, 10:50am UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/10 "2021-12-15T10:50:57Z")

</div>

You can use `ImageMorphology.component_boxes` find the bounding boxes of the `SegmentedImage` object. Then use use a `view` to isolate the `segment_labels` on the bounding boxes and work on the Segment Matrix from there.

---

<div class="post-metadata">

### Author: ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)
#### Post date: [January 2, 2023, 7:51pm UTC](https://discourse.julialang.org/t/opencv-package-not-properly-supported/70389/11 "2023-01-02T19:51:43Z")

</div>

Hello. Are someone using opencv for julia in this days? If yes, it is able for production?
