Jump to content

Display JPEG from IP address


Recommended Posts

Hello, it is my first message,

I need to display JPEG images in LabVIEW 7.1 from a smart-camera using its IP address:

When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image..

However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image:

http:\//192.168.1.128/484833/productXX.jpg

I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted.

Thanks!

(I suppose it's the same with any image from internet)

Link to comment

QUOTE(Zeclark @ Nov 4 2007, 09:31 PM)

Hello, it is my first message,

I need to display JPEG images in LabVIEW 7.1 from a smart-camera using its IP address:

http://192.168.1.128/484833/productXX.jpg

When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image..

However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image:

http:\//192.168.1.128/484833/productXX.jpg

I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted.

Thanks!

(I suppose it's the same with any image from internet)

Maybe you can set the path to relative (an absolute path will add the '\') or look at this post.

This requires you to download the file to your HD (temp or whatever) and than load it into your VI.

Ton

Link to comment

QUOTE(Zeclark @ Nov 4 2007, 01:31 PM)

When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image..

However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image:

http:\//192.168.1.128/484833/productXX.jpg

I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted.

The reason that you can paste the URL into the file browser when you leave the path input unwired is because Windows understands what a URL means in the file browser. In fact, I would bet that what's actually happening is that Windows (probably through IE?) is downloading the image from the URL to a temp file, then returning the path to that temp file to the Read JPEG File.vi VI. You just never see any of this happening because it's buried inside the VI and hidden by Windows.

But that's different from passing a URL into a subVI via a path control. So Ton is right about the '\' character being added, but it actually doesn't matter because Read JPEG File.vi doesn't take a URL at its path input to begin with.

The bottom line is that I don't think you can use Read JPEG File.vi to do what you want to do, unless you download the source image to your computer first and load it from there. But it sounds like that poses a speed problem for you :(.

Maybe you could streamline the process by implementing the communications manually, i.e. manage a single TCP/IP connection in your program, do the transactions in raw form (so the data comes straight to your app rather than to the disk), and then convert the raw data you receive to something suitable for your picture control. But that's a fair bit of trouble to go through. You might also be able to display the picture in some sort of special ActiveX control, but I'm the wrong person to ask about that ;).

Link to comment

QUOTE(Zeclark @ Nov 5 2007, 06:31 AM)

Have you tried something like \\192.168.1.128\484833\productXX.jpg as the path? I don't know anything about the smartcam that you're using, but can you share the directory that the files are in and then just map the directory as a drive?

Link to comment

Thanks Justin for the explication of why we can paste an URL in a dialogbox, but not directly in the .vi.

Map the directory as a drive is a good idea, I contacted the camera company to know if it is possible.

I also asked them if pictures can be directly uploaded on the computer HD. I hope those solutions will be fast enough.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.