Simulilnk, raspberry pi and codegeneration with Image Processing Tools
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am doing my master thesis on Simulink with a raspberry pi and its camera. My topic is to determinate the speed limit on streets.
In the matalb function I am using 'imfindcircles' and 'imcrop' to recognize round traffic signs and to crop the image to the ROI.
Does anyone knows a possibility to use the Image Processing Tools with code generation on Simulink?
function [zeile_u,spalte_u,frame] = fcn(PIimage)
frame = PIimage;
pixelL = size(frame,2);
if pixelL>641
rmin=11;
rmax=50;
else
rmin=10;
rmax=20;
end
[centers, radii] = imfindcircles(frame,[rmin rmax]);
if size(centers)~=0
detect = true;
x1 = round(centers(1,1));
y1 = round(centers(1,2));
ra1= round(radii(1,1));
if size(centers)~=1
ra1= round(radii(2,1));
end
else
detect = false;
x1 = centers;
y1 = centers;
ra1= radii;
end
width1=ra1+ra1-1;
height1=ra1+ra1-1;
xmin1=x1-ra1;
ymin1=y1-ra1;
if detect==false
ausl1 = 0;
else
s1 = imcrop(frame, [xmin1 ymin1 width1 height1]);
ausl1 = 1;
end
![testbench.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/203827/testbench.png)
0 Commenti
Risposte (1)
Naman Bhaia
il 25 Feb 2019
Hey Mortiz,
Certain Image Processing Toolbox features have been enabled for code generation. Please see the link below for more details.
0 Commenti
Vedere anche
Categorie
Scopri di più su Modeling in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!