Python Forum

Full Version: Plot/Image analysis %of colored area(grid)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

For a project I plotted a neighboorhood with matplotlib. I used filled polygons.

I would like to create a script wich divide the area in smaller square and analyse each square. If the square is full (A building) then the square coordinates will be added to a list, if the square is blank (empty), nothing happend and if the square have a part colored and a part blank, the square is replaced by a filled square and its cooridinates are saved in the list if the colored part represente more than 50% of the original square area,else the square is replaced with a blank one.
The aim of this script is to create a "square" neighboorhood and to have datas to recreate this square with Python or another software
I'm looking for a command/script abble to analyse and give the proportion of the colored area in output.
Thanks

[Image: piOuU2q]