How to use OpenCV imopen in Matlab?
Show older comments
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?
Answers (1)
Constantino Carlos Reyes-Aldasoro
on 5 Aug 2022
0 votes
Why don't you use matlab's native imopen function?
https://uk.mathworks.com/help/images/ref/imopen.html
Categories
Find more on OpenCV Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!