How to convert mxarray datatype in simulink
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nazim Badar
am 20 Mär. 2014
Kommentiert: Walter Roberson
am 18 Mai 2016
I have to remove small objects from binary image and Im trying to use bwareaopen in simulink by using following code:
function y = fcn(u)
x = zeros(size(u));
coder.extrinsic('bwareaopen');
x = bwareaopen(u, 50);
y = double(x);
and getting error:
Class mismatch for variable 'bwareaopen'. Expected 'double', Actual 'logical'. Block MATLAB Function (#24) While executing: none
Model is as follows:

%
0 Kommentare
Akzeptierte Antwort
Ryan Livingston
am 2 Apr. 2014
For allocating logical data use either of the functions true or false:
x = true(size(u));
x = false(size(u));
5 Kommentare
Sayed Rizban Hussain
am 18 Mai 2016
Bearbeitet: Sayed Rizban Hussain
am 18 Mai 2016
yes bwareaopen is supported in matlab coder as I have used it previously. Now my target machine is raspberry pi. Can you suggest me any function that can replace bwareaopen? As for my application I only need objects of a specific area range.
Weitere Antworten (1)
Kaustubha Govind
am 20 Mär. 2014
It looks like bwareaopen returns an output of type logical. You need to pre-declare 'x' as follows:
x = zeros(size(u), 'logical');
1 Kommentar
Siehe auch
Kategorien
Mehr zu Computer Vision with Simulink finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
