Info

This question is closed. Reopen it to edit or answer.

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?

2 views (last 30 days)
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);

Answers (1)

Kiran Kintali
Kiran Kintali on 25 Dec 2018
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

Community Treasure Hunt

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

Start Hunting!