Quadtree decomposition on non square image

730 views Asked by At

Does anyone know the best way to perform Quadtree decomposition on a non square image? I keep getting lines appearing across my image which is drawn using a Quadtree.

1

There are 1 answers

2
Gareth McCaughan On BEST ANSWER

The simplest thing would probably be to imagine that your image is embedded in a square image (placed centrally, so that bisection of the larger image corresponds to bisection of the smaller one). When drawing it, of course you'd then need to avoid drawing bits that aren't actually within the image rectangle, but I'd have thought the special-case code needed for that would be simpler than the special-case code needed to handle non-square images.

Without more information about just what you're doing and just what's going wrong, I don't think there's much prospect of debugging your lines-appearing-across-the-image problem. (Is it possible that the underlying problem there is that your size isn't a power of 2, rather than that it's not square? In other words, that something isn't being done quite right when bisecting the image produces "halves" of different sizes?)