I arrived here because searching google didn't give me anything and I figured it might not be that hard to realize.
My question:
I need to create a box of coordinates x, y, width, height. Which I need to be able to search for a specific color (let´s say red) and then add up these pixel counts.
I figure it works something like this: It starts at the top left, if pixel is red (255, 0, 0) then count= count+1, next pixel. Else next pixel etc.
The background is plain white, and there is only 1 actual color used (red).
What I know how to do:
Get pixel color at specific coordinate (robot.getPixelColor(x, y))
What I probably need to know:
How to increment the coordinates (x+1 untill end, then y+1, and x+1 untill the end etc. while continuously checking for pixelcolor).
Perhaps there is a total solution, maybe it can check the entire box as a whole and give the amount of red colored pixels within it?
I know it might come across as vague but that's mostly because I have no idea how to do this and am trying to paint a picture of it from what I see as logical. Now if someone would be so kind to push me into the right direction (maybe there is a whole other solution to this) I would be grateful.
My question:
I need to create a box of coordinates x, y, width, height. Which I need to be able to search for a specific color (let´s say red) and then add up these pixel counts.
I figure it works something like this: It starts at the top left, if pixel is red (255, 0, 0) then count= count+1, next pixel. Else next pixel etc.
The background is plain white, and there is only 1 actual color used (red).
What I know how to do:
Get pixel color at specific coordinate (robot.getPixelColor(x, y))
What I probably need to know:
How to increment the coordinates (x+1 untill end, then y+1, and x+1 untill the end etc. while continuously checking for pixelcolor).
Perhaps there is a total solution, maybe it can check the entire box as a whole and give the amount of red colored pixels within it?
I know it might come across as vague but that's mostly because I have no idea how to do this and am trying to paint a picture of it from what I see as logical. Now if someone would be so kind to push me into the right direction (maybe there is a whole other solution to this) I would be grateful.
Comment