コード例 #1
0
void ossimSpectraboticsRedEdgeModel::imagingRay(const ossimDpt& image_point,
                                    ossimEcefRay&   image_ray) const
{
    if(traceDebug())
    {
       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSpectraboticsRedEdgeModel::imagingRay: ..... entered" << std::endl;
    }
    ossimDpt film (image_point.x-m_calibratedCenter.x,
                   m_calibratedCenter.y - image_point.y); //- theRefImgPt);
//    ossimDpt film (image_point-m_calibratedCenter); //- theRefImgPt);
    if(m_lensDistortion.valid())
    {
      ossimDpt tempFilm(film.x/m_norm, film.y/m_norm);
      ossimDpt filmOut;
      m_lensDistortion->undistort(tempFilm, filmOut);
      film.x = filmOut.x*m_norm;
      film.y = filmOut.y*m_norm;
    }
    film.x *= m_pixelSize.x; // pixel size on the film
    film.y *= m_pixelSize.y; // pixel size on the film
    ossimColumnVector3d cam_ray_dir (film.x,
                                     film.y,
                                     -m_focalLength);
    ossimEcefVector     ecf_ray_dir (m_compositeMatrix*cam_ray_dir);
    ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());

    image_ray.setOrigin(m_adjEcefPlatformPosition);
    image_ray.setDirection(ecf_ray_dir);
}
コード例 #2
0
ファイル: ossimBuckeyeSensor.cpp プロジェクト: Dukeke/ossim
void ossimBuckeyeSensor::imagingRay(const ossimDpt& image_point,
	ossimEcefRay&   image_ray) const
{
	if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimBuckeyeSensor::imagingRay: ..... entered" << std::endl;

	ossimDpt f1 ((image_point) - theRefImgPt);
	f1.x *= thePixelSize.x;
	f1.y *= -thePixelSize.y;
	ossimDpt film (f1 - thePrincipalPoint);

	if(traceDebug())
	{
		ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
		ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
		ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
	}

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

	ossimColumnVector3d cam_ray_dir (film.x,
		film.y,
		-theFocalLength);
	ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
	ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());

	image_ray.setOrigin(theAdjEcefPlatformPosition);
	image_ray.setDirection(ecf_ray_dir);

	if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimBuckeyeSensor::imagingRay: ..... leaving" << std::endl;
}
コード例 #3
0
void ossimPpjFrameSensor::imagingRay(const ossimDpt& imagePoint,
                                     ossimEcefRay& imageRay) const
{
   // Form camera frame LOS vector
   ossimColumnVector3d camLOS(imagePoint.x - m_principalPoint.x,
                              imagePoint.y - m_principalPoint.y,
                              m_adjustedFocalLength);   

   // Rotate to ECF
   ossimColumnVector3d ecfLOS = m_ecef2CamInverse * camLOS;
   imageRay.setOrigin(m_adjustedCameraPosition);
   ossimEcefVector ecfRayDir(ecfLOS);
   imageRay.setDirection(ecfRayDir);

   if (traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "ossimPpjFrameSensor::imagingRay DEBUG:\n"
         << "  camLOS = " << camLOS << "\n"
         << "  m_adjustedPlatformPosition = " << m_adjustedCameraPosition << "\n"
         << "  imageRay = " << imageRay << "\n"
         << std::endl;
   }

}
コード例 #4
0
void ossimCsmSensorModel::imagingRay(const ossimDpt& image_point,
                                     ossimEcefRay&   image_ray) const
{
   if(m_model)
   {
      double locus[6] = {0.0, 0.0, 0.0,
      0.0, 0.0, 0.0};
      double AP = 0.0;
      m_model->imageToRemoteImagingLocus(image_point.y, image_point.x, locus, AP);
      ossimEcefVector v(locus[3], locus[4], locus[5]);	
      image_ray.setOrigin(ossimEcefPoint(locus[0], locus[1], locus[2]));
      image_ray.setDirection(v);
   } 
}
コード例 #5
0
void ossimAlphaSensorHSI::imagingRay(const ossimDpt& imagePoint,
                                     ossimEcefRay& imageRay) const
{
   ossim_float64 line = imagePoint.y;

   // Form camera frame LOS vector
   ossim_float64 scanAngle = getScanAngle(line);
   ossimColumnVector3d camLOS(imagePoint.x - theImageSize.x/2,
                              m_adjustedFocalLength * tan(scanAngle),
                              m_adjustedFocalLength);

   // Compute camera position & orientation matrix
   ossimEcefPoint platPos;
   NEWMAT::Matrix cam2EcfRot;
   getPositionOrientation(line, platPos, cam2EcfRot);

   // Rotate camera vector to ECF
   ossimColumnVector3d ecfLOS = cam2EcfRot * camLOS.unit();

   // Construct ECF image ray
   imageRay.setOrigin(platPos);
   ossimEcefVector ecfRayDir(ecfLOS);
   imageRay.setDirection(ecfRayDir);

   if (traceDebug())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "ossimAlphaSensorHSI::imagingRay DEBUG:\n"
         << "  imagePoint = " << imagePoint << "\n"
         << "  imageRay = " << imageRay << "\n"
         << "  camLOS     = " << camLOS << "\n"
         << "  platPos    = " << platPos << "\n"
         << std::endl;
   }

}