ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

机器视觉12-1 图形集合

机器视觉12-1 图形集合 图形集合一点CogPointMarkerCogPointMarker PointMarker1 new CogPointMarker();//创建对象点CogPointMarker //注意运行工具 PointMarker1.X 100; PointMarker1.Y 100;//点坐标 PointMarker1.Color CogColorConstants.Red;//点颜色设置 PointMarker1.LineWidthInScreenPixels 20;//点大小设置二直线CogLineCogLine Line1 new CogLine();//创建对象直线CogLine Line1.X 10; Line1.Y 10;//线坐标也可以用 Line1.Rotation设置角度 Line1.Color CogColorConstants.Red;//直线颜色设置 Line1.LineWidthInScreenPixels 20;//直线宽度三.矩形CogRectangleCogRectangle Rectangle1 new CogRectangle();//创建对象矩形CogRectangle Rectangle1.X 200; Rectangle1.Y 100;//矩形坐标 Rectangle1.Width 100; Rectangle1.Height 100;//矩形长宽也可以用 Rectangle1.Rotation设置角度 Rectangle1.Color CogColorConstants.Red;//颜色 Rectangle1.LineWidthInScreenPixels 20;四.圆形 CogCircleCogCircle Circle1 new CogCircle();////创建对象矩形CogRectangle Circle1.CenterX 192; Circle1.CenterY 100;//圆坐标 Circle1.Radius 10;//圆半径 Circle1.Color CogColorConstants.Red;//圆颜色 Circle1.LineWidthInScreenPixels 20;//圆线宽度五.多边形 CogPolygonCogPolygon p new CogPolygon();p mBlob.Results.GetBlobs()[i].GetBoundary();p.Color CogColorConstants.Red;六. 图形基类 ICogGraphic所有图形基于 ICogGraphic类接口七.图形集合CogGraphicCollection包含的对象类型为 ICogGraphic 所有图形对象 都可以直接放入集合中多种图形添加 方式创建多个List创建一个ListICogGraphic创建一个CogGraphicCollectionvp脚本在vs中调试方式作用利用vs断点调试模式 对程序进行排错1.开启VisionPro脚本调试功能if (system.diagnostics.debugger.isattached)if (system.diagnostics.debugger.isattached) 用于检测当前进程是否有调试器附加system.diagnostics.debugger.break();主动触发调试器中断在代码里手动打了一个断点调试1.打开Visual Studio软件1.选择附加 搜索Cog 程序2.在附加的进程上选择VisionPro脚本的进程1.运行设置断点调试
返回列表