Skip to content
Advertisement

Display a stream images in Google Colab using OpenCV

I have a stream of images and have to display it in Google Colab notebook such that it looks like a video, But what I get is a image under image …

JavaScript

Advertisement

Answer

I don’t know if some function can display image in the same place.

But I have code which I used with cv2 to display frames from webcam as video.

Here reduced version.

imshow(name, image) creates <img id="name"> and replaces src/url with image converted to string base64 and browser shows it as image.

imshow() uses name to check if already exist <img id="name"> and it replaces previous image.

JavaScript

And here code which uses it to display image Lenna from Wikipedia.

JavaScript

EDIT

Display images in two “windows” using imshow("img1", ...) and imshow("img2", ...)

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement