Exemple #1
0
visualfile = './visualized/'+versionName+'-augmented.jpg'

orient = 9
pix_per_cell = 8
cell_per_block = 2

### Final ###
# try to make thresholds LOWER!
# remove more false positives
hthreshold = 5.0

# remove more false negatives
lthreshold = 3.0

svc = joblib.load(trained_model) 
slide_window = SlidingWindows()
chog = CHOG(trained_scalar=trained_scalar)

outimages = []
images = glob.glob('./test_images/test*proj.jpg')
for file in images: 
    print("processing: ", file)
    image = cv2.cvtColor(cv2.imread(file), cv2.COLOR_BGR2RGB)

    print("initializing...")
    windows = slide_window.completeScan(file)

    foundwindows = []
    print("Processing",len(windows),"windows high...")
    for window in windows:
        wimage = image[window[0][1]:window[1][1], window[0][0]:window[1][0]]
Exemple #2
0
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import cv2
import glob
import time
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from skimage.feature import hog
from sklearn.externals import joblib
from testlib.slidingWindows import SlidingWindows
from testlib.CHOG import CHOG

versionName = 'CHOG-TEST-XO2'
visualfile = './visualized/' + versionName + '-augmented.jpg'

slide_window = SlidingWindows()
chog = CHOG()

outimages = []
images = glob.glob('./test_images/test*proj.jpg')
for file in images:
    print("processing: ", file)
    image = cv2.cvtColor(cv2.imread(file), cv2.COLOR_BGR2RGB)

    print("initializing...")
    windows = slide_window.sentinalScan(file)
    window_img = chog.draw_boxes(image, windows, color=(0, 0, 255), thick=2)
    outimages.append((file, 0, 0, 0, image, window_img))
chog.drawXOPlots(visualfile, versionName, outimages)