Given an image, this function crops the image to a particular size.
Mat crop(){
Mat m = new Mat();
Utils.bitmapToMat(bitmap_src, m);
Mat r = reSizeMat(m);
return r;
}
private Mat reSizeMat(Mat src){
Rect rect=new Rect(0,0,500,500);
Mat result=new Mat(src,rect);
return result;
}