Ok, so I have an image generated by a numpy array of values with arbitrary units. The image are showing a rotated square with a hole in it. What I am trying to do is to write some code to find the edges of this square and then save the values inside the square in one array and the values outside the square in one array. And the values in the hole should be excluded. This whole procedure I want to use for a lot of images but all with the same square in them.
I do not really know how to approach this but have been thinking about making loops trying to find where the values change fast (i.e being an edge) but that is complicated by that the units are arbitrary so the change in values would be different for every single image.
I tried to use canny plot without any luck since it only discovered the really sharp edges in another part of the figure.
So basically I need some ideas of the approach, if a lot of loops are the way to go or if I should try to find some other way.
So this is the image: Rotated square And this is showing the values for one y value: One y value, all x values