How to choose a specific area of an image?

조회 수: 6 (최근 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 CenterFile Exchange에서 Geometric 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