Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

reentrant execution in image processing

Solved!
Go to solution

Hi all, I'm using LabVIEW 2010 and the target machine is an Intel Atom N270.

 

I have a sub-VI dedicated to process image frames adquired from a remote IP camera. I'd like to process more than one camera at time. The question is: If I set my image processing chain sub-VI as reentrant, the image 'wires' are protected? I know that those purple wires are only references to my images, and I'm afraid that a second thread could change the reference at the beginning of the process chain while a previous frame is being processed at the end.

 

I've read in previous threads about change each IMAQ sub-VI to reentrant to achieve an improve in the performance execution but, does the reentrant execution condition (in the vi containig the process chain) protect all the references?

 

Thanks in advance,

 

Daniel

 

0 Kudos
Message 1 of 6
(3,446 Views)
Solution
Accepted by topic author dbello

Yes, the Vision library is thread safe. If you set your image processing VI (and all its dependencies) to reentrant, you can process more than one image at a time, assuming you pass different references to your processing VI. The Vision library will lock an image if the function you're calling is modifying it.

 

-Christophe

Message 2 of 6
(3,443 Views)

Thank you very much Christophe! I'm going to do that and let you know if something goes wrong...

 

Daniel

0 Kudos
Message 3 of 6
(3,440 Views)

Hi all,

 

I am trying to apply the same concept to VI but unfortunately it didnt work out!

 

I have two subVIs with the same code which are supposed to run in parallel and read different parts of a TDMS database and create images out of it and finally save the images by using the IMAQ Write File2.VI.

 

When I let the subVIs run in the either of options of the reentrant modes, one of the subVIs does not create the output image and issues the following error in IMAQ Write File2.VI:

 

Error -1074396154 occurred at IMAQ WriteTIFFFile

Possible reason(s):

IMAQ Vision: The image is not large enough for the operation

 

This error does not occur when the VI is not in the reentrant mode! but well then it is not really running concurrent..

 

Any help would be greatly appereciated

Thanks,

Arash

0 Kudos
Message 4 of 6
(3,215 Views)

@Arash_ali wrote:

 

When I let the subVIs run in the either of options of the reentrant modes, one of the subVIs does not create the output image and issues the following error in IMAQ Write File2.VI:

 

Error -1074396154 occurred at IMAQ WriteTIFFFile

Possible reason(s):

IMAQ Vision: The image is not large enough for the operation

 


Look like race condition in your application. Remember, that the images transferred in IMAQ by reference, not by value. Each copy of your reenterant VI should work with own image in your case (this is just my guess - just show your code).

 

0 Kudos
Message 5 of 6
(3,208 Views)

Hi Andrey,

 

Thanks for your reply and sorry that I'm responding late.

You are right about the race 🙂 cause in fact each time one of the subVIs takes the lead and creates the image and the other issues the error!

 

According to the previous messages I thought since the wires are protected I dont need to take care of the references..

I will also upload my VI as soon as I get back to the PC again.

 

Thanks,

Arash

0 Kudos
Message 6 of 6
(3,169 Views)