Using ROI in MATLAB

I have a final project in MATLAB and I need help.

I create a graphical interface and display the image using the function imshow, now I want to select an area from the image and get the pixels of the selected area.

I know the ROI method, but I don’t know how to use it, so I am very happy if someone can explain this to me. thank.

+3
source share
1 answer

Choosing an ROI is pretty simple if you have an image processing toolbar. There are many ways to do this, but I recommend using the roipoly function. Just write:

BW = roipoly(I);

where I am your image. You will then be asked to select points for your ROI. The output of BW will be a binary image with a value of 1 inside the ROI and 0 outside.

:

http://www.mathworks.com/help/toolbox/images/ref/roipoly.html

:

imrect ROI. , , imshow . roi, createMask .

imshow(I); 
h = imrect;
BW = createMask(h);

http://www.mathworks.com/help/toolbox/images/ref/imrect.html

+5

Source: https://habr.com/ru/post/1788976/


All Articles