Re: ImageCrop/ImageRotate
- To: mathgroup at smc.vnet.net
- Subject: [mg94127] Re: ImageCrop/ImageRotate
- From: "Solomon, Joshua" <J.A.Solomon at city.ac.uk>
- Date: Fri, 5 Dec 2008 05:33:17 -0500 (EST)
- References: <gh2h3n$i93$1@smc.vnet.net>
I finally got this reply out of WRI: I am sorry to inform you that there is no easy way to get round this. In the current form of our implementation, there may be some loss of precision for arbitrary rotation angles. Please let us know if you have further suggestions/questions. On 02/12/2008 05:29, in article gh2h3n$i93$1 at smc.vnet.net, "Joshua A. Solomon" <J.A.Solomon at city.ac.uk> wrote: > 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} > >