How to use OpenCV imopen in Matlab?

4 次查看(过去 30 天)
I see that the documentation for it is at: http://kyamagu.github.io/mexopencv/matlab/morphologyEx.html
However, it's not working for me. If I try any of the following:
im_open = cv.morphologyEx(im, open, [5 5]);
im_open = cv.morphologyEx(im, "open", [5 5]);
im_open = cv.morphologyEx(im, cv.Open, [5 5]);
im_open = cv.morphologyEx(im, cv.MORPH_OPEN, [5 5]);
im_open = cv.morphologyEx(im, MORPH_OPEN, [5 5]);
Then I get errors like `wrong number of arguments` or `undefined variable 'cv' or class 'cv.open'`
If I try
dst = open(im, [5 5]);
Then I get
wrong number of arguments
If I try
elem = cv.getStructuringElement(cv2.MORPH_RECT, (5,5))
then I get
error: invalid expression. When calling a function or indexing a variable, use parenthesis. Otherwise, check for mismatched delimiters
I just want to perform the equivalent of
im_open = imopen(im, strel('disk', 5));
But using OpenCV within Matlab. How can I do this?

回答(1 个)

Constantino Carlos Reyes-Aldasoro
Why don't you use matlab's native imopen function?
https://uk.mathworks.com/help/images/ref/imopen.html

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by