Raspberry and interpreted function in simulink
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




