App designer - problem with thresholding image
Mostrar comentarios más antiguos
Hi folks,
I have the app attached, in which I am encountering two issues. Firstly, when trying to threshold an image and displaying the thresholded image, it would appear my function calls aren't working as the image displayed is not thresholded. (ResinThreshold function works in live editor, but not when called in app designer). The thresholding function is below.
Thanks
function ResinThreshold(app)
imgGrey = rgb2gray(app.img);
[counts, ~] = imhist(imgGrey, 255);
T = otsuthresh(counts);
BW = imbinarize(imgGrey, T);
BW = bwareaopen(BW, 3000);
BW = imfill(BW, 'holes');
BW = bwperim(BW);
BW = imdilate(BW, ones(5));
BW = imerode(BW, ones(3));
BW = imfill(BW, 'holes');
app.img = app.img.*repmat(uint8(BW),[1 1 3]);
end
2 comentarios
DGM
el 11 de Abr. de 2021
I don't see any attached files.
Teshan Rezel
el 11 de Abr. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Preview and Device Configuration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!