# Path: python/Image/ImageProcessor.py
# class ImageProcessor:
# 
#     def __init__(self, img):
#         self.img = img
#         # https://stackoverflow.com/questions/21483301/how-to-unpack-optional-items-from-a-tuple
#         self.height, self.width, _ = (list(self.img.shape) + [None]*3)[:3]
# 
#     def process(self):
#         """ Do processing here and return the result"""
#         return self.img


import configparser
import cv2
import random
import numpy as np
import math
from .ImageProcessor import ImageProcessor



class Cannify(ImageProcessor):

    def __init__(self, img, debug: bool = False):
        super().__init__(img)
        # self.low_area = 300
        # self.high_area = 1100
        self.low_height = 45
        self.high_height = 60
        self.digits = []
        self.debug: bool = debug

        config = configparser.ConfigParser()
        config.read('config.ini')
        self.config: map = config['Cannify']
        self.low_height: int = int(self.config['low_height'])
        self.high_height: int = int(self.config['high_height'])

# Path: python/Image/ImageProcessor.py
# class ImageProcessor:
# 
#     def __init__(self, img):
#         self.img = img
#         # https://stackoverflow.com/questions/21483301/how-to-unpack-optional-items-from-a-tuple
#         self.height, self.width, _ = (list(self.img.shape) + [None]*3)[:3]
# 
#     def process(self):
#         """ Do processing here and return the result"""
#         return self.img


# Path: python/Image/Cannify.py
import configparser
import cv2
import random
import numpy as np
import math
from .ImageProcessor import ImageProcessor




class Cannify(ImageProcessor):

    def __init__(self, img, debug: bool = False):
        super().__init__(img)
        # self.low_area = 300
        # self.high_area = 1100
        self.low_height = 45
        self.high_height = 60
        self.digits = []
        self.debug: bool = debug

        config = configparser.ConfigParser()
        config.read('config.ini')
        self.config: map = config['Cannify']
        self.low_height: int = int(self.config['low_height'])
        self.high_height: int = int(self.config['high_height'])

        self.min_aspect: float = float(self.config['min_aspect'])