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

Merge branch 'develop' into documentation

Conflicts:
	.gitignore
	ext/opencv/cvmat.cpp
	ext/opencv/opencv.cpp
This commit is contained in:
ser1zw 2014-01-14 17:45:45 +09:00
commit c88feb2c8e
105 changed files with 21911 additions and 347 deletions

View file

@ -107,21 +107,25 @@ VALUE
rb_retrieve(VALUE self)
{
VALUE image = Qnil;
IplImage *frame = NULL;
try {
IplImage *frame = cvRetrieveFrame(CVCAPTURE(self));
if (!frame)
if (!(frame = cvRetrieveFrame(CVCAPTURE(self)))) {
return Qnil;
image = cIplImage::new_object(cvSize(frame->width, frame->height),
CV_MAKETYPE(CV_8U, frame->nChannels));
if (frame->origin == IPL_ORIGIN_TL)
}
image = cIplImage::new_object(frame->width, frame->height,
CV_MAKETYPE(IPL2CV_DEPTH(frame->depth), frame->nChannels));
if (frame->origin == IPL_ORIGIN_TL) {
cvCopy(frame, CVARR(image));
else
}
else {
cvFlip(frame, CVARR(image));
}
}
catch (cv::Exception& e) {
raise_cverror(e);
}
return image;
}
/*
@ -135,16 +139,19 @@ VALUE
rb_query(VALUE self)
{
VALUE image = Qnil;
IplImage *frame = NULL;
try {
IplImage *frame = cvQueryFrame(CVCAPTURE(self));
if (!frame)
if (!(frame = cvQueryFrame(CVCAPTURE(self)))) {
return Qnil;
image = cIplImage::new_object(cvSize(frame->width, frame->height),
CV_MAKETYPE(CV_8U, frame->nChannels));
if (frame->origin == IPL_ORIGIN_TL)
}
image = cIplImage::new_object(frame->width, frame->height,
CV_MAKETYPE(IPL2CV_DEPTH(frame->depth), frame->nChannels));
if (frame->origin == IPL_ORIGIN_TL) {
cvCopy(frame, CVARR(image));
else
}
else {
cvFlip(frame, CVARR(image));
}
}
catch (cv::Exception& e) {
raise_cverror(e);