Ask Your Question

harsh_bangari's profile - activity

2020-10-23 05:27:54 -0600 received badge  Necromancer (source)
2017-06-21 07:47:00 -0600 commented question Find pixel color out of cv::Mat on specific position

Please share the code for android.

2017-05-18 01:50:12 -0600 received badge  Enthusiast
2017-05-10 01:23:24 -0600 received badge  Editor (source)
2017-05-10 01:22:45 -0600 answered a question OpenCv: Extract portion of a Mat image

Here, mat will be your originalMat.

Rect roi = new Rect(40, 100, 100, 120);
Mat cropped = new Mat(mat, roi);
2017-05-09 07:13:48 -0600 commented question unable crop a mat

Code is correct and working fine.

2017-05-09 05:43:03 -0600 commented question unable crop a mat

It shows the whole original image into 50*50 bitmap.

2017-05-09 02:37:40 -0600 asked a question unable crop a mat

Getting originalMat into 50*50 Bitmap

   Mat cropped = originalMat.submat(0, 50, 0, 50);
    Bitmap tempBitmap = Bitmap.createBitmap(50, 50, thumbnail.getConfig())
    Utils.matToBitmap(cropped, tempBitmap );
    image.setImageBitmap(tempBitmap );