Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Image Processing Steps

Hi

 

Wonder if anyone can help a relative newbie to Labview Vision. I have two branches of processing steps for an image. As the steps at the start are common, I'd like to reduce the processing at the start and branch off later.

 

Attachment 1 - This shows my code running in parallel, works OK, but is not very efficient as there is duplication.

 

Attachment 2 - This is my attempt at branching off to reduce the amount of processing, this doesn't seem to work. I guess I am misunderstanding the references to the image files or something? Any help greatly appreciated.

 

Cheers

 

Download All
0 Kudos
Message 1 of 2
(2,928 Views)

Hi Noodles,

 

Firstly, when you say it's not working, what do you mean? Is it causing an error, or just giving an unexpected output?

 

I think you've hit the nail on the head with the references.

 

With IMAQ you're referencing a physical area in memory, so when you perform an operation on it the data in that memory location changes, and the reference remains the same. In some situations this makes LabVIEW appear to violate dataflow. In actual fact it's just passing a reference to this memory location, so the dataflow paradigm is not violated.

 

In ImageProcess2.PNG you perform two operations in parallel, each referencing the same memory location. My guess is that the one at the top of the block diagram executes first and changes the data in this location, and then that is the data that the bottom loop then manipulates, which gives you undesirable results. Is this consistent with what you're seeing?

 

Since there is no dataflow between the two IMAQ functions at the end, we can't tell which one is executing first.

 

One thing I would try, is using the error cluster to force the execution order, and executing the bottom one first, followed by the top one. The bottom one should save it's processed image to the new location that you've set up, leaving the image in the other memory location in tact fo the top one to then change.

 

Please let us know if this solves your problem and if that inoformation helps, this certainly isn't the first time I've seen this kind of behaviour using IMAQ VIs.

 

If it doesn't solve the problem please could you attach the VIs to your next post.

 

Many Thanks,

Joel G
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(2,876 Views)