std::vector<double> row1;
row1.push_back(1.0); row1.push_back(2.0); row1.push_back(3.0);
std::vector<double> row2;
row2.push_back(4.0); row2.push_back(5.0); row2.push_back(6.0);
std::vector<std::vector<double> > vector_of_rows;
vector_of_rows.push_back(row1);
vector_of_rows.push_back(row2);
// make sure the size of of row1 and row2 are the same, else you'll have serious problems!
cv::Mat my_mat(vector_of_rows.size(), row1.size(), CV_64F);
for (size_t i = 0; i < vector_of_rows.size(); i++)
{
for (size_t j = 0; j < row1.size(); j++)
{
my_mat.at<double>(i,j) = vector_of_rows[i][j];
}
}
std::cout << my_mat << std::endl;
////////////////////////////////// 이것도 된다. ////////////////////////////////////
for (int i = 0; i < img_rows; ++i)
{
comb_img.row(i) = Mat(text_score_comb[i]).t();
}
////////////////////////////////// 이것도 된다. ////////////////////////////////////
Mat comb_img(img_rows, img_cols, CV_8U);
for (int i = 0; i < img_rows; ++i)
for (int j = 0; j < img_cols; ++j)
comb_img.at<uchar>(i, j) = (uchar)(text_score_comb.at(i).at(j));
https://stackoverflow.com/questions/10898591/convert-a-stdvectorstdvector-double-representing-a-2d-array-to-cvmat