在GPUImage中实现简单的自适应阈值

问题描述:

我正在开发iPhone应用程序,以识别图片中的一些知名符号. 我基本上是在遵循这些教程 http://aishack.in/tutorials/sudoku -grabber-with-opencv-detection/ http://sudokugrab.blogspot.it/2009/07/how-does-it-all-work.html ,使用OpenCv进行模板匹配,使用GPUImage进行图像处理.

I'm developing an iPhone app to recognize some well known symbols from pictures. I'm basically following these tutorials http://aishack.in/tutorials/sudoku-grabber-with-opencv-detection/ and http://sudokugrab.blogspot.it/2009/07/how-does-it-all-work.html, using OpenCv for template matching and GPUImage for image processing.

当所有图像都具有相同的亮度水平时,我可以调整 GPUImageLuminanceThresholdFilter 的阈值,并且所有图像都可以平滑运行,但是,当然,我不能确定亮度.

When all images are with the same luminance level, I can adjust the threshold of GPUImageLuminanceThresholdFilter and all works smooth, but, of course, I can't be sure of the luminance.

因此,我需要一个简单的自适应阈值滤波器,就像那些教程中的那个一样,它可以计算每个像素周围区域的亮度.

So, I need a simple adaptive threshold filter, like the one in those tutorials, which calculate the luminance into the area surrounding each pixel.

GPUImageAdaptiveThresholdFilter 不符合我的需要,因为它可以检测并锐化边缘,而我需要增强符号.

The GPUImageAdaptiveThresholdFilter doesn't fit my needs, because it detects and sharps the edges, while I need to enhance the symbols.

如何实现这种过滤器?

令人敬畏的布拉德·拉森(Brad Larson)要求,在框模糊中添加模糊大小属性,并修改自适应阈值滤波器,使其按预期工作! 谢谢@BradLarson!

Asked to, the awesome Brad Larson added a blur size property to the box blur, and modified the adaptive threshold filter, so it works as expected! Thanx @BradLarson!