Ask Your Question

BaKa's profile - activity

2020-07-08 05:45:39 -0600 received badge  Famous Question (source)
2019-09-21 12:18:22 -0600 received badge  Popular Question (source)
2018-07-12 15:06:27 -0600 received badge  Notable Question (source)
2017-09-26 07:21:42 -0600 received badge  Popular Question (source)
2016-07-07 09:53:45 -0600 asked a question Android - selecting ROI of image

Hi all,

May i ask if i want to have a "pop-up window" for the app user on selecting ROI, how can i achieve that in Android?

And also, how can i selecting ROI using opencv?

Thanks a lot

2016-07-05 05:50:15 -0600 commented question Exception about copyMakeBorder and matToBitmap

btw, thanks for answering :)

2016-07-05 05:50:03 -0600 commented question Exception about copyMakeBorder and matToBitmap

I discover that i set the matToBitmap(); wrongly, not src but dst

2016-07-05 05:38:07 -0600 received badge  Organizer (source)
2016-07-05 05:36:22 -0600 asked a question Exception about copyMakeBorder and matToBitmap

When i use the following code,

    Mat src = new Mat(imageChosen.getHeight(), imageChosen.getWidth(), CvType.CV_8UC1);
    Utils.bitmapToMat(imageChosen, src);
    Mat dst = new Mat(imageChosen.getHeight(), imageChosen.getWidth(), CvType.CV_8UC1);
    Core.copyMakeBorder(src, dst, 10, 10, 10, 10, Core.BORDER_CONSTANT, new Scalar(0,0,0));
    Bitmap b = Bitmap.createBitmap(dst.cols(), dst.rows(),Bitmap.Config.ARGB_8888);
    Utils.matToBitmap(src, b);

it throw such exception:

E/cv::error(): OpenCV Error: Assertion failed (src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols) in void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean), file /Volumes/Linux/builds/master_pack-android/opencv/modules/java/generator/src/cpp/utils.cpp, line 97

E/org.opencv.android.Utils: nMatToBitmap catched cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/java/generator/src/cpp/utils.cpp:97: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)

Do any one have idea what's wrong is my code ?

Any help/ideas would be greatly appreciated, thanks a lot.

2016-06-24 04:25:46 -0600 received badge  Scholar (source)
2016-06-24 04:25:45 -0600 received badge  Supporter (source)
2016-06-17 10:22:19 -0600 commented question How to increase the thickness or darkness of edge after edge detection?

I am satisfy with the result of edge found for this kernel size, but what i want to do is just make the edge found more clearly shown

2016-06-17 05:37:15 -0600 asked a question How to increase the thickness or darkness of edge after edge detection?

After using Laplacian operator for edge detection, i find that the edge is too thin, May i ask if there are ways to increase the thinkness or darkness in order to sharpen the edge detected?

Image after bitwise not operator:

image description

2016-06-12 00:49:43 -0600 commented question Bilateral filter error, Assertion failed ((src.type() == CV_8UC1 || src.type() == CV_8UC3) && src.data != dst.data)

Thanks for you help, i can use it now!

2016-06-12 00:33:18 -0600 commented question Bilateral filter error, Assertion failed ((src.type() == CV_8UC1 || src.type() == CV_8UC3) && src.data != dst.data)

i have checked the channel of the src, it has 4 channels, but now i am confused about how to change the number of channels of the src btw thanks for your comment

2016-06-11 16:27:23 -0600 asked a question Bilateral filter error, Assertion failed ((src.type() == CV_8UC1 || src.type() == CV_8UC3) && src.data != dst.data)

My code is shown in the following:

Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.image1);
int width = b.getWidth();
int height =  b.getHeight();
Mat tmp = new Mat (width, height, CvType.CV_8UC3);
Mat tmp2 = tmp.clone();
Utils.bitmapToMat(b, tmp);
Imgproc.bilateralFilter(tmp,tmp2,10,50,10);

and give the following error,

OpenCV Error: Assertion failed ((src.type() == CV_8UC1 || src.type() == CV_8UC3) && src.data != dst.data) in void cv::bilateralFilter_8u(const cv::Mat&, cv::Mat&, int, double, double, int), file /Volumes/Linux/builds/master_pack-android/opencv/modules/imgproc/src/smooth.cpp, line 3145

May i ask what's wrong with my code, Thanks a lot!!