Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to get binary RGB data from webcam?

how to get binary RGB data from webcam?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialcomgraphicsgame-devquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ThinkingPrometheus
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • T ThinkingPrometheus

      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

      A Offline
      A Offline
      Andrew Walker
      wrote on last edited by
      #2

      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.


      T 1 Reply Last reply
      0
      • A Andrew Walker

        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.


        T Offline
        T Offline
        ThinkingPrometheus
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups