<address id="zhpbl"></address>
<noframes id="zhpbl">
<address id="zhpbl"><form id="zhpbl"><th id="zhpbl"></th></form></address>

    <em id="zhpbl"></em>

      <address id="zhpbl"><th id="zhpbl"><progress id="zhpbl"></progress></th></address>
      更多精彩內容,歡迎關注:

      視頻號
      視頻號

      抖音
      抖音

      快手
      快手

      微博
      微博

      python skimage

      文檔

      python skimage

      python skimage是基于scipy的一款圖像處理包,它將圖片作為numpy數組進行處理,正好與matlab一樣,因此,常用于進行數字圖像處理。
      推薦度:
      導讀python skimage是基于scipy的一款圖像處理包,它將圖片作為numpy數組進行處理,正好與matlab一樣,因此,常用于進行數字圖像處理。

      python skimage是什么呢?一起來看下吧:

      scikit-image是基于scipy的一款圖像處理包,它將圖片作為numpy數組進行處理,正好與matlab一樣,因此,我們最終選擇scikit-image進行數字圖像處理。

      Image讀出來的是PIL的類型,而skimage.io讀出來的數據是numpy格式的

      import?Image?as?img
      import?os
      from?matplotlib?import?pyplot?as?plot
      from?skimage?import?io,transform
      #Image和skimage讀圖片
      img_file1?=?img.open('./CXR_png/MCUCXR_0042_0.png')
      img_file2?=?io.imread('./CXR_png/MCUCXR_0042_0.png')

      輸出可以看出Img讀圖片的大小是圖片的(width, height);而skimage的是(height,width, channel), [這也是為什么caffe在單獨測試時要要在代碼中設置:transformer.set_transpose('data',(2,0,1)),因為caffe可以處理的圖片的數據格式是(channel,height,width),所以要轉換數據]

      #讀圖片后數據的大?。?
      print?"the?picture's?size:?",?img_file1.size
      print?"the?picture's?shape:?",?img_file2.shape
      the?picture's?size:??(4892,?4020)
      the?picture's?shape:??(4020,?4892)
      #得到像素:
      print(img_file1.getpixel((500,1000)),?img_file2[500][1000])
      print(img_file1.getpixel((500,1000)),?img_file2[1000][500])
      print(img_file1.getpixel((1000,500)),?img_file2[500][1000])
      (0,?139)
      (0,?0)
      (139,?139)

      如果我們想知道一些skimage圖片信息

      from?skimage?import?io,?data
      img?=?data.chelsea()
      io.imshow(img)
      print(type(img))??#顯示類型
      print(img.shape)??#顯示尺寸
      print(img.shape[0])??#圖片高度
      print(img.shape[1])??#圖片寬度
      print(img.shape[2])??#圖片通道數
      print(img.size)???#顯示總像素個數
      print(img.max())??#最大像素值
      print(img.min())??#最小像素值
      print(img.mean())?#像素平均值
      print(img[0][0])#圖像的像素值

      skimage提供了io模塊,顧名思義,這個模塊是用來圖片輸入輸出操作的。為了方便練習,也提供一個data模塊,里面嵌套了一些示例圖片,我們可以直接使用。

      以上就是小編今天的分享,希望可以幫助到大家。

      文檔

      python skimage

      python skimage是基于scipy的一款圖像處理包,它將圖片作為numpy數組進行處理,正好與matlab一樣,因此,常用于進行數字圖像處理。
      推薦度:
      為你推薦
      資訊專欄
      熱門視頻
      相關推薦
      armoury crate打不開 java process deque java linux 格式化u盤 js讀取文件 python 交集 object 轉list object轉bigdecimal java get和set方法 python中get函數用法 js set方法 mysql去重復 保留一條 rstudio使用教程 oracle coalesce python configparser模塊 python strip函數 python調用dll java concat js 遍歷json js json對象 vue使用jquery js set去重 python的range函數用法 vue 調用子組件方法 java反射獲取屬性值 python中find函數的用法 getclass方法 python中strip函數的用法 js class類 mysql time類型 python中sorted函數的用法 cad的基本命令 ubuntu卸載mysql js獲取隨機數 opencv安裝教程python python numpy教程 js獲取日期 python tkinter教程 java reentrantlock c語言struct用法
      Top 少妇高潮太爽了在线视频