|
From: <ale...@us...> - 2009-07-24 21:25:29
|
Revision: 19620
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19620&view=rev
Author: alexteichman
Date: 2009-07-24 21:25:18 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
Robustifying the daisy makefile.
Modified Paths:
--------------
pkg/trunk/3rdparty/daisy/Makefile
pkg/trunk/3rdparty/daisy/manifest.xml
pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp
Modified: pkg/trunk/3rdparty/daisy/Makefile
===================================================================
--- pkg/trunk/3rdparty/daisy/Makefile 2009-07-24 21:23:12 UTC (rev 19619)
+++ pkg/trunk/3rdparty/daisy/Makefile 2009-07-24 21:25:18 UTC (rev 19620)
@@ -1,16 +1,22 @@
-all: installed
+all: daisy
+ifneq ($(wildcard daisy_makefile),) #Clean up cruft from previous makefile.
+ ls | grep -v Makefile | grep -v Makefile.old | grep -v makefile.patch | grep -v manifest.xml | grep -v build | xargs rm -r; fi
+endif
+TARBALL = build/daisy-1.7.0.tar.gz
+TARBALL_URL = http://cvlab.epfl.ch/~tola/research/08/daisy/daisy-1.7.0.tar.gz
+SOURCE_DIR = build/daisy-1.7.0
+TARBALL_PATCH = makefile.patch
+include $(shell rospack find mk)/download_unpack_build.mk
-installed:
- wget http://cvlab.epfl.ch/~tola/research/08/daisy/daisy-1.7.0.tar.gz
- tar xvzf daisy-1.7.0.tar.gz
- mv daisy-1.7.0/* .
- rm -rf daisy-1.7.0
- patch makefile < makefile.patch
- mv makefile daisy_makefile
- make -f daisy_makefile slib
- touch installed
+daisy: $(SOURCE_DIR)/unpacked
+ifeq ($(wildcard $(SOURCE_DIR)/lib/libdaisy.so),)
+ cd $(SOURCE_DIR) && make -f makefile slib
+endif
clean:
- ls | grep -v Makefile | grep -v patch | grep -v manifest.xml | xargs rm -r
\ No newline at end of file
+ -rm -rf $(SOURCE_DIR)
+
+wipe: clean
+ -rm -rf build
Modified: pkg/trunk/3rdparty/daisy/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/daisy/manifest.xml 2009-07-24 21:23:12 UTC (rev 19619)
+++ pkg/trunk/3rdparty/daisy/manifest.xml 2009-07-24 21:25:18 UTC (rev 19620)
@@ -9,7 +9,7 @@
<review status="unreviewed" notes=""/>
<url>http://cvlab.epfl.ch/~tola/daisy.html</url>
<export>
- <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -ldaisy -Wl,-rpath,${prefix}/lib" />
+ <cpp cflags="-I${prefix}/build/daisy-1.7.0/include/" lflags="-L${prefix}/build/daisy-1.7.0/lib/ -ldaisy -Wl,-rpath,${prefix}/build/daisy-1.7.0/lib/" />
</export>
</package>
Modified: pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp
===================================================================
--- pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp 2009-07-24 21:23:12 UTC (rev 19619)
+++ pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp 2009-07-24 21:25:18 UTC (rev 19620)
@@ -23,6 +23,9 @@
dai.set_parameters(rad_, rad_q_no_, th_q_no_, hist_th_q_no_);
dai.set_normalization(NRM_FULL);
dai.initialize_single_descriptor_mode();
+ int ws = dai.compute_workspace_memory();
+ float* workspace = new float[ ws ];
+ dai.set_workspace_memory( workspace, ws);
result_size_ = dai.descriptor_size();
}
@@ -33,23 +36,23 @@
void Daisy::compute(IplImage* img, const cv::Vector<Keypoint>& points, vvf& results) {
// -- Stupid way to pass img to daisy.
+ char filename[] = "temp.pgm";
IplImage* gray = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1);
cvCvtColor(img, gray, CV_BGR2GRAY);
- cvSaveImage("temp.png", gray);
+ cvSaveImage(filename, gray);
uchar* im = NULL;
- load_gray_image("temp.png", im, img->height, img->width);
+ load_gray_image(filename, im, img->height, img->width);
dai.set_image(im, img->height, img->width);
results.clear();
results.resize(points.size());
- int orientation = 0;
int nValid = 0;
for(size_t i=0; i<points.size(); ++i) {
// -- Get the descriptor.
float* thor = new float[result_size_];
memset(thor, 0, sizeof(float)*result_size_);
- dai.get_descriptor(points[i].pt.y, points[i].pt.x, orientation, thor);
+ dai.get_descriptor((int)points[i].pt.y, (int)points[i].pt.x, thor);
// -- Check if it's all zeros.
bool valid = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|