/// <summary> /// 保存多目校准的系数 /// </summary> /// <param name="noCamera_e">相机序号</param> /// <param name="index">算子序号,不是拍照位置</param> /// <param name="calib"></param> /// <returns></returns> public static bool SaveCalibMultCo(NoCamera_enum noCamera_e, int index, double[] calib) { try { BaseParComprehensive par = GetParComphensive(noCamera_e); //index 获取对应算子的所有单元格名称 List <string> nameCell_L = par.GetAllNameCellByType("多目校准"); if (nameCell_L.Count < index) { return(false); } string nameCell = nameCell_L[index - 1]; ParCalibMult parCalibMult = par.GetCellParCalibrate(nameCell) as ParCalibMult; for (int i = 0; i < calib.Length; i++) { parCalibMult.CoCalib[i] = calib[i]; } bool blSave = par.WriteXmlDoc(nameCell); if (blSave) { ShowState(string.Format("将多目校准{0}参数保存到本地成功", nameCell)); } else { ShowAlarm(string.Format("将多目校准{0}参数保存到本地失败", nameCell)); return(false); } return(true); } catch (Exception ex) { Log.L_I.WriteError("BaseDealComprehensiveResult", ex); return(false); } }
public static List <Point3D> GetCalibCellRefValue3(NoCamera_enum noCamera_e, string nameType) { try { return(GetCalibCellRefValue3(noCamera_e, 1, nameType)); } catch (Exception ex) { Log.L_I.WriteError("Main_EX", ex); return(null); } }
/// <summary> /// 获取相机综合设置参数顶层类 /// </summary> /// <param name="noCamera_e"></param> /// <returns></returns> public static BaseParComprehensive GetParComphensive(NoCamera_enum noCamera_e) { try { BaseParComprehensive par = ParComprehensive1.P_I; switch (noCamera_e) { case NoCamera_enum.Camera1: par = ParComprehensive1.P_I; break; case NoCamera_enum.Camera2: par = ParComprehensive2.P_I; break; case NoCamera_enum.Camera3: par = ParComprehensive3.P_I; break; case NoCamera_enum.Camera4: par = ParComprehensive4.P_I; break; case NoCamera_enum.Camera5: par = ParComprehensive5.P_I; break; case NoCamera_enum.Camera6: par = ParComprehensive6.P_I; break; case NoCamera_enum.Camera7: par = ParComprehensive7.P_I; break; case NoCamera_enum.Camera8: par = ParComprehensive8.P_I; break; } return(par); } catch (Exception ex) { return(null); } }
/// <summary> /// 获取指定相机中校准算子的引用值列表, /// </summary> /// <param name="noCamera_e">相机序号</param> /// <param name="pos">算子序号</param> /// <param name="nameType">算子名称</param> /// <returns></returns> public static List <Point2D> GetCalibCellRefValue2(NoCamera_enum noCamera_e, int pos, string nameType) { List <Point2D> p_L = new List <Point2D>(); try { BaseParComprehensive par = GetParComphensive(noCamera_e); //获取对应算子的所有单元格名称 List <string> nameCell_L = par.GetAllNameCellByType(nameType); if (nameCell_L.Count < pos) { return(null); } string nameCell = nameCell_L[pos - 1]; //校准基类 BaseParCalibrate baseParCalibrate = par.GetCellParCalibrate(nameCell); List <ResultforCalib> resultforCalib_L = baseParCalibrate.g_ParGetResultFromCell.ResultforCalib_L; if (nameType == "旋转中心变换") { resultforCalib_L = ((ParCalibRotate)baseParCalibrate).g_ParGetResultFromCellForRC.ResultforCalib_L; } for (int i = 0; i < resultforCalib_L.Count; i++) { if (resultforCalib_L[i].XResult * resultforCalib_L[i].YResult != 0) { p_L.Add(new Point2D(resultforCalib_L[i].XResult, resultforCalib_L[i].YResult)); } } return(p_L); } catch (Exception ex) { Log.L_I.WriteError("Main_EX", ex); return(null); } }