Obtaining the pixel values within an ROI

조회 수: 17 (최근 30일)
Meghana Balasubramanian
Meghana Balasubramanian 2020년 1월 17일
댓글: Meghana Balasubramanian 2020년 1월 20일
Hello,
I have an image where the object of interest is curved and I would like to linearize it. To do that, I thought I could read the pixel values between the region created by (x1, y1), (x2, y2) and (a1, b1), (a2, b2) and reposition them in a linear manner. Assume that the x & y coordinates refer to the red line and a & b refer to the yellow. The ROI is the area in white.
I am not aware of how I could go about this.
Thank you, in advanceimage2.jpg

채택된 답변

KSSV
KSSV 2020년 1월 17일
As you have the coordinates for the boundary, use inpolygon and get the locations of the points lying inside the clsoed region......with these indices, you can get your pixel values. Read about inpolygon.
  댓글 수: 1
Meghana Balasubramanian
Meghana Balasubramanian 2020년 1월 20일
I'm not able to use inpolygon for an image. It doesn't seem to identify the pixels as points.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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