When I use reshape function with ROI then I encounter the following error.
Mat cur_img = imread(fileList.fileNames[i],0);
Mat res_img = cur_img(Rect(0,0,100,100)).reshape(1,1);
Error :Image step is wrong
I made a clone of ROI image the the error is resolved.
Mat cur_img = imread(fileList.fileNames[i],0);
Mat res_img = cur_img(Rect(0,0,100,100)).clone().reshape(1,1);
What is the reason?