Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

all: Drop RMAX software

This software was used only for one project, the mapping of Marscape
via the RMAX helicopter. Neither the RMAX hardware or Marscape exist
anymore. We still have the dataset file ... but if anyone was
interested, it could be processed with our generic PinholeSession.
  • Loading branch information...
commit a4a73580a024fb5afde59de5b60d51fa3a868223 1 parent db65ce1
Zack Moratto authored
View
50 config.options.columbia
@@ -1,50 +0,0 @@
-#! /bin/sh
-
-### IRG Specific Convenience Paths
-
-IRG_ARCH_RAW="`uname -m`_`uname -s`_gcc`gcc -dumpversion | cut -f-2 -d .`"
-IRG_ARCH=`echo $IRG_ARCH_RAW | awk '{ print tolower( $0 ) }'`
-IRGPKG_DIR=/irg/packages/$IRG_ARCH
-
-ENABLE_DEBUG=no
-ENABLE_OPTIMIZE=yes
-ENABLE_CUSTOM_ARCH_NAME=$IRG_ARCH
-
-PREFIX=$HOME/local
-
-VTO_PKGS=/u/vto/projects/packages
-NASA_PKGS=/nasa/pd
-VTO_NOBACKUP=/nobackup1a/vto/packages/$IRG_ARCH
-
-VW_DIR=/u/vto/projects/VisionWorkbench/build/$IRG_ARCH
-OUR_QT_DIR=$VTO_NOBACKUP/qt-x11-opensource-src-4.4.1
-PATH="$OUR_QT_DIR/bin:$PATH"
-
-HAVE_PKG_VW_CORE=$VW_DIR
-HAVE_PKG_VW_MATH=$VW_DIR
-HAVE_PKG_VW_IMAGE=$VW_DIR
-HAVE_PKG_VW_FILEIO=$VW_DIR
-HAVE_PKG_VW_STEREO=$VW_DIR
-HAVE_PKG_VW_CAMERA=$VW_DIR
-HAVE_PKG_VW_CARTOGRAPHY=$VW_DIR
-HAVE_PKG_VW_INTEREST_POINT=$VW_DIR
-
-HAVE_PKG_BOOST=$NASA_PKGS/boost/1.34.1
-HAVE_PKG_OPENSCENEGRAPH=$VTO_PKGS/src/OpenSceneGraph-2.2.0/
-HAVE_PKG_QT_INCLUDE=$OUR_QT_DIR
-HAVE_PKG_QT_CORE=$OUR_QT_DIR
-HAVE_PKG_QT_GUI=$OUR_QT_DIR
-HAVE_PKG_QT_SQL=$OUR_QT_DIR
-HAVE_PKG_ISIS=/u/vto/projects/isis3/isis/
-
-HAVE_PKG_GDAL=$VTO_PKGS/$IRG_ARCH/gdal-1.5.0
-HAVE_PKG_SPICE=$VTO_PKGS/src/cspice
-HAVE_PKG_GEOS=$VTO_PKGS/$IRG_ARCH/geos-3.0.0
-HAVE_PKG_XERCESC=$VTO_PKGS/$IRG_ARCH/xerces-c-src_2_8_0
-
-PKG_QWT_LDFLAGS="-L/u/vto/projects/packages/ia64_linux_gcc4.1/qwt-5.1.1/lib -lqwt"
-PKG_GSL_LDFLAGS="-L/u/vto/projects/packages/ia64_linux_gcc4.1/gsl-1.11/lib -lgsl -lgslcblas"
-PKG_SUPERLU_LDFLAGS="-L/u/vto/projects/packages/src/SuperLU_3.0 -lsuperlu_3.0"
-
-# Lapack still needs to be found the old-fashioned way
-PKG_PATHS="$VTO_PKGS/$IRG_ARCH/VisionWorkbench-LAPACK-1.0.0"
View
59 config.options.irg
@@ -1,59 +0,0 @@
-#! /bin/sh
-
-### IRG Specific Convenience Paths
-
-IRG_ARCH_RAW="`uname -m`_`uname -s`_gcc`gcc -dumpversion | cut -f-2 -d .`"
-IRG_ARCH=`echo $IRG_ARCH_RAW | awk '{ print tolower( $0 ) }'`
-IRGPKG_DIR=/irg/packages/$IRG_ARCH
-
-### Configure Options
-#
-# These options allow you modify the basic behavior of the build environment.
-ENABLE_DEBUG=no
-ENABLE_OPTIMIZE=yes
-
-# This is where stereo will be installed.
-PREFIX=$HOME/local
-
-# Set this to where you installed vw
-VW_INSTALL=$PREFIX
-
-# need this for qmake
-QT_PATH=$IRGPKG_DIR/qt-4/bin
-
-# Use this if it should run on every irg machine
-HAVE_PKG_BOOST=$IRGPKG_DIR/boost
-HAVE_PKG_GEOS=$IRGPKG_DIR/geos
-HAVE_PKG_GSL=$IRGPKG_DIR/gsl
-HAVE_PKG_ISIS=$IRGPKG_DIR/isis3/isis
-HAVE_PKG_OPENSCENEGRAPH=$IRGPKG_DIR/OpenSceneGraph
-HAVE_PKG_QT=$IRGPKG_DIR/qt-4
-HAVE_PKG_QT_CORE=$IRGPKG_DIR/qt-4
-HAVE_PKG_QT_GUI=$IRGPKG_DIR/qt-4
-HAVE_PKG_QT_INCLUDE=$IRGPKG_DIR/qt-4
-HAVE_PKG_QT_SQL=$IRGPKG_DIR/qt-4
-HAVE_PKG_QWT=$IRGPKG_DIR/qwt
-HAVE_PKG_SPICE=$IRGPKG_DIR/cspice
-HAVE_PKG_SUPERLU=$IRGPKG_DIR/superlu
-HAVE_PKG_VW_CORE=$VW_INSTALL
-HAVE_PKG_VW_MATH=$VW_INSTALL
-HAVE_PKG_VW_IMAGE=$VW_INSTALL
-HAVE_PKG_VW_FILEIO=$VW_INSTALL
-HAVE_PKG_VW_CAMERA=$VW_INSTALL
-HAVE_PKG_VW_CARTOGRAPHY=$VW_INSTALL
-HAVE_PKG_VW_INTEREST_POINT=$VW_INSTALL
-HAVE_PKG_VW_STEREO=$VW_INSTALL
-
-### Apps I want
-
-ENABLE_APP_STEREO=yes
-ENABLE_APP_ORTHOPROJECT=yes
-ENABLE_APP_BUNDLEADJUST=yes
-ENABLE_APP_ORBITVIZ=yes
-ENABLE_APP_DISPARITYDEBUG=yes
-ENABLE_APP_POINT2MESH=yes
-ENABLE_APP_POINT2DEM=yes
-ENABLE_APP_RMAX2CAHVOR=no
-ENABLE_APP_RMAXADJUST=no
-ENABLE_APP_BUNDLEVIS=yes
-ENABLE_APP_ISISADJUST=yes
View
5 configure.ac
@@ -420,8 +420,6 @@ AX_APP(POINT2MESH, [src/asp/Tools], yes, [OPENSCENEGRAPH CORE])
AX_APP(POINT2LAS, [src/asp/Tools], no, [BOOST LASZIP LIBLAS CORE])
AX_APP(DEM_GEOID, [src/asp/Tools], no, [GEOID CORE])
AX_APP(RESULTS, [src/asp/Tools], no, [CORE ISISIO])
-AX_APP(RMAX2CAHVOR, [src/asp/Tools], no, [SESSIONS])
-AX_APP(RMAXADJUST, [src/asp/Tools], no, [VW_BUNDLEADJUSTMENT SESSIONS])
AX_APP(RPCMAPPROJECT, [src/asp/Tools], yes, [CORE SESSIONS GDAL])
AX_APP(STEREO, [src/asp/Tools], yes, [SESSIONS])
@@ -456,8 +454,6 @@ AM_CONDITIONAL(MAKE_APP_POINT2MESH, [test "$MAKE_APP_POINT2MESH" = "yes"])
AM_CONDITIONAL(MAKE_APP_POINT2LAS, [test "$MAKE_APP_POINT2LAS" = "yes"])
AM_CONDITIONAL(MAKE_APP_DEM_GEOID, [test "$MAKE_APP_DEM_GEOID" = "yes"])
AM_CONDITIONAL(MAKE_APP_RESULTS, [test "$MAKE_APP_RESULTS" = "yes"])
-AM_CONDITIONAL(MAKE_APP_RMAX2CAHVOR, [test "$MAKE_APP_RMAX2CAHVOR" = "yes"])
-AM_CONDITIONAL(MAKE_APP_RMAXADJUST, [test "$MAKE_APP_RMAXADJUST" = "yes"])
AM_CONDITIONAL(MAKE_APP_RPCMAPPROJECT, [test "$MAKE_APP_RPCMAPPROJECT" = "yes"])
AM_CONDITIONAL(MAKE_APP_STEREO, [test "$MAKE_APP_STEREO" = "yes"])
AM_CONDITIONAL(MAKE_APP_STEREOGUI, [test "$MAKE_APP_STEREOGUI" = "yes"])
@@ -503,7 +499,6 @@ AC_CONFIG_FILES([ \
src/asp/Sessions/Makefile \
src/asp/Sessions/ISIS/Makefile \
src/asp/Sessions/Pinhole/Makefile \
- src/asp/Sessions/RMAX/Makefile \
src/asp/Sessions/DG/Makefile \
src/asp/Sessions/RPC/Makefile \
src/asp/Sessions/tests/Makefile \
View
1  src/asp/Sessions.h
@@ -26,7 +26,6 @@
#include <asp/Sessions/ISIS/StereoSessionIsis.h>
#endif
-#include <asp/Sessions/RMAX/StereoSessionRmax.h>
#include <asp/Sessions/Pinhole/StereoSessionPinhole.h>
#include <asp/Sessions/DG/StereoSessionDG.h>
#include <asp/Sessions/RPC/StereoSessionRPC.h>
View
6 src/asp/Sessions/Makefile.am
@@ -25,8 +25,8 @@ if MAKE_MODULE_SESSIONS
include_HEADERS = StereoSession.h
libaspSessions_la_SOURCES = StereoSession.cc \
- Pinhole/StereoSessionPinhole.cc RMAX/RMAX.cc \
- RMAX/StereoSessionRmax.cc DG/StereoSessionDG.cc \
+ Pinhole/StereoSessionPinhole.cc \
+ DG/StereoSessionDG.cc \
DG/XMLBase.cc DG/XML.cc RPC/StereoSessionRPC.cc \
RPC/RPCStereoModel.cc RPC/RPCModel.cc \
RPC/RPCMapTransform.cc
@@ -35,7 +35,7 @@ libaspSessions_la_LIBADD = @MODULE_SESSIONS_LIBS@
lib_LTLIBRARIES = libaspSessions.la
-SUBDIRS = . Pinhole RMAX DG tests
+SUBDIRS = . Pinhole DG tests
if HAVE_PKG_ISIS
SUBDIRS += ISIS
View
34 src/asp/Sessions/RMAX/Makefile.am
@@ -1,34 +0,0 @@
-# __BEGIN_LICENSE__
-# Copyright (c) 2009-2012, United States Government as represented by the
-# Administrator of the National Aeronautics and Space Administration. All
-# rights reserved.
-#
-# The NGT platform is licensed under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance with the
-# License. You may obtain a copy of the License at
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# __END_LICENSE__
-
-
-#########################################################################
-# sources
-#########################################################################
-
-include_HEADERS = RMAX.h StereoSessionRmax.h
-
-#########################################################################
-# general
-#########################################################################
-
-AM_CPPFLAGS = @ASP_CPPFLAGS@
-AM_LDFLAGS = @ASP_LDFLAGS@ -version-info @LIBTOOL_VERSION@
-
-includedir = $(prefix)/include/asp/Sessions/RMAX
-
-include $(top_srcdir)/config/rules.mak
View
138 src/asp/Sessions/RMAX/RMAX.cc
@@ -1,138 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (c) 2009-2012, United States Government as represented by the
-// Administrator of the National Aeronautics and Space Administration. All
-// rights reserved.
-//
-// The NGT platform is licensed under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance with the
-// License. You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// __END_LICENSE__
-
-
-/// \file RMAX.cc
-///
-
-#include <asp/Sessions/RMAX/RMAX.h>
-
-#include <vw/Core.h>
-#include <vw/FileIO/DiskImageResourcePNG.h>
-
-#define RMAX_GLOBAL_EASTING (582680)
-#define RMAX_GLOBAL_NORTHING (4141480)
-
-using namespace vw;
-using namespace vw::camera;
-
-void read_image_info( std::string const& filename, ImageInfo& info ) {
- vw_out(DebugMessage,"asp") << "Reading image info from " << filename << std::endl;;
- DiskImageResourcePNG png( filename );
- info.filename = filename;
- for( unsigned i=0; i<png.num_comments(); ++i ) {
- std::string const& key = png.get_comment(i).key;
- std::istringstream value( png.get_comment(i).text );
- if( key == "easting" ) value >> info.easting;
- else if( key == "northing" ) value >> info.northing;
- else if( key == "heading" ) value >> info.heading;
- else if( key == "pitch" ) value >> info.pitch;
- else if( key == "roll" ) value >> info.roll;
- else if( key == "height" ) value >> info.height;
- // Note: The key name says it's in radians, but it's clearly actually in degrees!
- else if( key == "tilt angle in radians" ) value >> info.tilt;
- else if( key == "which camera" ) {
- switch( png.get_comment(i).text[0] ) {
- case 'l': info.camera = ImageInfo::LEFT; break;
- case 'r': info.camera = ImageInfo::RIGHT; break;
- case 'c': info.camera = ImageInfo::COLOR; break;
- }
- }
- //else std::cout << "Unkown key: " << key << std::endl;
- }
-}
-
-camera::CAHVORModel rmax_image_camera_model( ImageInfo const& info,
- Vector3 const& position_correction,
- Vector3 const& pose_correction) {
- // Bundle Adjustment
- double r = info.roll + pose_correction[0];
- double p = info.pitch + pose_correction[1];
- double y = info.heading + pose_correction[2];
-
- camera::CAHVORModel base;
- if( info.camera == ImageInfo::RIGHT ) {
- base.C = Vector3( 0.495334, -0.003158, -0.004600 );
- base.A = Vector3( 0.006871, -0.000863, 0.999976 );
- base.H = Vector3( 1095.653400, 8.513659, 321.246801 );
- base.V = Vector3( -7.076027, 1093.871625, 251.343361 );
- base.O = Vector3( 0.004817, 0.000619, 0.999988 );
- base.R = Vector3( 0.000000, -0.235833, 0.180509 );
- }
- else {
- base.C = Vector3( -0.495334, 0.003158, 0.004600 );
- base.A = Vector3( -0.000000, 0.000000, 1.000000 );
- base.H = Vector3( 1095.186165, -0.000000, 324.865834 );
- base.V = Vector3( 0.000000, 1095.678491, 250.561559 );
- base.O = Vector3( 0.000012, -0.002199, 0.999998 );
- base.R = Vector3( 0.000000, -0.230915, 0.128078 );
- }
- double cr=cos(r*M_PI/180), sr=sin(r*M_PI/180);
- double cp=cos(p*M_PI/180), sp=sin(p*M_PI/180);
- double cy=cos(y*M_PI/180), sy=sin(y*M_PI/180);
- Matrix3x3 roll, pitch, yaw, flip;
- roll(0,0)=cr; roll(0,1)=0; roll(0,2)=-sr;
- roll(1,0)=0; roll(1,1)=1; roll(1,2)=0;
- roll(2,0)=sr; roll(2,1)=0; roll(2,2)=cr;
- pitch(0,0)=1; pitch(0,1)=0; pitch(0,2)=0;
- // XXX Pitch might have the wrong sign here....
- pitch(1,0)=0; pitch(1,1)=cp; pitch(1,2)=-sp;
- pitch(2,0)=0; pitch(2,1)=sp; pitch(2,2)=cp;
- yaw(0,0)=cy; yaw(0,1)=-sy; yaw(0,2)=0;
- yaw(1,0)=sy; yaw(1,1)=cy; yaw(1,2)=0;
- yaw(2,0)=0; yaw(2,1)=0; yaw(2,2)=1;
- flip(0,0)=1; flip(0,1)=0; flip(0,2)=0;
- flip(1,0)=0; flip(1,1)=-1; flip(1,2)=0;
- flip(2,0)=0; flip(2,1)=0; flip(2,2)=-1;
- Matrix3x3 ori = flip*yaw*pitch*roll;
- Vector3 pos( info.easting, info.northing, info.height );
-
- // Bundle Adjustment
- pos += position_correction;
-
- camera::CAHVORModel cahvor;
- cahvor.C = pos - Vector3(RMAX_GLOBAL_EASTING,RMAX_GLOBAL_NORTHING,0) + ori*base.C;
- cahvor.A = ori*base.A;
- cahvor.H = ori*base.H;
- cahvor.V = ori*base.V;
- cahvor.O = ori*base.O;
- cahvor.R = base.R;
- return cahvor;
-}
-
-vw::camera::CAHVORModel rmax_image_camera_model( ImageInfo const& info ) {
- return rmax_image_camera_model(info, Vector3(), Vector3());
-}
-
-vw::camera::CAHVORModel rmax_image_camera_model( std::string const& filename ) {
- ImageInfo info;
- read_image_info( filename, info );
- return rmax_image_camera_model( info );
-}
-
-bool may_overlap( ImageInfo const& i1, ImageInfo const& i2 ) {
- const double diameter = 6; // approximate diameter in meters
- return hypot( i2.easting-i1.easting, i2.northing-i1.northing ) < diameter;
-}
-
-bool may_overlap( std::string const& file1, std::string const& file2 ) {
- ImageInfo i1, i2;
- read_image_info(file1,i1);
- read_image_info(file2,i2);
- return may_overlap(i1,i2);
-}
-
View
54 src/asp/Sessions/RMAX/RMAX.h
@@ -1,54 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (c) 2009-2012, United States Government as represented by the
-// Administrator of the National Aeronautics and Space Administration. All
-// rights reserved.
-//
-// The NGT platform is licensed under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance with the
-// License. You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// __END_LICENSE__
-
-
-/// \file RMAX.h
-///
-
-#ifndef RMAX_H__
-#define RMAX_H__
-
-
-#include <string>
-#include <vw/Camera/CAHVORModel.h>
-
-struct ImageInfo {
- std::string filename;
- double easting, northing;
- double heading, pitch, roll;
- double height, tilt;
- enum {
- LEFT=1, RIGHT=2, COLOR=3
- } camera;
-};
-
-void read_image_info( std::string const& filename, ImageInfo& info );
-
-vw::camera::CAHVORModel rmax_image_camera_model( ImageInfo const& info,
- vw::Vector3 const& position_correction,
- vw::Vector3 const& pose_correction);
-
-vw::camera::CAHVORModel rmax_image_camera_model( ImageInfo const& info );
-
-vw::camera::CAHVORModel rmax_image_camera_model( std::string const& filename );
-
-bool may_overlap( ImageInfo const& i1, ImageInfo const& i2 );
-bool may_overlap( std::string const& file1, std::string const& file2 );
-
-// -----
-
-#endif // __RMAX_H__
View
38 src/asp/Sessions/RMAX/StereoSessionRmax.cc
@@ -1,38 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (c) 2009-2012, United States Government as represented by the
-// Administrator of the National Aeronautics and Space Administration. All
-// rights reserved.
-//
-// The NGT platform is licensed under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance with the
-// License. You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// __END_LICENSE__
-
-
-/// \file StereoSessionRMAX.cc
-///
-
-#include <boost/shared_ptr.hpp>
-
-#include <asp/Sessions/RMAX/StereoSessionRmax.h>
-#include <asp/Sessions/RMAX/RMAX.h>
-
-using namespace vw;
-using namespace vw::camera;
-
-boost::shared_ptr<vw::camera::CameraModel>
-asp::StereoSessionRmax::camera_model(std::string const& image_file,
- std::string const& /*camera_file*/) {
- ImageInfo info;
- read_image_info( image_file, info );
- CAHVORModel* cahvor = new CAHVORModel;
- *cahvor = rmax_image_camera_model(info);
- return boost::shared_ptr<camera::CameraModel>(cahvor);
-}
View
41 src/asp/Sessions/RMAX/StereoSessionRmax.h
@@ -1,41 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (c) 2009-2012, United States Government as represented by the
-// Administrator of the National Aeronautics and Space Administration. All
-// rights reserved.
-//
-// The NGT platform is licensed under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance with the
-// License. You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// __END_LICENSE__
-
-
-/// \file StereoSessionRMAX.h
-///
-
-#ifndef __RMAX_STEREO_SESSION_H__
-#define __RMAX_STEREO_SESSION_H__
-
-#include <asp/Sessions/Pinhole/StereoSessionPinhole.h>
-
-namespace asp {
- class StereoSessionRmax : public StereoSession {
- public:
- virtual ~StereoSessionRmax() {}
-
- // Correct lens distortion and epipolar-rectify the images
- virtual boost::shared_ptr<vw::camera::CameraModel>
- camera_model(std::string const& image_file,
- std::string const& camera_file = "");
-
- static StereoSession* construct() { return new StereoSessionRmax; }
- };
-} // end namespace asp
-
-#endif // __RMAX_STEREO_SESSION_H__
View
12 src/asp/Tools/Makefile.am
@@ -84,18 +84,6 @@ if MAKE_APP_DEM_GEOID
dem_geoid_LDADD = $(APP_DEM_GEOID_LIBS)
endif
-if MAKE_APP_RMAX2CAHVOR
- bin_PROGRAMS += rmax2cahvor
- rmax2cahvor_SOURCES = rmax2cahvor.cc
- rmax2cahvor_LDADD = $(APP_RMAX2CAHVOR_LIBS)
-endif
-
-if MAKE_APP_RMAXADJUST
- bin_PROGRAMS += rmax_adjust
- rmax_adjust_SOURCES = rmax_adjust.cc
- rmax_adjust_LDADD = $(APP_RMAXADJUST_LIBS)
-endif
-
if MAKE_APP_ISISADJUST
bin_PROGRAMS += isis_adjust
isis_adjust_SOURCES = isis_adjust.cc isis_adjust.h
View
2  src/asp/Tools/orthoproject.cc
@@ -185,13 +185,11 @@ int main(int argc, char* argv[]) {
// Orthorpoject a camera image not a DEM.
// Note: This process is not multi-threaded because it uses ISIS which is not thread safe.
-
Options opt;
try {
handle_arguments( argc, argv, opt );
// Create a fresh stereo session and query it for the camera models.
- asp::StereoSession::register_session_type( "rmax", &asp::StereoSessionRmax::construct);
#if defined(ASP_HAVE_PKG_ISISIO) && ASP_HAVE_PKG_ISISIO == 1
asp::StereoSession::register_session_type( "isis", &asp::StereoSessionIsis::construct);
#endif
View
101 src/asp/Tools/rmax2cahvor.cc
@@ -1,101 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (c) 2009-2012, United States Government as represented by the
-// Administrator of the National Aeronautics and Space Administration. All
-// rights reserved.
-//
-// The NGT platform is licensed under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance with the
-// License. You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// __END_LICENSE__
-
-
-/// \file rmax2cahvor.cc
-///
-
-
-/************************************************************************
- * File: rmaxcahvor.cc
- * Date: May 2007
- * By: Todd Templeton
- * For: NASA Ames Research Center, Intelligent Mechanisms Group
- * Function: Extract CAHVOR camera model from RMAX images
- *
- ************************************************************************/
-#include <stdlib.h>
-#include <iostream>
-
-#include <boost/algorithm/string.hpp>
-#include <boost/program_options.hpp>
-namespace po = boost::program_options;
-
-#include <vw/Camera/CAHVORModel.h>
-using namespace vw;
-using namespace vw::camera;
-
-#include <asp/Sessions/RMAX/RMAX.h>
-
-int main(int argc, char* argv[]) {
- std::string image_file;
- std::string adjustment_filename;
-
- po::options_description general_options("Options");
- general_options.add_options()
- ("adjustment-file,a", po::value<std::string>(&adjustment_filename), "Apply adjustments from file.\n")
- ("help,h", "Display this help message.")
- ("verbose", "Verbose output");
-
- po::options_description hidden_options("");
- hidden_options.add_options()
- ("input-file", po::value<std::string>(&image_file));
-
- po::options_description options("Allowed Options");
- options.add(general_options).add(hidden_options);
-
- po::positional_options_description p;
- p.add("input-file", -1);
-
- po::variables_map vm;
- po::store( po::command_line_parser( argc, argv ).options(options).positional(p).run(), vm );
- po::notify( vm );
-
- std::ostringstream usage;
- usage << "Usage: " << argv[0] << " [options] <rmax image filenames>..." << std::endl << std::endl;
- usage << general_options << std::endl;
-
- if( vm.count("help") ) {
- std::cout << usage.str() << std::endl;
- return 1;
- } else if ( vm.count("input-file") < 1 ) {
- std::cout << "No input files!\n" << usage.str() << std::endl;
- return 1;
- }
-
-
- std::string output;
- if( vm.count("adjustment-file") ) {
- ImageInfo info;
- read_image_info( image_file, info );
-
- std::ifstream f(adjustment_filename.c_str());
- Vector3 position_adjustment;
- Vector3 pose_adjustment;
-
- f >> position_adjustment[0] >> position_adjustment[1] >> position_adjustment[2];
- f >> pose_adjustment[0] >> pose_adjustment[1] >> pose_adjustment[2];
- std::cout << position_adjustment << " " << pose_adjustment<< "\n";
- CAHVORModel cahvor = rmax_image_camera_model(info, position_adjustment, pose_adjustment);
- output = asp::prefix_from_filename(image_file) + ".rmax_adjust.cahvor";
- cahvor.write(output);
- } else {
- CAHVORModel cahvor = rmax_image_camera_model(argv[1]);
- output = prefix_from_filename(image_file) + ".cahvor";
- cahvor.write(output);
- }
-}
View
367 src/asp/Tools/rmax_adjust.cc
@@ -1,367 +0,0 @@
-// __BEGIN_LICENSE__
-// Copyright (c) 2009-2012, United States Government as represented by the
-// Administrator of the National Aeronautics and Space Administration. All
-// rights reserved.
-//
-// The NGT platform is licensed under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance with the
-// License. You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// __END_LICENSE__
-
-
-/// \file rmax_adjust.cc
-///
-
-#include <boost/algorithm/string.hpp>
-#include <boost/program_options.hpp>
-#include "boost/filesystem/operations.hpp"
-#include "boost/filesystem/fstream.hpp"
-namespace po = boost::program_options;
-namespace fs = boost::filesystem;
-
-#include <vw/Core.h>
-#include <vw/Math.h>
-#include <vw/Camera/CAHVORModel.h>
-#include <vw/BundleAdjustment.h>
-
-using namespace vw;
-using namespace vw::camera;
-using namespace vw::ba;
-
-#include <stdlib.h>
-#include <iostream>
-
-#include <asp/Sessions/RMAX/RMAX.h>
-#include <asp/Core/Macros.h>
-#include <asp/Core/Common.h>
-
-// This sifts out from a vector of strings, a listing of GCPs. This
-// should be useful for those programs who accept their data in a mass
-// input vector.
-std::vector<std::string>
-sort_out_gcps( std::vector<std::string>& image_files ) {
- std::vector<std::string> gcp_files;
- std::vector<std::string>::iterator it = image_files.begin();
- while ( it != image_files.end() ) {
- if ( boost::iends_with(*it, ".gcp") ){
- gcp_files.push_back( *it );
- it = image_files.erase( it );
- } else
- it++;
- }
-
- return gcp_files;
-}
-
-class HelicopterBundleAdjustmentModel : public ba::ModelBase<HelicopterBundleAdjustmentModel, 6, 3> {
-
- typedef Vector<double,6> camera_vector_t;
- typedef Vector<double,3> point_vector_t;
-
- std::vector<ImageInfo> m_image_infos;
-
- boost::shared_ptr<ControlNetwork> m_network;
-
- std::vector<camera_vector_t> a, a_target;
- std::vector<point_vector_t> b, b_target;
- int m_num_pixel_observations;
-
-public:
-
- HelicopterBundleAdjustmentModel(std::vector<ImageInfo> const& image_infos,
- boost::shared_ptr<ControlNetwork> network) :
- m_image_infos(image_infos), m_network(network),
- a(image_infos.size()), a_target(image_infos.size()),
- b(network->size()), b_target(network->size()),
- m_num_pixel_observations(0) {
-
- // Compute the number of observations from the bundle.
- std::vector<point_vector_t>::iterator bit = b.begin(),
- btit = b_target.begin();
- BOOST_FOREACH( ba::ControlPoint const& cp, *m_network ) {
- m_num_pixel_observations += cp.size();
- *bit++ = *btit++ = cp.position();
- }
- }
-
- // Return a reference to the camera and point parameters.
- camera_vector_t const& A_parameters(int j) const { return a[j]; }
- point_vector_t const& B_parameters(int i) const { return b[i]; }
- void set_A_parameters(int j, camera_vector_t const& a_j) {
- a[j] = a_j;
- }
- void set_B_parameters(int i, point_vector_t const& b_i) {
- b[i] = b_i;
- }
-
- // Return the initial parameters
- camera_vector_t const& A_target(int j) const { return a_target[j]; }
- point_vector_t const& B_target(int i) const { return b_target[i]; }
-
- // Return general sizes
- size_t num_cameras() const { return a.size(); }
- size_t num_points() const { return b.size(); }
- size_t num_pixel_observations() const { return m_num_pixel_observations; }
-
- // Return the covariance of the camera parameters for camera j.
- inline Matrix<double,camera_params_n,camera_params_n>
- A_inverse_covariance ( size_t /*j*/ ) {
- return math::identity_matrix<camera_params_n>();
- }
-
- // Return the covariance of the point parameters for point i.
- inline Matrix<double,point_params_n,point_params_n>
- B_inverse_covariance ( size_t /*i*/ ) {
- return math::identity_matrix<point_params_n>();
- }
-
- void write_adjustment(int j, std::string const& filename) {
- std::ofstream ostr(filename.c_str());
- ostr << a[j][0] << " " << a[j][1] << " " << a[j][2] << "\n";
- ostr << a[j][3] << " " << a[j][4] << " " << a[j][5] << "\n";
- }
-
- void write_adjusted_camera(int j, std::string const& filename) {
- camera_vector_t a_j = a[j];
- camera::CAHVORModel cam =
- rmax_image_camera_model(m_image_infos[j],
- subvector(a_j,0,3),
- subvector(a_j,3,3) );
- cam.write(filename);
- }
-
- void write_adjusted_cameras_append(std::string const& filename) {
- std::ofstream ostr(filename.c_str(),std::ios::app);
- ostr.precision(15);
- for (size_t j=0; j < a.size();++j){
- camera_vector_t a_j = a[j];
- camera::CAHVORModel cam =
- rmax_image_camera_model( m_image_infos[j],
- subvector(a_j,0,3),
- subvector(a_j,3,3) );
- ostr << j << "\t" << cam.C(0) << "\t" << cam.C(1)
- << "\t" << cam.C(2) << " 1 0 0 0\n";
- }
- }
-
- std::vector< boost::shared_ptr< CameraModel > >
- adjusted_cameras() const {
- std::vector< boost::shared_ptr<CameraModel> > cameras( a.size() );
- for ( size_t j = 0; j < a.size(); j++ ) {
- CAHVORModel cam =
- rmax_image_camera_model( m_image_infos[j],
- subvector(a[j],0,3),
- subvector(a[j],3,3) );
- cameras[j].reset( new CAHVORModel( cam ) );
- }
- return cameras;
- }
-
- // Given the 'a' vector (camera model parameters) for the j'th
- // image, and the 'b' vector (3D point location) for the i'th
- // point, return the location of b_i on imager j in pixel
- // coordinates.
- Vector2 operator() ( size_t /*i*/, size_t j,
- camera_vector_t const& a_j,
- point_vector_t const& b_i ) const {
- return
- rmax_image_camera_model(m_image_infos[j],
- subvector(a_j, 0, 3),
- subvector(a_j, 3, 3) ).point_to_pixel( b_i );
- }
-
- // Errors on the image plane
- std::string image_unit() const { return "px"; }
- inline double image_compare( vw::Vector2 const& meas,
- vw::Vector2 const& obj ) {
- return norm_2(meas-obj);
- }
- inline double position_compare( camera_vector_t const& meas,
- camera_vector_t const& obj ) {
- return norm_2(subvector(meas,0,3)-subvector(obj,0,3));
- }
- inline double pose_compare( camera_vector_t const& meas,
- camera_vector_t const& obj ) {
- return 0;
- }
- inline double gcp_compare( point_vector_t const& meas,
- point_vector_t const& obj ) {
- return norm_2(meas-obj);
- }
-
- // Give access to the control network
- boost::shared_ptr<ControlNetwork> control_network() {
- return m_network;
- }
-};
-
-struct Options : public asp::BaseOptions {
- Options() : lambda(-1), cnet( new ControlNetwork("") ) {}
- std::vector<std::string> image_files, gcp_files;
- std::string cnet_file;
- double lambda;
- boost::shared_ptr<ControlNetwork> cnet;
- int min_matches, max_iterations, report_level;
-
- bool save_bundlevis;
-};
-
-void handle_arguments( int argc, char *argv[], Options& opt ) {
- po::options_description general_options("Options");
- general_options.add_options()
- ("cnet,c", po::value(&opt.cnet_file), "Load a control network from a file")
- ("lambda,l", po::value(&opt.lambda), "Set the initial value of the LM parameter lambda")
- ("min-matches", po::value(&opt.min_matches)->default_value(5), "Set the mininmum number of matches between images that will be considered.")
- ("max-iterations", po::value(&opt.max_iterations)->default_value(25), "Set the maximum number of iterations.")
- ("save-iteration-data,s", po::bool_switch(&opt.save_bundlevis)->default_value(false), "Saves all camera information between iterations to iterCameraParam.txt, it also saves point locations for all iterations in iterPointsParam.txt. Warning: This is slow as pixel observations need to be calculated on each step.")
- ("report-level,r",po::value(&opt.report_level)->default_value(10),"Changes the detail of the Bundle Adjustment Report");
- general_options.add( asp::BaseOptionsDescription(opt) );
-
- po::options_description hidden_options("");
- hidden_options.add_options()
- ("input-files", po::value(&opt.image_files));
-
- po::options_description options("Allowed Options");
- options.add(general_options).add(hidden_options);
-
- po::positional_options_description p;
- p.add("input-files", -1);
-
- std::string usage("[options] <rmax image filenames> ...");
- po::variables_map vm =
- asp::check_command_line( argc, argv, opt, general_options, general_options,
- hidden_options, p, usage );
-
- if ( opt.image_files.size() < 2)
- vw_throw( ArgumentErr() << "Must specify at least two input files!\n\n" );
- opt.gcp_files = sort_out_gcps( opt.image_files );
-}
-
-void do_ba( Options& opt ) {
- // Read in the camera model and RMAX image info for the input
- // images.
- std::vector<std::string> camera_files(opt.image_files.size());
- std::vector<ImageInfo> image_infos(opt.image_files.size());
- std::vector<boost::shared_ptr<CameraModel> > camera_models(opt.image_files.size());
- for (size_t i = 0; i < opt.image_files.size(); ++i) {
- read_image_info( opt.image_files[i], image_infos[i] );
- CAHVORModel *cahvor = new CAHVORModel;
- *cahvor = rmax_image_camera_model(image_infos[i]);
- camera_models[i] = boost::shared_ptr<CameraModel>(cahvor);
- }
-
- { // Subtract off the first camera's position
- Vector3 origin = camera_models[0]->camera_center(Vector2());
- for ( size_t i = 0; i < camera_models.size(); i++ ) {
- CAHVORModel* cam =
- dynamic_cast<CAHVORModel*>( camera_models[i].get() );
- cam->C -= origin;
- image_infos[i].easting -= origin[0];
- image_infos[i].northing -= origin[1];
- image_infos[i].height -= origin[2];
- }
- }
-
- if ( !opt.cnet_file.empty() ) {
- // Loading a Control Network
-
- vw_out() << "Loading control network from file: " << opt.cnet_file << "\n";
- opt.cnet->read_binary(opt.cnet_file);
-
- } else {
- // Building a Control Network
- build_control_network( *opt.cnet, camera_models,
- opt.image_files, opt.min_matches );
- add_ground_control_points( *opt.cnet, opt.image_files,
- opt.gcp_files.begin(), opt.gcp_files.end() );
-
- opt.cnet->write_binary("rmax_adjust");
- }
-
- HelicopterBundleAdjustmentModel ba_model(image_infos, opt.cnet);
- AdjustRobustSparse<HelicopterBundleAdjustmentModel, L2Error> bundle_adjuster(ba_model, L2Error(),
- true, false );
-
- if ( opt.lambda > 0 )
- bundle_adjuster.set_lambda(opt.lambda);
-
- //Clearing the monitoring text files to be used for saving camera params
- if (opt.save_bundlevis){
- std::ofstream ostr("iterCameraParam.txt",std::ios::out);
- ostr << "";
- ostr.close();
- ostr.open("iterPointsParam.txt",std::ios::out);
- ostr << "";
- ostr.close();
-
- //Now I'm going to save the initial starting position of the cameras
- ba_model.write_adjusted_cameras_append("iterCameraParam.txt");
- std::ofstream ostr_points("iterPointsParam.txt",std::ios::app);
- for (size_t i = 0; i < ba_model.num_points(); ++i){
- Vector<double,3> const& current_point = ba_model.B_parameters(i);
- ostr_points << i << "\t" << current_point(0) << "\t" << current_point(1) << "\t" << current_point(2) << "\n";
- }
- }
-
- // Reporter
- BundleAdjustReport<AdjustRobustSparse<HelicopterBundleAdjustmentModel, L2Error> >
- reporter( "RMAX Adjust", ba_model, bundle_adjuster, opt.report_level );
-
- // Performing Bundle Adjustment
- double abs_tol = 1e10, rel_tol=1e10, overall_delta;
- while(true) {
- reporter.loop_tie_in();
-
- overall_delta = bundle_adjuster.update(abs_tol, rel_tol);
-
- // Writing Current Camera Parameters to file for later reading in MATLAB
- if (opt.save_bundlevis) {
-
- //Writing this iterations camera data
- ba_model.write_adjusted_cameras_append("iterCameraParam.txt");
-
- //Writing this iterations point data, also saving the pixel param data
- std::ofstream ostr_points("iterPointsParam.txt",std::ios::app);
- ostr_points.precision(15);
- for (size_t i = 0; i < ba_model.num_points(); ++i){
- Vector<double,3> const& current_point = ba_model.B_parameters(i);
- ostr_points << i << "\t" << current_point(0) << "\t" << current_point(1) << "\t" << current_point(2) << "\n";
- }
- }
-
- if ( bundle_adjuster.iterations() > opt.max_iterations ) {
- reporter() << "Terminated on Max Iterations\n";
- break;
- }
- if ( abs_tol < 0.2 ) {
- reporter() << "Terminated on Absolute Tolerance\n";
- break;
- }
- if ( rel_tol < 1e-5 ) {
- reporter() << "Terminated on Relative Tolerance\n";
- break;
- }
- }
- reporter.end_tie_in();
-
- for (size_t i=0; i < ba_model.num_cameras(); ++i)
- ba_model.write_adjustment(i, asp::prefix_from_filename(opt.image_files[i])+".rmax_adjust");
-}
-
-int main(int argc, char* argv[]) {
-
- Options opt;
- try {
- handle_arguments( argc, argv, opt );
- do_ba(opt);
- } ASP_STANDARD_CATCHES;
-
- return 0;
-}
View
1  src/asp/Tools/stereo.cc
@@ -244,7 +244,6 @@ namespace asp {
&DiskImageResourceIsis::construct_create);
#endif
asp::StereoSession::register_session_type( "rpc", &asp::StereoSessionRPC::construct);
- asp::StereoSession::register_session_type( "rmax", &asp::StereoSessionRmax::construct);
#if defined(ASP_HAVE_PKG_ISISIO) && ASP_HAVE_PKG_ISISIO == 1
asp::StereoSession::register_session_type( "isis", &asp::StereoSessionIsis::construct);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.