Extracting part of an image

조회 수: 4 (최근 30일)
Jaeyong Oh
Jaeyong Oh 2019년 8월 8일
편집: Matt J 2019년 8월 9일
Hi, I am trying to extract a part of an image to get average pixel intensity of that part.
Attached image '1.jpg' is the original image and '1.. line.jpg' shows the part that I want to extract.
I cannot use the imcrop command since the part I want is not rectangular.
I tried using the drawpolygon command and got the vertices of the polygon, but I couldn't take it any further.
Can anybody help me?
Thank you in advance.

답변 (1개)

Matt J
Matt J 2019년 8월 9일
편집: Matt J 2019년 8월 9일
Use impoly instead of drawpolygon. Use the createMask() method of the impoly object h to extract the ROI pixels
pixelvalues = yourImage(h.creatMask)

카테고리

Help CenterFile Exchange에서 Build Interactive Tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by