Esempio n. 1
0
 private void delete_roi_Click(object sender, EventArgs e)
 {
     Htemp_roi.Dispose();
     Hdraw_roi.Dispose();
     Hshow_xld1.Dispose();
     Hshow_xld2.Dispose();
     try
     {
         HOperatorSet.ClearWindow(Hwin);
         HOperatorSet.DispObj(image_show, Hwin);
     }
     catch
     {
     }
 }
Esempio n. 2
0
        public FindModel_form(UnitFindModel FM, HObject image)
        {
            HOperatorSet.GenEmptyObj(out image_show);
            HOperatorSet.GenEmptyObj(out m_hModelXLD);
            HOperatorSet.GenEmptyObj(out Htemp_roi);
            HOperatorSet.GenEmptyObj(out Hdraw_roi);
            HOperatorSet.GenEmptyObj(out Hshow_xld1);
            HOperatorSet.GenEmptyObj(out Hshow_xld2);

            Hdraw_roi.Dispose();
            Hshow_xld2.Dispose();

            image_show = image;
            FM_data    = FM;

            HangleStart  = -20;
            HangleExtent = 40;
            HscaleMin    = 0.9;
            HscaleMax    = 1.1;
            ContrastMin  = 11;
            ContrastMax  = 15;
            MinSize      = 10;
            Hcontrast    = new HTuple();
            Hcontrast    = Hcontrast.TupleConcat(ContrastMin);
            Hcontrast    = Hcontrast.TupleConcat(ContrastMax);
            Hcontrast    = Hcontrast.TupleConcat(MinSize);
            HminContrast = 9;

            H_NumLevels    = 4;
            H_AngleStep    = "auto";
            H_ScaleStep    = "auto";
            H_Optimization = (new HTuple("none")).TupleConcat("no_pregeneration");
            H_Metric       = "use_polarity";

            HminScore   = 0.5;
            HmaxOverlap = 0.5;
            Hgreediness = 0.8;

            H_NumMatches = 1;
            H_SubPixel   = "least_squares";



            InitializeComponent();
        }
Esempio n. 3
0
        void display_draw(HObject Htemp_roi, ref HObject Hdraw_roi)//, out HObject Hdraw_roi, out HObject Hshow_xld2)
        {
            Hshow_xld1.Dispose();
            HOperatorSet.GenContourRegionXld(Htemp_roi, out Hshow_xld1, "border");
            if (radioButton1.Checked)
            {
                if (Hdraw_roi.Key == (IntPtr)0)
                {
                    HOperatorSet.CopyObj(Htemp_roi, out Hdraw_roi, 1, 1);
                    HOperatorSet.CopyObj(Hshow_xld1, out Hshow_xld2, 1, 1);
                }
                else
                {
                    HOperatorSet.Union2(Hdraw_roi, Htemp_roi, out Hdraw_roi);
                    HOperatorSet.ConcatObj(Hshow_xld2, Hshow_xld1, out OTemp[0]);
                    Hshow_xld2.Dispose();
                    Hshow_xld2 = OTemp[0];
                }
            }
            else if (radioButton2.Checked)
            {
                if (Hdraw_roi.Key == (IntPtr)0)
                {
                    HOperatorSet.CopyObj(Htemp_roi, out Hdraw_roi, 1, 1);
                    HOperatorSet.CopyObj(Hshow_xld1, out Hshow_xld2, 1, 1);
                }
                else
                {
                    HOperatorSet.Intersection(Hdraw_roi, Htemp_roi, out Hdraw_roi);
                    HOperatorSet.ConcatObj(Hshow_xld2, Hshow_xld1, out OTemp[0]);
                    Hshow_xld2.Dispose();
                    Hshow_xld2 = OTemp[0];
                }
            }
            else if (radioButton3.Checked)
            {
                if (Hdraw_roi.Key == (IntPtr)0)
                {
                    HOperatorSet.CopyObj(Htemp_roi, out Hdraw_roi, 1, 1);
                    HOperatorSet.CopyObj(Hshow_xld1, out Hshow_xld2, 1, 1);
                }
                else
                {
                    HOperatorSet.Difference(Hdraw_roi, Htemp_roi, out Hdraw_roi);
                    HOperatorSet.ConcatObj(Hshow_xld2, Hshow_xld1, out OTemp[0]);
                    Hshow_xld2.Dispose();
                    Hshow_xld2 = OTemp[0];
                }
            }
            else
            {
                return;
            }
            try
            {
                HOperatorSet.ClearWindow(Hwin);
                HOperatorSet.DispObj(image_show, Hwin);

                HOperatorSet.SetColor(Hwin, "green");
                HOperatorSet.DispObj(Hshow_xld2, Hwin);

                HOperatorSet.SetColor(Hwin, "red");
                HOperatorSet.DispObj(Hdraw_roi, Hwin);
            }
            catch (System.Exception ex)
            {
            }
        }