Example #1
0
        private void Act_Engine(HImage image, HTuple Angle, int i)
        {
            PTZ_Detection_ProcedureCall.SetInputIconicParamObject("R", image);
            PTZ_Detection_ProcedureCall.SetInputIconicParamObject("RegionPZT_T", Pzt_Region_Affine);
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("mesureNumber", new HTuple(mesureNumber));
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("mes_width", new HTuple(mes_width));
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("threshold", new HTuple(threshold));
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("dist_STD", new HTuple(dist_STD));
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("dist_max", new HTuple(dist_max));
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("angle", Angle[i]);
            PTZ_Detection_ProcedureCall.SetInputCtrlParamTuple("sigma", new HTuple(sigma));
            PTZ_Detection_ProcedureCall.Execute();
            if (pZTOkNg.Length == 0)
            {
                dist_PZT = (PTZ_Detection_ProcedureCall.GetOutputCtrlParamTuple("dist_PZT"));
                pZTOkNg  = (PTZ_Detection_ProcedureCall.GetOutputCtrlParamTuple("pZTOkNg"));
            }
            else
            {
                dist_PZT = dist_PZT.TupleConcat(PTZ_Detection_ProcedureCall.GetOutputCtrlParamTuple("dist_PZT"));
                pZTOkNg  = pZTOkNg.TupleConcat(PTZ_Detection_ProcedureCall.GetOutputCtrlParamTuple("pZTOkNg"));
            }
            HXLD temp = new HXLD();

            temp = PTZ_Detection_ProcedureCall.GetOutputIconicParamXld("Arrow");
            if (temp != null && temp.IsInitialized())
            {
                Arrow = Arrow.ConcatObj(temp);
                temp.Dispose();
            }
        }
Example #2
0
        public bool PZT_Detection_Act(HImage image, List <HHomMat2D> Mat2Ds, HTuple Angle)
        {
            try
            {
                if (!bIsInitial)
                {
                    Initial_PZT_Detection();
                }
                if (Pzt_Region == null || !Pzt_Region.IsInitialized())
                {
                    return(false);
                }
                if (Mat2Ds == null || Mat2Ds.Count() < 1)
                {
                    return(false);
                }
                if (Arrow == null)
                {
                    Arrow = new HXLD();
                }
                if (Arrow != null && Arrow.IsInitialized())
                {
                    Arrow.Dispose();
                }
                Arrow.GenEmptyObj();
                dist_PZT = new HTuple();

                pZTOkNg = new HTuple();

                for (int i = 0; i < Mat2Ds.Count(); i++)
                {
                    if (Pzt_Region_Affine != null && Pzt_Region_Affine.IsInitialized())
                    {
                        Pzt_Region_Affine.Dispose();
                    }
                    Pzt_Region_Affine = Mat2Ds[i].AffineTransRegion(Pzt_Region, "nearest_neighbor");
                    Act_Engine(image, Angle, i);
                    //Act_Source(image, Angle, i);
                }
            }
            catch
            {
                return(false);
            }
            return(true);
        }