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

做网站开发需要学什么软件网站搜索优化价格

做网站开发需要学什么软件,网站搜索优化价格,手机h5模板,晋江网站建设公司visionpro案例: 轴承缺珠检测 项目概述思路以及解题过程1.图像预处理:使用CogIPOneImageTool对图像进行灰度化、去噪等预处理操作,以提高后续处理的准确性。2.特征提取:使用CogPMAlignTool提供的工具提取轴承的概念建特征3.图像校正: 使用Cog…

visionpro案例: 轴承缺珠检测

  • 项目概述
  • 思路以及解题过程
    • 1.图像预处理:使用CogIPOneImageTool对图像进行灰度化、去噪等预处理操作,以提高后续处理的准确性。
    • 2.特征提取:使用CogPMAlignTool提供的工具提取轴承的概念建特征
    • 3.图像校正: 使用CogFixtureTool,并把上面CogPMAlignTool找到的GetPose()传入进行位置矫正
    • 4.圆展开: CogFindCircleTool找圆并通过找到的圆心坐标对CogPolarUnwrapTool的圆心赋值将图像从笛卡尔坐标系转换到极坐标系
    • 5.模板匹配: 对展开后的图像进行模板匹配,匹配圆珠,没有匹配的地方则缺少,通过代码显示出来,并映射到原图中
    • 6.完整代码展示
  • 结论

项目概述

我们需要对下面轴承的缺珠情况进行检测,并且把缺珠的位置在图像上标记出来,效果如下:
在这里插入图片描述

思路以及解题过程

1.图像预处理:使用CogIPOneImageTool对图像进行灰度化、去噪等预处理操作,以提高后续处理的准确性。

在这里插入图片描述

2.特征提取:使用CogPMAlignTool提供的工具提取轴承的概念建特征

在这里插入图片描述

3.图像校正: 使用CogFixtureTool,并把上面CogPMAlignTool找到的GetPose()传入进行位置矫正

在这里插入图片描述

4.圆展开: CogFindCircleTool找圆并通过找到的圆心坐标对CogPolarUnwrapTool的圆心赋值将图像从笛卡尔坐标系转换到极坐标系

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

5.模板匹配: 对展开后的图像进行模板匹配,匹配圆珠,没有匹配的地方则缺少,通过代码显示出来,并映射到原图中

在这里插入图片描述

6.完整代码展示

#region namespace imports
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Cognex.VisionPro;
using Cognex.VisionPro.ToolBlock;
using Cognex.VisionPro3D;
using Cognex.VisionPro.ImageProcessing;
using Cognex.VisionPro.PMAlign;
using Cognex.VisionPro.CalibFix;
using Cognex.VisionPro.Caliper;
#endregionpublic class CogToolBlockAdvancedScript : CogToolBlockAdvancedScriptBase
{#region Private Member Variablesprivate Cognex.VisionPro.ToolBlock.CogToolBlock mToolBlock;#endregionCogGraphicCollection col = new CogGraphicCollection();/// <summary>/// Called when the parent tool is run./// Add code here to customize or replace the normal run behavior./// </summary>/// <param name="message">Sets the Message in the tool's RunStatus.</param>/// <param name="result">Sets the Result in the tool's RunStatus</param>/// <returns>True if the tool should run normally,///          False if GroupRun customizes run behavior</returns>public override bool GroupRun(ref string message, ref CogToolResultConstants result){// To let the execution stop in this script when a debugger is attached, uncomment the following lines.// #if DEBUG// if (System.Diagnostics.Debugger.IsAttached) System.Diagnostics.Debugger.Break();// #endifcol.Clear();CogPMAlignTool pm = mToolBlock.Tools["CogPMAlignTool2"] as CogPMAlignTool;CogPolarUnwrapTool Polar = mToolBlock.Tools["CogPolarUnwrapTool1"] as CogPolarUnwrapTool;//声明一个列表  用来储存X坐标List<double> listX = new List<double>();// Run each tool using the RunTool functionforeach(ICogTool tool in mToolBlock.Tools)mToolBlock.RunTool(tool, ref message, ref result);double y = 0,yTotal = 0;for(int i = 0 ; i < pm.Results.Count;i++){//将x坐标数据  添加到列表中listX.Add(pm.Results[i].GetPose().TranslationX);yTotal += pm.Results[i].GetPose().TranslationY;}//Y平均值y = yTotal / pm.Results.Count;//排序listX.Sort();//找缺陷的 比较逻辑for(int i = 0; i < listX.Count - 1;i++){if(listX[i+1] - listX[i] > 60){double x = (listX[i + 1] + listX[i]) / 2;double xIN,yIN;Polar.RunParams.GetInputPointFromOutputPoint(Polar.InputImage, Polar.Region, x, y, out xIN, out yIN);col.Add(CreateCircle(xIN,yIN));}}//第一个缺失if(listX[0]>40){double x = listX[0] - 40;double xIN,yIN;Polar.RunParams.GetInputPointFromOutputPoint(Polar.InputImage, Polar.Region, x, y, out xIN, out yIN);col.Add(CreateCircle(xIN,yIN));}//最后一个缺失if(listX[listX.Count-1] < 750){double x = listX[listX.Count-1] + 40;double xIN,yIN;Polar.RunParams.GetInputPointFromOutputPoint(Polar.InputImage, Polar.Region, x, y, out xIN, out yIN);col.Add(CreateCircle(xIN, yIN));}return false;}public CogCircle CreateCircle(double x,double y){CogCircle c = new CogCircle();c.CenterX = x;c.CenterY = y;c.Radius = 10;c.LineWidthInScreenPixels = 4;c.Color = CogColorConstants.Red;return c;}#region When the Current Run Record is Created/// <summary>/// Called when the current record may have changed and is being reconstructed/// </summary>/// <param name="currentRecord">/// The new currentRecord is available to be initialized or customized.</param>public override void ModifyCurrentRunRecord(Cognex.VisionPro.ICogRecord currentRecord){}#endregion#region When the Last Run Record is Created/// <summary>/// Called when the last run record may have changed and is being reconstructed/// </summary>/// <param name="lastRecord">/// The new last run record is available to be initialized or customized.</param>public override void ModifyLastRunRecord(Cognex.VisionPro.ICogRecord lastRecord){foreach(ICogGraphic g in col){mToolBlock.AddGraphicToRunRecord(g, lastRecord, "CogIPOneImageTool1.InputImage", "");}}#endregion#region When the Script is Initialized/// <summary>/// Perform any initialization required by your script here/// </summary>/// <param name="host">The host tool</param>public override void Initialize(Cognex.VisionPro.ToolGroup.CogToolGroup host){// DO NOT REMOVE - Call the base class implementation first - DO NOT REMOVEbase.Initialize(host);// Store a local copy of the script hostthis.mToolBlock = ((Cognex.VisionPro.ToolBlock.CogToolBlock)(host));}#endregion}

结论

通过上述步骤和控件的使用,可以实现对轴承的缺陷检测。代码中使用了Cognex VisionPro工具进行特征提取和缺陷识别,并在图像上标记缺陷位置。项目可以根据实际需求进行扩展和优化

http://www.dtcms.com/wzjs/65953.html

相关文章:

  • 中国建筑资讯网河北百度推广seo
  • 淘宝网网页seo如何提升排名收录
  • 建设网络强国征文seo排名点击
  • 北京市住房城乡建设委员会官方网站北京网络营销推广外包
  • 在网站上做教学直播平台多少钱青岛网站建设方案服务
  • 威海建设委员会网站百度网站官网入口
  • 河南省建设厅官方网站页面关键词优化
  • 如果启动浏览器就能直接打开一个常用的网站主页_要怎么做?seo的作用是什么
  • 西安企业建站营销策划书
  • 石家庄网站建设备案seo性能优化
  • 娱乐类网站软文代写
  • 网页制作与网站建设设计价格目前在哪个平台做推广好
  • 云平台网站优化网站推广seo
  • 国外移动端网站模板宁波网络营销策划公司
  • 成都网站建设竞价托管公司联系方式
  • 如何给一个网站做定时的更新武汉网站制作
  • 网站页面太多是否做静态有友情链接的网站
  • 专业网站建设微信官网开发网页设计怎么做
  • 怎么做狼视听网站怎么弄推广广告
  • 张浦专业做网站百度推广怎么收费的
  • 网站建设平台推广网站关键词在哪里看
  • 手机网站自适应宽度百度广告投诉电话客服24小时
  • 软件开发技术培训中心网站优化包括哪些
  • 电商网站那些功能用到静态化功能app注册推广任务平台
  • 天津做再生资源交易的网站搜狗关键词排名此会zjkwlgs
  • 怎么使自己做的网站有音乐外贸网站建设优化推广
  • asp.net网站开发之美海淀区seo搜索引擎
  • 5g互联如何取消网站备案个人网站怎么做
  • 广州网站建设定制哪家口碑好公司怎么在网上推广
  • 人才共享网站的建设方案怎么写网站模板中心