aboutsummaryrefslogtreecommitdiff
path: root/graphics/panomatic
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2008-04-26 20:24:03 +0000
committerMartin Wilke <miwi@FreeBSD.org>2008-04-26 20:24:03 +0000
commitcdd73bb9c473de2752feaf1af1c5216c321cd631 (patch)
tree10749cb9e9ff651da19e00499e638480c2e46317 /graphics/panomatic
parent70cff39f48bc0ce89cb5ea50acffe3f04f2f4633 (diff)
downloadports-cdd73bb9c473de2752feaf1af1c5216c321cd631.tar.gz
ports-cdd73bb9c473de2752feaf1af1c5216c321cd631.zip
Pan-o-matic is a tool that automates the creation of control points in Hugin.
WWW: http://aorlinsk2.free.fr/panomatic/ PR: ports/121859 Submitted by: Iouri V. Ivliev <ii@any.com.ru>
Notes
Notes: svn path=/head/; revision=212049
Diffstat (limited to 'graphics/panomatic')
-rw-r--r--graphics/panomatic/Makefile27
-rw-r--r--graphics/panomatic/distinfo3
-rw-r--r--graphics/panomatic/files/patch-panomatic-PanoDetector.cpp22
-rw-r--r--graphics/panomatic/files/patch-panomatic-PanoDetector.h22
-rw-r--r--graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp81
-rw-r--r--graphics/panomatic/files/patch-panomatic-TestCode.cpp18
-rw-r--r--graphics/panomatic/files/patch-panomatic-TestCode.h11
-rw-r--r--graphics/panomatic/files/patch-panomatic-main.cpp22
-rw-r--r--graphics/panomatic/pkg-descr3
9 files changed, 209 insertions, 0 deletions
diff --git a/graphics/panomatic/Makefile b/graphics/panomatic/Makefile
new file mode 100644
index 000000000000..5f479d09ca1a
--- /dev/null
+++ b/graphics/panomatic/Makefile
@@ -0,0 +1,27 @@
+# New ports collection makefile for: panomatic
+# Date created: Fri Mar 7 11:06:34 UTC 2008
+# Whom: argv[0] (Iouri V. Ivliev)
+#
+# $FreeBSD$
+
+PORTNAME= panomatic
+PORTVERSION= 0.9.4
+CATEGORIES= graphics
+MASTER_SITES= http://people.esterdev.com/yury/bicycles/
+DISTNAME= ${PORTNAME}-${PORTVERSION}-src
+
+MAINTAINER= ii@any.com.ru
+COMMENT= A tool that automates the creation of control points
+
+BUILD_DEPENDS= bjam:${PORTSDIR}/devel/boost
+
+GNU_CONFIGURE= yes
+CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+USE_BZIP2= yes
+USE_GMAKE= yes
+
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+
+PLIST_FILES= bin/panomatic
+
+.include <bsd.port.mk>
diff --git a/graphics/panomatic/distinfo b/graphics/panomatic/distinfo
new file mode 100644
index 000000000000..250bfccf966b
--- /dev/null
+++ b/graphics/panomatic/distinfo
@@ -0,0 +1,3 @@
+MD5 (panomatic-0.9.4-src.tar.bz2) = 0b08a4f7e1b4ecaf6ae364779a01da07
+SHA256 (panomatic-0.9.4-src.tar.bz2) = 9673c23d09783a526d09d54327f2ea32dfff053629411939cfca223fe690d36d
+SIZE (panomatic-0.9.4-src.tar.bz2) = 1598683
diff --git a/graphics/panomatic/files/patch-panomatic-PanoDetector.cpp b/graphics/panomatic/files/patch-panomatic-PanoDetector.cpp
new file mode 100644
index 000000000000..3312d71e7aaa
--- /dev/null
+++ b/graphics/panomatic/files/patch-panomatic-PanoDetector.cpp
@@ -0,0 +1,22 @@
+--- panomatic/PanoDetector.cpp.orig 2008-03-10 21:17:33.000000000 +0100
++++ panomatic/PanoDetector.cpp 2008-04-26 20:15:44.000000000 +0200
+@@ -26,7 +26,7 @@
+ _sieve1Width(10), _sieve1Height(10), _sieve1Size(10),
+ _kdTreeSearchSteps(40), _kdTreeSecondDistance(0.15), _sieve2Width(5), _sieve2Height(5),
+ _sieve2Size(1), _test(false), _cores(utils::getCPUCount()), _ransacIters(1000), _ransacDistanceThres(25),
+- _minimumMatches(4), _linearMatch(false), _linearMatchLen(1), _downscale(true)
++ _minimumMatches(4), _linearMatch(false), _linearMatchLen(1), _scale(0.5)
+ {
+
+ }
+@@ -67,8 +67,8 @@
+ cout << "Output file : " << _outputFile << endl;
+ cout << "Number of CPU : " << _cores << endl << endl;
+ cout << "Input image options" << endl;
+- cout << " Downscale to half-size : " << (_downscale?"yes":"no") << endl;
+- cout << "SURF Options" << endl;
++ cout << " Scale factor : " << _scale << endl;
++ cout << "SURF Options" << endl;
+ cout << " Extended : " << (_extendedSurf?"yes":"no") << endl;
+ cout << " Score threshold : " << _surfScoreThreshold << endl;
+ cout << "Sieve 1 Options" << endl;
diff --git a/graphics/panomatic/files/patch-panomatic-PanoDetector.h b/graphics/panomatic/files/patch-panomatic-PanoDetector.h
new file mode 100644
index 000000000000..3a7bc1ac647e
--- /dev/null
+++ b/graphics/panomatic/files/patch-panomatic-PanoDetector.h
@@ -0,0 +1,22 @@
+--- panomatic/PanoDetector.h.orig 2008-03-10 21:17:33.000000000 +0100
++++ panomatic/PanoDetector.h 2008-04-26 20:20:01.000000000 +0200
+@@ -84,8 +84,8 @@
+ inline bool getLinearMatch() const { return _linearMatch; }
+ inline int getLinearMatchLen() const { return _linearMatchLen; }
+
+- inline bool getDownscale() const { return _downscale; }
+- inline void setDownscale(bool iDown) { _downscale = iDown; }
++ inline float getScale() const { return _scale; }
++ inline void setScale(float iScale) { _scale = iScale; }
+
+
+ inline void addFile(const std::string& iFile) { _files.push_back(iFile); }
+@@ -126,7 +126,7 @@
+
+ bool _test;
+ int _cores;
+- bool _downscale;
++ float _scale;
+
+ // list of files
+ FileNameList_t _files;
diff --git a/graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp b/graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp
new file mode 100644
index 000000000000..82d2d8a9f37f
--- /dev/null
+++ b/graphics/panomatic/files/patch-panomatic-PanoDetectorLogic.cpp
@@ -0,0 +1,81 @@
+--- panomatic/PanoDetectorLogic.cpp.orig 2008-03-10 20:17:33.000000000 +0000
++++ panomatic/PanoDetectorLogic.cpp 2008-03-11 08:52:59.000000000 +0000
+@@ -98,25 +98,27 @@
+
+ int aNewImgWidth = aImageInfo.width();
+ int aNewImgHeight = aImageInfo.height();
++ float scale = iPanoDetector.getScale();
+
+- if (iPanoDetector.getDownscale())
++ if (scale != 1.)
+ {
+- aNewImgWidth >>= 1;
+- aNewImgHeight >>= 1;
++ aNewImgWidth = (int)(aNewImgWidth * scale);
++ aNewImgHeight = (int)(aNewImgHeight * scale);
+ }
+
+ vigra::DImage aImageDouble(aNewImgWidth, aNewImgHeight);
+
+ if(aImageInfo.isGrayscale())
+ {
+- if (iPanoDetector.getDownscale())
++ if (scale != 1.)
+ {
+ TRACE_IMG("Load greyscale...");
+ vigra::DImage aImageG(aImageInfo.width(), aImageInfo.height());
+ importImage(aImageInfo, destImage(aImageG));
+- vigra::resizeImageNoInterpolation(
++ TRACE_IMG("Resize greyscale witn factor " << scale << " ...");
++ vigra::resizeImageLinearInterpolation(
+ aImageG.upperLeft(),
+- aImageG.upperLeft() + vigra::Diff2D(aNewImgWidth * 2, aNewImgHeight * 2),
++ aImageG.upperLeft() + vigra::Diff2D((int)(aNewImgWidth / scale), (int)(aNewImgHeight / scale)),
+ vigra::DImage::Accessor(),
+ aImageDouble.upperLeft(),
+ aImageDouble.lowerRight(),
+@@ -150,12 +152,12 @@
+ return false;
+ }
+
+- if (iPanoDetector.getDownscale())
++ if (scale != 1.)
+ {
+- TRACE_IMG("Resize to greyscale double...");
+- vigra::resizeImageNoInterpolation(
++ TRACE_IMG("Resize to greyscale witn factor " << scale << " ...");
++ vigra::resizeImageLinearInterpolation(
+ aImageRGB.upperLeft(),
+- aImageRGB.upperLeft() + vigra::Diff2D(aNewImgWidth * 2, aNewImgHeight * 2),
++ aImageRGB.upperLeft() + vigra::Diff2D((int)(aNewImgWidth / scale), (int)(aNewImgHeight / scale)),
+ vigra::RGBToGrayAccessor<vigra::RGBValue<double> >(),
+ aImageDouble.upperLeft(),
+ aImageDouble.lowerRight(),
+@@ -390,7 +392,7 @@
+
+ if (iPanoDetector.getTest())
+ TestCode::drawRansacMatches(ioMatchData._i1_name, ioMatchData._i2_name, ioMatchData._matches,
+- aRemovedMatches, aRansacFilter, iPanoDetector.getDownscale());
++ aRemovedMatches, aRansacFilter, iPanoDetector.getScale());
+
+ return true;
+
+@@ -502,12 +504,13 @@
+ BOOST_FOREACH(PointMatchPtr& aPM, aM._matches)
+ {
+ aOut << "c n" << aN1 << " N" << aN2 << " ";
+- if (getDownscale())
++ float scale = getScale();
++ if (scale != 1.)
+ {
+- aOut << "x" << 2.0 * aPM->_img1_x << " ";
+- aOut << "y" << 2.0 * aPM->_img1_y << " ";
+- aOut << "X" << 2.0 * aPM->_img2_x << " ";
+- aOut << "Y" << 2.0 * aPM->_img2_y << " ";
++ aOut << "x" << aPM->_img1_x / scale << " ";
++ aOut << "y" << aPM->_img1_y / scale << " ";
++ aOut << "X" << aPM->_img2_x / scale << " ";
++ aOut << "Y" << aPM->_img2_y / scale << " ";
+ }
+ else
+ {
diff --git a/graphics/panomatic/files/patch-panomatic-TestCode.cpp b/graphics/panomatic/files/patch-panomatic-TestCode.cpp
new file mode 100644
index 000000000000..2146241344b4
--- /dev/null
+++ b/graphics/panomatic/files/patch-panomatic-TestCode.cpp
@@ -0,0 +1,18 @@
+--- panomatic/TestCode.cpp.orig 2008-03-10 20:17:33.000000000 +0000
++++ panomatic/TestCode.cpp 2008-03-11 08:52:59.000000000 +0000
+@@ -88,13 +88,10 @@
+ }
+
+ void TestCode::drawRansacMatches(std::string& i1, std::string& i2,
+- PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, bool iHalf)
++ PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, float iScale)
+ {
+- double aDoubleFactor = 1.0;
+- if (iHalf)
+- aDoubleFactor = 2.0;
++ double aDoubleFactor = 1.0 / iScale;
+
+-
+ std::cout << "writing file outcomp.png ..." << endl;
+
+ // write a side by side image with match pairs and
diff --git a/graphics/panomatic/files/patch-panomatic-TestCode.h b/graphics/panomatic/files/patch-panomatic-TestCode.h
new file mode 100644
index 000000000000..f8ab02ef1ac4
--- /dev/null
+++ b/graphics/panomatic/files/patch-panomatic-TestCode.h
@@ -0,0 +1,11 @@
+--- panomatic/TestCode.h.orig 2008-03-05 22:12:18.000000000 +0100
++++ panomatic/TestCode.h 2008-04-26 20:21:56.000000000 +0200
+@@ -29,7 +29,7 @@
+ {
+ public:
+ static void drawRansacMatches(std::string& i1, std::string& i2,
+- PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, bool iHalf);
++ PointMatchVector_t& iOK, PointMatchVector_t& iNOK, Ransac& iRansac, float iScale);
+
+
+
diff --git a/graphics/panomatic/files/patch-panomatic-main.cpp b/graphics/panomatic/files/patch-panomatic-main.cpp
new file mode 100644
index 000000000000..f25f34dc29ea
--- /dev/null
+++ b/graphics/panomatic/files/patch-panomatic-main.cpp
@@ -0,0 +1,22 @@
+--- panomatic/main.cpp.orig 2008-03-10 21:19:09.000000000 +0100
++++ panomatic/main.cpp 2008-04-26 20:26:30.000000000 +0200
+@@ -92,6 +92,7 @@
+ MyOutput my;
+ cmd.setOutput(&my);
+
++ ValueArg<float> aArgScale("","scale", "Scale image with factor to detect keypoints (default:0.5)\n", false, 0.5, "float");
+ SwitchArg aArgFullScale("","fullscale", "Uses full scale image to detect keypoints (default:false)\n", false);
+ SwitchArg aArgSurfExtended("","surf128", "Uses extended SURF (128 descriptors) (default:true)", true);
+ ValueArg<int> aArgSurfScoreThreshold("","surfscore", "SURF Detection score threshold (default : 1000)\n", false, 1000, "int");
+@@ -175,8 +176,9 @@
+ if (aArgSieve2Size.isSet()) ioPanoDetector.setSieve2Size(aArgSieve2Size.getValue());
+ if (aArgLinearMatch.isSet()) ioPanoDetector.setLinearMatch(aArgLinearMatch.getValue());
+ if (aArgLinearMatchLen.isSet()) ioPanoDetector.setLinearMatchLen(aArgLinearMatchLen.getValue());
+- if (aArgFullScale.isSet()) ioPanoDetector.setDownscale(false);
+-
++ if (aArgFullScale.isSet()) ioPanoDetector.setScale(1.);
++ if (aArgScale.isSet()) ioPanoDetector.setScale(aArgScale.getValue());
++
+ if (aArgTest.isSet()) ioPanoDetector.setTest(aArgTest.getValue());
+ if (aArgCores.isSet()) ioPanoDetector.setCores(aArgCores.getValue());
+
diff --git a/graphics/panomatic/pkg-descr b/graphics/panomatic/pkg-descr
new file mode 100644
index 000000000000..f16b971ce800
--- /dev/null
+++ b/graphics/panomatic/pkg-descr
@@ -0,0 +1,3 @@
+Pan-o-matic is a tool that automates the creation of control points in Hugin.
+
+WWW: http://aorlinsk2.free.fr/panomatic/