From: <hug...@li...> - 2010-09-27 15:43:57
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/8418676e8a53 changeset: 4425:8418676e8a53 user: tmodes date: Mon Sep 27 17:43:27 2010 +0200 description: Fixes incorrect masks in combination with translations parameters [3076130] diffstat: src/hugin_base/panodata/Mask.cpp | 8 ++++++-- src/hugin_base/panodata/Panorama.cpp | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diffs (35 lines): diff -r 3936a26214ba -r 8418676e8a53 src/hugin_base/panodata/Mask.cpp --- a/src/hugin_base/panodata/Mask.cpp Sun Sep 26 21:29:54 2010 +0100 +++ b/src/hugin_base/panodata/Mask.cpp Mon Sep 27 17:43:27 2010 +0200 @@ -140,11 +140,15 @@ void MaskPolygon::transformPolygon(const PTools::Transform &trans) { double xnew,ynew; + VectorPolygon newPoly; for(unsigned int i=0;i<m_polygon.size();i++) { - trans.transformImgCoord(xnew,ynew,m_polygon[i].x,m_polygon[i].y); - m_polygon[i]=FDiff2D(xnew,ynew); + if(trans.transformImgCoord(xnew,ynew,m_polygon[i].x,m_polygon[i].y)) + { + newPoly.push_back(FDiff2D(xnew,ynew)); + }; }; + m_polygon=newPoly; }; void MaskPolygon::subSample(const double max_distance) diff -r 3936a26214ba -r 8418676e8a53 src/hugin_base/panodata/Panorama.cpp --- a/src/hugin_base/panodata/Panorama.cpp Sun Sep 26 21:29:54 2010 +0100 +++ b/src/hugin_base/panodata/Panorama.cpp Mon Sep 27 17:43:27 2010 +0200 @@ -1094,6 +1094,10 @@ PTools::Transform targetTrans; targetTrans.createTransform(getImage(k),getOptions()); targetMask.transformPolygon(targetTrans); + if(targetMask.getMaskPolygon().size()<3) + { + continue; + }; //check if mask was inverted - outside became inside and vice versa //if so, invert mask int newWindingNumber=targetMask.getTotalWindingNumber(); |