Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Assistant LabVIEW 2013 export - memory leak identified

I was using the Vision Assistant for research, and decided on the Edge Detection strategy.

I adjusted the VA script until I could reliably find the desired edge, and saved the script, it included to consecutive Edge Detection steps.

I exported the functionality to LabVIEW 2013 using the VA LabVIEW export tool.

 

When I opened a stored video file, and ran the images through the newly exported filter, the process worked, and the images were detected.

However, when I ran this process with files containing thousands of images, LabVIEW would crash indicating that it ran out of memory.

 

Upon investigation I found a memory leak in the 'Vision Assistant Utilities', in the SubVI named 'IVA EdgeDetect - Create Monochrome Image if needed.vi
  (revision 13).

 

In this SubVI, the utility 'IMAQ Create VI' is used to create the image space for processing.

Unfortunately, the image 'name' input is built with a random number generator.

Every time this SubVI is run, a brand new image space is created.

This would be OK, except that the image space is not deleted when the SubVI ends.

I tried adding a 'delete VI' at the end,l but then the SubVI would not return my image (it was deleted).

So, I removed the random number generator from the SubVI, and passed it a consistent string every time it is run.

This way the exact same Image Space is used every time it is executed.

Since the calling routine has already used the returned image, and is working on the next one before this SubVI is called again, that works for me.

 

With this change, removing the random number generator, I can run thousands of images through this SubVI over and over without running out of memory.

This one change solved my problem.

 

FYI,

Jeff

 

0 Kudos
Message 1 of 5
(4,976 Views)

Most of the code generated by Vision Assistant will not be optimized in any way.  It is meant to provide a quick and dirty means for integrating the script into your LV application.

 

Instead of the random number thing, what you want to do is use a Functional Global to carry your image reference.  Like this...

 

Case structure inside of While Loop, constant "T" wired to stop, First Run wired to Case, IMAQ create image in True case, shift register of the image reference passed through in the False case.  Viola!  Reusable Image Reference. 

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 5
(4,957 Views)
Hello
I am having problem with my QR code scanning using a webcam
This is the actual image that is seen 
I used vision assitant to make the image processing. But still it is not detected.
I took an image and process it in the vision assistant. still the output is not yielded.
Anybody can help
Download All
0 Kudos
Message 3 of 5
(4,797 Views)

Dear sir

I successfully did it.

Thank you for replying

It will be better if u help me how to write the data in excel.

I did the coding but it is not working properly.

I hope to hear from you soon

0 Kudos
Message 4 of 5
(4,761 Views)

Hi Zahkay,

 

How are you trying to write it to excel?  Feel free to upload your new VI, as the version I have doesn't have anything regarding excel.  



Notes for Branch AE:
Please reply to This Post within 24 hours
The US AE is expected to reply to all of your posts within 24 hours. Having this expectation will keep the escalation moving quickly and toward a fast resolution.

You can also use other communication channels: Phone, Skype, etc. to discuss the issue with the US AE. This can help with troubleshooting and quick diagnosis of the issue.

Click here to provide kudos for a post on this page
0 Kudos
Message 5 of 5
(4,754 Views)