write multiple images for loop
Posted: 2013-11-01T04:34:39-07:00
I am working with Magick++ API on linux and I am reading multiple images, processing them in for loop and then I need to write them in the for loop as well passing the index value "i" to the filename. However I don't use sprintf, I use the method from Magick++ which is image.write();
How can do it ? See part of my code:
I saw another post regarding this but none one was answered. I am new here, if someone could help me. Thank you
How can do it ? See part of my code:
Code: Select all
int main(int argc, char **argv) {
// ImageMagick Stuffs
InitializeMagick(*argv);
vector<Blob> myblob;
vector<Image> imageList(7);
imageList[0].read("/cars/placa1/2.png");
imageList[1].read("/cars/placa1/4.png");
imageList[2].read("/cars/placa1/9.png");
imageList[3].read("/cars/placa1/9_.png");
imageList[4].read("/cars/placa1/e.png");
imageList[5].read("/cars/placa1/b.png");
imageList[6].read("/cars/placa1/g.png");
for (unsigned int i = 0; i <= imageList.size() ; ++i) {
imageList[i].resize("30x50");
// imageList[i].write("/cars/results/%d.png");
imageList[i].write(&myblob[i]);
}
I saw another post regarding this but none one was answered. I am new here, if someone could help me. Thank you