MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

ImageCrop/ImageRotate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94010] ImageCrop/ImageRotate
  • From: "Solomon, Joshua" <J.A.Solomon at city.ac.uk>
  • Date: Tue, 2 Dec 2008 00:40:06 -0500 (EST)

WRI support may be 24/7 these days, but since I'm still awaiting a response
to my last query, I'll reprint it here:
Dear W.R.T.S.
Love the new image processing routines. One problem. Here's an otherwise
blank image with a dot in the middle:
In[1]:=
tst=Table[0,{33},{33}];tst[[17,17]]=1;image=Image[tst];
Now I'm going to rotate that image through 5 degrees, and crop it so that it
is still 33 x 33 pixels:
In[2]:=
newImage=ImageCrop[ImageRotate[image, 5*Degree], 33];
note that the dot is still in the middle:
In[3]:= 
Position[#, Max[Flatten[#]]] &[ImageData[newImage]]
Out[3]=
{{17, 17}}
However, if I rotate the image another 5 degrees, the dot does *not* stay in
the middle.
In[4]:= 
Position[#, Max[Flatten[#]]] &[ImageData[ImageCrop[ImageRotate[image,
10*Degree], 33]]]
Out[4]=
{{17, 16}}
Is this a bug? Is there some way to hack around it, so that the dot stays in
the middle for any arbitrary rotation?
Cheers
PS
In[5]:= 
{$Version, $ReleaseNumber}
Out[5]=
{"7.0 for Mac OS X x86 (64-bit) (November 11, 2008)", 0}



  • Prev by Date: SaveAs in Version 6 and Version 7
  • Next by Date: Re: Quick help needed very much!!!!
  • Previous by thread: Re: SaveAs in Version 6 and Version 7
  • Next by thread: Re: ImageCrop/ImageRotate