[Scilab-users] ?==?utf-8?q? creating ROI from mouse clicks

Antoine Monmayrant amonmayr at laas.fr
Fri Mar 11 08:59:37 CET 2016


 
Le Vendredi 11 Mars 2016 06:39 CET, Philipp Mühlmann <p.muehlmann at gmail.com> a écrit: 
 
> Dear all,
> 
> how can I use mouse clicks to create a region of interest (ROI) for image
> processing without using IPD toolbox?
> 
> 
> My current aproach is something like this:
> 
> 
> 
> 1.) display an 2-D array, e.g.: a grayscale image
> 
> 2.) use xclick to get mouse coordinates
> 
> 3.) use xfpoly to draw a mask image based on the points clicked with the
> mouse
>      --> mask image has same size as 2D-array in 1.)
>      --> mask image starts as zeros only
>      --> xfpoly will fill the polygons white =ROI
>      --> result is a 2D array containing only "0" and "1" --> can be saved
> as b/w image
> 
> 4.) use xs2bmp to save the mask image temporarily
> 
> 5.) use "ReadImage" from IPD-toolbox to load the temporary image and delete
> this temporary image afterwards
> 
> 6.) now the mask can be applied onto the original image such as:
> result_image = input_image .* mask_image;
> 
> 
> 
> I'd prefer to get already the position of the area filled by xfpoly in step
> 3.) as a variable.
> This would prevent the need of the temporary image and the need of using
> IPD.

Hi,

I am not sure this corresponds to what you are looking for, but an alternative to xclick could be rubberbox:

[final_rect, btn] = rubberbox()


Antoine


> 
> Any idea?
> 
> BR
> Philipp
> 
> -- 
> There we have the salad.
 
 
 
 





More information about the users mailing list