problem finding roi formula for ct scan image
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Image Analyst
am 2 Jun. 2020
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];
Antworten (1)
Sulaymon Eshkabilov
am 2 Jun. 2020
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 Kommentare
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!