Trace Image from Intensity

2 次查看(过去 30 天)
I have the following image and want to plot a line that follows the outline of the image based on the intensity. I considered using "bwtraceboundary" but I I want to be able to set the region in which it traces. For example, if the pixel is greater than 25% of the max pixel in that row, I want to save that point. After the code has spanned over all rows, all of the saved points will be a trace of the high intensity region of the image.
  1 个评论
Articat
Articat 2019-6-25
I tried this:
flamefront = [];
for c = 1:size(mean_max_upper)
r = 1;
indicator = 0;
while indicator == 0;
if mean_max_upper(r,c) >= .25*max(mean_max_upper(r,c));
indicator = 1;
flamefront = [flamefront; r,c];
end
r = r+1;
end
end
where mean_max_upper is the image and flamefront is the array I would like to fill. However it's just running from 1 to the amount of rows and not saving anything.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2019-6-25
Try
mask = grayImage > someThreshold
boundaries = bwboundaries(mask)

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by