cv2.error: OpenCV(4.5.0-dev) /home/pi/opencv/modules/highgui/src/window.cpp:651: error: (-2:Unspecified error) [closed]
Hallo, I have fallowed the steps provided in this tutorial https://www.tomshardware.com/how-to/r... and have tried scouring to get a fix for my issue bellow. I have the latest version of everything I can find to try and install and have re ran the Cmake twice now and I continue to run into this cv2.error can anyone help me figure out why I am unable to run the face recognition?(note I can import cv2 in python3 on the terminal and check things like version of CV but it doesn't want to work with python)
Traceback (most recent call last): File "headshots_picam.py", line 18, in <module> cv2.imshow("Press Space to take a photo", image) cv2.error: OpenCV(4.5.0-dev) /home/pi/opencv/modules/highgui/src/window.cpp:651: 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'
(also let me know if there are changes I need to make to the quire not sure how the openCV does all their questions)
sudo apt install libgtk2.0-dev and pkg-config
Which rpi model?
your cv2 was built without any gui support. install libgtk2.0-dev, rerun cmake, and show us the output
@Zapero.There is one thing in line 18... meaning that u're forgot to
sudo make install
after u done with make -j4. So u don't needed thisinstall libgtk2.0-dev and pkg-config
. This happened to me I left outsudo make install
. This worked for me.@berak i have done a clean install installed the libgtk2.0dev before running cmake, ran cmake
cv2.imshow("Press Space to take a photo", image) cv2.error: OpenCV(4.5.0-dev) /home/pi/opencv/modules/highgui/src/window.cpp:651: 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'
this is the error message again
@supra56 i have run sudo make install both times (it is in the steps) and nothing im running a pi 4 model , 4 or 8 gb
Didn't u deleted inside build folder and then do cmake again? Otherwise here is another link install opencv 4 After that, u can do face recognition. I used both rpi 3B/3B+, rpi 4B with 4/8gb
Forgotten. Did u do update and upgrade before u install OpenCV 4?
@supra56 i think i did. Let me try running that and then rerun cmake? do you think that that might fix it?
Go ahead and try it. Don't forget to do update and upgrade before installing OpenCV 4.5.0. If u already gone into rerun cmake ...DON'T do it. //clean sd card.
@supra56 Ok i followed the path and link you put up and everything works i have no idea what was wrong but hey its working so thanks