You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to select a ROI by mouse input. I wish to get the pixel coordinates by means of a mouseCallback, however the mouseCallback never seems to be called. Other callbacks such as trackbar seems to work just fine.
Environment
Visual Studio 2017 WPF
Example code:
public void getMouseClickCoordinates(MouseEvent e, int x, int y, MouseEvent f)
{
System.Windows.MessageBox.Show("im a callback");
}
public void trackbarCallback(int pos, object userdata)
{
System.Windows.MessageBox.Show("im a trackbarcallback");
}
public MainWindow()
{
InitializeComponent();
}
int bla = 5;
private void Button_Click(object sender, RoutedEventArgs e)
{
Mat mat;
mat = Cv2.ImRead("C:\\Users\\Master\\Desktop\\img.png");
Cv2.NamedWindow("myWindow");
Cv2.CreateTrackbar("myTrackbar", "myWindow", ref bla, 0, new
CvTrackbarCallback2(trackbarCallback));
Cv2.SetMouseCallback("myWindow", new CvMouseCallback(getMouseClickCoordinates));
Cv2.ImShow("myWindow", mat);
Cv2.WaitKey(2000);
}
The text was updated successfully, but these errors were encountered:
Summary of your issue
Im trying to select a ROI by mouse input. I wish to get the pixel coordinates by means of a mouseCallback, however the mouseCallback never seems to be called. Other callbacks such as trackbar seems to work just fine.
Environment
Visual Studio 2017 WPF
Example code:
The text was updated successfully, but these errors were encountered: