[Hugin-cvs] SF.net SVN: hugin:[4039]
hugin/branches/gsoc2009_layout/src/tools/ align_image_stack.cpp
From: <jl...@us...> - 2009-07-13 21:28:50
|
Revision: 4039 http://hugin.svn.sourceforge.net/hugin/?rev=4039&view=rev Author: jlegg Date: 2009-07-13 21:28:47 +0000 (Mon, 13 Jul 2009) Log Message: ----------- Refactor AlignImageStack to work with new lenses interface. Modified Paths: -------------- hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp Modified: hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp 2009-07-13 16:10:53 UTC (rev 4038) +++ hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp 2009-07-13 21:28:47 UTC (rev 4039) @@ -41,6 +41,7 @@ #include <panodata/Panorama.h> #include <panotools/PanoToolsOptimizerWrapper.h> +#include <panodata/StandardImageVariableGroups.h> #include <algorithms/optimizer/PTOptimizer.h> #include <nona/Stitcher.h> @@ -269,7 +270,6 @@ Panorama pano; Lens l; - pano.addLens(l); // add the first image.to the panorama object // default settings @@ -300,26 +300,15 @@ srcImg.setHFOV(50); } - srcImg.setLensNr(0); - int imgNr = pano.addImage(srcImg, defaultVars); - // unlink HFOV? - if (param.optHFOV) { - l = pano.getLens(0); - LensVariable lv = map_get(l.variables, "v"); - lv.setLinked(false); - pano.updateLensVariable(0, lv); - } if (param.linear) { srcImg.setResponseType(SrcPanoImage::RESPONSE_LINEAR); if (g_verbose>0) { cout << "Using linear response" << std::endl; } } - /** @todo I think the addImage and setSrcImage should be combined into - * one call, now that addImage takes SrcPanoImages. - */ - pano.setSrcImage(imgNr, srcImg); - + + pano.addImage(srcImg, defaultVars); + // setup output to be exactly similar to input image PanoramaOptions opts; @@ -349,6 +338,7 @@ OptimizeVector optvars(1); ImageType * rightImg = new ImageType(leftImg->size()); + StandardImageVariableGroups variable_groups(pano); // loop to add images and control points between them. for (int i = 1; i < (int) files.size(); i++) { @@ -369,14 +359,13 @@ srcImg.setHFOV(50); } - /** @todo remove lens stuff, set variables directly or something. - * the following commented out line should be reinstated when there - * is proper linking in the Panorama. - */ - // srcImg.setLens(l); - pano.addLens(l); int imgNr = pano.addImage(srcImg, defaultVars); - pano.setSrcImage(imgNr, srcImg); + // each image shares the same lens. + variable_groups.getLenses().switchParts(imgNr, 0); + // unlink HFOV? + if (param.optHFOV) { + pano.unlinkImageVariableHFOV(0); + } // load the actual image data of the next image vigra::ImageImportInfo nextImgInfo(files[i].c_str()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Hugin-cvs] SF.net SVN: hugin:[4205]
hugin/branches/gsoc2009_layout/src/tools/ align_image_stack.cpp
From: <jl...@us...> - 2009-08-13 14:27:11
|
Revision: 4205 http://hugin.svn.sourceforge.net/hugin/?rev=4205&view=rev Author: jlegg Date: 2009-08-13 14:26:59 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Link the stack parameter (j) in the pto file produced by align_image_stack. Could be useful if creating a bracketed panorama. Modified Paths: -------------- hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp Modified: hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp 2009-08-13 13:39:35 UTC (rev 4204) +++ hugin/branches/gsoc2009_layout/src/tools/align_image_stack.cpp 2009-08-13 14:26:59 UTC (rev 4205) @@ -363,8 +363,11 @@ // unlink HFOV? if (param.optHFOV) { pano.unlinkImageVariableHFOV(0); - } - + } + + // All images are in the same stack: Link the stack variable. + pano.linkImageVariableStack(imgNr, 0); + // load the actual image data of the next image vigra::ImageImportInfo nextImgInfo(files[i].c_str()); assert(nextImgInfo.size() == firstImgInfo.size()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |