Ask Your Question

Revision history [back]

Region of interest of YV12 matrix

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(mPreviewHeight + (mPreviewHeight/2), mPreviewWidth, CvType.CV_8UC1);

Is it possible to extract some sub-region of this image and convert it to RGB colorspace subsequently? To say, I want to extract the following rect:

x1: 150
y1: 50
width: 60
height: 60

Thanks in advance.

Region of interest of YV12 matrix

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(mPreviewHeight Mat(480 + (mPreviewHeight/2), mPreviewWidth, (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? 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:

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

Thanks in advance.