draco1023 / aforge

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

AccessViolitionException in ReplaceChannel.ProcessFilter #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following code will throw an AccessViolitionException (at least on my
machine; taken from a tutorial on codeproject):

Difference differenceFilter = new Difference();
IFilter thresholdFilter = new Threshold(15);
IFilter grayscaleFilter = new GrayscaleBT709();
IFilter erosionFilter = new Erosion();
IFilter extrachChannel = new ExtractChannel(RGB.R);

Bitmap redChannel = extrachChannel.Apply(currentFrame);

differenceFilter.OverlayImage = grayscaleFilter.Apply(backgroundFrame); ;
Bitmap tmp1 = differenceFilter.Apply(grayscaleFilter.Apply(currentFrame));
Bitmap tmp2 = thresholdFilter.Apply(tmp1);
Bitmap tmp3 = erosionFilter.Apply(tmp2);

Merge mergeFilter = new Merge();
mergeFilter.OverlayImage = tmp3;
Bitmap tmp4 = mergeFilter.Apply(redChannel);

ReplaceChannel replaceChannel = new ReplaceChannel(RGB.R, tmp4);
Bitmap tmp5 = replaceChannel.Apply(currentFrame);

I'm using VisualStudio 2008 with .NET 3.5 and AForge 1.7.0.

BR,
Christoph

Original issue reported on code.google.com by cluppr...@gmail.com on 18 Dec 2008 at 4:35

GoogleCodeExporter commented 9 years ago
From the code it is not clear where are background and current frames come 
from. 
Need more information.

It would help if you attach sample images to use and/or simple application to 
reproduce the exception.

Original comment by andrew.k...@gmail.com on 18 Dec 2008 at 5:01

GoogleCodeExporter commented 9 years ago
They were received via http from a webcam. Does that have an influence? I will 
try it tomorrow with two 
filesystem-based images, will post the sample app (I'm on Mac at home).

Original comment by cluppr...@gmail.com on 18 Dec 2008 at 7:35

GoogleCodeExporter commented 9 years ago
Please find the test program as an attachment, including the two images used 
for the
currentFrame and the backgroundFrame. The exceptions is still thrown, even if 
the two
images are loaded from the filesystem.

Original comment by cluppr...@gmail.com on 19 Dec 2008 at 8:02

Attachments:

GoogleCodeExporter commented 9 years ago
Okay, pretty easy stuff, please find the path attached.
(btw, awesome peace of software)

Original comment by cluppr...@gmail.com on 19 Dec 2008 at 8:20

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for the fix. Yes, it is small tiny typo. Initially (when the article 
was 
written) there was no interface, which allows applying filter to rectangle. So 
it 
looks like I just made a typo updating the code to support new interface.

Original comment by andrew.k...@gmail.com on 19 Dec 2008 at 8:24

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 19 Dec 2008 at 1:38

GoogleCodeExporter commented 9 years ago
The bug is fixed.

Committed in 849 revision. Will be released in 2.0 version.

Original comment by andrew.k...@gmail.com on 20 Jan 2009 at 4:28

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 22 Jul 2009 at 3:53

GoogleCodeExporter commented 9 years ago
I am on windows m/c and I am experiencing the same error. Give me some more
information about how to use this patch.

Original comment by soumya.g...@gmail.com on 2 Oct 2009 at 6:12

GoogleCodeExporter commented 9 years ago
Just take new version of the framework.

Original comment by andrew.k...@gmail.com on 2 Oct 2009 at 8:17