I have tried to compile Hugin in debug mode (-DCMAKE_BUILD_TYPE=Debug)
and found a few issues. The patches are attached. Hugin_shared.h.patch
is just cosmetic change in order to MinGW's gcc doesn't complain about
#pragma warning.
Regards,
/J.D.
--
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/hugin-ptx/56A6932F.90004%40onet.pl.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/hugin_shared.h b/src/hugin_shared.h
--- a/src/hugin_shared.h
+++ b/src/hugin_shared.h
@@ -43,7 +43,9 @@
#define LINESIMPEX __declspec(dllimport)
#endif
+#ifdef _MSC_VER
#pragma warning( disable: 4251 )
+#endif
#else
#define IMPEX
diff --git a/src/hugin_base/huginapp/ImageCache.cpp
b/src/hugin_base/huginapp/ImageCache.cpp
--- a/src/hugin_base/huginapp/ImageCache.cpp
+++ b/src/hugin_base/huginapp/ImageCache.cpp
@@ -187,31 +187,31 @@
std::map<std::string, EntryPtr>::iterator imgIt;
for(imgIt=images.begin(); imgIt != images.end(); ++imgIt) {
#ifdef DEBUG
- cout << "Image: " << imgIt->first << std::endl;
- cout << "CacheEntry: " << imgIt->second.use_count() << "last access: "
<< imgIt->second->lastAccess;
+ std::cout << "Image: " << imgIt->first << std::endl;
+ std::cout << "CacheEntry: " << imgIt->second.use_count() << "last
access: " << imgIt->second->lastAccess;
#endif
if (imgIt->second->image8) {
imgMem += imgIt->second->image8->width() *
imgIt->second->image8->height() * 3;
#ifdef DEBUG
- cout << " 8bit: " << imgIt->second->image8.use_count();
+ std::cout << " 8bit: " << imgIt->second->image8.use_count();
#endif
}
if (imgIt->second->image16) {
imgMem += imgIt->second->image16->width() *
imgIt->second->image16->height() * 3*2;
#ifdef DEBUG
- cout << " 16bit: " << imgIt->second->image8.use_count();
+ std::cout << " 16bit: " << imgIt->second->image8.use_count();
#endif
}
if (imgIt->second->imageFloat) {
imgMem += imgIt->second->imageFloat->width() *
imgIt->second->imageFloat->height() * 3 * 4;
#ifdef DEBUG
- cout << " float: " << imgIt->second->imageFloat.use_count() ;
+ std::cout << " float: " << imgIt->second->imageFloat.use_count() ;
#endif
}
if (imgIt->second->mask) {
imgMem += imgIt->second->mask->width() *
imgIt->second->mask->height();
#ifdef DEBUG
- cout << " mask: " << imgIt->second->mask.use_count() << std:: endl;
+ std::cout << " mask: " << imgIt->second->mask.use_count() <<
std::endl;
#endif
}
}
diff --git a/src/hugin_base/algorithms/optimizer/PhotometricOptimizer.cpp
b/src/hugin_base/algorithms/optimizer/PhotometricOptimizer.cpp
--- a/src/hugin_base/algorithms/optimizer/PhotometricOptimizer.cpp
+++ b/src/hugin_base/algorithms/optimizer/PhotometricOptimizer.cpp
@@ -162,10 +162,10 @@
OptimData * dat = static_cast<OptimData*>(data);
dat->FromX(p);
#ifdef DEBUG_LOG_VIG
- ostringstream oss;
+ std::ostringstream oss;
oss << "vig_log_" << iter;
iter++;
- ofstream log(oss.str().c_str());
+ std::ofstream log(oss.str().c_str());
log << "VIGparams = [";
for (int i = 0; i < m; i++) {
log << p[i] << " ";
@@ -335,7 +335,11 @@
// difference mode
optimOpts[4] = LM_DIFF_DELTA;
+#ifdef DEBUG
+ int ret = dlevmar_dif(&photometricError, &photometricVis, &(p[0]),
&(x[0]), m, n, nMaxIter, optimOpts, info, NULL,NULL, &data); // no jacobian
+#else
dlevmar_dif(&photometricError, &photometricVis, &(p[0]), &(x[0]), m, n,
nMaxIter, optimOpts, info, NULL,NULL, &data); // no jacobian
+#endif
// copy to source images (data.m_imgs)
data.FromX(p.begin());
// calculate error at solution
diff --git a/src/hugin_base/nona/RemappedPanoImage.h
b/src/hugin_base/nona/RemappedPanoImage.h
--- a/src/hugin_base/nona/RemappedPanoImage.h
+++ b/src/hugin_base/nona/RemappedPanoImage.h
@@ -193,6 +193,7 @@
#ifdef DEBUG
#define DEBUG_REMAP 1
+#include <vigra/impex.hxx> // for vigra::exportImage()
#endif
#ifdef DEBUG_REMAP