0
晚上好,需要一些帮助与openCV获得rgb像素的正方形区域 我试图从屏幕中心的50x50区域获取像素,但我没有得到任何成功。 如果我使用的输出我没有得到其他任何像素,如果使用原来的垫(图)招收到右上角 请别人帮Android OpenCV创建矩形
@Override
public void onPreviewFrame(Mat image) {
int w = image.cols();
int h = image.rows();
Mat roi=new Mat(image, new Rect(h/2 , w/2 , 50, 50));
Mat output = roi.clone();
int rw=output.cols();
int rh=output.rows();
//double [] arrp = output.get(rh, rw);//if i use the output i dont get any pixel
double [] arrp = image.get(rh, rw);//if use original mat its getting the top corner
Log.i("",+(int)arrp[2]+" "+ (int)arrp[1]+" "+(int)arrp[0]);
}