use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.
the class Converters method Mat_to_vector_vector_KeyPoint.
public static void Mat_to_vector_vector_KeyPoint(Mat m, List<MatOfKeyPoint> kps) {
if (kps == null)
throw new java.lang.IllegalArgumentException("Output List can't be null");
if (m == null)
throw new java.lang.IllegalArgumentException("Input Mat can't be null");
List<Mat> mats = new ArrayList<Mat>(m.rows());
Mat_to_vector_Mat(m, mats);
for (Mat mi : mats) {
MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
kps.add(vkp);
mi.release();
}
mats.clear();
}
use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.
the class Converters method vector_vector_char_to_Mat.
// vector_vector_char
public static Mat vector_vector_char_to_Mat(List<MatOfByte> lvb, List<Mat> mats) {
Mat res;
int lCount = (lvb != null) ? lvb.size() : 0;
if (lCount > 0) {
for (MatOfByte vb : lvb) mats.add(vb);
res = vector_Mat_to_Mat(mats);
} else {
res = new Mat();
}
return res;
}
use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.
the class Converters method vector_char_to_Mat.
public static Mat vector_char_to_Mat(List<Byte> bs) {
Mat res;
int count = (bs != null) ? bs.size() : 0;
if (count > 0) {
res = new Mat(count, 1, CvType.CV_8SC1);
byte[] buff = new byte[count];
for (int i = 0; i < count; i++) {
byte b = bs.get(i);
buff[i] = b;
}
res.put(0, 0, buff);
} else {
res = new Mat();
}
return res;
}
use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.
the class Converters method vector_vector_DMatch_to_Mat.
// vector_vector_DMatch
public static Mat vector_vector_DMatch_to_Mat(List<MatOfDMatch> lvdm, List<Mat> mats) {
Mat res;
int lCount = (lvdm != null) ? lvdm.size() : 0;
if (lCount > 0) {
for (MatOfDMatch vdm : lvdm) mats.add(vdm);
res = vector_Mat_to_Mat(mats);
} else {
res = new Mat();
}
return res;
}
use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.
the class Converters method vector_Mat_to_Mat.
public static Mat vector_Mat_to_Mat(List<Mat> mats) {
Mat res;
int count = (mats != null) ? mats.size() : 0;
if (count > 0) {
res = new Mat(count, 1, CvType.CV_32SC2);
int[] buff = new int[count * 2];
for (int i = 0; i < count; i++) {
long addr = mats.get(i).nativeObj;
buff[i * 2] = (int) (addr >> 32);
buff[i * 2 + 1] = (int) (addr & 0xffffffff);
}
res.put(0, 0, buff);
} else {
res = new Mat();
}
return res;
}
Aggregations