OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimApplanixEcefModel.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 //*******************************************************************
10 // $Id: ossimApplanixEcefModel.cpp 23564 2015-10-02 14:12:25Z dburken $
11 #include <sstream>
17 #include <ossim/base/ossimDatum.h>
20 #include <ossim/base/ossimTrace.h>
26 static ossimTrace traceDebug("ossimApplanixEcefModel:debug");
27 
28 RTTI_DEF1(ossimApplanixEcefModel, "ossimApplanixEcefModel", ossimSensorModel);
29 
30 #ifdef OSSIM_ID_ENABLED
31 static const char OSSIM_ID[] = "$Id: ossimApplanixEcefModel.cpp 23564 2015-10-02 14:12:25Z dburken $";
32 #endif
33 
35 {
38  theRoll = 0.0;
39  thePitch = 0.0;
40  theHeading = 0.0;
41  theFocalLength = 55.0;
42  thePixelSize = ossimDpt(.009, .009);
43  theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
44  theAdjEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
45  theGSD.x = 0.1524;
46  theGSD.y = 0.1524;
47  theMeanGSD = 0.1524;
50 
51  if (traceDebug())
52  {
54  << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
55 #ifdef OSSIM_ID_ENABLED
56  ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID: " << OSSIM_ID << endl;
57 #endif
58  }
59 }
61  const ossimGpt& platformPosition,
62  double roll,
63  double pitch,
64  double heading,
65  const ossimDpt& /* principalPoint */, // in millimeters
66  double focalLength, // in millimeters
67  const ossimDpt& pixelSize) // in millimeters
68 {
69  theImageClipRect = imageRect;
73  theRoll = roll;
74  thePitch = pitch;
75  theHeading = heading;
76  theFocalLength = focalLength;
77  thePixelSize = pixelSize;
78  theEcefPlatformPosition = platformPosition;
79  theAdjEcefPlatformPosition = platformPosition;
82  updateModel();
83 
84  try
85  {
86  // Method throws ossimException.
87  computeGsd();
88  }
89  catch (const ossimException& e)
90  {
92  << "ossimApplanixEcefModel Constructor caught Exception:\n"
93  << e.what() << std::endl;
94  }
95 
96  if (traceDebug())
97  {
99  << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
100 #ifdef OSSIM_ID_ENABLED
101  ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID: " << OSSIM_ID << endl;
102 #endif
103  }
104 }
105 
107  :ossimSensorModel(src)
108 {
110 
111  if(src.theLensDistortion.valid())
112  {
114  }
115  else
116  {
118  }
119 }
120 
122 {
123  return new ossimApplanixEcefModel(*this);
124 }
125 
127  ossimEcefRay& image_ray) const
128 {
129 // if(traceDebug())
130 // {
131 // ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... entered" << std::endl;
132 // }
133  ossimDpt f1 ((image_point) - theRefImgPt);
134  f1.x *= thePixelSize.x;
135  f1.y *= -thePixelSize.y;
136  ossimDpt film (f1 - thePrincipalPoint);
137 // if(traceDebug())
138 // {
139 // ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size = " << thePixelSize << std::endl;
140 // ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
141 // ossimNotify(ossimNotifyLevel_DEBUG) << "film pt = " << film << std::endl;
142 // }
143  if (theLensDistortion.valid())
144  {
145  ossimDpt filmOut;
146  theLensDistortion->undistort(film, filmOut);
147  film = filmOut;
148  }
149 
150  ossimColumnVector3d cam_ray_dir (film.x,
151  film.y,
152  -theFocalLength);
153  ossimEcefVector ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
154  ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
155 
157  image_ray.setDirection(ecf_ray_dir);
158 
159 // if(traceDebug())
160 // {
161 // ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... leaving" << std::endl;
162 // }
163 }
164 
166  ossimGpt& gpt) const
167 {
168  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimApplanixEcefModel::lineSampleToWorld:entering..." << std::endl;
169 
170  if(image_point.hasNans())
171  {
172  gpt.makeNan();
173  return;
174  }
175  //***
176  // Extrapolate if image point is outside image:
177  //***
178 // if (!insideImage(image_point))
179 // {
180 // gpt.makeNan();
181 // gpt = extrapolate(image_point);
182 // return;
183 // }
184 
185  //***
186  // Determine imaging ray and invoke elevation source object's services to
187  // intersect ray with terrain model:
188  //***
189  ossimEcefRay ray;
190  imagingRay(image_point, ray);
192 
193  if (traceDebug())
194  {
195  ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
196  ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
197  ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
198  }
199 
200  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
201  return;
202 }
203 
205  const double& heightEllipsoid,
206  ossimGpt& worldPoint) const
207 {
208 // if (!insideImage(image_point))
209 // {
210 // worldPoint.makeNan();
211 // worldPoint = extrapolate(image_point, heightEllipsoid);
212 // }
213 // else
214  {
215  //***
216  // First establish imaging ray from image point:
217  //***
218  ossimEcefRay ray;
219  imagingRay(image_point, ray);
220  ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
221  worldPoint = ossimGpt(Pecf);
222  }
223 }
224 
226  ossimDpt& image_point) const
227 {
228  #if 0
231  {
232  if (!(theBoundGndPolygon.pointWithin(world_point)))
233  {
234 // image_point.makeNan();
235 // image_point = extrapolate(world_point);
236 // return;
237  }
238  }
239  #endif
240  ossimEcefPoint g_ecf(world_point);
241  ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
242  ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
243 
244 
245  double scale = -theFocalLength/camRayDir[2];
246  ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
247 
248  if (theLensDistortion.valid())
249  {
250  ossimDpt filmOut;
251  theLensDistortion->distort(film, filmOut);
252  film = filmOut;
253  }
254 
255  ossimDpt f1(film + thePrincipalPoint);
256  ossimDpt p1(f1.x/thePixelSize.x,
257  -f1.y/thePixelSize.y);
258 
259  ossimDpt p0 (p1.x + theRefImgPt.x,
260  p1.y + theRefImgPt.y);
261 
262  image_point = p0;
263 }
264 
266 {
267  ossimGpt gpt;
268  ossimGpt wgs84Pt;
269  double metersPerDegree = wgs84Pt.metersPerDegree().x;
270  double degreePerMeter = 1.0/metersPerDegree;
271  double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
272  double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
273 
275  double height = gpt.height();
276  gpt.height(height + computeParameterOffset(5));
277  gpt.latd(gpt.latd() + latShift);
278  gpt.lond(gpt.lond() + lonShift);
281 
282  // make a left handed roational matrix;
283  ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
286  theCompositeMatrix = (lsrMatrix.getData()*orientation);
288 
290  // ossim_float64 w = theImageClipRect.width()*2.0;
291  // ossim_float64 h = theImageClipRect.height()*2.0;
292  theExtrapolateImageFlag = false;
293  theExtrapolateGroundFlag = false;
294 
295  lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
296  theBoundGndPolygon[0] = gpt;
297  lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
298  theBoundGndPolygon[1] = gpt;
299  lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
300  theBoundGndPolygon[2] = gpt;
301  lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
302  theBoundGndPolygon[3] = gpt;
303 }
304 
306 {
307 
309 
310  setAdjustableParameter(0, 0.0);
311  setParameterDescription(0, "x_offset");
312  setParameterUnit(0, "pixels");
313 
314  setAdjustableParameter(1, 0.0);
315  setParameterDescription(1, "y_offset");
316  setParameterUnit(1, "pixels");
317 
318  setAdjustableParameter(2, 0.0);
319  setParameterDescription(2, "roll");
320  setParameterUnit(2, "degrees");
321 
322  setAdjustableParameter(3, 0.0);
323  setParameterDescription(3, "pitch");
324  setParameterUnit(3, "degrees");
325 
326  setAdjustableParameter(4, 0.0);
327  setParameterDescription(4, "heading");
328  setParameterUnit(4, "degrees");
329 
330  setAdjustableParameter(5, 0.0);
331  setParameterDescription(5, "altitude");
332  setParameterUnit(5, "meters");
333 
334 
335  setParameterSigma(0, 20.0);
336  setParameterSigma(1, 20.0);
337  setParameterSigma(2, .1);
338  setParameterSigma(3, .1);
339  setParameterSigma(4, .1);
340  setParameterSigma(5, 50);
341 }
342 
344 {
345  thePrincipalPoint = principalPoint;
346 }
347 
349  double pitch,
350  double heading)
351 {
352  theRoll = roll;
353  thePitch = pitch;
354  theHeading = heading;
355 
356  updateModel();
357 }
358 
360 {
361  thePixelSize = pixelSize;
362 }
363 
365 {
366  theImageClipRect = rect;
367  theRefImgPt = rect.midPoint();
368 }
369 
371 {
372  theFocalLength = focalLength;
373 }
374 
376 {
377  theRefGndPt = gpt;
379  updateModel();
380 
381 }
382 
384  const char* prefix) const
385 {
386  ossimSensorModel::saveState(kwl, prefix);
387 
388  kwl.add(prefix, "type", "ossimApplanixEcefModel", true);
389 
390  kwl.add(prefix, "roll", theRoll, true);
391  kwl.add(prefix, "pitch", thePitch, true);
392  kwl.add(prefix, "heading", theHeading, true);
393  kwl.add(prefix, "principal_point", ossimString::toString(thePrincipalPoint.x) + " " + ossimString::toString(thePrincipalPoint.y));
394  kwl.add(prefix, "pixel_size", ossimString::toString(thePixelSize.x) + " " + ossimString::toString(thePixelSize.y));
395  kwl.add(prefix, "focal_length", theFocalLength);
396  kwl.add(prefix, "ecef_platform_position",
400 
402  {
403  ossimString lensPrefix = ossimString(prefix)+"distortion.";
405  lensPrefix.c_str());
406  }
407 
408  return true;
409 }
410 
412  const char* prefix)
413 {
414  if(traceDebug())
415  {
416  std::cout << "ossimApplanixEcefModel::loadState: ......... entered" << std::endl;
417  }
418 
419  theImageClipRect = ossimDrect(0,0,4076,4091);
420  theRefImgPt = ossimDpt(2046.0, 2038.5);
421 
422  ossimSensorModel::loadState(kwl, prefix);
424  {
426  }
427  theEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
428  theAdjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
429  theRoll = 0.0;
430  thePitch = 0.0;
431  theHeading = 0.0;
432  // bool computeGsdFlag = false;
433  const char* roll = kwl.find(prefix, "roll");
434  const char* pitch = kwl.find(prefix, "pitch");
435  const char* heading = kwl.find(prefix, "heading");
436  const char* principal_point = kwl.find(prefix, "principal_point");
437  const char* pixel_size = kwl.find(prefix, "pixel_size");
438  const char* focal_length = kwl.find(prefix, "focal_length");
439  const char* ecef_platform_position = kwl.find(prefix, "ecef_platform_position");
440  const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
441  const char* compute_gsd_flag = kwl.find(prefix, "compute_gsd_flag");
442  const char* eo_file = kwl.find(prefix, "eo_file");
443  const char* camera_file = kwl.find(prefix, "camera_file");
444  const char* eo_id = kwl.find(prefix, "eo_id");
445  bool result = true;
446  if(eo_id)
447  {
448  theImageID = eo_id;
449  }
450  if(eo_file)
451  {
452  ossimApplanixEOFile eoFile;
453  if(eoFile.parseFile(ossimFilename(eo_file)))
454  {
456  if(record.valid())
457  {
458  ossim_int32 rollIdx = eoFile.getFieldIdx("ROLL");
459  ossim_int32 pitchIdx = eoFile.getFieldIdx("PITCH");
460  ossim_int32 headingIdx = eoFile.getFieldIdx("HEADING");
461  ossim_int32 xIdx = eoFile.getFieldIdx("X");
462  ossim_int32 yIdx = eoFile.getFieldIdx("Y");
463  ossim_int32 zIdx = eoFile.getFieldIdx("Z");
464 
465  if((rollIdx >= 0)&&
466  (pitchIdx >= 0)&&
467  (headingIdx >= 0)&&
468  (xIdx >= 0)&&
469  (yIdx >= 0)&&
470  (zIdx >= 0))
471  {
472  theRoll = (*record)[rollIdx].toDouble();
473  thePitch = (*record)[pitchIdx].toDouble();
474  theHeading = (*record)[headingIdx].toDouble();
475  theEcefPlatformPosition = ossimEcefPoint((*record)[xIdx].toDouble(),
476  (*record)[yIdx].toDouble(),
477  (*record)[zIdx].toDouble());
479  }
480  else
481  {
482  return false;
483  }
484  }
485  else
486  {
487  ossimNotify(ossimNotifyLevel_WARN) << "ossimApplanixEcefModel::loadState() Image id " << theImageID << " not found in eo file " << eo_file << std::endl;
488 
489  return false;
490  }
491  }
492  else
493  {
494  return false;
495  }
496  // computeGsdFlag = true;
497  }
498  else
499  {
500  if(roll)
501  {
502  theRoll = ossimString(roll).toDouble();
503  }
504  if(pitch)
505  {
506  thePitch = ossimString(pitch).toDouble();
507  }
508  if(heading)
509  {
510  theHeading = ossimString(heading).toDouble();
511  }
512  if(ecef_platform_position)
513  {
514  std::vector<ossimString> splitString;
515  ossimString tempString(ecef_platform_position);
516  tempString.split(splitString, ossimString(" "));
517  if(splitString.size() > 2)
518  {
519  theEcefPlatformPosition = ossimEcefPoint(splitString[0].toDouble(),
520  splitString[1].toDouble(),
521  splitString[2].toDouble());
522  }
523  }
524  else if(latlonh_platform_position)
525  {
526  std::vector<ossimString> splitString;
527  ossimString tempString(latlonh_platform_position);
528  tempString.split(splitString, ossimString(" "));
529  std::string datumString;
530  double lat=0.0, lon=0.0, h=0.0;
531  if(splitString.size() > 2)
532  {
533  lat = splitString[0].toDouble();
534  lon = splitString[1].toDouble();
535  h = splitString[2].toDouble();
536  }
537 
538  theEcefPlatformPosition = ossimGpt(lat,lon,h);
539  }
540  }
541 
542  if(camera_file)
543  {
544  ossimKeywordlist cameraKwl;
545  ossimKeywordlist lensKwl;
546  cameraKwl.add(camera_file);
547  const char* sensor = cameraKwl.find("sensor");
548  const char* image_size = cameraKwl.find(prefix, "image_size");
549  principal_point = cameraKwl.find("principal_point");
550  focal_length = cameraKwl.find("focal_length");
551  pixel_size = cameraKwl.find(prefix, "pixel_size");
552  focal_length = cameraKwl.find(prefix, "focal_length");
553  const char* distortion_units = cameraKwl.find(prefix, "distortion_units");
555  ossimUnitType unitType = OSSIM_MILLIMETERS;
556 
557  if(distortion_units)
558  {
559  unitType = (ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(distortion_units);
560 
561  if(unitType == OSSIM_UNIT_UNKNOWN)
562  {
563  unitType = OSSIM_MILLIMETERS;
564  }
565  }
566  if(image_size)
567  {
568  std::vector<ossimString> splitString;
569  ossimString tempString(image_size);
570  tempString.split(splitString, ossimString(" "));
571  double w=1, h=1;
572  if(splitString.size() == 2)
573  {
574  w = splitString[0].toDouble();
575  h = splitString[1].toDouble();
576  }
577  theImageClipRect = ossimDrect(0,0,w-1,h-1);
578  theRefImgPt = ossimDpt(w/2.0, h/2.0);
579  theImageSize = ossimDpt(w,h);
580  }
581  if(sensor)
582  {
583  theSensorID = sensor;
584  }
585  if(principal_point)
586  {
587  std::vector<ossimString> splitString;
588  ossimString tempString(principal_point);
589  tempString.split(splitString, ossimString(" "));
590  if(splitString.size() == 2)
591  {
592  thePrincipalPoint.x = splitString[0].toDouble();
593  thePrincipalPoint.y = splitString[1].toDouble();
594  }
595  }
596  if(pixel_size)
597  {
598  std::vector<ossimString> splitString;
599  ossimString tempString(pixel_size);
600  tempString.split(splitString, ossimString(" "));
601  if(splitString.size() == 1)
602  {
603  thePixelSize.x = splitString[0].toDouble();
605  }
606  else if(splitString.size() == 2)
607  {
608  thePixelSize.x = splitString[0].toDouble();
609  thePixelSize.y = splitString[1].toDouble();
610  }
611  }
612  if(focal_length)
613  {
614  theFocalLength = ossimString(focal_length).toDouble();
615  }
616 
617  cameraKwl.trimAllValues();
618 
619 
620  ossimString regExpression = ossimString("^(") + "d[0-9]+)";
621  vector<ossimString> keys;
622  cameraKwl.getSubstringKeyList( keys, regExpression );
623  long numberOfDistortions = (long)keys.size();
624  int offset = (int)ossimString("d").size();
625  ossim_uint32 idx = 0;
626  std::vector<int> numberList(numberOfDistortions);
627  for(idx = 0; idx < numberList.size();++idx)
628  {
629  ossimString numberStr(keys[idx].begin() + offset,
630  keys[idx].end());
631  numberList[idx] = numberStr.toInt();
632  }
633  std::sort(numberList.begin(), numberList.end());
634  double distance=0.0, distortion=0.0;
635 
636  for(idx = 0; idx < numberList.size(); ++idx)
637  {
638  ossimString value = cameraKwl.find(ossimString("d")+ossimString::toString(numberList[idx]));
639 
640  if(!value.empty())
641  {
642  std::istringstream inStr(value.c_str());
643  inStr >> distance;
644  ossim::skipws(inStr);
645  inStr >> distortion;
646 #if 0
647  std::vector<ossimString> splitString;
648  ossimString tempString(value);
649  tempString = tempString.trim();
650  tempString.split(splitString, " ");
651  std::cout << splitString.size() << std::endl;
652  if(splitString.size() >= 2)
653  {
654  distance = splitString[0].toDouble();
655  distortion = splitString[1].toDouble();
656  }
657 #endif
658 
659  tool.setValue(distortion, unitType);
660  lensKwl.add(ossimString("distance") + ossimString::toString(idx),
661  distance,
662  true);
663  lensKwl.add(ossimString("distortion") + ossimString::toString(idx),
664  tool.getMillimeters(),
665  true);
666  }
667  lensKwl.add("convergence_threshold",
668  .00001,
669  true);
670  if(pixel_size)
671  {
672  lensKwl.add("dxdy",
673  ossimString(pixel_size) + " " + ossimString(pixel_size),
674  true);
675  }
676  else
677  {
678  lensKwl.add("dxdy",
679  ".009 .009",
680  true);
681  }
682  }
684  {
685  theLensDistortion->loadState(lensKwl,"");
686  }
687  }
688  else
689  {
690 
691  if(principal_point)
692  {
693  std::vector<ossimString> splitString;
694  ossimString tempString(principal_point);
695  tempString.split(splitString, ossimString(" "));
696  if(splitString.size() == 2)
697  {
698  thePrincipalPoint.x = splitString[0].toDouble();
699  thePrincipalPoint.y = splitString[1].toDouble();
700  }
701  }
702  else
703  {
704  if(traceDebug())
705  {
706  ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
707  result = false;
708  }
709  }
710  if(pixel_size)
711  {
712  std::vector<ossimString> splitString;
713  ossimString tempString(pixel_size);
714  tempString.split(splitString, ossimString(" "));
715  if(splitString.size() == 1)
716  {
717  thePixelSize.x = splitString[0].toDouble();
719  }
720  else if(splitString.size() == 2)
721  {
722  thePixelSize.x = splitString[0].toDouble();
723  thePixelSize.y = splitString[1].toDouble();
724  }
725  }
726  else
727  {
728  if(traceDebug())
729  {
730  ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
731  result = false;
732  }
733  }
734  if(focal_length)
735  {
736  theFocalLength = ossimString(focal_length).toDouble();
737  }
738  else
739  {
740  if(traceDebug())
741  {
742  ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
743  result = false;
744  }
745  }
746 
748  {
749  ossimString lensPrefix = ossimString(prefix)+"distortion.";
750  if(!theLensDistortion->loadState(kwl,
751  lensPrefix.c_str()))
752  {
753  result = false;
754  }
755  }
756  }
758  theRefGndPt.height(0.0);
759 
760  updateModel();
761 
762  if(compute_gsd_flag)
763  {
764  if(ossimString(compute_gsd_flag).toBool())
765  {
766  try
767  {
768  //---
769  // This will set theGSD and theMeanGSD. Method throws
770  // ossimException.
771  //---
772  computeGsd();
773  }
774  catch (const ossimException& e)
775  {
777  << "ossimApplanixEcefModel::loadState Caught Exception:\n"
778  << e.what() << std::endl;
779  }
780  }
781  }
782 
783  if(traceDebug())
784  {
785  ossimNotify(ossimNotifyLevel_DEBUG) << std::setprecision(15) << std::endl;
786  ossimNotify(ossimNotifyLevel_DEBUG) << "roll: " << theRoll << std::endl
787  << "pitch: " << thePitch << std::endl
788  << "heading: " << theHeading << std::endl
789  << "platform: " << theEcefPlatformPosition << std::endl
790  << "latlon Platform: " << ossimGpt(theEcefPlatformPosition) << std::endl
791  << "focal len: " << theFocalLength << std::endl
792  << "principal: " << thePrincipalPoint << std::endl
793  << "Ground: " << ossimGpt(theEcefPlatformPosition) << std::endl;
794  }
795 
796  return result;
797 }
798 
800 {
801  ossimKeywordlist kwl;
802  kwl.addFile(init_file.c_str());
803 
804  return loadState(kwl);
805 }
ossimString theSensorID
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
ossimRefPtr< ossimMeanRadialLensDistortion > theLensDistortion
static NEWMAT::Matrix createRotationYMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
ossimEcefPoint intersectAboveEarthEllipsoid(const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const
ossimUnitType
Represents serializable keyword/value map.
bool addFile(const char *file)
bool intersectRay(const ossimEcefRay &ray, ossimGpt &gpt, double defaultElevValue=0.0)
METHOD: intersectRay()
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
ossimString theImageID
void setRollPitchHeading(double roll, double pitch, double heading)
const ossimDpt & ul() const
Definition: ossimDrect.h:339
void setValue(double value, ossimUnitType unitType=OSSIM_METERS)
double y
Definition: ossimDpt.h:165
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
void makeNan()
Definition: ossimGpt.h:130
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double x() const
NEWMAT::Matrix theCompositeMatrixInverse
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
double magnitude() const
virtual ossim_int32 getEntryNumber(const char *entry_string, bool case_insensitive=true) const
void setFocalLength(double focalLength)
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
void setOrigin(const ossimEcefPoint &orig)
Definition: ossimEcefRay.h:81
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
NEWMAT::Matrix theCompositeMatrix
uses file path to init model
virtual void imagingRay(const ossimDpt &image_point, ossimEcefRay &image_ray) const
void setPixelSize(const ossimDpt &pixelSize)
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimEcefPoint theAdjEcefPlatformPosition
RTTI_DEF1(ossimApplanixEcefModel, "ossimApplanixEcefModel", ossimSensorModel)
void setPrincipalPoint(ossimDpt principalPoint)
const NEWMAT::Matrix & lsrToEcefRotMatrix() const
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
void setPlatformPosition(const ossimGpt &gpt)
OSSIM_DLL std::istream & skipws(std::istream &in)
Definition: ossimCommon.cpp:38
virtual const char * what() const
Returns the error message.
std::string::size_type size() const
Definition: ossimString.h:405
static NEWMAT::Matrix createRotationXMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
ossimEcefPoint theEcefPlatformPosition
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimPolygon theBoundGndPolygon
double height() const
Definition: ossimGpt.h:107
double toDouble() const
virtual bool setupOptimizer(const ossimString &init_file)
ground to image faster (you don&#39;t need DEM)
bool hasNans() const
will sequence through the polygon and check to see if any values are NAN
void setParameterUnit(ossim_uint32 idx, ossimUnitType unit)
virtual void undistort(const ossimDpt &input, ossimDpt &output) const
virtual ossimObject * dup() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
bool pointWithin(const ossimDpt &point) const
METHOD: pointWithin(ossimDpt) Returns TRUE if point is inside polygon.
bool hasNans() const
Definition: ossimDpt.h:67
const ossimRefPtr< ossimApplanixEORecord > getRecordGivenId(const ossimString &id) const
Given an ID it will search and find an EO record that matches the ID.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void worldToLineSample(const ossimGpt &world_point, ossimDpt &image_point) const
std::vector< ossimString > getSubstringKeyList(const ossimString &regularExpression) const
void lineSampleToWorld(const ossimDpt &image_point, ossimGpt &gpt) const
ossim_uint32 getNumberOfVertices() const
ossimDrect theImageClipRect
static NEWMAT::Matrix createIdentity()
double y() const
ossimDpt midPoint() const
Definition: ossimDrect.h:817
virtual void setAdjustableParameter(ossim_uint32 idx, double value, bool notify=false)
ossim_int32 getFieldIdx(const ossimString &searchKey) const
Is a case insensitive parse of the column names for the orientation record.
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
void resizeAdjustableParameterArray(ossim_uint32 numberOfParameters)
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool empty() const
Definition: ossimString.h:411
const ossimColumnVector3d & data() const
ossimDpt metersPerDegree() const
Definition: ossimGpt.cpp:498
const ossimDpt & ll() const
Definition: ossimDrect.h:342
void setImageRect(const ossimDrect &rect)
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
void resize(ossim_uint32 newSize)
void setDirection(const ossimEcefVector &d)
Definition: ossimEcefRay.h:82
bool parseFile(const ossimFilename &file)
Will parse the entire Exterior orientation file and then index any record ID&#39;s found.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
float distance(double lat1, double lon1, double lat2, double lon2, int units)
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
const ossimDpt & lr() const
Definition: ossimDrect.h:341
virtual void distort(const ossimDpt &input, ossimDpt &output) const
double z() const
void setParameterSigma(ossim_uint32 idx, double value, bool notify=false)
int toInt() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_float64 theMeanGSD
int ossim_int32
ossimKeywordlist & trimAllValues(const ossimString &valueToTrim=ossimString(" \\))
virtual void lineSampleHeightToWorld(const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const