您的位置:首页 > 编程语言 > MATLAB

matlab-图片-imrect使用

2015-12-01 20:03 573 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  matlab 图片操作