Region of interest of YV12 matrix

asked 2013-10-10 07:53:29 -0600

updated 2013-10-10 08:00:32 -0600

I have the following matrix in YV12 colorspace (stored as 1-channel image). It's filled with data which came from Android camera preview.

mYuv  = new Mat(480 + (480/2), 640, CvType.CV_8UC1);

Is it possible to extract some sub-region of this image (first step) and convert it to RGB colorspace subsequently (second step)? I would like to extract region first in order to keep good performance when converting. To say, I want to extract the following rect:

x: 150
y: 50
width: 60
height: 60

Thanks in advance.

edit retag flag offensive close merge delete