Boost logo

Geometry :

Subject: [geometry] Polygons <-> image with a given ofset and reslution
From: Johan Doré (jdh_at_[hidden])
Date: 2014-12-03 16:34:28


Dear Boost Geometry,

We are happy users of boost::geometry for a broad range of our image analysis algorithms.

In our work we often need to draw polygons in byte** images with a given offset and resolution, as well as to convert from image object back to polygons.

When work with polygons their x,y coordinates are in millimeters and when we draw these polygons in an image we try to fill all pixels with a spatial center inside the polygon, and leave pixels with centers outside the polygon blank.

When converting from image objects (Collection of neighboring pixels with the same value) to polygons, we do it by tracing the outer border of such objects.
An example could be a 3x3 pixels image with the center pixels set to 1. If that image has its origin at 0,0 and the resolution is 1x1 pixel/millimeter. Then the closed clockwise polygon would become
{-0.5, 0.5}, {0.5, 0.5}, {0.5, -0.5}, {-0.5, -0.5}, {-0.5, 0.5}.

Now our functionality for drawing these polygons in images and our functionality for tracing the outline is far from optimal, and I wonder if you know of any boost functionality we could use instead?

Thanks in advance

Johan Doré,
Visiopharm



Geometry list run by mateusz at loskot.net