how to get binary RGB data from webcam?
-
hiho@ll i had a look at this tutorial to capture video from a webcam now i need just the RGB data from the webcam! i don't want the webcam data to be displayed on the screen (well i want it too) but i need the binary data! anybody knows a filter which i can use to grab the data cause i'm a noob at this topic, a tutorial or a sample code would be great hmm btw maybe i'm wrong, but it seems that there is no tutorial about direct show programming! or not? i search for some, but i only get some doc about some functions but what if i want to prog my own filter, how do pins work and what are they exactly? it's not easy to find a good basic tutorial about directshow programming! anybody knows a good resource? thx@ll
-
hiho@ll i had a look at this tutorial to capture video from a webcam now i need just the RGB data from the webcam! i don't want the webcam data to be displayed on the screen (well i want it too) but i need the binary data! anybody knows a filter which i can use to grab the data cause i'm a noob at this topic, a tutorial or a sample code would be great hmm btw maybe i'm wrong, but it seems that there is no tutorial about direct show programming! or not? i search for some, but i only get some doc about some functions but what if i want to prog my own filter, how do pins work and what are they exactly? it's not easy to find a good basic tutorial about directshow programming! anybody knows a good resource? thx@ll
To prevent rendering you'll need a null renderer To capture images from the graph you'll need ISampleGrabber (or a variant) Source Filter -> ISample Grabber -> Null Renderer If you're looking for a simple way to do this, have a look at OpenCV (Intel's Open Computer Vision Library) hosted on sourceforge - you should be able to borrow or modify enough of their code to get started.
-
To prevent rendering you'll need a null renderer To capture images from the graph you'll need ISampleGrabber (or a variant) Source Filter -> ISample Grabber -> Null Renderer If you're looking for a simple way to do this, have a look at OpenCV (Intel's Open Computer Vision Library) hosted on sourceforge - you should be able to borrow or modify enough of their code to get started.
hiho thx for your help!! this library (OpenCV/cvcam) is damn cool! it's exactly what i need and i just got it run but i have a little problem, maybe you can help if you already worked with the library i have a IplImage pointer to the image from which i want to read the image's RGB values my problem is the access to the rawdata array! the pointer points to a image structure with a value imageData = the raw data imageSize = the byte size (i think) in an example i saw this code memset(img->imageData, 0, img->imageSize/2); which simply set's the first half of the image to black this code crashes my prog! the same happens if i use a loop to read every pixel values i just can read the first 146047 bytes of the buffer then it crashes i'm sure it's because it's a segmentation fault so my question if i use image->imageSize as a byte limit for the image raw data buffer and this is wrong how do i know the exact size of the raw data buffer? because imageSize doesn't seem to be correct thx