Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

ImaqSession.Acquisition questions.

Solved!
Go to solution

Trying to use the new ImaqSession stuff, and I have some questions:

1. All the samples seem to use a background worker. Why, as opposed to using the ImaqSession.Acquisition.AcquireCompleted event? Any examples of using this?

2. How do I clear the image from an ImageViewer? Used to be able to Detach.

3. What is the difference between ImaqSession.Acquisition.Extract and ImaqSession.Acquisition.Copy?  

 

Thanks,

 

Don

0 Kudos
Message 1 of 4
(2,961 Views)
Solution
Accepted by topic author DRT

Hi Don,

 

I am not exactly sure what you are asking in your first question, can you please further explain what you are looking for. As far as clearing your image you can use Dispose. The difference between Extract and Copy is with Extract you can select your X and Y sizes. Please refer to the documents below, they explain the VI functionally for LabVIEW but the same should apply in your coding environment.

 

IMAQ Extract VI
http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_extract/

 

IMAQ Copy VI
http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_copy/

 

IMAQ Dispose VI
http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_dispose/

 

Tim O

 

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,951 Views)

@DRT wrote:

Trying to use the new ImaqSession stuff, and I have some questions:

1. All the samples seem to use a background worker. Why, as opposed to using the ImaqSession.Acquisition.AcquireCompleted event? Any examples of using this?

2. How do I clear the image from an ImageViewer? Used to be able to Detach.

3. What is the difference between ImaqSession.Acquisition.Extract and ImaqSession.Acquisition.Copy?  

 

Thanks,

 

Don


1) I believe all events in .NET are delivered in the main thread which usually used for UI events. If you were to do any image processing inside the callback it would cause UI events to be postponed. Additionally, it does not have a straightforward means of indicating overflow of events (if you don't process the callbacks as fast as frames are occuring). Using the nice worker model in .NET is a much better example of how to structure things.

 

2) Not sure on this one

 

3) Extract is used for zero-copy access to ring buffers while Copy makes a copy of the data. The former is best for high-performance but means that if you keep the buffer extracted for too long (the size of your ring) it will stall the hardware and make it lose frames. Functionally, the Copy method is pretty equivalent to doing Extract/CopyImage/Release. Both have pros and cons for different applications.

 

Eric

 

Message 3 of 4
(2,945 Views)

Thanks.That helps alot. I see that the documentation for the LabView VIs are much better than the documentation for the .NET classes.

0 Kudos
Message 4 of 4
(2,933 Views)