aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN.N. <sevyves@users.sourceforge.net>2009-08-15 16:01:08 +0000
committerN.N. <sevyves@users.sourceforge.net>2009-08-15 16:01:08 +0000
commit3eca5353025abcded8bf8e009945260dcbad677e (patch)
treec40afd0ef752047ee8ada4d88b1624e8c64629fc
parent65fede5d18e7e4004c36991dc21dbf6273f9f0af (diff)
fixed threshold
svn path=/trunk/externals/pix_opencv/; revision=11926
-rw-r--r--INSTALL2
-rw-r--r--Makefile4
-rwxr-xr-xpix_opencv_threshold-help.pd4
-rw-r--r--pix_opencv_threshold.cc12
-rw-r--r--pix_opencv_threshold.h5
5 files changed, 13 insertions, 14 deletions
diff --git a/INSTALL b/INSTALL
index 0c4d94f..e747357 100644
--- a/INSTALL
+++ b/INSTALL
@@ -60,5 +60,5 @@ then, compile it ::
and copy the .pd_darwin to your externals folder ::
- cp *.pd_darwin /Applications/Pd-0.40.3-extended-20080315.app/Contents/Resources/extra/Gem/ for exemple
+ cp *.pd_darwin /Applications/Pd-0.40.3-extended-20080315.app/Contents/Resources/extra/Gem/ for example
diff --git a/Makefile b/Makefile
index ef1a5a0..8fc259e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-PD_DIR = ../../pd
-GEM_DIR = ../../Gem
+PD_DIR = ../pd
+GEM_DIR = ../gem
GEM_OPENCV_VERSION = 0.1
diff --git a/pix_opencv_threshold-help.pd b/pix_opencv_threshold-help.pd
index 3cc6664..f924aea 100755
--- a/pix_opencv_threshold-help.pd
+++ b/pix_opencv_threshold-help.pd
@@ -76,8 +76,8 @@
);
#X text 398 59 used as a filter to detect bright or dark piksels;
#X text 399 46 pix_opencv_threshold : pixel thresholding;
-#X msg 187 59 colorspace RGBA;
#X text 339 360 ( default 50 );
+#X msg 187 58 colorspace Grey;
#X connect 0 0 19 0;
#X connect 1 0 2 0;
#X connect 4 0 5 0;
@@ -109,4 +109,4 @@
#X connect 32 0 26 0;
#X connect 33 0 26 0;
#X connect 41 0 1 0;
-#X connect 45 0 19 0;
+#X connect 46 0 19 0;
diff --git a/pix_opencv_threshold.cc b/pix_opencv_threshold.cc
index 2a353c4..bf1af10 100644
--- a/pix_opencv_threshold.cc
+++ b/pix_opencv_threshold.cc
@@ -46,10 +46,10 @@ pix_opencv_threshold :: pix_opencv_threshold()
/////////////////////////////////////////////////////////
pix_opencv_threshold :: ~pix_opencv_threshold()
{
- //Destroy cv_images to clean memory
- cvReleaseImage(&orig);
- cvReleaseImage(&gray);
- cvReleaseImage(&rgb);
+ //Destroy cv_images to clean memory
+ cvReleaseImage(&orig);
+ cvReleaseImage(&gray);
+ cvReleaseImage(&rgb);
}
/////////////////////////////////////////////////////////
@@ -214,11 +214,11 @@ void pix_opencv_threshold :: processGrayImage(imageStruct &image)
/////////////////////////////////////////////////////////
void pix_opencv_threshold :: floatMaxMess (float maxvalue)
{
- if ( (int)maxvalue>0 ) this->max_value = (int)maxvalue;
+ if ( (int)maxvalue>0 ) this->max_value = maxvalue;
}
void pix_opencv_threshold :: floatThreshMess (float edge_thresh)
{
- this->edge_thresh = (int)edge_thresh;
+ this->threshold_value = edge_thresh;
}
void pix_opencv_threshold :: floatModeMess (float mode)
{
diff --git a/pix_opencv_threshold.h b/pix_opencv_threshold.h
index 7d45ffb..66286cf 100644
--- a/pix_opencv_threshold.h
+++ b/pix_opencv_threshold.h
@@ -65,14 +65,13 @@ class GEM_EXTERN pix_opencv_threshold : public GemPixObj
void floatModeMess(float mode);
// The new edge threshold
- int threshold_value;
- int max_value;
+ float threshold_value;
+ float max_value;
int threshold_mode;
// to detect changes in the image size
int comp_xsize;
int comp_ysize;
- float edge_thresh;
private: