当前位置: 首页>>代码示例>>C#>>正文


C# HTuple.TupleLess方法代码示例

本文整理汇总了C#中HTuple.TupleLess方法的典型用法代码示例。如果您正苦于以下问题:C# HTuple.TupleLess方法的具体用法?C# HTuple.TupleLess怎么用?C# HTuple.TupleLess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTuple的用法示例。


在下文中一共展示了HTuple.TupleLess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Action


//.........这里部分代码省略.........

            //B1_1_1_X, B1_1_1_Y 分量
            hv_B1_1_1_X = (hv_STD_B1_1_1_V_Col * (hv_Img_Rotate_Angle.TupleCos())) + (hv_STD_B1_1_1_V_Row * (hv_Img_Rotate_Angle.TupleSin()
                ));
            hv_B1_1_1_Y = (hv_STD_B1_1_1_V_Row * (hv_Img_Rotate_Angle.TupleCos())) - (hv_STD_B1_1_1_V_Col * (hv_Img_Rotate_Angle.TupleSin()
                ));

            //目前圖形 B1_1_1_ 位置
            hv_B1_1_1_Pos_Row = (hv_STD_Row + hv_B1_1_1_Y) + hv_OffsetRow;
            hv_B1_1_1_Pos_Col = (hv_STD_Col + hv_B1_1_1_X) + hv_OffsetCol;
            //for (hv_MatchingObjIdx = 0; (int)hv_MatchingObjIdx <= (int)((new HTuple(hv_AllModelScore.TupleLength()
            //	)) - 1); hv_MatchingObjIdx = (int)hv_MatchingObjIdx + 1)
            //{
            //step 1 由 matchingObj 得知目標區域中心座標 (B_ModelRow, B_ModelColumn... 等資訊) 建立 ROI
            hv_B_ROI_W = 40;
            hv_B_ROI_H = 90;
            ho_B_Rectangle.Dispose();
            HOperatorSet.GenRectangle2(out ho_B_Rectangle, hv_B1_1_1_Pos_Row, hv_B1_1_1_Pos_Col,
                hv_Img_Rotate_Angle, hv_B_ROI_W, hv_B_ROI_H);
            //stop ()
            ho_B__ROI.Dispose();
            HOperatorSet.ReduceDomain(ho_Image, ho_B_Rectangle, out ho_B__ROI);
            //step 2 Extract contours and segment it
            hv_low = 60;
            hv_high = 140;
            ho_B_Edges.Dispose();
            HOperatorSet.EdgesSubPix(ho_B__ROI, out ho_B_Edges, "lanser2", 0.3, hv_low,
                hv_high);
            HOperatorSet.CountObj(ho_B_Edges, out hv_B_EdgesNumber);

            //stop ()
            //修正上限
            hv_inc = -3;
            while ((int)(new HTuple(hv_B_EdgesNumber.TupleLess(1))) != 0)
            {
                hv_high = hv_high + hv_inc;
                ho_B_Edges.Dispose();
                HOperatorSet.EdgesSubPix(ho_B__ROI, out ho_B_Edges, "lanser2", 0.3, hv_low,
                    hv_high);
                HOperatorSet.CountObj(ho_B_Edges, out hv_B_EdgesNumber);
            }
            //stop ()
            ho_B_ContoursSplit.Dispose();
            HOperatorSet.SegmentContoursXld(ho_B_Edges, out ho_B_ContoursSplit, "lines",
                9, 4, 2);
            ho_SelectedB_ContoursSplit.Dispose();
            HOperatorSet.SelectShapeXld(ho_B_ContoursSplit, out ho_SelectedB_ContoursSplit,
                "contlength", "and", 20, 99999);
            //step 3 取得目標線段
            ho_B_LeftLine_Contour.Dispose();
            HOperatorSet.SelectObj(ho_SelectedB_ContoursSplit, out ho_B_LeftLine_Contour,
                1);
            HOperatorSet.GetContourGlobalAttribXld(ho_B_LeftLine_Contour, "cont_approx",
                out hv_Attrib);
            //線段 B_ 的資訊
            HOperatorSet.FitLineContourXld(ho_B_LeftLine_Contour, "tukey", -1, 0, 5, 2,
                out hv_B_RowBegin, out hv_B_ColBegin, out hv_B_RowEnd, out hv_B_ColEnd,
                out hv_B_Nr, out hv_B_Nc, out hv_B_Dist);
            //	if (HDevWindowStack.IsOpen())
            //	{
            //		HOperatorSet.DispObj(ho_B_LeftLine_Contour, HDevWindowStack.GetActive());
            //	}
            //	//stop ()
            //}

            //計算 A1 與 B 之交點 P
开发者ID:Joncash,项目名称:HanboAOMClassLibrary,代码行数:67,代码来源:SDMS_A1.cs

示例2: find_caltab_edges


//.........这里部分代码省略.........
          "and", 1.4, 10);
          ho_RegionFillUp.Dispose();
          HOperatorSet.FillUp(ho_SelectedRegions, out ho_RegionFillUp);
          ho_SelectedRegions1.Dispose();
          HOperatorSet.SelectShape(ho_RegionFillUp, out ho_SelectedRegions1, "rectangularity",
          "and", 0.6, 1);
          ho_RegionIntersection.Dispose();
          HOperatorSet.Intersection(ho_SelectedRegions1, ho_RegionDynThresh, out ho_RegionIntersection
          );
          ho_RegionFillUp1.Dispose();
          HOperatorSet.FillUp(ho_RegionIntersection, out ho_RegionFillUp1);
          ho_RegionDifference.Dispose();
          HOperatorSet.Difference(ho_RegionFillUp1, ho_RegionIntersection, out ho_RegionDifference
          );
          HOperatorSet.CountObj(ho_RegionDifference, out hv_Number);
          ho_CaltabCandidates.Dispose();
          HOperatorSet.GenEmptyObj(out ho_CaltabCandidates);
          HOperatorSet.CaltabPoints(hv_DescriptionFileName, out hv_X, out hv_Y, out hv_Z);
          hv_NumDescrMarks = new HTuple(hv_X.TupleLength());
          for (hv_Index = 1; hv_Index.Continue(hv_Number, 1); hv_Index = hv_Index.TupleAdd(1))
          {
          ho_ObjectSelected.Dispose();
          HOperatorSet.SelectObj(ho_RegionDifference, out ho_ObjectSelected, hv_Index);
          ho_ConnectedMarks.Dispose();
          HOperatorSet.Connection(ho_ObjectSelected, out ho_ConnectedMarks);
          HOperatorSet.CountObj(ho_ConnectedMarks, out hv_NumberMarks);
          HOperatorSet.Eccentricity(ho_ConnectedMarks, out hv_Anisometry, out hv_Bulkiness,
              out hv_StructureFactor);
          HOperatorSet.AreaCenter(ho_ConnectedMarks, out hv_AreaMarks, out hv_Row, out hv_Column);
          ho_ObjectSelectedCaltab.Dispose();
          HOperatorSet.SelectObj(ho_RegionIntersection, out ho_ObjectSelectedCaltab,
              hv_Index);
          if ((int)((new HTuple((new HTuple((new HTuple(hv_NumberMarks.TupleGreaterEqual(
              10))).TupleAnd(new HTuple(hv_NumberMarks.TupleLess(hv_NumDescrMarks + 20))))).TupleAnd(
              new HTuple(((((hv_Anisometry.TupleSort())).TupleSelect((new HTuple(hv_Anisometry.TupleLength()
              )) / 2))).TupleLess(2))))).TupleAnd(new HTuple((new HTuple(hv_AreaMarks.TupleMean()
              )).TupleGreater(20)))) != 0)
          {
              HOperatorSet.ConcatObj(ho_CaltabCandidates, ho_ObjectSelectedCaltab, out OTemp[0]
                  );
              ho_CaltabCandidates.Dispose();
              ho_CaltabCandidates = OTemp[0];
          }
          }
          ho_RegionFillUpCand.Dispose();
          HOperatorSet.FillUp(ho_CaltabCandidates, out ho_RegionFillUpCand);
          HOperatorSet.Rectangularity(ho_RegionFillUpCand, out hv_Rectangularity);
          if ((int)(new HTuple((new HTuple(hv_Rectangularity.TupleLength())).TupleEqual(
          0))) != 0)
          {
          ho_ImageMean.Dispose();
          ho_RegionDynThresh.Dispose();
          ho_RegionBorder.Dispose();
          ho_RegionOpening1.Dispose();
          ho_ConnectedRegions1.Dispose();
          ho_SelectedRegions4.Dispose();
          ho_SelectedRegions5.Dispose();
          ho_RegionBorder2.Dispose();
          ho_RegionTrans.Dispose();
          ho_RegionErosion.Dispose();
          ho_RegionBorder1.Dispose();
          ho_RegionDilation2.Dispose();
          ho_RegionDifference1.Dispose();
          ho_RegionOpening.Dispose();
          ho_ConnectedRegions.Dispose();
          ho_SelectedRegions2.Dispose();
开发者ID:rtigithub,项目名称:HALCON-12-codelets,代码行数:67,代码来源:QualityProcedures.cs

示例3: Action


//.........这里部分代码省略.........
            //****Display
            if (HDevWindowStack.IsOpen())
            {
                HOperatorSet.ClearWindow(HDevWindowStack.GetActive());
            }
            if (HDevWindowStack.IsOpen())
            {
                HOperatorSet.DispObj(ho_Image, HDevWindowStack.GetActive());
            }
            //*****R6
            hv_R6 = 999;
            //STD R6_ 位置
            hv_STD_R6_Row = 1292;
            hv_STD_R6_Col = 639;

            //STD 向量 STD_R6_
            hv_STD_R6_V_Row = hv_STD_R6_Row - hv_STD_Row;
            hv_STD_R6_V_Col = hv_STD_R6_Col - hv_STD_Col;

            //R6_X, R6_Y 分量
            hv_R6_X = (hv_STD_R6_V_Col * (hv_Img_Rotate_Angle.TupleCos())) + (hv_STD_R6_V_Row * (hv_Img_Rotate_Angle.TupleSin()
                ));
            hv_R6_Y = (hv_STD_R6_V_Row * (hv_Img_Rotate_Angle.TupleCos())) - (hv_STD_R6_V_Col * (hv_Img_Rotate_Angle.TupleSin()
                ));

            //目前圖形 R4 位置
            hv_R6_Pos_Row = (hv_STD_Row + hv_R6_Y) + hv_OffsetRow;
            hv_R6_Pos_Col = (hv_STD_Col + hv_R6_X) + hv_OffsetCol;

            //R6_Region 由半徑 29 開始搜尋, 最大搜尋至 41, Inc =2
            hv_R6_R = 29;
            hv_R6_R_Max = 41;
            hv_R6_R_Inc = 2;
            while ((int)((new HTuple(hv_R6.TupleEqual(999))).TupleAnd(new HTuple(hv_R6_R.TupleLess(
                hv_R6_R_Max)))) != 0)
            {
                //*******************************
                ho_R6_Circle.Dispose();
                HOperatorSet.GenCircle(out ho_R6_Circle, hv_R6_Pos_Row, hv_R6_Pos_Col, hv_R6_R);
                ho_R6_ROI_Image.Dispose();
                HOperatorSet.ReduceDomain(ho_Image, ho_R6_Circle, out ho_R6_ROI_Image);
                ho_R6_Region.Dispose();
                HOperatorSet.Threshold(ho_R6_ROI_Image, out ho_R6_Region, 100, 255);
                ho_R6_RegionBorder.Dispose();
                HOperatorSet.Boundary(ho_R6_Region, out ho_R6_RegionBorder, "inner");
                ho_R6_RegionDilation.Dispose();
                HOperatorSet.DilationCircle(ho_R6_RegionBorder, out ho_R6_RegionDilation,
                    1.5);
                ho_R6_ImageReduced.Dispose();
                HOperatorSet.ReduceDomain(ho_R6_ROI_Image, ho_R6_RegionDilation, out ho_R6_ImageReduced
                    );
                ho_R6_Edges.Dispose();
                HOperatorSet.EdgesSubPix(ho_R6_ImageReduced, out ho_R6_Edges, "lanser2",
                    0.3, 40, 90);

                //fast_threshold (R6_ROI_Image, R6_Region, 80, 255, 15)
                //reduce_domain (R6_ROI_Image, R6_Region, R6_ImageReduced)
                //sobel_fast 具有較寬的選擇範圍,搭配 alpha 參數 (alpha 越大, 容錯範圍大)
                //alpha := 10
                //R6_low := 10
                //R6_high := 60
                //edges_sub_pix (R6_ImageReduced, R6_Edges, 'sobel_fast', alpha, R6_low, R6_high)
                //stop ()
                //*所有的數值越小,表示容錯範圍大,反之亦然
                ho_R6_ContoursSplit.Dispose();
                HOperatorSet.SegmentContoursXld(ho_R6_Edges, out ho_R6_ContoursSplit, "lines_circles",
开发者ID:Joncash,项目名称:HanboAOMClassLibrary,代码行数:67,代码来源:SDMS_R6.cs


注:本文中的HTuple.TupleLess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。