I am trying to convert matlab code to verilog HDL (HDL coder), But i am getting the following error, can anyone please suggest a solution.
1 view (last 30 days)
Show older comments
%FUNCTION
% clear all
% rgbImage = imread('ricesam2.jpg');
% rgbImage=imresize(rgbImage,[480,480]);
function props =New_grading(BinaryImage)
BinaryImage=reshape(BinaryImage,[480,480]);
binaryImage = BinaryImage < 170;
binaryImage = imclearborder(binaryImage);
binaryImage = bwareafilt(binaryImage, [100, 1000]);
props = regionprops(binaryImage, {'Area','Centroid'});
props = struct2table(props);
% Show the result
-----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
%Test_Bench
clear all
rgbImage = imread('ricesam2.jpg');
rgbImage=imresize(rgbImage,[480,480]);
binaryImage = rgbImage(:,:,3);
BinaryImage=reshape(binaryImage,[1,480*480]);
props =New_grading(BinaryImage);
figure imshow(rgbImage, []);
hold on
for kk = 1:height(props)
text(props.Centroid(kk,1)+10, props.Centroid(kk,2),...
num2str(props.Area(kk)))
end
0 Comments
Answers (1)
Kiran Kintali
on 1 May 2021
HDL Code generation from MATLAB requires streaming inputs. Please refer to the following example.
>> mlhdlc_demo_setup('heq')
0 Comments
See Also
Categories
Find more on FPGA, ASIC, and SoC Development in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!