getting java.lang.IllegalArgumentException: width and height must be > 0 error while initializing Mat in android : I am trying to initialize Mat and this is my code 


        Mat imgRgba = new Mat();
        final Bitmap bitmap =
        Bitmap.createBitmap(imgRgba.width(), imgRgba.height(), Bitmap.Config.RGB_565);
        Utils.matToBitmap(imgRgba, bitmap);


 I have tried this too
      
   
   
    Bitmap.createBitmap(imgRgba.cols(), imgRgba.rows(), Bitmap.Config.RGB_565);



but when I am going to run my app I am getting crash and exception is this 
        
        Stack trace:  
        java.lang.IllegalArgumentException: width and height must be > 0
        at android.graphics.Bitmap.createBitmap(Bitmap.java:969)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:948)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:915)
        at com.jmr.agency.banking.ui.facerecognition.FRAddPersonPreviewActivity.onCameraFrame(FRAddPersonPreviewActivity.java:156)


