Alternative Input

Feb 15, 2010 at 12:30 PM


    I was wondering how / where in the code could I substitute the input from that of a webcam, to simple bitmap data which could be supplied via a .NET event 25 times a second. This is because I have a device which give an output very similar to that from the webcam, except it works capacitively instead of by light. I would like to adapt your project to work with my input data. Basically I process data sent into USB, 16x16 resolution, I can the interpolate this data up to a much greater resolution, suitable for input into touchless, I just need to know if there is an easy way of skipping the webcam bit?

   Any help would be greatly appreciated.




Feb 16, 2010 at 9:07 PM

You should try the latest V2 source code, implement a new FrameSource. Please let us know how this goes for you, as we'd be interested in your feedback and perhaps adding this feature to the Touchless V2 library.

Feb 16, 2010 at 9:19 PM

Excellent, I will look at this tomorrow morning and see if I can work out what to do, has anything like this been attempted before? Also is their any documentation on how to go about this?

    If I get anything working I will happily give feedback and share my code as it could be a powerful feature. Can I ask ... is a "marker" an associated area (or hotspot) in the image that has been linked to a touch. As far as I can tell the image is scanned for markers, the peaks within the markers are then found, and then the points are tracked using these peaks, each frame is compared to keep track of each marker.

   I was trying to implement something similar but it started getting really messy, its no easy task, I was using connected component labeling algorythms to identify the individual hotspots in my image.

Feb 16, 2010 at 11:39 PM

Unfortunately we don't have documentation for v2.0 yet, but it's in the works. Your best bet is to implement a new IFrameSource (see Toucless.Vision.Contract's IFrameSource.cs), and you might find it useful to see the implementation of CameraFrameSource in Touchless.Vision's Camera folder. CameraFrameSource.OnImageCaptured recieves image events from its Camera (via WebCamLib) and then reports those events via the IFrameSource.NewFrame. Depending on your device library, you'll want to pass along its image events or write an IFrameSource that polls the device.

A Marker is a collection of hashed color values that are used to filter the image to match any similar pixels. Touchless doesn't currently analyze connected components, so two disjoint blobs of identical color will be tracked as a single entity, and this may not be ideal for you. But the project is open source, so feel free to extend our implementation and perhaps we’ll adopt your changes. I'll happily help you if you get most of the way there.