Java API: changing C++ vector<T> handling;

Java tests fixes are expected shortly
This commit is contained in:
Andrey Pavlenko
2012-04-04 12:59:53 +00:00
parent 9ac0d4323d
commit 78d92584c3
20 changed files with 737 additions and 79 deletions

View File

@@ -185,11 +185,11 @@ void vector_Point3d_to_Mat(vector<Point3d>& v_point, Mat& mat)
void Mat_to_vector_KeyPoint(Mat& mat, vector<KeyPoint>& v_kp)
{
v_kp.clear();
CHECK_MAT(mat.type()==CV_64FC(7) && mat.cols==1);
CHECK_MAT(mat.type()==CV_32FC(7) && mat.cols==1);
for(int i=0; i<mat.rows; i++)
{
Vec<double, 7> v = mat.at< Vec<double, 7> >(i, 0);
KeyPoint kp((float)v[0], (float)v[1], (float)v[2], (float)v[3], (float)v[4], (int)v[5], (int)v[6]);
Vec<float, 7> v = mat.at< Vec<float, 7> >(i, 0);
KeyPoint kp(v[0], v[1], v[2], v[3], v[4], (int)v[5], (int)v[6]);
v_kp.push_back(kp);
}
return;
@@ -199,11 +199,11 @@ void Mat_to_vector_KeyPoint(Mat& mat, vector<KeyPoint>& v_kp)
void vector_KeyPoint_to_Mat(vector<KeyPoint>& v_kp, Mat& mat)
{
int count = v_kp.size();
mat.create(count, 1, CV_64FC(7));
mat.create(count, 1, CV_32FC(7));
for(int i=0; i<count; i++)
{
KeyPoint kp = v_kp[i];
mat.at< Vec<double, 7> >(i, 0) = Vec<double, 7>(kp.pt.x, kp.pt.y, kp.size, kp.angle, kp.response, kp.octave, kp.class_id);
mat.at< Vec<float, 7> >(i, 0) = Vec<float, 7>(kp.pt.x, kp.pt.y, kp.size, kp.angle, kp.response, kp.octave, kp.class_id);
}
}
#endif
@@ -245,11 +245,11 @@ void vector_Mat_to_Mat(std::vector<cv::Mat>& v_mat, cv::Mat& mat)
void Mat_to_vector_DMatch(Mat& mat, vector<DMatch>& v_dm)
{
v_dm.clear();
CHECK_MAT(mat.type()==CV_64FC4 && mat.cols==1);
CHECK_MAT(mat.type()==CV_32FC4 && mat.cols==1);
for(int i=0; i<mat.rows; i++)
{
Vec<double, 4> v = mat.at< Vec<double, 4> >(i, 0);
DMatch dm((int)v[0], (int)v[1], (int)v[2], (float)v[3]);
Vec<float, 4> v = mat.at< Vec<float, 4> >(i, 0);
DMatch dm((int)v[0], (int)v[1], (int)v[2], v[3]);
v_dm.push_back(dm);
}
return;
@@ -259,11 +259,11 @@ void Mat_to_vector_DMatch(Mat& mat, vector<DMatch>& v_dm)
void vector_DMatch_to_Mat(vector<DMatch>& v_dm, Mat& mat)
{
int count = v_dm.size();
mat.create(count, 1, CV_64FC4);
mat.create(count, 1, CV_32FC4);
for(int i=0; i<count; i++)
{
DMatch dm = v_dm[i];
mat.at< Vec<double, 4> >(i, 0) = Vec<double, 4>(dm.queryIdx, dm.trainIdx, dm.imgIdx, dm.distance);
mat.at< Vec<float, 4> >(i, 0) = Vec<float, 4>(dm.queryIdx, dm.trainIdx, dm.imgIdx, dm.distance);
}
}
#endif
@@ -374,6 +374,19 @@ void vector_vector_Point2f_to_Mat(vector< vector< Point2f > >& vv_pt, Mat& mat)
vector_Mat_to_Mat(vm, mat);
}
void vector_vector_Point_to_Mat(vector< vector< Point > >& vv_pt, Mat& mat)
{
vector<Mat> vm;
vm.reserve( vv_pt.size() );
for(size_t i=0; i<vv_pt.size(); i++)
{
Mat m;
vector_Point_to_Mat(vv_pt[i], m);
vm.push_back(m);
}
vector_Mat_to_Mat(vm, mat);
}
void vector_Vec4f_to_Mat(vector<Vec4f>& v_vec, Mat& mat)
{
mat = Mat(v_vec, true);

View File

@@ -64,4 +64,5 @@ void vector_vector_char_to_Mat(std::vector< std::vector< char > >& vv_ch, cv::Ma
void Mat_to_vector_vector_Point(cv::Mat& mat, std::vector< std::vector< cv::Point > >& vv_pt);
void vector_vector_Point2f_to_Mat(std::vector< std::vector< cv::Point2f > >& vv_pt, cv::Mat& mat);
void vector_vector_Point_to_Mat(std::vector< std::vector< cv::Point > >& vv_pt, cv::Mat& mat);

View File

@@ -0,0 +1,35 @@
package org.opencv.core;
public class CvVector extends Mat {
protected int depth;
protected int channels;
protected CvVector(int d, int ch) {
super();
depth = d;
channels = ch;
}
protected CvVector(int d, int ch, long addr) {
super(addr);
depth = d;
channels = ch;
if( !empty() && checkVector(channels, depth) < 0 )
throw new IllegalArgumentException("Incomatible Mat");
//FIXME: do we need release() here?
}
protected CvVector(int d, int ch, Mat m) {
super(m, Range.all());
depth = d;
channels = ch;
if( !empty() && checkVector(channels, depth) < 0 )
throw new IllegalArgumentException("Incomatible Mat");
//FIXME: do we need release() here?
}
protected void create(int cnt) {
if(cnt>0)
super.create(cnt, 1, CvType.makeType(depth, channels));
}
}

View File

@@ -0,0 +1,42 @@
package org.opencv.core;
public class CvVectorByte extends CvVector {
private static final int _d = CvType.CV_8U;
public CvVectorByte(int ch) {
super(_d, ch);
}
public CvVectorByte(int ch, long addr) {
super(_d, ch, addr);
}
public CvVectorByte(long addr) {
super(_d, 1, addr);
}
public CvVectorByte(int ch, Mat m) {
super(_d, ch, m);
}
public CvVectorByte(int ch, byte[] a) {
super(_d, ch);
if(a!=null) {
int cnt = a.length / ch;
create(cnt);
put(0, 0, a);
}
}
public byte[] toArray(byte[] a) {
int cnt = (int) total() * channels;
if(cnt == 0)
return new byte[0];//null;
byte[] res = a;
if(res==null || res.length<cnt)
res = new byte[cnt];
get(0, 0, res); //TODO: check ret val!
return res;
}
}

View File

@@ -0,0 +1,49 @@
package org.opencv.core;
import org.opencv.features2d.DMatch;
public class CvVectorDMatch extends CvVectorFloat {
private static final int _ch = 4; //xxxC4
public CvVectorDMatch() {
super(_ch);
}
public CvVectorDMatch(long addr) {
super(_ch, addr);
}
public CvVectorDMatch(Mat m) {
super(_ch, m);
}
public CvVectorDMatch(DMatch[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
float buff[] = new float[_ch * cnt];
for(int i=0; i<cnt; i++) {
DMatch m = a[i];
buff[_ch*i+0] = m.queryIdx;
buff[_ch*i+1] = m.trainIdx;
buff[_ch*i+2] = m.imgIdx;
buff[_ch*i+3] = m.distance;
}
put(0, 0, buff); //TODO: check ret val!
}
public DMatch[] toArray(DMatch[] a) {
float buff[] = super.toArray(null);
if(buff.length == 0)
return new DMatch[0]; //null;
int cnt = buff.length / _ch;
DMatch[] res = a;
if(a==null || a.length<cnt)
res = new DMatch[cnt];
for(int i=0; i<cnt; i++)
res[i] = new DMatch((int) buff[_ch*i+0], (int) buff[_ch*i+1], (int) buff[_ch*i+2], buff[_ch*i+3]);
return res;
}
}

View File

@@ -0,0 +1,37 @@
package org.opencv.core;
public class CvVectorDouble extends CvVector {
private static final int _d = CvType.CV_64F;
public CvVectorDouble(int ch) {
super(_d, ch);
}
public CvVectorDouble(int ch, long addr) {
super(_d, ch, addr);
}
public CvVectorDouble(int ch, Mat m) {
super(_d, ch, m);
}
public CvVectorDouble(int ch, double[] a) {
super(_d, ch);
if(a!=null) {
int cnt = a.length / ch;
create(cnt);
put(0, 0, a);
}
}
public double[] toArray(double[] a) {
int cnt = (int) total() * channels;
if(cnt == 0)
return new double[0];//null;
double[] res = a;
if(res==null || res.length<cnt)
res = new double[cnt];
get(0, 0, res); //TODO: check ret val!
return res;
}
}

View File

@@ -0,0 +1,41 @@
package org.opencv.core;
public class CvVectorFloat extends CvVector {
private static final int _d = CvType.CV_32F;
public CvVectorFloat(int ch) {
super(_d, ch);
}
public CvVectorFloat(int ch, long addr) {
super(_d, ch, addr);
}
public CvVectorFloat(long addr) {
super(_d, 1, addr);
}
public CvVectorFloat(int ch, Mat m) {
super(_d, ch, m);
}
public CvVectorFloat(int ch, float[] a) {
super(_d, ch);
if(a!=null) {
int cnt = a.length / ch;
create(cnt);
put(0, 0, a);
}
}
public float[] toArray(float[] a) {
int cnt = (int) total() * channels;
if(cnt == 0)
return new float[0];//null;
float[] res = a;
if(res==null || res.length<cnt)
res = new float[cnt];
get(0, 0, res); //TODO: check ret val!
return res;
}
}

View File

@@ -0,0 +1,22 @@
package org.opencv.core;
public class CvVectorFloat4 extends CvVectorFloat {
private static final int _ch = 4; //xxxC4
public CvVectorFloat4() {
super(_ch);
}
public CvVectorFloat4(long addr) {
super(_ch, addr);
}
public CvVectorFloat4(Mat m) {
super(_ch, m);
}
public CvVectorFloat4(float[] a) {
super(_ch, a);
}
}

View File

@@ -0,0 +1,21 @@
package org.opencv.core;
public class CvVectorFloat6 extends CvVectorFloat {
private static final int _ch = 6; //xxxC6
public CvVectorFloat6() {
super(_ch);
}
public CvVectorFloat6(long addr) {
super(_ch, addr);
}
public CvVectorFloat6(Mat m) {
super(_ch, m);
}
public CvVectorFloat6(float[] a) {
super(_ch, a);
}
}

View File

@@ -0,0 +1,38 @@
package org.opencv.core;
public class CvVectorInt extends CvVector {
private static final int _d = CvType.CV_32S;
public CvVectorInt(int ch) {
super(_d, ch);
}
public CvVectorInt(int ch, long addr) {
super(_d, ch, addr);
}
public CvVectorInt(int ch, Mat m) {
super(_d, ch, m);
}
public CvVectorInt(int ch, int[] a) {
super(_d, ch);
if(a!=null) {
int cnt = a.length / ch;
create(cnt);
put(0, 0, a);
}
}
public int[] toArray(int[] a) {
int cnt = (int) total() * channels;
if(cnt == 0)
return new int[0];//null;
int[] res = a;
if(res==null || res.length<cnt)
res = new int[cnt];
get(0, 0, res); //TODO: check ret val!
return res;
}
}

View File

@@ -0,0 +1,53 @@
package org.opencv.core;
import org.opencv.features2d.KeyPoint;
public class CvVectorKeyPoint extends CvVectorFloat {
private static final int _ch = 7; //xxxC7
public CvVectorKeyPoint() {
super(_ch);
}
public CvVectorKeyPoint(long addr) {
super(_ch, addr);
}
public CvVectorKeyPoint(Mat m) {
super(_ch, m);
}
public CvVectorKeyPoint(KeyPoint[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
float buff[] = new float[_ch * cnt];
for(int i=0; i<cnt; i++) {
KeyPoint kp = a[i];
buff[_ch*i+0] = (float) kp.pt.x;
buff[_ch*i+1] = (float) kp.pt.y;
buff[_ch*i+2] = kp.size;
buff[_ch*i+3] = kp.angle;
buff[_ch*i+4] = kp.response;
buff[_ch*i+5] = kp.octave;
buff[_ch*i+6] = kp.class_id;
}
put(0, 0, buff); //TODO: check ret val!
}
public KeyPoint[] toArray(KeyPoint[] a) {
float buff[] = super.toArray(null);
if(buff.length == 0)
return new KeyPoint[0]; //null;
int cnt = buff.length / _ch;
KeyPoint[] res = a;
if(a==null || a.length<cnt)
res = new KeyPoint[cnt];
for(int i=0; i<cnt; i++)
res[i] = new KeyPoint( buff[_ch*i+0], buff[_ch*i+1], buff[_ch*i+2], buff[_ch*i+3],
buff[_ch*i+4], (int) buff[_ch*i+5], (int) buff[_ch*i+6] );
return res;
}
}

View File

@@ -0,0 +1,45 @@
package org.opencv.core;
public class CvVectorPoint extends CvVectorInt {
private static final int _ch = 2; //xxxC2
public CvVectorPoint() {
super(_ch);
}
public CvVectorPoint(long addr) {
super(_ch, addr);
}
public CvVectorPoint(Mat m) {
super(_ch, m);
}
public CvVectorPoint(Point[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
int buff[] = new int[_ch * cnt];
for(int i=0; i<cnt; i++) {
Point p = a[i];
buff[_ch*i+0] = (int) p.x;
buff[_ch*i+1] = (int) p.y;
}
put(0, 0, buff); //TODO: check ret val!
}
public Point[] toArray(Point[] a) {
int buff[] = super.toArray(null);
if(buff.length == 0)
return new Point[0]; //null;
int cnt = buff.length / _ch;
Point[] res = a;
if(a==null || a.length<cnt)
res = new Point[cnt];
for(int i=0; i<cnt; i++)
res[i] = new Point(buff[i*_ch], buff[i*_ch+1]);
return res;
}
}

View File

@@ -0,0 +1,45 @@
package org.opencv.core;
public class CvVectorPoint2f extends CvVectorFloat {
private static final int _ch = 2; //xxxC2
public CvVectorPoint2f() {
super(_ch);
}
public CvVectorPoint2f(long addr) {
super(_ch, addr);
}
public CvVectorPoint2f(Mat m) {
super(_ch, m);
}
public CvVectorPoint2f(Point[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
float buff[] = new float[_ch * cnt];
for(int i=0; i<cnt; i++) {
Point p = a[i];
buff[_ch*i+0] = (float) p.x;
buff[_ch*i+1] = (float) p.y;
}
put(0, 0, buff); //TODO: check ret val!
}
public Point[] toArray(Point[] a) {
float buff[] = super.toArray(null);
if(buff.length == 0)
return new Point[0]; //null;
int cnt = buff.length / _ch;
Point[] res = a;
if(a==null || a.length<cnt)
res = new Point[cnt];
for(int i=0; i<cnt; i++)
res[i] = new Point(buff[i*_ch], buff[i*_ch+1]);
return res;
}
}

View File

@@ -0,0 +1,46 @@
package org.opencv.core;
public class CvVectorPoint3 extends CvVectorInt {
private static final int _ch = 3; //xxxC2
public CvVectorPoint3() {
super(_ch);
}
public CvVectorPoint3(long addr) {
super(_ch, addr);
}
public CvVectorPoint3(Mat m) {
super(_ch, m);
}
public CvVectorPoint3(Point3[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
int buff[] = new int[_ch * cnt];
for(int i=0; i<cnt; i++) {
Point3 p = a[i];
buff[_ch*i] = (int) p.x;
buff[_ch*i+1] = (int) p.y;
buff[_ch*i+2] = (int) p.z;
}
put(0, 0, buff); //TODO: check ret val!
}
public Point3[] toArray(Point3[] a) {
int buff[] = super.toArray(null);
if(buff.length == 0)
return new Point3[0]; //null;
int cnt = buff.length / _ch;
Point3[] res = a;
if(a==null || a.length<cnt)
res = new Point3[cnt];
for(int i=0; i<cnt; i++)
res[i] = new Point3(buff[i*_ch], buff[i*_ch+1], buff[i*_ch+2]);
return res;
}
}

View File

@@ -0,0 +1,46 @@
package org.opencv.core;
public class CvVectorPoint3f extends CvVectorFloat {
private static final int _ch = 3; //xxxC2
public CvVectorPoint3f() {
super(_ch);
}
public CvVectorPoint3f(long addr) {
super(_ch, addr);
}
public CvVectorPoint3f(Mat m) {
super(_ch, m);
}
public CvVectorPoint3f(Point3[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
float buff[] = new float[_ch * cnt];
for(int i=0; i<cnt; i++) {
Point3 p = a[i];
buff[_ch*i] = (float) p.x;
buff[_ch*i+1] = (float) p.y;
buff[_ch*i+2] = (float) p.z;
}
put(0, 0, buff); //TODO: check ret val!
}
public Point3[] toArray(Point3[] a) {
float buff[] = super.toArray(null);
if(buff.length == 0)
return new Point3[0]; //null;
int cnt = buff.length / _ch;
Point3[] res = a;
if(a==null || a.length<cnt)
res = new Point3[cnt];
for(int i=0; i<cnt; i++)
res[i] = new Point3(buff[i*_ch], buff[i*_ch+1], buff[i*_ch+2]);
return res;
}
}

View File

@@ -0,0 +1,48 @@
package org.opencv.core;
public class CvVectorRect extends CvVectorInt {
private static final int _ch = 4; //xxxC4
public CvVectorRect() {
super(_ch);
}
public CvVectorRect(long addr) {
super(_ch, addr);
}
public CvVectorRect(Mat m) {
super(_ch, m);
}
public CvVectorRect(Rect[] a) {
super(_ch);
if(a==null)
return;
int cnt = a.length;
create(cnt);
int buff[] = new int[_ch * cnt];
for(int i=0; i<cnt; i++) {
Rect r = a[i];
buff[_ch*i] = r.x;
buff[_ch*i+1] = r.y;
buff[_ch*i+2] = r.width;
buff[_ch*i+3] = r.height;
}
put(0, 0, buff); //TODO: check ret val!
}
public Rect[] toArray(Rect[] a) {
int buff[] = super.toArray(null);
if(buff.length == 0)
return new Rect[0]; //null;
int cnt = buff.length / _ch;
Rect[] res = a;
if(a==null || a.length<cnt)
res = new Rect[cnt];
for(int i=0; i<cnt; i++)
res[i] = new Rect(buff[i*_ch], buff[i*_ch+1], buff[i*_ch+2], buff[i*_ch+3]);
return res;
}
}

View File

@@ -3,11 +3,16 @@ package org.opencv.utils;
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.CvVectorPoint2f;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Point3;
import org.opencv.core.Rect;
import org.opencv.core.CvVectorByte;
import org.opencv.core.CvVectorDMatch;
import org.opencv.core.CvVectorKeyPoint;
import org.opencv.core.CvVectorPoint;
import org.opencv.features2d.DMatch;
import org.opencv.features2d.KeyPoint;
@@ -468,14 +473,14 @@ public class Converters {
(float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
}
}
// vector_vector_Point
public static Mat vector_vector_Point_to_Mat(List<List<Point>> pts, List<Mat> mats) {
public static Mat vector_vector_Point_to_Mat(List<CvVectorPoint> pts, List<Mat> mats) {
Mat res;
int lCount = (pts != null) ? pts.size() : 0;
if (lCount > 0) {
for (List<Point> lpt : pts)
mats.add(vector_Point_to_Mat(lpt));
for (CvVectorPoint vpt : pts)
mats.add(vpt);
res = vector_Mat_to_Mat(mats);
} else {
res = new Mat();
@@ -483,8 +488,7 @@ public class Converters {
return res;
}
// vector_vector_Point2f
public static void Mat_to_vector_vector_Point2f(Mat m, List<List<Point>> pts) {
public static void Mat_to_vector_vector_Point(Mat m, List<CvVectorPoint> pts) {
if (pts == null)
throw new java.lang.IllegalArgumentException("Output List can't be null");
@@ -494,19 +498,34 @@ public class Converters {
List<Mat> mats = new ArrayList<Mat>(m.rows());
Mat_to_vector_Mat(m, mats);
for (Mat mi : mats) {
List<Point> pt = new ArrayList<Point>();
Mat_to_vector_Point2f(mi, pt);
CvVectorPoint pt = new CvVectorPoint(mi);
pts.add(pt);
}
}
// vector_vector_Point2f
public static void Mat_to_vector_vector_Point2f(Mat m, List<CvVectorPoint2f> pts) {
if (pts == 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) {
CvVectorPoint2f pt = new CvVectorPoint2f(mi);
pts.add(pt);
}
}
// vector_vector_KeyPoint
public static Mat vector_vector_KeyPoint_to_Mat(List<List<KeyPoint>> kps, List<Mat> mats) {
public static Mat vector_vector_KeyPoint_to_Mat(List<CvVectorKeyPoint> kps, List<Mat> mats) {
Mat res;
int lCount = (kps != null) ? kps.size() : 0;
if (lCount > 0) {
for (List<KeyPoint> lkp : kps)
mats.add(vector_KeyPoint_to_Mat(lkp));
for (CvVectorKeyPoint vkp : kps)
mats.add(vkp);
res = vector_Mat_to_Mat(mats);
} else {
res = new Mat();
@@ -514,7 +533,7 @@ public class Converters {
return res;
}
public static void Mat_to_vector_vector_KeyPoint(Mat m, List<List<KeyPoint>> kps) {
public static void Mat_to_vector_vector_KeyPoint(Mat m, List<CvVectorKeyPoint> kps) {
if (kps == null)
throw new java.lang.IllegalArgumentException("Output List can't be null");
@@ -524,9 +543,8 @@ public class Converters {
List<Mat> mats = new ArrayList<Mat>(m.rows());
Mat_to_vector_Mat(m, mats);
for (Mat mi : mats) {
List<KeyPoint> lkp = new ArrayList<KeyPoint>();
Mat_to_vector_KeyPoint(mi, lkp);
kps.add(lkp);
CvVectorKeyPoint vkp = new CvVectorKeyPoint(mi);
kps.add(vkp);
}
}
@@ -600,12 +618,12 @@ public class Converters {
}
// vector_vector_DMatch
public static Mat vector_vector_DMatch_to_Mat(List<List<DMatch>> lldm, List<Mat> mats) {
public static Mat vector_vector_DMatch_to_Mat(List<CvVectorDMatch> lvdm, List<Mat> mats) {
Mat res;
int lCount = (lldm != null) ? lldm.size() : 0;
int lCount = (lvdm != null) ? lvdm.size() : 0;
if (lCount > 0) {
for (List<DMatch> ldm : lldm)
mats.add(vector_DMatch_to_Mat(ldm));
for (CvVectorDMatch vdm : lvdm)
mats.add(vdm);
res = vector_Mat_to_Mat(mats);
} else {
res = new Mat();
@@ -613,8 +631,8 @@ public class Converters {
return res;
}
public static void Mat_to_vector_vector_DMatch(Mat m, List<List<DMatch>> lldm) {
if (lldm == null)
public static void Mat_to_vector_vector_DMatch(Mat m, List<CvVectorDMatch> lvdm) {
if (lvdm == null)
throw new java.lang.IllegalArgumentException("Output List can't be null");
if (m == null)
@@ -622,20 +640,20 @@ public class Converters {
List<Mat> mats = new ArrayList<Mat>(m.rows());
Mat_to_vector_Mat(m, mats);
lvdm.clear();
for (Mat mi : mats) {
List<DMatch> ldm = new ArrayList<DMatch>();
Mat_to_vector_DMatch(mi, ldm);
lldm.add(ldm);
CvVectorDMatch vdm = new CvVectorDMatch(mi);
lvdm.add(vdm);
}
}
// vector_vector_char
public static Mat vector_vector_char_to_Mat(List<List<Byte>> llb, List<Mat> mats) {
public static Mat vector_vector_char_to_Mat(List<CvVectorByte> lvb, List<Mat> mats) {
Mat res;
int lCount = (llb != null) ? llb.size() : 0;
int lCount = (lvb != null) ? lvb.size() : 0;
if (lCount > 0) {
for (List<Byte> lb : llb)
mats.add(vector_char_to_Mat(lb));
for (CvVectorByte vb : lvb)
mats.add(vb);
res = vector_Mat_to_Mat(mats);
} else {
res = new Mat();