Fix a position in a webcam video using OpenCV - opencv

I'm trying to draw an arrow to moving video using OpenCV.
What I want to do is the following:
Select a position (eg with the mouse) in the video captured by my webcam. Then I want to draw an arrow at this position. While the camera is moving the arrow should get drawn at the right position relatively to the webcam video.
Can you give some hints on how to do this?

This is pretty much what I'm looking for, but it isn't that stable. Since I'm a newbie to OpenCV, it would be helpful to get some help.

Related

Can I use OpenCV to analyze a video for how long a face is in the centre of the screen?

This is a frame from a video taken using the HTC Vive (it's from the user's perspective of a game I developed in Unity) I've overlaid those boxes in paint.
I'm trying to determine which character the person is looking at (assuming the white box is where they user is focusing)
I know this can be done in Unity without the need for a video, but I want to know if the video can be analyzed using something like OpenCV to detect how long each character faces is in the white box. I just made this in paint to get the idea across, the parameters aren't to scale or anything, I just have no idea where to start with a concept like this apart from OpenCV.
But to summarize, can I use OpenCV to detect how long each face is in the centre of the screen? i.e. How long the user looked at each character.

Screen detection using opencv / Emgucv

I'm working on computer screen detection using emgucv (a c# opencv wrapper ).
I want to detect my computer screnn and draw a rectangle on it.
To help in this process, I used 3 Infrared Leds on the screen of the computer which I detect firtsly and after the detection, I could find the screen areas below those 3 leds.
Here is the results after the detection of the 3 leds.
The 3 red boxes are the detected leds.
.
And in general I have something like this
Does anyone have an idea about how I can proceed to detect the whole screan area ?
This is just a suggestion but, if you know for a fact that your computer screen is below your LEDs, you could try using OpenCV GrabCut algorithm. Draw a rectangle below the LEDs, large enough to contain the screen (maybe you could guess the size from the space between the LEDs) and use it to initialize the GrabCut.
Let me know what kind of results you get.
You can try to use a camera with no IR filter(This is mostly all night vision cameras) so that you can get a more intense light from the LEDs hence making it stand out than what your display would have then its a simple blob detection to get there position.
Another solution would be using ARUCO markers on the display if the view angle you are tending to use are not very large then its should be a compelling option and even the relative position of the camera with the display can be predicted also if that is what you want. With the detection of ARUCO you can get the angles that the plane of the display is placed at hence making the estimation of the display area with them.

Saving bounding box coordinates for each frame in a video

I have a video from a camera with humans on the scene. I need to go through each frame of that video and manually save the coordinates (go through each frame and draw the square around each human) of the bounding box of the detected humans on the scene and the coordinate of the center of the head - so basically, top-left, bottom-right, head-center coordinates. The bounding box has to be a square.
An additional program will then read a file with coordinates of the square and center of head and the frame number, and extract the boxes as an image.
For anybody that has experience with computer vision - is there any open-source software that can accomplish what I am requesting? If not, what technology would you recommend building this tool on? Any starter code?
I don't know of any programs that can do specifically this, but I think it is an easy problem and you can code it yourself in no time.
As you are in the computer vision field you must be used to OpenCV. You can use it to extract the frames from a video and to select the box and head center.
Here are some links that can help you out:
Extract video frames
Detect mouse events

How to track head using Kinect

I want to track the head of a player in order to move the camera inside XNA.
When the player rotates left or right, the camera inside XNA will respond to this action and will also rotate.
I tried using the head joint from Skeleton Data and taking the vector value X,Y but this is not an accurate solution. I need another solution that can rotate the camera inside XNA.
Any suggestions?
You could use the Face Tracking API and see the difference from a certain point on the users face (like their nose) to decide whether or not the user looked in a different direction. The points on a users face are assembled like this:
Then you can see if the X changed and by what amount to see the rotation effects.
(You might want to see Facial Recognition with Kinect)

How to overlay small animation on camera stream in opencv

I am developing an application using opencv as my college project, it's almost done except that i am unable to overlay a animated video( a flash video) over my camera stream, i want to capture user mouth and after detecting mouth i want to overlay a animated video of smoke. Please can anyone help me with the overlaying part? If it is not possible can you shed some light on any workaround
I am using opencv 2.3.1 and ubuntu 11.10.
Basically, all you need to do is set a ROI (Region of Interested) in the video frame and then perform the operation to copy an arbitrary image to that specific position in the video frame.
I've demonstrated how to do something similar in this thread, where the user selects the ROI with the mouse and the system performs a grayscale conversion of that area.
Also, this thread shows how to use the mouse to draw over the webcam window.
Both threads use the C interface of OpenCV and they show how to accomplish the overlay effect you are looking for.

Resources