Fix JavaScript bindings for features2d module

This commit is contained in:
Dmitry Kurtaev 2018-10-07 22:55:38 +03:00
parent 0492301e76
commit 7649e537b7

View File

@ -327,6 +327,7 @@ EMSCRIPTEN_BINDINGS(binding_utils)
register_vector<cv::Point>("PointVector");
register_vector<cv::Mat>("MatVector");
register_vector<cv::Rect>("RectVector");
register_vector<cv::KeyPoint>("KeyPointVector");
emscripten::class_<cv::Mat>("Mat")
.constructor<>()
@ -472,6 +473,14 @@ EMSCRIPTEN_BINDINGS(binding_utils)
function("rotatedRectBoundingRect", select_overload<Rect(const cv::RotatedRect&)>(&binding_utils::rotatedRectBoundingRect));
function("rotatedRectBoundingRect2f", select_overload<Rect2f(const cv::RotatedRect&)>(&binding_utils::rotatedRectBoundingRect2f));
emscripten::value_object<cv::KeyPoint>("KeyPoint")
.field("angle", &cv::KeyPoint::angle)
.field("class_id", &cv::KeyPoint::class_id)
.field("octave", &cv::KeyPoint::octave)
.field("pt", &cv::KeyPoint::pt)
.field("response", &cv::KeyPoint::response)
.field("size", &cv::KeyPoint::size);
emscripten::value_array<cv::Scalar_<double>> ("Scalar")
.element(index<0>())
.element(index<1>())