mikolalysenko / rectangle-decomposition

Computes a minimal rectangular decomposition of a rectilinear polygon
MIT License
76 stars 7 forks source link

How would one use this with a binary image? #1

Closed adishavit closed 9 years ago

adishavit commented 9 years ago

Say I have a binary image that I would like to decompose with this lib. From the interface, it seems that the image (pixels) need to be decomposed into 4-connected contours. Is this correct?
If so, do you have a recommendation for a library that can do this?

mikolalysenko commented 9 years ago

Use this module: https://github.com/mikolalysenko/bitmap-to-boxes

adishavit commented 9 years ago

Cool! Thanks :-)

adishavit commented 9 years ago

BTW, is there a module for doing this for grayscale image? I.e. segment single color contiguous regions into rectangles.

mikolalysenko commented 9 years ago

You could use ndarray-ops.eq to pull out each level and segment them separately, but nothing right now that works out of the box.

adishavit commented 9 years ago

Thanks.