public KNearest(MainForm form) { this.form = form; trainData = cxcore.CvCreateMat(train_samples * classes, size * size, cxtypes.CV_32FC1); trainClasses = cxcore.CvCreateMat(train_samples * classes, 1, cxtypes.CV_32FC1); K = int.Parse(form.txtK.Text); p = new preprocessing(form); }