[Scilab-users] creating ROI from mouse clicks

Philipp Mühlmann p.muehlmann at gmail.com
Fri Mar 11 06:39:13 CET 2016


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.

Any idea?

BR
Philipp

-- 
There we have the salad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20160311/21e72628/attachment.htm>


More information about the users mailing list