Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- #include<iomanip>
- #include<sstream>
- using namespace std;
- int main(int argc, char** argv)
- {
- if(argc!=3)
- {
- fprintf(stderr,"Usage: %s\n(1)Input_filename\n(2)Output_filename",argv[0]);
- //exit(1);
- }
- ifstream ifs(argv[1]);
- ofstream ofs(argv[2]);
- string line;
- int num=0;
- while(getline(ifs,line))
- {
- float x,y,z;
- //int a,b,c,d,e,f;
- int r,g,b;
- int x_i,y_i;
- float y_c,x_c;
- //std::cout << std::fixed << std::setprecision(2) << pi << '\n';
- istringstream is(line);
- is >> x >> y >> z >> r >> g >> b;
- num=num+1;
- //x_i=(int)x*10000;
- //y_i=(int)y*10000;
- //y_c=(float)y_i/10000;
- //x_c=(float)x_i/10000;
- //cout<< y <<" "<< x <<" "<< z <<" "<< r <<" "<< g <<" "<< b <<endl;
- //ofs << fixed << setprecision(4) << x <<" "<< y;
- //ofs <<" "<< z <<" "<< r <<" "<< g <<" "<< b <<endl;
- }
- cout <<"the nunber of pointcloud="<< num << endl;
- ifs.close();
- ofs.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement