how to display result from matlab to LCD

2 Ansichten (letzte 30 Tage)
Nor Azizah
Nor Azizah am 11 Mai 2019
Beantwortet: Joris Naudin am 26 Mai 2020
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 Kommentar
Talent Mukaro
Talent Mukaro am 26 Mai 2020
Hie, kindly advice how you solved this? I'm facing the same problem. Email tmmatuhwa@gmail.com or app +263783581256. Thank you

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Kategorien

Mehr zu MATLAB Support Package for Arduino Hardware finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by