0

I am trying to detect the pixel position of an object on the screen. In my case: a soccer ball which changes the position on the screen each 10-20s. My first approach was to use a Webcam, record my own screen and then detect the object by using openCV and translate the position to a pixel position. But I think there must be an easier solution. If anybody knows another approach, please tell me your idea. I want to use c/c++ if possible.

Thanks in advance.

user3853511
  • 43
  • 1
  • 6
  • 2
    For starters, this entirely depends on what graphics API you're using (i.e. GDI, Xorg, etc). Second, using openCV is definitely not the best approach. You can usually just grab a direct screenshot of the screen and do your processing from there. – Drew McGowen Feb 12 '15 at 17:42
  • Maybe this will help you out http://opencv-srf.blogspot.com.br/2010/09/object-detection-using-color-seperation.html – hlscalon Feb 12 '15 at 17:50
  • you can grab the screen with opencv directly. see [here](http://stackoverflow.com/questions/14148758/how-to-capture-the-desktop-in-opencv-ie-turn-a-bitmap-into-a-mat). or you can use another screen capture lib like [FFmpeg](https://www.ffmpeg.org/)/[Libav](https://libav.org/). – user1810087 Feb 12 '15 at 18:24
  • Ok, I didn´t know, that I can grap the screen directly. Thanks for that hint. – user3853511 Feb 13 '15 at 10:03

1 Answers1

0

VLC can stream your screen over RTP/HTTP/etc and opencv video capture can open it, e.g. cv::VideoCapture("http://...") For VLC's settings follow the description here: https://grok.lsu.edu/m/article.aspx?articleId=14625

Kornel
  • 5,264
  • 2
  • 21
  • 28