【发布时间】:2015-03-31 17:49:15
【问题描述】:
我正在尝试将我的图像的一部分切片(裁剪)到另一个图像,以便可以单独处理它。我找到了轮廓,现在尝试将每个轮廓保存在新 Mat 中,但它给出了错误
Mat crop;
Imgproc.findContours(m, contours, new Mat() ,Imgproc.RETR_EXTERNAL , Imgproc.CHAIN_APPROX_SIMPLE);
for(int i=0; i <contours.size();i++)
{
Rect rect = Imgproc.boundingRect(contours.get(i));
crop = m.submat(rect);
}
Utils.matToBitmap(crop, bm);
ImageView iv = (ImageView) findViewById(R.id.imageView1);
iv.setImageBitmap(bm);
这里 m 是我保存图像的 Mat
错误:
【问题讨论】:
-
尝试让裁剪垫的尺寸大于投资回报率
-
能否提供代码?
标签: java android opencv image-processing runtime-error