當前位置: 首頁>>代碼示例>>Python>>正文


Python pylab.gray方法代碼示例

本文整理匯總了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() 
開發者ID:pfchai,項目名稱:ImageFusion,代碼行數:12,代碼來源:fusion_dwb.py

示例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']) 
開發者ID:OCR-D,項目名稱:ocrd_anybaseocr,代碼行數:9,代碼來源:ocrd_anybaseocr_binarize.py

示例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 
開發者ID:dpkingma,項目名稱:nips14-ssl,代碼行數:10,代碼來源:paramgraphics.py

示例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) 
開發者ID:CSTR-Edinburgh,項目名稱:ophelia,代碼行數:49,代碼來源:process_merlin_label.py


注:本文中的pylab.gray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。