# Extracting the green-screen region borders

Given a png image with an unknown number of green colored (rgba=0, 65535, 0, 65535) regions

1- How can I find and put the border points of only the separate green boxes to an array like:

[0] = []point{...} // the first box's points
[1] = []point{...} // the second box's points
[...] = []point{...} //
[7] = []point{...} // the last box's points


2- Which algorithm(s) should I use?

I tried canny edge detector and my own custom ones (like flood-fill) but the canny algorithm finds all the regions not only the green ones.

• Are these guaranteed to be the exact color you've shown above, or might they vary a bit from region to region? – user1118321 Nov 7 '17 at 3:21
• @user1118321 Let’s assume they’re exact for now. – Inanc Gumus Nov 7 '17 at 8:53