Advertisement
tomohiro-tabo

kazoeru_xyzrgb2yxzrgb

Dec 8th, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. #include<iomanip>
  4. #include<sstream>
  5.  
  6. using namespace std;
  7.  
  8. int main(int argc, char** argv)
  9. {
  10.  
  11. if(argc!=3)
  12. {
  13. fprintf(stderr,"Usage: %s\n(1)Input_filename\n(2)Output_filename",argv[0]);
  14. //exit(1);
  15. }
  16.  
  17. ifstream ifs(argv[1]);
  18. ofstream ofs(argv[2]);
  19. string line;
  20. int num=0;
  21. while(getline(ifs,line))
  22. {
  23. float x,y,z;
  24. //int a,b,c,d,e,f;
  25. int r,g,b;
  26. int x_i,y_i;
  27. float y_c,x_c;
  28.  
  29. //std::cout << std::fixed << std::setprecision(2) << pi << '\n';
  30.  
  31. istringstream is(line);
  32.  
  33. is >> x >> y >> z >> r >> g >> b;
  34. num=num+1;
  35.  
  36. //x_i=(int)x*10000;
  37. //y_i=(int)y*10000;
  38.  
  39. //y_c=(float)y_i/10000;
  40. //x_c=(float)x_i/10000;
  41.  
  42. //cout<< y <<" "<< x <<" "<< z <<" "<< r <<" "<< g <<" "<< b <<endl;
  43. //ofs << fixed << setprecision(4) << x <<" "<< y;
  44. //ofs <<" "<< z <<" "<< r <<" "<< g <<" "<< b <<endl;
  45.  
  46.  
  47. }
  48. cout <<"the nunber of pointcloud="<< num << endl;
  49. ifs.close();
  50. ofs.close();
  51.  
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement