本文整理汇总了Python中pylab.gray方法的典型用法代码示例。如果您正苦于以下问题:Python pylab.gray方法的具体用法?Python pylab.gray怎么用?Python pylab.gray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylab
的用法示例。
在下文中一共展示了pylab.gray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot
# 需要导入模块: import pylab [as 别名]
# 或者: from pylab import gray [as 别名]
def plot(self):
plt.figure(0)
plt.gray()
plt.subplot(131)
plt.imshow(self._images[0])
plt.subplot(132)
plt.imshow(self._images[1])
plt.subplot(133)
plt.imshow(self._fusionImage)
plt.show()
示例2: dshow
# 需要导入模块: import pylab [as 别名]
# 或者: from pylab import gray [as 别名]
def dshow(self, image, info):
if self.parameter['debug'] <= 0:
return
ion()
gray()
imshow(image)
ginput(1, self.parameter['debug'])
示例3: imgshow
# 需要导入模块: import pylab [as 别名]
# 或者: from pylab import gray [as 别名]
def imgshow(plt, w, dim_input, scale=False, colorImg=False, convertImgs=False, tile_spacing=(1,1)):
if convertImgs:
channelSize = w.shape[0]/3
w = tuple([w[channelSize*i:channelSize*(i+1)] for i in range(3)])
plt.axis('Off')
pil_image = mat_to_img(w, dim_input, scale, colorImg, tile_spacing)
plt.imshow(pil_image, cmap=pylab.gray(), origin='upper')
return pil_image
示例4: main_work
# 需要导入模块: import pylab [as 别名]
# 或者: from pylab import gray [as 别名]
def main_work():
#################################################
# ============= Process command line ============
a = ArgumentParser()
a.add_argument('-b', dest='binlabdir', required=True)
a.add_argument('-t', dest='text_lab_dir', required=True)
a.add_argument('-n', dest='norm_info_fname', required=True)
a.add_argument('-o', dest='outdir', required=True)
a.add_argument('-binext', dest='binext', required=False, default='lab')
a.add_argument('-skipterminals', action='store_true', default=False)
opts = a.parse_args()
# ===============================================
safe_makedir(opts.outdir)
norm_info = get_speech(opts.norm_info_fname, 425)[:,:-9]
data_min = norm_info[0,:]
data_max = norm_info[1,:]
data_range = data_max - data_min
text_label_files = set([basename(f) for f in glob.glob(opts.text_lab_dir + '/*.lab')])
binary_label_files = sorted(glob.glob(opts.binlabdir + '/*.' + opts.binext) )
print binary_label_files
for binlab in binary_label_files:
base = basename(binlab)
if base not in text_label_files:
continue
print base
lab = process_merlin_label(binlab, opts.text_lab_dir)
if opts.skipterminals:
lab = lab[1:-1,:] ## NB: dont remove 2 last as in durations, as the final punct does't features here
norm_lab = minmax_norm(lab, data_min, data_max)
if 0: ## piano roll style plot:
pl.imshow(norm_lab, interpolation='nearest')
pl.gray()
pl.savefig('/afs/inf.ed.ac.uk/user/o/owatts/temp/fig.pdf')
sys.exit('abckdubv')
np.save(opts.outdir + '/' + base, norm_lab)