How do I convert a 3 by 3 single channel Mat to a 1 by 3 triple channel array in OpenCV?
I have a 3 by 3 rotation matrix, created with the header cvCreateMat(3, 3, CV_32FC1)
. This is the matrix I get from calling cvRodrigues2. I want to rotate several points stored in an array of length N with 3 channels. To do this rotation I call cvMul(rotation, points)
, but this requires that the rotation matrix be an array. I therfore need to convert it开发者_StackOverflow社区 to a cvCreateMat(3, 1, CV_32FC3)
. Is there any way to do this in openCV (in C, if it makes any difference).
Using cvReshape (link to documentation). The second example is very alike to what you want (you just have to adapt the number of rows and channels).
精彩评论