Hi, my text file contains 640 rows 480 columns of floating points. Id like to read them into a matrix and reshape at the end. But the code below only reads a single data per row. Help me edit the stream >> x please.
std::ifstream file("img1.txt");
Mat depthImg;
int i = 0;
std::string line;
while (std::getline(file, line)) {
std::istringstream stream(line);
double x;
while (stream >> x) {
depthImg.push_back(x);
}
}