void ossimPpjFrameSensor::updateModel() { if (traceDebug()) { ossimNotify(ossimNotifyLevel_DEBUG) << "ossimPpjFrameSensor::updateModel DEBUG:" << std::endl; } double deltap = computeParameterOffset(PARAM_ADJ_LAT_OFFSET)/ m_cameraPositionEllipsoid.metersPerDegree().y; double deltal = computeParameterOffset(PARAM_ADJ_LON_OFFSET)/ m_cameraPositionEllipsoid.metersPerDegree().x; m_adjustedCameraPosition = ossimGpt(m_cameraPositionEllipsoid.latd() + deltap, m_cameraPositionEllipsoid.lond() + deltal, m_cameraPositionEllipsoid.height() + computeParameterOffset(PARAM_ADJ_ALTITUDE_OFFSET)); // TODO Need to add correction matrix to accommodate orientation offsets. It // shouldn't be done in ECF frame. // double r = ossim::degreesToRadians(m_roll + computeParameterOffset(PARAM_ADJ_ROLL_OFFSET)); // double p = ossim::degreesToRadians(m_pitch + computeParameterOffset(PARAM_ADJ_PITCH_OFFSET) ); // double y = ossim::degreesToRadians(m_yaw + computeParameterOffset(PARAM_ADJ_YAW_OFFSET)); // NEWMAT::Matrix rollM = ossimMatrix3x3::create(1, 0, 0, // 0, cos(r), sin(r), // 0, -sin(r), cos(r)); // NEWMAT::Matrix pitchM = ossimMatrix3x3::create(cos(p), 0, -sin(p), // 0, 1, 0, // sin(p), 0, cos(p)); // NEWMAT::Matrix yawM = ossimMatrix3x3::create(cos(y), sin(y), 0, // -sin(y), cos(y), 0, // 0,0,1); m_adjustedFocalLength = m_focalLength + computeParameterOffset(PARAM_ADJ_FOCAL_LENGTH_OFFSET); try { computeGsd(); } catch(...) { } if (traceDebug()) { ossimNotify(ossimNotifyLevel_DEBUG) << "ossimPpjFrameSensor::updateModel complete..." << std::endl; } /* ossimGpt gpt; lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt); theBoundGndPolygon[0] = gpt; lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt); theBoundGndPolygon[1] = gpt; lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt); theBoundGndPolygon[2] = gpt; lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt); theBoundGndPolygon[3] = gpt; */ }
rspfRefPtr<rspfProperty> rspfSFIMFusion::getProperty(const rspfString& name)const { if(name == "low_pass_kernel_width") { rspfNumericProperty* prop = new rspfNumericProperty(name, rspfString::toString(computeParameterOffset(LOW_PASS_WIDTH_OFFSET)), getParameterCenter(LOW_PASS_WIDTH_OFFSET)-getParameterSigma(LOW_PASS_WIDTH_OFFSET), getParameterCenter(LOW_PASS_WIDTH_OFFSET)+getParameterSigma(LOW_PASS_WIDTH_OFFSET)); prop->setCacheRefreshBit(); return prop; } else if(name == "high_pass_gain") { rspfNumericProperty* prop = new rspfNumericProperty(name, rspfString::toString(computeParameterOffset(HIGH_PASS_GAIN_OFFSET)), getParameterCenter(HIGH_PASS_GAIN_OFFSET)-getParameterSigma(HIGH_PASS_GAIN_OFFSET), getParameterCenter(HIGH_PASS_GAIN_OFFSET)+getParameterSigma(HIGH_PASS_GAIN_OFFSET)); prop->setCacheRefreshBit(); return prop; } else if(name=="auto_adjust_scales") { rspfBooleanProperty* prop = new rspfBooleanProperty(name,theAutoAdjustScales); prop->setCacheRefreshBit(); return prop; } return rspfFusionCombiner::getProperty(name); }
void ossimRpcModel::updateModel() { theIntrackOffset = computeParameterOffset(INTRACK_OFFSET); theCrtrackOffset = computeParameterOffset(CRTRACK_OFFSET); theIntrackScale = computeParameterOffset(INTRACK_SCALE); theCrtrackScale = computeParameterOffset(CRTRACK_SCALE); double mapRotation = computeParameterOffset(MAP_ROTATION); theCosMapRot = ossim::cosd(mapRotation); theSinMapRot = ossim::sind(mapRotation); }
void ossimRpcProjection::adjustableParametersChanged() { theIntrackOffset = computeParameterOffset(INTRACK_OFFSET); theCrtrackOffset = computeParameterOffset(CRTRACK_OFFSET); theIntrackScale = computeParameterOffset(INTRACK_SCALE); theCrtrackScale = computeParameterOffset(CRTRACK_SCALE); double mapRotation = computeParameterOffset(MAP_ROTATION); theCosMapRot = ossim::cosd(mapRotation); theSinMapRot = ossim::sind(mapRotation); }
void rspfLandSatModel::updateModel() { theIntrackOffset = computeParameterOffset(INTRACK_OFFSET); theCrtrackOffset = computeParameterOffset(CRTRACK_OFFSET); theLineGsdCorr = computeParameterOffset(LINE_GSD_CORR); theSampGsdCorr = computeParameterOffset(SAMP_GSD_CORR); theRollOffset = computeParameterOffset(ROLL_OFFSET); theYawOffset = computeParameterOffset(YAW_OFFSET); theYawRate = computeParameterOffset(YAW_RATE); theMapRotation = computeParameterOffset(MAP_ROTATION); if (theProjectionType == UTM_ORBIT) { theMapAzimCos = rspf::cosd(-theMapAzimAngle + theMapRotation); theMapAzimSin = rspf::sind(-theMapAzimAngle + theMapRotation); } else if (theProjectionType == TM_ORBIT) { theMapAzimCos = rspf::cosd(-theMapAzimAngle + theMapRotation); theMapAzimSin = rspf::sind(-theMapAzimAngle + theMapRotation); } else { theMapAzimCos = rspf::cosd(theMapAzimAngle + theMapRotation); theMapAzimSin = rspf::sind(theMapAzimAngle + theMapRotation); } double cos = rspf::cosd(theRollOffset); double sin = rspf::sind(theRollOffset); theRollRotMat = rspfMatrix3x3::create( 1.0, 0.0, 0.0, 0.0, cos,-sin, 0.0, sin, cos); }
void rspfSFIMFusion::setFilters() { theLowPassFilter->setGaussStd(theLowPassKernelWidth); theHighPassMatrix = NEWMAT::Matrix(theHighPassKernelWidth, theHighPassKernelWidth); theHighPassMatrix = 0; theHighPassMatrix[theHighPassKernelWidth>>1][theHighPassKernelWidth>>1] = 1; // adjust the gain for the high pass filter // NEWMAT::Matrix high = theHighPassMatrix; rspf_float64 kernelW2 = theHighPassKernelWidth*theHighPassKernelWidth; double gain = computeParameterOffset(HIGH_PASS_GAIN_OFFSET)*(kernelW2); double multiplier = gain/(kernelW2); high = -multiplier; rspf_int32 cx = theHighPassKernelWidth>>1; rspf_int32 cy = theHighPassKernelWidth>>1; if(gain > FLT_EPSILON) { high[cy][cx] = multiplier* ( (kernelW2-1)+kernelW2/gain); } else { high = 0.0; high[cy][cx] = 1.0; } theHighPassFilter->setConvolution(high); }
void ossimCsmSensorModel::updateModel() { if(!m_model) return; int nParams = getNumberOfAdjustableParameters(); int idx = 0; for(idx = 0; idx < nParams; ++idx) { m_model->setCurrentParameterValue(idx, computeParameterOffset(idx)); } }
void rspfBuckeyeSensor::imagingRay(const rspfDpt& image_point, rspfEcefRay& image_ray) const { rspfDpt f1 ((image_point) - theRefImgPt); f1.x *= m_pixelSize.x; f1.y *= -m_pixelSize.y; rspfDpt film (f1 - m_principalPoint); if (m_lensDistortion.valid()) { rspfDpt filmOut; m_lensDistortion->undistort(film, filmOut); film = filmOut; } rspfColumnVector3d cam_ray_dir (film.x, film.y, -(m_focalLength+computeParameterOffset(6))); rspfEcefVector ecf_ray_dir (m_compositeMatrix*cam_ray_dir); ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude()); image_ray.setOrigin(m_ecefPlatformPosition); image_ray.setDirection(ecf_ray_dir); }
void ossimSpectraboticsRedEdgeModel::updateModel() { ossimGpt gpt; ossimGpt wgs84Pt; double metersPerDegree = wgs84Pt.metersPerDegree().x; double degreePerMeter = 1.0/metersPerDegree; double latShift = computeParameterOffset(1)*theMeanGSD*degreePerMeter; double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter; gpt = m_ecefPlatformPosition; double height = gpt.height(); gpt.height(height + computeParameterOffset(5)); gpt.latd(gpt.latd() + latShift); gpt.lond(gpt.lond() + lonShift); m_adjEcefPlatformPosition = gpt; ossimLsrSpace lsrSpace(m_adjEcefPlatformPosition); NEWMAT::Matrix heading = ossimMatrix4x4::createRotationZMatrix(m_heading+computeParameterOffset(4), OSSIM_RIGHT_HANDED); NEWMAT::Matrix roll = ossimMatrix4x4::createRotationYMatrix(m_roll+computeParameterOffset(2), OSSIM_RIGHT_HANDED); NEWMAT::Matrix pitch = ossimMatrix4x4::createRotationXMatrix(m_pitch+computeParameterOffset(3), OSSIM_LEFT_HANDED); ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix()); NEWMAT::Matrix orientation = heading*pitch*roll;//roll*pitch*heading; m_compositeMatrix = (lsrMatrix.getData()*orientation); m_compositeMatrixInverse = m_compositeMatrix.i(); theBoundGndPolygon.resize(4); // ossim_float64 w = theImageClipRect.width()*2.0; // ossim_float64 h = theImageClipRect.height()*2.0; theExtrapolateImageFlag = false; theExtrapolateGroundFlag = false; lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt); theBoundGndPolygon[0] = gpt; lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt); theBoundGndPolygon[1] = gpt; lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt); theBoundGndPolygon[2] = gpt; lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt); theBoundGndPolygon[3] = gpt; }
void ossimBuckeyeSensor::updateModel() { if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: entering..." << std::endl; ossimGpt gpt; ossimGpt wgs84Pt; double metersPerDegree = wgs84Pt.metersPerDegree().x; double degreePerMeter = 1.0/metersPerDegree; double latShift = -computeParameterOffset(1)*degreePerMeter; double lonShift = computeParameterOffset(0)*degreePerMeter; gpt = theEcefPlatformPosition; double height = gpt.height(); gpt.height(height + computeParameterOffset(5)); gpt.latd(gpt.latd() + latShift); gpt.lond(gpt.lond() + lonShift); theAdjEcefPlatformPosition = gpt; ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4)); // make a left handed roational matrix; ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix()); NEWMAT::Matrix orientation = (ossimMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)* ossimMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), OSSIM_LEFT_HANDED)); theCompositeMatrix = (lsrMatrix.getData()*orientation); theCompositeMatrixInverse = theCompositeMatrix.i(); theBoundGndPolygon.resize(4); // ossim_float64 w = theImageClipRect.width()*2.0; // ossim_float64 h = theImageClipRect.height()*2.0; theExtrapolateImageFlag = false; theExtrapolateGroundFlag = false; lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt); theBoundGndPolygon[0] = gpt; lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt); theBoundGndPolygon[1] = gpt; lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt); theBoundGndPolygon[2] = gpt; lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt); theBoundGndPolygon[3] = gpt; if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: returning..." << std::endl; }
void rspfBuckeyeSensor::updateModel() { rspfGpt gpt; rspfGpt wgs84Pt; double metersPerDegree = wgs84Pt.metersPerDegree().y; double degreePerMeter = 1.0/metersPerDegree; double latShift = computeParameterOffset(1)*degreePerMeter; double lonShift = computeParameterOffset(0)*degreePerMeter; gpt = m_platformPosition; double height = gpt.height(); gpt.height(height + computeParameterOffset(5)); gpt.latd(gpt.latd() + latShift); gpt.lond(gpt.lond() + lonShift); m_ecefPlatformPosition = gpt; rspfLsrSpace lsrSpace(m_ecefPlatformPosition, m_yaw+computeParameterOffset(4)); NEWMAT::Matrix platformLsrMatrix = lsrSpace.lsrToEcefRotMatrix(); NEWMAT::Matrix orientationMatrix = ( rspfMatrix3x3::createRotationXMatrix(m_pitch+computeParameterOffset(3), RSPF_LEFT_HANDED) *rspfMatrix3x3::createRotationYMatrix(m_roll+computeParameterOffset(2), RSPF_LEFT_HANDED) ); m_compositeMatrix = platformLsrMatrix*orientationMatrix; m_compositeMatrixInverse = m_compositeMatrix.i(); theBoundGndPolygon.resize(4); rspf_float64 w = theImageClipRect.width()*2.0; rspf_float64 h = theImageClipRect.height()*2.0; lineSampleToWorld(theImageClipRect.ul()+rspfDpt(-w, -h), gpt); theBoundGndPolygon[0] = gpt; lineSampleToWorld(theImageClipRect.ur()+rspfDpt(w, -h), gpt); theBoundGndPolygon[1] = gpt; lineSampleToWorld(theImageClipRect.lr()+rspfDpt(w, h), gpt); theBoundGndPolygon[2] = gpt; lineSampleToWorld(theImageClipRect.ll()+rspfDpt(-w, h), gpt); theBoundGndPolygon[3] = gpt; lineSampleToWorld(theRefImgPt, theRefGndPt); }
void rspfApplanixEcefModel::updateModel() { rspfGpt gpt; rspfGpt wgs84Pt; double metersPerDegree = wgs84Pt.metersPerDegree().x; double degreePerMeter = 1.0/metersPerDegree; double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter; double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter; gpt = theEcefPlatformPosition; double height = gpt.height(); gpt.height(height + computeParameterOffset(5)); gpt.latd(gpt.latd() + latShift); gpt.lond(gpt.lond() + lonShift); theAdjEcefPlatformPosition = gpt; rspfLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4)); // make a left handed roational matrix; rspfMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix()); NEWMAT::Matrix orientation = (rspfMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), RSPF_LEFT_HANDED)* rspfMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), RSPF_LEFT_HANDED)); theCompositeMatrix = (lsrMatrix.getData()*orientation); theCompositeMatrixInverse = theCompositeMatrix.i(); theBoundGndPolygon.resize(4); // rspf_float64 w = theImageClipRect.width()*2.0; // rspf_float64 h = theImageClipRect.height()*2.0; theExtrapolateImageFlag = false; theExtrapolateGroundFlag = false; lineSampleToWorld(theImageClipRect.ul(),gpt);//+rspfDpt(-w, -h), gpt); theBoundGndPolygon[0] = gpt; lineSampleToWorld(theImageClipRect.ur(),gpt);//+rspfDpt(w, -h), gpt); theBoundGndPolygon[1] = gpt; lineSampleToWorld(theImageClipRect.lr(),gpt);//+rspfDpt(w, h), gpt); theBoundGndPolygon[2] = gpt; lineSampleToWorld(theImageClipRect.ll(),gpt);//+rspfDpt(-w, h), gpt); theBoundGndPolygon[3] = gpt; }
void ossimApplanixUtmModel::updateModel() { ossimGpt wgs84Pt; double metersPerDegree = wgs84Pt.metersPerDegree().x; double degreePerMeter = 1.0/metersPerDegree; double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter; double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter; ossimGpt gpt = thePlatformPosition; // gpt.height(0.0); double height = gpt.height(); gpt.height(height + computeParameterOffset(5)); gpt.latd(gpt.latd() + latShift); gpt.lond(gpt.lond() + lonShift); theAdjEcefPlatformPosition = gpt; ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition); // ORIENT TO A UTM AXIS // NEWMAT::ColumnVector v(3); v[0] = 0.0; v[1] = 0.0; v[2] = 1.0; NEWMAT::ColumnVector v2 = lsrSpace.lsrToEcefRotMatrix()*v; ossimEcefVector zVector(v2[0], v2[1], v2[2]); zVector.normalize(); // now lets create a UTM axis by creating a derivative at the center // by shift over a few pixels and subtracting // ossimUtmProjection utmProj; utmProj.setZone(theUtmZone); utmProj.setZone(theUtmHemisphere); utmProj.setMetersPerPixel(ossimDpt(1.0,1.0)); ossimDpt midPt = utmProj.forward(theAdjEcefPlatformPosition); ossimDpt rPt = midPt + ossimDpt(10, 0.0); ossimDpt uPt = midPt + ossimDpt(0.0, 10.0); ossimGpt wMidPt = utmProj.inverse(midPt); ossimGpt wRPt = utmProj.inverse(rPt); ossimGpt wUPt = utmProj.inverse(uPt); ossimEcefPoint ecefMidPt = wMidPt; ossimEcefPoint ecefRPt = wRPt; ossimEcefPoint ecefUPt = wUPt; ossimEcefVector east = ecefRPt-ecefMidPt; ossimEcefVector north = ecefUPt-ecefMidPt; east.normalize(); north.normalize(); // now use the lsr space constructors to construct an orthogonal set of axes // lsrSpace = ossimLsrSpace(thePlatformPosition, 0, north, east.cross(north)); // lsrSpace = ossimLsrSpace(thePlatformPosition); // DONE ORIENT TO UTM AXIS NEWMAT::Matrix platformLsrMatrix = lsrSpace.lsrToEcefRotMatrix(); NEWMAT::Matrix orientationMatrix = (ossimMatrix3x3::createRotationXMatrix(theOmega+computeParameterOffset(2), OSSIM_LEFT_HANDED)* ossimMatrix3x3::createRotationYMatrix(thePhi+computeParameterOffset(3), OSSIM_LEFT_HANDED)* ossimMatrix3x3::createRotationZMatrix(theKappa+computeParameterOffset(4), OSSIM_LEFT_HANDED)); theCompositeMatrix = platformLsrMatrix*orientationMatrix; theCompositeMatrixInverse = theCompositeMatrix.i(); // theAdjEcefPlatformPosition = theEcefPlatformPosition; theBoundGndPolygon.resize(4); ossim_float64 w = theImageClipRect.width()*2.0; ossim_float64 h = theImageClipRect.height()*2.0; lineSampleToWorld(theImageClipRect.ul()+ossimDpt(-w, -h), gpt); theBoundGndPolygon[0] = gpt; lineSampleToWorld(theImageClipRect.ur()+ossimDpt(w, -h), gpt); theBoundGndPolygon[1] = gpt; lineSampleToWorld(theImageClipRect.lr()+ossimDpt(w, h), gpt); theBoundGndPolygon[2] = gpt; lineSampleToWorld(theImageClipRect.ll()+ossimDpt(-w, h), gpt); theBoundGndPolygon[3] = gpt; }
void rspfSFIMFusion::adjustableParametersChanged() { // std::cout << "Parameter offset = " << computeParameterOffset(2) << std::endl; theLowPassKernelWidth = (rspf_uint32)(rspf::round<int>(computeParameterOffset(LOW_PASS_WIDTH_OFFSET))); }