开发者

Getting part of an image with MATLAB

I'm doing a 开发者_高级运维final project in MATLAB on "License Plate Correlation". For now the user selects the plate with ROI function, afterwards I want to get only the plate. How can I do this?


After using the ROI function, use getPosition on the handle. This gives you the vector [x_min y_min width height]. You can then use this to get your sub image.

imshow(I,[])
h = imrect;
cord = getPosition(h);
Sub_I = I(cord(2):cord(2)+cord(4),cord(1):cord(1)+cord(3));


Please be more specific. If you want to read in an image you can use the imread(filename, format) function which returns a m by n array. There is a 3rd dimension depending on the format of the image. Then you can subset this array as desired.

More details, see: http://www.mathworks.com/help/techdoc/ref/imread.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜