作者 主題: 圖像 processing  (閱讀 6513 次)

0 會員 與 1 訪客 正在閱讀本文。

nobrainer

  • 可愛的小學生
  • *
  • 文章數: 1
    • 檢視個人資料
圖像 processing
« 於: 2011-03-27 13:32 »
大家好,我想問,在Python中,如果我 load 了一個圖像,


怎樣可以讀取所有image 的 pixies, 跟著 save 在array 裡?

我看了一下 PIL ( Python image library) ... 但找唔到 , getpixie() 又有點怪

thanks

elleryq

  • 鑽研的研究生
  • *****
  • 文章數: 908
  • 性別: 男
    • 檢視個人資料
    • Thinking more...
回覆: 圖像 processing
« 回覆 #1 於: 2011-03-30 10:37 »
getdata

im.getdata() => sequence

Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on.

Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations, including iteration and basic sequence access. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()).

The Image Module
Plan your work, then work your plan.
我的首頁:http://blog.elleryq.idv.tw
351899by http://counter.li.org