Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use pre-trained cnn to classify 6-channel-mats

Hey there,

I have a pre trained cnn, which was trained on 6 channel inputs (created out of two bgr images of same size).

vector<Mat> inputs;
vector<Mat> temp;
Mat blob;
cv::split(image_1, inputs);
cv::split(image_2, temp);
inputs.insert(inputs.end(), temp.begin(), temp.end());
dnn::blobFromImages(inputs, blob, 1.0/255.0, m_patchSize, 0, true, false);
net.setInput(blob);
Mat out = net.forward();

The program crashes in line blobFromImages. What am I doing wrong? Is it possible to classify Mats with more than 3 channels?