Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6517 Discussions

install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage

heebahsaleem
Beginner
5,253 Views

I have installed openvino and deployed blob into it but when i am executing. I am getting below error.

I have tried everything that i available on internet, installed the packages as well but nothing works

OS: Ubuntu 20.04

Error

 

2024-01-16 17:51:29.889857: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-01-16 17:51:29.911350: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-01-16 17:51:29.911607: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-01-16 17:51:30.349034: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
[INFO] initializing a depthai camera pipeline...
[INFO] initializing pipeline...
[INFO] initializing traffic light signal classifier network...
[INFO] Creating Color Camera...
[INFO] Creating ImageManip node...
Traceback (most recent call last):
File "classify_camera.py", line 91, in <module>
cv2.imshow("rgb", frame)
cv2.error: OpenCV(4.5.3-openvino) ../opencv/modules/highgui/src/window.cpp:1239: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'

0 Kudos
12 Replies
Peh_Intel
Moderator
5,209 Views

Hi Heebahsaleem,

 

The encountered error is due to there is some conflict with OpenCV. May I know which OpenCV you’re using?

 

 

Regards,

Peh


0 Kudos
heebahsaleem
Beginner
5,190 Views

>>> import cv2
>>> cv2.__version__
'4.5.3-openvino'

0 Kudos
Peh_Intel
Moderator
5,169 Views

Hi Heebahsaleem,


Where do you download the OpenCV 4.5.3-openvino?


I am able to run OpenCV with OpenCV 4.5.3-openvino, which included in Intel® Distribution of OpenVINO™ toolkit 2021.4.2.


Please ensure that you update OpenVINO™ environment variables by running the command below before importing OpenCV.

source /opt/intel/openvino_2021/bin/setupvars.sh



Regards,

Peh



0 Kudos
heebahsaleem
Beginner
5,157 Views

Hi Peh_Intel

 

Thank you for your reply.

 

I did as you said, but nothing works. I am really new to OpenVino.

As per the error, I have also tried installing libgtk2.0-dev and pkg-config, but it didn't work.

Your help will be highly appreciated.

0 Kudos
Peh_Intel
Moderator
5,128 Views

Hi Heebahsaleem,


Can you try testing the basic OpenCV function with OpenCV 4.5.3-openvino?


Try with the following commands:

  1. source /opt/intel/openvino_2021/bin/setupvars.sh
  2. python3
  3. import cv2
  4. image = cv2.imread("AnyPathToAnImage.jpeg")
  5. cv2.imshow("Image",image)
  6. cv2.waitKey(0)



Regards,

Peh


0 Kudos
heebahsaleem
Beginner
5,126 Views

thank you for your reply^^

Please see the output below. It is same:

heebahsaleem_0-1705623072077.png

 

0 Kudos
heebahsaleem
Beginner
5,103 Views

thank you for your reply^^

I fixed the warnings.

Please see the output below. It is same:

heebahsaleem_0-1705628769070.png

 

 

0 Kudos
Peh_Intel
Moderator
5,112 Views

Hi Heebahsaleem,


For OpenVINO™ 2021.4.2, it only supports Python 3.6 - 3.8.


To proceed to use Python 3.11, you have to install OpenVINO™ 2023.2. For OpenVINO™ 2023.2, OpenCV is not include in the archives. However, you can download OpenCV package, pip install opencv-python .



Regards,

Peh


0 Kudos
heebahsaleem
Beginner
5,091 Views

thank you for your reply.

Yes, that's correct that OpenVino 2021.4.2 only supports Python 3-6 3.8 and hence I have installed Python version 3.8.

 

I do not want to use OpenVino 2023.2 version, because as per the documentation there is no blob converter for this version and I may have to use some tags which might not work, therefore 2021 could work right away.

References: 

https://discuss.luxonis.com/d/2642-compile-tool-for-openvino-20231/8

https://discuss.luxonis.com/d/1196-neuralnetwork0-warning-input-image-224x224-does-not-match-nn-3x224/20 

0 Kudos
Peh_Intel
Moderator
4,978 Views

Hi Heebahsaleem,


From your last screenshot, I noticed that you're importing Python 3.11.5.


Can you try creating a virtual environment and re-run OpenCV?

  1. python3 -m venv openvino_env
  2. source openvino_env/bin/activate
  3. source /opt/intel/openvino_2021/bin/setupvars.sh
  4. pip install numpy
  5. python3
  6. import cv2
  7. image = cv2.imread("AnyPathToAnImage.jpeg")
  8. cv2.imshow("Image",image)
  9. cv2.waitKey(0)



Regards,

Peh



0 Kudos
heebahsaleem
Beginner
4,939 Views

Hi Peh_Intel

 

After lot of multiple attempt, I am able to solve the issue by uninstalling libtiff.

Thank you for your time and help^^

0 Kudos
Peh_Intel
Moderator
4,864 Views

Hi Heebahsaleem,


Glad to know your issue has been resolved.


This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.



Regards,

Peh


0 Kudos
Reply