04-18-2010 12:26 PM
I would like to rotate an image of a boat to illustrate the pitch. altenbach made a VI very close to what i want, but I have a hard time making it eat a jpeg image instead of a generated one.
I have tried to make a knob control to do this, but I guess there is a problem with my emf converter.
I would like to avoid generating 64 images to show +-16deg pitch with a 0.5 resolution.....
Thanks!
Kind regards
Pål Jacob
04-18-2010 12:57 PM
Can you show us your code?
You would just read the jpeg using "read jpeg file", then use unflatten pixmap to make the 2D array.
04-18-2010 01:44 PM - last edited on 04-19-2010 09:51 AM by Support
Looks like you need to correctly apply the 8bit colormap.
Here's a quick example:
04-18-2010 03:09 PM
I just noticed that the original old code has a gigantic memory leak. The image should not be in a shift regsiter!
Here's a corrected version!
04-19-2010 06:07 AM
Superb solution altenbach!! This is exactly what I was looking for!
Thanks!
08-24-2010 02:20 AM
Excellent!! This vi will save me a lot of time.
Thank you so much~
Adam
09-02-2010 11:26 AM
Hi Altenbach,
With reference to your attached rotateship vi. The background is black, how do i change it to white? or transparent? because i tried it with a picture of mine which is white, rotating it shows the other uncovered areas as black.
Also, is it possible to make the image permanent in the code without needing to read the file?
09-02-2010 11:53 AM
@BPBP wrote:
With reference to your attached rotateship vi. The background is black, how do i change it to white?
Initialize a 2D array of white, keep it in shift registers for the two inner FOR loops, and use "replace array subset" in the inner loop to fill the rest with the rotated image.
@BPBP wrote:
Also, is it possible to make the image permanent in the code without needing to read the file?
09-02-2010 01:45 PM
Actually, here's a better method. Since we have a colormap, we need to pick one of the colors from the palette. Easiest is to e.g. grab the color of the pixel at (0,0) as background color if we index out of range.
Modify as needed.
09-02-2010 02:34 PM
Quick modification to resize image container to the actual image size and also allow zoom. (LabVIEW 8.0)