【发布时间】:2013-06-27 17:41:22
【问题描述】:
Mat b = new Mat();
Bitmap bmp = getIntent().getExtras().getParcelable("image_send");
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_image);
Mat tmp = new Mat (bmp.getWidth(), bmp.getHeight(), CvType.CV_8UC1);
Utils.bitmapToMat(bmp, tmp);
Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_RGB2GRAY);
//Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_GRAY2RGB, 4);
Utils.matToBitmap(tmp, bmp);
iv = (ImageView) findViewById(R.id.imageView1);
iv.setImageBitmap(bmp);
}
无法显示 bmp。我的应用在拍照后停止了。
【问题讨论】:
-
你不能在onCreate中使用opencv代码(原生so还没有加载)