You can find three of the sides with a simple horizontal and vertical histogram.
maybe_foreground = YourImage > YourImage(1,1);
vert_profile = any(maybe_foreground, 1);
horz_profile = any(maybe_foreground, 2);
vert_start = find(vert_profile,1,'first');
vert_end = find(vert_profile,1,'last');
horz_start = find(horz_profile,1,'first');
horz_end = find(horz_profile,1,'last');
the ROI is now contained within
YourImage(horz_start : horz_end, vert_start : vert_end)
I say "contained within" because of that text at the bottom, which you probably want to crop out. I am not sure at the moment what the best way to do that would be.