From: Ibtesam Saleh on 20 May 2010 18:29 I want to compute the maximum and minimum values in both x-axis and y-axis of my image (xmin, xmax, ymin and ymax)? I know that I should use xlim and ylim but I don't know how to use them to get these values from my image?
From: Walter Roberson on 20 May 2010 20:03 "Ibtesam Saleh" <bossy_4me(a)yahoo.com> wrote in message <ht4d3j$r5f$1(a)fred.mathworks.com>... > I want to compute the maximum and minimum values in both x-axis and y-axis of my image (xmin, xmax, ymin and ymax)? I know that I should use xlim and ylim but I don't know how to use them to get these values from my image? In general, you cannot count on xlim and ylim corresponding to the min and max of your data, because xmin and ylim control what range of data is plotted, not what range of data is there. xlim and ylim will have been rounded to show "nice" plots. For example, when I used plot(rand(1,5),rand(1,5)) then xlim was [0.2 1] and ylim was [0 1] because the random numbers for x were from .29 to .82 and the random numbers for y were from .05 to .93 . The xlim and ylim chosen by Matlab frame those values "nicely". In the case of a single image in the figure with nothing else, then xlimits = xlim; ylimits = ylim; and then the first element of xlim is a min and the second is a max.
From: Ibtesam Saleh on 20 May 2010 21:02 I am sorry... but I am really not understood... I want these values to crop my image Image = imcrop (image,[ n2 , m2 , width , length ]) %m1= ymax %m2= ymin %Length = m1 – m2 %n1=xmax %n2=xmin %Width = n1 – n2 please help me to compute (ymax, ymin, xmax and xmin) thanks in advance Ibtesam
From: Walter Roberson on 20 May 2010 21:29 Ibtesam Saleh wrote: > I am sorry... but I am really not understood... > > I want these values to crop my image > Image = imcrop (image,[ n2 , m2 , width , length ]) > %m1= ymax > %m2= ymin > %Length = m1 – m2 > %n1=xmax > %n2=xmin > %Width = n1 – n2 > > please help me to compute (ymax, ymin, xmax and xmin) You do not have a displayed image to compute the limits of. You would have to image() or imshow() or the like before using xlim() and ylim() . In the meantime, xmin = 1 ymin = 1 xmax = xmin + width - 1; ymax = ymin + length - 1;
|
Pages: 1 Prev: control object: uitable Next: Number Of Frames for non-AVI's |