Your question is quite vague and the methodology and results depend very much on how the images vary.
Remember that the computer will have no concept of how you decide where to draw that boundary, so you need to come up with some criterion on how to do that. If you have the image processing toolbox, that has many functions that can help you to create a mask from an image.
Assuming that using a threshold will suffice - i.e. all points within the enclosed region are above threshold and outside are below, you can create a mask in 1 line:
mask = (ImgArray>threshold_value);
However, you are likely going to be required to pre-process the data. The most likely is to perform smoothing using e.g. imfilter or filter2 You may then also need to refine the mask - for example by only taking connected points (image processing toolbox will be your friend). A little trick you can use is to smooth the mask and then threshold that - this can help get rid of any holes and create a little extra padding.
If you don't have the toolbox, it is still possible to find the continous region, but it will be slow (I do have a function to do that).