aforge.net中的过滤器不支持源像素格式

时间:2015-12-27 18:15:49

标签: c# image image-processing bitmap accord.net

我正在尝试使用Aforge.net开发LPR系统,我想在我的图片上应用过滤器,如您所见:

            Bitmap a = new Bitmap(@"C:\Users\Public\Pictures\Sample Pictures\1.png");
            SobelEdgeDetector filter = new SobelEdgeDetector();
            filter.ApplyInPlace(a);
            pictureBox1.Image = a;

但在跑完后我得到了这个错误:

Source pixel format is not supported by the filter.

我是aforge.net的新手。

1 个答案:

答案 0 :(得分:5)

this API文档页面可以看到,{ "message" : "message send successfully", "statusCode" : "1" } 过滤器仅支持8bpp灰度图像。

要应用滤镜,您需要先将图像转换为8bpp和灰度,例如:

SobolEdgeDetector
相关问题