Re: imcrop
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Fri, 30 May 2008 20:42:56 +0000 (UTC)
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,:,:);
possibly by using:I need the program to be able to do this by itself,
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
.
- Follow-Ups:
- Re: imcrop
- From: Jack Branning
- Re: imcrop
- References:
- imcrop
- From: Jack Branning
- Re: imcrop
- From: Kenneth Eaton
- imcrop
- Prev by Date: Re: Passing a MATLAB user defined class object to a MEX function
- Next by Date: Re: Passing a MATLAB user defined class object to a MEX function
- Previous by thread: Re: imcrop
- Next by thread: Re: imcrop
- Index(es):
Relevant Pages
|