将外部目录中的图像数组读入android中的MAT对象

时间:2013-11-19 16:06:09

标签: android opencv computer-vision mat

如何将存储在SD卡中的图像数组读取到MAT对象的数组中?我想在this帖子中做类似的imread,但是对于图像数组

1 个答案:

答案 0 :(得分:2)

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);
}