Effacer les filtres
Effacer les filtres

output image from simulink and matlab code are different ??

2 vues (au cours des 30 derniers jours)
vijay sai
vijay sai le 1 Avr 2014
I have built a simulink model to do watershedding as apart of project. The output I get from the simulink function block is quite different from matlab code version of the same program. I am attaching the code I used for both matlab and simulink and their output images
>>
if true
% a=imread('medtest.png');
b=watershed(a);%%MATLAB CODE
d=imshow(b);
c=label2rgb(a);
figure
imshow(c);
end
if true%%WATERSHEDDING
% function y = fcn(u)
% #codegen
coder.extrinsic('watershed','imshow','label2rgb','image');
y=zeros(size(u));
y = double(watershed(u));
image(y);
end
if true %%LABEL2RGB CODE
% function z = fcn(u)
coder.extrinsic('imshow','label2rgb');
% z=0;
z=zeros(size(u,1),size(u,2),3);
z = double(label2rgb(u));
imshow(z)
end
  1 commentaire
Ryan Livingston
Ryan Livingston le 2 Avr 2014
Could you please describe the code a bit more? The top block is your code in MATLAB and the bottom two are in the Function Block, or is it something else?
Also, from the model shown, it appears that only the watershedding code is in the function block. Is that the case?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Block Libraries dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by