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; } }
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; }
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; }
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; }
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; }
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; } }