本文介绍了c#中的指纹检测角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于指纹分类的项目,用c#和一部分计算角度。

这个部分我的项目没有答案,挂起,没有任何动作。

计算角度首先计算sobelx和sobely过滤器然后用arctan计算角度



请帮帮我

hi i have project about fingerprint classification with c# and in one part compute angle.
in this part my project give no answer and hang and dont have any action .
to compute angle first compute sobelx and sobely filter and then compute angle with arctan

please help me

// calcute angle***************
public void computeAngle()
{
   
    sobelx();
    sobely();
    angleIMG = new double[imgsx.Width, imgsx.Height];
    try
    {
        for(int i=10 ; i<=200 ; i++)
        {
            for (int j = 10; j <= 150; j++)
            {
                if (Oy(i, j) != 0.0)
                {
                    angleIMG[i, j] = Math.Atan(Ox(i, j) / Oy(i, j)) / 2 + Math.PI / 2;
                    textBox1.Text += Math.Abs(angleIMG[i, j]).ToString();
                }
                else
                {
                    angleIMG[i, j] = 0.0;
                }
            }
              textBox1.Text = "\n";
        }
    }
    catch (Exception e1)
    {
        MessageBox.Show(e1.Message);
    }
//get Ox(i,j)****************
public double Ox(int i, int j)
{
    double wx=0.0;
    for (int u = i - 1; u <= i + 1; u++)
    {
        for (int v = i - 1; v <= i + 1; v++)
        {
            Color cw = imgsx.GetPixel(u, v);
            Color cw1 = imgsy.GetPixel(u, v);
            wx =wx+ 2*( cw.R * cw1.R);
        }
    }
    return wx;
}
//get Oy(i,j)****************
public double Oy(int i, int j)
{
    double wy = 0.0;
    for (int u = i - 1; u <= i + 1; u++)
    {
        for (int v = i - 1; v <= i + 1; v++)
        {
            Color cw=imgsx.GetPixel(u, v);
            Color cw1=imgsy.GetPixel(u, v);
            wy =wy+ Math.Pow (cw.R,2 )- Math.Pow(cw1.R,2);
        }
    }
    return wy;
}

推荐答案


这篇关于c#中的指纹检测角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 17:24