本文介绍了指纹如何二值化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我需要代码将指纹二值化??
AnyBody可以帮助我吗?
这是我的算法吗?

HiI need Code To binarization FingerPrint???
AnyBody Can Help Me?
This My Algorithm,Is It Currect???

byte[] s = new byte[7*7];

            //bin.bit is byte 2D and store each pixel of image
            //this algorithm mask 7*7
            

            for (int i = 3; i < bin.bite.GetLength(0) - 4; i++)
                for (int j = 3; j < bin.bite.GetLength(1) - 4; j++)
                {
                    int ind = 0;
                    for(int u=i-3;u<i+4;u++)>
                        for (int v = j - 3; v < j + 4; v++)
                        {
                            s[ind] = bin.bite[u, v];
                            ind++;
                        }


                    byte[] s2 = _sort(s);//_sort Function sort ASCENDANT element
 
                    byte mean =(byte) (((s2[0] + s[48])/2)-7);



                    if (bin.bite[i, j] < mean)
                    {
                        bin.Image.SetPixel(i, j, Color.Black);
                        bin.bite[i, j] = (byte)(0);
                    }
                    else
                    {
                        bin.Image.SetPixel(i, j, Color.White);
                        bin.bite[i, j] = (byte)(1);
                    }
                    

                }

推荐答案


这篇关于指纹如何二值化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 06:59