From: Enblend <enb...@li...> - 2013-12-02 18:44:35
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/529580b95c73 changeset: 992:529580b95c73 user: Chris <cs...@us...> date: Mon Dec 02 19:36:16 2013 +0100 description: Make GraphCut compile again. diffstat: VERSION | 2 +- src/graphcut.h | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diffs (84 lines): diff -r 68aeda574a8d -r 529580b95c73 VERSION --- a/VERSION Mon Dec 02 17:58:11 2013 +0000 +++ b/VERSION Mon Dec 02 19:36:16 2013 +0100 @@ -1,1 +1,1 @@ -4.2-90fcf8f1b20d +4.2-68aeda574a8d diff -r 68aeda574a8d -r 529580b95c73 src/graphcut.h --- a/src/graphcut.h Mon Dec 02 17:58:11 2013 +0000 +++ b/src/graphcut.h Mon Dec 02 19:36:16 2013 +0100 @@ -17,10 +17,10 @@ * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef GRAPHCUT_H #define GRAPHCUT_H + #include <iostream> #ifdef _WIN32 @@ -74,13 +74,12 @@ #define LABEL_LEFT 1 #define LABEL_RIGHT 2 + //#define DEBUG_GRAPHCUT -#ifdef DEBUG_GRAPHCUT -using namespace vigra; -#endif -namespace enblend { +namespace enblend +{ struct pointHash { std::size_t operator()(const vigra::Point2D& p) const @@ -348,10 +347,10 @@ vigra::Point2D offset_) : left(a_), right(b_), offset(offset_) {} - MaskPixelType operator()(vigra::Diff2D point_) const + MaskPixelType operator()(const vigra::Diff2D& a_point) const { - vigra::Point2D point(point_); - //add border to detect seams close to border + vigra::Point2D point(a_point); + // add border to detect seams close to border point -= vigra::Point2D(1,1); if(left->find(point) != left->end()) @@ -373,7 +372,7 @@ { public: CutPixelsFunctor(boost::unordered_set<vigra::Point2D, pointHash>* a_, - boost::unordered_set<vigra::Point2D, pointHash>* b_) : + boost::unordered_set<vigra::Point2D, pointHash>* b_) : left(a_), right(b_){} MaskPixelType operator()(const vigra::Diff2D& pos2, const MaskPixelType& a2) const @@ -1232,7 +1231,7 @@ exportImage(srcImageRange(tempImg), ImageExportInfo("./debug/process_cut_1_seam_pixels.tif").setPixelType("UINT8")); #endif - vigra::transformImage(srcIterRange(Diff2D(), size), vigra::destIter(tempImg.upperLeft()), + vigra::transformImage(srcIterRange(vigra::Diff2D(), size), vigra::destIter(tempImg.upperLeft()), OutputLabelingFunctor<MaskPixelType>(&pixelsLeftOfCut, &pixelsRightOfCut, iBB.upperLeft())); // labels areas that belong to left/right images @@ -1480,10 +1479,12 @@ delete intermediatePointList; delete dualPath; } +} /* namespace enblend */ -} /* namespace enblend */ + #endif /* GRAPHCUT_H */ + // Local Variables: // mode: c++ // End: |