I tried to detect contours in an image ,draw a bounding box for each contours ,put all rect.x rect.y rect.height in an array lists ,sorting them and finally draw a rectangle for each lignes in the image .but i got this error(the error is here : Imgcodecs.imwrite("/storage/emulated/0/DCIM/Lignes/sub"+j+".png",su);
04-27 14:33:43.818: E/cv::error()(25787): OpenCV Error: Assertion failed (0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows) in cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&), file /home/maksim/workspace/android-pack/opencv/modules/core/src/matrix.cpp, line 456
if (approxDistance >1.5){
Imgproc.rectangle(gray, new Point(rect.x-3,rect.y-3), new Point(rect.x+rect.width+5,rect.y+5+rect.height), new Scalar(0,0,0),2);
//Ajouter les colonnes dans un tableau
valx.add(rect.x);
for(int p=0; p
↧