Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I want to use kmeans image segmentation by using emgucv.
I want to split the image into 3 clusters depend on the color...how can I do that? can anyone give me the advise for starting...pls

What I have tried:

I saw this code
public static double Kmeans(
	IInputArray data,
	int k,
	IOutputArray bestLabels,
	MCvTermCriteria termcrit,
	int attempts,
	KMeansInitType flags,
	IOutputArray centers = null
)

how to convert my image to inputarray data?
Posted
Updated 30-Apr-19 18:46pm

1 solution

You may want to read up on the chapter of Emgu CV discussing working with images here:
Working with Images - Emgu CV: OpenCV in .NET (C#, VB, C++ and more)[^]
Quote:
Unlike the Image<,> class, where you will need to pre-allocate memory with the correct size before passing it as an IOutputArray, when an empty Mat is passed as an IOutputArray, Open CV will automatically allocate memory for the Mat. You can also load an image from file using the CvInvoke.Imread function:


There have been plenty of articles posted on CodeProject over the last several years; you may want to read through them and see the various techniques in action:
CodeProject | Search results for "Emgvu CV"[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900