00001 #include "OglGui/Window.h" 00002 #include "OglGui/StaticText.h" 00003 #include "Visualization/ImageSet.h" 00004 #include "OglGui/OglLib.cpp" 00005 00006 #include "Basis/CmdOptions.h" 00007 #include "Core/Array/ReadPng.h" 00008 #include "Core/Array/WritePng.h" 00009 #include "Core/Array/InvQuasi.h" 00010 00011 using namespace Impala; 00012 using namespace Core; 00013 using namespace Array; 00014 00015 int main(int argc, char** argv) 00016 { 00017 Impala::CmdOptions& options = Impala::CmdOptions::GetInstance(); 00018 options.AddOption(0, "sigma", "sigma for the gaussian derivatives", "1.0"); 00019 options.AddOption(0, "precision", "precision for the gaussian derivatives", "2"); 00020 if(!options.ParseArgs(argc, argv, "<input image>", 1)) 00021 return 0; 00022 00023 std::string filename = options.GetArg(0); 00024 double sigma = options.GetDouble("sigma"); 00025 double precision = options.GetDouble("precision"); 00026 00027 Array2dVec3UInt8* inputimage = 0; 00028 ReadPng(inputimage, filename); 00029 if(inputimage == 0) 00030 return 0; 00031 00032 Array2dVec3Real64* src = 0; 00033 Set(src, inputimage); 00034 00035 std::vector<Array2dScalarReal64*> quasiList = InvQuasi(src, sigma, precision); 00036 00037 OglGui::Window* win = new OglGui::Window(0,0,1080,550); 00038 win->SetBackground(0xffffff); 00039 Visualization::ImagesWindow* images; 00040 00041 new OglGui::StaticText(win,800,16,"joosts invarianten", false); 00042 images = new Visualization::ImageSet(win, 256, 256, 2.0, 2, 1); 00043 images->AddImage(inputimage, "Direct", "original", false, false, -1); 00044 images->AddImage(inputimage, "Direct", "original", false, false, -1); 00045 00046 images->AddImage(quasiList[0], "Stretch", "specular quasi invariant", false, false, -1); 00047 images->AddImage(quasiList[1], "Stretch", "specular variant", false, false, -1); 00048 images->AddImage(quasiList[2], "Stretch", "shadow-shading quasi invariant", false, false, -1); 00049 images->AddImage(quasiList[3], "Stretch", "shadow-shading variant", false, false, -1); 00050 images->AddImage(quasiList[4], "Stretch", "specular shadow-shading quasi invariant", false, false, -1); 00051 images->AddImage(quasiList[5], "Stretch", "specular shadow-shading variant", false, false, -1); 00052 00053 win->Start(); 00054 while(1) 00055 { 00056 if(OglGui::Sys::Instance().WindowManage()) 00057 break; 00058 ::Sleep(20); 00059 } 00060 00061 return 1; 00062 }