I ran into a problem that I don't know how to address, if anyone has any ideas I would be very grateful. So I have a NxM matrix and number of points (minimum 4) that represent a shape resting on the matrix as show in the figure (Each point is represented by a number, ignore the black/white points):
I know how to match each point to the x,y coordinate inside the matrix. But let's say I want to calculate the average of the values inside the polygon, how can I do it? Many thanks to all the helpers
I tried to parametrize the polygon to a new square, but without success...