0

I am currently doing research on how I am going to do this.

I need a program to read the screen of my computer(pixels, edges, etc) and an answer that I think might work is opencv. However everything I look into about opencv reads from a video camera and not from a computer screen. Is it possible to record the screen and use it in the same fashion that I see video cameras being used in opencv?

If so can anyone point me to some reading on this? So far I havent found any examples that apply to what I am looking for

EDIT: I am not looking for anybody to write code for me. Im simply asking if it is possible to use the screen as a video feed for opencv. I am not familiar with opencv nor have I ever used it before.

Jon Storm
  • 185
  • 1
  • 3
  • 10
  • 3
    1) Cheating is bad 2) Why not just read the gamestate from the game's memory? – Tom van der Woerdt Dec 03 '11 at 23:35
  • 1
    second that. Parsing the entire screen to get some information, already available somewhere in the memory is a really bad idea. If the game is written is java, you can freely modify its code, and recompile it. The best method is to write a loader in java, witch manages the running game. – Evan Dark Dec 04 '11 at 00:04
  • See my answer here: http://stackoverflow.com/questions/1032489/how-can-a-program-control-another-program/1032530#1032530 – Stefan Mai Dec 04 '11 at 00:07
  • 1
    They somehow detect that you are modifying the client/reading variables and the account that was used gets banned. The only existing bot that does not get your account banned only reads the screen through pixels etc. I know its not a pretty way to do it but it seems like the only way. – Jon Storm Dec 04 '11 at 00:34

1 Answers1

1

Does the system have to use OpenCV and C++? I know that Java can do this very easily using its built it Robot class the code being:

 try {
    Robot robot = new Robot();
Rectangle captureSize = new Rectangle(0, 0, 500, 500);
    BufferedImage bufferedImage = robot.createScreenCapture(captureSize);
}
catch(AWTException e) {
    System.err.println("Error");
}

If you really want to use OpenCV and C++ you could connect to them via JNI but this would probably be making life harder than it needs to be.

RyanfaeScotland
  • 1,216
  • 11
  • 30