フィルターのクリア

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'

9 ビュー (過去 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 日
Please format your code. Click on the edit pencil, highlight your code, and click on the '{} code' button.

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

回答 (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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by