WebcamApp Dll

Posted By: Slin

WebcamApp Dll - 02/23/09 23:48

I was asked by several people to share this dll and thus I finall decided to post it here.
It is everything else but perfect and basicly just a bad wrapper of an awsome library plus basic point tracking.

You can use it completely free and however you want, but please share your results with me (not needed, it would just be a simple way for you to make me happy :P), as I am always enjoying to test such stuff :P

It is the dll used in those three videos:




And you can download it here: http://files.filefront.com/WebcamApp+Pub+V1rar/;13353125;/fileinfo.html


The example allows you to open the webcams driver panel with strg. You should hold something bright in front of your webcam like a torch and make sure that only this one can be seen as a white dot on the image. If you then press alt and afterwards space to set everything to zero, you can look around by moving the torch.
Posted By: Cowabanga

Re: WebcamApp Dll - 02/24/09 11:06

I was waiting for this! Thnaks! smile

Just a question, Can i use it in a commercial game?
Posted By: 3dgs1

Re: WebcamApp Dll - 02/24/09 15:14

i watched some jhonny lee vids 2 mounts ago and i started experimenting with wii motes and sensor bar since then im glad too see that im not the only 1 interested in implementing them in games from here

Posted By: XD1v0

Re: WebcamApp Dll - 02/24/09 17:42

Slin its awesome Contribution!
How many marker this plug-in can track, only one?
Posted By: Slin

Re: WebcamApp Dll - 02/24/09 18:52

Thanks for your comments wink
It can track 20 points.
Posted By: Quad

Re: WebcamApp Dll - 02/24/09 20:04

i guess the 20 points are decided by the brightness?

i mean what happens if i use 5 points at same brightness and close to each other?

if it was able to track colored points, it could be used for very basic non preciese mocap. (with 2-4 cameras, or 2d mocap with 1 camera)

aand, btw, thanks for your contrubition looks nice wink
Posted By: JazzDude

Re: WebcamApp Dll - 02/26/09 20:05

Wow!...very impressive!
Posted By: BoH_Havoc

Re: WebcamApp Dll - 02/27/09 16:54

Sweet! This came just in time for a small project we do at the university at the moment smile

Great contribution as always wink
Posted By: Hitsch

Re: WebcamApp Dll - 03/25/09 15:48

I've been messing with your WebcamApp a bit.

The WiiRemote-solution is still something I would like to try out, but it turns out the effect looks almost as nice when tracking only one point trough a standard webcam.



So essentially what I'm doing is using the tracked white spot to move the scene counter wise to the movement of the observer in front of the screen. The hard part turned out the be finding the right amount of movement and the right amount of zoom. But I think it looks plausible now.

Since the distance of the observer to the screen can not be determent like this, my scene will only adjust to movements right/left and up/down.

It takes some time for the scene to catch up with the observers movements, the effect is not perfect yet and the illusion often goes away when you're looking a it live and notice even a small lagg. But since my crapy phonecamera is just as slow, it doesn't show on video.

I've also implemented Slin's AnaglyphApp to further give the illusion of a 3D scene and it really makes a huge difference.

I'm trying to make the scene and code adjustable to any screen/webcam combination.
I would also like to create a nice scene that looks realistic, kind of a "inner life of a computer screen".

And no, I'm not sponsored by the CocaCola-Company cool , but it's a great object for realism , because everybody knows how it looks like in real life...

Thanks Slin for your great contributions and for making it easy to implement them!
Posted By: cro_games

Re: WebcamApp Dll - 03/30/09 23:37

Slin knows I love it..
Originally Posted By: XD1v0
Slin its awesome Contribution!
How many marker this plug-in can track, only one?

You can use plugin like I did..just for getting picture from webcam,and than you can programm it all..I have made my own motion tracking system..
p.s.
3. video is mine.
Posted By: carlpa

Re: WebcamApp Dll - 04/03/09 20:31

thank you for the app. I have not tried it yet. As a neurolgist, I was ondering if this could be made into an inexpensive tool for people with cervical spinal cord lesions. There are systems that exist but most are expensive. I look forward to your thoughts and comments.
Posted By: MMike

Re: WebcamApp Dll - 04/09/09 17:21

where is the functions llist? and manual do you have something? so i can know how to i get the image to panel for example? if thats possibble at all.?
Posted By: MMike

Re: WebcamApp Dll - 04/09/09 18:27

Originally Posted By: Quadraxas
i guess the 20 points are decided by the brightness?

i mean what happens if i use 5 points at same brightness and close to each other?

if it was able to track colored points, it could be used for very basic non preciese mocap. (with 2-4 cameras, or 2d mocap with 1 camera)

aand, btw, thanks for your contrubition looks nice wink


the points are merget into the same pixel center, but when you move appart, they will reform again, i hope.
Posted By: Hitsch

Re: WebcamApp Dll - 04/09/09 21:16

I've tried to track multiple (two) points, when trying to get the distance of the two spots to the camera.

Since the points will swap if one gets brighter then the other, I couldn't get this to work as it should. That happens a lot if you use two torches or two white spots on a paper, depending on the angle to the camera.

So if two spots could be identified in an absolute way, so that it always knows which point it is, it would help a lot for mocap or any other precise tracking.

I think there is a function that determents the points color, but since that can change with the points brightness, I don't think it would solve the problem.
Posted By: MMike

Re: WebcamApp Dll - 04/09/09 21:55

well you can always analise the 4d dimension right? the time...

So, you can run/apply a probability prediction of who is who. istead of random, at least you could get more accurate result.

So you know that if you mix 2 points one coming from above to down, and one from the left to the right..and they cross to a single point.. the next value from that cross, is what? probably the dots would keep their direction, so the above will keep goin down, and the left will keep going right, and not, the up will go right and the left to right will go down.. understand me?

So you have the var delta_x and delta_y that holds the position frame -1 frames, so you get a direction vector, and you then predict based on that. like(if the direction vector is the same then id is the same, else switch).
Posted By: Hitsch

Re: WebcamApp Dll - 04/10/09 13:30


I think your idea could work if it's done right and if those very unlikely situations of points changing direction just when they're crossing, are not messing things up.
That combined with a color recognition should get results that are reliable enough

Since in my case I'm only using points that will never cross their path, I could fix my problem by always taking the right point as point one, instead of the bright one.
This works perfectly, I can know get the distance between the light sources and the camera. So if the observer has two light sources left and right of the head, then I know if he's moving closer or further away.

Now the next problem is that if he's turning the head, then the points are moving closer together and it looks like if he's moving closer.
I have to find a solution for that yet...
Posted By: MMike

Re: WebcamApp Dll - 04/10/09 13:54

Oh yes, that because you are using 2 points, and you cant derivate that, from 2 points..
So your solution is very very simple..

You must have have 3 points.. So.. if you have a head with 2 lights, you need on more in on the upper side.. like this:



()
||
()--[HEAD]--()

Thus you can draw a triangle.. and when you aproach , however they scale they on screen.. the distance between those, is the same...
But when you rotate.. the distance will cause the triangle to srhink.. horizontaly and the distance of the left to the right will be smaller but, the up will mantain..

You can calcultate that by the angles of the corners, or by dividing the side lenghts with the down lenth
Code:
     .
    /|\
   / | \  right side lenght
  /  |  \
 ~-------~
    down leght


Posted By: Hitsch

Re: WebcamApp Dll - 04/10/09 14:37

I guess that would be a solution.
But it would require a lot of calculations and I would look like Sam Fisher grin

I'm thinking more of something like the Wii-Bar, which is essentially just like the white spots for the camera. And since I would like to reduce the amount of equipment needed, I will try to get it to work with I guess about 4-6 points.
They could then be mounted on sunglasses, or just white spots on a black paper.

The Wii-Bar contains 10 lights, 5 on each end. I think the way they do it is looking at how much the points a getting closer together. If they all come closer together at the same speed, then they are all getting closer. If the points on one side move closer together faster than on the other, that means this side has moved closer while the other one has moved away, so the player has turned.
Something like that...

But I'm not sure if tracking that many points, with the small resolution of a webcam, is going work out.
Posted By: MMike

Re: WebcamApp Dll - 04/10/09 14:52

white spots on a black paper? why dont you use an infra red reflting paper, that you can easly crop and glue tot he sun glasses, .. and so enchace the IR you can use a tv control to send light in front of you..
Posted By: Hitsch

Re: WebcamApp Dll - 04/10/09 15:07

My main goal is to keep it as simple as possible. I would like to keep this down to a webcam and at best two torches. But I realize that it doesn't work with the distance, so I have to make it a bit more complex, but I'd rather not touch IR.
Other wise the Wii-Remote solution would solve all my problems.

But I just realized that when the observer moves left and right in front of the screen, he always turns towards the screen and the webcam, if he's directly in front of it, he wont turn he's head away. (or shouldn't)
So maybe I can just account for the amount of head turning when he's moving to the side, that the distance stays steady enough.

It's not perfect, because the angle changes when getting closer to the webcam, but then again, this is not that precise, and it doesn't have to be, just close enough. wink
Posted By: Slin

Re: WebcamApp Dll - 04/12/09 12:29

Originally Posted By: carlpa
thank you for the app. I have not tried it yet. As a neurolgist, I was ondering if this could be made into an inexpensive tool for people with cervical spinal cord lesions. There are systems that exist but most are expensive. I look forward to your thoughts and comments.


What exactly could it may be used for?
I finally found some kind of translation for "cervical spinal cord lesions", but could not find any information on how this could may help.
It would be great if you could give me some links or just a little more explanation.

I am currently working on a improved version of the dll with more features. But it will take some time until it is done.
Posted By: txesmi

Re: WebcamApp Dll - 04/16/09 19:15

i'm impresed. i'll follow your work closely!
Posted By: Felixsg

Re: WebcamApp Dll - 04/17/09 20:18

Originally Posted By: Slin
Originally Posted By: carlpa
thank you for the app. I have not tried it yet. As a neurolgist, I was ondering if this could be made into an inexpensive tool for people with cervical spinal cord lesions. There are systems that exist but most are expensive. I look forward to your thoughts and comments.


What exactly could it may be used for?
I finally found some kind of translation for "cervical spinal cord lesions", but could not find any information on how this could may help.
It would be great if you could give me some links or just a little more explanation.

I am currently working on a improved version of the dll with more features. But it will take some time until it is done.


probaly to control the aplication only with the head
(normally is the only part can move)
Posted By: Reconnoiter

Re: WebcamApp Dll - 06/13/14 10:46

Sry to necro, but link is dead. Does anyone still have the file and could maybe post it here? ty :-)
© 2024 lite-C Forums