Unwrap your polyline masks

This week we’re talking about a tool that helps you position polyline masks more accurately.  The following diagram shows the idea we are exploring. Basically, perpendicular lines of interpolated samples are obtained at intervals along the length of the polyline, which then become the columns of the output image.

Sampling along polyline to generate output image

Sampling along polyline to generate output image

When isolating a object with a definite edge, the ideal output is a horizontal line at the exact center of the image, dividing the interior and exterior textures. The next three images show the tool in action on an image of Morning Glory Pool at Yellowstone National Park. This image has a high-contrast yellow-to-green edge along the bottom of the polyline (foreground of the image) and a yellow-to-gray edge along the top.

polyline_unwrap_pool

The next image shows what is happening conceptually. Interpolated samples are obtained along lines that are perpendicular to the polyline. The number of samples between key points is consistent, so the sampling is finer when the key points are closer to one another.

polyline_unwrap_samples

The next image shows the output from the tool, where the two high-contrast edges are visible in the image. While the polyline seems to track the edge well in the above images, the unwrapped output reveals some deviations from the ideal. A center-line guide is overlaid in blue and the yellow ticks along the top and bottom indicate the keypoint positions along the polyline.

Polyline unwrap parameters (resolution and # samples)

Increasing unwrap parameters. (a) Sampling factor - normal (b) Sampling factor - spline (c) Number of samples.

The diagram on the right shows some of the parameters of the unwrapping that we can adjust. If we increase the sampling factor in the normal direction, we see the effect in (a), which will accent deviations from the ideal edge. Diagram (b) shows the effect of increasing the sampling factor in the “spline direction”. This increases the width the output image as more columns are sampled along the polyline. Increasing the number of samples produces the effect illustrated in (c), where sampling lines increase in length with a corresponding increase in the height of the output image.

Another feature of the tool is interactive keypoint adjustment. Clicking and dragging on the output image vertically moves the corresponding keypoint along the polyline’s normal at that point. The image below shows this process, where a keypoint is moved to match the image edge, bringing the unwrapped image closer to the ideal.

We’ll be talking more about (and releasing) this tool in the near future. Chad is also preparing a quick video demo as well to post later in the week.

Click-drag the unwrap tool ouput to tweak a polyline into correct position.

Click-drag the unwrap tool ouput to tweak a polyline into correct position.

4 Responses

  1. Chad Says:

    I’m a little comment bot.

  2. russiaman Says:

    thank`s! helpfull!

  3. Dunn Says:

    This is really Cool Stuff!! Looking forward to the video and the tool! ;-) . Keep up the good work guys!!

  4. Chad Says:

    http://www.anatomicaltravel.com/research/2009/04/download-polyline-unwrap/

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.