File size: 491 Bytes
a103028 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import cv2
class ImageReader:
"""
A flexible and more optimzed image reader against opencv image reader.
"""
def __init__(self, image_path):
self._image_path = image_path
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def read(self):
"Reads a frame from photo file - the frame is in BGR format"
frame = cv2.imread(self._image_path)
# frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|