forked from rekon/T3D-keras
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
input preprocess script added. lanenet connection added.
- Loading branch information
Showing
3 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import cv2 | ||
import numpy as np | ||
|
||
def cutter(src): | ||
|
||
cap = cv2.VideoCapture(src) | ||
|
||
frames = [] | ||
if not cap.isOpened(): | ||
cap.open(src) | ||
ret = True | ||
while(True and ret): | ||
# Capture frame-by-frame | ||
ret, frame = cap.read() | ||
|
||
frames.append(frame) | ||
if cv2.waitKey(1) & 0xFF == ord('q'): | ||
break | ||
|
||
# When everything done, release the capture | ||
cap.release() | ||
|
||
croped_frames = [] | ||
for cf in frames: | ||
rsz_f = cf[300:950, 0:1920] # cut unnecessary sky and car view | ||
croped_frames.append(rsz_f) | ||
|
||
return np.asarray(croped_frames) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters