This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
ripsnorta  
#1 Posted : Thursday, October 6, 2005 3:42:29 PM(UTC)
ripsnorta

Rank: Member

Groups: Guest
Joined: 10/6/2005(UTC)
Posts: 1

Hello,

I tried posting my problem to the support form, but was having a little trouble getting it working, so I'll repost here. Hope that's okay.

I am using Aurigma Graphics Mill 3.1 for .NET in a multi-threaded environment and I've found what appears to be a fairly serious issue.

Graphics Mill is being used to preprocess images to ready them for OCR using the Abby FineReader 7.1 engine, however, if I load a bitmap using G.M. or perform a function like crop, the interface to the FineReader engine is corrupted, and if I try to call an engine function, I get a InvalidCastException on the QueryInterface call.

I did try a work around by loading the bitmap using System.Drawing.Bitmap and then passing that to the Graphics Mill Bitmap constructor. This did not corrupt FineReader, however, immediately performing a crop operation on the bitmap to extract the area containing the text we were interested in destroyed the FineReader COM interface.

The code in question is below. I've left in the G.M. bitmap load call, but commented out. This code runs inside a thread, there can be multiple threads active doing this processing, but even when there is only one thread doing this processing the problem occurs.

Code:
private Aurigma.GraphicsMill.Bitmap getImageDataBlock(string filename, WetFilmCameraType cameraType, BoundingRegion region)
{
	System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(filename);
	Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(bmp);
	try
	{
		//bitmap.Load(filename);

		int x, y, w, h;
				
		x = region.topLeftXCoordinate;
		y = region.topLeftYCoordinate;
		w = region.bottomRightXCoordinate - region.topLeftXCoordinate;
		h = region.bottomRightYCoordinate - region.topLeftYCoordinate;

		Crop cropRegion = new Crop(x, y, w, h); // rectangle format of crop region
		cropRegion.ApplyTransform(bitmap);
	}
	catch (Aurigma.GraphicsMill.Codecs.MediaUnsupportedException e)
	{
		// Throw EPSException
		throw new EPSException(e.Message, -1, this);
	}
	return bitmap;
}

public void ProcessSession()
{
	OCREngineWrapper ocrEngine = new OCREngineWrapper();
	for (int itemIdx = 0 ; itemIdx < sessionItems.Count ; itemIdx++)
	{
		SessionItem item = (SessionItem)sessionItems[itemIdx];

		// Extract the portion of the camera image that contains the data
		Aurigma.GraphicsMill.Bitmap image = getImageDataBlock(item.wetFilmImage.ImageFilename, wetFilmCamera, dataBlockRegion);

		...
		item.image = image;
		ocrEngine.ProcessImage(ref item);
		item.image = null;
	}
}

This is a fairly serious issue as I mentioned before. While it appears at the moment that Graphics Mill is only affecting the FineReader engine interface, I cannot be certain that other functions in memory are not also being affected.

Can anyone shed some light on this? Is this a known issue?

cheers

John

Edited by user Sunday, December 23, 2007 5:17:58 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.