Given a multispectral satellite image with 4-8 bands; what is the correct code for band splitting of the image using OpenCV C++ programming?
-------------------------------------------
Mat img2 = imread( "MS_data/test1/multi_001.tif", CV_LOAD_IMAGE_UNCHANGED );
vector img2_band;
split(img2, img2_band);
imshow(" MS_band1", img2_band[0]);
-----------------------------------------------------------
This code is giving an error "vector subscript out of range". Please find attached snapshot of the error information.