Thread: Monitoring on pixel level

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    15

    Monitoring on pixel level

    I would like to monitor several windows, in each window i would like to monitor several pixels continuously. What is the best way of doing this?

    Is it possible to monitor a windows pixel even if it is not in focus on the screen or even if it is minimizes to system tray?

    Using the GetDc and then GetPixel is the only thing i have used before but i feel there must be a faster and better way to solve this problem?

    (im not an english native speaker)

  2. #2
    Registered User
    Join Date
    Jan 2012
    Posts
    15
    No one?

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I think we're all asking: "Why on earth would he want to do that?"

  4. #4
    Registered User
    Join Date
    Jan 2012
    Posts
    15
    Hehe ok, i think this is the only way to monitor this program. It is a program that recive an image from a camera over the internet and i would like to watch a few specific pixels in the image for when they cange color so that i know an event have happened. Does it make more sens now?

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    An image library like opencv, and some search terms like "motion detection" would be a good start.
    VideoSurveillance - OpenCV Wiki
    Tips: Motion Detection using OpenCV
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Jan 2012
    Posts
    15
    The thing is that i do not need to make this that advanced. I do not need to detect movment or anything, all i want to do is look at a few x:y cordinates in the image and monitor what colors they have. This i can do with the GetDc and GetPixel but what i am wondering is if there is a way to monitor a pixel in a window without having to catch and release the DC every time i want to get the color for that pixel?

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    When the camera sends you a new image there should be some event / msg to show there is a new image to display on the screen.

    You could check the raw image data (rather than the HBITMAP data displayed in the HDC) when you process this msg.

    I did similar to monitor the lights on the back of servers (to check for warning lights turning from green to red).
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  8. #8
    Registered User
    Join Date
    Jan 2012
    Posts
    15
    When i use spy++ to see what messages is in the process i cant find any relevant. Sure i get the standard ones when moving the moue but other than that it is silent. How is the program made when it dont show any msg for event?

  9. #9
    Registered User
    Join Date
    Jan 2012
    Posts
    15
    Before the window gets painted to the screen is it not saved in the graphics cards memory? Can i not acces that memory to read the pixel? Is this something i can use opengl for?

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Why not replace the camera application with your own, and read the images directly?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Monitoring soundcard line-out level
    By moose in forum C Programming
    Replies: 4
    Last Post: 04-10-2009, 05:46 PM
  2. event monitoring
    By gvector1 in forum Windows Programming
    Replies: 24
    Last Post: 08-30-2003, 03:08 AM
  3. Monitoring LAN
    By pasha in forum C Programming
    Replies: 4
    Last Post: 01-14-2003, 04:27 AM
  4. CPU monitoring
    By fenedara in forum Windows Programming
    Replies: 1
    Last Post: 01-08-2003, 09:14 AM
  5. lan monitoring
    By scott27349 in forum C++ Programming
    Replies: 3
    Last Post: 05-09-2002, 10:11 PM