资源简介
环境VS2019 VDM2013
代码片段和文件信息
using NationalInstruments.Vision;
using NationalInstruments.Vision.Analysis;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private double Search_Left = 0;
private double Search_Width = 0;
private double Search_Top = 0;
private double Search_Height = 0;
private SearchDirection sdir = SearchDirection.LeftToRight;
private EdgePolaritySearchMode spol = EdgePolaritySearchMode.All;
private StraightEdgeSearchMode sedge = StraightEdgeSearchMode.FirstRakeEdges;
private uint skernel = 3U;
private double sthr = 200D;
private void btn_RdFile_Click(object sender EventArgs e)
{
OpenFileDialog _dlg = new OpenFileDialog();
_dlg.Filter = “bmp|*.bmp“;
_dlg.FileName = ““;
_dlg.InitialDirectory = System.IO.Directory.GetCurrentDirectory();
if (_dlg.ShowDialog() == DialogResult.OK)
{
iv_Main.Image.ReadFile(_dlg.FileName);
}
}
private void btn_SearchArea_Click(object sender EventArgs e)
{
if (iv_Main.Roi.Count > 0)
{
if (iv_Main.Roi[0].Type != ContourType.Rectangle)
{
MessageBox.Show(“请选择矩形工具!“);
}
else
{
Search_Left = iv_Main.Roi.GetBoundingRectangle().Left;
Search_Top = iv_Main.Roi.GetBoundingRectangle().Top;
Search_Width = iv_Main.Roi.GetBoundingRectangle().Width;
Search_Height = iv_Main.Roi.GetBoundingRectangle().Height;
}
}
else
{
MessageBox.Show(“请试用矩形工具绘制搜索区域!“);
}
iv_Main.Roi.Clear();
}
private void FindStatight(VisionImage srcimg RectangleContour rec SearchDirection searchdir EdgePolaritySearchMode searchpol StraightEdgeSearchMode searchedge uint kernelsize double minithr bool calibration double baseX double baseY double baseAngle double calibrationX double calibrationY double calibrationaAngle)
{
Roi _vaRoi = new Roi();
StraightEdgeOptions _vaOpt = new StraightEdgeOptions();
EdgeOptions _vaEdgeOpt = new EdgeOptions();
StraightEdgeReport _vaReport = new StraightEdgeReport();
CoordinateSystem _vaNewSystem = new CoordinateSystem(new PointContour(calibrationX calibrationY) calibrationaAngle AxisOrientation.Direct);
CoordinateSystem _vabaseSystem = new CoordinateSystem(new PointContour(baseX baseY) baseAngle AxisOrientation.Direct);
OverlayTextOptions _vaTextOpt = new OverlayTextOptions();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 61440 2020-08-08 13:27 cs找直线\.vs\WindowsFormsApp1\v16\.suo
文件 189 2020-08-08 10:42 cs找直线\WindowsFormsApp1\App.config
文件 284672 2013-05-16 11:57 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Common.dll
文件 79360 2013-05-16 11:54 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Common.Native.dll
文件 454301 2013-05-16 11:57 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Common.xm
文件 4608 2013-05-16 11:53 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.MStudioCLM.dll
文件 29696 2013-05-16 11:53 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.NiLmClientDLL.dll
文件 209920 2014-05-16 20:41 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Vision.Common.dll
文件 909026 2014-05-16 20:41 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Vision.Common.xm
文件 508928 2013-06-23 04:54 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Vision.dll
文件 3183225 2013-06-23 04:53 cs找直线\WindowsFormsApp1\bin\Debug\NationalInstruments.Vision.xm
文件 16896 2020-08-08 13:25 cs找直线\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe
文件 902 2020-08-08 10:55 cs找直线\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config
文件 38400 2020-08-08 13:25 cs找直线\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb
文件 5039926 2017-05-12 22:33 cs找直线\WindowsFormsApp1\bin\Debug\测试.bmp
文件 8363 2020-08-08 13:27 cs找直线\WindowsFormsApp1\Form1.cs
文件 11071 2020-08-08 13:16 cs找直线\WindowsFormsApp1\Form1.Designer.cs
文件 8458 2020-08-08 12:03 cs找直线\WindowsFormsApp1\Form1.resx
文件 214 2020-08-08 10:42 cs找直线\WindowsFormsApp1\obj\Debug\.NETfr
文件 2770 2020-08-08 10:43 cs找直线\WindowsFormsApp1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7769 2020-08-08 11:41 cs找直线\WindowsFormsApp1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 0 2020-08-08 13:25 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CopyComplete
文件 42 2020-08-08 11:51 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache
文件 2307 2020-08-08 11:51 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.FileListAbsolute.txt
文件 1012 2020-08-08 12:04 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache
文件 424 2020-08-08 13:16 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csprojAssemblyReference.cache
文件 16896 2020-08-08 13:25 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe
文件 902 2020-08-08 10:55 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe.config
文件 180 2020-08-08 12:04 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources
文件 38400 2020-08-08 13:25 cs找直线\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb
............此处省略24个文件信息
- 上一篇:Nivision找圆
- 下一篇:灵信LED开发
评论
共有 条评论