I'm trying to apply Bradleys thresholding algorithm in Aforge
Everytime I try to process the image I get the exception below
throw new UnsupportedImageFormatException( "Source pixel format is not supported by the filter." );
I grayscaled the image using the below method before applying the algorithm
private void button2_Click(object sender, EventArgs e)
{
Grayscale filter = new Grayscale(0.2125, 0.7154, 0.0721);
Bitmap grayImage = filter.Apply(img);
pictureBox1.Image = grayImage;
}
The code for the algorithm call
public void bradley(ref Bitmap tmp)
{
BradleyLocalThresholding filter = new BradleyLocalThresholding();
filter.ApplyInPlace(tmp);
}
I tried the sane image in image processing lab and it did work but not on my system.
Any idea what I'm doing wrong?