Hi Ishrat,

Welcome to Julia. About the original question of loading OpenCV via PyCall,
there was a discussion that mentioned using it, successfully, in this
thread:

https://github.com/timholy/Images.jl/issues/96#issuecomment-44529823

I also just tested it myself, and cv2 imported successfully on Ubuntu 14.04
with Julia 0.3.11 / Python 2.7.6. However, I am using the default version
of opencv installed by `apt-get install python-opencv`, which appears to be
2.4 (rather than your 3.0 version).

A couple suggestions for debugging this:

- the first thing is to check is that PyCall is up-to-date, using
`Pkg.update()`. (just in case, might have been fixed since the last update).

- another idea to add some debugging output in the failing "pywrap"
function. You could change line 312 (
https://github.com/stevengj/PyCall.jl/blob/804e065479362f0f3f8a413f8d9ddeb201fccfbc/src/PyCall.jl#L312)
from:

[symbol(x[1]) for x in filter(x -> x[1][1] != '_', members)]
to
[symbol(x[1]) for x in filter(x -> (println(x); x[1][1]) != '_', members)]

And then start Julia try `@pyimport cv2` again. This should now print out
all of the objects as they are filtered at that line, which might give a
clue why the error is happening -- check the output just before the error
occurs. Maybe there is some change in OpenCV 3 that is different from what
PyCall expects there?

Best,
Isaiah



On Fri, Sep 18, 2015 at 7:34 AM, Ishrat Badami <badami.ish...@gmail.com>
wrote:

> Hi everyone,
>
> For quite some time I am trying to use opencv with julia.
> Initially I tried installing Cxx.jl  + OpenCV.jl with  julia 4.0
>  following the instructions given here: https://github.com/Keno/Cxx.jl
>
> I encountered compiling errors while building Cxx package in julia .
> https://github.com/Keno/Cxx.jl/issues/159 which still needs to be
> resolved.
> I also tried LLVM-3.7.0 + julia-0.4 but and I am encountering different
> set of compilation errors related to clang library.
>
> Hence I gave up installing Cxx package.
>
> I then installed PyCall.jl  package to try and see if I can use OpenCV
> Python api in Julia.
>
> The python api works in python REPL using import cv2 command.
>
> But when I try
>
> *using PyCall + @pyimport cv2* I get following error:
>
> ERROR: BoundsError()
>  in anonymous at /home/badami/.julia/v0.3/PyCall/src/PyCall.jl:312
>  in filter at array.jl:1230
>  in pywrap at /home/badami/.julia/v0.3/PyCall/src/PyCall.jl:310
>  in pywrap at /home/badami/.julia/v0.3/PyCall/src/PyCall.jl:298
>
> My question is : Is it possible to pyimport opencv python api in julia at
> all?
> I am really looking forward for some help. Feeling desperate.
>
> My system specs:
> OS: Ubuntu 14.04
> Python: 2.7.6
> OpenCV: 3.0.0
> julia-0.3
>
> Thank you.
>
>
>

Reply via email to