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

青岛中企动力做网站怎么样慧生活798app下载

青岛中企动力做网站怎么样,慧生活798app下载,杭州定制网站公司,购物网站建设过程2D图像拼接的3种情景 1.一只相机取像位置固定,或者多只相机固定位置拍图,硬拷贝拼图,采用CopyRegion工具实现 2.一只或多只相机在多个位置拍照,相机视野互相重叠,基于Patmax特征定位后,无缝 拼图&#xff…

2D图像拼接的3种情景

1.一只相机取像位置固定,或者多只相机固定位置拍图,硬拷贝拼图,采用CopyRegion工具实现
2.一只或多只相机在多个位置拍照,相机视野互相重叠,基于Patmax特征定位后,无缝
拼图;采用CogImageStitch类实现;
3.一只或多只相机在多个位置拍照,相机视野只有小范围重叠,或者不重叠,无法使用 Patmax特征定位,可以用标定板标定位置关系,使用CogImageStitch类实现拼图.

注意:此方法是是预先标定的位置关系,如果采用1只相机多个位置拍摄,需要机构保证重复运动的精度在允许范围内,否则可能造成图像错位。

注意:无论是哪种拼接方式,单相机或是多相机拍照,都需要尽量调节到同一个高度拍照,否则可能造成图像重影,模糊等问题;

1.CopyRegionTool硬拷贝拼图

1.请参考QuickBuild自带例程: Script_Stitch_Job.vpp
2.在CogJob的作业属性-取像脚本中实现多张图像拷 贝拼接
3.注意CopyRegion工具的属性, DesinationImageAlignmentX和Y用于指定子图像在拼接大图的位置偏移

在这里插入图片描述

2.基于互相重叠的Patmax特征无缝拼接

请参考“TB_Patmax算法拼.vpp”; 此VPP实现3张图像上下拼接,其他拼接组合可以自行改写程序

流程:
1).添加Patmax工具,训练各个重叠特征;注意相邻的两张图同样的特征使用同一个Patmax工具即可;
2).载入第一张图像,运行整个CogJob,将图像给到TB_StitchImage1,Patmax定位结果给到Image1Pose1;注意不要用连线;
3).对其他图像重复同样的工作,中间的图像有两个PMA结果,需要连2个Pose;
4).TB_Stitch输出的图像即为拼接后图。

在这里插入图片描述
在这里插入图片描述
这里CogImageStitch类使用的方法:

1).AllocateBlendingBuffer,指定图像大小为拼接后图的尺寸,Transform不需要特别设置,在(0,0)附近即可,Scale为1;  
2).分别为3张图建立CogTransform2DLinear;第一个Transform建立在(0,0)位置, 其他图Transform关系依次Compose 前一个相邻Pose的Invert,因为后一个是依据前一个的位置关系来偏移的。以上下3张图拼接为例,就建立了图示的关系;         
3).将图像和Tansform关系分别传入不同的CogFixtureTool,在图像中添加对应的坐标系。注意坐标系名称不能一样;或者用代码AddSpace手动添加坐标系也可以;
4).生成的带新坐标系的图像传入CogImageStitch工具,用BlendImageIntoBuffer方法,会将每张图像对应添加到拼接大图的对
应位置。
5).调用FillDestinationImageFromBuffer来生成拼接图,完成。

注意BlendImageInfoBuffer和OverwriteImage两种方法的区别,Overwrite在像素重叠部分是互相覆盖了,而Blend模式是按照不同权重混合起来,因此更接近无缝拼接。

详细代码如下:

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();// #endifCogImage8Grey Img1 =(CogImage8Grey) this.Inputs.Image1;CogImage8Grey Img2 =(CogImage8Grey) this.Inputs.Image2;CogImage8Grey Img3 =(CogImage8Grey) this.Inputs.Image3;CogImage8Grey StitchedImg = new CogImage8Grey(Img1.Width+500, Img1.Height * 3);CogImageStitch mStitch = new CogImageStitch();//  CogImageStitch.FillDefaultWeightImage(StitchedImg);CogImage8Grey imgMask0 = new CogImage8Grey(Img1.Width, Img1.Height);CogImageStitch.FillDefaultWeightImage(imgMask0);CogImage8Grey imgMask1 = new CogImage8Grey(Img1.Width, Img1.Height);CogImageStitch.FillDefaultWeightImage(imgMask1);CogImage8Grey imgMask2 = new CogImage8Grey(Img1.Width, Img1.Height);CogImageStitch.FillDefaultWeightImage(imgMask2);CogTransform2DLinear trans = new CogTransform2DLinear();trans.Scaling = 1;trans.TranslationX = 10;trans.TranslationY = 10;mStitch.AllocateBlendingBuffer(Img1.Width+500, Img1.Height * 3, trans);CogCoordinateSpaceTree mSpace1 = Img1.CoordinateSpaceTree;CogCoordinateSpaceTree mSpace2 = Img2.CoordinateSpaceTree;CogCoordinateSpaceTree mSpace3 = Img3.CoordinateSpaceTree;CogTransform2DLinear mTrans1 =new CogTransform2DLinear();mTrans1.Scaling = 1;mTrans1.TranslationX = 0;mTrans1.TranslationY = 0;mTrans1.Rotation = 0;//   mSpace1.AddSpace("@", "foo_0", mTrans1, true, CogAddSpaceConstants.ReplaceDuplicate);CogTransform2DLinear mTrans2 =this.Inputs.Image2Pose1.Compose(this.Inputs.Image1Pose1.Invert());//   mSpace2.AddSpace("@", "foo_1", mTrans2, true, CogAddSpaceConstants.ReplaceDuplicate);CogTransform2DLinear mTrans3 = this.Inputs.Image3Pose2.Compose(this.Inputs.Image2Pose2.Invert()).Compose(mTrans2);//   mSpace3.AddSpace("@", "foo_2", mTrans3, true, CogAddSpaceConstants.ReplaceDuplicate);/*   mStitch.BlendImageIntoBuffer(Img1, null);mStitch.BlendImageIntoBuffer(Img2, null);mStitch.BlendImageIntoBuffer(Img3, null);*/   this.Tools.CogFixtureTool1.RunParams.UnfixturedFromFixturedTransform = mTrans1;this.Tools.CogFixtureTool1.Run();this.Tools.CogFixtureTool2.RunParams.UnfixturedFromFixturedTransform = mTrans2;this.Tools.CogFixtureTool2.Run();this.Tools.CogFixtureTool3.RunParams.UnfixturedFromFixturedTransform = mTrans3;this.Tools.CogFixtureTool3.Run();mStitch.BlendImageIntoBuffer((CogImage8Grey)this.Tools.CogFixtureTool1.OutputImage, imgMask0);mStitch.BlendImageIntoBuffer((CogImage8Grey)this.Tools.CogFixtureTool2.OutputImage,imgMask1);mStitch.BlendImageIntoBuffer((CogImage8Grey)this.Tools.CogFixtureTool3.OutputImage,imgMask2);    mStitch.FillDestinationImageFromBuffer(StitchedImg);//  MessageBox.Show(mTrans3.TranslationX.ToString() + "   " + mTrans3.TranslationY.ToString());this.Outputs.StitchedImage = StitchedImg;return false;}

3.使用标定板拼接

请参考“TB_标定板拼.vpp”; 此VPP实现3张图像上下拼接,其他拼接组合可以自行改写程序,标定板可以使用二维码标定板,也可以用Cognex标准标定板;
如果使用二维码标定板,不要求视野重叠,使用带 Cognex标记的标定板,则需要视野重叠,以便于各个拍照位置建立统一的标定板坐标系。

流程如下:

1).标定板放好,固定不动。大小要能够覆盖整个拍照视野范围 2).3只相机或同一个相机的3个位置对标定板拍照,执行。
CheckBoard标定;得到outputImage和OutputImageMask;注意此时每张图的输出坐标系都是标定片坐标系;
3).打开距离标定板坐标系原点最近的那张图,获取坐标原点在Root
space下的X和Y坐标值;利用标定板图计算图像的像素坐标与标定板坐标系的比例关系;分别输入到 ToolBlock的dScale,dTransX, dTransY中;
4).执行ToolBlock,即可得到拼接后图像。

在这里插入图片描述

CogImageStitch类使用的方法:

1).由于各张子图像已经采用标定板建立了标定板坐标系,因此前面特征拼接方法不同的是,这里不需要再自行建立坐标系关系,使用标定板坐标系即可;
2).但是在AllocateBlendingBuffer时,需要指定RootFromBlendingBuffer的坐标系变换关系。由于BlendingBuffer分配时使用的标定板坐标系,而图像是从rootspace下copy像素,因此变换关系的比例和Translation需要在定义BlendingBuffer时指定。
3)其他部分按照CogImageStitch的使用方法调用即可。

详细代码如下

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();// #endifCogImage8Grey Img1 =(CogImage8Grey) this.Inputs.Image1;CogImage8Grey Img2 =(CogImage8Grey) this.Inputs.Image2;CogImage8Grey Img3 =(CogImage8Grey) this.Inputs.Image3;CogImage8Grey imgMask0 = (CogImage8Grey) this.Inputs.CalibMask1;CogImage8Grey imgMask1 = (CogImage8Grey) this.Inputs.CalibMask2;CogImage8Grey imgMask2 = (CogImage8Grey) this.Inputs.CalibMask3;CogImage8Grey StitchedImg = new CogImage8Grey(Img1.Width+500, Img1.Height * 3+500);CogImageStitch mStitch = new CogImageStitch();//  CogImageStitch.FillDefaultWeightImage(StitchedImg);CogImage8Grey imgWeight0 = new CogImage8Grey(Img1.Width, Img1.Height);CogImageStitch.FillDefaultWeightImage(imgWeight0);CogImage8Grey imgWeight1 = new CogImage8Grey(Img2.Width, Img2.Height);CogImageStitch.FillDefaultWeightImage(imgWeight1);CogImage8Grey imgWeight2 = new CogImage8Grey(Img3.Width, Img3.Height);CogImageStitch.FillDefaultWeightImage(imgWeight2);CogTransform2DLinear trans = new CogTransform2DLinear();trans.Scaling = this.Inputs.dScale;trans.TranslationX = this.Inputs.dTransX;trans.TranslationY = this.Inputs.dTransY;mStitch.AllocateBlendingBuffer(Img1.Width+500, Img1.Height * 3+500, trans);mStitch.BlendImageIntoBuffer(Img1, imgWeight0,imgMask0,0,0);mStitch.BlendImageIntoBuffer(Img2,imgWeight1,imgMask1,0,0);mStitch.BlendImageIntoBuffer(Img3,imgWeight2,imgMask2,0,0);    mStitch.FillDestinationImageFromBuffer(StitchedImg);//  MessageBox.Show(mTrans3.TranslationX.ToString() + "   " + mTrans3.TranslationY.ToString());this.Tools.CogBlobTool1.InputImage = StitchedImg;this.Tools.CogBlobTool1.Run();return false;}

总结:
1.小视野多次取像,每张图片单独使用检测工具,精度可满足需求;
不够直观,调试复杂;
2.小视野多次取像,根据标定结果,进行图像拼接;
精度可满足需求;同时更加直观,客户接受度高;检测工具使用更加方便;后期维护及设备复制更省心;

http://www.hkea.cn/news/507980/

相关文章:

  • 做网站 博客百度推广助手客户端
  • 温州市手机网站制作哪家好爱站网长尾词挖掘
  • 党委网站建设要求凡科建站靠谱吗
  • wordpress 安卓客户端福建seo优化
  • 襄阳seo技术长沙seo网站优化
  • 做一的同志小说网站做seo要投入什么
  • 网站的文件结构百度搜索排名怎么收费
  • 全景网站app网络营销工具分析
  • 南京建设工程交易中心网站seo是什么的简称
  • 利用vps做网站关键字排名查询
  • 常熟网站制作找哪家好品牌型网站制作价格
  • 怎么做自己网站推广网络广告
  • 化州网站建设促销方法100种
  • 长沙专业网站设计平台新闻最新消息10条
  • 惠州网站建设制作宣传推广方案
  • 宁波网站推广外包服务长岭网站优化公司
  • 哈尔滨市哪里做淘宝网站seo课程心得体会
  • 做网站建设公司企业一个企业该如何进行网络营销
  • 移动端h5网站开发服务企业seo推广
  • 管理公司网站建设引擎搜索优化
  • 上市公司专利查询网站百度广告投放价格
  • html5电商网页制作网站怎么seo关键词排名优化推广
  • 大同网站建设黄冈网站推广优化找哪家
  • 昌邑网站建设站长之家网站排名
  • 建设企业网站的需求分析免费域名
  • 重庆欧勒精细有限公司网站策划书百度竞价推广开户
  • 怎么做一键添加信任网站ios aso优化工具
  • ps做网站的分辨率多少钱苹果cms永久免费建站程序
  • 网站推广积分常用于网站推广的营销手段是
  • wordpress时间云储存沈阳网站制作优化推广