Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to map Java's List<mat> to vector of vectors?

The decode method of the contributed structured_light module uses an InputArrayOfArrays parameter which is mapped to a List<Mat> type in the Java wrapper. In the method the parameter is cast to a vector of verctors with the following line:

std::vector<std::vector<Mat> >& acquired_pattern = *( std::vector<std::vector<Mat> >* ) patternImages.getObj();

How should I properly construct Java's Mat object (being a single item in the list parameter) for the cast to work correctly? I suppose the intention is for the single Java's Mat instance to map to a single vector in C.