E
E
elisey4742016-02-07 19:09:21
C++ / C#
elisey474, 2016-02-07 19:09:21

How to do opencv c++ morphological transformation?

Briefly speaking. You need to do this:

st1 = cv2.getStructuringElement(cv2.MORPH_RECT, (21, 21), (10, 10))
st2 = cv2.getStructuringElement(cv2.MORPH_RECT, (11, 11), (5, 5))
thresh = cv2.morphologyEx(thresh, cv2.MORPH_CLOSE, st1) 
thresh = cv2.morphologyEx(thresh, cv2.MORPH_OPEN, st2)

but in c++ . I can't make out the documentation. I just want to do it like there but in c++ www.poprobot.ru/home/modulslezeniazaoranzevymsarikom

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel K, 2016-02-07
@PavelK

Mat st1 = getStructuringElement(MORPH_RECT, Size(21, 21), Point(10, 10));
Mat st2 = getStructuringElement(MORPH_RECT, Size(11, 11), Point(5, 5));
morphologyEx(thresh, thresh, MORPH_CLOSE, st1 ); 
morphologyEx(thresh, thresh, MORPH_OPEN, st2);

Tweaked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question