1

I'm looking for a a way that allows me to apply image processing techniques to a set of polygons that are defined by a set of points (x and y) and then apply the following opperations: substract,erode,dialate,get all area that form a continues area connected to a particulair spot.

The images are monochrome (no colour data).

Anybody know what a way to do this? I have looked at gtk-sharp but that seems to miss some of these functions and most other libraries only take raster graphics as input.

Opencv does not seem to work so well with a set of points (or is there a way to fix this?).

What I'm looking for is something like this:

image image;
List<List<Point>> shapes;
List<Point> extract;
foreach(List<Point> shape in shapes){
    image.add(shape)
} 
image.remove(extract)
image.erode(5);
image.dialate(5)
image.getAllConnectedTo(0,0); 

Anyone know a good library? Or a method to do this in general?

Note if anything is unclear feel free to ask so I can impprove it.

Thijser
  • 2,625
  • 1
  • 36
  • 71
  • 2
    Perhaps your problem stems from looking for 'image' libraries, when in fact your are looking for libraries for polygonal geometry operations. When dealing with vectors, erode and dilate are really just an offset of a polygon (see http://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons ). "subtract" and "get all area that forms a continuous area" sound like 2d boolean operations to me, perhaps you should search for that. – Rotem Oct 12 '15 at 08:36
  • That does look quite a bit like what I'm looking for thanks, do you happen to know the details of these operations in clipper? – Thijser Oct 12 '15 at 08:49
  • No, I haven't used Clipper, sorry. – Rotem Oct 12 '15 at 08:50

1 Answers1

0

I used SharpDX library for 3D graphics. They also had 2D module and samples on GitHub. It seems easy to use and well documented. Check this sample.

Here is code snippet from sample:

    void TessellationSink.AddTriangles(Triangle[] triangles)
    {
        // Add Tessellated triangles to the opened GeometrySink
        foreach (var triangle in triangles)
        {
            GeometrySink.BeginFigure(triangle.Point1, FigureBegin.Filled);
            GeometrySink.AddLine(triangle.Point2);
            GeometrySink.AddLine(triangle.Point3);
            GeometrySink.EndFigure(FigureEnd.Closed);                
        }
    }

All drawing stuff executes in "forever" loop. So, you changes will be displayed on the screen after new render occurs.