Is it possible to plot a SURFPoints or MSERRegions object using App Designer on UIAxes? Or any other Point Object?
조회 수: 1 (최근 30일)
이전 댓글 표시
I can execute these series of commands outside of app designer:
image is an imported BW jpeg. uint8 class Executing the below lines in the Command Window work great.
fixedPoints = detectSURFFeatures(image);
figure;imshow(image);
hold on
plot(fixedPoints);
However, executing these lines in the app designer results in an error:
imshow(image, 'Parent',app.UIAxes)% this works also with imshowpair or showMatchedFeatures
hold(app.UIAxes,"on");
plot(app.UIAxes, fixedPoints); % unfortunately this results in an error:
Error using plot
Data must be numeric, datetime, duration, categorical, or an array convertible to double.
I am running this code using Matlab 2024a, Update 2, on an Apple M2 Max with Ventura 13.4.1.
Might anyone know how to fix this or maybe a workaround?
Thanks
댓글 수: 0
채택된 답변
Pratyush Swain
2024년 5월 21일
Hi Darral,
The error you're encountering in MATLAB App Designer when trying to plot "fixedPoints" (which are SURF feature points detected in an image) directly using plot on "app.UIAxes" is due to the fact that "fixedPoints" is not a set of numeric data, but rather an object of type "SURFPoints". The workaround for this is as follows:
% Detect SURF features - assuming app has a property "image"
fixedPoints = detectSURFFeatures(app.image);
% Extract the points locations by using the property - "Location"
pointsLocation = fixedPoints.Location;
% Extract "Scales" property to determine the size of circles which will be plotted
scales = fixedPoints.Scale;
% Plot the points
hold(app.UIAxes, 'on');
for i = 1:length(fixedPoints)
viscircles(app.UIAxes, pointsLocation(i,:), scales(i), 'Color', 'y','LineWidth', 0.25);
end
hold(app.UIAxes, 'off');
Instead of utilizing the "Location" property for a SURFPoints object , you can also leverage its "selectStrongest" object function to select points with strongest metrics. For more information please refer to following resources:
I have also implemented a very basic app designer app to showcase the working of surf points detection in appdesigner. It contains an axes component and two buttons( for loading image and detecting surf points).
I have attached the sample image and app designer file for your reference.
Hope this helps.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!