How can i get the position of a slanted rectangle and also to copy the
intensities as a matrix?
I would like to draw a rectangle on a figure and to be able to take the
positions of my rectangle so i would be able to "copy" the intensities in
the rectangle to another matrix.The rectangle needs to be able to be
slanted if i want to,so i understand the command "imrect" will not work
here.Another problem i have is once that I've drawn a slanted rectangle i
don't know how can i "copy" the intensities as a matrix,cause the matrix
is also slanted now. I'm adding part of my code so you can see what i'm
trying to do:
for k = 1 : nFrames
this_frame = read(obj, k);
thisax = axes('Parent', thisfig);
image(this_frame, 'Parent', thisax);
if k==nFrames
title(thisax, sprintf('Frame #%d', k));
end
if k==1
result=input('How many rectangles would you like to draw? ');
pos=zeros(result,4);
for i=1:result
handle=imrect;
pos(i,:)=handle.getPosition;
end
end
end
No comments:
Post a Comment