ARLM-Keller / aforge

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

AForge.Imaging.Filters.Morph when both images are the same, result is white image with red cross.. #108

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Just copy image, resize it and apply morph on those images

What is the expected output? What do you see instead?
white image and two red lines crossing each other

What version of the product are you using?
2.0.0

Please provide any additional information below.

I'm working on a small project, it is an image slideshow, so i use aforge 
morph effect between images. Don't really know if this is an issue, but i 
had two  images in same directory, they both were the same ,but different 
size and when i applied morph effect, i got white image with red cross, 
maybe it would be better if it would just show original image on such case, 
or should i just compare images and use morph only when they are different?

Here is sample code:
<...>
//^^ Prev and current images are resized to fit the screen and converted 
//to PixelFormat.Format24bppRgb format

AForge.Imaging.Image.FormatImage(ref iPrevImage);
AForge.Imaging.Image.FormatImage(ref iCurrentImage);

morph_filter = new AForge.Imaging.Filters.Morph(iPrevImage);
morph_filter.SourcePercent = fFadeValue;
Bitmap result = morph_filter.Apply(iCurrentImage);
e.Graphics.DrawImage(result, iImageLocation);
<...>

Thanks.

Original issue reported on code.google.com by baku...@gmail.com on 18 Aug 2009 at 4:06

GoogleCodeExporter commented 8 years ago
ok, i guess it is because one image is a lot smaller then the other.

Original comment by baku...@gmail.com on 18 Aug 2009 at 4:42

GoogleCodeExporter commented 8 years ago
You should not get any image as result at all. What you are doing is an invalid 
operation and you should get exception. Both images should of the same size. It 
is 
said in documentation.

Original comment by andrew.k...@gmail.com on 18 Aug 2009 at 4:56