Imgproc。调整大小......不起作用。我想将我的图像调整为较小的图像。我的第二次尝试是将我的orgimage复制到一个新的较小矩阵中

时间:2015-12-17 10:38:02

标签: image resize size

public void findeKarte (Bitmap currentBitmap){

Mat src = new Mat (240, 320, CvType.CV_8UC1, new Scalar(255));

      Mat  orgimage = new Mat (currentBitmap.getWidth(), currentBitmap.getHeight(), CvType.CV_8UC1);

        Utils.bitmapToMat(currentBitmap, orgimage);


        // first try, why doesnt work?

orgimage.copyTo(src);
// second try try
//        Size sz = new Size(240,320);

//          Imgproc.resize(orgimage, src, sz);


        Utils.matToBitmap(src, currentBitmap);
        loadImageToImageView(currentBitmap);
  }


  public void  loadImageToImageView(Bitmap currentBitmap){
      ImageView = (ImageView) findViewById(R.id.ImageView);
      ImageView.setImageBitmap(currentBitmap); 

  }

0 个答案:

没有答案