java - Trouble converting mat to bitmap? -
i using opencv detect similarities between 2 images. unfortunately, line of code converts mat bitmap causing app crash. have ideas causing this? here code:
bitmap centerbit = bitmapfactory.decoderesource(getresources(), r.drawable.center); mat center = new mat(); utils.bitmaptomat(centerbit,center); mat resultcenter = new mat(); imgproc.matchtemplate(center,center,resultcenter,imgproc.tm_sqdiff_normed); bitmap bm = bitmap.createbitmap(resultcenter.cols(), resultcenter.rows(),bitmap.config.argb_8888); utils.mattobitmap(resultcenter, bm); //this line causing app crash imageview iv = (imageview) findviewbyid(r.id.imageview); iv.setimagebitmap(bm);
Comments
Post a Comment