comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Is it possible to rotate a flipped image with cgImage?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Is it possible to rotate a flipped image with cgImage? [message #88853 is a reply to message #88842] Wed, 25 June 2014 09:58 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

>
> I have a .JPG image, which requires flipping over the top-down axis before rotating the image by 60 degrees ( clockwise counting ).
>
> I now read the JPG image file as below and place:
>
> READ_JPEG,ImgFile.JPG,img,/ORDER
> ; Flipping the image
> flipHorImg = REVERSE(img,1)
> ; Rotate the flipped image by 60 deg clockwise direction
> rotImg = ROT(flipHorImg,60,0.8,/INTERP)
> cgImage,rotImg,Position=pos2,/OVERPLOT
>
> I get an error like this ...
> % POLY_2D: Expression must be an array in this context: I.
>
> I don't see a problem with flipping of the image, but there is actually a problem with rotated image. While I know that with cgImage, I can use the keyword /NEGATIVE for flipping the image but there is no option for rotating the flipped image. Anyone with a solution and an example will be of great help.

I would do it like this:

filename = Filepath(SubDir=["examples","data"], "marsglobe.jpg")
imageOrig = Read_Image(filename)
image = Transpose(imageOrig,[1,2,0]) ; For ease of handling
image = Reverse(image,2) ; Reverse in Y direction
r = Rot(image[*,*,0], 60, 0.9, Missing=255)
g = Rot(image[*,*,1], 60, 0.9, Missing=255)
b = Rot(image[*,*,2], 60, 0.9, Missing=255)
rotImage = [[[r]],[[g]],[[b]]]
cgDisplay, 900, 300
!P.Multi = [0,3,1]
cgImage, imageOrig
cgImage, image
cgImage, rotImage
!P.Multi=0
END

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Output matrix from Wavelet Toolkit 3D Wavelet Power Spectrum
Next Topic: A case for lookarounds in StRegEx()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 07:44:31 PDT 2025

Total time taken to generate the page: 2.40046 seconds