I have been trying to read some images in a loop using imread
into a vector of Mat
(images) with opencv by getting the filenames from a vector of QString
but it will not compile. I know it's the format of my QString
that's the problem but cannot seem to work it out. I have also tried ...image = imread( image_vector[i] );
... and several other ways. Any help is greatly appreciated.
for ( unsigned int i = 0; i < image_names.size(); i++ )
{
image = imread( image_names.data()->at(i) );
if( !image.data )
{
qDebug()<< "Error";
}
else
{
image_vector.push_back( image );
}
}