25 #include <Base/Common/BIASpragma.hh>
27 #include <Base/Image/ImageIO.hh>
28 #include <Image/Camera.hh>
42 cout <<
"Usage: biassetprojection imagefile projectionfile [destfile]"
44 cout <<
"This program opens the image file and the projection file" << endl
45 <<
"given by the command line, copies the projection into the image"
47 <<
"and saves the image to destfile. If no destfile is given,"
48 << endl <<
"the source image file is overwritten." << endl;
51 int main(
int argc,
char* argv[]) {
64 BIASERR(
"Failed to load image: " << argv[1]);
70 BIASERR(
"Failed to load image: " << argv[1]);
77 BIASERR(
"Failed to load image: " << argv[1]);
81 BIASERR(
"only float and unsigned char images supported");
89 if (projection.
XMLRead(argv[2]) != 0) {
90 BIASERR(
"Failed to load projection: " << argv[2]);
93 #endif //BIAS_HAVE_XML2
104 string destfile = argv[1];
111 BIAS_DEFAULT_SYNC, BIAS_DEFAULT_IMAGE_QUALITY,
false,
true)
113 BIASERR(
"Failed to save image: " << destfile);
119 BIAS_DEFAULT_IMAGE_QUALITY,
false,
true) != 0) {
120 BIASERR(
"Failed to save image: " << destfile);
int XMLRead(const std::string &Filename)
derived classes must implement the function XMLIn which is called by this function XMLRead to read ev...
This class hides the underlying projection model, like projection matrix, spherical camera...
int SetProj(const Projection &Proj)
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
int UpdateMetaData()
copy P_ and co.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
enum EStorageType GetStorageType() const
(8bit) unsigned char image storage type
This is the base class for images in BIAS.