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:
parent
11b07a3097
commit
35537b6248
1 changed files with 2 additions and 2 deletions
|
@ -564,8 +564,9 @@ rb_decode_imageM(int argc, VALUE *argv, VALUE self)
|
||||||
need_release = 1;
|
need_release = 1;
|
||||||
try {
|
try {
|
||||||
buff = rb_cvCreateMat(1, cols, CV_8UC1);
|
buff = rb_cvCreateMat(1, cols, CV_8UC1);
|
||||||
|
VALUE *ary_ptr = RARRAY_PTR(_buff);
|
||||||
for (int i = 0; i < cols; i++) {
|
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) {
|
catch (cv::Exception& e) {
|
||||||
|
@ -585,7 +586,6 @@ rb_decode_imageM(int argc, VALUE *argv, VALUE self)
|
||||||
CvMat* mat_ptr = NULL;
|
CvMat* mat_ptr = NULL;
|
||||||
try {
|
try {
|
||||||
mat_ptr = cvDecodeImageM(buff, iscolor);
|
mat_ptr = cvDecodeImageM(buff, iscolor);
|
||||||
// mat = cvDecodeImage();
|
|
||||||
if (need_release) {
|
if (need_release) {
|
||||||
cvReleaseMat(&buff);
|
cvReleaseMat(&buff);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue