1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

remove wastes

This commit is contained in:
ser1zw 2012-07-15 02:53:06 +09:00
parent 11b07a3097
commit 35537b6248

View file

@ -564,8 +564,9 @@ rb_decode_imageM(int argc, VALUE *argv, VALUE self)
need_release = 1;
try {
buff = rb_cvCreateMat(1, cols, CV_8UC1);
VALUE *ary_ptr = RARRAY_PTR(_buff);
for (int i = 0; i < cols; i++) {
CV_MAT_ELEM(*buff, char, 0, i) = NUM2CHR(RARRAY_PTR(_buff)[i]);
CV_MAT_ELEM(*buff, char, 0, i) = NUM2CHR(ary_ptr[i]);
}
}
catch (cv::Exception& e) {
@ -585,7 +586,6 @@ rb_decode_imageM(int argc, VALUE *argv, VALUE self)
CvMat* mat_ptr = NULL;
try {
mat_ptr = cvDecodeImageM(buff, iscolor);
// mat = cvDecodeImage();
if (need_release) {
cvReleaseMat(&buff);
}