Permalink
Browse files

Some adjustments to support building against the lastest version of I…

…SIS on Mac OS X. I would not be suprised if this breaks the build on other systems, and I plan to work with Mike and Vinh to resolve these issues on Columbia and general Linux systems tomorrow.
  • Loading branch information...
1 parent ec7d956 commit 38b27027ab3c035dec3f553c6d5edee34a8acbd0 @broxtronix broxtronix committed Oct 15, 2008
Showing with 125 additions and 31 deletions.
  1. +12 −5 configure.ac
  2. +12 −0 docs/book/Makefile
  3. +56 −0 docs/book/asp_book.tex
  4. +15 −15 src/Isis/StereoSessionIsis.cc
  5. +3 −3 src/bundlevis.h
  6. +15 −2 src/disparitydebug.cc
  7. +12 −6 src/stereo.cc
View
@@ -260,18 +260,25 @@ fi
AX_PKG(SPICE, [], [-lcspice], [SpiceUsr.h SpiceZfc.h])
+dnl ISIS includes QT headers without the proper qt module prefix, so
+dnl we need to add this check here to force the build system to add an
+dnl extra include path at the top level of the QTCore tree.
AX_PKG(QT_INCLUDE, [], [], [QVector], [${QT_CPPFLAGS}])
-AX_PKG(QT_CORE, [QT_INCLUDE], [-lQtCore], [QVector], [${QT_CPPFLAGS}])
-AX_PKG(QT_GUI, [QT_INCLUDE], [-lQtGui], [QLabel], [${QT_CPPFLAGS}])
-AX_PKG(QT_SQL, [QT_INCLUDE], [-lQtSql], [QtSql], [${QT_CPPFLAGS}])
+dnl AX_PKG(QT_CORE, [QT_INCLUDE], [-lQtCore], [QVector], [${QT_CPPFLAGS}])
+dnl AX_PKG(QT_GUI, [QT_INCLUDE], [-lQtGui], [QLabel], [${QT_CPPFLAGS}])
+dnl AX_PKG(QT_SQL, [QT_INCLUDE], [-lQtSql], [QtSql], [${QT_CPPFLAGS}])
dnl We need to link ISIS3RDPARTY against LAPACK because, on some systems,
dnl the ISIS compilation does not resolve certain BLAS symbols that its
dnl dependent 3rd party libraries depend on (for whatever retarded reason).
dnl Thus, we link against LAPACK here because it defines these missing
dnl BLAS symbols in the event that we need them.
-AX_PKG(ISIS3RDPARTY, [LAPACK], [-lsuperlu_3.0 -lgeos.2 -lxerces-c.27 -lgsl.0 -lgslcblas.0 -lqwt.5 -lstdc++])
-AX_PKG(ISIS, [QT_INCLUDE QT_CORE QT_GUI QT_SQL SPICE ISIS3RDPARTY], [-lisis3])
+AX_PKG(GEOS, [], [-lgeos-3.0.0], [])
+AX_PKG(SUPERLU, [], [-lsuperlu_3.0], [])
+AX_PKG(XERCESC, [], [-lxerces-c.28], [])
+AX_PKG(ISIS3RDPARTY, [LAPACK], [-lgsl.0 -lgslcblas.0 -lqwt.5.1])
+dnl AX_PKG(ISIS, [QT_INCLUDE QT_CORE QT_GUI QT_SQL SPICE ISIS3RDPARTY], [-lisis3])
+AX_PKG(ISIS, [SPICE GEOS SUPERLU XERCESC ISIS3RDPARTY], [-lisis3])
dnl AX_PKG(SPICE, [], [-lcspice -lcsupport], [SpiceUsr.h SpiceZfc.h])
dnl AX_PKG(QT_CORE, [], [-lQtCore], [QVector], [QtCore QtCore])
View
@@ -0,0 +1,12 @@
+all: asp_book.pdf
+
+asp_book.pdf:
+ pdflatex asp_book.tex
+
+clean:
+ rm -rf *.o *~ \#* *.aux *.log
+
+distclean: clean
+ rm -rf generate asp_book.toc asp_book.pdf .libs
+
+.PHONY: images clean distclean all
View
@@ -0,0 +1,56 @@
+\documentclass[letterpaper,12pt]{book}
+\usepackage[margin=0.75in]{geometry}
+\usepackage{moreverb}
+\usepackage{float}
+\usepackage{subfigure}
+\usepackage{graphicx}
+\usepackage{epstopdf}
+
+% Define the \sourcelst command to create a floating listing of
+% a (separate) source file.
+\newfloat{listing}{t}{lop}
+\floatname{listing}{Listing}
+\def\sourcelst#1#2{
+\begin{listing}
+\begin{tabular}{|@{\hspace{0.04\linewidth}}c@{\hspace{0.02\linewidth}}|}
+\hline \\
+\begin{minipage}{0.94\linewidth}
+\small\listinginput{1}{#1}
+\end{minipage}
+\\ \\ \hline
+\end{tabular}
+\caption{[{\tt #1}]\ \ #2}
+\label{lst:#1}
+\end{listing}
+}
+
+\title{{\Huge The Vision Workbook:}\\A User's Guide to the\\NASA Vision Workbench v1.0}
+\author{
+Matthew D.~Hancher\\
+Michael J.~Broxton\\
+Laurence J.~Edwards\\
+\\
+Intelligent Systems Division\\
+NASA Ames Research Center\\
+\\
+DRAFT}
+
+\begin{document}
+\maketitle
+\include{acknowledgements}
+\tableofcontents
+\include{introduction}
+\include{gettingstarted}
+\include{workingwithimages}
+\include{imageprocessing}
+\include{typesystem}
+\include{core_module}
+\include{camera_module}
+\include{mosaic_module}
+\include{hdr_module}
+\include{cartography_module}
+\include{stereo_module}
+\include{advancedtopics}
+\include{cookbook}
+
+\end{document}
@@ -311,25 +311,25 @@ void StereoSessionIsis::pre_filtering_hook(std::string const& input_file, std::s
// (uncomment at your own risk)
// ****************************************************
-// output_file = m_out_prefix + "-D-masked.exr";
+ output_file = m_out_prefix + "-R-masked.exr";
-// ImageView<uint8> Lmask, Rmask;
-// DiskImageView<PixelGray<float> > left_disk_image(m_left_image_file);
-// DiskImageView<PixelGray<float> > right_disk_image(m_right_image_file);
+ ImageView<uint8> Lmask, Rmask;
+ DiskImageView<PixelGray<float> > left_disk_image(m_left_image_file);
+ DiskImageView<PixelGray<float> > right_disk_image(m_right_image_file);
-// read_image(Lmask,m_out_prefix + "-lMask.tif");
-// read_image(Rmask,m_out_prefix + "-rMask.tif");
-// disparity::mask_black_pixels(clamp(left_disk_image,0,1e6), Lmask);
-// disparity::mask_black_pixels(clamp(right_disk_image,0,1e6), Rmask);
-// write_image(m_out_prefix + "-lMaskDebug.tif", Lmask);
-// write_image(m_out_prefix + "-rMaskDebug.tif", Rmask);
+ read_image(Lmask,m_out_prefix + "-lMask.tif");
+ read_image(Rmask,m_out_prefix + "-rMask.tif");
+ disparity::mask_black_pixels(clamp(left_disk_image,0,1e6), Lmask);
+ disparity::mask_black_pixels(clamp(right_disk_image,0,1e6), Rmask);
+ write_image(m_out_prefix + "-lMaskDebug.tif", Lmask);
+ write_image(m_out_prefix + "-rMaskDebug.tif", Rmask);
-// DiskImageView<PixelDisparity<float> > disparity_disk_image(input_file);
-// ImageViewRef<PixelDisparity<float> > disparity_map = disparity::mask(disparity_disk_image, Lmask, Rmask);
+ DiskImageView<PixelDisparity<float> > disparity_disk_image(input_file);
+ ImageViewRef<PixelDisparity<float> > disparity_map = disparity::mask(disparity_disk_image, Lmask, Rmask);
-// DiskImageResourceOpenEXR disparity_map_rsrc(output_file, disparity_map.format() );
-// disparity_map_rsrc.set_tiled_write(std::min(2048,disparity_map.cols()),std::min(2048, disparity_map.rows()));
-// block_write_image( disparity_map_rsrc, disparity_map, TerminalProgressCallback() );
+ DiskImageResourceOpenEXR disparity_map_rsrc(output_file, disparity_map.format() );
+ disparity_map_rsrc.set_tiled_write(std::min(512,disparity_map.cols()),std::min(512, disparity_map.rows()));
+ block_write_image( disparity_map_rsrc, disparity_map, TerminalProgressCallback() );
}
// Reverse any pre-alignment that was done to the images.
View
@@ -142,7 +142,7 @@ class CameraIter : public osg::Referenced {
void addIteration( const std::vector<osg::Vec3f>& newPos,
const std::vector<osg::Vec3f>& newEuler ) {
if (_isPushbroom){
- if ( newPos.size() == _vertices ) {
+ if ( int(newPos.size()) == _vertices ) {
for (int i = 0; i < _vertices; ++i) {
_position.push_back( newPos[i] );
_euler.push_back( newEuler[i] );
@@ -349,12 +349,12 @@ struct pushbroomDrawCallback : public osg::Drawable::DrawCallback
if ( buffer == 0 ) { // Draw the last instance
- for ( unsigned i = 0; i < (*_camera).getVertices(); ++i )
+ for ( int i = 0; i < (*_camera).getVertices(); ++i )
(*vertices)[i] = (*_camera).getPosition( _camera->size() - 1, i);
} else { // normal
- for ( unsigned i = 0; i < (*_camera).getVertices(); ++i )
+ for ( int i = 0; i < (*_camera).getVertices(); ++i )
(*vertices)[i] = (*_camera).getPosition( buffer-1, i );
}
View
@@ -51,8 +51,17 @@ namespace vw {
template<> struct PixelFormatID<PixelDisparity<float> > { static const PixelFormatEnum value = VW_PIXEL_GENERIC_3_CHANNEL; };
}
+// Erases a file suffix if one exists and returns the base string
+static std::string prefix_from_filename(std::string const& filename) {
+ std::string result = filename;
+ int index = result.rfind(".");
+ if (index != -1)
+ result.erase(index, result.size());
+ return result;
+}
+
int main( int argc, char *argv[] ) {
- std::string input_file_name, output_prefix, output_file_type;
+ std::string input_file_name, output_prefix = "", output_file_type;
unsigned cache_size;
int debug_level;
@@ -61,7 +70,7 @@ int main( int argc, char *argv[] ) {
("help", "Display this help message")
("cache", po::value<unsigned>(&cache_size)->default_value(1024), "Cache size, in megabytes")
("input-file", po::value<std::string>(&input_file_name), "Explicitly specify the input file")
- ("output-prefix,o", po::value<std::string>(&output_prefix)->default_value("disparity"), "Specify the output prefix")
+ ("output-prefix,o", po::value<std::string>(&output_prefix), "Specify the output prefix")
("output-filetype,t", po::value<std::string>(&output_file_type)->default_value("tif"), "Specify the output file")
("debug-level,d", po::value<int>(&debug_level)->default_value(vw::DebugMessage-1), "Set the debugging output level. (0-50+)")
("float-pixels", "Save the resulting debug images as 32 bit floating point files (if supported by the selected files type.");
@@ -87,6 +96,10 @@ int main( int argc, char *argv[] ) {
return 1;
}
+ if( output_prefix == "" ) {
+ output_prefix = prefix_from_filename(input_file_name);
+ }
+
std::cout << "Opening " << input_file_name << "\n";
DiskImageView<PixelDisparity<float> > disk_disparity_map(input_file_name);
View
@@ -113,6 +113,12 @@ void print_usage(po::options_description const& visible_options) {
//***********************************************************************
int main(int argc, char* argv[]) {
+ TerminateHandler th[] = {BacktraceTerminate, PrettyTerminate, DefaultTerminate};
+
+ for (int i = 0; i < 3; ++i)
+ if (set_terminate_handler(th[i]))
+ break;
+
// The default file type are automatically registered the first time
// a file is opened or created, however we want to override some of
// the defaults, so we explicitly register them here before registering
@@ -128,12 +134,12 @@ int main(int argc, char* argv[]) {
&DiskImageResourceDDD::construct_create);
#if defined(ASP_HAVE_PKG_ISIS) && ASP_HAVE_PKG_ISIS == 1
-// // Register the Isis file handler with the Vision Workbench
-// // DiskImageResource system.
-// DiskImageResource::register_file_type(".cub",
-// DiskImageResourceIsis::type_static(),
-// &DiskImageResourceIsis::construct_open,
-// &DiskImageResourceIsis::construct_create);
+ // Register the Isis file handler with the Vision Workbench
+ // DiskImageResource system.
+ DiskImageResource::register_file_type(".cub",
+ DiskImageResourceIsis::type_static(),
+ &DiskImageResourceIsis::construct_open,
+ &DiskImageResourceIsis::construct_create);
#endif
/*************************************/
/* Parsing of command line arguments */

0 comments on commit 38b2702

Please sign in to comment.