How to express coordinate range of an area

1 回表示 (過去 30 日間)
afiqah nurhakim binti mohamad zaini
afiqah nurhakim binti mohamad zaini 2019 年 9 月 23 日
コメント済み: Johannes Fischer 2019 年 9 月 24 日
I want to read the pixel value of an area but I dont know how to write the coordinate range
x = [ 1119 until 1121]
y = [ 392 until 394]
I have to change the 'until' word into what symbol?

回答 (1 件)

Johannes Fischer
Johannes Fischer 2019 年 9 月 23 日
You are looking for the colon operator (https://www.mathworks.com/help/matlab/ref/colon.html)
x = 1119:1121;
y = 392:394;
  6 件のコメント
afiqah nurhakim binti mohamad zaini
afiqah nurhakim binti mohamad zaini 2019 年 9 月 24 日
error.png
Johannes Fischer
Johannes Fischer 2019 年 9 月 24 日
That error message means you are trying to get data points from a pixel that doesnt exist. Along the first dimension, your image has 825 pixels. with
x = [1119:1121];
you are trying to access data that does not exist, hence the error.
In order to see how big your image is, use
size(RGB)
It will give you the number of pixels along each dimension.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by