Answer the question
In order to leave comments, you need to log in
How can I highlight areas of different colors in an image or on a camera?
Good day. I need to make a program that will select color areas of different colors. As in the fact sheet below. In most examples, they write how to find one color.
I found a code that converts to RGB
private void btnLoadSequence_Click(object sender, EventArgs e)
{
string dir = Directory.GetParent(Environment.CurrentDirectory).FullName;
dir = Directory.GetParent(dir).FullName;
this.openFileDialog1.InitialDirectory = dir;
this.openFileDialog1.Filter="IMAGES |*.jpg;*.bmp";
this.openFileDialog1.FileName = "";
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
picPreview.Image = null;
picPreview.Refresh();
lblInfo.Text = "";
Image b = Image.FromFile(openFileDialog1.FileName);
picPreview.Image = b;
picProcessed.Image = null;
picProcessed.Refresh();
}
}
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();
}
#endregion
KMeans _kMeans;
int _count = 0;
Answer the question
In order to leave comments, you need to log in
it?
or that
In most examples, they write how to find one color.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question