problem finding roi formula for ct scan image
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Image Analyst
le 2 Juin 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];
Réponses (1)
Sulaymon Eshkabilov
le 2 Juin 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 commentaires
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!