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'

2 次查看(过去 30 天)
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 个)

Walter Roberson
Walter Roberson 2016-12-28
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.

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by