how to display result from matlab to LCD

조회 수: 2 (최근 30일)
Nor Azizah
Nor Azizah 2019년 5월 11일
답변: Joris Naudin 2020년 5월 26일
how to display the final result into LCD arduino?
here is my code for the image processing which assigned to count the number of blackheads.
i want the LCD to display the number of blackhead counted.
and what about the code for the arduino?
I = imread('psm1.png');
figure
imshow (I);
Im=I,
rmat=Im(:,:,1);
gmat=Im(:,:,2);
bmat=Im(:,:,3);
subplot(2,2,1),imshow(rmat);
title('Red');
subplot(2,2,2),imshow(gmat);
title('Green');
subplot(2,2,3),imshow(bmat);
title('Blue');
subplot(2,2,4),imshow(I);
title('Original');
levelr=0.52;
levelg=0.52;
levelb=0.52;
i1=imbinarize(rmat,levelr);
i2=imbinarize(gmat,levelg);
i3=imbinarize(bmat,levelb);
Isum=(i1&i2&i3);
figure,
subplot(2,2,1),imshow(i1);
title('Red');
subplot(2,2,2),imshow(i2);
title('Green');
subplot(2,2,3),imshow(i3);
title('Blue');
subplot(2,2,4),imshow(Isum);
title('Sum of All Colour');
Icomp = imcomplement (Isum);
Ifilled = imfill(Icomp,'holes');
figure, imshow(Ifilled);
se=strel('disk',20);
Iopenned=imopen(Ifilled,se);
imshow(Iopenned);
Iregion=regionprops(Iopenned, 'centroid');
[labeled,numObjects]=bwlabel(Iopenned,4);
stats = regionprops (labeled, 'Eccentricity','Area','BoundingBox');
areas = [stats.Area];
eccentricities = [stats.Eccentricity];
idxOfSubjects=find(eccentricities);
statsDefects=stats(idxOfSubjects);
figure,imshow(I);
hold on;
for idx = 1: length(idxOfSubjects)
h = rectangle('Position',statsDefects(idx).BoundingBox);
set(h,'EdgeColor', [.75 0 0]);
hold on;
end
if idx<10
title([ ' ',num2str(numObjects),' blackheads detected']);
end
hold off;
  댓글 수: 1
Talent Mukaro
Talent Mukaro 2020년 5월 26일
Hie, kindly advice how you solved this? I'm facing the same problem. Email tmmatuhwa@gmail.com or app +263783581256. Thank you

댓글을 달려면 로그인하십시오.

답변 (1개)

Joris Naudin
Joris Naudin 2020년 5월 26일
Hi,
Did you downloaded an add-on for communicating Arduino with Matlab ? Then you can check some examples.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by