04-27-2015 07:58 AM
I do have an IDS camera with the LV-driver. Unfortunately the driver uses .NET and therefore I have the camera image in a picturebox. Now I would like to do some image processing and therefore I
need to have the LabView image at this point and not the picturebox.
Question:
How can I "convert" the current picturebox into a LabView image? Saving and loading the image is no option because it would be to slow.
Thanks
Solved! Go to Solution.
04-27-2015 09:21 AM
Is it the Picture to Pixmap you need?
/Y
04-27-2015 09:34 AM
I do have the .NET picturebox. This picturebox I need to "convert" into a Imaq-image for further image processing.
04-27-2015 10:07 AM
.NET is quite problematic, i hope someone has an answer as i'm eager to learn. 🙂
/Y
04-27-2015 11:21 AM
Norick_17 wrote:
Question:
How can I "convert" the current picturebox into a LabView image? Saving and loading the image is no option because it would be to slow.
there exists a methode node whith which you can copy the recent PictureBox content to clipboard in order to acces the image's bytes:
Regards,
Alex
04-27-2015 12:03 PM
I posted these VIs before but I can't seem to find where. Attached is some image utility VIs that do some interesting things with .Net. Extract the zip and open the Demo Load Image. This will load a PNG file with alpha layer transparencies and display it in a picture box. You can then grey out the image and it does this by converting the image to LabVIEW data, applying an opacity change to 50% and then convert it back to .Net and display it. I also have added some code showing how to get the image from a picture box, and then going from there.
The working part of this is taking the image, (from a picture box) and saving it to a stream as a PNG. Then you use a vi in the vi.lib which takes a PNG stream and turn it into LabVIEW data image. Being able to go from .Net image data, to LabVIEW and back is very powerful because you can do what is easiest in whatever platform you want and jump back and forth as needed. This demo was originally made to demonstrate how .Net is good at transparencies and alpha layers, and LabVIEW is not, but you can combine the two to get what you want.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-28-2015 01:14 AM
Hello Alex
looks good but the output is a picture unfortunately. What I'm looking for is an imaq-image.
How can I get the RGB imaq-image?
thanks!
04-28-2015 01:22 AM
Hello Hoooovah
the attached vi's are good but I think there is the same issue here. How can I get the imaq-image out of the 2D-picture?
Thanks
04-28-2015 06:38 AM
@Norick_17 wrote:
How can I get the RGB imaq-image?
@Hooovahh, aka Labview-Overlord, showed us how to get the image data in bytes frome the .NET Picturebox, which is 1d Array of U8 values
Reshape this 1d Array to a 2d Array according to height and width of your input array and then feed this 2d array in the imaq_arraytocolorimage.vi
04-28-2015 07:50 AM
I added following code...
and it works now!!!
Thanks a lot!