02-14-2024 07:23 AM - edited 02-14-2024 07:32 AM
Hello,
We're utilizing the IMAQ module to display a camera image on a Windows interface using the WindDraw function, specifying window number 1. We've adjusted pixel mapping and window size with WindDisplayMapping and WindZoom, which rely on window number 1 rather than the image source. Now, we aim to export the modified window as an image, incorporating these adjustments, as the image source lacks these modifications. We haven't yet discovered a function that enables exporting an image from a specified window number. Could you provide guidance on the appropriate steps please?
We are utilizing LabVIEW 2016, Vision Acquisition Software and Vision Development Module 2017.
Thank you for your assistance.
Masiva
02-14-2024 08:22 AM
I don't think you can easily achieve this with IMAQ (I don't know appropriate function, which will associate Window Nr. with Image), but you can create kind of Functional Global and wrap IMAQ WindDraw into your VI, where you will track displayed images in uninitialized shift register and get these back if needed, quick and dirty something like that:
Then use it like this:
VI as "getting started" in the attachment.
02-15-2024 02:05 AM - edited 02-15-2024 03:00 AM
Hello,
Appreciate your prompt response. We tested your solution, but it doesn't account for pixel mapping and window size modifications set by WindDisplayMapping and WindZoom.
Do you have an alternative solution or an equivalent function for image conversion policy please?
In this case, we aim to use the WindDisplayMapping function "Given Range" and apply it to the image.
Masiva
02-15-2024 05:13 AM
it doesn't account for pixel mapping and window size modifications set by WindDisplayMapping and WindZoom.
Well, obviously you can get all properties of the windows programmatically, like Zoom, Center Point, Size, 16 to 8 bit mapping, etc, and apply these transforms accurately in your functional global. In this case I would like to recommend do not modify original image, but create "Screen Window Images" array inside of this global, for example, for Zoom something like that:
This is quite amount of work if you would like to take care about zoomed images which are displayed without "Fit to Window", in this case you should take the size and center point and cut off the only visible portion. The same with WindDisplayMapping. You can also get overlays, and so on.
Another possible approach is to grab images directly from the screen using WinAPI, but not sure if you will be able to get content of the window in case if the window overlapped by other. Will not recommend, if you haven't WinAPI experience.