matlab-图片-imrect使用

来源:互联网 发布:java算法面试题及答案 编辑:程序博客网 时间:2024/05/19 09:49

1.使用固定大小的框

Display updated position in the title. Specify a position constraint function using makeConstrainToRectFcn to keep the rectangle inside the original Xlim and Ylim ranges.
    f igure, imshow('cameraman.tif');
    h = imrect(gca, [10 10 100 100]);
    addNewPositionCallback(h,@(p) title(mat2str(p,3)));
    fcn = makeConstrainToRectFcn('imrect',get(gca,'XLim'),get(gca,'YLim'));
    setPositionConstraintFcn(h,fcn); 
Now drag the rectangle using the mouse.


1 0
原创粉丝点击