フィルターのクリア

output image from simulink and matlab code are different ??

2 ビュー (過去 30 日間)
vijay sai
vijay sai 2014 年 4 月 1 日
コメント済み: Ryan Livingston 2014 年 4 月 2 日
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 件のコメント
Ryan Livingston
Ryan Livingston 2014 年 4 月 2 日
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?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeBlock Libraries についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by