Example #1
0
from imutils.video import FileVideoStream
from imutils.video import FPS
from skimage.measure import compare_ssim
import numpy as np
import argparse
import imutils
import time
import cv2
import os
import datetime
from pydarknet import Detector, Image
import Threshold

videoFile="HighlineGate.mp4"
yolodir="yolo"
threshold =  Threshold.Threshold(videoFile).get()

# parse the arguments
ap = argparse.ArgumentParser()

ap.add_argument("-y", "--yolo", default=yolodir,
	help="base path to YOLO directory")
ap.add_argument("-c", "--confidence", type=float, default=0.5,
	help="minimum probability to filter weak detections")
ap.add_argument("-s", "--sample", default=videoFile,
	help="minimum probability to filter weak detections")
ap.add_argument("-st", "--thresh", default=threshold,
	help="minimum probability to filter weak detections")
args = vars(ap.parse_args())

import Sobel_edge_enhancement as enhance
import Threshold as detect
import time

#Create a grayscale image
grayImage = gray.GrayScale()

#Apply a Gaussian Blur filter
blurImage = blur.GaussianBlur(grayImage)

#Perform Edge Enhancement
start = time.time()
enhancedImage = enhance.sobel_edge_detection(blurImage)
end = time.time()
print(f"Edge enhancement completed in {round(end-start,2)} seconds.")

#Perform Sobel Edge Detection
start = time.time()
finalImage = detect.Threshold()
end = time.time()
print(f"Final edge detection completed in {round(end-start,2)} seconds.")
'''
===============================================================================
ACADEMIC INTEGRITY STATEMENT
    I have not used source code obtained from any other unauthorized
    source, either modified or unmodified. Neither have I provided
    access to my code to another. The project I am submitting
    is my own original work.
===============================================================================
'''