Re: imcrop



In article <g1pmcm$t6b$1@xxxxxxxxxxxxxxxxxx>,
Kenneth Eaton <Kenneth.dot.Eaton@xxxxxxxxxxxxx> wrote:

Could you just use a subindex into the image matrix?

ex: img = img(5:(size(img,1)-4)),:,:);

img = img(5:end-4,:,:);


I need the program to be able to do this by itself,
possibly by using:

size(image, 1)-4 and size(image, 2)-4

If you are looking at size(image,1) and size(image,2) then
either that was a mistake or you want to crop slightly differently
than you indicated (left and right).

here's an example of cropping left and bottom, leaving right
and top alone:

croppedimage = img(5:end,1:end-4);

Mind you, which dimension is "top" is open to interpretation when
you are working at the array level, and depends upon how you
display the image -- i.e., should the logical origin be at the
lower-left corner, or at the upper-left corner ?
--
"The human mind is so strangely capricious, that, when freed from
the pressure of real misery, it becomes open and sensitive to the
ideal apprehension of ideal calamities." -- Sir Walter Scott
.



Relevant Pages

  • Re: imcrop
    ... lower-left corner, ... "The human mind is so strangely capricious, that, when freed from ... I did make a mistake. ... It's 8 pixels in total but it must only be 4 pixels from either ...
    (comp.soft-sys.matlab)
  • Re: Personal Note. OT.
    ... they can be set to tell you when you've made a mistake, ... The only thing comparable to Sudoku in terms of rendering the human mind ... inoperable is a sentence with a quadruple negative....r ...
    (alt.usage.english)