How to choose a specific area of an image?

8 ビュー (過去 30 日間)
Ann G
Ann G 2015 年 10 月 5 日
コメント済み: Image Analyst 2017 年 12 月 9 日
I would like to ask you how to choose a specific area of an image and then use the elements of this content?
  5 件のコメント
Yap Sam
Yap Sam 2017 年 12 月 9 日
Hi, I have a question here. Lets say, I have defined an area of polygon using its x and y coordinates. But,how do I able to find out the mean pixels intensity of this area of polygon? Secondly,how should I apply the"if" condition to thershold a certain value of mean intensity of this polygon area.
Kindly advice
Image Analyst
Image Analyst 2017 年 12 月 9 日
Make a mask and then use mean on the masked image:
mask = poly2mask(x, y, rows, columns);
theMeanIntensity = mean(grayImage(mask));

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

採用された回答

Stephen23
Stephen23 2015 年 10 月 5 日
You need to use some kind of array indexing. Often the easiest is to use logical indexing, which would allow you to select the area that you want.

その他の回答 (1 件)

Image Analyst
Image Analyst 2015 年 10 月 5 日
If you want masking demos, ask me.

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by