How to read a pixelregion of a .tif image

1 回表示 (過去 30 日間)
Zoe
Zoe 2019 年 12 月 28 日
コメント済み: Amal George M 2019 年 12 月 30 日
I am trying to read just a portion of my .tif image since reading the entire one takes hours and hours. My code is:
a = imread('landcover.tif','PixelRegion',{[1:96684],[1,1000]});
The error comes up and I do not know why:
Error using imread (line 438)
PixelRegion values must contain [START, STOP] or [START,
INCR, STOP].
But if I only want to look at [1,2], [1,2], it could work:
a = imread('landcover.tif','PixelRegion',{[1:2],[1,2]});
If anyone can help, I will really appreciate it! Thank you!
  1 件のコメント
Amal George M
Amal George M 2019 年 12 月 30 日
ROWS and COLS must both be two-element vectors, which specify starting and ending rows (or columns).
Try :
a = imread('landcover.tif','PixelRegion',{[1,96684],[1,1000]});

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by