diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee11562 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +examples/data +*.o +Makefile +mkmf.log +opencv.bundle \ No newline at end of file diff --git a/ext/iplimage.cpp b/ext/iplimage.cpp index a109576..fe7d323 100644 --- a/ext/iplimage.cpp +++ b/ext/iplimage.cpp @@ -88,7 +88,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "22", &width, &height, &depth, &channel); int _depth = argc < 3 ? CV_8U : FIX2INT(depth); int _channel = argc < 4 ? 3 : FIX2INT(channel); - DATA_PTR(self) = cvCreateImage(cvSize(FIX2INT(width), FIX2INT(height)), cvCvToIplDepth(_depth), _channel); + DATA_PTR(self) = cvCreateImage(cvSize(FIX2INT(width), FIX2INT(height)), cvIplDepth(_depth), _channel); return self; } @@ -225,13 +225,13 @@ rb_reset_coi(VALUE self) VALUE new_object(int width, int height, int type) { - return OPENCV_OBJECT(rb_klass, cvCreateImage(cvSize(width, height), cvCvToIplDepth(type), CV_MAT_CN(type))); + return OPENCV_OBJECT(rb_klass, cvCreateImage(cvSize(width, height), cvIplDepth(type), CV_MAT_CN(type))); } VALUE new_object(CvSize size, int type) { - return OPENCV_OBJECT(rb_klass, cvCreateImage(size, cvCvToIplDepth(type), CV_MAT_CN(type))); + return OPENCV_OBJECT(rb_klass, cvCreateImage(size, cvIplDepth(type), CV_MAT_CN(type))); } __NAMESPACE_END_IPLIMAGE diff --git a/ext/opencv.h b/ext/opencv.h index 05bcfef..4e2d077 100644 --- a/ext/opencv.h +++ b/ext/opencv.h @@ -50,6 +50,7 @@ extern "C"{ // OpenCV headers #include +#include #include #include #include