Name

imroi — Roi (region of interest) of an image

Calling Sequence

mask=imroi(image[,type_of_mask,option])

Parameters

image
A gray, color or binary image.
type_of_mask
'rect' rectangular or 'ellipse' are the only available selections by now.
option
0 displays no coordinates (default) 1 displays coordinates
mask
Binary matrix (0 and 1) corresponding to the image selection. It has the same size as the input image (e.g. it is 3D if the input is 3D, and 2D if the input is 2D).

Description

The function allows the user to select a Region of Interest (ROI) in an image ALREADY DISPLAYED, and returns the corresponding binary matrix.

The mask is working with any of binary, gray or color images.

With the ellipse selection, you draw the rectangle in which the ellipse is drawn.

Examples

       a=imread(SIPDIR+'images/ararauna.jpg');
       xset("window",0);xbasc();
       imshow(a);
       mask=imroi(a);
       //the user must then select the ROI with the mouse
       b=a.*mask;
       xset("window",1);xbasc();
       imshow(b);//displays just the ROI
   

TIP

To generate much more complex ROI's, you can use the Gimp (GNU Image Manipulation Program) [www.gimp.org], although of course this is not an integrated solution.

Authors

Jocelyn DRUEL <jocelyn.druel1@libertysurf.fr>
The code to display coordinates comes directly from the function xgetpixel by Ricardo Fabbri

Availability

The latest version of the Scilab Image Processing toolbox can be found at

http://siptoolbox.sourceforge.net

See Also

imread , xgetpixel , GIMP