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 Center および File ExchangeMATLAB 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