2020-09-22 18:25:06 +00:00
|
|
|
import os
|
|
|
|
|
import time
|
|
|
|
|
from ContourExctractor import ContourExtractor
|
2020-09-23 20:02:46 +00:00
|
|
|
from Exporter import Exporter
|
2020-09-24 20:48:04 +00:00
|
|
|
from LayerFactory import LayerFactory
|
2020-10-05 07:43:27 +00:00
|
|
|
from Analyzer import Analyzer
|
2020-10-08 20:26:29 +00:00
|
|
|
from VideoReader import VideoReader
|
2020-10-11 15:09:49 +00:00
|
|
|
from Config import Config
|
2020-10-03 22:27:36 +00:00
|
|
|
import cv2
|
2020-09-22 18:25:06 +00:00
|
|
|
#TODO
|
2020-09-23 20:02:46 +00:00
|
|
|
# finden von relevanten Stellen anhand von zu findenen metriken für vergleichsbilder
|
2020-09-20 20:01:54 +00:00
|
|
|
|
2020-09-23 20:02:46 +00:00
|
|
|
def demo():
|
2020-09-20 20:01:54 +00:00
|
|
|
print("startup")
|
2020-09-22 18:25:06 +00:00
|
|
|
start = time.time()
|
2020-10-11 15:09:49 +00:00
|
|
|
config = Config()
|
2020-09-24 13:47:49 +00:00
|
|
|
|
2020-10-11 20:54:12 +00:00
|
|
|
config["inputPath"] = os.path.join(os.path.dirname(__file__), "./generate test footage/out.mp4")
|
2020-10-11 15:09:49 +00:00
|
|
|
config["outputPath"] = os.path.join(os.path.dirname(__file__), "./output/short.mp4")
|
2020-10-08 20:26:29 +00:00
|
|
|
|
2020-10-11 15:09:49 +00:00
|
|
|
contours = ContourExtractor(config).extractContours()
|
2020-10-11 12:13:27 +00:00
|
|
|
print("Time consumed extracting: ", time.time() - start)
|
2020-10-11 15:09:49 +00:00
|
|
|
layerFactory = LayerFactory(config, contours)
|
|
|
|
|
layerFactory.freeData()
|
2020-10-03 22:27:36 +00:00
|
|
|
layerFactory.sortLayers()
|
2020-10-09 21:59:04 +00:00
|
|
|
|
2020-10-11 15:09:49 +00:00
|
|
|
Exporter(config).exportOverlayed(layerFactory.layers)
|
2020-10-03 22:27:36 +00:00
|
|
|
print("Total time: ", time.time() - start)
|
2020-10-05 20:24:38 +00:00
|
|
|
|
2020-09-23 20:02:46 +00:00
|
|
|
def init():
|
|
|
|
|
print("not needed yet")
|
2020-09-20 20:01:54 +00:00
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2020-09-23 20:02:46 +00:00
|
|
|
demo()
|
2020-09-22 18:25:06 +00:00
|
|
|
|
|
|
|
|
|