Queueing up is in my blood #
Worked on the actual stroke simplification/collapsing today. Ported over collapse queue from mesh simplification assignment (turned it into a real C++ object finally) and made it use an STL vector
for its storage instead of a hand-rolled chunked array. Collapsing seems to work to some extent, but a) it's slow and b) it's not quite right.
The speed issues seem to stem from the fact that my error function computes error across the entire stroke (overlap between it and the original thinned pixels). At each point then I store this error value assuming that that point had been removed. What I really need to store is the delta in the function when it is removed, and that way when I remove a completely unrelated point, I shouldn't have to worry this one. Not handling this updating properly is also what I think is causing the correctness issues - when I do the most thorough updating possible (update all other entries after one is removed, regardless of connectivity) I get better results.
Post a Comment