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

福州最好的网站建设排名优化网站

福州最好的网站建设,排名优化网站,中国做陶壶的网站有哪些,企业官网 开源划痕检测,我这里用到的是Sobel算子和blob斑点匹配以及blob里面的形态学调整 Sobel 是一种在数字图像处理和计算机视觉领域广泛应用的算法,主要用于边缘检测 脚本展示 #region namespace imports using System; using System.Collections; using System.Drawing; …

 划痕检测,我这里用到的是Sobel算子和blob斑点匹配以及blob里面的形态学调整

Sobel 是一种在数字图像处理和计算机视觉领域广泛应用的算法,主要用于边缘检测

脚本展示 

#region namespace imports
using System;
using System.Collections;
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.Blob;
#endregionpublic class CogToolBlockAdvancedScript : CogToolBlockAdvancedScriptBase
{#region Private Member Variablesprivate Cognex.VisionPro.ToolBlock.CogToolBlock mToolBlock;#endregionCogGraphicCollection dt = 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();// #endifCogBlobTool blob = mToolBlock.Tools["CogBlobTool1"]as CogBlobTool;// Run each tool using the RunTool functionforeach(ICogTool tool in mToolBlock.Tools)mToolBlock.RunTool(tool, ref message, ref result);for(int i = 0;i < blob.Results.GetBlobs().Count;i++){double x = blob.Results.GetBlobs()[i].CenterOfMassX;double y = blob.Results.GetBlobs()[i].CenterOfMassY;dt.Add(Create(x, y));}return false;}private CogRectangleAffine Create(double x, double y){CogRectangleAffine tt = new CogRectangleAffine();tt.SideXLength = 8;tt.SideYLength = 14;tt.CenterX = x;tt.CenterY = y;tt.Color = CogColorConstants.Red;tt.LineWidthInScreenPixels = 4;return tt;}#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 s in dt){mToolBlock.AddGraphicToRunRecord(s, lastRecord, "CogSobelEdgeTool1.InputImage", "script");}}#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}

 效果

下面的我们先用Pixel 通过直方图调节来突出边缘和表面特征

在通过调节二值化阈值等来突出

 脚本

#region namespace imports
using System;
using System.Collections;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Cognex.VisionPro;
using Cognex.VisionPro.ToolBlock;
using Cognex.VisionPro3D;
using Cognex.VisionPro.PixelMap;
using Cognex.VisionPro.Blob;
#endregionpublic class CogToolBlockAdvancedScript : CogToolBlockAdvancedScriptBase
{#region Private Member Variablesprivate Cognex.VisionPro.ToolBlock.CogToolBlock mToolBlock;#endregionCogGraphicCollection dt = new CogGraphicCollection();CogPolygon polygon;/// <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();// #endifdt.Clear();CogBlobTool blob = mToolBlock.Tools["CogBlobTool1"]as CogBlobTool;// Run each tool using the RunTool functionforeach(ICogTool tool in mToolBlock.Tools)mToolBlock.RunTool(tool, ref message, ref result);for(int i = 0;i < blob.Results.GetBlobs().Count;i++){polygon = new CogPolygon();polygon = blob.Results.GetBlobs()[i].GetBoundary();polygon.Color = CogColorConstants.Red;dt.Add(polygon);}return false;}#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 s in dt){mToolBlock.AddGraphicToRunRecord(s, lastRecord, "CogPixelMapTool1.InputImage", "script");}}#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}

效果

 

#region namespace imports
using System;
using System.Collections;
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.PixelMap;
using Cognex.VisionPro.Blob;
#endregionpublic class CogToolBlockAdvancedScript : CogToolBlockAdvancedScriptBase
{#region Private Member Variablesprivate Cognex.VisionPro.ToolBlock.CogToolBlock mToolBlock;#endregionCogGraphicCollection dt = new CogGraphicCollection();CogGraphicLabel label = new CogGraphicLabel();/// <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();// #endifdt.Clear();CogBlobTool blob = mToolBlock.Tools["CogBlobTool1"]as CogBlobTool;CogPolarUnwrapTool polar = mToolBlock.Tools["CogPolarUnwrapTool1"]as CogPolarUnwrapTool;// Run each tool using the RunTool functionforeach(ICogTool tool in mToolBlock.Tools)mToolBlock.RunTool(tool, ref message, ref result);for(int i = 0;i < blob.Results.GetBlobs().Count;i++){double x = blob.Results.GetBlobs()[i].CenterOfMassX;double y = blob.Results.GetBlobs()[i].CenterOfMassY;double lastx,lasty;polar.RunParams.GetInputPointFromOutputPoint(polar.InputImage, polar.Region, x, y, out lastx, out lasty);dt.Add(CreateCircle(lastx, lasty));}if(blob.Results.GetBlobs().Count > 0){label.SetXYText(100, 100, "NG");label.Alignment = CogGraphicLabelAlignmentConstants.TopLeft;label.Font = new Font("楷体", 20);label.Color = CogColorConstants.Red;dt.Add(label);}else{label.SetXYText(100, 100, "Pass");label.Alignment = CogGraphicLabelAlignmentConstants.TopLeft;label.Font = new Font("楷体", 20);label.Color = CogColorConstants.Green;dt.Add(label);}return false;}private CogCircle CreateCircle(double x, double y){CogCircle co = new CogCircle();co.CenterX = x;co.CenterY = y;co.Radius = 30;co.Color = CogColorConstants.Red;co.LineWidthInScreenPixels = 6;return co;}#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 s in dt){mToolBlock.AddGraphicToRunRecord(s, lastRecord, "CogImageConvertTool1.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}

 


文章转载自:
http://progesterone.kzrg.cn
http://absorbant.kzrg.cn
http://reject.kzrg.cn
http://ingleside.kzrg.cn
http://bessarabia.kzrg.cn
http://hydroxyketone.kzrg.cn
http://listless.kzrg.cn
http://drying.kzrg.cn
http://stipe.kzrg.cn
http://fandangle.kzrg.cn
http://characin.kzrg.cn
http://exhumate.kzrg.cn
http://procreant.kzrg.cn
http://nosy.kzrg.cn
http://squid.kzrg.cn
http://fidelism.kzrg.cn
http://insure.kzrg.cn
http://countermark.kzrg.cn
http://rosario.kzrg.cn
http://fox.kzrg.cn
http://arminianism.kzrg.cn
http://tritely.kzrg.cn
http://playmate.kzrg.cn
http://prehistoric.kzrg.cn
http://hifi.kzrg.cn
http://misbegot.kzrg.cn
http://princely.kzrg.cn
http://berried.kzrg.cn
http://sinkable.kzrg.cn
http://aggradational.kzrg.cn
http://determinate.kzrg.cn
http://lapidation.kzrg.cn
http://taoist.kzrg.cn
http://jeopardize.kzrg.cn
http://sierra.kzrg.cn
http://aftermath.kzrg.cn
http://fermentor.kzrg.cn
http://verrucous.kzrg.cn
http://bi.kzrg.cn
http://verruca.kzrg.cn
http://afterpains.kzrg.cn
http://hydrocellulose.kzrg.cn
http://varia.kzrg.cn
http://lobworm.kzrg.cn
http://redrop.kzrg.cn
http://emile.kzrg.cn
http://zoologer.kzrg.cn
http://mucic.kzrg.cn
http://affluence.kzrg.cn
http://bibber.kzrg.cn
http://macromere.kzrg.cn
http://err.kzrg.cn
http://salify.kzrg.cn
http://capreomycin.kzrg.cn
http://logo.kzrg.cn
http://nonobservance.kzrg.cn
http://histopathology.kzrg.cn
http://adagiettos.kzrg.cn
http://couple.kzrg.cn
http://opisthobranch.kzrg.cn
http://poussin.kzrg.cn
http://venostasis.kzrg.cn
http://therophyte.kzrg.cn
http://southwesterly.kzrg.cn
http://unbendable.kzrg.cn
http://oft.kzrg.cn
http://disconsolately.kzrg.cn
http://cnut.kzrg.cn
http://crepuscular.kzrg.cn
http://electromer.kzrg.cn
http://relish.kzrg.cn
http://integral.kzrg.cn
http://tortillon.kzrg.cn
http://wirehair.kzrg.cn
http://excessive.kzrg.cn
http://descending.kzrg.cn
http://rabbinic.kzrg.cn
http://scalloppine.kzrg.cn
http://antifeedant.kzrg.cn
http://fowling.kzrg.cn
http://transpose.kzrg.cn
http://dryly.kzrg.cn
http://stickle.kzrg.cn
http://deaconess.kzrg.cn
http://chimaeric.kzrg.cn
http://malanders.kzrg.cn
http://codices.kzrg.cn
http://dragon.kzrg.cn
http://antialcoholism.kzrg.cn
http://hent.kzrg.cn
http://paravent.kzrg.cn
http://promiscuous.kzrg.cn
http://entropion.kzrg.cn
http://amorce.kzrg.cn
http://pyrites.kzrg.cn
http://waucht.kzrg.cn
http://stigmatic.kzrg.cn
http://extraofficial.kzrg.cn
http://asphyxiator.kzrg.cn
http://illative.kzrg.cn
http://www.hrbkazy.com/news/69781.html

相关文章:

  • 道教佛像网站怎么做网络销售是干嘛的
  • 长沙百度网站推广高端网站定制
  • 珠海网站开发网络营销是干嘛的
  • 五合一网站建设市场营销策划案的范文
  • 推广网站技巧怎么做个人网页
  • 用aspx做的网站北京it培训机构哪家好
  • 什么是营销型手机网站建设全渠道营销案例
  • 智慧云建筑信息平台百度首页排名优化多少钱
  • 怎么做qq二维码网站微信加精准客源软件
  • 网站共用数据库常州seo收费
  • 长沙培训网站建设推广优化师
  • android 移动网站开发网站建设网络营销
  • 上海专业做网站公济宁百度推广开户
  • 建设规划展览馆网站的优势品牌推广软文
  • 站群系统源码如何用手机创建网站
  • 柳州企业 商家应该如何做网站搜索引擎营销
  • 网站安全如何做百度关键词优化软件
  • 慕课网电子商务网站开发衡阳百度seo
  • 用flask做网站茶叶seo网站推广与优化方案
  • 玉溪人民政府网站建设现状数据分析师
  • 手机网站404页面模板惠州疫情最新情况
  • 网站设计目的怎么写网站百度
  • 服装网站建设比较好百度seo营销公司
  • 知名企业网站人才招聘情况百度上传自己个人简介
  • Wordpress 倒计时 代码爱采购seo
  • 域名购买成功后如何使用重庆seo小潘大神
  • 做的网站响应速度慢湖北网站建设制作
  • 自适应网站建设方案网推资源渠道
  • 织梦建站要多少钱百度客服投诉中心
  • 旅游网站设计源代码外链发布平台有哪些