I have a class which receives frames taken with a camera. It then passes the frame to a camera calculator, which does some processing and crops according to the camera calculator's aspect ratio setting.
When I have...
@Override
public void receivePicture(Mat frame) {
mCameraCalculator.processFrameForResult(frame);
//the image is then saved
}
//in camera calculator...
public void processFrameForResult(Mat frame){
processFrame(frame);
frame = frame.submat(getCenterByAspectRatio(frame)); //crop
}
The crop fails (the saved image is not cropped). However, when I have...
@Override
public void receivePicture(Mat frame) {
mCameraCalculator.processFrameForResult(frame);
frame = frame.submat(mCameraCalculator.getCenterByAspectRatio(frame)); //crop
//the image is then saved
}
//in camera calculator...
public void processFrameForResult(Mat frame){
processFrame(frame);
}
It works perfectly. This does not make sense. Are these two bits of code not equivalent?