I have taken the current frame under mRGBA in this fashion:
mRgba = inputFrame.rgba();
then created a rectangle object which takes the height and width of the current camera frame
rect = new Rect();
rect.width = mRgba.width();
rect.height = mRgba.height();
it takes the whole space of the frame but when i try to shrink this rectangle it got shrink in a one side(not as a whole which i need)
So i tried to find the rectangles center and then tried to create another rectangle according to that center and a predefined size
int x = (int) (rect.tl().x + rect.br().x)/2;
int y = (int) (rect.tl().y + rect.br().y)/2;
Rect rect1 = new Rect(x,y,280,280);
Imgproc.rectangle(mRgba, rect1.tl(), rect1.br(), new Scalar(255, 0, 0), 2, 8, 0);
But yet its not in the center!! i am not sure about the parameters the rectangle object takes i didn't find the document of opencv that much helpful. So how to overcome this situation i want the rectangle to be exactly at the center of the camera frame.