How to update plot window of image using opencv python at certain regular interval? -
i've set of images dynamically being generated python script "image_generator.py" @ rate. want display these images dynamically. there method can update image plot newly generated image "image_generator.py"?
image_generator.py
import numpy def generate(height, width, channels): img = numpy.random.rand(height, width, channels) img = (255*img).astype(numpy.uint8) return img example.py
import cv2 image_generator import generate n_images = 20 height = 200 width = 200 channels = 3 n in range(n_images): img = generate(height, width, channels) cv2.imshow('random image', img) k = cv2.waitkey(200) if k == ord('q') & 0xff: break note no different if in same python file. once import module, have access functions sitting inside python script.
Comments
Post a Comment