Installed OpenCV on Raspberry Pi 3, created (in fact, took from the tutorial ) a file for getting frames by the algorithm: [Get frame from camera] -> [Display frame in window]

The code itself:

import cv2 import video if __name__ == '__main__': # создаСм ΠΎΠΊΠ½ΠΎ с ΠΈΠΌΠ΅Π½Π΅ΠΌ result cv2.namedWindow( "result" ) # создаСм ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ cap для Π·Π°Ρ…Π²Π°Ρ‚Π° ΠΊΠ°Π΄Ρ€ΠΎΠ² с ΠΊΠ°ΠΌΠ΅Ρ€Ρ‹ cap = video.create_capture(0) while True: # Π·Π°Ρ…Π²Π°Ρ‚Ρ‹Π²Π°Π΅ΠΌ Ρ‚Π΅ΠΊΡƒΡ‰ΠΈΠΉ ΠΊΠ°Π΄Ρ€ ΠΈ ΠΊΠ»Π°Π΄Π΅ΠΌ Π΅Π³ΠΎ Π² ΠΏΠ΅Ρ€Π΅ΠΌΠ΅Π½Π½ΡƒΡŽ img flag, img = cap.read() try: # ΠΎΡ‚ΠΎΠ±Ρ€Π°ΠΆΠ°Π΅ΠΌ ΠΊΠ°Π΄Ρ€ Π² ΠΎΠΊΠ½Π΅ с ΠΈΠΌΠ΅Π½Π΅ΠΌ result cv2.imshow('result', img) except: cap.release() raise ch = cv2.waitKey(5) if ch == 27: break cap.release() cv2.destroyAllWindows() 

And the error:

Traceback (most recent call last): File "eye.py", line 6, in cv2.namedWindow ("result") cv2.error: OpenCV (4.0.0-pre) / home / pi / Downloads / opencv-
master / modules / highgui / src / window.cpp: 615: error: (-2: Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK + 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

From what they write to us in the error, you can understand that they are asking to install libgtk2.0-dev and pkg-config , restart cmake or configure script functions. When installing libgtk2.0-dev, errors and files get out (most likely due to that it is already installed), and pkg-config writes that nothing new has been added.

I do not understand how to restart Cmake and how to "configure the script functions." If you have thoughts on how this should work and how to fix it, I will be very grateful

  • Try downloading the previous version of OpenCV: wget -O opencv.zip https://github.com/opencv/opencv/archive/3.4.1.zip since the example you are referring to may not work for 4.0.0 - mr NAE
  • Do you remotely run this example through the console or through the GUI directly from the raspberry? - kidig
  • @kidig, no, this example is created and runs directly in the .py file. According to your comment, I can conclude that you need to run in the console, in the graph. shell, right? - Lisa Wilson
  • @mr NAE, thanks for the advice, I will definitely use it - Lisa Wilson

0