Yes, you can overlay a SurfaceView with 2 semitransparent rectangles to cut out the square.
You should calculate the expected crop effect on the captured hi-res image. E.g. if your camera supports picture size of 4368x2912, you will need to crop (mLeft=728, mTop=0, mWidth=2912, mHeight=2912).
To apply the custom crop to the Jpeg byte[]
received from onPictureTaken(), you have two options: easy or efficient.
The easy way is to decode the Jpeg data to bitmap,
@Override
public void onPictureTaken(final byte[] data, Camera camera) {
Bitmap picture = BitmapFactory.decodeByteArray(data, 0, data.length);
picture = Bitmap.createBitmap(picture, mLeft, mTop, mWidth, mHeight);
picture.compress(Bitmap.CompressFormat.JPEG, 85, mFileOutputStream);
}
The drawbacks are that it may be slow and require huge memory (maybe 60 MBytes for 12 MPixel camera).
The "smart" approach is to use Jpeg Lossless transformation (see for example http://mediachest.sourceforge.net/mediautil/), using less than 10 MBytes. Note that this imposes some restrictions, e.g. in the example of 12 MPixel camera above, you may need mLeft=720, because 728 is not dividable by 16.