Hello, after accidentally changing enblend to smartblend in a wrong place (directly in pto) I found out that arguments to the blending apps are spread all over the Makefile which is quite messy. I've done patch which moves setting these arguments for different apps to one place. Because these changes should be only cosmetic (I've just tested it with a small pano and Makefile is generated properly) I'd like to commit it soon. Patch is of course attached.
But to the real reason why I'm writing this email. I' think about cleaning makefile a bit (OK, a lot). First I think that setting all possible blending programs at the begging is not necessary and redundant. My idea is to have only one variable, let's say BLENDER which could hold eg. enblend, smartblend, PTmender etc. The same for it's options. As I'm looking at parameters of these blending programs they seem quite similar, so only one make rule should be enough for these. With these changes, the PanoramaMakefileExport.cpp file could be reduced without loss of it's possibilities. Maybe it would allow to use different blending applications again.Adding support for new blending app should be simplified by this, because for most tools it would be probably enough to change eg BLENDER_OPTS accordingly. Also makefile would be a bit smaller (see test.pto.mk as an example), because there would be no unnecessary programs. I can make some patch which will show it probably by tomorrow. What do you think about it? regards, Lukáš "stativ" Jirkovský --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group. A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hugin-ptx -~----------~----~----~----~------~----~------~--~---
Index: src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp
===================================================================
--- src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp (revision 3663)
+++ src/hugin_base/algorithms/panorama_makefile/PanoramaMakefileExport.cpp (working copy)
@@ -78,10 +78,10 @@
result.push_back(stack);
stack.clear();
} while (allImgs.size() > 0);
-
+
return result;
}
-
+
// should be moved somewhere else (will be after GSOC anyway)
vector<UIntSet> getExposureLayers(const PanoramaData & pano, UIntSet allImgs)
{
@@ -126,13 +126,13 @@
{
UIntSet images;
PanoramaOptions opts = pano.getOptions();
- for (UIntSet::const_iterator it = activeImages.begin(); it != activeImages.end(); ++it)
- {
- Rect2D roi = estimateOutputROI(pano, opts, *it);
- if (! (roi.isEmpty())) {
- images.insert(*it);
- }
- }
+ for (UIntSet::const_iterator it = activeImages.begin(); it != activeImages.end(); ++it)
+ {
+ Rect2D roi = estimateOutputROI(pano, opts, *it);
+ if (! (roi.isEmpty())) {
+ images.insert(*it);
+ }
+ }
return images;
}
@@ -156,8 +156,8 @@
setlocale(LC_NUMERIC,"C");
#endif
- // output only images in current ROI
- UIntSet images = getImagesinROI(pano,rimages);
+ // output only images in current ROI
+ UIntSet images = getImagesinROI(pano,rimages);
// execute exiftool with perl if necessary
#ifdef COULD_EXECUTE_EXIFTOOL_WITH_PERL
@@ -172,13 +172,13 @@
}
#endif
#endif
-
+
o << "# makefile for panorama stitching, created by hugin " << endl
<< endl;
// pass settings for different temporary directory
if (tmpDir != "") {
- o << "# set temporary directory" << endl;
+ o << "# set temporary directory" << endl;
#ifdef __unix__
o << "export TMPDIR=" << quoteStringShell(tmpDir) << endl;
#else // WINDOWS
@@ -207,15 +207,6 @@
<< "EXIFTOOL=" << quoteStringShell(progs.exiftool) << endl
#endif
<< endl
-// This is completely unnecessary because it should be handled by default values in struct progs
-// << "ifndef ENBLEND" << endl
-// << " ENBLEND=false" << endl
-// << "endif" << endl
-// << endl
-// << "ifndef ENFUSE" << endl
-// << " ENFUSE=false" << endl
-// << "endif" << endl
-// << endl
<< "# Project parameters" << endl
<< "HUGIN_PROJECTION=" << opts.getProjection() << endl
@@ -226,44 +217,87 @@
<< "# options for the programs" << endl << endl;
- o << "NONA_LDR_REMAPPED_COMP=";
- if (opts.outputImageType == "tif" && opts.outputLayersCompression.size() != 0) {
- o << "-z " << opts.outputLayersCompression;
- } else if (opts.outputImageType == "jpg") {
- o << "-z PACKBITS ";
+ // set remapper specific settings
+ switch(opts.remapper) {
+ case PanoramaOptions::NONA:
+ {
+ o << "NONA_LDR_REMAPPED_COMP=";
+ if (opts.outputImageType == "tif" && opts.outputLayersCompression.size() != 0) {
+ o << "-z " << opts.outputLayersCompression;
+ } else if (opts.outputImageType == "jpg") {
+ o << "-z PACKBITS ";
+ }
+ o << endl;
+ }
+ break;
+ case PanoramaOptions::PTMENDER:
+ break;
}
- o << endl;
- o << "ENBLEND_OPTS=" << opts.enblendOptions;
- if (opts.getHFOV() == 360.0) {
- // blend over the border
- o << " -w";
- }
+ // set blender specific settings
+ switch(opts.blendMode) {
+ case PanoramaOptions::ENBLEND_BLEND:
+ {
+ o << "ENBLEND_OPTS=" << opts.enblendOptions;
+ if (opts.getHFOV() == 360.0) {
+ // blend over the border
+ o << " -w";
+ }
+ vigra::Rect2D roi = opts.getROI();
+ if (roi.top() != 0 || roi.left() != 0 ) {
+ o << " -f" << roi.width() << "x" << roi.height() << "+" << roi.left() << "+" << roi.top();
+ } else {
+ o << " -f" << roi.width() << "x" << roi.height();
+ }
+ o << endl;
- vigra::Rect2D roi = opts.getROI();
- if (roi.top() != 0 || roi.left() != 0 ) {
- o << " -f" << roi.width() << "x" << roi.height() << "+" << roi.left() << "+" << roi.top();
- } else {
- o << " -f" << roi.width() << "x" << roi.height();
+ o << "ENBLEND_LDR_COMP=";
+ if (opts.outputImageType == "tif" && opts.outputImageTypeCompression.size() != 0) {
+ o << "--compression " << opts.outputImageTypeCompression;
+ } else if (opts.outputImageType == "jpg") {
+ o << "--compression " << opts.quality;
+ }
+ o << endl;
+
+ o << "ENBLEND_HDR_COMP=";
+ if (opts.outputImageType == "tif" && opts.outputImageTypeHDRCompression.size() != 0) {
+ o << "--compression " << opts.outputImageTypeHDRCompression;
+ }
+ o << endl;
+ }
+ break;
+ case PanoramaOptions::PTBLENDER_BLEND:
+ {
+ o << "PTBLENDER_OPTS=";
+ switch (opts.colorCorrection) {
+ case PanoramaOptions::NONE:
+ break;
+ case PanoramaOptions::BRIGHTNESS_COLOR:
+ o << " -k " << opts.colorReferenceImage;
+ break;
+ case PanoramaOptions::BRIGHTNESS:
+ o << " -k " << opts.colorReferenceImage;
+ break;
+ case PanoramaOptions::COLOR:
+ o << " -k " << opts.colorReferenceImage;
+ break;
+ }
+ o << endl;
+ }
+ break;
+ case PanoramaOptions::SMARTBLEND_BLEND:
+ {
+ o << "SMARTBLEND_OPTS=" << progs.smartblend_opts;
+ if (opts.getHFOV() == 360.0) {
+ // blend over the border
+ o << " -w";
+ }
+ o << endl;
+ // TODO: build smartblend command line from given images. (requires additional program)
+ }
+ break;
}
- o << endl;
-
- o << "ENBLEND_LDR_COMP=";
- if (opts.outputImageType == "tif" && opts.outputImageTypeCompression.size() != 0) {
- o << "--compression " << opts.outputImageTypeCompression;
- } else if (opts.outputImageType == "jpg") {
- o << "--compression " << opts.quality;
- }
- o << endl;
-
- o << "ENBLEND_HDR_COMP=";
- if (opts.outputImageType == "tif" && opts.outputImageTypeHDRCompression.size() != 0) {
- o << "--compression " << opts.outputImageTypeHDRCompression;
- }
- o << endl;
-
-
o << "ENFUSE_OPTS=" << opts.enfuseOptions;
// TODO: blend only over border if this is indeed a
// image with 360 deg overlap
@@ -547,7 +581,7 @@
}
o << endl << endl;
-
+
vector<string> ldrStackedImages;
o << endl
<< "# stacked images for enfuse or other automatic exposure blending tools" << endl
@@ -592,7 +626,7 @@
o << "$(LDR_STACK_" << i << "_SHELL) ";
o << endl;
-
+
// TODO: include custom makefile here
if (includePath.size() > 0) {
o << "include " << escapeStringMake(includePath) << endl << endl;
@@ -726,12 +760,12 @@
{
string destImg = escapeStringMake(similarExposureRemappedImages[j]);
string srcImg = escapeStringMake(pano.getImage(*it).getFilename());
- /*
+ /*
o << destImg << ": " << srcImg << " $(PROJECT_FILE)" << endl
<< "\t$(NONA) -r ldr -e $(LDR_EXPOSURE_LAYER_" << i << "_EXPOSURE) -m "
<< ldrRemappedMode << " -o $(LDR_EXPOSURE_REMAPPED_PREFIX) -i " << *it
<< " $(PROJECT_FILE)" << endl << endl;
- */
+ */
o << destImg << ": " << srcImg << " $(PROJECT_FILE)" << endl
<< "\t$(NONA) $(NONA_LDR_REMAPPED_COMP) -r ldr -e " << pano.getSrcImage(*it).getExposureValue()
<< " -m " << ldrRemappedMode << " -o $(LDR_EXPOSURE_REMAPPED_PREFIX_SHELL) -i " << *it
@@ -817,30 +851,9 @@
break;
case PanoramaOptions::PTBLENDER_BLEND:
- o << "PTBLENDER_OPTS=";
- switch (opts.colorCorrection) {
- case PanoramaOptions::NONE:
- break;
- case PanoramaOptions::BRIGHTNESS_COLOR:
- o << " -k " << opts.colorReferenceImage;
- break;
- case PanoramaOptions::BRIGHTNESS:
- o << " -k " << opts.colorReferenceImage;
- break;
- case PanoramaOptions::COLOR:
- o << " -k " << opts.colorReferenceImage;
- break;
- }
- o << endl;
// TODO: output PTBlender + PTmasker + PTroller rules
break;
case PanoramaOptions::SMARTBLEND_BLEND:
- o << "SMARTBLEND_OPTS=" << progs.smartblend_opts;
- if (opts.getHFOV() == 360.0) {
- // blend over the border
- o << " -w";
- }
- o << endl;
// TODO: build smartblend command line from given images. (requires additional program)
break;
default:
test.pto.mk
Description: Binary data
