problem finding roi formula for ct scan image
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Image Analyst
el 2 de Jun. de 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];
Respuestas (1)
Sulaymon Eshkabilov
el 2 de Jun. de 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 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!