@@ -73,19 +73,22 @@ NAN_METHOD(Calib3d::FindHomography) {
73
73
FF_GET_UINT_IFDEF (optArgs, uint method, " method" , 0 );
74
74
FF_GET_NUMBER_IFDEF (optArgs, double ransacReprojThreshold, " ransacReprojThreshold" , 3 );
75
75
FF_GET_UINT_IFDEF (optArgs, uint maxIters, " maxIters" , 2000 );
76
- FF_GET_INSTANCE_IFDEF (optArgs, cv::Mat mask, " mask" , Mat::constructor, FF_UNWRAP_MAT_AND_GET, Mat, cv::noArray ().getMat ())
77
76
FF_GET_NUMBER_IFDEF (optArgs, double confidence, " confidence" , 0.995 );
78
77
if (!hasOptArgsObj) {
79
78
FF_ARG_UINT_IFDEF (2 , method, method);
80
79
FF_ARG_NUMBER_IFDEF (3 , ransacReprojThreshold, ransacReprojThreshold);
81
80
FF_ARG_UINT_IFDEF (4 , maxIters, maxIters);
82
- FF_ARG_INSTANCE_IFDEF (5 , mask, Mat::constructor, FF_UNWRAP_MAT_AND_GET, mask);
83
- FF_ARG_NUMBER_IFDEF (4 , confidence, confidence);
81
+ FF_ARG_NUMBER_IFDEF (5 , confidence, confidence);
84
82
}
85
83
86
84
FF_OBJ jsMat = FF_NEW_INSTANCE (Mat::constructor);
87
- FF_UNWRAP_MAT_AND_GET (jsMat) = cv::findHomography (srcPoints, dstPoints, method, ransacReprojThreshold, mask, maxIters, confidence);
88
- FF_RETURN (jsMat);
85
+ FF_OBJ mask = FF_NEW_INSTANCE (Mat::constructor);
86
+ FF_UNWRAP_MAT_AND_GET (jsMat) = cv::findHomography (srcPoints, dstPoints, method, ransacReprojThreshold, FF_UNWRAP_MAT_AND_GET (mask), maxIters, confidence);
87
+
88
+ v8::Local<v8::Object> output = Nan::New<v8::Object>();
89
+ Nan::Set (output, Nan::New (" homography" ).ToLocalChecked (), jsMat);
90
+ Nan::Set (output, Nan::New (" mask" ).ToLocalChecked (), mask);
91
+ info.GetReturnValue ().Set (output);
89
92
}
90
93
91
94
struct Calib3d ::ComposeRTWorker : public SimpleWorker {
0 commit comments