• EmguCv“线段” 结构类型学习


    1. 文件所在

    Namespace: Emgu.CV.Structure
    Assembly: Emgu.CV (in Emgu.CV.dll) Version: 3.0.0.2157 (3.0.0.2157)

    类型分:LineSegment2D 、 LineSegment2DF、 LineSegment3DF

    1. 2.     函数说明:

    2.1构造函数:LineSegment2DF

    测试夹角的验证:画线确认之间夹角

    部分代码:

    Point[] a = new Point[2];  //构造线的点数组

            LineSegment2DF [] lin1=new LineSegment2DF [2]; 线段的数组

            int lin_num = 0; //线段数字超下标

            private void pictureBox1_MouseDown(object sender, MouseEventArgs e)

            {

               

                if (e.Button == MouseButtons.Left)

                {

                    if (butleft_num < 2)  //

                    {

     

                        ++butleft_num;

                        a[butleft_num - 1] = e.Location;

                    }

                    if (butleft_num> 2)

                    {

                        butleft_num = 0;

                    }

                    if (butleft_num == 2)

                    {

                        if (lin_num < 2)

                        {

                            ++lin_num;

                           

                            lin1[lin_num - 1]

                                    = new LineSegment2DF(a[0], a[1]);

                        }

                        Graphics g1 = pictureBox1.CreateGraphics(); // 画图

                        g1.DrawLine(new Pen(Color.Red,5), a[0], a[1]); 画线

                        g1.Dispose();

                        butleft_num = 0;

                        if (lin_num==2)

                        {

                            label1.Text = lin1[1].GetExteriorAngleDegree(lin1[0]).ToString(); //验证角度计算

                        }

                        if (lin_num>=2)

                        {

                            lin_num = 0;

                        }

                    }

                }

            }

  • 相关阅读:
    第一类斯特林数,第二类斯特林数,组合数
    P1005 矩阵取数游戏
    P4609 [FJOI2016]建筑师
    射击小游戏一03(碰撞检测)
    CCLabelAtlas 特效 自定义CCLabelTTF
    CCSpriteBatchNode cocos2dx使用
    cocos2dx plist动画
    CCSpriteBatchNode 渲染
    cocos2dx 实现翻牌效果
    cocos2dx技能冷却
  • 原文地址:https://www.cnblogs.com/nulidemaomaochong/p/8480802.html
Copyright © 2020-2023  润新知