Quadtree decomposition

Hi!
I’m working on a mapping of flooded regions. I’ve already done all the preprocessing stuff of the images with the module snappy. Now I should do a quadtree decomposition by selecting the tiles based on the values ​​of some coefficients. it’s my first python project and I don’t know what is the best way to implement the decomposition. Do you have some advice? Has someone ever done this type of decomposition?
Thanks

I’m still attending intensive courses of python,

But might be these could help your start point in Quadtree decomposition

Source: https://github.com/ilmanzo666/quadtree-image-decomposition

Source: https://pypi.org/project/smartquadtree/