vfx-2 / python_core /media /ImageWriter.py
TaqiRaza512's picture
Initial commit
a103028
import cv2
class ImageWriter:
"""
A flexible and more optimzed image writer against opencv image writer.
"""
def __init__(self, image_path):
self._image_path = image_path
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def write(self, frame):
"Writes a frame onto photo file - the frame needs to be in BGR format"
cv2.imwrite(self._image_path, frame)