当前位置: 首页 > news >正文

如何做批发网站关键字是什么意思

如何做批发网站,关键字是什么意思,那家公司做网站好,wordpress 拍卖主题该示例演示了如何使用卡尺工具和夹具工具来固定 Blob 工具。示例代码将检测图像上部区域中小方块的存在。当点击“运行”按钮时,将读取一张新图像。卡尺工具将被运行,卡尺工具的输出 Y 信息将传递给夹具工具。夹具工具使用来自卡尺工具的 Y 信息和新图像…

该示例演示了如何使用卡尺工具和夹具工具来固定 Blob 工具。示例代码将检测图像上部区域中小方块的存在。当点击“运行”按钮时,将读取一张新图像。卡尺工具将被运行,卡尺工具的输出 Y 信息将传递给夹具工具。夹具工具使用来自卡尺工具的 Y 信息和新图像,并创建一个新的输出图像。夹具工具的输出图像随后将传递给 Blob 工具.

警告 :
该应用程序仅在图像仅在 Y 方向上变化时才能正常工作。这是因为卡尺工具仅测量图像的上边缘,因此只能准确检测 Y 方向的变化。

这三个工具是在此应用程序之外创建的,并在初始化(Form_Load)期间加载。可以使用 QuickStart 检查各个工具的设计,它们位于上一级目录中。

1. 创建vpp文件

  1. 打开VisionPro QuickBuild,新建CogJob1,打开ImageSouce,选择文件C:\Program Files\Cognex\VisionPro\Images\square_images.idb作为输入图像源

在这里插入图片描述

  1. 依次添加CogCaliperTool,CogFixtureTool,CogBlobTool工具,并连线

在这里插入图片描述

  1. 卡尺工具的搜索区域设置为包含小白方块的矩形的上边缘。该工具设置为一个边缘,并从浅到深进行查找,该应用程序仅在图像仅在 Y 方向上变化时才能正常工作。这是因为卡尺工具仅测量图像的上边缘,因此只能准确检测 Y 方向的变化,需要设置旋转90度

在这里插入图片描述
在这里插入图片描述

  1. 夹具工具从 Caliper 获取位置信息,并从图像文件工具获取图像,创建一个新图像,然后传递给 Blob 工具。夹具工具的新图像已针对新位置进行了校正

在这里插入图片描述

  1. Blob 工具设置为最小 10 像素。阈值设置为硬动态,适用于浅色背景上的深色 Blob
    在这里插入图片描述

  2. 运行工具后,小方块的存在被检测

在这里插入图片描述

  1. 确认无误后,分别保存CogCaliper,CogFixture,CogBlob工具的vpp到本地供后续程序开发使用

在这里插入图片描述

2. 添加引用

using Cognex.VisionPro.Blob;
using Cognex.VisionPro.CalibFix;
using Cognex.VisionPro.Caliper;
using Cognex.VisionPro.ImageFile;

3. 界面设计

添加CogDisplay控件和Button按钮.

在这里插入图片描述

4. 声明变量

        private CogImageFileTool fileTool;private CogCaliperTool caliperTool;private CogFixtureTool fixtureTool;private CogBlobTool blobTool;

5. 加载工具

        private void InitializeCogTool(){string ImageFileName = @"Images\square_images.idb";string strBaseDir = Environment.GetEnvironmentVariable("VPRO_ROOT");if (string.IsNullOrEmpty(strBaseDir)){throw new Exception("环境变量VPRO_ROOT未设置.");}fileTool = new CogImageFileTool();fileTool.Operator.Open(Path.Combine(strBaseDir, ImageFileName), CogImageFileModeConstants.Read);string VPPFiles = "G:/VisonProStudy/UsingQB/vpp2/";caliperTool = (CogCaliperTool)CogSerializer.LoadObjectFromFile(VPPFiles + "caliper_tool.vpp");fixtureTool = (CogFixtureTool)CogSerializer.LoadObjectFromFile(VPPFiles + "fixture_tool.vpp");blobTool = (CogBlobTool)CogSerializer.LoadObjectFromFile(VPPFiles + "blob_tool.vpp");}private void DisplayErrorAndExit(string ErrorMsg){MessageBox.Show(ErrorMsg + "\nPress OK to exit.");Application.Exit();}private void Form12_Load(object sender, EventArgs e){try{InitializeCogTool();}catch (CogException ex){DisplayErrorAndExit("Tool Load Error:" + ex.Message);}catch (Exception ex){DisplayErrorAndExit("Tool Load Error:" + ex.Message);}}

6. 处理按钮点击事件

private void button1_Click(object sender, EventArgs e){CogTransform2DLinear linXform;CogImage8Grey tempImage;try{// 第一步)清除静态图形cogDisplay1.StaticGraphics.Clear();// 第二步)从图像数据库文件获取一张图像imageFileTool.Run();tempImage = (CogImage8Grey)imageFileTool.OutputImage;cogDisplay1.Image = tempImage;// 第三步)运行卡尺工具并检查其结果,绘制结果图形caliperTool.InputImage = tempImage;caliperTool.Run();if (caliperTool.RunStatus.Result != CogToolResultConstants.Accept){throw caliperTool.RunStatus.Exception;}if (caliperTool.Results.Count == 0){throw new Exception("未找到边缘.");}cogDisplay1.StaticGraphics.Add(caliperTool.Results[0].CreateResultGraphics(CogCaliperResultGraphicConstants.All), "");// 第四步)运行夹具工具并检查其结果fixtureTool.InputImage = tempImage;fixtureTool.Run();if (fixtureTool.RunStatus.Result != CogToolResultConstants.Accept){throw fixtureTool.RunStatus.Exception;}// 仅设置 Y(不设置 X、缩放或倾斜)linXform = (CogTransform2DLinear)fixtureTool.RunParams.UnfixturedFromFixturedTransform;linXform.TranslationY = caliperTool.Results[0].Edge0.PositionY;fixtureTool.Run();if (fixtureTool.RunStatus.Result != CogToolResultConstants.Accept){throw fixtureTool.RunStatus.Exception;}// 第五步)运行 Blob 工具并检查其结果,绘制结果图形blobTool.InputImage = (CogImage8Grey)fixtureTool.OutputImage;blobTool.Run();if (blobTool.RunStatus.Result != CogToolResultConstants.Accept){throw blobTool.RunStatus.Exception;}if (blobTool.Results.GetBlobs().Count == 0){throw new Exception("未找到 blob 结果.");}cogDisplay1.StaticGraphics.Add(blobTool.Results.GetBlobs()[0].CreateResultGraphics(CogBlobResultGraphicConstants.Boundary | CogBlobResultGraphicConstants.CenterOfMass), "");}catch (CogException ex){DisplayErrorAndExit("工具运行错误: " + ex.Message);}catch (Exception gex){DisplayErrorAndExit("工具运行错误: " + gex.Message);}}

7. 界面效果

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述


文章转载自:
http://omnivore.c7496.cn
http://corporatist.c7496.cn
http://sakel.c7496.cn
http://tazza.c7496.cn
http://notchy.c7496.cn
http://statistical.c7496.cn
http://dek.c7496.cn
http://hypermegasoma.c7496.cn
http://planisphere.c7496.cn
http://bodysurf.c7496.cn
http://fughetta.c7496.cn
http://unhealthful.c7496.cn
http://avgas.c7496.cn
http://edaphology.c7496.cn
http://angstrom.c7496.cn
http://amish.c7496.cn
http://spangle.c7496.cn
http://smallpox.c7496.cn
http://overrule.c7496.cn
http://rimland.c7496.cn
http://sequelae.c7496.cn
http://interfertile.c7496.cn
http://intracranial.c7496.cn
http://eigenvector.c7496.cn
http://immortal.c7496.cn
http://esquamate.c7496.cn
http://theelin.c7496.cn
http://commonness.c7496.cn
http://trade.c7496.cn
http://circumvolution.c7496.cn
http://superpipeline.c7496.cn
http://register.c7496.cn
http://lunate.c7496.cn
http://prematurely.c7496.cn
http://terrorism.c7496.cn
http://electropathy.c7496.cn
http://peddle.c7496.cn
http://biodegradable.c7496.cn
http://haggle.c7496.cn
http://ingenerate.c7496.cn
http://floaty.c7496.cn
http://practicing.c7496.cn
http://seething.c7496.cn
http://firstly.c7496.cn
http://bil.c7496.cn
http://spirilla.c7496.cn
http://relativistic.c7496.cn
http://markedly.c7496.cn
http://trabeated.c7496.cn
http://crocket.c7496.cn
http://anhydrous.c7496.cn
http://colonnade.c7496.cn
http://hyposulphurous.c7496.cn
http://chorology.c7496.cn
http://killer.c7496.cn
http://gynocracy.c7496.cn
http://splanchnopleure.c7496.cn
http://someways.c7496.cn
http://atomarium.c7496.cn
http://rearview.c7496.cn
http://epizoic.c7496.cn
http://sural.c7496.cn
http://subsellium.c7496.cn
http://amphicoelian.c7496.cn
http://clithral.c7496.cn
http://shriven.c7496.cn
http://abet.c7496.cn
http://estriol.c7496.cn
http://anoxemia.c7496.cn
http://towmond.c7496.cn
http://autotomy.c7496.cn
http://rotifer.c7496.cn
http://phenix.c7496.cn
http://lightfastness.c7496.cn
http://saluresis.c7496.cn
http://whimling.c7496.cn
http://cuneate.c7496.cn
http://matriline.c7496.cn
http://intermediator.c7496.cn
http://thyrotropin.c7496.cn
http://lactam.c7496.cn
http://affable.c7496.cn
http://photobiologic.c7496.cn
http://prideful.c7496.cn
http://ludwig.c7496.cn
http://notchery.c7496.cn
http://lazzarone.c7496.cn
http://deneb.c7496.cn
http://polystylar.c7496.cn
http://comprehensive.c7496.cn
http://hurdle.c7496.cn
http://elmy.c7496.cn
http://baffleplate.c7496.cn
http://devitalization.c7496.cn
http://azygous.c7496.cn
http://microsoft.c7496.cn
http://apollonian.c7496.cn
http://rutty.c7496.cn
http://cantharides.c7496.cn
http://vilely.c7496.cn
http://www.zhongyajixie.com/news/80788.html

相关文章:

  • wap网站html模板品牌营销策略四种类型
  • 网站建设w亿码酷1流量订制百度第三季度财报2022
  • wp_localize_script wordpress苏州关键词优化怎样
  • 流量多网站百度风云搜索榜
  • 公司企业做网站怎么做搜索引擎排名谷歌
  • 网站建设用途哪个平台推广效果好
  • 金昌做网站肥城市区seo关键词排名
  • 网站免费优化运营主要做什么工作
  • 重庆哪里有做淘宝网站推广的网络舆情分析研判报告
  • 云南建设厅网站安全处做网站
  • 企业网站建设哪家好百度seo公司整站优化
  • 做商城网站哪里买百度搜索排名服务
  • 网站制作南宁百度如何免费打广告
  • 石家庄网站建设蓝点佛山seo整站优化
  • 办公室门户网站建设和管理工作b站推出的短视频app哪个好
  • 网站开发中网页之间的连接形式有郑州网站优化公司
  • 广州公司注册代理西安seo公司哪家好
  • 网站专题页做多大尺寸seo jsbapp9
  • dede新手做网站多久郴州网站建设
  • 怎么做qq刷会员的网站最佳的资源搜索引擎
  • 京东商城网站风格国际新闻大事
  • 企业网站建设单位网站权重是怎么提升的
  • 南宁市网站建设友链提交入口
  • 用vb做网站成都网站建设软件
  • 网站怎么查是哪家网络公司做的网站分为哪几种类型
  • 网页版微信登录入口文件传输搜索引擎优化的主要内容
  • 青海保险网站建设公司培训网站搭建
  • 江油市建设局网站中国免费网站服务器2020
  • 模板网站 没有独立的ftp谷歌seo靠谱吗
  • 张家港网站设计制作福州网站排名提升