本文整理汇总了Python中feature.Feature.getSuperpixelsHog方法的典型用法代码示例。如果您正苦于以下问题:Python Feature.getSuperpixelsHog方法的具体用法?Python Feature.getSuperpixelsHog怎么用?Python Feature.getSuperpixelsHog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feature.Feature
的用法示例。
在下文中一共展示了Feature.getSuperpixelsHog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Feature
# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import getSuperpixelsHog [as 别名]
feature = Feature()
feature.create(image_filenames[i],label_image_filenames[i])
labels = feature.getSuperpixelLabels()
feature_vectors = feature.getFeaturesVectors()
h, img_filename = os.path.split(image_filenames[i])
h, label_img_filename = os.path.split(label_image_filenames[i])
folder = "extracted/" + img_filename + "-" + label_img_filename + "/"
if not os.path.exists(folder):
os.makedirs(folder)
scipy.io.savemat(folder+"superpixel", {'features':feature.getSuperpixelImage()}, oned_as='column')
scipy.io.savemat(folder+"superpixel_labels", {'features':feature.getSuperpixelLabels()}, oned_as='column')
scipy.io.savemat(folder+"location", {'features':feature.getSuperpixelsLocation()}, oned_as='column')
scipy.io.savemat(folder+"color", {'features':feature.getSuperpixelsColor()}, oned_as='column')
scipy.io.savemat(folder+"hog", {'features':feature.getSuperpixelsHog()}, oned_as='column')
scipy.io.savemat(folder+"size", {'features':feature.getSuperpixelsSize()}, oned_as='column')
scipy.io.savemat(folder+"texture", {'features':feature.getSuperpixelsTexture()}, oned_as='column')
scipy.io.savemat(folder+"features_combined", {'features':feature.getFeaturesVectors()}, oned_as='column')
if file_labels[i] != TESTING:
# store data
if file_labels[i] == TRAINING:
train_superpixels.append(feature.getSuperpixelImage())
train_labels = np.append(train_labels, labels, 0)
if train_data==[]:
train_data = feature_vectors
else:
train_data = np.vstack((train_data,feature_vectors))
else:
valid_superpixels.append(feature.getSuperpixelImage())