Date: Wed, 19 Mar 2008 13:25:53 +0300 (MSK) From: "Iouri V. Ivliev" <ii@any.com.ru> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/121859: New port: graphics/panomatic A tool that automates the creation of control points Message-ID: <200803191025.m2JAPr5i003473@smaug.esterdev.com> Resent-Message-ID: <200803191030.m2JAU2BT088585@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 121859 >Category: ports >Synopsis: New port: graphics/panomatic A tool that automates the creation of control points >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Mar 19 10:30:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Iouri V. Ivliev >Release: FreeBSD 6.2-RELEASE-p7 i386 >Organization: EsterDev, Ltd. >Environment: System: FreeBSD smaug.esterdev.com 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #0: Sun Sep 23 17:28:25 UTC 2007 root@smaug.esterdev.com:/usr/obj/usr/src/sys/SMAUG i386 >Description: Pan-o-matic is a tool that automates the creation of control points in Hugin. WWW: http://aorlinsk2.free.fr/panomatic/ >How-To-Repeat: >Fix: --- panomatic.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # graphics/panomatic # graphics/panomatic/Makefile # graphics/panomatic/distinfo # graphics/panomatic/pkg-descr # graphics/panomatic/files # graphics/panomatic/files/patch-panomatic-PanoDetector.cpp # graphics/panomatic/files/patch-panomatic-PanoDetector.h # graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp # graphics/panomatic/files/patch-panomatic-TestCode.cpp # graphics/panomatic/files/patch-panomatic-TestCode.h # graphics/panomatic/files/patch-panomatic-main.cpp # echo c - graphics/panomatic mkdir -p graphics/panomatic > /dev/null 2>&1 echo x - graphics/panomatic/Makefile sed 's/^X//' >graphics/panomatic/Makefile << 'END-of-graphics/panomatic/Makefile' X# New ports collection makefile for: panomatic X# Date created: Fri Mar 7 11:06:34 UTC 2008 X# Whom: argv[0] (Iouri V. Ivliev) X# X# $FreeBSD$ X XPORTNAME= panomatic XPORTVERSION= 0.9.4 XPORTREVISION= 0 XDISTVERSIONSUFFIX=-src XCATEGORIES= graphics XMASTER_SITES= http://people.esterdev.com/yury/bicycles/ XWRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} X XMAINTAINER= ii@any.com.ru XCOMMENT= A tool that automates the creation of control points. X XGNU_CONFIGURE= yes XCONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} XUSE_BZIP2= yes XUSE_GMAKE= yes X XBUILD_DEPENDS= bjam:${PORTSDIR}/devel/boost X XPLIST_FILES= bin/panomatic X X.include <bsd.port.mk> END-of-graphics/panomatic/Makefile echo x - graphics/panomatic/distinfo sed 's/^X//' >graphics/panomatic/distinfo << 'END-of-graphics/panomatic/distinfo' XMD5 (panomatic-0.9.4-src.tar.bz2) = 0b08a4f7e1b4ecaf6ae364779a01da07 XSHA256 (panomatic-0.9.4-src.tar.bz2) = 9673c23d09783a526d09d54327f2ea32dfff053629411939cfca223fe690d36d XSIZE (panomatic-0.9.4-src.tar.bz2) = 1598683 END-of-graphics/panomatic/distinfo echo x - graphics/panomatic/pkg-descr sed 's/^X//' >graphics/panomatic/pkg-descr << 'END-of-graphics/panomatic/pkg-descr' XPan-o-matic is a tool that automates the creation of control points in Hugin. X XWWW: http://aorlinsk2.free.fr/panomatic/ END-of-graphics/panomatic/pkg-descr echo c - graphics/panomatic/files mkdir -p graphics/panomatic/files > /dev/null 2>&1 echo x - graphics/panomatic/files/patch-panomatic-PanoDetector.cpp sed 's/^X//' >graphics/panomatic/files/patch-panomatic-PanoDetector.cpp << 'END-of-graphics/panomatic/files/patch-panomatic-PanoDetector.cpp' X--- panomatic/PanoDetector.cpp.orig 2008-03-10 20:17:33.000000000 +0000 X+++ panomatic/PanoDetector.cpp 2008-03-11 08:52:59.000000000 +0000 X@@ -26,7 +26,7 @@ X _sieve1Width(10), _sieve1Height(10), _sieve1Size(10), X _kdTreeSearchSteps(40), _kdTreeSecondDistance(0.15), _sieve2Width(5), _sieve2Height(5), X _sieve2Size(1), _test(false), _cores(utils::getCPUCount()), _ransacIters(1000), _ransacDistanceThres(25), X- _minimumMatches(4), _linearMatch(false), _linearMatchLen(1), _downscale(true) X+ _minimumMatches(4), _linearMatch(false), _linearMatchLen(1), _scale(0.5) X { X X } X@@ -67,7 +67,7 @@ X cout << "Output file : " << _outputFile << endl; X cout << "Number of CPU : " << _cores << endl << endl; X cout << "Input image options" << endl; X- cout << " Downscale to half-size : " << (_downscale?"yes":"no") << endl; X+ cout << " Scale factor : " << _scale << endl; X cout << "SURF Options" << endl; X cout << " Extended : " << (_extendedSurf?"yes":"no") << endl; X cout << " Score threshold : " << _surfScoreThreshold << endl; END-of-graphics/panomatic/files/patch-panomatic-PanoDetector.cpp echo x - graphics/panomatic/files/patch-panomatic-PanoDetector.h sed 's/^X//' >graphics/panomatic/files/patch-panomatic-PanoDetector.h << 'END-of-graphics/panomatic/files/patch-panomatic-PanoDetector.h' X--- panomatic/PanoDetector.h.orig 2008-03-10 20:17:33.000000000 +0000 X+++ panomatic/PanoDetector.h 2008-03-11 08:52:59.000000000 +0000 X@@ -84,8 +84,8 @@ X inline bool getLinearMatch() const { return _linearMatch; } X inline int getLinearMatchLen() const { return _linearMatchLen; } X X- inline bool getDownscale() const { return _downscale; } X- inline void setDownscale(bool iDown) { _downscale = iDown; } X+ inline float getScale() const { return _scale; } X+ inline void setScale(float iScale) { _scale = iScale; } X X X inline void addFile(const std::string& iFile) { _files.push_back(iFile); } X@@ -126,7 +126,7 @@ X X bool _test; X int _cores; X- bool _downscale; X+ float _scale; X X // list of files X FileNameList_t _files; END-of-graphics/panomatic/files/patch-panomatic-PanoDetector.h echo x - graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp sed 's/^X//' >graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp << 'END-of-graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp' X--- panomatic/PanoDetectorLogic.cpp.orig 2008-03-10 20:17:33.000000000 +0000 X+++ panomatic/PanoDetectorLogic.cpp 2008-03-11 08:52:59.000000000 +0000 X@@ -98,25 +98,27 @@ X X int aNewImgWidth = aImageInfo.width(); X int aNewImgHeight = aImageInfo.height(); X+ float scale = iPanoDetector.getScale(); X X- if (iPanoDetector.getDownscale()) X+ if (scale != 1.) X { X- aNewImgWidth >>= 1; X- aNewImgHeight >>= 1; X+ aNewImgWidth = (int)(aNewImgWidth * scale); X+ aNewImgHeight = (int)(aNewImgHeight * scale); X } X X vigra::DImage aImageDouble(aNewImgWidth, aNewImgHeight); X X if(aImageInfo.isGrayscale()) X { X- if (iPanoDetector.getDownscale()) X+ if (scale != 1.) X { X TRACE_IMG("Load greyscale..."); X vigra::DImage aImageG(aImageInfo.width(), aImageInfo.height()); X importImage(aImageInfo, destImage(aImageG)); X- vigra::resizeImageNoInterpolation( X+ TRACE_IMG("Resize greyscale witn factor " << scale << " ..."); X+ vigra::resizeImageLinearInterpolation( X aImageG.upperLeft(), X- aImageG.upperLeft() + vigra::Diff2D(aNewImgWidth * 2, aNewImgHeight * 2), X+ aImageG.upperLeft() + vigra::Diff2D((int)(aNewImgWidth / scale), (int)(aNewImgHeight / scale)), X vigra::DImage::Accessor(), X aImageDouble.upperLeft(), X aImageDouble.lowerRight(), X@@ -150,12 +152,12 @@ X return false; X } X X- if (iPanoDetector.getDownscale()) X+ if (scale != 1.) X { X- TRACE_IMG("Resize to greyscale double..."); X- vigra::resizeImageNoInterpolation( X+ TRACE_IMG("Resize to greyscale witn factor " << scale << " ..."); X+ vigra::resizeImageLinearInterpolation( X aImageRGB.upperLeft(), X- aImageRGB.upperLeft() + vigra::Diff2D(aNewImgWidth * 2, aNewImgHeight * 2), X+ aImageRGB.upperLeft() + vigra::Diff2D((int)(aNewImgWidth / scale), (int)(aNewImgHeight / scale)), X vigra::RGBToGrayAccessor<vigra::RGBValue<double> >(), X aImageDouble.upperLeft(), X aImageDouble.lowerRight(), X@@ -390,7 +392,7 @@ X X if (iPanoDetector.getTest()) X TestCode::drawRansacMatches(ioMatchData._i1_name, ioMatchData._i2_name, ioMatchData._matches, X- aRemovedMatches, aRansacFilter, iPanoDetector.getDownscale()); X+ aRemovedMatches, aRansacFilter, iPanoDetector.getScale()); X X return true; X X@@ -502,12 +504,13 @@ X BOOST_FOREACH(PointMatchPtr& aPM, aM._matches) X { X aOut << "c n" << aN1 << " N" << aN2 << " "; X- if (getDownscale()) X+ float scale = getScale(); X+ if (scale != 1.) X { X- aOut << "x" << 2.0 * aPM->_img1_x << " "; X- aOut << "y" << 2.0 * aPM->_img1_y << " "; X- aOut << "X" << 2.0 * aPM->_img2_x << " "; X- aOut << "Y" << 2.0 * aPM->_img2_y << " "; X+ aOut << "x" << aPM->_img1_x / scale << " "; X+ aOut << "y" << aPM->_img1_y / scale << " "; X+ aOut << "X" << aPM->_img2_x / scale << " "; X+ aOut << "Y" << aPM->_img2_y / scale << " "; X } X else X { END-of-graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp echo x - graphics/panomatic/files/patch-panomatic-TestCode.cpp sed 's/^X//' >graphics/panomatic/files/patch-panomatic-TestCode.cpp << 'END-of-graphics/panomatic/files/patch-panomatic-TestCode.cpp' X--- panomatic/TestCode.cpp.orig 2008-03-10 20:17:33.000000000 +0000 X+++ panomatic/TestCode.cpp 2008-03-11 08:52:59.000000000 +0000 X@@ -88,13 +88,10 @@ X } X X void TestCode::drawRansacMatches(std::string& i1, std::string& i2, X- PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, bool iHalf) X+ PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, float iScale) X { X- double aDoubleFactor = 1.0; X- if (iHalf) X- aDoubleFactor = 2.0; X+ double aDoubleFactor = 1.0 / iScale; X X- X std::cout << "writing file outcomp.png ..." << endl; X X // write a side by side image with match pairs and END-of-graphics/panomatic/files/patch-panomatic-TestCode.cpp echo x - graphics/panomatic/files/patch-panomatic-TestCode.h sed 's/^X//' >graphics/panomatic/files/patch-panomatic-TestCode.h << 'END-of-graphics/panomatic/files/patch-panomatic-TestCode.h' X--- panomatic/TestCode.h.orig 2008-03-05 21:12:18.000000000 +0000 X+++ panomatic/TestCode.h 2008-03-11 08:52:59.000000000 +0000 X@@ -29,7 +29,7 @@ X { X public: X static void drawRansacMatches(std::string& i1, std::string& i2, X- PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, bool iHalf); X+ PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, float iScale); X X X END-of-graphics/panomatic/files/patch-panomatic-TestCode.h echo x - graphics/panomatic/files/patch-panomatic-main.cpp sed 's/^X//' >graphics/panomatic/files/patch-panomatic-main.cpp << 'END-of-graphics/panomatic/files/patch-panomatic-main.cpp' X--- panomatic/main.cpp.orig 2008-03-10 20:19:09.000000000 +0000 X+++ panomatic/main.cpp 2008-03-11 08:56:34.000000000 +0000 X@@ -92,6 +92,7 @@ X MyOutput my; X cmd.setOutput(&my); X X+ ValueArg<float> aArgScale("","scale", "Scale image with factor to detect keypoints (default:0.5)\n", false, 0.5, "float"); X SwitchArg aArgFullScale("","fullscale", "Uses full scale image to detect keypoints (default:false)\n", false); X SwitchArg aArgSurfExtended("","surf128", "Uses extended SURF (128 descriptors) (default:true)", true); X ValueArg<int> aArgSurfScoreThreshold("","surfscore", "SURF Detection score threshold (default : 1000)\n", false, 1000, "int"); X@@ -130,6 +131,7 @@ X cmd.add(aArgSurfScoreThreshold); X cmd.add(aArgSurfExtended); X cmd.add(aArgFullScale); X+ cmd.add(aArgScale); X X //cmd.add( aArgSurfExtended ); X X@@ -175,7 +177,8 @@ X if (aArgSieve2Size.isSet()) ioPanoDetector.setSieve2Size(aArgSieve2Size.getValue()); X if (aArgLinearMatch.isSet()) ioPanoDetector.setLinearMatch(aArgLinearMatch.getValue()); X if (aArgLinearMatchLen.isSet()) ioPanoDetector.setLinearMatchLen(aArgLinearMatchLen.getValue()); X- if (aArgFullScale.isSet()) ioPanoDetector.setDownscale(false); X+ if (aArgFullScale.isSet()) ioPanoDetector.setScale(1.); X+ if (aArgScale.isSet()) ioPanoDetector.setScale(aArgScale.getValue()); X X if (aArgTest.isSet()) ioPanoDetector.setTest(aArgTest.getValue()); X if (aArgCores.isSet()) ioPanoDetector.setCores(aArgCores.getValue()); END-of-graphics/panomatic/files/patch-panomatic-main.cpp exit --- panomatic.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803191025.m2JAPr5i003473>