LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to rotate objects or pictures on my FP?

Thanks. 

0 Kudos
Message 21 of 34
(4,014 Views)

Thanks for the examples Altenbach, the good descriptions to everyone who has helped (and the problems to everyone who has provided them). This thread has been a great read.

 

Here is some code that updates Altenbach's awesome RotateBowl2.vi with a fix to a tiny bug that he missed due to the Square nature of the Bowl Image and shows the Bowl method and the Ship load technique VI.

(Just to make it easier for anyone else out there experimenting with this.)

Functions -

1) Zoom on Centre as per Bowl VI

2) Rotate as per Ship and Bowl VIs

3) Load from Constant as Per Bowl VI

4) Load from File as per Ship VI

5) Be awesome as per Altenbach

 

(Posted in LV 2012)

 

 

 

CLD; LabVIEW since 8.0, Currently have LabVIEW 2022 SP1 installed
Message 22 of 34
(3,722 Views)

I was always impressed with Altenbach's pure G implementation of the image rotate and zoom on the boat.  There is lots to learn when it comes to raw image manipulation, and imaginary number math.  But there are times when you may prefer to use an already developed library to do things like image manipulation, and I always wondered if I could perform the same functions shown here using .Net.  So if you don't mind the platform dependency of Windows this can work.

 

Attached is my attempt to rotate an image, by an arbitrary angle.  Now one thing my version doesn't do yet, is have a zoom control, but I suspect that is possible.  But there are a list of neat features mine does that the native one doesn't.

 

With the attached VI you can rotate many different image types, images with alpha layer are supported, pivot points can be set anywhere, and the image is fit to the control size, which changes on window resize.  No need to do more code to make the image fit, it just works without any extra work.

 

There could be improvements for sure.  One issue is that the original image and the new image is the same size, but on a rotate parts of the image may fall outside the bounds.  I think this can be fixed but I didn't look into it.  Still this was a fun challenge that I hope to find a use for some day.

Message 23 of 34
(3,552 Views)

@Hooovahh wrote:

Attached is my attempt to rotate an image, by an arbitrary angle.


Nice.

 

(Note that the outer FOR loop of my code can be parallelized giving me about 5x speedup on my 16 core machine.)

Message 24 of 34
(3,540 Views)

10 years later...

 

Thanks! This is very helpful. Its nice to have a purely LabVIEW solution to rotate and zoom image.

0 Kudos
Message 25 of 34
(244 Views)

Very nice.  But I wish you had more comments.  For instance, why do you divide the size by 2?

paul_a_cardinale_0-1766687134864.png

 

0 Kudos
Message 26 of 34
(225 Views)

I just found this VI that i made long ago.

0 Kudos
Message 27 of 34
(221 Views)

@paul_a_cardinale wrote:

I just found this VI that i made long ago.


The inner code could probably be made into a VIM to avoid all that duplicate code...

Message 28 of 34
(192 Views)

@altenbach wrote:

@paul_a_cardinale wrote:

I just found this VI that i made long ago.


The inner code could probably be made into a VIM to avoid all that duplicate code...


Good point.  Here it is.

Download All
0 Kudos
Message 29 of 34
(187 Views)

Sorry, can't look at it. Only LabVIEW 2020 here....

0 Kudos
Message 30 of 34
(138 Views)