From 7649e537b778dc9f7a7e36639a6e9dbae9534f21 Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Sun, 7 Oct 2018 22:55:38 +0300 Subject: [PATCH] Fix JavaScript bindings for features2d module --- modules/js/src/core_bindings.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/js/src/core_bindings.cpp b/modules/js/src/core_bindings.cpp index e8f0ee7f85..60679bb96f 100644 --- a/modules/js/src/core_bindings.cpp +++ b/modules/js/src/core_bindings.cpp @@ -327,6 +327,7 @@ EMSCRIPTEN_BINDINGS(binding_utils) register_vector("PointVector"); register_vector("MatVector"); register_vector("RectVector"); + register_vector("KeyPointVector"); emscripten::class_("Mat") .constructor<>() @@ -472,6 +473,14 @@ EMSCRIPTEN_BINDINGS(binding_utils) function("rotatedRectBoundingRect", select_overload(&binding_utils::rotatedRectBoundingRect)); function("rotatedRectBoundingRect2f", select_overload(&binding_utils::rotatedRectBoundingRect2f)); + emscripten::value_object("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> ("Scalar") .element(index<0>()) .element(index<1>())