Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

extracting sequence of images using IMAQ1394

Solved!
Go to solution
Hi,
 
I am trying to extract images (that have been obtained using the low level sequence.vi) and store them separately so as to analyze it at a later point of time.  I have a SONY XCD-X710 IEEE1394 camera that can be used with the NI-IMAQ IEEE1394 drivers in a LabView environment.  I don't have NI-Vision.
 
I notice that under Vision/Vision Utilities/Files, I have VIs like the IMAQ Write file and under Vision/Vision Utilities/Files/AVI, I have VIs to create .avi files directly.  I would appreciate if someone can enlighten me about how I can proceed with extracting and saving images. 
 
Thanks.
 
Ram
0 Kudos
Message 1 of 9
(5,157 Views)
Hello Ram,
 
I would suggest that you take a look at the following two examples.  The first was installed as a shipping example with NI-IMAQ and the second is an example program that is available on the National Instruments webpage.
 
1) C:\Program Files\National Instruments\LabVIEW 7.1\examples\IMAQ\IMAQ File IO.llb\Sequence and Save to AVI.vi
 
2)Acquire Sequence and Save with NI-IMAQ.vi
 
Try those and let me know if you have any additional questions on this issue.
 
Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 2 of 9
(5,148 Views)
Hi Scott,

Thanks for your response.  I checked the path (C:\Program Files\National Instruments\LabVIEW 7.1\examples\IMAQ\IMAQ File IO.llb\Sequence and Save to AVI.vi) you mentioned for the first example and I don't seem find it.  For one, I think it is because I got the driver: NI-IMAQ for IEEE 1394 Cameras (Version 1.5.2) when I bought the camera that's being used for our application.  The path I can go to when I look for the examples is this: C:\Program Files\National Instruments\LabVIEW 7.1\examples\imaq\IMAQ1394 examples.llb.  I am now in the process of downloading the latest driver (NI-IMAQ for IEEE 1394 Version 2.0.1 for Windows 2000/XP). However, I am not sure if installing this driver would display the first example you mentioned.  I vaguely remember upgrading to the latest IMAQ 1394 driver when I installed the camera for the first time.  Is there a way one check the version of the driver installed on the computer?

I believe the second example you mentioned also needs the NI-IMAQ 2.6 driver which is not the one in my case.   I am also planning to download the NI-IMAQ Version 3.1.3 for Windows 2000/NT/XP driver. 

I will get back to you as soon as I install the drivers and try out the examples.

Thanks.

Ram


0 Kudos
Message 3 of 9
(5,141 Views)
Hi Scott,

One more question: Is there any difference in functionality between the NI-IMAQ and NI-IMAQ for IEEE 1394 drivers?  I mean, can I use either of these to program my vision applications using the SONY IEEE 1394 compliant camera?

I looked on the website of National Instruments and haven't been able to find a satisfying answer for this question.

Thanks.

Ram
0 Kudos
Message 4 of 9
(5,139 Views)
Solution
Accepted by topic author Ramkiran

IMAQ and IMAQ 1394 are two totally different drivers.  IMAQ provides the interface for analog and digital acquisition boards.  IMAQ 1394 provides the interface for firewire cameras.  You almost don't need the IMAQ drivers when you use a firewire camera, except they provide the basic utilities for image allocation, etc.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 9
(5,134 Views)

Hello,

Instead of the examples that I referenced earlier, try loading Sequence.vi (found at: C:\Program Files\National Instruments\LabVIEW 7.1\examples\IMAQ\IMAQ1394 examples.llb).  This VI will acquire a sequence of images and output an array of images.  You could then use IMAQ AVI Create to create your AVI file and use a for loop to iterate through the image array.  Inside of that loop, use IMAQ AVI Write Frame to write your individual AVI frames.  After the loop finishes, use IMAQ AVI Close to close the memory reference to that AVI.

Try this and let me know if you have any additional questions.

Regards,
Scott R.
Applications Engineer
National Instruments

Scott Romine
Course Development Engineer
National Instruments
Message 6 of 9
(5,094 Views)

Hi Scott,

Thanks for your help.  The VI works like a charm.  I applied the same idea you suggested to grabbing a video and storing it as a .avi file although I am not sure if this is the best way to record a continuous video of the process.  Your suggestion would be appreciated in this regard. 

I am wondering if there is a limit to the number of images you can capture using the combination of sequence and storing as a .avi file.  While working with the VI I created yesterday, whenever an input was given asking to capture 900 images (30 second duration at 30fps), I kept getting the following error:

_______________________________________________

Error -50353 occurred at an unidentified location

Possible reason(s):

One or more memory pages in the specified logical buffer could not be locked into physical memory. The operation could not be completed as specified.

_____________________________________________________

I remember reading somewhere that there is a size limit of 2GB on a .avi file and I think this could be the reason why I am not able to capture 900 images.  I must tell you here however that I would not have to capture 900 images in my application.  This input of 900 was given just to test the maximum number of images that could be extracted by the VI.
 
Thanks.

Ram
0 Kudos
Message 7 of 9
(5,084 Views)

Ram,

What are the dimensions of your images?  What bit-depth are you using?  Those two factors will determine the size of each frame of your AVI.  For example, if you are using a 640 x 480 image with a bit-depth of 8 (byte-depth of 1) then each frame will use 300 kB.  An AVI with 900 frames of that size will use 263.67 MB.  This does not exceed the limit on AVI size, but if your image dimensions or bit-depth are larger, then you might exceed that limit.  If your images are color, then that will also affect the image size, as the above result would be multiplied by 4.  Also, that is 263.67 MB of memory that you must have available for the operation.  If you don't have enough disk space or memory, then that could cause the error that you described.  How much memory do you have installed in your system? 

Regards,
Scott R.
Applications Engineer,
National Instruments

Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 8 of 9
(5,066 Views)
Hi Scott,

Thanks for your response.  I used the 1024x768 video mode with a bit depth of 8.  I have enough hard disc space to take bigger files.  I will test the program again to see if I have the same problem.

Thanks.

Ram
0 Kudos
Message 9 of 9
(5,032 Views)