I want to read an array of images in c++ and I wrote this sample code:
std::vector<Mat> ReadInputImages()
{
Mat tmp1=imread("C:/tmp/im1.jpg");
Mat tmp2=imread("C:/tmp/im2.jpg");
Mat tmp3=imread("C:/tmp/im3.jpg");
Mat tmp4=imread("C:/tmp/im4.jpg");
std::vector<Mat> images;
images={tmp1,tmp2,tmp3,tmp4};
return images;
}
But it doesn't work and I am getting compiler error on
images={tmp1,tmp2,tmp3,tmp4};
What is the best way to return an array of images from a function.