peterbraden / node-opencv

OpenCV Bindings for node.js
MIT License
4.36k stars 857 forks source link

Add distanceTransform and watershed #423

Open bradrisse opened 8 years ago

bradrisse commented 8 years ago

For my project I need distanceTransform and watershed. I am willing to implement and pull request myself, but need some direction on how to integrate. Any assistance is much appreciated.

Essentially its this code here: http://docs.opencv.org/3.0-rc1/d2/dbd/tutorial_distance_transform.html

What Im looking for is maybe a basic implementation of "AddSkill" where there is a small amount of sudo code that explains what the required files are and the basic structure to add new opencv skills.

From what I I have gathered I need to create a DistanceTransform.cc, DistanceTransform.h and in the init.cc include the #include "DistanceTransform.h" and DistanceTransform::Init(target);

The target includes the image and any parameters and the DistanceTransform.cc executes the code and returns the modified target.

OR

Do I add Nan::SetPrototypeMethod(ctor, "distanceTransform", DistanceTransform); to the Matrix.cc and the related function and add JSFUNC(DistanceTransform) to the Matrix.h?

ClaudeSutterlin commented 6 years ago

Did you have any luck with this? Looks like distanceTransform was added, but not Watershed.