How to perform Hot Spot Detection ?
9 次查看(过去 30 天)
显示 更早的评论
HI,
what is the equivalent code to be used in App Designer, for the below .m file ?
Thanks
%% Calculate Object Properties Using Pixel Values of Grayscale Image
ti = imread('ti2.jpg');
sc = regionprops('ti2erode.png','ti2rgb.png',{'Centroid','WeightedCentroid'});
figure()
subplot(1,3,1)
imshow(ti)
title('Weighted (red) and Unweighted (blue) Centroids');
hold on
numObj = numel(sc);
for k = 1 : numObj
plot(sc(k).WeightedCentroid(1), sc(k).WeightedCentroid(2), 'r*')
plot(sc(k).Centroid(1), sc(k).Centroid(2), 'bo')
end
hold off
0 个评论
采纳的回答
Mario Malic
2021-1-30
There's no equivalent code in AppDesigner, if you just open it and do few examples there, you'll figure out what to do. I made some changes to your code, as this is most likely how it'll look like in App Designer, excluding these first two lines.
uiFig = uifigure;
uiAxes = uiaxes('Parent', uiFig)
%% Calculate Object Properties Using Pixel Values of Grayscale Image
ti = imread('ti2.jpg');
sc = regionprops('ti2erode.png','ti2rgb.png',{'Centroid','WeightedCentroid'});
imshow(ti, 'Parent', uiAxes)
title(uiAxes, 'Weighted (red) and Unweighted (blue) Centroids');
hold(uiAxes, 'on')
numObj = numel(sc);
for k = 1 : numObj
plot(uiAxes, sc(k).WeightedCentroid(1), sc(k).WeightedCentroid(2), 'r*')
plot(uiAxes, sc(k).Centroid(1), sc(k).Centroid(2), 'bo')
end
hold off
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!