imganalyser.py
def extract_hog_features(self):
        """Extract the "Histogram of Oriented Gradients" for the region of
        interest of the current image.
        """
        img = self.image
        orient = self.hog_params['orientations']
        pix_per_cell = self.hog_params['pix_per_cell']
        cell_per_block = self.hog_params['cell_per_block']
        visualise = self.hog_params['visualise']

        channels = img.shape[2]
        hog_features = []
        hog_images = []

        if visualise:
            for i in range(channels):
                features, image = hog(img[:, :, i],
                                      orientations=orient,
                                      pixels_per_cell=(pix_per_cell,
                                                       pix_per_cell),
                                      cells_per_block=(cell_per_block,
                                                       cell_per_block),
                                      visualise=visualise,
                                      block_norm='L2-Hys',
                                      transform_sqrt=False, 
                                      feature_vector=False)
                hog_features.append(features)
                hog_images.append(image)
            result = (np.array(hog_features), hog_images)
        else:
            for i in range(channels):
                features = hog(img[:, :, i],
                               orientations=orient,
                               pixels_per_cell=(pix_per_cell,
                                                pix_per_cell),
                               cells_per_block=(cell_per_block,
                                                cell_per_block),
                               visualise=visualise,
                               block_norm='L2-Hys',
                               transform_sqrt=False, 
                               feature_vector=False)
                hog_features.append(features)
            result = (np.array(hog_features))

        return result
Extract the "Histogram of Oriented Gradients" for the region of
        interest of the current image.
        
Extract the "Histogram of Oriented Gradients" for the region of
interest of the current image.
Extract the " Histogram of Oriented Gradients " for the region of interest of the current image .
def extract_hog_features(self):
        img = self.image
        orient = self.hog_params['orientations']
        pix_per_cell = self.hog_params['pix_per_cell']
        cell_per_block = self.hog_params['cell_per_block']
        visualise = self.hog_params['visualise']
        channels = img.shape[2]
        hog_features = []
        hog_images = []
        if visualise:
            for i in range(channels):
                features, image = hog(img[:, :, i],
                                      orientations=orient,
                                      pixels_per_cell=(pix_per_cell,
                                                       pix_per_cell),
                                      cells_per_block=(cell_per_block,
                                                       cell_per_block),
                                      visualise=visualise,
                                      block_norm='L2-Hys',
                                      transform_sqrt=False, 
                                      feature_vector=False)
                hog_features.append(features)
                hog_images.append(image)
            result = (np.array(hog_features), hog_images)
        else:
            for i in range(channels):
                features = hog(img[:, :, i],
                               orientations=orient,
                               pixels_per_cell=(pix_per_cell,
                                                pix_per_cell),
                               cells_per_block=(cell_per_block,
                                                cell_per_block),
                               visualise=visualise,
                               block_norm='L2-Hys',
                               transform_sqrt=False, 
                               feature_vector=False)
                hog_features.append(features)
            result = (np.array(hog_features))
        return result
def extract_hog_features ( self ) : img = self . image orient = self . hog_params [ 'orientations' ] pix_per_cell = self . hog_params [ 'pix_per_cell' ] cell_per_block = self . hog_params [ 'cell_per_block' ] visualise = self . hog_params [ 'visualise' ] channels = img . shape [ 2 ] hog_features = [ ] hog_images = [ ] if visualise : for i in range ( channels ) : features , image = hog ( img [ : , : , i ] , orientations = orient , pixels_per_cell = ( pix_per_cell , pix_per_cell ) , cells_per_block = ( cell_per_block , cell_per_block ) , visualise = visualise , block_norm = 'L2-Hys' , transform_sqrt = False , feature_vector = False ) hog_features . append ( features ) hog_images . append ( image ) result = ( np . array ( hog_features ) , hog_images ) else : for i in range ( channels ) : features = hog ( img [ : , : , i ] , orientations = orient , pixels_per_cell = ( pix_per_cell , pix_per_cell ) , cells_per_block = ( cell_per_block , cell_per_block ) , visualise = visualise , block_norm = 'L2-Hys' , transform_sqrt = False , feature_vector = False ) hog_features . append ( features ) result = ( np . array ( hog_features ) ) return result
Extract the "Histogram of Oriented Gradients" for the region of
interest of the current image.
Extract the " Histogram of Oriented Gradients " for the region of interest of the current image .
"""Extract the "Histogram of Oriented Gradients" for the region of
        interest of the current image.
        """
self