From a3c4d37ae22f9c04188c015796474f2d22d9bb6f Mon Sep 17 00:00:00 2001 From: Simon Mayer Date: Mon, 15 Feb 2021 17:11:27 +0100 Subject: [PATCH] Added first sketch for three classes --- README.md | 2 +- iiif_tools.py | 41 +++++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 +++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 iiif_tools.py create mode 100644 requirements.txt diff --git a/README.md b/README.md index f17e1f4..27091c6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # iiif-image-manipulation Provide tools for colorization of black & white images and stitching of scanned -images of large maps in a IIIF setup. \ No newline at end of file +images of large maps in a IIIF setup. diff --git a/iiif_tools.py b/iiif_tools.py new file mode 100644 index 0000000..306bf1c --- /dev/null +++ b/iiif_tools.py @@ -0,0 +1,41 @@ +import cv2 +import numpy as np +import requests +from abc import ABC, abstractmethod + + +class IIIFAbstractManifest(ABC): + """ + An abstract class for handling IIIF manifests for further processing. + """ + def __init__(self, manifest_url): + self.manifest_url = manifest_url + super().__init__() + + @abstractmethod + def _load_single_image(self): + pass + + @abstractmethod + def _load_multiple_images(self): + pass + + @abstractmethod + def get_image(self): + pass + + @abstractmethod + def get_images(self): + pass + + @abstractmethod + def get_image_range(self): + pass + + +class IIIFColorizer(IIIFAbstractManifest): + pass + + +class IIIFImageStitcher(IIIFAbstractManifest): + pass diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..732cf12 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +opencv-python +numpy +requests \ No newline at end of file -- GitLab