Hi guys and thank you for your help. I need to find only rectangles that have not white pixels inside them, WITHOUT USING LIBRARIES...
In the img there are only white and black pixels , the rectangles are composed only by white pixels and the rest is black.
This is an example : IMG
And this is the result that the function should return: SOLUTION
I can use only the commands "load" and "save".
you can save the img and use the load command and you will see that the img is a list of list , where each list is a row , and each element of the list is each pixel of the row.
I found all the coordinates of the white pixels and i am searching for a solution to find the rectangles ..
img=immagini.load("e1_f1.png")
white=[]
white2=[]
for x, y in enumerate(img):
for x1, y1 in enumerate(y):
if (255,255,255) == y1:
white2.append((x, x1))
white=[x[::-1] for x in white2]