How can i do a 'color tracking' (means detect/locate a specific color in an image) using ImageMagick. Solutions on command-line or Magick++ or MagickWand for C can be very helpful for me.
Thanking you in advance,
I am a newbie

Darkout wrote:Good evening,
Thanks fmw42 for your answer. It seems to me very interesting
Thanks anthony that's what i've been looking for, by introducing this fuzzy tolerance i'll detect perfectly my colored object.
I'll test this on command line tool first then i'll implement this in a C/C++ or java code.
Hello,fmw42 wrote:convert your color to transparent, then send the output to txt: and run grep or sed to filter only those lines that have your transparent color. the first part of each line will be the coordinates
convert logo: -depth 8 logo.png
convert logo: -transparent "rgb(255,0,0)" txt:- | grep "rgba(255,0,0,0)"
244,38: (255, 0, 0, 0) #FF000000 rgba(255,0,0,0)
237,39: (255, 0, 0, 0) #FF000000 rgba(255,0,0,0)
238,39: (255, 0, 0, 0) #FF000000 rgba(255,0,0,0)
239,39: (255, 0, 0, 0) #FF000000 rgba(255,0,0,0)
240,39: (255, 0, 0, 0) #FF000000 rgba(255,0,0,0)
...
can you explain a little bit more your contribution!anthony wrote:In MagickWand or Magic++, you are better off finding one of the 'loop though pixel example demo programs, and then looking at the pixels directly yourself.
Command line shell does not have that luxury (though it can do it with a -fx expression) and uses text processing tools on identify output. It is slower but it gets the job done.