LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stiching together images of graph plots and saving as one image

Solved!
Go to solution

Hello,
i was able to create seperate image files out of each chart in my VI but i wasn't able to figure out how to stitch them together and save as one large image.
As output i only get the first image without the 2. and 3. attached.
I was following these 2 examples:
https://forums.ni.com/t5/LabVIEW/Draw-image-at-point-in-picture-control/td-p/612570
https://forums.ni.com/t5/LabVIEW/Merge-2D-pictures/td-p/1981713
But somehow i didn't get it to work.
I was trying to stitch the 2. picture to the top right corner of the 1.one and the 3. to the bottom left corner of the 2. picture.

For the testing no example data is needed, the button "Plots Speichern" should be used to save the - in this case - empty charts into one large jpg. file.
Here's a scematic of what i want to achieve:

2020-05-25_13h02_46.png


I'd be glad if someone could point out my mistake and help me figuring out how to fix it.

Best Regards,
MT_at_home
0 Kudos
Message 1 of 5
(2,209 Views)
Solution
Accepted by topic author MT_at_home

Hello,

You are almost there

Try this

Yddet_0-1590410134440.png

Yddet

 

Message 2 of 5
(2,176 Views)

Thank you a lot, based on your example i was able to get the rest figured out too.

One question, just for my understanding:
If you reposition a image, do you always have to specify all the boundaries along the axis you are moving?
I first tried the following:

img2.left=img1.right
Cause i expected them to end up in the same height level if not otherwise specified, at least either at top or at the bottom, but not, not working at all.


img3.left=img1.right
img3.top=img2.bottom
The same here, img3.left should just match with img1.right and be positioned at whichever height level img2.bottom is.

But i couldn't understand why this didnt work.

 

As seen in the code now it only works when specifing both the boundaries on the axis you are moving:

img2.left=img1.right
img2.right=img1.right+added_img.right

aswell as

img3.top=img2.bottom
img3.bottom=img2.bottom+added_img2.bottom

img3.left=img1.right
img3.right=img1.right+added_img2.right

Which for me, who had just a little CAD in his life, feels like overdetermined, because the right border of the stitched image is already defined by the left img width + width of the right img.

 

Anyways, i'm happy to have it working now, for anyone interested here's how it looks:

2020-05-25_17h42_55.png

Best Regards,
MT_at_home
0 Kudos
Message 3 of 5
(2,149 Views)

I don't have a good knowledge of how LabVIEW works but here is my best interpretation.

If we used the VI Draw unflatten pixmap and its input "Top left point", it would have worked as you expect. There is an image and you specify where to place it.

The VI we use (Draw flattened pixmap) does not have the input "Top left point" and always put the image at the top left. So we modify the image itself beforehand. The image is composed of several information : pixels, color, data type,... and bounds (rectangle) that are modified.

 

Al least that's how I understand it

Yddet

Message 4 of 5
(2,113 Views)

Okey, thank you for the explaination, sounds reasonable to me.
And thx for the help again, now it works like a charm.

Best Regards,
MT_at_home
0 Kudos
Message 5 of 5
(2,067 Views)