I have a complex Region and a polyline which separates the region in two parts.
I would like to have the two subregions defined by that region and use them for other purposes.
Does anyone have an idea how to do it?
I have a complex Region and a polyline which separates the region in two
Share
What I eventually did is I used the Radial Sweep algorithm to contour around the region, starting where the polyline exited the region and stopping when the sweep reaches the point where the polyline entered the region. The sweep was done twice – once clockwise and once counterclockwise.
To find whether the radial pixels are in/out of the region at each iteration I used region.contains(x,y).
The radial sweep explained:
http://www.imageprocessingplace.com/downloads_V3/root_downloads/tutorials/contour_tracing_Abeer_George_Ghuneim/ray.html