I am trying to crop images coming out of the video stream with OpenCV for iOS. I am not trying to do anything fancy, simply crop the image, and display it. I have tried this, and this, neither seem to work for me. As a delegate method, I get the current cv::Mat image passed in, so all I need is the code that will create the crop effect.
I could do something as complicated as this if need be, but I only need a rectangular crop, so I think there is an easier way. I just dont understand why setting the ROI is not working for me!
cv::Rect myROI(10, 10, 100, 100);
cv::Mat croppedImage = src(myROI);
src.copyTo(croppedImage);
[displayView setImage:[UIImage imageWithCVMat:src]];
^^^not working, just displaying original image