Raspberry and interpreted function in simulink
Afficher commentaires plus anciens
Hello,
I need your help to solve my problem. I have to realized project in simulink which is based on communication with raspberry pi 3. Please see the model in simulink:

Inside the subsystem is :

And the interpreted function is :
function [DANE]=DetekcjaKata(image)
vidFrame = image;
figure(1);imshow(vidFrame);
Rmin=15;
Rmax=45;
[centers, radii] = imfindcircles(vidFrame,[Rmin Rmax],'ObjectPolarity','dark','Sensitivity',0.75);
viscircles(centers, radii,'EdgeColor','b');
%%Wykrycie kół znaczników
if size(centers,1)==3
hold on
plot(centers(1,1),centers(1,2),'xr')
plot(centers(2,1),centers(2,2),'xg')
plot(centers(3,1),centers(3,2),'xw')
pkt_AB=[centers(1,1),centers(1,2);centers(2,1),centers(2,2)];
L1=line([centers(1,1),centers(2,1)],[centers(1,2),centers(2,2)]);
dl_1 = pdist(pkt_AB,'euclidean');
pkt_AC=[centers(1,1),centers(1,2);centers(3,1),centers(3,2)];
L2=line([centers(1,1),centers(3,1)],[centers(1,2),centers(3,2)]);
dl_2 = pdist(pkt_AC,'euclidean');
pkt_BC=[centers(2,1),centers(2,2);centers(3,1),centers(3,2)];
L3=line([centers(2,1),centers(3,1)],[centers(2,2),centers(3,2)]);
dl_3 = pdist(pkt_BC,'euclidean');
DANE(1)=centers(1,1);
DANE(2)=centers(1,2);
DANE(3)=centers(2,1);
DANE(4)=centers(2,2);
DANE(5)=centers(3,1);
DANE(6)=centers(3,2);
DANE(7)=dl_1;
DANE(8)=dl_2;
DANE(9)=dl_3;
DANE(10)=1;
else
DANE=zeros(1,10);
end
end
end
I have the error :

then I change the type of data to double like this :

I get the error :

This application is looking for three circles and give me the value "x" and "y" of a centroid of the circle. It is good working on a wideo file, but problem is with raspberry..
Please help me solve this problem..
Regards,
Jan
1 commentaire
Jan Szlek
le 19 Sep 2017
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Raspberry Pi Hardware dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




