Screen from my new game working on

Community Forums/Showcase/Screen from my new game working on

Panno(Posted 2003) [#1]

eie toy for windows ;)

look at my worklog please

now with blue box (chroma key)


mfg panno


Panno(Posted 2003) [#2]
chroma key implement 80%


jfk EO-11110(Posted 2003) [#3]
PANNO, I don't know exactly what it is, but I feel like it's something rrreally cool! Is this the new Webcam DLL in Action? What is my Fish doing there? Has it become a Pirhana and is trying to bite in your Finger?

Please describe what it does!


Panno(Posted 2003) [#4]
no no i give him feed and them he get bigger and bigger and
then crashed he into many particels and over the screen runs blood ! i've got 10 point's LOL


yes this is my special webcam dll in action
i am working on because motion capture is a haevy act (for me)



look at this !
this is a link for the ps2

www.eyetoy.com



mfg panno


jfk EO-11110(Posted 2003) [#5]
Sounds good :) Yes, Motion Tracking is difficult when you don't use special Markers. You could use infrared LEDs - they are invisible to the human eye but can be seen by the camera, check out conrad.de for cheap LEDs.


Shagwana(Posted 2003) [#6]
looks neat


IPete2(Posted 2003) [#7]
Wow Panno,

Eye Toy from Blitz? Good man - I like it!!!!

Keep us posted as this would be a great fun thing for Christmas!!!

IPete2.


Panno(Posted 2003) [#8]
i will do all my best to release it at start december


Anthony Flack(Posted 2003) [#9]
This is very worthy. Good luck! If you can get it all happening nicely it could be huge fun.


Panno(Posted 2003) [#10]
hm motion tracking is a hard way

command "HIT" 80% implementet
command "SPEED" 0.1 % implementet





please wait a while


Panno(Posted 2003) [#11]
new pic now with buttons and the best
!it works!!!

but 62 millisecs per frame grrrrr
i need a inline asm and pointer .Please !






hit is ok but the movement sux at the moment


ps: a bit do dark here


jfk EO-11110(Posted 2003) [#12]
Hey Panno, I just tried your old Camera DLL with my new ultracheap Camera. First it gave me a real low framerate, but then I edited the source a bit and now I got about 15 FPS or something!

I edited it the following way:

callDll("pbca3d","START") is called only once, before the main loop.

callDll("pbca3d","ENDCAP") is called only once, after the main loop.

callDll("pbca3d","GIVEIMAGE") is called every Frame. Then I use the following waiting Code:
a=0
while a=0 and keydown(1)=0
a=peekbyte(out_bank,0)
wend


Now it works perfectly!!! It is the fastest solution I found yet, perfect!!!

The good news is: this new cheap cam doesn't fail like the other cams I had before. I already wrote a little Source that allows to use TV Remote Control as a Mouselike Input device. This works up to 3 Meter Distance, I can draw Pictures on the Screen using the TV-Remote-Control :)

(only had to mirror the x-axis)

I will now think about a simple solution to determine the Depth of the Marker to use it as a 3D Cursor.

EDIT: ARRRGH! There's just another Problem popped up :/ (See PM @ blitzforum)


Panno(Posted 2003) [#13]
New DLL FOR B3D
with source ! runs fine in xp



www.napalm.de/webcamdll/webcamdll.rar
have fun


L_Draven(Posted 2003) [#14]
the example text.exe dont work for me.

I have memory access violation in pointer=pointer+4 with debug mode on.

Any idea?


IPete2(Posted 2003) [#15]
Panno,

Yes me too, as L Draven above, pointer=pointer+4 is highlighted in Debug with a crash.

I have a USB logitech clicksmart 310 web cam.

Is there something else I am missing?

Does this work with EyeToy?

Thanks,

IPete2.


*** HOLD IT L-Draven ****

Don't select the driver in the dialog box, just click okay instead.

I get a picture but it is not synched

IPete2.


Jim Teeuwen(Posted 2003) [#16]
mm the test.exe and the source both work as far as they do not crash, but the imagery I get is really distorted.

See this screenshot

Ive got a Philips Vesta Pro cam.
Any idea how this is happening?


L_Draven(Posted 2003) [#17]
Thanks Ipete2 but i continue with the same error. :-(

thanks again.

L_DRAVEN


Panno(Posted 2003) [#18]
sorry i have forgott :

make sure u have the foolowing settings in your softwareapplication from the developer

320*240
24 bit

what will works


Panno(Posted 2003) [#19]
and itete 2 and l_draven have win98 i guess


L_Draven(Posted 2003) [#20]
Hi PANNO

NOTHING!!! dont work!! grrr :-))

i have XP.

I think that the problem is in my webcam because is bad. (it is D-MAX 4 in 1) :-( (BAD BAD :-))


Skitchy(Posted 2003) [#21]
Just had an idea. You might be doing it this way already - in any case here goes :-

My idea relates to FAST motion detection. Say you are using a screen size of 800x600. Now, you don't need to test *every* pixel for movement but instead have 1 pixel per 'zone'. With the 800x600 example, if you wanted 100 zones, you'd test pixel 80,60 / 160,60 / 240,60 etc. (simply put, one pixel in every box on an invisible grid).
Then, you test each of your pixels to see if there has been a change in colour. Now, bearing in mind that on live video you're always going to get some artefacts and small colour variation, you'll need to build in a 'tolerance' setting so that zones aren't triggered accidentally (analog sources generally have that 'creep' thing as well).

Now, the clever part. You can then decide what direction something is moving by comparing currently active zones with previously active zones. For example if the zone at 0,80 is active now, and the zone at 0,0 was active before, then you can deduce that the movement is *probably* heading from left -> right. You could remember as many 'previous poses' as you needed to get a good result. You could also gain accuracy by remembering the different colours moving through different zones, and vector math / probability tables (any human figure is always going to move in similar ways).
The great thing about this method is that it does NOT require a uniform background colour, provided the camera never moves (background pixels will be fixed, hence they will never trigger movement).

Hope that's of some help :)


IPete2(Posted 2003) [#22]
Panno,

I am using XP.

I have a Logitech clicksmart 310 camera, works perfectly with its own software to do all sorts of things.

It is set at 320,240.

I get a picture and I can see movement but the picture is made of diagonally out of synch bits of picture. I'll try and post a picture.

My output is a lot worse than the picture shown by Defiance...


Ipete2.


jfk EO-11110(Posted 2003) [#23]
Ipete - also make shure it is set to 24 Bit!

Hey PANNO, I tried it and it works a charm on WinME with Creative WebcamIII.

And -hohoho- I have a little toy for you kids, that is actually kinda funny :)

It's called (fanfare): TV-Remotecontrol Painting, or IRDRAW
:) All you need is a TV Remote Control and a webcam and of
course PANNOs DLL (see above). Look, me, painting:



It's really funny since the webcam image is mirrored and if
you position the cam on the Screen, it really feels like a
mirror. Colors can be choosen as well using the RC, and
there is a Button to clear the Drawing which demonstrates
it's capabilities as an input device. Tho it's a bit new and
raw to navigate this "cursor". Here the source (pasta)

; *********** IRDRAW 0.00001 - TV Remotecontrol Painting - Brought to you by CSP ***********

; Credit to PANNO - thanks for the incredible WEBCAM.DLL !!!
; For this you need a TV-RC and a Webcam. Webcam settings MUST be 320*240 in 24 Bit!
; The Picture must be relatively dark with low contrast.
AppTitle "IRDRAW 0.00001 - TV Remotecontrol Painting"
Global hwnd_width=640
Global hwnd_height=480
Graphics3D hwnd_width,hwnd_height,32,2 ; btw: also works in fullscreen! :)

;This is an Input device, the Infrared Point of a TV Remotecontrol, when aimed to a camera
;IRDot is 1 if a button was pressed (something like mousedown())
Global IRDot,IRDotX,IRDotY
Global IRDotBrightness=650  ; (max=765=white)
Global IRDotSize=2


Global WebcamRefresh=100					 ; Camera texture refresh every n millisecs
Global in_bank = CreateBank(1)               ; ask PANNO :)
Global out_bank = CreateBank (321*241*4):    ; 320*240 pixels for image exchange with DLL

Global img = CreateImage (320,256)           ; used as a buffer for webcam image

camera=CreateCamera() 
CameraClsMode camera,0,1

Global tex=CreateTexture(256,256,256)		 ; screen-covering sprite semitransparent webcam image
ols=CreateSprite()
EntityTexture ols,tex
ScaleTexture tex,-1,1
TranslateEntity ols,0,0,1.0
EntityBlend ols,3
EntityFX ols,1

cube=CreateCube()							 ; had to add this since radeon 9200 is somehow crazy
TranslateEntity cube,16,12,20


ok = CallDLL("B3DCAPtest","INIT",in_bank,Out_bank); Delect WebCam Device
ok = CallDLL ("B3DCAPtest","START"); start thread that will continuelsy copy webcam images to our bank!!

SetBuffer BackBuffer()
font=LoadFont("arial",32)
SetFont font


butth=40									 ; initialize some buttons and stuff
butt1$="  Clearcanvas  "
butt1x=0
butt1w=StringWidth(butt1$)
Global doodle=CreateImage(hwnd_width,hwnd_height-butth)

rgbimg=CreateImage(256,butth-1) ; colorpick palette
SetBuffer ImageBuffer(rgbimg)
jstep#=butth/255.0
For j=0 To 255
For i=0 To 255
 Color i, j ,Abs(127-j)
 Plot i,yj#
Next
yj#=yj#+jstep#
Next
SetBuffer BackBuffer()
butt2x=butt1w
butt2w=256

draw_r=255
draw_g=255
draw_b=255


; -----------------------------------------MAIN LOOP--------------------------------------
While Not(KeyHit(1))  
 Cls
 m_old=m
 m=MilliSecs()
 If m>next_refresh Then
  WebCamJobs()
  next_refresh=m+WebcamRefresh
 EndIf

 If IRDot=1 ; TV-RC Button pressed?
  SetBuffer ImageBuffer(doodle)
  Color draw_r,draw_g,draw_b
  If old_IRDot=1
   Line IRDotX,IRDotY-(butth),old_IRDotX,old_IRDotY-(butth)
  Else
   Plot IRDotX,IRDotY-(butth)
  EndIf
  SetBuffer BackBuffer()
 EndIf
 old_IRDot=IRDot
 old_IRDotX=IRDotX
 old_IRDotY=IRDotY

 DrawImage doodle,0,butth ; overlay masked painting-canvas

 ; draw buttons etc.
 Color 100,100,100
 Rect butt1x,0,butt1w,butth-1,0
 Text butt1x,butth/2,butt1$,0,1
 DrawBlock rgbimg,butt1w,0 ; show pickable palette
 Color draw_r,draw_g,draw_b
 Rect butt2x+butt2w+10,0,100,butth-1,1 ; show current color

 ; preform button actions if required
 If IRDot=1 And IRDotY<butth Then
  If IRDotX>butt1x And IRDotX<butt1x+butt1w
   ; CLS 
   SetBuffer ImageBuffer(doodle)
   Color 0,0,0
   Rect 0,0,hwnd_width,hwnd_height-butth
   SetBuffer BackBuffer()
   IRDot=0
  EndIf
  If IRDotX>butt2x And IRDotX<butt2x+butt2w
   ; select color 
   SetBuffer ImageBuffer(rgbimg)
   rgb=ReadPixel(IRDotX-butt2x,IRDotY)
   SetBuffer BackBuffer()
   draw_r=(rgb Shr 16) And $ff
   draw_g=(rgb Shr 8) And $ff
   draw_b=(rgb And $ff)
   IRDot=0
  EndIf
 EndIf

 ;Text hwnd_width-40,10,m-m_old
 ;DrawBlock img,MouseX(),MouseY()
 RenderWorld
 Flip
Wend
ok = CallDLL("B3dCAPtest","ENDCAP") ; leave nicely
EndGraphics()
End
; --------------------------------------end of main loop--------------------------------------


Function WebCamJobs()
 IRDot=0 ; flush Buttonstate
 cbright=0
 SetBuffer ImageBuffer(img)
 LockBuffer ImageBuffer(img)
 pointer =0
 For LoopX = 32 To 287 ; copy neccessary part from bank to image...
  For LoopY = 24 To 215 
   Pointer = (Loopy+(Loopx*240))*4
   argb = PeekInt(out_bank,pointer)
   WritePixelFast(Loopx-32,Loopy,argb)
   r=argb Shr 16
   g=(argb Shr 8) And $ff
   b=argb And $ff
   sum=r+g+b
   If sum>IRDotBrightness ; (find White IR-Dot)
    cbright=cbright+1
    If cbright>=IRDotSize
     IRDot=1
     IRDotX=hwnd_width-(((loopx-32)/256.0)*hwnd_width)
     IRDotY=((loopy-24)/192.0)*hwnd_height
    EndIf
   Else
    cbright=0
   EndIf
  Next
 Next
 UnlockBuffer ImageBuffer(img)
 CopyRect 0,0,256,256,0,8,ImageBuffer(img),TextureBuffer(tex) ; ...and from image to texture
 SetBuffer BackBuffer()
 ; maybe it would be better to move it directly from bank to texture. However...
End Function
 



Panno(Posted 2003) [#24]
lol


po(Posted 2003) [#25]
I can't even make a normal paint program, and you can make a T.V. remote control/ use your hands, paint on a webcam!
Cool :D


po(Posted 2003) [#26]
I can't even make a normal paint program, and you can make a T.V. remote control/ use your hands, paint on a webcam!
Cool :D


IPete2(Posted 2003) [#27]
L_Draven : try moving the web cam to another USB port, that's how I got mine semi-working!


Looking at the above, fantastic!

What a lot of fun can be had with this!

Well done guys!

Now if only, I could make it work on my camera... 24 bit I'll give it a try and report back.

...Er I can't seem to change the web cam colour settings...

My nVidia card doesn't do 24 bit only 16 and 32. I set it to 16 bit and...no that doesn't seem to be the problem.

Here is a picture.





IPete2.


jfk EO-11110(Posted 2003) [#28]
IPete - maybe you can set your camera color depth (no need to set screen depth!) using the following tool:
http://ictcm.tamu.edu/Phoenix_2002/vidcap.zip

which was listed on this handy lil link list:
http://ictcm.tamu.edu/Phoenix_2002/links.html

it's from microsoft, but they even don't host it on their downloads zone anymore.


IPete2(Posted 2003) [#29]
Hey thanks,

I'll certainly try that tonight! The web cam is at my home office at the moment.

Cheers,

IPete2.


Skitchy(Posted 2003) [#30]
Panno, this might interest you :
http://www.blitzbasic.com/Community/posts.php?topic=27730
:)

If you ever get this lib to a rock-solid state that works with any camera then I'd be interested in buying a license - or you could always make it freeware ;)


Panno(Posted 2003) [#31]
he skitchy

this lib to a rock-solid state that works with any camera ?

LOL

but i will try !


Jim Teeuwen(Posted 2003) [#32]
mm mine still dont work.. now it doesnt produce anything anymore, just an 'illegal memory address' error..
when I set the cam res to 320x240 using the lil vidcap tool I cant change the depth to 24bits. only thing it will let me select is the value '1420' .. whatever that may be...

ps. I also have an nvidia card which doesnt support 24 bit screendepth


Panno(Posted 2003) [#33]
i420 whats werry wery evil !!!
its a decoded format for the image


let me see what i can do !


jfk EO-11110(Posted 2003) [#34]
PANNO - could you include a "Picture on Demand"-Mode?

Atm it works in a continous Mode in the Background and delivers Images "as fast as possible", but this makes the 3D rendering very slow. Would it be possible to send a request to the dll, which will then grab one image and then go in standby mode?

initialize capture
while game
 read image from bank
 send single grab request to dll
 ...
 renderworld
 flip
wend
endcap thing



Panno(Posted 2003) [#35]
yes no problem


jhocking(Posted 2004) [#36]
This is very cool. I just purchased an Eye Toy before I saw this post. Also, here at RISD we've started messing with video input for various stuff; people have been using video input with Director and Max/MSP, but now I get to mess with it in Blitz!

Can you provide the download as a zip archive?


Giano(Posted 2004) [#37]
Doenn't work with...some of Ipete2
logitech messanger
GeForce 4
Windows XP


Rook Zimbabwe(Posted 2005) [#38]
So what happened? The link is dead. Where is webcam?


nawi(Posted 2005) [#39]
Yes please, I would like the webcam DLL very much :/


jfk EO-11110(Posted 2005) [#40]
http://members.tripod.com/BLITZPANNO/

to prevent the user from using the close button of a window, use BlitzClose to allow ending Webcam capturing correctly under all circumstances (it will crash if you don't):
http://www.blitzbasic.com/Community/posts.php?topic=44032


_PJ_(Posted 2005) [#41]
That's really impressive!!!!

Im quite amazed!


KimoTech(Posted 2006) [#42]
can i get any link to the dll and source? :) Im making some kind of motion capture app.


Dabbede(Posted 2006) [#43]
Panno, can you post two lines of comments about your webcam dll?
I don't know how to use it!!


Dabbede(Posted 2006) [#44]
Halooo!! Can someone explain me how to use Panno's dll?


Panno(Posted 2006) [#45]
iam at work please wait som hour's


Damien Sturdy(Posted 2006) [#46]
Just a Q- Was there a new version of it released Panno? I'd like to recode my motion detection so I can share it :)

I can show you my current code, but it's very very dirty as it was not planned out. I think I wanted to show you before too. :)


Dabbede(Posted 2006) [#47]
:-( Please help me!


Panno(Posted 2006) [#48]
soo

lastmethyl.rar is the last dll version !

in this rar is a bb source , my server is down and i have a update on cd but i have 230 update cd's and an chaotic system .

@DABBEDE PLEASE WAIT
@CYGNUS help dabbede please, because i have not much time in the moment

sorry i come back on 12.sept


WedgeBob(Posted 2006) [#49]
Hmm, I notice that most Macs, like the MacBook and iMac have built-in webcams right into the monitors. I'm sort of wondering if doing an iToy (Eye-Toy, iToy, get it?) would be worth anything doing.

Windows and Linux are cool, too, just as long as you have a good quality webcam in which to do this, and that it's supported (I even wonder what webcams are even supported for Linux).


Dabbede(Posted 2006) [#50]
I'm sorry for the problems I'm creating to the community (and in particoular Panno)!
I appreciate a lot your effort!!


jfk EO-11110(Posted 2006) [#51]
I've got a copy of Methyl on my server:
http://www.melog.ch/dl/panno_webcam_dec2005_lastmethyl.rar


Dabbede(Posted 2006) [#52]
Yuppie!! :D


Dabbede(Posted 2006) [#53]
Thank you all!


Panno(Posted 2006) [#54]
well jfk - my friend :) thx


Litobyte(Posted 2008) [#55]
whatabout the userlib / example for the dll ?
I see only a runtime in the archive