# Call OpenCV functions from Julia

**URL:** <https://discourse.julialang.org/t/call-opencv-functions-from-julia/37820>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 18, 2020, 9:27pm UTC](https://discourse.julialang.org/t/call-opencv-functions-from-julia/37820 "2020-04-18T21:27:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasanOryx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hasanoryx/32/5373_2.png) [@hasanOryx](https://discourse.julialang.org/u/hasanOryx)\
**Post date:** [April 18, 2020, 9:27pm UTC](https://discourse.julialang.org/t/call-opencv-functions-from-julia/37820/1 "2020-04-18T21:27:02Z")

</div>

In [this](http://milindapro.blogspot.com/2015/04/call-opencv-functions-from-cnet.html) and [this](http://milindapro.blogspot.com/2015/01/create-opencv-property-sheets-in-visual.html) the author explaining how to call OpenCV functions from C#.

How can I do this from Julia? [Here](https://www.youtube.com/watch?v=p-6rG6Zgu4U) how to make OpenCV C++ project

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [April 18, 2020, 11:55pm UTC](https://discourse.julialang.org/t/call-opencv-functions-from-julia/37820/2 "2020-04-18T23:55:14Z")

</div>

I’ve successfully called OpenCV functions through the Python interface via PyCall. It may take a bit of trial and error, but this should get you started:

```julia
using PyCall, Conda
cv2 = pyimport_conda("cv2", "opencv")

img = rand(UInt8, 256, 256)
cv2.GaussianBlur(img, (13, 13), 3)

```

---

<div class="post-metadata">

**Author:** ![Erik\_Engheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erik_engheim/32/8122_2.png) [@Erik\_Engheim](https://discourse.julialang.org/u/Erik_Engheim)\
**Post date:** [January 26, 2021, 3:21pm UTC](https://discourse.julialang.org/t/call-opencv-functions-from-julia/37820/3 "2021-01-26T15:21:55Z")

</div>

We had the same challenge as you and thought we had to use the Python bindings, but it turns out that Julia bindings does exist. We followed this recipe to build a Julia OpenCV package locally: [OpenCV: Introduction to Julia OpenCV Binding](https://docs.opencv.org/master/d8/da4/tutorial_julia.html)

Remember to build [libcxxwrap-julia](https://github.com/JuliaInterop/libcxxwrap-julia) from scratch, and setup CxxWrap to use this. That was a step we initially ignored. Building OpenCV with Julia support will not work otherwise.
