Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
-ADD: Images of the single Runs (Udacity)
Browse files Browse the repository at this point in the history
  • Loading branch information
Super-T02 committed Dec 12, 2022
1 parent cbd13da commit 6f2dd31
Show file tree
Hide file tree
Showing 27 changed files with 14 additions and 12 deletions.
Binary file added Documentation/Images/Udacity/Img001-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img001-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img002-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img002-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img003-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img003_KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img004-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img004-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img005-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img005-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img006-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img006-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img007-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img007-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img008-Hough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/Images/Udacity/Img008-KI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Dieses Projekt beinhaltet die Prüfungsleistung für den Kurs Digitale Bildverarbeitung an der Dualen Hochschule Bade-Württemberg. Aufgabe ist es, eine Spurerkennung für ein Video zu erstellen. Bonusaufgaben können zudem ergänzt werden. Für genauere Anforderungen, siehe [Task.pdf](Task.pdf).

**Hinweis: Die Videos für die Abgabe sind unter `Documentation/Videos` zu finden!**
**Hinweise zum KI-Modell: Der direkte Download ist: <https://drive.google.com/file/d/1WCYyur5ZaWczH15ecmeDowrW30xcLrCn/view?usp=sharing> Der Pfad des Models muss dann in der mein als model_path mitgegeben werden**

## Ordnerstruktur

Expand Down
8 changes: 4 additions & 4 deletions config/video.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"HOUGH": {
"RHO": 6,
"THETA": 90,
"THETA": 80,
"THRESHOLD": 100,
"MIN_LINE_LENGTH": 3,
"MAX_LINE_GAP": 2,
"CANNY_LOWER": 100,
"CANNY_LOWER": 80,
"CANNY_UPPER": 150,
"LEFT_FIX": [200, 720],
"RIGHT_FIX": [1200, 720],
Expand All @@ -16,10 +16,10 @@
"MAX_COLOR": [70, 255, 255],
"HIT_X_LEFT": 200,
"HIT_Y_LEFT": 300,
"HIT_X_RIGHT": -80,
"HIT_X_RIGHT": -40,
"HIT_Y_RIGHT": 500,
"HIT_X_MIDDLE_LEFT": 450,
"HIT_X_MIDDLE_RIGHT": -380,
"HIT_X_MIDDLE_RIGHT": -410,
"HIT_Y_MIDDLE": -75,
"ROI": [
[300, -75],
Expand Down
17 changes: 9 additions & 8 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ class Main():
WIN_X = 1280
WIN_Y = 720

def __init__(self, path, debug=False):
def __init__(self, path, model_path = "", debug=False):
print('Willkommen beim Projekt "Erkennung von Spurmarkierungen"')

# Define the objects
self.calib = cal.Calibration(debug=debug)
self.sliding_win = slw.SlidingWindow(debug=debug)
self.hough = hou.HoughTransformation(debug = debug)

model_path = "src/model/tusimple_18.pth"
self.model_path = None

if model_path: self.model_path = model_path
useGPU = False # True if you want to use GPU and coda cores

self.lane_detector = LaneDetection(model_path, useGPU)
if model_path: self.lane_detector = LaneDetection(model_path, useGPU)

# Define the variables
self.path = path
Expand All @@ -39,10 +40,10 @@ def startVideo(self, mode=0, config_path="./config/video.json", export_video=Fal
error = self.hough.load_config(config_path)
elif mode == 1:
error = self.sliding_win.load_config(config_path)
elif mode == 2:
elif mode == 2 and self.model_path:
pass
else:
error = "Mode not found"
error = "Mode not found or model not found"

if error:
print(error)
Expand All @@ -60,7 +61,7 @@ def startVideo(self, mode=0, config_path="./config/video.json", export_video=Fal
vid_str = 'default_vid'
if mode == 1:
mode_str = 'sliding_windows'
if mode == 2:
if mode == 2 and self.model_path:
mode_str = 'KI'
if config_path == './config/video_challenge.json':
vid_str = 'challenge_vid'
Expand Down Expand Up @@ -149,7 +150,7 @@ def _calcFPS(self, prev_frame_time, new_frame_time):
# Mode:
# - 0: Hough
# - 1: Sliding window
# - 2: KI-Model
# - 2: KI-Model (if model is loaded) model_path = ...
main.startVideo(mode=0, config_path="./config/video.json")
main.startVideo(mode=1, config_path="./config/video.json")
main.startVideo(mode=2, config_path="./config/video.json")
Expand Down

0 comments on commit 6f2dd31

Please sign in to comment.