LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rotating an 2d array by an arbitrary degree around a pivot point, example code.

Hello everyone! Smiley Happy

 

This code rotates an 2d array around a specified pivot point, using the IMAQ Vision library. 

After execution, the pivot point is in the center of the array and the array is enlarged to fit the rotation.

Execution speed is very dependent on the specified angle, the position of the pivot point and the size of the array.

 

Rotate 2D Array.png

 

Rotate.PNG

 

 

I'm sharing this code because, after a long search on the forums and internet, I found there is no fast solution for rotating 2d arrays by an arbitrary degree in LabVIEW.

 

I want to start a discussion about optimizing this code, without the use of IMAQ Vision (which is a detour to a C++ DLL). 

Please help me defend labview and let us find a really fast way to do this directly, without using Pixmaps or Vision.

 

Thank you, and as always, kudos will be given! Smiley Very Happy

 

 

 

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

Message 1 of 4
(4,216 Views)

Mmm, I made a mistake Smiley Surprised

 

Pivot should be OFFSET.

 

So after execution the offset is NOT the middle of the image.

 

sorry

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 2 of 4
(4,199 Views)

Please someone Smiley Surprised

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 3 of 4
(4,159 Views)

Altenbach posted an example of array rotation here - http://forums.ni.com/t5/BreakPoint/LV-Picture-Control/m-p/230351#M748

 

I don't know how efficient it is, but since it's Altenbach, it's probably pretty good. It's also always around the center, but I'm assuming it should be possible to modify it to work on an arbitrary pivot point (e.g. by enlarging the entire array and placing the new pivot in the center).


___________________
Try to take over the world!
Message 4 of 4
(4,155 Views)