Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to copy vector to a row of a Mat using openCV 2.4.11?

Hi

How to copy an entire vector to a row of a Mat using openCV 2.4.11?

I tried those ways, but none of them worked:

        vector<float> ders;
        Mat Hogfeat;

        Hogfeat.row(j) = ders.clone();
        ders.copyTo(Hogfeat.row(j));

But I get those errors at compile time:

         main.cpp:75:26: error: ‘class std::vector<float>’ has no member named ‘clone’
                  Hogfeat.row(j) = ders.clone();

        main.cpp:76:9: error: ‘class std::vector<float>’ has no member named ‘copyTo’
                 ders.copyTo(Hogfeat.row(j));

I would like to not use for loops to copy every element of the vector "manually" to the Mat in question. What am I doing wrong or what alternatives are there?

Thanks!