当前位置: 首页>>代码示例>>Python>>正文


Python Feature.getFeaturesVectors方法代码示例

本文整理汇总了Python中feature.Feature.getFeaturesVectors方法的典型用法代码示例。如果您正苦于以下问题:Python Feature.getFeaturesVectors方法的具体用法?Python Feature.getFeaturesVectors怎么用?Python Feature.getFeaturesVectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在feature.Feature的用法示例。


在下文中一共展示了Feature.getFeaturesVectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: xrange

# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import getFeaturesVectors [as 别名]
test_files = []
valid_files_count = 0
test_files_count = 0
test_superpixels = []
train_superpixels = []
validation_original_image = []
test_original_image = []
test_pixels_labels = []
valid_pixels_labels = []
valid_superpixels = []

for i in xrange(0,num_images):
	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')
开发者ID:patriciocordova,项目名称:road-estimation,代码行数:33,代码来源:data_preprocessing.py


注:本文中的feature.Feature.getFeaturesVectors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。