problem finding roi formula for ct scan image
2 ビュー (過去 30 日間)
古いコメントを表示
Before that, I'm sorry if my English is too bad. I want to find a formula for roi ct-scan images, but I am confused to enter the rect formula, what do you think about my formula? please help me show how the formula is right.
clc;clear
img = dicomread('Z17');
figure,imshow(img,[])
title('citra asli')
img2=imcomplement(img);
figure,imshow(img2,[])
title('citra negatif')
[x,y]=getpts;
a=x;
b=y;
xs=a;
ys=b;
rect=[xs-25 ys-25 100 50];
ROI=(imcrop(img,rect));
1 件のコメント
Image Analyst
2020 年 6 月 2 日
Where do you expect the user to click? You're cropping out a subimage that starts up and to the left 25 pixels. Also you do not need parentheses around (outside) the imcrop() function. And there really seems no reason to have a, b, xs, and ys at all when you could simply do
rect = [x-25, y-25, 100, 50];
回答 (1 件)
Sulaymon Eshkabilov
2020 年 6 月 2 日
If you'd need to collect the coordinates of a few selected points by a user, then you'd need to use:
[x, y]=ginput(1); % Selects the coordinates of 1 point (x1, y1)
rect = [x-25, y-25, 100, 50];
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!