Balti2016 / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

AForge.Imaging.Filters.Crop causes Exception #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
searchImage is a 24bit Jpeg Bitmap (see attachment):

// create grayscale filter (BT709)
Grayscale grayFilter = new Grayscale(0.2125, 0.7154, 0.0721);
// apply the filter
Bitmap bitmap = grayFilter.Apply(searchImage);

Rectangle cropMask = new Rectangle(new Point(0, 0), bitmap.Size);
cropMask.Inflate(-10, -10);
// create filter
Crop cropFilter = new Crop(cropMask);
// apply the filter
bitmap = cropFilter.Apply(bitmap);

// create filter
ResizeBilinear resizeFilter = new ResizeBilinear(this.Size.Width, 
this.Size.Height);
// apply the filter
bitmap = resizeFilter.Apply(bitmap);

What is the expected output? What do you see instead?

System.AccessViolationException
StackTrace:
   bei AForge.SystemTools.memcpy(Byte* dst, Byte* src, Int32 count)
   bei AForge.SystemTools.CopyUnmanagedMemory(Byte* dst, Byte* src, Int32 
count)
   bei AForge.Imaging.Filters.Crop.ProcessFilter(UnmanagedImage 
sourceData, UnmanagedImage destinationData)
   bei AForge.Imaging.Filters.BaseTransformationFilter.Apply(BitmapData 
imageData)
   bei AForge.Imaging.Filters.BaseTransformationFilter.Apply(Bitmap image)
   bei TestEcke.Form2.FitToForm(Bitmap searchImage) in 
C:\Users\Hesse\Documents\Visual Studio 2008
\Projects\TestEcke\TestEcke\Form2.cs:Zeile 317.

What version of the product are you using?

2.0.0 BETA (20.03.2009)

Please provide any additional information below.

Crop Causes Violation. Dependend on sequence of the Methodcall, Violation 
can also occur at next filter Operation. Even had OutOfMemory Exceptions 
sometimes.

Original issue reported on code.google.com by cellh...@googlemail.com on 5 Jun 2009 at 2:11

Attachments:

GoogleCodeExporter commented 9 years ago
It was fixed. See issue #95:
http://code.google.com/p/aforge/issues/detail?id=95

Will be available with next release. Or you can build manually from sources.

Original comment by andrew.k...@gmail.com on 5 Jun 2009 at 2:16