how to use mouse event to get out loop in opencv using setmousecallback -


OpenCV's setmousecallback () to break the loop (for webcam video frames) as soon as the user presses

intxor, int yCor, int flag, blank * user input) {point 3_ & lt; Int & gt; * Mouse input = (Point 3_ & lt; int & gt; *) User Input; Mouse inputs-> X = xCor; Mouse inputs-> Y = yCor; MouseInputs- & gt; Z = event; } // for for loop (;;) {Camera & gt; & Gt; Frame; Imshow ("average frame", here is the 'code'; setmusickelback ("average frame", blmozole, and mouse input); if (mouseInputs.z == EVENT_RBUTTONDOWN) {cout & lt; & lt; "user selected ROI Highest Director "

  // mouse callback function zero getMouseLoc (int event, int XCor, int yCor, int flag, empty * user input) {point3_  * mouse input = (point 3_ & Lt; int & gt; *) User Input; MouseInputs-> gt = x = xCor; MouseInputs-> Y = yCor; MouseInputs-> gt = event;} // It should not be inside loop, one The bar is sufficient: Point3_  mouseInputs; SetMusicCellback ("Average Frame", Mmozole, and Mouse Input); // for Loop (;;) {Camera> Frame> Imshow ( "Average frame", here's the 'code'; // You are missing a call to wait (), otherwise your image will not be updated !! Int k = waitKey (40); Break if (k == 27); // SC pressed if (mouseInputs.z == EVENT_RBUTTONDOWN) {cout & lt; & Lt; "Top Director of ROI Selected by User" & lt; & Lt; Endl; Count & lt; & Lt; Mouse input. X & lt; & Lt; "And" & lt; & Lt; Mouse Input: & Lt; & Lt; Endl; break; }}    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -