Last active
March 22, 2018 18:05
-
-
Save MareArts/8ac6696501814a855c4fca65e2bf1b86 to your computer and use it in GitHub Desktop.
Extract the value of interest rows and copy that to new Mat using concate.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//using concate | |
cout << "\ncopy interest rows to new Mat using concate\n"; | |
Mat c; | |
for (auto it : row_index_interest) | |
{ | |
if (c.empty()) | |
{ | |
c = a.row(it); | |
continue; | |
}else{ | |
//cout << a.row(it) << endl; | |
vconcat(c, a(Range(it, it+1), Range::all()), c); | |
/* //or | |
Mat t; | |
vconcat(c, a(Range(it, it+1), Range::all()), t); | |
c = t; | |
*/ | |
} | |
} | |
cout << "\nnew Mat\n"; | |
cout << c << endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment