Clear Filters
Clear Filters

How to use OpenCV imopen in Matlab?

2 views (last 30 days)
asdf on 13 May 2019
I see that the documentation for it is at:
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 ''`
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?

Answers (1)

Constantino Carlos Reyes-Aldasoro
Why don't you use matlab's native imopen function?


Community Treasure Hunt

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

Start Hunting!