Screen shot processing and getting co-ordinates

edited May 2015 in How To...

I am taking screen shots every second in Processing to detect circles of different colors which occur at the exact same co-ordinate on my screen. I cannot figure out how to get the co-ordinate of each circle on the screen shot (the circles are always in the same spot on the screen). I am taking screen shots 400 px x 600 px.

If there is no way then my only solution is to write some code where it takes a screen shot and freezes it, and then I do left mouse button presses in pixel of interest and then console prints the co-ordinates as well as the color.

Answers

  • What exactly are you asking? Can you show us some code, preferably in the form of an MCVE?

    How are you trying to get the coordinates of each circle?

  • Answer ✓

    Never mind....I ended up writing some code to do this instead of trying to find a tool that did it:

        void mousePressed() {
    
            if (mouseButton == LEFT) {
          // Save color where the mouse is clicked in trackColor variable
          System.out.println("Mouse X: " +mouseX + " Mouse Y: " + mouseY + " Color: " + get(mouseX, mouseY));
          color c = get(mouseX, mouseY);
        fill(c);
        noStroke();
        rect(25, 25, 50, 50);   
    
          } 
        }
    
Sign In or Register to comment.