Why Does the Memory Usage Increase When I Call the ImaqImageToArray() Function in a Loop?Primary Software: Primary Software Version: 2.6 Primary Software Fixed Version: N/A Secondary Software:
Problem: How come every time I call the imaqImageToArray() function in a loop structure my memory usage increases about the size of the acquired image? Solution: Every time imaqImageToArray() function is called a copy of the array (generated from the image) is placed in the system memory. On success this function returns the pointer to the location that stores the copy of the array. These copies are the same size as the images and if they are not de-allocated, the system will run out of memory fast. In order to release a copy of the array, imaqDispose() function needs to be called for the pointer that was returned by the imaqImageToArray() function within the same loop. Following is an example of the described procedure above: iPointer = imaqImageToArray(imgInputImage, IMAQ_NO_RECT, &iCols, &iRows); imaqDispose(iPointer); Related Links: Developer Zone: IMAQ Image to Array Example Attachments:
Report Date: 08/28/2003 Last Updated: 03/05/2012 Document ID: 30RBFT45 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
