Answer the question
In order to leave comments, you need to log in
How to convert bitmap to IplImage in JavaCV?
Hello. When porting an OpenCV application from C++ to Android, I ran into a problem.
I have a bitmap image that I need to convert to IplImage for further work. I tried to do it like this:
void preparingBeforeFindContours(Bitmap image){
Igray = IplImage.create(image.getWidth(),image.getHeight(), IPL_DEPTH_8U, 1);
image.copyPixelsToBuffer(Igray.getByteBuffer());
Answer the question
In order to leave comments, you need to log in
create takes the number of channels as the last parameter. In my opinion , in android it is impossible to create a bitmap with one channel. That's where they don't fit.
PS Isn't it easier for you to use NDK and not rewrite everything in Java?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question