Ask Your Question

Revision history [back]

Reshape function problem

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?

Reshape function problem

When I use reshape reshape function with ROI 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 clone of ROI image the the error is resolved.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?

Reshape function problem

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?

Reshape function problem

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 then 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?

Reshape function problem

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 then 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?

Edit:

I realize this topic that reshape function in this step need to consecutive memory.My question is why the reshape function when Mat data is not consecutive memory don't create new image and then it does not reshape it .This solution is better than facing the user with an error.

Reshape function problem

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 then 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?

Edit:

I realize this topic that reshape function in this step need to consecutive memory.My question is why the reshape function don't create new image when the Mat data is not consecutive memory don't create new image and then it does not reshape it .This solution is better than facing the user with an error.

Reshape function problem

When I use the 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 then 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?

Edit:

I realize this topic that reshape function in this step need to consecutive memory.My question is why the reshape function don't create new image when the Mat data is not consecutive memory and then it does not reshape it .This solution is better than facing the user with an error.

Reshape function problem

When I use the 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 then 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?

Edit:

I realize this topic that the reshape function in this step need to consecutive memory.My question is why the reshape function don't create new image when the Mat data is not consecutive memory and then it does not reshape it .This solution is better than facing the user with an error.