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'
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Walter Roberson
il 28 Dic 2016
Please format your code. Click on the edit pencil, highlight your code, and click on the '{} code' button.
Risposte (1)
Walter Roberson
il 28 Dic 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.
0 Commenti
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!