Posted: 2007-01-28T21:33:27-07:00
I answered your email but will repeat it here for the benifit of others.
However now that I have a specific example (in a inexact JPEG format, avoid it if you can) I can see that the colors are not primary, but nicer off-primary colors. and the scoreboard has black and white text inside. Makes the problem harder.
Start as above, but only for the blue 'edge' color of the board. When you ahve extracted that outline, use it to fill the areas outside that area, and use the result to mask out everything but the insides. From that you can trim and extract the information contained.
I cant generate a solution however as the JPEG has corrupted the pixel information too much, specifically where the score board overlays the red banner.
Also some of the prople at the top middle-left have jackets with near identical colors, requiring even further work to isolate and remove solid 'blobs' pf that color, rather than just the scroeboard outline. It can be done, just not using a inexact and low quality JPEG image.
Hmm tricky, sounds like what you want is something that maps any
primary color to that color, but anything else to black.
One solution I can think if is take a copy of the image and make specific colors
transparent, the use that to mask out all the other non-matching colors.
See the second example of
http://www.cit.gu.edu.au/~anthony/graph ... ransparent
For exampleThis would return an image only showing colors close to just the specific colors specified,Code: Select all
convert hd-tv.png \( +clone -matte -fuzz %2 \ -transparent blue \ -transparent green \ -transparent red \ -fill black -colorize 100% \) \ -composite primary_colors.png
and replace all other colors with black.
However now that I have a specific example (in a inexact JPEG format, avoid it if you can) I can see that the colors are not primary, but nicer off-primary colors. and the scoreboard has black and white text inside. Makes the problem harder.
Start as above, but only for the blue 'edge' color of the board. When you ahve extracted that outline, use it to fill the areas outside that area, and use the result to mask out everything but the insides. From that you can trim and extract the information contained.
I cant generate a solution however as the JPEG has corrupted the pixel information too much, specifically where the score board overlays the red banner.
Also some of the prople at the top middle-left have jackets with near identical colors, requiring even further work to isolate and remove solid 'blobs' pf that color, rather than just the scroeboard outline. It can be done, just not using a inexact and low quality JPEG image.