inf = imfinfo('twins.tif');觀察 workspace 中的變化,
我們發現 IMFINFO 傳回值都放到一個特定型態的結構之中。連按 inf 兩下, 就可以打開 Array Editor 視窗, 觀察 inf 的實際內容。
inf = imfinfo('twins.tif');觀察 workspace 中的變化,
imshow(w)
A = IMREAD(FILENAME,FMT) reads a grayscale or color image from the file specified by the string FILENAME, where the string FMT specifies the format of the file.我們直接用例子說明。請下載範例影像 wombats.tif 與 twins.tif 後, 在 Command Window 鍵入:
w=imread('wombats.tif');你會發現在 workspace 視窗中, 已經多了一列資料, 告訴你 w 這個矩陣變數的大小就是 256 * 256, 每個元素的資料型態是 uint8, 換句話說就是長度為 8 位元的 unsigned integer, 沒有正負號的整數。因此, 可表示的數值範圍為 0 ~ 255 的正整數。
x=imread('twins.tif');觀察 workspace 就會發現多了一個三維陣列 x。