I am trying to apply the Bradleys threshold algorithm in Aforge
Every time I try to process an image, I get an exception below
throw new UnsupportedImageFormatException ("The source pixel format is not supported by the filter.");
I grayed out the image using the method below 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; }
Code to call the algorithm
public void bradley(ref Bitmap tmp) { BradleyLocalThresholding filter = new BradleyLocalThresholding(); filter.ApplyInPlace(tmp); }
I tried a sane image in an image processing lab and it really worked, but not on my system.
Any idea what I'm doing wrong?
source share