public bool ReadParams(String xmlNode, string imageName, 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"; hv_MinGray = Convert.ToInt32(xmlRW.Read(shv_MinGray)); hv_MaxGray = Convert.ToInt32(xmlRW.Read(shv_MaxGray)); hv_Min = Convert.ToInt32(xmlRW.Read(shv_Min)); hv_Max = Convert.ToInt32(xmlRW.Read(shv_Max)); hv_Number = Convert.ToInt32(xmlRW.Read(shv_Number)); string imagePath = AppDomain.CurrentDomain.BaseDirectory + "Parameters\\" + imageName; HOperatorSet.ReadImage(out ho_Image, imagePath); string regionPath = AppDomain.CurrentDomain.BaseDirectory + "Parameters\\" + regionName; HOperatorSet.ReadRegion(out ho_Region, regionPath); errorFlag = false; return(true); } catch (Exception exc) { errorFlag = true; return(false); } }
public bool ReadParams(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"; string shv_Model = "Parameters/" + xmlNode + "/hv_Model"; string shv_RegionMin = "Parameters/" + xmlNode + "/hv_RegionMin"; string shv_RegionMax = "Parameters/" + xmlNode + "/hv_RegionMax"; hv_MeasureLength1 = Convert.ToInt32(xmlRW.Read(shv_MeasureLength1)); hv_MeasureLength2 = Convert.ToInt32(xmlRW.Read(shv_MeasureLength2)); hv_MeasureSigma = Convert.ToDouble(xmlRW.Read(shv_MeasureSigma)); hv_MeasureThreshold = Convert.ToInt32(xmlRW.Read(shv_MeasureThreshold)); hv_GenParamName = xmlRW.Read(shv_GenParamName); hv_GenParamValue = xmlRW.Read(shv_GenParamValue); hv_Row1 = Convert.ToDouble(xmlRW.Read(shv_Row1)); hv_Column1 = Convert.ToDouble(xmlRW.Read(shv_Column1)); hv_Row2 = Convert.ToDouble(xmlRW.Read(shv_Row2)); hv_Column2 = Convert.ToDouble(xmlRW.Read(shv_Column2)); hv_Model = Convert.ToInt32(xmlRW.Read(shv_Model)); hv_RegionMin = Convert.ToInt32(xmlRW.Read(shv_RegionMin)); hv_RegionMax = Convert.ToInt32(xmlRW.Read(shv_RegionMax)); errorFlag = false; return(true); } catch (Exception exc) { errorFlag = true; return(false); } }
public bool ReadParams(String xmlNode, string templateName, string imageName, 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"; hv_ScaleMethod = xmlRW.Read(shv_ScaleMethod); hv_NumLevels_Create = Convert.ToInt32(xmlRW.Read(shv_NumLevels_Create)); hv_AngleStart_Create = Convert.ToDouble(xmlRW.Read(shv_AngleStart_Create)); hv_AngleExtent_Create = Convert.ToDouble(xmlRW.Read(shv_AngleExtent_Create)); hv_AngleStep_Create = Convert.ToDouble(xmlRW.Read(shv_AngleStep_Create)); hv_ScaleRMin_Create = Convert.ToDouble(xmlRW.Read(shv_ScaleRMin_Create)); hv_ScaleRMax_Create = Convert.ToDouble(xmlRW.Read(shv_ScaleRMax_Create)); hv_ScaleRStep_Create = Convert.ToDouble(xmlRW.Read(shv_ScaleRStep_Create)); hv_ScaleCMin_Create = Convert.ToDouble(xmlRW.Read(shv_ScaleCMin_Create)); hv_ScaleCMax_Create = Convert.ToDouble(xmlRW.Read(shv_ScaleCMax_Create)); hv_ScaleCStep_Create = Convert.ToDouble(xmlRW.Read(shv_ScaleCStep_Create)); hv_Optimization_Create = xmlRW.Read(shv_Optimization_Create); hv_Metric_Create = xmlRW.Read(shv_Metric_Create); hv_Contrast_Create = Convert.ToInt32(xmlRW.Read(shv_Contrast_Create)); hv_MinContrast_Create = Convert.ToInt32(xmlRW.Read(shv_MinContrast_Create)); hv_AngleStart_Find = Convert.ToDouble(xmlRW.Read(shv_AngleStart_Find)); hv_AngleExtent_Find = Convert.ToDouble(xmlRW.Read(shv_AngleExtent_Find)); hv_ScaleRMin_Find = Convert.ToDouble(xmlRW.Read(shv_ScaleRMin_Find)); hv_ScaleRMax_Find = Convert.ToDouble(xmlRW.Read(shv_ScaleRMax_Find)); hv_ScaleCMin_Find = Convert.ToDouble(xmlRW.Read(shv_ScaleCMin_Find)); hv_ScaleCMax_Find = Convert.ToDouble(xmlRW.Read(shv_ScaleCMax_Find)); hv_MinScore_Find = Convert.ToDouble(xmlRW.Read(shv_MinScore_Find)); hv_NumMatches_Find = Convert.ToInt32(xmlRW.Read(shv_NumMatches_Find)); hv_MaxOverlap_Find = Convert.ToDouble(xmlRW.Read(shv_MaxOverlap_Find)); hv_SubPixel_Find = xmlRW.Read(shv_SubPixel_Find); hv_NumLevels_Find = Convert.ToInt32(xmlRW.Read(shv_NumLevels_Find)); hv_Greediness_Find = Convert.ToDouble(xmlRW.Read(shv_Greediness_Find)); hv_CenterRow = Convert.ToDouble(xmlRW.Read(shv_CenterRow)); hv_CenterCol = Convert.ToDouble(xmlRW.Read(shv_CenterCol)); string modelIDPath = AppDomain.CurrentDomain.BaseDirectory + @".//Parameters//" + templateName; HOperatorSet.ReadShapeModel(modelIDPath, out hv_ModelID); string imagePath = AppDomain.CurrentDomain.BaseDirectory + "Parameters\\" + imageName; HOperatorSet.ReadImage(out ho_Image, imagePath); string regionPath = AppDomain.CurrentDomain.BaseDirectory + "Parameters\\" + regionName; HOperatorSet.ReadRegion(out ho_Region, regionPath); errorFlag = false; return(true); } catch (Exception exc) { errorFlag = true; return(false); } }