フィルターのクリア

Use roipoly or poly2mask to calculate intensity

2 ビュー (過去 30 日間)
Ihiertje
Ihiertje 2017 年 2 月 1 日
コメント済み: Image Analyst 2017 年 2 月 1 日
Hi,
I used the function mmROI to draw three ROIs on multiple images (n=10). Now I have corrected the original images and I want to calculate the mean value within the ROI again. I tried two things with both the roipoly and poly2mask from the mmROI function. However, I cannot get the mean value from the predefined ROI in the new images.
if true
I = Fluo_Corrected_ExpTime(:,:,:,1);
J = imadjust(I);
BW = roipoly(X1, Y1,J,720,1080);
imshow(J)
hold on
plot(X1, Y1, 'r.-', 'MarkerSize',15);
end
and
if true
I = Fluo_Corrected_ExpTime(:,:,:,2);
J = imadjust(I);
imagesc(I)
ROI1 = poly2mask (X1, Y1,720,1080); %mxn is size image
Bimg = imagesc(ROI1) end
Hope you can help me again

回答 (1 件)

Image Analyst
Image Analyst 2017 年 2 月 1 日
You need to call poly2mask() for each ROI that the user draws and then OR them together:
ROI1 = poly2mask(x1, y1, rows, columns);
ROI2 = poly2mask(x2, y2, rows, columns);
ROI3 = poly2mask(x3, y3, rows, columns);
ROI = ROI1 | ROI2 | ROI3;
You can get the x,y from imfreehand(), roipoly(), or roipolyold().
  2 件のコメント
Ihiertje
Ihiertje 2017 年 2 月 1 日
Thank you for your reaction. I managed to get coordinates from the ROIs. However, I have problems to apply these ROI to another image and measure the mean intensity value within that ROI. Can you maybe help me with that as well?
Image Analyst
Image Analyst 2017 年 2 月 1 日
Sure. What's the problem? You used regionprops() didn't you? That should do it. See my Image Segmentation Tutorial for a full well commented demo. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by