releasing native memory in Java converters

This commit is contained in:
Andrey Pavlenko 2015-05-26 13:10:54 +03:00
parent b1a8e4f760
commit 6006790c18

View File

@ -501,7 +501,9 @@ public class Converters {
for (Mat mi : mats) {
MatOfPoint pt = new MatOfPoint(mi);
pts.add(pt);
mi.release();
}
mats.clear();
}
// vector_vector_Point2f
@ -517,7 +519,9 @@ public class Converters {
for (Mat mi : mats) {
MatOfPoint2f pt = new MatOfPoint2f(mi);
pts.add(pt);
mi.release();
}
mats.clear();
}
// vector_vector_Point2f
@ -547,7 +551,9 @@ public class Converters {
for (Mat mi : mats) {
MatOfPoint3f pt = new MatOfPoint3f(mi);
pts.add(pt);
mi.release();
}
mats.clear();
}
// vector_vector_Point3f
@ -590,7 +596,9 @@ public class Converters {
for (Mat mi : mats) {
MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
kps.add(vkp);
mi.release();
}
mats.clear();
}
public static Mat vector_double_to_Mat(List<Double> ds) {
@ -689,7 +697,9 @@ public class Converters {
for (Mat mi : mats) {
MatOfDMatch vdm = new MatOfDMatch(mi);
lvdm.add(vdm);
mi.release();
}
mats.clear();
}
// vector_vector_char
@ -719,6 +729,8 @@ public class Converters {
List<Byte> lb = new ArrayList<Byte>();
Mat_to_vector_char(mi, lb);
llb.add(lb);
mi.release();
}
mats.clear();
}
}