LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

image translation

Hi,

I am still working on that cockpit I mentioned in my earlier post and I succeded in rotating the image of the handwheel. Now I would like to be able to move it up and down vertically (translation) in the same frame if possible. Suggestions to do this? I have included my image and th VI to rotate it below so you can see what Im doing more clearly. Thanks.

p.s. Just change the file path in the VI to wherever you store the included picture.

Mike
0 Kudos
Message 1 of 5
(3,858 Views)

Hi Mike,

 

I am missing Rotate Picture Control.vi and Mask Color.vi, so I am not sure exactly how you are displaying the jpg.  I’m assuming that you would like to shift the position of the whole picture.  If so, please take a look at the following thread.

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=72182&requireLogin=False

 

You will find an example that should help you out.  I hope this answer your question.  If I can do anything else to help, please post back.

 

Regards,

Elizabeth S.

Applications Engineer

National Instruments  

Message 2 of 5
(3,818 Views)
Hi,

Actually I dont want to move the picture control frame just the picture inside it around. I have achived this in the attached yokemotion.vi. The only thing I am now having trouble withis that the adjustment is being made to the entire picture (consisting of the mask and the background). I would like to have only the mask move that way if I want to do rotation or translation I can have a static background and just a moving handwheel. Thanks alot for the previous help. I am looking forward to your next advice.

Mike
0 Kudos
Message 3 of 5
(3,802 Views)

Hi Mike,

I was able to edit your VI to move the object up and down in the picture frame.  I added 2 two controls; one for the change in x position and one for the change in y position.  You can edit the formula node in Rotate 24bit.vi to reflect the changes in position:

x2 = x + delta_x;

y2= y + delta_y;

You will need to add a new input by right-clicking on the border of the formula node.  Be sure that you replace all angle rotation controls with a delta_x control and a delta_y control.  Then change the connector pane for the Rotate Picture Control.vi to incorporate the extra control. 

You may want to divide the delta value by some constant.  I noticed a large change in position when shifting x or y by only 1. 

Elizabeth S.

Applications Engineer

National Instruments

 

Message 4 of 5
(3,766 Views)
Hi Elizabeth,

I tried your suggestion and it worked great! Thanks a bunch!

Mike


0 Kudos
Message 5 of 5
(3,738 Views)