private void btnTrack_Click(object sender, EventArgs e) { if (radioButton1.Checked) _kMeans = new KMeans((Bitmap)picPreview.Image, Convert.ToInt32(txtNumClusters.Text), ImageProcessor.Colour.Types.RGB); else _kMeans = new KMeans((Bitmap)picPreview.Image, Convert.ToInt32(txtNumClusters.Text), ImageProcessor.Colour.Types.HSV); timer1.Enabled = true; timer1.Start(); }
private void button1_Click(object sender, EventArgs e) { _kMeans = new KMeans(source_bmp, 4, ImageProcessor.Colour.Types.RGB); while (!_kMeans.Converged) { _kMeans.Iterate(); } seg_bmp = _kMeans.ProcessedImage; picturebox2_bmp = new Bitmap(seg_bmp, ImageUtils.GenerateImageDimensions(seg_bmp.Width, seg_bmp.Height, pictureBox2.Width, pictureBox2.Height)); pictureBox2.Image = picturebox2_bmp; }