VISHNULALR / aforge

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

ReplaceChannel with UnmanagedImage throws NullReferenceException #344

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create RGB UnmanagedImage ->
Dim tmpImg As AForge.Imaging.UnmanagedImage = 
AForge.Imaging.UnmanagedImage.FromManagedImage(foundImg)

2. Create channel image ->
Dim exChan As New AForge.Imaging.Filters.ExtractChannel(AForge.Imaging.RGB.R)
Dim redChan As AForge.Imaging.UnmanagedImage = exChan.Apply(tmpImg)

3. Insert the modified channel back to the original image ->
Dim replaceChan As New 
AForge.Imaging.Filters.ReplaceChannel(AForge.Imaging.RGB.R, redChan)
replaceChan.ApplyInPlace(tmpImg)    **** Throws the NULL Error

What is the expected output? What do you see instead?
I expect the ReplaceChannel to replace the designated channel. Instead, a Null 
Reference is thrown. There is a work around to fix this (see below).

What version of the product are you using?
2.2.4

Please provide any additional information below.
Convert the target image and replacement channel to a System.Drawing.Bitmap 
object before running the ReplaceChannel function. This runs with no problems.

Original issue reported on code.google.com by dst...@email.arizona.edu on 28 Apr 2013 at 4:44