demonstrates reading of RAW4096 image format Reads a .raw RAW4096 image which contains a scorpion 1600x1200 Bayer raw pattern with 8 bpp and writes it as a jpeg. This format is used by Mediendom project by Jan Woetzel and Juergen Rienow 2005.
- Author
- Jan Woetzel 05/2005
#include <Base/Image/ImageIO.hh>
#include <Base/Image/ImageConvert.hh>
#include <Base/Debug/Error.hh>
#include <Base/Debug/DebugSimple.hh>
using namespace std;
using namespace BIAS;
void usage(int , char** )
{
cout<<"usage: readRAW <img.raw> <out.jpg> <jpgQuality>"<<endl
<<"author: Jan Woetzel"<<endl;
}
int main(int argc, char** argv){
if (argc==1) usage(argc, argv);
cout<<"started ";
if (argc>0) cout<<argv[0];
cout<<endl;
string in("img.raw");
string out("img_out.jpg");
unsigned int quality=100;
if (argc>1) in =argv[1];
if (argc>2) out=argv[2];
if (argc>3) quality=atoi(argv[3]);
int result = 0;
if (result!=0) {
cout<<"could not load image "<<in<<endl;
return -2;
};
if (result!=0)
cout<<"could not write image."<<endl;
#ifdef BIAS_HAVE_OPENCV
imgRGB.
Display(
"imgRGB",
true,
false,
true, 6000);
#endif // BIAS_HAVE_OPENCV
cout<<"done."<<endl;
}