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


Python Feature.getSuperpixelsSize方法代码示例

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


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

示例1:

# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import getSuperpixelsSize [as 别名]
	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())
			#validation_original_image.append(images[i])
开发者ID:patriciocordova,项目名称:road-estimation,代码行数:33,代码来源:data_preprocessing.py


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