releasing native memory in Java converters
This commit is contained in:
parent
74bb0beeb0
commit
5b00d9da49
@ -501,7 +501,9 @@ public class Converters {
|
|||||||
for (Mat mi : mats) {
|
for (Mat mi : mats) {
|
||||||
MatOfPoint pt = new MatOfPoint(mi);
|
MatOfPoint pt = new MatOfPoint(mi);
|
||||||
pts.add(pt);
|
pts.add(pt);
|
||||||
|
mi.release();
|
||||||
}
|
}
|
||||||
|
mats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// vector_vector_Point2f
|
// vector_vector_Point2f
|
||||||
@ -517,7 +519,9 @@ public class Converters {
|
|||||||
for (Mat mi : mats) {
|
for (Mat mi : mats) {
|
||||||
MatOfPoint2f pt = new MatOfPoint2f(mi);
|
MatOfPoint2f pt = new MatOfPoint2f(mi);
|
||||||
pts.add(pt);
|
pts.add(pt);
|
||||||
|
mi.release();
|
||||||
}
|
}
|
||||||
|
mats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// vector_vector_Point2f
|
// vector_vector_Point2f
|
||||||
@ -547,7 +551,9 @@ public class Converters {
|
|||||||
for (Mat mi : mats) {
|
for (Mat mi : mats) {
|
||||||
MatOfPoint3f pt = new MatOfPoint3f(mi);
|
MatOfPoint3f pt = new MatOfPoint3f(mi);
|
||||||
pts.add(pt);
|
pts.add(pt);
|
||||||
|
mi.release();
|
||||||
}
|
}
|
||||||
|
mats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// vector_vector_Point3f
|
// vector_vector_Point3f
|
||||||
@ -590,7 +596,9 @@ public class Converters {
|
|||||||
for (Mat mi : mats) {
|
for (Mat mi : mats) {
|
||||||
MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
|
MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
|
||||||
kps.add(vkp);
|
kps.add(vkp);
|
||||||
|
mi.release();
|
||||||
}
|
}
|
||||||
|
mats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Mat vector_double_to_Mat(List<Double> ds) {
|
public static Mat vector_double_to_Mat(List<Double> ds) {
|
||||||
@ -689,7 +697,9 @@ public class Converters {
|
|||||||
for (Mat mi : mats) {
|
for (Mat mi : mats) {
|
||||||
MatOfDMatch vdm = new MatOfDMatch(mi);
|
MatOfDMatch vdm = new MatOfDMatch(mi);
|
||||||
lvdm.add(vdm);
|
lvdm.add(vdm);
|
||||||
|
mi.release();
|
||||||
}
|
}
|
||||||
|
mats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// vector_vector_char
|
// vector_vector_char
|
||||||
@ -719,6 +729,8 @@ public class Converters {
|
|||||||
List<Byte> lb = new ArrayList<Byte>();
|
List<Byte> lb = new ArrayList<Byte>();
|
||||||
Mat_to_vector_char(mi, lb);
|
Mat_to_vector_char(mi, lb);
|
||||||
llb.add(lb);
|
llb.add(lb);
|
||||||
|
mi.release();
|
||||||
}
|
}
|
||||||
|
mats.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user