• 大小: 0.60M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-05-03
  • 语言: C#
  • 标签: C#  NIVision  

资源简介

环境vs2019 .net472 vdm2013

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NationalInstruments.Vision.Analysis;
using NationalInstruments.Vision;
using System.Diagnostics;

namespace WindowsFormsApp2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private double x = 0;
        private double y = 0;
        private double out_rad = 0;
        private double in_rad = 0;

        private SpokeDirection sdir;
        private EdgePolaritySearchMode spol;
        private RakeProcessType sedge;
        private uint skernel;
        private double sthr;

        private void button3_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)
            {
                imageViewer1.Image.ReadFile(_dlg.FileName);
            }
        }

        private void button1_Click(object sender EventArgs e)
        {
            if (imageViewer1.Roi.Count > 0)
            {
                if (imageViewer1.Roi[0].Type != ContourType.Annulus)
                {
                    MessageBox.Show(“请选择环形工具!“);
                }
                else
                {
                    AnnulusContour a;
                    a = (AnnulusContour)imageViewer1.Roi[0].Shape;         //AnnulusContour _a = new AnnulusContour();
                    x = a.Center.X;
                    y = a.Center.Y;
                    in_rad = a.InnerRadius;
                    out_rad = a.OuterRadius;
                    //imageViewer1.Roi[0];


                }
            }

            imageViewer1.Roi.Clear();
        }

        private void button2_Click(object sender EventArgs e)
        {
            skernel = Convert.ToUInt32(textBox1.Text);
            sthr = Convert.ToDouble(textBox2.Text);
            findcircle(imageViewer1.Image new AnnulusContour(new PointContour(x y) in_rad out_rad 0 360) sdir spol sedge skernel sthr false 0 0 0 0 0 0);
        }

        private void findcircle(VisionImage src AnnulusContour area SpokeDirection dir EdgePolaritySearchMode pol RakeProcessType edge uint kernelsize double thr bool carlibration double orgx double orgy double orga double calx double caly double cala)
        {
            Roi _varoi = new Roi();
            FindCircularEdgeOptions _vaopt = new FindCircularEdgeOptions();
            CircularEdgeFitOptions _vafitopt = new CircularEdgeFitOptions();
            FindCircularEdgeReport _vareport = new FindCircularEdgeReport();
            CoordinateSyst

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     58880  2020-08-12 11:59  WindowsFormsApp2\.vs\WindowsFormsApp2\v16\.suo

     文件        189  2020-08-12 10:38  WindowsFormsApp2\WindowsFormsApp2\App.config

     文件     284672  2013-05-16 11:57  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Common.dll

     文件      79360  2013-05-16 11:54  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Common.Native.dll

     文件     454301  2013-05-16 11:57  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Common.xml

     文件       4608  2013-05-16 11:53  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.MStudioCLM.dll

     文件      29696  2013-05-16 11:53  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.NiLmClientDLL.dll

     文件     209920  2014-05-16 20:41  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Vision.Common.dll

     文件     909026  2014-05-16 20:41  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Vision.Common.xml

     文件     508928  2013-06-23 04:54  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Vision.dll

     文件    3183225  2013-06-23 04:53  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\NationalInstruments.Vision.xml

     文件      15360  2020-08-12 11:58  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe

     文件        902  2020-08-12 10:40  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe.config

     文件      36352  2020-08-12 11:58  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.pdb

     文件    5039926  2017-05-12 22:33  WindowsFormsApp2\WindowsFormsApp2\bin\Debug\测试.bmp

     文件       6122  2020-08-12 11:58  WindowsFormsApp2\WindowsFormsApp2\Form1.cs

     文件      10072  2020-08-12 11:54  WindowsFormsApp2\WindowsFormsApp2\Form1.Designer.cs

     文件       6695  2020-08-12 11:54  WindowsFormsApp2\WindowsFormsApp2\Form1.resx

     文件        214  2020-08-12 10:38  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\.NETframeworkVersion=v4.7.2.AssemblyAttributes.cs

     文件      12886  2020-08-12 11:59  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7770  2020-08-12 10:40  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2020-08-12 11:58  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CopyComplete

     文件         42  2020-08-12 10:40  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CoreCompileInputs.cache

     文件       2307  2020-08-12 11:53  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.FileListAbsolute.txt

     文件       1012  2020-08-12 11:54  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.GenerateResource.cache

     文件        424  2020-08-12 11:53  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csprojAssemblyReference.cache

     文件      15360  2020-08-12 11:58  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.exe

     文件        902  2020-08-12 10:40  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.exe.config

     文件        180  2020-08-12 11:54  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Form1.resources

     文件      36352  2020-08-12 11:58  WindowsFormsApp2\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.pdb

............此处省略23个文件信息

评论

共有 条评论