Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

since this is probably still about the face rcognition, -- you have some options:

// 1. use an int[]
int[] data = {1,2,3,4,5,6}; // however you fill it
Mat labels(6,1,CV_32S);
labels.put(0,0, data);

// 2. use MatOfInt
MatOfInt labels; // initially empty !
for (each item)
    labels.push_back(MatOfInt(17));

since this is probably still about the face rcognition, -- you have some options:

// 1. use an int[]
int[] data = {1,2,3,4,5,6}; // however you fill it
Mat labels(6,1,CV_32S);
labels.put(0,0, data);

// 2. use MatOfInt
MatOfInt labels; labels = new MatOfInt(); // initially empty !
for (each item)
    labels.push_back(MatOfInt(17));

since this is probably still about the face rcognition, -- you have some options:

// 1. use an int[]
int[] data = {1,2,3,4,5,6}; // however you fill it
Mat labels(6,1,CV_32S);
labels.put(0,0, data);

// 2. use MatOfInt
MatOfInt labels = new MatOfInt(); // initially empty !
for (each item)
    labels.push_back(MatOfInt(17));
labels.push_back(new MatOfInt(17));