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

5 views (last 30 days)
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 Comments
Adam Danz
Adam Danz on 18 Jan 2022
Edited: Adam Danz on 18 Jan 2022
...or do you want to get color information of the image within the black circle?

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 19 Jan 2022
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 Comments
Anonymous
Anonymous on 20 Jan 2022
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 on 20 Jan 2022
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!