You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I run the Pix.BinarizeSauvola or Pix.BinarizeSauvolaTiled functions, they will leak memory and handles. BinarizeOtsuAdaptiveThreshold doesn't cause a problem.
I isolated everything by just passing an 8-bit grayscale image into a large loop in the code below. This leaks about 10MB / iteration (8.5"x11" 300dpi source image) until it crashes because it can't allocate any more memory or resource handles. If I make the loop shorter so that the function ends and the using's dispose, the memory still stays leaked.
Any suggestions?
var converter = new BitmapToPixConverter();
using (Pix pix = converter.Convert(bmp))
{
// Convert RGB to grayscale
using (Pix grayPix = pix.Depth == 32 ? pix.ConvertRGBToGray() : pix.Clone())
{
for (int i2 = 0; i2 < 300; i2++)
{
// Binarize
using (Pix binaryPix = grayPix.BinarizeSauvolaTiled(50, 0.35f, 8, 8))
//using (Pix binaryPix = grayPix.BinarizeOtsuAdaptiveThreshold(50, 50, 5, 5, 0.1f))
{
}
}
}
}
The text was updated successfully, but these errors were encountered:
…rizeSauvola, and Pix.BinarizeSauvolaTiled
The Pix methods where using pixaDestroy instead of pixDestroy to delete intermediate Pix structures created b the Binarize* implementation.
If I run the Pix.BinarizeSauvola or Pix.BinarizeSauvolaTiled functions, they will leak memory and handles. BinarizeOtsuAdaptiveThreshold doesn't cause a problem.
I isolated everything by just passing an 8-bit grayscale image into a large loop in the code below. This leaks about 10MB / iteration (8.5"x11" 300dpi source image) until it crashes because it can't allocate any more memory or resource handles. If I make the loop shorter so that the function ends and the using's dispose, the memory still stays leaked.
Any suggestions?
var converter = new BitmapToPixConverter();
using (Pix pix = converter.Convert(bmp))
{
// Convert RGB to grayscale
using (Pix grayPix = pix.Depth == 32 ? pix.ConvertRGBToGray() : pix.Clone())
{
for (int i2 = 0; i2 < 300; i2++)
{
// Binarize
using (Pix binaryPix = grayPix.BinarizeSauvolaTiled(50, 0.35f, 8, 8))
//using (Pix binaryPix = grayPix.BinarizeOtsuAdaptiveThreshold(50, 50, 5, 5, 0.1f))
{
}
}
}
}
The text was updated successfully, but these errors were encountered: