while converting my matlab code to hdl code, i got the error' HDL Code generation does not support 2D-matrices as function inputs. Use help codegen for more information on using this command. Error in Manager>wfa_generateCode at 627'

1 vue (au cours des 30 derniers jours)
clc; clear all; close all; image1=imread('cameraman.tif'); subplot(2,2,1); figure(1); imshow(image1);title('original image'); image2=stdfilt(image1); subplot(2,2,2); imshow(image2,[]); title('standard deviation map'); t2=0.1*max(max(image2)); for i=1:256 for j=1:256 % c1(:,:,i)=cell2mat(C(i)); % p1(:,:,i)=cell2mat(P(i)); % sum1=sum(sum(c1(:,:,i)));
if image2(i,j) < t2
s(i,j)=0;
else
s(i,j)=1;
end
end
end
subplot(2,2,3);
imshow(s);
title('binarized standard deviation map');
  1 commentaire
Walter Roberson
Walter Roberson le 28 Déc 2016
Please format your code. Click on the edit pencil, highlight your code, and click on the '{} code' button.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 28 Déc 2016
Your code cannot be translated to HDL. HDL does not support file operations such as imread(), and does not support any graphics such as imshow()
When you get the needed code isolated, you might need to use https://www.mathworks.com/products/vision-hdl/features.html#full-frame-and-pixel-based-processing frame to pixel conversion.

Community Treasure Hunt

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

Start Hunting!

Translated by