I want to get the position of a mouse click on an IplImage. I searched for it but I couldn't find anything. There is no source for get mouse position in c# using openCVsharp methods. So I tried something. When the code is started it is waiting for the waiting time at that time I click with mouse but nothing is happining. And after the waitkey the code stops. Is there a way to get the position of a mouse click on an IplImage?
namespace mousedeneeme
{
class Program
{
static void Main(string[] args)
{
IplImage I_clean = Cv.LoadImage("Iclean.tiff", LoadMode.GrayScale);
String s = Cv.NamedWindow("I_clean image").ToString();
CvMouseCallback mo = new CvMouseCallback(on_mouse);
Cv.SetMouseCallback(s, on_mouse);
Cv.ShowImage("I_clean image", I_clean);
Cv.WaitKey(5000);
}
public static void on_mouse(MouseEvent me, int x, int y, MouseEvent me7) {
Console.WriteLine(x);
}
}
}