//构造函数-3:由构造好的ImagePCX对象创建,类别由参数给定 public Features(PCXImage pcx, int myclassID) { if (pcx == null) { return; } pcximage = pcx; PcxtoMartix(); ET1(); DT12(); MergeFeature(); classID = myclassID; }
//构造函数-4:由构造好的ImagePCX对象创建,忽略类别 public Features(PCXImage pcx) { if (pcx == null) { return; } this.pcximage = pcx; //初始化数据 这里也可以直接写函数Set、Get进行初始化 PcxtoMartix(); ET1(); DT12(); MergeFeature(); classID = -1; }
//构造函数-2:由文件路径创建,忽略类别 public Features(string p_FileFullName) { if (!File.Exists(p_FileFullName)) { return; } this.filepath = p_FileFullName; Image image = PCXHelper.LoadPCX(p_FileFullName); this.pcximage = PCXHelper.GetPCXImage(p_FileFullName); PcxtoMartix(); ET1(); DT12(); MergeFeature(); classID = -1; }