Problems with offset

Using a point as the interior contour is problematic for some irregularly shaped segments. Since the point is simply the average of all of the points that make up the boundary, the output will be biased towards it. This can be seen in the output of the previous post.

This can be solved by using an offset of the boundary, as can be seen here with the blue and red lines. Ehren has a function to take care of this, however it cannot offset it very far.

combIso.png

A solution to this is to use morphological erosion. The technique includes going around the boundary pixel by pixel and removing any parts of the region that are within a certain distance of this boundary pixel. The outcome will look like this;imgEroded.png

With this technique, we are able to erode to any size we want, by just changing a single number. The above example is a 4px erosion, whereas the bottom example is a 20px erosion.

imgEroded.png

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s