Sign in to follow this  
Followers 0
JRowe

PixelSearching video offscreen.

10 posts in this topic

#1 ·  Posted (edited)

PixelSearch is really fast. Is there a way to run a pixelSearch on graphics in memory, such as a video stream from a webcam or a snapshot from a webcam?

Pixelsearching a streaming video source (not onscreen, but in memory) would be ideal.

I'm fairly sure it's possible, but I'm unsure where the best route is. It seems to me that you would create a device context and stream the video content to the context, updating one section in memory that is formatted like a bitmap. Since I'll only have 1GB of RAM, keeping the memory usage down is also desirable.

Solutions that I'm trying to find include using a different .dll than avicap32, creating a plugin solution with c/c++, and reworking existing gdiplus/video/webcam udfs into a mashup that does what i want with decent performance.

The end goal is a motion tracker script that tracks 3 LEDs attached to a glove, acting as a haptic interface for my Acer netbook.

If anyone has any ideas or knows of solutions, please post here.

Much thanks! :)

Edited by JRowe

Share this post


Link to post
Share on other sites



One last bump with clarified topic. Thanks for any insight, I'm also thinking c/c++ solutions are going to be the only route. :)

Share this post


Link to post
Share on other sites

One last bump with clarified topic. Thanks for any insight, I'm also thinking c/c++ solutions are going to be the only route. :)

Step 1: Capture It to hBmp, then get handle for Bitmap (on memory)

Step 2: PixelGetColor about hBmp.

Hint: _ScreenCapture()

Share this post


Link to post
Share on other sites

Not quite. I'm looking to PixelSearch, not pixelGetColor. I'm looking for the coordinates of a color, not the color at specific coordinates.

I can use looped GetColor from bitmaps grabbed from the webcam, but it takes almost 1/3 of a second to just get the bmp from the cam, and around 4 ms per pixel to search... It's no good for tracking realtime motion.

So my question is whether I can run a PixelSearch on a live stream from the webcam.

Share this post


Link to post
Share on other sites

Working on a prior script I used a live camera feed and used pixel search on it. Try looking at my "Playing using your body" script, that searches for a black pixel in a live webcam feed but can be configured to do many other things.


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites

Not onscreen. In memory, or offscreen, where the video/images haven't been rendered. Your example uses an onscreen cam feed, which is good for the purpose you're using it for, but useless for mine. To a point... the raw image data is accessible via avicap32.dll, I just need to figure out how to get to it... and then apply PixelSearch to it.

Share this post


Link to post
Share on other sites

You got an interesting idea here. Hope you'll continue digging ill watch this thread :D

This threat hasn't been updated in months, so i'm wondering if you found a solution to the problem? I'm looking for the exact same thing (though not with a webcam) and i'd love to know =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0