Event listener for multiple draggable rectangles using imrect in matlab
이전 댓글 표시
function computeButton_Callback(hObject, eventdata, handles)
% hObject handle to computeButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
PImage=handles.ProcessedImage;
Image=handles.Image;
imshow(Image);
hold on;
bw=bwconncomp(PImage,4);
regions=regionprops(bw,'BoundingBox','PixelIdxList');
for i=1:length(regions)
box=regions(i).BoundingBox;
h=imrect(gca,box);
%rectangle('Position',box,'EdgeColor','black','LineWidth',2);
end
%I want to make an event listener that would record the
%properties(height,width) of all the rectangles and even
%the changes on each of the draggable rectangles on the Image.
채택된 답변
추가 답변 (1개)
Rajeev Yadav
2022년 7월 14일
편집: Rajeev Yadav
2022년 7월 14일
0 개 추천
Can we add ARROW KEYS (UP ARROW, RIGHT ARROW, LEFT ARROW,DOWN ARROW) with fixed step size control to move the rectangle?
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!