Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision image acquisition

Solved!
Go to solution

I acquiring images via a USB camera at a rate of 12HZ.  The problem I'm having is saving these images.  If I save these images while acquiring data, the program can not keep up at this rate.  I need a way to acquire 120 images and then save them after the acquisition is complete.  I've tried to build an array but this does not seem to work (the issue is when I index the array, I do not get images out).  Any suggestions on this approach or perhaps another approach to accomplish this.

 

Thank you.

0 Kudos
Message 1 of 11
(5,026 Views)
What is the camera u r using?
0 Kudos
Message 2 of 11
(5,014 Views)
Solution
Accepted by topic author Gene Z.

Hi, Gene,

 

Assumed that IMAQ Vision + IMAQ USB was used.

The typical error is bundling array of IMAQ images. Remember, that IMAQ image passed as reference, not image itself. It means, the code like this will not work as you may expect:

 

Acq120(wrong).png

What you need is following. You should create your buffers before acquisition, then acquire each image into own buffer:

 

Acq128.png

 

Hope it helps,

 

Andrey.

 

Message 3 of 11
(5,008 Views)
Marlin F201 B.
0 Kudos
Message 4 of 11
(5,001 Views)

Thank you for the suggestion.  I tried it and I get an error 1074396120 IMAQ WriteFile not an image.  I am using IMAQdx Legacy with a triggered acquisition.  Could this be causing the problem? 

0 Kudos
Message 5 of 11
(4,979 Views)

IMAQdx is NOT intended for USB cameras. You should use IMAQ USB instead!

 

Andrey.

 

0 Kudos
Message 6 of 11
(4,977 Views)
Oops.  I am using a firewire camera.  I do get images.  Should this work with a firewire camera?  My apologies for incorrect description.
0 Kudos
Message 7 of 11
(4,975 Views)

Well, then IMAQdx is right choice, it should work. Are you able to see images in Measurement and Automation Explorer?

 

0 Kudos
Message 8 of 11
(4,973 Views)
I am able to see images in IMAX and in my program. Attached is my code.
0 Kudos
Message 9 of 11
(4,972 Views)

Sure, you have troubles. You tried to save images AFTER disposing:

 

screen.png

 

Andrey.

0 Kudos
Message 10 of 11
(4,970 Views)