Ask Your Question

marius's profile - activity

2020-11-26 10:17:00 -0500 received badge  Self-Learner (source)
2020-11-26 10:17:00 -0500 received badge  Teacher (source)
2020-11-26 08:52:35 -0500 commented question OpenCV 4 and TermCriteria CV_TERMCRIT_ITER

I used TermCriteria::MAX_ITER|TermCriteria::EPS and it works

2020-11-26 08:27:48 -0500 asked a question OpenCV 4 and TermCriteria CV_TERMCRIT_ITER

OpenCV 4 and TermCriteria CV_TERMCRIT_ITER Hi, I am using OpenCV and Android Ndk. I recently upgraded from OpenCV 3.5.

2020-11-26 08:27:46 -0500 asked a question OpenCV 4 and TermCriteria CV_TERMCRIT_ITER

OpenCV 4 and TermCriteria CV_TERMCRIT_ITER Hi, I am using OpenCV and Android Ndk. I recently upgraded from OpenCV 3.5.

2020-11-19 05:01:35 -0500 received badge  Supporter (source)
2020-11-19 05:01:33 -0500 marked best answer opencv 4.5.0 cvDiv/cvMat equivalent ?

LE:

System information (version)

OpenCV => 4.5.0
Operating System / Platform => MacOS
Compiler => Android Studio with ndkBuild

Detailed description

I am developing and android app, I am using openCV android sdk along with some cpp files that process some images, building with ndkBuild all of the files. Now I updated from OpenCV-3.1-android-sdk to OpenCV-4.5.0-android-sdk

I am using these includes:

#include <opencv2/core/core.hpp>
#include <opencv2/core/core_c.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

In my cpp file was using it like this (So basically I had this code working in openCV 3.1.0):

Mat mat1 = new Mat(..);
Mat mat2 = new Mat(..);
CvMat src = mat1;
CvMat mask = mat2;
cvDiv(&src, &mask, &mask, 256);

In openCV 4.5.0 I get this error:

error: no viable conversion from 'cv::Mat' to 'CvMat '

If I use this instead

Mat mat1 = new Mat(..);
Mat mat2 = new Mat(..);
Mat src = mat1;
Mat mask = mat2;
cvDiv(&src, &mask, &mask, 256);

I get this error at runtime:

cv::error(): OpenCV(4.5.0) Error: Bad argument (Unknown array type) in cvarrToMat, file /build/master_pack-android/opencv/modules/core/src/matrix_c.cpp, line 185

I am actually asking: How can I convert this code to run with OpenCV 4.5.0. - I could use divide instead of cvDiv (as @sturkmen stated) - but what arguments do I feed to that function ? I cannot feed Mat, I cannot use CvMat.. PS: evidently I am clueless in C since I am just an android dev

2020-11-19 05:01:33 -0500 received badge  Scholar (source)
2020-11-19 04:59:08 -0500 commented answer opencv 4.5.0 cvDiv/cvMat equivalent ?

thanks!!!! it worked!

2020-11-19 03:08:11 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-19 02:36:22 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-19 02:36:02 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-18 18:12:55 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-18 17:32:54 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-18 17:25:44 -0500 commented question opencv 4.5.0 cvDiv/cvMat equivalent ?

Can you check my revised question please ?

2020-11-18 17:25:27 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-18 17:23:59 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? LE: System information (version) OpenCV => 4.5.0 Operating System / Platform

2020-11-18 10:33:26 -0500 received badge  Editor (source)
2020-11-18 10:33:26 -0500 edited question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? System information (version) OpenCV => 4.5.0 Operating System / Platform =>

2020-11-18 10:31:26 -0500 asked a question opencv 4.5.0 cvDiv/cvMat equivalent ?

opencv 4.5.0 cvDiv/cvMat equivalent ? System information (version) OpenCV => 4.5.0 Operating System / Platform =>