void ossimSpectraboticsRedEdgeModel::worldToLineSample(const ossimGpt& world_point,
                                           ossimDpt&       image_point) const
{
   #if 0
   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
      (!theBoundGndPolygon.hasNans()))
   {
      if (!(theBoundGndPolygon.pointWithin(world_point)))
      {
//         image_point.makeNan();
//          image_point = extrapolate(world_point);
//         return;
      }         
   }
   #endif
   ossimEcefPoint g_ecf(world_point);
   ossimEcefVector ecfRayDir(g_ecf - m_adjEcefPlatformPosition);
   ossimColumnVector3d camRayDir (m_compositeMatrixInverse*ecfRayDir.data());
   
      
    double scale = -m_focalLength/camRayDir[2];
    ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
    film.x /= m_pixelSize.x; // get into pixel coordinates
    film.y /= m_pixelSize.y;


    // now distort to find the true image coordinate location
    if (m_lensDistortion.valid())
    {
      ossimDpt filmOut;
      film.x /= m_norm; // normalize radial
      film.y /= m_norm;
       m_lensDistortion->distort(film, filmOut);
      film = filmOut;//+m_lensDistortion->getCenter();
      film.x *= m_norm;
      film.y *= m_norm; 
    }

    // invert Y to get back to left handed image space
    ossimDpt f1(film.x+m_calibratedCenter.x, m_calibratedCenter.y-film.y);
    
    image_point = f1;
}
Ejemplo n.º 2
0
void ossimBuckeyeSensor::worldToLineSample(const ossimGpt& world_point,
	ossimDpt&       image_point) const
{
	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::worldToLineSample: entering..." << std::endl;
	if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
		(!theBoundGndPolygon.hasNans()))
	{
		if (!(theBoundGndPolygon.pointWithin(world_point)))
		{
			image_point.makeNan();
			return;
		}         
	}
	ossimEcefPoint g_ecf(world_point);
	ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
	ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());


	double scale = -theFocalLength/camRayDir[2];
	ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);

	if (theLensDistortion.valid())
	{
		ossimDpt filmOut;
		theLensDistortion->distort(film, filmOut);
		film = filmOut;
	}

	ossimDpt f1(film + thePrincipalPoint);
	ossimDpt p1(f1.x/thePixelSize.x,
		-f1.y/thePixelSize.y);

	ossimDpt p0 (p1.x + theRefImgPt.x,
		p1.y + theRefImgPt.y);

	image_point = p0;
	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::worldToLineSample: returning..." << std::endl;
}
Ejemplo n.º 3
0
void rspfBuckeyeSensor::worldToLineSample(const rspfGpt& world_point,
                                          rspfDpt&       image_point) const
{
#if 0
   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
      (!theBoundGndPolygon.hasNans()))
   {
      if (!(theBoundGndPolygon.pointWithin(world_point)))
      {
         image_point.makeNan();
         return;
      }         
   }
#endif
   rspfEcefPoint g_ecf(world_point);
   rspfEcefVector ecfRayDir(g_ecf - m_ecefPlatformPosition);
   rspfColumnVector3d camRayDir (m_compositeMatrixInverse*ecfRayDir.data());
   
   
   double scale = -m_focalLength/camRayDir[2];
   rspfDpt film (scale*camRayDir[0], scale*camRayDir[1]);
   
   if (m_lensDistortion.valid())
   {
      rspfDpt filmOut;
      m_lensDistortion->distort(film, filmOut);
      film = filmOut;
   }
   
   rspfDpt f1(film + m_principalPoint);
   rspfDpt p1(f1.x/m_pixelSize.x,
               -f1.y/m_pixelSize.y);
   
   rspfDpt p0 (p1.x + theRefImgPt.x,
                p1.y + theRefImgPt.y);
   
   image_point = p0;
}
Ejemplo n.º 4
0
void ossimApplanixUtmModel::worldToLineSample(const ossimGpt& world_point,
                                           ossimDpt&       image_point) const
{
   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
      (!theBoundGndPolygon.hasNans()))
   {
      if (!(theBoundGndPolygon.pointWithin(world_point)))
      {
         image_point.makeNan();
//          image_point = extrapolate(world_point);
         return;
      }         
   }
   ossimEcefPoint g_ecf(world_point);
   ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
   ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
   
      
   double scale = -theFocalLength/camRayDir[2];
   ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
      
   if (theLensDistortion.valid())
   {
      ossimDpt filmOut;
      theLensDistortion->distort(film, filmOut);
      film = filmOut;
    }
   
     ossimDpt f1(film + thePrincipalPoint);
    ossimDpt p1(f1.x/thePixelSize.x,
                -f1.y/thePixelSize.y);

    ossimDpt p0 (p1.x + theRefImgPt.x,
                 p1.y + theRefImgPt.y);
    
    image_point = p0;
}