Commit 68b1696c authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

updated pdp_opencv to make it compile with latest version of libs

parent 37c0cf15
#!/bin/sh
prefix=/usr
prefix=/usr/local
version=0.12.7
usage="\
......
PD_DIR = /Software/pd-svn/trunk/pd
PDP_DIR = /Software/pd-svn/trunk/externals/pdp
PD_DIR = /home/ico/Downloads/PureData/pure-data/pd
PDP_DIR = /home/ico/Downloads/PureData/pure-data/externals/pdp
GEM_OPENCV_VERSION = 0.2
......@@ -13,7 +13,7 @@ CPPFLAGS = -fPIC -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
INCLUDES += `pkg-config --cflags opencv`
LDFLAGS = --export-dynamic -shared
LDFLAGS = -Wl,--export-dynamic -shared
LIBS = `pkg-config --libs opencv`
EXTENSION = pd_linux
endif
......@@ -27,7 +27,7 @@ endif
.SUFFIXES = $(EXTENSION)
SOURCES = pdp_opencv_threshold.cc pdp_opencv_edge.cc pdp_opencv_distrans.cc pdp_opencv_laplace.cc pdp_opencv_motempl.cc pdp_opencv_morphology.cc pdp_opencv_haarcascade.cc pdp_opencv_contours_convexity.cc pdp_opencv_contours_boundingrect.cc pdp_opencv_bgsubstract.cc pdp_opencv_lk.cc pdp_opencv_floodfill.cc pdp_opencv_hist_compare.cc pdp_opencv_dft.cc pdp_opencv_knear.cc pdp_opencv_hu_moments.cc pdp_opencv_hu_compare.cc pdp_opencv_pgh_compare.cc pdp_opencv_bgstats.cc pdp_opencv_athreshold.cc pdp_opencv_hough_lines.cc pdp_opencv_channels.cc pdp_opencv_hough_circles.cc pdp_opencv_camshift.cc pdp_opencv_colorfilt.cc pdp_opencv_contours_convexhull.cc pdp_opencv_of_bm.cc pdp_opencv_of_hs.cc pdp_opencv_of_lk.cc pdp_opencv_smooth.cc
SOURCES_OPT = pdp_opencv_surf.cc
SOURCES_OPT =
all: $(SOURCES:.c=.$(EXTENSION)) $(SOURCES:.cc=.$(EXTENSION)) $(SOURCES_OPT:.c=.$(EXTENSION)) $(SOURCES_OPT:.cc=.$(EXTENSION))
......
......@@ -13,7 +13,7 @@ CPPFLAGS = -fPIC -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
INCLUDES += `pkg-config --cflags opencv`
LDFLAGS = --export-dynamic -shared
LDFLAGS = -Wl,--export-dynamic -shared
LIBS = `pkg-config --libs opencv`
EXTENSION = pd_linux
endif
......
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_PREREQ(2.65)
AC_INIT([pdp_opencv],[0.2-rc6-svn],[lluisgomez@hangar.org],[pdp_opencv-dev],[http://www.hangar.org/wikis/lab/doku.php?id=start:puredata_opencv])
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
AC_DISABLE_OPTION_CHECKING
......@@ -69,9 +70,27 @@ AM_SANITY_CHECK
AM_MAINTAINER_MODE
AM_WITH_DMALLOC
AC_CHECK_LIB(cv, cvSobel, , AC_MSG_ERROR(you need to install opencv library (libcv)))
AC_CHECK_LIB(highgui, cvNamedWindow, , AC_MSG_ERROR(you need to install high gui library (libhighgui)))
AC_CHECK_LIB(cvaux, cvSegmentImage, , AC_MSG_ERROR(you need to install opencv auxiliary library (libcvaux) ))
# Very basic check for OpenCV. This does not collect any compile flags; these
# are currently set in Makefile.in through pkg-config
# TODO: use a more robust and well-established OpenCV configure approach
AC_CHECK_LIB([cv], [cvSobel], [], [
# try another lib name used in other versions of OpenCV
AC_CHECK_LIB([opencv_imgproc], [cvSobel], [],
[AC_MSG_ERROR([[missing a library from opencv try installing libcv]])
])
])
AC_CHECK_LIB([highgui], [cvNamedWindow], [], [
AC_CHECK_LIB([opencv_highgui], [cvNamedWindow], [], [
AC_MSG_ERROR([[missing a library from opencv, try installing libhighgui]])
])
])
AC_CHECK_LIB([cvaux], [cvSegmentImage], [], [
AC_CHECK_LIB([opencv_legacy], [cvSegmentImage], [], [
AC_MSG_ERROR([[missing a library from opencv try installing libcvaux]])
])
])
echo -n "looking for pd sources (required) ... "
if test -f $PD_DIR/src/m_pd.h
......
......@@ -229,11 +229,6 @@ static void pdp_opencv_contours_boundingrect_process_rgb(t_pdp_opencv_contours_b
if ( odist < dist )
{
oi=im;
x->x_xmark[oi] = (float)(rect.x+rect.width/2);
x->x_ymark[oi] = (float)(rect.y+rect.height/2);
x->x_wmark[oi] = (int)rect.width;
x->x_hmark[oi] = (int)rect.height;
x->x_found[oi] = x->x_ftolerance;
dist=odist;
}
}
......@@ -247,6 +242,11 @@ static void pdp_opencv_contours_boundingrect_process_rgb(t_pdp_opencv_contours_b
else
{
// post( "contour found : %d", oi );
x->x_xmark[oi] = (float)(rect.x+rect.width/2);
x->x_ymark[oi] = (float)(rect.y+rect.height/2);
x->x_wmark[oi] = (int)rect.width;
x->x_hmark[oi] = (int)rect.height;
x->x_found[oi] = x->x_ftolerance;
}
if ( x->x_draw )
......
......@@ -35,7 +35,7 @@
#include "pdp.h"
#include "cv.h"
#include "highgui.h"
#include <opencv2/highgui/highgui_c.h>
#include "ml.h"
typedef struct pdp_opencv_knear_struct
......
......@@ -25,11 +25,13 @@
#include <limits.h>
#include <dlfcn.h>
#include <ctype.h>
#include <cvaux.h>
#include "pdp.h"
#ifndef _EiC
#include "cv.h"
#include <opencv2/highgui/highgui_c.h>
#endif
#define MAX_MARKERS 500
......@@ -171,9 +173,9 @@ static void pdp_opencv_lk_process_rgb(t_pdp_opencv_lk *x)
x->count = MAX_COUNT;
cvGoodFeaturesToTrack( x->grey, eig, temp, x->points[1], &x->count,
x->quality, x->min_distance, 0, 3, 0, 0.04 );
cvFindCornerSubPix( x->grey, x->points[1], x->count,
cvSize(x->win_size,x->win_size), cvSize(-1,-1),
cvTermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS,20,0.03));
// cvFindCornerSubPix( x->grey, x->points[1], x->count,
// cvSize(x->win_size,x->win_size), cvSize(-1,-1),
// cvTermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS,20,0.03));
cvReleaseImage( &eig );
cvReleaseImage( &temp );
......
......@@ -26,6 +26,7 @@
#include <dlfcn.h>
#include <ctype.h>
#include <math.h>
#include <cvaux.h>
#include "pdp.h"
......
......@@ -28,6 +28,7 @@
#include <dlfcn.h>
#include <ctype.h>
#include <math.h>
#include <cvaux.h>
#include "pdp.h"
......
......@@ -28,6 +28,7 @@
#include <dlfcn.h>
#include <ctype.h>
#include <math.h>
#include <cvaux.h>
#include "pdp.h"
......
......@@ -30,6 +30,7 @@
#ifndef _EiC
#include "cv.h"
#include "cvaux.h"
#endif
typedef struct pdp_opencv_pgh_compare_struct
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment