Ask Your Question

Revision history [back]

error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)

I have suceesfully drew a rectanlge over the face in Android. Inorder to crop the selected face I used the following code:

Mat cropped_face = image;
Rect cropped= new Rect(facesArray[i].tl(), facesArray[i].br());
cropped_face = new Mat(image,cropped);

The 'image' variable holds the original image from the camera. I encountered following error on the last line of code.

AndroidRuntime: FATAL EXCEPTION: Thread-6
    Process: com.example.kiran.opencv, PID: 5573
    CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.1) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:418: error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)
    ]
click to hide/show revision 2
None

updated 2018-11-15 01:01:06 -0600

berak gravatar image

error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)

I have suceesfully drew a rectanlge over the face in Android. Inorder to crop the selected face I used the following code:

Mat cropped_face = image;
Rect cropped= new Rect(facesArray[i].tl(), facesArray[i].br());
cropped_face = new Mat(image,cropped);

The 'image' variable holds the original image from the camera. I encountered following error on the last line of code.

AndroidRuntime: FATAL EXCEPTION: Thread-6
    Process: com.example.kiran.opencv, PID: 5573
    CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.1) /build/master_pack-android/opencv/modules/core/src/matrix.cpp:418: error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)
    ]