Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CVS to host with real time wizard

HI I used the serial port of cvs without problem.
I do only at this time separate acquisition (high priority)(image to array. reshape array..)from transmission ( transmit by tcp(normal priority))I hope I can acquire one shot every second and transmit all images..

bye
elisa
0 Kudos
Message 11 of 17
(1,729 Views)
Hi all,

I am trying to do similar things, namely send a captured image from the CVS to a host PC. I am using data socket, but my difficulties lie deeper.

My problem is that "sometimes!" the compress to array function does not work. When this function works it happily creates an string of approximately 4000 bytes for an RGB image. When it does not work, it just creates a string of exactly 65 bytes. There seems to be little reason to the problem, it has sometimes started to work again when I relaoded the CVS's software, but now, it just does not work. I am using the set compression VI before the aquisition starts.

If anyone had any ideas, I would be really interested.

Thanks,
Steve
0 Kudos
Message 12 of 17
(1,685 Views)
Attached is the VI to demonstrate the above problem. It captures an image from a 1394 camera, displays it, and adds the size of string resulting from the flatten to string function.

Cheers,
Steve
0 Kudos
Message 13 of 17
(1,677 Views)
Hi Stephen,

Unless you are using an image that is only 37 pixels by 37 pixels or smaller, I would venture to guess that the flattened string you have created using your program does not represent the image. Typically, you would need to first convert your image to an array before flattening it to a string.

In this situation, I would recommend using an Image to Array function before any flattening. This way, we will be flattening the actual data. Let me know if you have any problems with this!

Regards,

Robert
0 Kudos
Message 14 of 17
(1,671 Views)
Thanks Robert,

You are correct. In fact the string contains the details of the image (jpeg, size etc) but no image. The problem is if I convert the image to an array, the CVS cannot do a JPEG compression, and the size jumps from about 5K to 71K. The transfer then becomes so slow it is close to useless. The really weird part is, it has worked for me. Then, when I have changes something very unrelated, the flatten to string VI stops working. One time it started working again when I reloaded lots of stuff in the CVS, but maybe it had nothing to do with it. It is really frustrating!!! I am pretty sure I am doing what I am supposed to. As far as I can tell I am using the latest revisions of everything.

I was wondering if anyone has used this flatten to string VI either successfully or unsuccessfully.

Cheers (though I am running out of cheer really fast!),
Steve
0 Kudos
Message 15 of 17
(1,669 Views)
Hi

This should help. These vi's willl allow the CVS to send an image back to the host PC. It doesn't use the RT FIFOs but you could easily add the functionality.

Hope that helps

Mike
0 Kudos
Message 16 of 17
(1,647 Views)
Unfortunately, this is a known issue, but you do have several options.

First, you could change the image to an array before flattening. I understand that this means that the image is larger, but keep in mind that the compression lended by a jpeg image will not be that large. The compression ratio is dependent upon the image itself and will vary.

Second, you could use 'Call by VI reference' and pass the image back as an output. This has advantages and disadvantages. The advantage is that the image can still be transferred using the jpeg compression. The disadvantage is that typically this will require a large change to the manner in which the application is structured. Rather than having a single, continuously running program on the CVS, a host computer would be calling and running a VI repeatedly.

Hopefully one of these options might work. Additionally, you could certainly try sending your image over TCP/IP, but let me remind you that you will most likely run into this problem no matter how you transmit your images.
Let me know how it goes.

Robert Manion
0 Kudos
Message 17 of 17
(1,621 Views)