From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Front Panel Image issue

    I have a LV program in LV2015, running under W10. I need to acquire an image from a webcam, scale it, and send it on to another system.

    For our first attempt, I got a USB webcam. LV Vision could see the webcam, and acquiring an image was easy. I got the whole thing working, then went to install the webcam. Since it was 30-ish feet from the computer, we used an active USB repeater cable. The camera balked. I found some posts suggesting that this can be an issue...

     So we bought an Ethernet webcam. Well, it turns out that most cheap Ethernet webcams don't use the GigE standard, and LV Vision can only see Ethernet cameras that do.

      No worries: I installed the webcam software, which allowed an image to be displayed in a web browser. Then I put the .NET web browser in LV. So far so good. I can see the camera image, and cable length should no longer be a problem.

      But then I had to grab the image from the LV front panel, scale it, and send it on to another system. I used the FP.Get Image method. The resulting image is incomplete. I kind of understand that LabVIEW doesn't own the contents of the .NET container, so maybe its Method doesn't have access to the actual pixel data there. But the odd thing is, the image is partially complete. The web page in the .NET container has some border elements and controls. Those show up. Only the rectangle that should contain the camera image is coming out blank!

      Can anyone recommend a way for LabVIEW to capture the entire front panel image, including all the data in the camera image on the web page?

Thanks,

      DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 1 of 12
(3,323 Views)

I know this isn't answering your question, but can you tap into the camera's RTSP stream and extract images from it? This site is handy for getting the right RTSP path for a given camera make and model, and there's some example LabVIEW code here which might be useful.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 2 of 12
(3,289 Views)

Thanks! Often, the most useful answers aren't the ones that give that go down the exact rabbit hole that was being asked about. Your kind of answer is exactly why I post to the forums! I might not have a chance to try it right away, but I'll try to remember to report back on how it goes.

 

Cheers

     DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 3 of 12
(3,267 Views)

Does Print Screen work in this case?

 

George Zou
0 Kudos
Message 4 of 12
(3,254 Views)

A normal .Net container has an invoke node Get Image.

 

I have nothing else to add.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 12
(3,242 Views)

Thanks, Ben. I had thought of trying the Get Image for the control (container). Not sure if it will be any better, but it's definitely worth a try. I'll post how it works...

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 6 of 12
(3,232 Views)

Just for the archive: The invoke node for the .NET control has the same behavior as the invoke node for the front panel. Blanks space where the image should be. Not surprising, I guess.

 

As for the Print Front Panel option: I need the image as data in memory. So the best I could think of down that route would be to print the front panel to a .pdf file, then read the .pdf into memory with a pdf viewer, then somehow convince LabVIEW to take a screen image of the .pdf. Ugh... Sounds incredibly slow. I was hoping for 1 Hz image updates. Not live video, but a decent refresh of a fairly static situation. I doubt the print idea could do that. Unless maybe there is a way to print directly to a .jpg? I haven't seen such a thing. There is a "print to file" option in the LV print dialog, but it creates a .prn file.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 7 of 12
(3,197 Views)

Thanks again for the ideas, Michael. I was able to get data from the camera, which I believe is in h264 format. I was also able to find some examples for how to display FFMPEG data in LabVIEW. But translating h264 to FFMPEG looks a bit messy. There are some posts, but it involves pipes to external programs... Not sure that I'll take the time to go all the way down that route.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 8 of 12
(3,183 Views)

I had a quick dig in the forums and came up with this post for doing a print screen and grabbing image data from the clipboard. Not sure how well it works, but might be another option. It simulates pressing the PrtSc key, so you might have better luck with the issue of missing parts of the camera frame.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 9 of 12
(3,178 Views)

Thanks. I'll take a look at it.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 10 of 12
(3,154 Views)