Hi. First of all, thank you for answering. I followed your valuable advice(with a little modification, but that's the point), but the problem doesn't change. here the piece of the code correct:
for(int i = 0 ; i < imagesArray.size(); i++){
cout << "flag3" << endl;
patternfound = findChessboardCorners(imagesArray[i] , patternSize , centers);
if(patternfound){
cout << "pattern found:"<< patternSize << endl;
cout << "centroids: " << centers << endl;
cout << "centroids array size: " << centers.size() << endl;
for(int j = 0; j < centers.size(); j++)
cout << centers[j] << endl;
}
}
But still I get the same error when I compile:
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.5) /tmp/opencv@3-20190117-71360-ynjwgu/opencv-3.4.5/modules/core/src/matrix.cpp:757: error: (-215:Assertion failed) dims <= 2 && step[0] > 0 in function 'locateROI'
Abort trap: 6