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:
commit
c88feb2c8e
105 changed files with 21911 additions and 347 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue