benwiz
benwiz

Reputation: 2317

Show image using OpenCV in Python on a Raspberry Pi terminal

I get a gtk-WARNING when trying:

cv2.imshow("WindowName", image)

I'm using this to watch a live stream one frame at a time. Are there any alternative libraries I could use? I tried several other options like PIL and Tkinter as well as wand, but could get none of them to work for various different reason.

Upvotes: 2

Views: 2383

Answers (1)

George Profenza
George Profenza

Reputation: 51867

You need to use a windowing system to display images using imshow. (That can be enabled in settings running sudo raspi-config)

If you absolutely, positively need to display images without using a windowing system, consider providing an html/web interface. Two options that come to mind when serving a web interface are:

  1. Creating an HTTP video stream (serve the output image as if it's an IP camera, kind of)
  2. Stream the output matrix as a jpg blob via websockets

Upvotes: 2

Related Questions