Image ROI Label Issue
显示 更早的评论
Hello,
I currently have a code which outputs images, I would like to label different ROI within these images using consecutive numbers. I have written some code to compute the centroid of the ROIs within the image that I would like to label, this data is stored in "props".
"props" is a 1 x 4 cell (I have 4 images, each cell corresponds to a different image). Each of the cells in "props" contains a 5 (the current images have 5 different ROI each) x 1 struct with 2 fields (Centroid Position and Mean Intensity). Here is the code I have thus far:
for i = i:length(props)
imagesc(boutput{1,i});
axis image
colormap('gray')
end
labelShiftX = -7; %simply for aligning number placement
for k = length(props{1})
cent = props{k}.Centroid;
text(cent(1) + labelShiftX, cent(2), num2str(k));
end
To note, "props" was generated using the regionprops function which takes in boutput and output, the binarized and original images, respectively.
So far, my code is not accomplishing the task and the ROIs within the image are not labeled. Any suggestions on how to proceed?
Thank you for your time and attention!!!!
2 个评论
Image Analyst
2017-9-1
If props was generated by regionprops(), it's a structure array, not a cell array, and you'd use parentheses, not braces. Or it could be a table if you asked for a table. Please show the entire code.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!