I am relatively new to OpenCV and I am trying to work on virtual mouse. I figured out how to detect different colors and filter them out. I couldn't find how to make mouse click when specific color is detected. Here my sample code:
if (b == 1){
if (x >= 0 && y >= 0 && PosX >= 0 && PosY >= 0)
//Here is the function to left clicking the mouse
}
I figured out how to move the mouse. I used SetCursorPos(x,y). I would appreciate any help. Thank you in advance!