Example for 3D output of a camera path as VRML ,ThreeDOut
- Author
- MIP
#include <Utils/ThreeDOut.hh>
#include <Utils/Param.hh>
#include <Image/Camera.hh>
#include <Base/Image/ImageIO.hh>
#include <vector>
using namespace std;
using namespace BIAS;
int main(int argc, char* argv[]) {
string* imagesList =
"pass list of images containing projections", "");
string* outputName =
"name of resulting wrl", "");
"color of coord frame, default [0.0 0.0 0.0 255.0]",
"0.0 0.0 0.0 255.0");
double* scale =
bool* help = params.
AddParamBool(
"help",
"this helpful output",
false,
'h');
if(*help) {
cout<<argv[0]<<" converts a list of projections into a vrml\n";
return 0;
}
vector<string> vectorOfImageNames;
Param::ParseListFile(*imagesList, vectorOfImageNames);
vector<string>::iterator begin = vectorOfImageNames.begin();
vector<string>::iterator end = vectorOfImageNames.end();
for(vector<string>::iterator pos=begin; pos!=end; pos++) {
if(ImageIO::Load(*pos, img) != 0) {
BIASERR("could not image "<<*pos<<"!");
return -1;
}
col[0] = (unsigned char)((*color)[0]);
col[1] = (unsigned char)((*color)[1]);
col[2] = (unsigned char)((*color)[2]);
col[3] = (unsigned char)((*color)[3]);
}
cout<<"finished\n";
return 0;
}