OCR4all / LAREX

A semi-automatic open-source tool for Layout Analysis and Region EXtraction on early printed books.
MIT License
179 stars 33 forks source link

Automatic polygon simplification #286

Closed maxnth closed 2 years ago

maxnth commented 2 years ago

Allow automatically simplifying existing polygons using e. g. the Douglas–Peucker algorithm

bertsky commented 2 years ago

Allow automatically simplifying existing polygons using e. g. the Douglas–Peucker algorithm

Very useful indeed. However, I'd recommend against naive implementation of Douglas-Peucker, because that might change the topology and its result may depend on the order / starting-point of the coordinate ring. Shapely offers a preserve_topology option against this. In OCR-D core's PAGE validator (which ensures both self-validity and consistency between parent and child), this is how we deal with it.

maxnth commented 2 years ago

merged

bertsky commented 2 years ago

295 is fantastic – but only applies to the region level. Often, the most complicated polygons (and most editing effort) is on the line level. Any chance we can get that, too?

bertsky commented 2 years ago

This can be closed – thanks @chaddy314!