Rotating Images

Author: Molly

Aug. 19, 2024

35

0

0

Rotating Images


Standard Rotations

You can find more information on our web, so please take a look.

Rotate is the primary process responsible of image rotation in PixInsight. Its parameters are simple: an angle to rotate the target image, an interpolation algorithm, and a color to fill the resulting extended image canvas.

Our implementation lets you specify whether fast rotations should be used to optimize rotations by +/-90 or 180 degrees. Fast rotations work by swapping and copying pixels between memory locations without floating point operations; see them at the bottom of this document.

On the Rotate window, you can either type an angle in degrees or define it by dragging over the circular graphic. Simply click and drag to place the radial pointer at the desired angle. The Clockwise and Counter-clockwise radio buttons are self-explanatory. The Optimize... check box is to allow the usage of fast rotations for angles of 90 and 180 degrees.

Finally, the Interpolation panel lets you specify the pixel interpolation algorithm used, which is Bicubic Interpolation by default. The Fill Color panel works as explained for the Crop/Expand window.


Smooth Rotated Edges

When rotating an image, edges are never smoothed in PixInsight. This is because we think that rotation and edge smoothing are distinct, unconnected processing tasks that in general should not be mixed. If an application does edge smoothing by default, then you probably have no chance to rotate unsmoothed.

If you really want smooth rotated edges, expand the image by two or four pixels all around before rotating with CropExpand, and use the same fill color for both CropExpand and Rotate. Pixel interpolation will do the smoothing job this way.


Fast Rotations

Some rotations can be performed without using floating point operations, but just by copying and swapping pixels, which is extremely fast. More importantly, fast rotations preserve the integrity of rotated data since no transformation is applied to pixel values, but they are just moved between memory locations. The FastRotate process is used to accomplish these tasks in PixInsight.

Fast rotations include:

You will get efficient and thoughtful service from optec.

  • Rotate 180 degrees
  • Rotate 90 degrees, clockwise
  • Rotate 90 degrees, counter-clockwise
  • Horizontal mirror
  • Vertical Mirror

To directly apply a fast rotation to the active image window, you can use the Fast Rotate tool bar:

which is not visible by default. To show it, use Windows > Tool Bars > Fast Rotate.

Of course, you can also use the Fast Rotate processing window:

Image rotation: Move center of rotation to point of origin

Hi there,


I want to achieve my first image rotation with an algorithm I found on the www. The algorithm is based on 3 shears, one in x, one in y and once again x direction. The VIs basically do what they should do, with one exception: The image is not rotated about it's center, but the 2D array origin. Since last week, I'm restless thinking about this, but I don't find a solution. Maybe because I'm quite a starter with programming. &#;

So, I adapted the Matlab code, I found on this page but also looked into the cited paper of Alan Paeth:
https://www.ocf.berkeley.edu/~fricke/projects/israel/paeth/rotation_by_shearing.html

In my opinion, it should work, when I'm able to move the center of the image to the point of origin. I thought about one possibility, and tried out only the start, because there must be a simpler way to do this.
Nonetheless: I can (and have a VI for this) rotate an amount of coordinates, I store in a 2D Array around a specific point/coordinate through subtracting this from each other. I can do this too for each coordinate of each Array element for an image, but this is somehow unpleasant, because I have to rearrange every channel to a 1D Array and implement a 2D shear into a 1D Array ...

So: Can you maybe suggest me another approach in moving the rotation center to the origin?
(not sure if my VIs help you, but if you start the rotateByShear.vi, load the rectangule_24bit.png and enter some different positive angles, you will for sure see, what I mean)

 

Thanks a lot!

 

edit: I can't upload zip files? Is this correct?

Contact us to discuss your requirements of Dove Prism for Image Rotation. Our experienced sales team can help you identify the options that best suit your needs.

Comments

Please Join Us to post.

0

0/2000

Guest Posts

If you are interested in sending in a Guest Blogger Submission,welcome to write for us.

Your Name: (required)

Your Email: (required)

Subject:

Your Message: (required)

0/2000