CvException [org.opencv.core.CvException: cv::Exception] [closed]
I'm getting this error in logcat in android studio
2019-01-04 18:19:51.208 24101-24101/com.example.nabil.imagetext E/cv::error(): OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in cv::Mat::Mat(const cv::Mat&, const Rect&), file /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/core/src/matrix.cpp, line 323
2019-01-04 18:19:51.209 24101-24101/com.example.nabil.imagetext E/org.opencv.core.Mat: Mat::n_1submat() caught cv::Exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/core/src/matrix.cpp:323: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function cv::Mat::Mat(const cv::Mat&, const Rect&)
2019-01-04 18:19:51.210 24101-24101/com.example.nabil.imagetext E/ContentValues: Error parse image. Message: cv::Exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/core/src/matrix.cpp:323: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function cv::Mat::Mat(const cv::Mat&, const Rect&)
CvException [org.opencv.core.CvException: cv::Exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/core/src/matrix.cpp:323: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function cv::Mat::Mat(const cv::Mat&, const Rect&)
]
you did something with a ROI, and that went out of bounds. (like calling a Mat constructor with a Rect)
can you try to look up, where you did something like that, and add your resp. part of code to the question ?
also, do the maths: rect.x and rect.y must be > 0, also,
rect.x + rect.width < img.cols()
, andrect.y + rect.height < img.rows()