If you use the "Escapi.dll" and the blitzmax-examples within the archive you can found in the forums here, you will have a Tpixmap filled with the current webcamdata.
You decide yourself if you draw it or compute something out of the pixeldata.
inside the blitzmax example look for:
' A PixMap for captured data...
Global pix:TPixmap = CreatePixmap (width, height, PF_BGRA8888)
And yes it works, some months ago i made some tests with the library (snapshot a starting picture and calculate differences between this picture and the actual data you receive from the webcam, storing some informations, filtering some distortions like fingers or ears ;D and then compute things like "movement" of arms or your head for moving a ball etc).
PS: don't forget to copy the pixmap because working on the real data could end in corruption:
Function RealPixmapCopy(src:TPixmap, dest:TPixmap)
Local srcPixelPointer:Int Ptr = Int Ptr(src.PixelPtr(0,0))
Local srcPixelPointerBackup:Int Ptr = srcPixelPointer
Local destPixelPointer:Int Ptr = Int Ptr(dest.PixelPtr(0,0))
Local destPixelPointerBackup:Int Ptr = destPixelPointer
For Local my_x:Int=0 To ((src.width)*(src.height))
destPixelPointer[0] = srcPixelPointer[0]
srcPixelPointer:+1
destPixelPointer:+1
If srcPixelPointer = srcPixelPointer+(src.pitch Shr 2)
srcPixelPointerBackup = srcPixelPointer
EndIf
If destPixelPointer = destPixelPointer+(dest.pitch Shr 2)
destPixelPointerBackup =destPixelPointer
EndIf
Next
End Function
bye MB
|