Prev: LVQ
Next: Matlab Logger Object
From: Sean on 21 Jul 2010 12:44 "Ross " <rjmthreeone(a)duke.edu> wrote in message <i275o3$58q$1(a)fred.mathworks.com>... > Hello all, > > I have a shape defined using the rectangle command > > >> rectangle('Position',[0 0 51 30],'Curvature',0.8,'FaceColor','k') > > with the ultimate goal of being able to create a BW mask with this shape centered in a 128x128 blank image. The 'Position' vector doesn't help much given that the positions are normalized relative to the entire figure window and not the image itself. > > Is there a way I can preserve this shape but actually find the row/col index of the 'filled' rectangle within the image itself and not the figure window? > > Cheers, > R Use: >>imtool() to find the coordinates Example: %We want to cover the cameraman's hand in red I = imread('cameraman.tif'); %builtin image - you can run this imtool(I) %Top of hand at [80, 120] imshow(I) rectangle('Position',[80,120,20,10],'Curvature',0.8,'FaceColor','r')
|
Pages: 1 Prev: LVQ Next: Matlab Logger Object |