I am trying to crop images coming out of a video stream using OpenCV for iOS. I'm not trying to do anything, just crop the image and show it. I tried this one , and this one does not work for me. As a delegate method, I get the current cv :: Mat image, so I only need code that will create a cropping effect.
I could do something as complex as this if necessary, but I only need a rectangular culture, so I think there is an easier way. I just don’t understand why ROI setup doesn’t work for me!
cv::Rect myROI(10, 10, 100, 100); cv::Mat croppedImage = src(myROI); src.copyTo(croppedImage); [displayView setImage:[UIImage imageWithCVMat:src]];
^^^ does not work, just displaying the original image
Jameo source share