carsearch.py
def sliding_search(self, img, classifier):
        """Returns a list of windows where a vehicle was found."""
        windows_with_vehicles = []
        analyser = self.image_analyser

        for name, window in self.search_windows.items():
            n_steps = self.get_nsteps(window)
            self.update_image_analyser(img, window)

            for step in range(n_steps):
                position = self.get_window_position(step, window)
                position = self.convert_to_px(position)

                window_relative = self.get_relative_window_coordinates(window,
                                                                       step)
                features = analyser.get_image_features(window=window_relative)
                label = classifier.predict(features.reshape(1, -1))[0]

                # current_window = (position, (position[0] + 8 * window['size'][0],
                #                              position[1] + 8 * window['size'][1]))
                # window_name = "temp_" + name + "_" + str(step)
                # #save_image(self.get_area_of_interest(img, current_window), name=window_name)

                if label == 'vehicles':
                    windows_with_vehicles.append({'position': position,
                                                  'label': label,
                                                  'window': name})

        return windows_with_vehicles
Returns a list of windows where a vehicle was found.
Returns a list of windows where a vehicle was found.
Returns a list of windows where a vehicle was found .
def sliding_search(self, img, classifier):
        windows_with_vehicles = []
        analyser = self.image_analyser
        for name, window in self.search_windows.items():
            n_steps = self.get_nsteps(window)
            self.update_image_analyser(img, window)
            for step in range(n_steps):
                position = self.get_window_position(step, window)
                position = self.convert_to_px(position)
                window_relative = self.get_relative_window_coordinates(window,
                                                                       step)
                features = analyser.get_image_features(window=window_relative)
                label = classifier.predict(features.reshape(1, -1))[0]
                if label == 'vehicles':
                    windows_with_vehicles.append({'position': position,
                                                  'label': label,
                                                  'window': name})
        return windows_with_vehicles
def sliding_search ( self , img , classifier ) : windows_with_vehicles = [ ] analyser = self . image_analyser for name , window in self . search_windows . items ( ) : n_steps = self . get_nsteps ( window ) self . update_image_analyser ( img , window ) for step in range ( n_steps ) : position = self . get_window_position ( step , window ) position = self . convert_to_px ( position ) window_relative = self . get_relative_window_coordinates ( window , step ) features = analyser . get_image_features ( window = window_relative ) label = classifier . predict ( features . reshape ( 1 , - 1 ) ) [ 0 ] if label == 'vehicles' : windows_with_vehicles . append ( { 'position' : position , 'label' : label , 'window' : name } ) return windows_with_vehicles
Returns a list of windows where a vehicle was found.
Returns a list of windows where a vehicle was found .
"""Returns a list of windows where a vehicle was found.""" # current_window = (position, (position[0] + 8 * window['size'][0], #                              position[1] + 8 * window['size'][1])) # window_name = "temp_" + name + "_" + str(step) # #save_image(self.get_area_of_interest(img, current_window), name=window_name)
self
img
classifier