From: Pablo d'A. <da...@us...> - 2005-01-17 23:33:29
|
Update of /cvsroot/hugin/hugin/src/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10390/src/tools Modified Files: autopano.cpp Makefile.am Log Message: compilation fixes for gcc, previous checkin was only tested with MSVC. Index: autopano.cpp =================================================================== RCS file: /cvsroot/hugin/hugin/src/tools/autopano.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- autopano.cpp 27 Oct 2004 18:12:56 -0000 1.10 +++ autopano.cpp 17 Jan 2005 23:32:33 -0000 1.11 @@ -98,23 +98,11 @@ } Lens lens; - map_get(lens.variables,"v").setValue(defaultHFOV); - lens.isLandscape = (img.width() > img.height()); - if (lens.isLandscape) { - lens.setRatio(((double)img.width())/img.height()); - } else { - lens.setRatio(((double)img.height())/img.width()); - } - - std::string::size_type idx = filename.rfind('.'); - if (idx == std::string::npos) { - DEBUG_DEBUG("could not find extension in filename"); - } - std::string ext = filename.substr( idx+1 ); - - if (! forcedHFOV && utils::tolower(ext) == "jpg") { - // try to read exif data from jpeg files. - lens.readEXIF(filename); + // try to read exif data from jpeg files. + double cropFactor=0; + lens.initFromFile(filename, cropFactor); + if (forcedHFOV) { + map_get(lens.variables,"v").setValue(defaultHFOV); } int matchingLensNr=-1; @@ -126,9 +114,10 @@ // use a lens if hfov and ratio are the same // should add a check for exif camera information as // well. - if ((l.getRatio() == lens.getRatio()) && - (l.isLandscape == lens.isLandscape) && - (const_map_get(l.variables,"v").getValue() == const_map_get(lens.variables,"v").getValue()) ) + if ((l.getAspectRatio() == lens.getAspectRatio()) && + (l.isLandscape() == lens.isLandscape()) && + (fabs(const_map_get(l.variables,"v").getValue() - const_map_get(lens.variables,"v").getValue()) < 0.01 ) && + (l.getSensorSize() == lens.getSensorSize())) { matchingLensNr= lnr; } Index: Makefile.am =================================================================== RCS file: /cvsroot/hugin/hugin/src/tools/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 10 Nov 2004 07:29:07 -0000 1.5 +++ Makefile.am 17 Jan 2005 23:32:45 -0000 1.6 @@ -5,7 +5,7 @@ AM_CPPFLAGS = $(BOOST_CFLAGS) $(JPEG_FLAGS) $(TIFF_FLAGS) $(PANO_FLAGS) AM_LDFLAGS = $(LIB_JPEG) $(LIB_TIFF) $(LIB_PANO) -bin_PROGRAMS = nona autopano_old automatch panosifter autooptimiser zhang_undistort +bin_PROGRAMS = nona autopano_old panosifter autooptimiser zhang_undistort nona_SOURCES = nona.cpp nona_LDADD = ${top_builddir}/src/Panorama/libpanorama.la ${top_builddir}/src/common/libcommon.la \ |