32 using namespace ossim;
35 int main(
int argc,
char *argv[])
45 cout<<
"\nUsage: "<<argv[0]<<
" <atp-results.json>\n"<<endl;
53 cout<<
"\nError opening JSON file <"<<argv[1]<<
">\n"<<endl;
62 const Json::Value& pbJson = root[
"photoblock"];
65 vector<shared_ptr<Image> >& imageList = photoblock.
getImageList();
70 cout <<
"\n " << root_name <<
" -- No tiepoints found." << endl;
76 map<string, ossimRefPtr<ossimImageGeometry> > geomList;
78 for (
auto &image : imageList)
80 handler = factory->
open(image->getFilename());
83 cout<<
"\nError loading image file <"<<image->getFilename()<<
">\n"<<endl;
91 vector<double> distances;
96 NEWMAT::SymmetricMatrix cov;
98 for (
auto &tp : tpList)
100 tp->getImagePoint(0, imageID, ipA, cov);
101 geomA = geomList.find(imageID)->second;
103 tp->getImagePoint(1, imageID, ipB, cov);
104 geomB = geomList.find(imageID)->second;
106 if (!geomA || !geomB)
108 cout<<
"\nError: null image geometry encountered.\n"<<endl;
119 double mean = accum / tpList.size();
123 double sigma = sqrt(e/distances.size());
125 cout<<
"\n "<<root_name<<
" mean residual: "<<mean<<
" +- "<<sigma<<
" m"<<endl;
virtual bool open()=0
Pure virtual open.
ossimFilename noExtension() const
void initialize(int &argc, char **argv)
std::basic_ifstream< char > ifstream
Class for char input file streams.
void addOptions(ossimArgumentParser &parser)
int main(int argc, char *argv[])
This code was derived from https://gist.github.com/mshockwave.
Class for representing MSP PhotoBlock.
ImageList & getImageList()
double distanceTo(const ossimGpt &arg_gpt) const
METHOD: distanceTo(ossimGpt) Computes straight-line distance in meters between this and arg gpt: ...
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
TiePointList & getTiePointList()
static ossimInit * instance()
static ossimImageHandlerRegistry * instance()
float distance(double lat1, double lon1, double lat2, double lon2, int units)
const std::string & string() const