Goolge 0 Posted August 31, 2022 (edited) I installed devian10 on tinker-edge-r. The following error occurred as soon as cv2.imshow() was performed with the test code. And I try to apt-get install libgtk2.0-dev and pkg-config. How can I resolve the error? Quote 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' Edited August 31, 2022 by Goolge Share this post Link to post Share on other sites
tooz 52 Posted September 2, 2022 hello @Goolge, what is your test code? have you done what the notice suggested? (If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage') Share this post Link to post Share on other sites
tooz 52 Posted September 2, 2022 just tested the cv2.imshow() function on my side and no errors shown. if the debian 10 os you're using is the official release from our website, python/ opencv pakages are built in the image; if you're using a third party debian 10 os, maybe follow this tutorial to get all the necessary libs/ pkgs installed: https://linuxize.com/post/how-to-install-opencv-on-debian-10/ Share this post Link to post Share on other sites
Goolge 0 Posted November 2, 2022 On 9/2/2022 at 5:07 PM, tooz said: just tested the cv2.imshow() function on my side and no errors shown. if the debian 10 os you're using is the official release from our website, python/ opencv pakages are built in the image; if you're using a third party debian 10 os, maybe follow this tutorial to get all the necessary libs/ pkgs installed: https://linuxize.com/post/how-to-install-opencv-on-debian-10/ Thank you very much. I almost gave up. I'll give it a try. I have one more question. Two webcams were connected in the tinker edge. 'cv2.open' works well for two webcams, but only one webcam can be read. How do I 'cv2.read' two webcams at the same time? Share this post Link to post Share on other sites
Tinker Board 2 Posted November 2, 2022 Hi, Usually, before you use `cv2.open`, should have a define codes to let cv2 know use which camera. so should such as: import cv2 cam0 = cv2.VideoCapture(0) cam1 = cv2.VideoCapture(1) ret0, frame0 = cam0.read() and node ID is based on your camera node in system. Share this post Link to post Share on other sites
marco@bigsis.tech 0 Posted November 23, 2022 (edited) On 9/2/2022 at 9:07 AM, tooz said: just tested the cv2.imshow() function on my side and no errors shown. if the debian 10 os you're using is the official release from our website, python/ opencv pakages are built in the image; if you're using a third party debian 10 os, maybe follow this tutorial to get all the necessary libs/ pkgs installed: https://linuxize.com/post/how-to-install-opencv-on-debian-10/ i have downloaded the debian 10 official realease from tinker board asus website and then followed your suggested tutorial to install opencv but i am still getting the error: 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' Edited November 23, 2022 by marco@bigsis.tech Share this post Link to post Share on other sites
tooz 52 Posted November 23, 2022 hello @marco@bigsis.tech which version of opencv were you building? were you building it on tinker board 2s? Share this post Link to post Share on other sites
marco@bigsis.tech 0 Posted November 23, 2022 (edited) Hi, thank you for your reply. No, I am building it on the Tinker Edge R, and the downloaded version of opencv after following that tutorial is 4.6.0. I also tried to execute the RKNN toolkit which gives opencv 4.4.0 and still got that error message. Edited November 23, 2022 by marco@bigsis.tech Share this post Link to post Share on other sites
marco@bigsis.tech 0 Posted November 23, 2022 (edited) 19 minutes ago, tooz said: hello @marco@bigsis.tech which version of opencv were you building? were you building it on tinker board 2s? Hi, thank you for your reply. No, I am building it on the Tinker Edge R, and the downloaded version of opencv after following that tutorial is 4.6.0. I also tried to execute the RKNN toolkit which gives opencv 4.4.0 and still got that error me Edited November 23, 2022 by marco@bigsis.tech Share this post Link to post Share on other sites
tooz 52 Posted November 23, 2022 hello @marco@bigsis.tech, i was testing tinker board 2s and did manage to compile opencv: sudo apt-get update sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev git clone https://github.com/opencv/opencv.git cd opencv/ git checkout 4.1 mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D INSTALL_C_EXAMPLES=OFF \ -D PYTHON_EXECUTABLE=$(which python3) \ -D BUILD_opencv_python2=OFF \ -D PYTHON3_EXECUTABLE=$(which python3) \ -D WITH_GSTREAMER=ON .. make && sudo make install will check on tinker edge r and let you know Share this post Link to post Share on other sites
marco@bigsis.tech 0 Posted November 23, 2022 2 minutes ago, tooz said: hello @marco@bigsis.tech, i was testing tinker board 2s and did manage to compile opencv: sudo apt-get update sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev git clone https://github.com/opencv/opencv.git cd opencv/ git checkout 4.1 mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D INSTALL_C_EXAMPLES=OFF \ -D PYTHON_EXECUTABLE=$(which python3) \ -D BUILD_opencv_python2=OFF \ -D PYTHON3_EXECUTABLE=$(which python3) \ -D WITH_GSTREAMER=ON .. make && sudo make install will check on tinker edge r and let you know thank you for your response, I will try uninstall opencv and recompile it with your modification and let you know as well Share this post Link to post Share on other sites
tooz 52 Posted November 24, 2022 hello @marco@bigsis.tech, forgot to mention that if you're using the releases from us: https://tinker-board.asus.com/download-list.html?product=tinker-edge-r the script file of rknn toolkit installation is included (you can find it on desktop) no need to install opencv as it's included in the toolkit installation Share this post Link to post Share on other sites
tooz 52 Posted November 24, 2022 16 hours ago, marco@bigsis.tech said: Hi, thank you for your reply. No, I am building it on the Tinker Edge R, and the downloaded version of opencv after following that tutorial is 4.6.0. I also tried to execute the RKNN toolkit which gives opencv 4.4.0 and still got that error message. hello @marco@bigsis.tech, so the version of opencv-python was upgraded, if you've encountered import cv2.imshow() error, please remove the build-in opencv-python: python3 -m pip uninstall opencv-python then re-install: python3 -m pip install opencv-python --user Share this post Link to post Share on other sites
marco@bigsis.tech 0 Posted November 24, 2022 1 hour ago, tooz said: hello @marco@bigsis.tech, so the version of opencv-python was upgraded, if you've encountered import cv2.imshow() error, please remove the build-in opencv-python: python3 -m pip uninstall opencv-python then re-install: python3 -m pip install opencv-python --user Hi, thank you again for your quick response. at the end I was able to solve the error by re-compiling opencv following the same tutorial BUT installing libgtk2.0-dev instead of libgtk-3-dev. I will try your suggestion as well. However I am currently facing another problem.. I am trying to capture videos from 4 usb cameras. I am able to preview only 3 cameras together, but if I try with 4 I gets the following error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow Any suggestion please? Share this post Link to post Share on other sites
tooz 52 Posted November 28, 2022 hello @marco@bigsis.tech, this is the imshow function error, perhaps you want to check and adjust the import frame Share this post Link to post Share on other sites
marco@bigsis.tech 0 Posted November 28, 2022 6 hours ago, tooz said: hello @marco@bigsis.tech, this is the imshow function error, perhaps you want to check and adjust the import frame Hello, Do you mean the frame size? Share this post Link to post Share on other sites