03-26-2003 06:55 PM
03-27-2003 09:33 AM
03-27-2003 05:46 PM
01-05-2004 03:36 PM
01-16-2007 01:15 AM
Hi,
Actually, I am using the function imaqFindCircularEdge, I found the memory leakage in this function - imaqSpoke. Even I have used the imaqDispose to free the memory of SpokeReport. The problem may similar to the case of http://forums.ni.com/ni/board/message?board.id=200&message.id=1977&query.id=163957#M1977. which is frist posted on 03-31-2003 08:41 PM
I am using the updatest version, 8.2, developing the program under Microsoft Visual studio 6.0
Can anyone help me to solve this problem asap?
Thanks
=========================================================================
void TestEdge1(Image* image, Annulus searchArea, SpokeDirection direction, const FindEdgeOptions* options, const CoordinateTransform2* transform)
{
CircularEdgeReport* reportToReturn = NULL;
ROI* tempROI;
ContourID rectID;
SpokeReport* reportToProcess=NULL;
SpokeOptions optionsToUse;
// Create an ROI, place the annulus contour inside it and set the contour color
tempROI = imaqCreateROI();
if ( tempROI == NULL ) {
return;
}
rectID = imaqAddAnnulusContour (tempROI, searchArea);
optionsToUse.threshold = options->threshold;
optionsToUse.width = options->width;
optionsToUse.steepness = options->steepness;
optionsToUse.subsamplingRatio = options->subsamplingRatio;
optionsToUse.subpixelType = IMAQ_CUBIC_SPLINE;
optionsToUse.subpixelDivisions = DEFAULT_SUBPIXEL_DIVISIONS;
// Calculate the edge locations
if ( (reportToProcess = imaqSpoke( image, tempROI, direction, IMAQ_FIRST, &optionsToUse )) == NULL ) {
imaqPrepareForExit( imaqGetLastError(), imaqFindCircularEdgeErrorString, tempROI, NULL );
return ;
}
imaqDispose(reportToProcess);
imaqDispose(tempROI);
}
===================================================================================================
01-22-2007 10:55 AM
Hello chris_cb750,
I took a closer look at the IMAQ Rake and IMAQ Spoke functions. IMAQ Spoke is actually completely separate and doesn’t use IMAQ Rake in any way. The issue with IMAQ Rake was fixed as of version 8.2 and although this shouldn’t be related, it may be similar. We would like to recreate the issue you are experiencing here on our end. In order to make sure we see the exact same behavior, we have two questions that will help us isolate the issue as quickly as possible:
12-01-2014 12:31 AM
Hello Luke H.
I found the similar look in 'imaqFindEdge2' function.
Every time I call this function, my pc's memory continues to increase.
I tested the 'imaqrake' and 'imaqrake2', but It had no problems.
I observed the memory in Task Manager.
Below is a simple example and PC specs.
If you continue to call the function in the for loop, memory continues to increase.
Second, If I used the 'imaqMergeOverlay' function, pagefault is increase.
Is there a problem if the page fault is increasing?
I felt the process is slow.
I need a help..
<specs>
OS : Window 7 professional SP1 64bit
RAM : 4GB
CPU : Intel Core i7
programming tool : Visual Studio 2008
<example>
void test(void)
{
Image *img = NULL;
ROI *roi = NULL;
FindEdgeReport *findEdgeReport = NULL;
EdgeOptions2 edgeOptions;
FindEdgeOptions2 findEdgeOptions;
StraightEdgeOptions straightEdgeOptions;
int err;
img = imaqCreateImage(IMAQ_IMAGE_U8, 7);
err = imaqReadFile(img, "E:\\tmp\\h4_0.bmp", NULL, NULL);
if(err < ERR_SUCCESS)
{
imaqDispose(img);
return;
}
edgeOptions.polarity = IMAQ_SEARCH_FOR_ALL_EDGES;
edgeOptions.kernelSize = 3;
edgeOptions.width = 5;
edgeOptions.minThreshold = 50;
edgeOptions.interpolationType = IMAQ_BILINEAR_FIXED;
edgeOptions.columnProcessingMode = IMAQ_AVERAGE_COLUMNS;
findEdgeOptions.direction = IMAQ_LEFT_TO_RIGHT;
findEdgeOptions.showSearchArea = TRUE;
findEdgeOptions.showSearchLines = TRUE;
findEdgeOptions.showEdgesFound = TRUE;
findEdgeOptions.showResult = FALSE;
findEdgeOptions.searchAreaColor = IMAQ_RGB_GREEN;
findEdgeOptions.searchLinesColor = IMAQ_RGB_BLUE;
findEdgeOptions.searchEdgesColor = IMAQ_RGB_RED;
findEdgeOptions.resultColor = IMAQ_RGB_GREEN;
findEdgeOptions.overlayGroupName = NULL;
findEdgeOptions.edgeOptions = edgeOptions;
straightEdgeOptions.numLines = 1;
straightEdgeOptions.searchMode = IMAQ_USE_FIRST_RAKE_EDGES;
straightEdgeOptions.minScore = 10;
straightEdgeOptions.maxScore = 1000;
straightEdgeOptions.orientation = 0;
straightEdgeOptions.angleRange = 45;
straightEdgeOptions.angleTolerance = 1;
straightEdgeOptions.stepSize = 2;
straightEdgeOptions.minSignalToNoiseRatio = 0;
straightEdgeOptions.minCoverage = 25;
straightEdgeOptions.houghIterations = 5;
// Creates a new, empty region of interest.
roi = imaqCreateROI();
// Creates a new rectangle ROI contour and adds the rectangle to the provided ROI.
err = imaqAddRotatedRectContour(roi, imaqMakeRotatedRectFromRect(rect); // 'rect' is test example
if(err < ERR_SUCCESS)
{
imaqDispose(img);
imaqDispose(roi);
return;
}
findEdgeReport = imaqFindEdge2(img, roi, NULL, NULL, &findEdgeOptions, &straightEdgeOptions);
if(findEdgeReport == NULL)
{
printf("Find Edge Fail !!\n");
}
else
{
printf("Find Edge Success ..\n");
imaqDispose(findEdgeReport);
}
imaqDispose(img);
imaqDispose(roi);
}