mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
More housekeeping.
This commit is contained in:
parent
e268db9fd0
commit
0dead60224
1 changed files with 3 additions and 6 deletions
|
|
@ -70,17 +70,14 @@ namespace rubyopencv {
|
||||||
|
|
||||||
// void setInput(const Mat &blob, const String& name = "")
|
// void setInput(const Mat &blob, const String& name = "")
|
||||||
VALUE rb_set_input(int argc, VALUE *argv, VALUE self) {
|
VALUE rb_set_input(int argc, VALUE *argv, VALUE self) {
|
||||||
VALUE blob, name, options;
|
VALUE blob, name;
|
||||||
rb_scan_args(argc, argv, "12", &blob, &name, &options);
|
rb_scan_args(argc, argv, "11", &blob, &name);
|
||||||
|
|
||||||
cv::dnn::Net* selfptr = obj2net(self);
|
cv::dnn::Net* selfptr = obj2net(self);
|
||||||
|
|
||||||
cv::Mat *m = Mat::obj2mat(blob);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
selfptr->setInput(*m, CSTR_DEFAULT(name, ""));
|
selfptr->setInput(*Mat::obj2mat(blob), CSTR_DEFAULT(name, ""));
|
||||||
} catch(cv::Exception& e) {
|
} catch(cv::Exception& e) {
|
||||||
delete m;
|
|
||||||
Error::raise(e);
|
Error::raise(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue