LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image rotation

It is a relatively simple matter to rotate an image n times and create an array of pictures or a pict ring for diplay.  That is exactly what I did here:

 

http://forums.ni.com/t5/LabVIEW/%E0%B9%91-%E0%B9%91-Egg-Catcher-Game-%E0%B9%91-%E0%B9%91/m-p/1590098...

 

But, there is an underlying problem that no amount of bilinear interpolation is going to solve:  you have used a gradient to create a lighting effect in your image.  Rotating this image will make it appear that the light source is rotating, not a good look.  You really need to break the image down and rotate just the quadrotor and indicator while leaving the body of the gauge alone.

Message 11 of 14
(906 Views)

Hi, here's the actual VI. I replaced my yaw indicator with a normal numeric indicator because my actual yaw indicator is a pict ring with lots of pictures. And the file is too big to even be attached here. This is why I want to use a rotation code, to minimize the file size. How do I simple wire the rotation code to the received value? So I don't need the event structure at all?

 


 

How does a typical received string look like? Does the lower code alone communicate correctly with the instrument if you leave out the rotation code?


The string data displays "#YPR=69.46,1.17,-0.42". The lower code alone works correctly without the rotation code. 

0 Kudos
Message 12 of 14
(877 Views)

@'Aliah wrote:

Hi, here's the actual VI. I replaced my yaw indicator with a normal numeric indicator because my actual yaw indicator is a pict ring with lots of pictures. And the file is too big to even be attached here.


 

How many pictures do you possibly need? I doubt you need infinite resolution. Also try to use paletted pictures instead of 24 bit pictures.

 

Some more comments to your code:

  • Since your image is 24 bit, you don't need to wire the colormap. It is not used.
  • I dont see a reason for the shift register.
  • As said before, your use of an event structure is pointless. delete it! Use dataflow. Sice event structures do not react to calue changes of indicators, the event structure will block the loop from ever going to the next iteration. You VI is basically locked up. (the timeout case does not trigger either, because your timeout is not wired and -1 (infinite wiat) is implied.
  • Swap bytes does not do anything for DBL inputs. You can delete it and nothing changes.

Attached are a few simple changes. It is nowhere complete.

0 Kudos
Message 13 of 14
(857 Views)

Try this!.You can use this code to rotate an image!.

Even,you can use the IMAQ rotate function in the Vision and Motion palette instead.

If you wanna use a custom code,try this.

Thanks!

Message 14 of 14
(691 Views)