コード例 #1
0
        public Boolean ROI_create(CogRecordDisplay CogRecordDisplay1)
        {
            string ProcID = System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString();

            try
            {
                //initial RunParams
                mFindLineTool.RunParams.ExpectedLineSegment.StartX = mStartX;
                mFindLineTool.RunParams.ExpectedLineSegment.StartY = mStartY;
                mFindLineTool.RunParams.ExpectedLineSegment.EndX   = mEndX;
                mFindLineTool.RunParams.ExpectedLineSegment.EndY   = mEndY;
                mFindLineTool.RunParams.NumCalipers             = mNumCalipers;
                mFindLineTool.RunParams.CaliperSearchLength     = mCaliperSearchLength;
                mFindLineTool.RunParams.CaliperProjectionLength = mCaliperProjectionLength;
                mFindLineTool.RunParams.CaliperSearchDirection  = mCaliperSearchDirection;

                mFindLineTool.InputImage = (CogImage8Grey)CogRecordDisplay1.Image;
                CogRecordDisplay1.Record = mFindLineTool.CreateCurrentRecord().SubRecords["InputImage"];
                return(true);
            }
            catch (Exception ex)
            {
                SaveLog.Msg_("FindLineTool ROI_create Failed : " + ModularID + ":\r\n" + ProcID + ":\r\n" + ex.ToString());
                FindLineTool_Status = false;
                return(false);
            }
        }
コード例 #2
0
        //public void DrawFindLineCaliper(CogLineSegment _CogFindLine = null)
        public void DrawFindLineCaliper(CogFindLine _CogFindLine = null)
        {
            ICogRecord           _Record;
            CogGraphicCollection _Region;

            LineCaliperTool.InputImage = (CogImage8Grey)kCogDisplay.Image;
            LineCaliperTool.RunParams  = _CogFindLine;

            _Record         = LineCaliperTool.CreateCurrentRecord();
            InteractiveLine = (CogLineSegment)_Record.SubRecords["InputImage"].SubRecords["ExpectedShapeSegment"].Content;
            _Region         = (CogGraphicCollection)_Record.SubRecords["InputImage"].SubRecords["CaliperRegions"].Content;

            kCogDisplay.InteractiveGraphics.Add(InteractiveLine, "Line", false);
            foreach (ICogGraphic _ICogGra in _Region)
            {
                kCogDisplay.InteractiveGraphics.Add((ICogGraphicInteractive)_ICogGra, "", false);
            }
            GC.Collect();
        }
コード例 #3
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //생성 :
        //추가 :
        //목적 : 툴 내 파인드 라인 그래픽 -> 현재 디스플레이에 표시
        //설명 : 소스코드야 미안하다
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public void GetFindLineBottom()
        {
            do
            {
//                 // 디스플레이 초기화
//                 m_objCogDisplayMain.Image = null;
//                 // 이미지 유무 체크해서 메인 디스플레이에 이미지를 가져옴
//                 SetMainImage();
//                 // 디스플레이 클리어
//                 m_objCogDisplayMain.StaticGraphics.Clear();
//                 m_objCogDisplayMain.InteractiveGraphics.Clear();
                // 이미지 유무 체크
                if (null == m_objCogDisplayMain.Image)
                {
                    break;
                }
                // 극성 방향
                CogLineSegment objLineSegment;
                // 캘리퍼 사각형's
                CogGraphicCollection objRegions;
                m_objFindLineToolBottom.CurrentRecordEnable = CogFindLineCurrentRecordConstants.All;
                ICogRecord objCogRecord = m_objFindLineToolBottom.CreateCurrentRecord();
                objLineSegment = ( CogLineSegment )objCogRecord.SubRecords["InputImage"].SubRecords["ExpectedShapeSegment"].Content;
                objRegions     = ( CogGraphicCollection )objCogRecord.SubRecords["InputImage"].SubRecords["CaliperRegions"].Content;
                // 캘리퍼 선
                objLineSegment.Color = CogColorConstants.Green;
                //objLineSegment.Interactive = false;
                //m_objCogDisplayMain.InteractiveGraphics.Add( ( ICogGraphicInteractive )objLineSegment, "", false );
                m_objCogDisplayMain.StaticGraphics.Add(( ICogGraphicInteractive )objLineSegment, "");

                // 캘리퍼 상자
                if (null != objRegions)
                {
                    for (int iLoopCount = 0; iLoopCount < objRegions.Count; iLoopCount++)
                    {
                        objRegions[iLoopCount].Color = CogColorConstants.Green;
                        //m_objCogDisplayMain.InteractiveGraphics.Add( ( ICogGraphicInteractive )objRegions[ iLoopCount ], "", false );
                        m_objCogDisplayMain.StaticGraphics.Add(( ICogGraphicInteractive )objRegions[iLoopCount], "");
                    }
                }
            } while(false);
        }