def extract(cls, picture=None, params=default_param): feature = cls.extractor(picture, P=params['P'], R=params['R'], method=params['method']) return feature.ravel()
def extract_one(self, image): # print (self.config['frequency'], self.config['fre'], self.config['fre']) feature_lbp, foo = skimage.filters.gabor(image,frequency = float(self.config['frequency'])) feature = self.extractor(feature_lbp, pixels_per_cell=(int(self.config['pixels_per_cell_x']), int(self.config['pixels_per_cell_y'])), cells_per_block=(int(self.config['cells_per_block_x']), int(self.config['cells_per_block_y']))) if bool(self.config['ravel']): feature = feature.ravel() # print(feature) return feature
def extract_one(self, image): # Extract feature feature = self.extractor(image, P=int(self.config.get('P', 32)), R=int(self.config.get('R', 1)), method=self.config.get( 'method', 'nri_uniform')) # Expend it? if bool(self.config.get('ravel', True)): feature = feature.ravel() return feature
def extract_one(self, image): # Extract feature feature = self.extractor( image, pixels_per_cell=(int(self.config.get('pixels_per_cell_x')), int(self.config.get('pixels_per_cell_y'))), cells_per_block=(int(self.config.get('cells_per_block_x')), int(self.config.get('cells_per_block_y')))) # print (feature) # Expend it? if bool(self.config.get('ravel', True)): feature = feature.ravel() # print('hog', len(feature)) return feature
def extract_one(self, image): feature_lbp = skimage.feature.local_binary_pattern(image, P=int(self.config.get('P')), R=int(self.config.get('R')), method=self.config.get('method')) feature = self.extractor(feature_lbp, pixels_per_cell=(int(self.config.get('pixels_per_cell_x')), int(self.config.get('pixels_per_cell_y'))), cells_per_block=(int(self.config.get('cells_per_block_x')), int(self.config.get('cells_per_block_y')))) if bool(self.config.get('ravel')): feature = feature.ravel() # print(feature) return feature
def extract_one(self, image): # print (self.config['frequency'], self.config['fre'], self.config['fre']) feature_lbp, foo = skimage.filters.gabor(image, frequency=float( self.config['frequency'])) # feature = self.extractor(feature_lbp, pixels_per_cell=(int(self.config['pixels_per_cell_x']), # int(self.config['pixels_per_cell_y'])), # cells_per_block=(int(self.config['cells_per_block_x']), # int(self.config['cells_per_block_y']))) feature = self.extractor(feature_lbp, P=int(self.config.get('P')), R=int(self.config.get('R')), method=self.config.get( 'method', 'nri_uniform')) if bool(self.config['ravel']): feature = feature.ravel() # print(feature) return feature
def extract(cls, picture=None, params=default_param): feature = cls.extractor(picture, pixels_per_cell=params['pixels_per_cell'], cells_per_block=params['cells_per_block']) return feature.ravel()