Ask Your Question

Revision history [back]

The answer is that the featuresG[i] is 1x23328 in size. Being used to linear algebra where mxn signifies m rows and n columns, I believed that copying featuresG[i] into Mat(posGCount + negCount, 23328, gLabels.type()) was matching the correct column size of 23328, but no. In actuality, OpenCV's Mat.size() method returns columns x rows... So, after addressing the issue from this standpoint, I was able to fix the problem.

The answer is that the featuresG[i] is 1x23328 in size. Being used to linear algebra where mxn signifies m rows and n columns, I believed that copying featuresG[i] into Mat(posGCount + negCount, 23328, gLabels.type())(trainingMatG.rowRange(i,i+1) was matching the correct column size of 23328, but no. In actuality, OpenCV's Mat.size() method returns columns x rows... So, after addressing the issue from this standpoint, I was able to fix the problem.

The answer is that the featuresG[i] is 1x23328 in size. Being used to linear algebra where mxn signifies m rows and n columns, I believed that copying featuresG[i] into (trainingMatG.rowRange(i,i+1) was matching the correct column size of 23328, but no. In actuality, OpenCV's Mat.size() method returns columns x rows... So, after addressing the issue from this standpoint, standpoint by setting features[count] = descriptors.t(), I was able to fix the problem.