In my program the user has to define ROIs by drawing them with the mouse (rectangles and polygons). But I want to prevent overlapping of these ROIs. For example: One rectangle ROI is already drawn. Then the user draws a second one and it overlaps the first one.
My software should automatically correct the second ROI by reducing its size so that it adjoins the first one but does not overlap.
I already have a solution by converting the existing ROIs to one mask and the new ROI to another mask. Then I apply IMAQ's LogDiff function on both images and get a mask image with my corrected new ROI (still as mask).
The problem now is to reconvert this mask to a ROI. The IMAQ MaskToROI function does exactly this but generates a polygone with hundreds of vectors (every two pixels are converted into one straight vector). My problem now is: This kind of ROI is no longer editable in practice. E.g. if you want to move one line of a rectangle you now must move hundreds of single points, simply not usable!
My question now: Is there a way to reconvert my mask image more intelligent, i.e. with a more intelligent vectorizer or does anybody have a different idea how to solve the problem.
Any ideas are appreciated.
Ingo Bartsch