ImportError: libopencv_shape.so.3.2

Hi everyone

I tried this tutorial.

In a notebook, I wrote:

from pynq import Overlay
bareHDMI = Overlay("/usr/local/lib/python3.6/dist-packages/" "pynq_cv/overlays/xv2Filter2DDilate.bit")
import pynq_cv.overlays.xv2Filter2DDilate as xv2
from pynq import Xlnk
Xlnk.set_allocator_library("/usr/local/lib/python3.6/dist-packages/" "pynq_cv/overlays/xv2Filter2DDilate.so")
mem_manager = Xlnk()
hdmi_in = bareHDMI.video.hdmi_in
hdmi_out = bareHDMI.video.hdmi_out

I got:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-454b292e341b> in <module>()
      2 bareHDMI = Overlay("/usr/local/lib/python3.6/dist-packages/"
      3                "pynq_cv/overlays/xv2Filter2DDilate.bit")
----> 4 import pynq_cv.overlays.xv2Filter2DDilate as xv2
      5 from pynq import Xlnk
      6 Xlnk.set_allocator_library("/usr/local/lib/python3.6/dist-packages/"

ImportError: libopencv_shape.so.3.2: cannot open shared object file: No such file or directory

I already tried this solution. However, I couldn’t find “opencv” in the link that rock gave to solve the problem.

I tried this command:

apt-get install libopencv-calib3d-dev

Could you help me?

Thank you.

1 Like

I also tried the first solution given here. I still have this issue.

The computervision overlay is currently broken, since the maintainers are yet to upgrade their opencv version and recompile the shared libraries. This is due to our upgrade of opencv from 3.2 to 3.4 in image v2.6.0. If you still want to use that repo, I guess the best chance is to fall back to image v2.5.0. Otherwise you will need to recompile their libs by yourself to match the opencv3.4 version.

1 Like

Thank you for your answer. Could you explain how I could install older versions of Pynq, e.g. 2.5 or even 2.4?

The question is from last year, but for anyone interested you can get any older of PYNQ from github repository, via releases tags. For exemple for v2.4 go to Release Utah Release · Xilinx/PYNQ · GitHub. You can then download PYNQ SD Card Image for PYNQ-Z1, PYNQ-Z2 ZCU104 and ZCU111 boards. Note that you will need a Xilinx account.