WHY ARE SPLIT MATS NOT CONTINOUS [closed]
so I split an into is seperate colors (using split on the matrix). When I then try to reshape one of the resulting matrix I get the following error:
OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed) in reshape, file /tmp/opencv3-20160429-9997-hdwo4d/opencv-3.1.0/modules/core/src/matrix.cpp, line 997
so then I quickly wrote the following code:
cv::Mat image = cv::imread(inputImageName,CV_LOAD_IMAGE_COLOR);
cv::Mat colorMats[3];
cv::split(image,colorMats);
for (int i=0;i < 3;++i)
{
std::cout<<colorMats[i].isContinuous()<<std::endl;
}
and got the following result
1
1
0
why is the last one not continuous ?
What is your platforms? Can you give image size -width and height)?
PS with lower case in title it is better
The image is 1138 x 912. I'm trying to run it on Mac OSX here is the image Test Image
no problem with windows 10 and opencv 3.1. can you check if image isContinuous just after imread.
image is continuous