public override void Setup(IEvolutionState state, IParameter paramBase) { confMat = new double[10, 10]; imageTransformer = new ImageTransformer(0, 0, "", ""); NumOfImagesPerCategory = 100; SuperpixelSize = 8; NumOfClasses = 10; NumOfFeatures = 64 * 64 / (SuperpixelSize * SuperpixelSize); CategoryDirs = Directory.EnumerateDirectories(@"F:\Gesty\problem2\grayscale").ToArray(); currentImage = new Image <Gray, Byte> [4]; originalImage = new Image <Gray, Byte> [4]; for (int i = 0; i < 4; i++) { currentImage[i] = new Image <Gray, Byte>(64, 64); originalImage[i] = new Image <Gray, Byte>(64, 64); } // Parameter = new SVMParameter(); //Parameter.Type = SVMType.C_SVC; //Parameter.Kernel = SVMKernelType.POLY; base.Setup(state, paramBase); Input = (ProblemData)state.Parameters.GetInstanceForParameterEq( paramBase.Push(P_DATA), null, typeof(ProblemData)); Input.Setup(state, paramBase.Push(P_DATA)); // imageTransformer.RescaleAndSaveImages(); // imageList = Directory.GetFiles(@"F:\Gesty\rescaled"); }
public override void Setup(IEvolutionState state, IParameter paramBase) { imageTransformer = new ImageTransformer(200, 200, @"F:\Gesty\bin", @"F:\Gesty\rescaled"); currentImage = new Image <Gray, Byte> [4]; originalImage = new Image <Gray, Byte> [4]; for (int i = 0; i < 4; i++) { currentImage[i] = new Image <Gray, Byte>(200, 200); originalImage[i] = new Image <Gray, Byte>(200, 200); } Parameter = new SVMParameter(); Parameter.Type = SVMType.C_SVC; Parameter.Kernel = SVMKernelType.POLY; base.Setup(state, paramBase); Input = (ProblemData)state.Parameters.GetInstanceForParameterEq( paramBase.Push(P_DATA), null, typeof(ProblemData)); Input.Setup(state, paramBase.Push(P_DATA)); // imageTransformer.RescaleAndSaveImages(); // imageList = Directory.GetFiles(@"F:\Gesty\rescaled"); imageTransformer.RescaleAndRotate(); imageList = Directory.GetFiles(@"F:\Gesty\rotated"); }