Add init and lazy loading to init

This commit is contained in:
DSTO\pivatom
2018-12-18 10:25:40 +10:30
parent 4ad9490555
commit eb784f2f27

View File

@@ -3,8 +3,13 @@ import numpy as np
import cv2
class SimpleHandRecogniser(HandRecogniser):
def load_image(self, image_path):
self.img = cv2.imread(image_path, 1)
def __init__(self, image_path = ""):
self._image_path = image_path
def load_image(self, image_path = None):
if image_path is not None:
self._image_path = image_path
self.img = cv2.imread(self._image_path, 1)
self.img = cv2.resize(self.img, None, fx=0.1, fy=0.1, interpolation = cv2.INTER_AREA)
def __calc_pos_y(self, x, radius, centre):