How to extract the information from a specific line which draws on an image in matlab?

조회 수: 8 (최근 30일)
Dear all, I have a problem for my project. I have a bunch of matrixs M by N by Z.
I binerized all matrixs and find the boundaries for each M by N matrix and apply them on original image same as the attached images (Red lines).
I would like to extract the information from cells which assign to a specific line.
To do this, I draw a shrinked border in black color and I would like to extract the information of the cells that the black line overlab with them.
Here I mean the black line which shows in the third image.
  댓글 수: 3
Adam Danz
Adam Danz 2022년 1월 18일
편집: Adam Danz 2022년 1월 18일
...or do you want to get color information of the image within the black circle?
Ali Hariri
Ali Hariri 2022년 1월 19일
Dear Max Heimann and Adam Danz
I need the color information of the pixels in my original image which has the same location as black line in the processes image.
imagine the (x,y) positions of the black line is my target which I need to know its color information from my original image.

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

채택된 답변

Image Analyst
Image Analyst 2022년 1월 19일
If xBlack and yBlack are the vectors that you plotted for the black curve, you can get the values underneath the lines by doing this
for k = 1 : length(xBlack)
v(k) = data(yBlack(k), xBlack(k)); % Note that y comes first because it's "row".
end
v will be a vector of data values at the black curve locations.
  댓글 수: 6
Anonymous
Anonymous 2022년 1월 20일
No, it was a seperate question actually, I am sorry if that was an inappropriate way to ask here in this discussion.
Ali Hariri
Ali Hariri 2022년 1월 20일
Dear @Image Analyst I found my mistake here, thank you for your support. Furthermore, I dont know Anonymous, as said it was a separate question.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by