node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

Missing getStucturingElement and morphologyEx

Open xkxx opened this issue 10 years ago • 3 comments

Hello,

I'm trying to translate a text classifier that uses morphology algorithms. Uefotunately, they dont seem to be present on node-opencv. Would it be possible to expose these functions?

Thanks,

xkxx

xkxx avatar Jun 23 '15 16:06 xkxx

really sad, any news on that?

marsch avatar Jun 15 '16 06:06 marsch

👍

http://docs.opencv.org/trunk/d9/d61/tutorial_py_morphological_ops.html

kaue avatar Jun 02 '17 19:06 kaue

+1

http://docs.opencv.org/trunk/d9/d61/tutorial_py_morphological_ops.html

Just wanted to add that morphologyEx (i.e. opening and closing) as indicated by @kaue as follows:

Closing: const kernel = cv.imgproc.getStructuringElement(2, [eps, eps]); image.dilate(1, kernel); image.erode(1, kernel);

Opening: const kernel = cv.imgproc.getStructuringElement(2, [eps, eps]); image.erode(1, kernel); image.dilate(1, kernel);

Note for the docs about iterations from the docs

The number of iterations is the number of times erosion or dilatation operation will be applied. For instance, an opening operation (MORPH_OPEN) with two iterations is equivalent to apply successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).

Thanks @kaue

Asheeshkrsharma avatar Dec 23 '20 21:12 Asheeshkrsharma