crop image
hi!
someone know how to use crop for the image?
for example i have one image i want to show a part of this image...
i read that there are the cvRect and cvSetImageROI.....
thanks a lot :)
hi!
someone know how to use crop for the image?
for example i have one image i want to show a part of this image...
i read that there are the cvRect and cvSetImageROI.....
thanks a lot :)
Mat cropedImage = fullImage(Rect(roiX,roiY,roiWidth,roiHeight));
Also note that this operation doesn't really perform cropping or coping memory. croppedImage uses same memory buffer as fullImage, so any changes of one of them may affect another.
You should crop the bounding rectangle in the same way as Michael suggested. But then you can call cv:fillPoly (http://docs.opencv.org/modules/core/doc/drawing_functions.html?highlight=poly#cv.FillPoly) to create a mask for your region. You can keep the mask in a separate matrix, or add to the submatrix as an alpha channel (4th channel in the CV_8UC4 matrix).
Before the question pops up, because it is closely related. Here is how to extract the data in a RotatedRect:
Asked: 2012-07-31 14:18:13 -0600
Seen: 21,457 times
Last updated: Jul 31 '12
OpenCV crop function fatal signal 11
in stereo matching is the disparity always to the left?
How to identify an image once in a video sequence?
Capture one resolution from camera but display another
Error when Cropping Human Image after detectMultiScale
Remove black border lines around image after scan with opencv c++