I want to convert this code into hdl, but blockproc function is not an allowed function in hdl code. Hence, not able to convert it. Is there any other function same as blockproc and accepted by hdl coder. If not, then what else can be done?
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I = imread('flower.jpg');
X = rgb2gray(I);
XD = im2double(X);
T = dctmtx(8);
dct = @(block_struct) T * block_struct.data * T';
B = blockproc(XD,[8 8],dct);
mask = [1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blockproc(B,[8 8],@(block_struct) mask .* block_struct.data);
invdct = @(block_struct) T' * block_struct.data * T;
I2 = blockproc(B2,[8 8],invdct);
imshow(I2);
0 个评论
回答(1 个)
Kiran Kintali
2018-12-25
0 个投票
Hi,
You can check hdlcoder supported style of MATLAB code in "matlab\toolbox\hdlcoder\hdlcoderdemos\matlabhdlcoderdemos"
Can you please share your code?
kiran.kintali@mathworks.com
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!