In this image:
I want to find this rectangle with all contents(without those grid's lines)
I think the total of the pixels can help a little like:
img = Import["https://i.sstatic.net/lnd5w.png"];
data = Total[ImageData[ImageRotate[ColorNegate[img]]]];
Show[ImageRotate[img],
ListLinePlot[data, PlotRange -> All, PlotStyle -> Red]]
And I have such images:
image2
image3
image4
image5
I have no idea to do this thing. Does anyone have an idea?