예제 #1
0
        public bool WriteParams(String xmlNode, string regionName)
        {
            try
            {
                string shv_MinGray = "Parameters/" + xmlNode + "/hv_MinGray";
                string shv_MaxGray = "Parameters/" + xmlNode + "/hv_MaxGray";
                string shv_Min     = "Parameters/" + xmlNode + "/hv_Min";
                string shv_Max     = "Parameters/" + xmlNode + "/hv_Max";
                string shv_Number  = "Parameters/" + xmlNode + "/hv_Number";

                xmlRW.Update(shv_MinGray, hv_MinGray.ToString());
                xmlRW.Update(shv_MaxGray, hv_MaxGray.ToString());
                xmlRW.Update(shv_Min, hv_Min.ToString());
                xmlRW.Update(shv_Max, hv_Max.ToString());
                xmlRW.Update(shv_Number, hv_Number.ToString());

                string regionPath = AppDomain.CurrentDomain.BaseDirectory + @".//Parameters//" + regionName;
                HOperatorSet.WriteRegion(ho_Region, regionPath);

                errorFlag = false;
                return(true);
            }
            catch (Exception exc)
            {
                errorFlag = true;
                return(false);
            }
        }
예제 #2
0
        public bool WriteParams(String xmlNode)
        {
            try
            {
                string shv_MeasureLength1   = "Parameters/" + xmlNode + "/hv_MeasureLength1";
                string shv_MeasureLength2   = "Parameters/" + xmlNode + "/hv_MeasureLength2";
                string shv_MeasureSigma     = "Parameters/" + xmlNode + "/hv_MeasureSigma";
                string shv_MeasureThreshold = "Parameters/" + xmlNode + "/hv_MeasureThreshold";
                string shv_GenParamName     = "Parameters/" + xmlNode + "/hv_GenParamName";
                string shv_GenParamValue    = "Parameters/" + xmlNode + "/hv_GenParamValue";

                string shv_Row1    = "Parameters/" + xmlNode + "/hv_Row1";
                string shv_Column1 = "Parameters/" + xmlNode + "/hv_Column1";
                string shv_Row2    = "Parameters/" + xmlNode + "/hv_Row2";
                string shv_Column2 = "Parameters/" + xmlNode + "/hv_Column2";

                xmlRW.Update(shv_MeasureLength1, hv_MeasureLength1.ToString());
                xmlRW.Update(shv_MeasureLength2, hv_MeasureLength2.ToString());
                xmlRW.Update(shv_MeasureSigma, hv_MeasureSigma.ToString());
                xmlRW.Update(shv_MeasureThreshold, hv_MeasureThreshold.ToString());
                xmlRW.Update(shv_GenParamName, hv_GenParamName);
                xmlRW.Update(shv_GenParamValue, hv_GenParamValue);

                xmlRW.Update(shv_Row1, hv_Row1.ToString());
                xmlRW.Update(shv_Column1, hv_Column1.ToString());
                xmlRW.Update(shv_Row2, hv_Row2.ToString());
                xmlRW.Update(shv_Column2, hv_Column2.ToString());

                errorFlag = false;
                return(true);
            }
            catch (Exception exc)
            {
                errorFlag = true;
                return(false);
            }
        }
예제 #3
0
        public bool WriteParams(String xmlNode, string regionName)
        {
            try
            {
                string shv_MeasureLength1   = "Parameters/" + xmlNode + "/hv_MeasureLength1";
                string shv_MeasureLength2   = "Parameters/" + xmlNode + "/hv_MeasureLength2";
                string shv_MeasureSigma     = "Parameters/" + xmlNode + "/hv_MeasureSigma";
                string shv_MeasureThreshold = "Parameters/" + xmlNode + "/hv_MeasureThreshold";
                string shv_GenParamName     = "Parameters/" + xmlNode + "/hv_GenParamName";
                string shv_GenParamValue    = "Parameters/" + xmlNode + "/hv_GenParamValue";
                string shv_Number           = "Parameters/" + xmlNode + "/hv_Number";

                string shv_Row1_Horizon    = "Parameters/" + xmlNode + "/hv_Row1_Horizon";
                string shv_Column1_Horizon = "Parameters/" + xmlNode + "/hv_Column1_Horizon";
                string shv_Row2_Horizon    = "Parameters/" + xmlNode + "/hv_Row2_Horizon";
                string shv_Column2_Horizon = "Parameters/" + xmlNode + "/hv_Column2_Horizon";

                string shv_Row1_Vertical    = "Parameters/" + xmlNode + "/hv_Row1_Vertical";
                string shv_Column1_Vertical = "Parameters/" + xmlNode + "/hv_Column1_Vertical";
                string shv_Row2_Vertical    = "Parameters/" + xmlNode + "/hv_Row2_Vertical";
                string shv_Column2_Vertical = "Parameters/" + xmlNode + "/hv_Column2_Vertical";


                xmlRW.Update(shv_MeasureLength1, hv_MeasureLength1.ToString());
                xmlRW.Update(shv_MeasureLength2, hv_MeasureLength2.ToString());
                xmlRW.Update(shv_MeasureSigma, hv_MeasureSigma.ToString());
                xmlRW.Update(shv_MeasureThreshold, hv_MeasureThreshold.ToString());
                xmlRW.Update(shv_GenParamName, hv_GenParamName);
                xmlRW.Update(shv_GenParamValue, hv_GenParamValue);
                xmlRW.Update(shv_Number, hv_Number.ToString());

                xmlRW.Update(shv_Row1_Horizon, hv_Row1_Horizon.ToString());
                xmlRW.Update(shv_Column1_Horizon, hv_Column1_Horizon.ToString());
                xmlRW.Update(shv_Row2_Horizon, hv_Row2_Horizon.ToString());
                xmlRW.Update(shv_Column2_Horizon, hv_Column2_Horizon.ToString());

                xmlRW.Update(shv_Row1_Vertical, hv_Row1_Vertical.ToString());
                xmlRW.Update(shv_Column1_Vertical, hv_Column1_Vertical.ToString());
                xmlRW.Update(shv_Row2_Vertical, hv_Row2_Vertical.ToString());
                xmlRW.Update(shv_Column2_Vertical, hv_Column2_Vertical.ToString());

                errorFlag = false;
                return(true);
            }
            catch (Exception exc)
            {
                errorFlag = true;
                return(false);
            }
        }
예제 #4
0
        public bool WriteParams(String xmlNode, string templateName, string regionName)
        {
            try
            {
                string shv_ScaleMethod = "Parameters/" + xmlNode + "/hv_ScaleMethod";

                string shv_NumLevels_Create   = "Parameters/" + xmlNode + "/hv_NumLevels_Create";
                string shv_AngleStart_Create  = "Parameters/" + xmlNode + "/hv_AngleStart_Create";
                string shv_AngleExtent_Create = "Parameters/" + xmlNode + "/hv_AngleExtent_Create";
                string shv_AngleStep_Create   = "Parameters/" + xmlNode + "/hv_AngleStep_Create";
                string shv_ScaleRMin_Create   = "Parameters/" + xmlNode + "/hv_ScaleRMin_Create";
                string shv_ScaleRMax_Create   = "Parameters/" + xmlNode + "/hv_ScaleRMax_Create";
                string shv_ScaleRStep_Create  = "Parameters/" + xmlNode + "/hv_ScaleRStep_Create";

                string shv_ScaleCMin_Create    = "Parameters/" + xmlNode + "/hv_ScaleCMin_Create";
                string shv_ScaleCMax_Create    = "Parameters/" + xmlNode + "/hv_ScaleCMax_Create";
                string shv_ScaleCStep_Create   = "Parameters/" + xmlNode + "/hv_ScaleCStep_Create";
                string shv_Optimization_Create = "Parameters/" + xmlNode + "/hv_Optimization_Create";
                string shv_Metric_Create       = "Parameters/" + xmlNode + "/hv_Metric_Create";
                string shv_Contrast_Create     = "Parameters/" + xmlNode + "/hv_Contrast_Create";
                string shv_MinContrast_Create  = "Parameters/" + xmlNode + "/hv_MinContrast_Create";

                string shv_AngleStart_Find  = "Parameters/" + xmlNode + "/hv_AngleStart_Find";
                string shv_AngleExtent_Find = "Parameters/" + xmlNode + "/hv_AngleExtent_Find";
                string shv_ScaleRMin_Find   = "Parameters/" + xmlNode + "/hv_ScaleRMin_Find";
                string shv_ScaleRMax_Find   = "Parameters/" + xmlNode + "/hv_ScaleRMax_Find";
                string shv_ScaleCMin_Find   = "Parameters/" + xmlNode + "/hv_ScaleCMin_Find";
                string shv_ScaleCMax_Find   = "Parameters/" + xmlNode + "/hv_ScaleCMax_Find";
                string shv_MinScore_Find    = "Parameters/" + xmlNode + "/hv_MinScore_Find";
                string shv_NumMatches_Find  = "Parameters/" + xmlNode + "/hv_NumMatches_Find";
                string shv_MaxOverlap_Find  = "Parameters/" + xmlNode + "/hv_MaxOverlap_Find";
                string shv_SubPixel_Find    = "Parameters/" + xmlNode + "/hv_SubPixel_Find";
                string shv_NumLevels_Find   = "Parameters/" + xmlNode + "/hv_NumLevels_Find";
                string shv_Greediness_Find  = "Parameters/" + xmlNode + "/hv_Greediness_Find";

                string shv_CenterRow = "Parameters/" + xmlNode + "/hv_CenterRow";
                string shv_CenterCol = "Parameters/" + xmlNode + "/hv_CenterCol";

                xmlRW.Update(shv_ScaleMethod, hv_ScaleMethod);

                xmlRW.Update(shv_NumLevels_Create, hv_NumLevels_Create.ToString());
                xmlRW.Update(shv_AngleStart_Create, hv_AngleStart_Create.ToString());
                xmlRW.Update(shv_AngleExtent_Create, hv_AngleExtent_Create.ToString());
                xmlRW.Update(shv_AngleStep_Create, hv_AngleStep_Create.ToString());
                xmlRW.Update(shv_ScaleRMin_Create, hv_ScaleRMin_Create.ToString());
                xmlRW.Update(shv_ScaleRMax_Create, hv_ScaleRMax_Create.ToString());
                xmlRW.Update(shv_ScaleRStep_Create, hv_ScaleRStep_Create.ToString());
                xmlRW.Update(shv_ScaleCMin_Create, hv_ScaleCMin_Create.ToString());
                xmlRW.Update(shv_ScaleCMax_Create, hv_ScaleCMax_Create.ToString());
                xmlRW.Update(shv_ScaleCStep_Create, hv_ScaleCStep_Create.ToString());
                xmlRW.Update(shv_Optimization_Create, hv_Optimization_Create);
                xmlRW.Update(shv_Metric_Create, hv_Metric_Create);
                xmlRW.Update(shv_Contrast_Create, hv_Contrast_Create.ToString());
                xmlRW.Update(shv_MinContrast_Create, hv_MinContrast_Create.ToString());

                xmlRW.Update(shv_AngleStart_Find, hv_AngleStart_Find.ToString());
                xmlRW.Update(shv_AngleExtent_Find, hv_AngleExtent_Find.ToString());
                xmlRW.Update(shv_ScaleRMin_Find, hv_ScaleRMin_Find.ToString());
                xmlRW.Update(shv_ScaleRMax_Find, hv_ScaleRMax_Find.ToString());
                xmlRW.Update(shv_ScaleCMin_Find, hv_ScaleCMin_Find.ToString());
                xmlRW.Update(shv_ScaleCMax_Find, hv_ScaleCMax_Find.ToString());
                xmlRW.Update(shv_MinScore_Find, hv_MinScore_Find.ToString());
                xmlRW.Update(shv_NumMatches_Find, hv_NumMatches_Find.ToString());
                xmlRW.Update(shv_MaxOverlap_Find, hv_MaxOverlap_Find.ToString());
                xmlRW.Update(shv_SubPixel_Find, hv_SubPixel_Find);
                xmlRW.Update(shv_NumLevels_Find, hv_NumLevels_Find.ToString());
                xmlRW.Update(shv_Greediness_Find, hv_Greediness_Find.ToString());

                xmlRW.Update(shv_CenterRow, hv_CenterRow.ToString());
                xmlRW.Update(shv_CenterCol, hv_CenterCol.ToString());

                string modelIDPath = AppDomain.CurrentDomain.BaseDirectory + @".//Parameters//" + templateName;
                HOperatorSet.WriteShapeModel(hv_ModelID, modelIDPath);

                string regionPath = AppDomain.CurrentDomain.BaseDirectory + @".//Parameters//" + regionName;
                HOperatorSet.WriteRegion(ho_Region, regionPath);

                errorFlag = false;
                return(true);
            }
            catch (Exception exc)
            {
                errorFlag = true;
                return(false);
            }
        }