Domanda

How do i read array of images stored in SDcard to a array of MAT object ? i want to do similar imread like in this post, but for array of images

È stato utile?

Soluzione

File directoyOfMatFiles; // it points to the directory that contains mat files
File[] contentOfDirectoyOfMatFiles = directoyOfMatFiles.listFiles();
ArrayList<Mat> mats = new ArrayList<Mat>();
for (File f : contentOfDirectoyOfMatFiles) {
   Mat m = Highgui.imread(f.getAbsolutePath());
   mats.add(m);
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top