InputStream is = this.getResources().openRawResource(R.drawable.cat); //圖片
Bitmap bmp = BitmapFactory.decodeStream(is);
Mat tmp = new Mat (bmp.getWidth(), bmp.getHeight(), CvType.CV_8UC3);
Utils.bitmapToMat(bmp, tmp); // src_bmp , dest_mat
Size sz = new Size(cols, rows); // x,y
Imgproc.resize( tmp, rgba, sz ); // src, dest , dest_size
沒有留言:
張貼留言