Transfer Images Over the Network
Downloads
Filename: 202722.llb
Requirements: View
Filename: ds_image_array_vb.zip
Requirements: View
Filename: 202724.zip
Requirements: View
Filename: flatten_image_to_string_lv70.vi
Requirements: View
The first example converts an image to an array, flattens it to a string, and then it's ready to send across a network where it will be unflatten and the 2-D array will be converted to an image. This method can quickly convert image to array, compress, uncompress, and convert array to image, but the amount of data it sends across the network is the full size of the image. This method can do all the non netowrk related processing in about 29ms/image on a 1.5GHz machine.
The second method is only support with LabVIEW 7.0 or higher and Vision 7.0 or higher. It uses the flatten to string with the image and achieve very good compression. The amount of data sent across the network is about 3% of the image size. It does take about 67ms/image to compress, but the network transfer time will be much faster. The transfer speed across a network depends on the compression quality, the network traffic and the speed of the network. Compressing images takes processing power, and the faster you can compress the images the faster you can begin to send them across the network.
The third method uses a JPEG compression algorithm to convert the image to a binary string. It achieves a similar compression ratio as the previous method, and it is supported on older versions of LabVIEW. It takes about 48ms/image. You can specify a compression quality between 0 (highly compressed and looks very poor) and 100 (uncompressed and looks exactly the same as the original). This example uses a compression quality of 75.
The fourth example takes advantage of Datasocket and uses a customized ActiveX Control for the web browser to receive and display images. The VideoServer continuously performs a grab and sends each frame to the Datasocket server. The ActiveX Control, written in Visual Basic, will connect to a Datasocket server on demand and continuously receive and display the images in an IMAQ Viewer. This example allows you to stream video over the Internet to multiple clients.
Perform the following steps to use this example:
1. Configure you image acquisition device and camera in MAX
2. Open and run the VideoServer.vbp
3. Open dsimaq.htm in your web browser. The file is located in the Package directory.
If you copy the Package directory to another computer, you must change the URL so the computer name matches the name of the computer where the Video Server is running. For example, if VideoServer is running on a machine called "TestMachine", and you open the HTM file on another machine, the URL should be "dstp://TestMachine/Vision".
You may need to adjust your internet security to allow ActiveX controls to run and install their temporary files. Internet security settings are located in your web browser at Tools>>Internet Options>>Security.
For more information on creating ActiveX Controls, please refer to the link below, Building an Interactive Web Page with Datasocket.
| Related Links: |
| Building an Interactive Web Page (App Note 127) |
| Knoweldge Base: Streaming Images Across a Network |
| File I/O - Saving an image from a Target onto a Host |
Requirements
Filename: 202722.llb
Software Requirements
Application Software: LabVIEW Base Development System 6.1
Toolkits and Add-Ons: LabVIEW Vision Development Module 6.1
Language(s): LabVIEW, Visual Basic
Additional Software: Visual Basic 6.0
Software Requirements
Application Software: Measurement Studio Visual Basic Support 6.0
Toolkits and Add-Ons: LabVIEW Vision Development Module 6.1
Language(s): Visual Basic, LabVIEW
Software Requirements
Application Software: LabVIEW Base Development System 6.1
Toolkits and Add-Ons: LabVIEW Vision Development Module 7.0
Language(s): LabVIEW, Visual Basic
Software Requirements
Application Software: LabVIEW Base Development System 7.0
Language(s): LabVIEW, Visual Basic
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
