-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vec operators mean() and cross() throw 'is not a function' #282
Comments
Ah yeah, the Vec classes don't implement mean. Yet another fix to be done. |
I'd like to work on this. Any tips on how/where to get started? |
Mean is already implemented for Mat. You could simply take that implementation as an example and adjust it for the Vector classes: opencv4nodejs/cc/core/MatBindings.h Lines 767 to 792 in c07bb63
Lines 798 to 812 in f564125
|
Hey, I started working on this but I need some help. What does NAN_METHOD(Mat::Mean) {
FF::SyncBinding(
std::make_shared<MatBindings::MeanWorker>(Mat::Converter::unwrap(info.This())),
"Mat::Mean",
info
);
} So far I created a #include "Vec.h"
#ifndef __FF_VECBINDINGS_H__
#define __FF_VECBINDINGS_H__
namespace VecBindings {
struct MeanWorker : public CatchCvExceptionWorker {
public:
cv::Mat self;
MeanWorker(cv::Mat self) {
this->self = self;
return("test");
}
};
} Then I added the Mean method to class Vec : public Nan::ObjectWrap {
public:
static NAN_MODULE_INIT(Init);
static NAN_METHOD(New);
static NAN_METHOD(NewVec2);
static NAN_METHOD(NewVec3);
static NAN_METHOD(NewVec4);
static NAN_METHOD(Mean); |
Hi, sorry it is me again.
Thanks for fixing the Mat.mean() issue. Now I wanted to use the vec mean() operator and got the following error:
I then tested out all the other vec operators and found that
cross()
also throws the same exception.All other operators worked fine. Am I doing something wrong?
First I was calculating
mat.mean()
which gave meVec4 { z: 0, y: 0, x: 0, w: 0 }
The result I then used for the vec operator like so
mat.mean().mean()
.The text was updated successfully, but these errors were encountered: