Page 1 of 1

is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T08:43:16-07:00
by josephaaroncampbell
Is it possible to use IM to locate and recognize a color target , like an XRITE ColorChecker?

I can do this with ArgyllCMS but I want to be able to create a new image from some of the color patches on the target.
which is to say Argyll uses a scan recognition file (.cht) to somehow locate the color target in the image frame (if photographed correctly).

Finally, maybe MagicWand would be better for this instead of the command line?


I couldn't find anything so I just thought I would ask.

Thanks!

* link to xrite colorchecker

http://xritephoto.com/colorchecker-passport-photo


IM version: 6.9.2-0 Q16 2015-08-15
Windows 7 x64

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T08:48:14-07:00
by fmw42
How about a link to XRITE ColorChecker. We all are not familiar with that. So we have no idea what you are trying to do. Also always provide your IM version and platform, since syntax differs. Please read viewtopic.php?f=1&t=9620

Is this what you reference? http://xritephoto.com/colorchecker-classic. If so, what specifically do you want to do with it? Please clarify.

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:02:59-07:00
by snibgo
When you want to search for a known object in a photographs, there are basically two methods.

1. Search for one or more distinguishing features. A colour checker has areas of flat colour (ie very low standard deviation within an area), so "-statistics StandardDeviation" would find the patches.

2. Use a "standard photograph" of the object. Search for this at all possible scales, and a small range of orientations and colour variations and so on, in your test photographs.

I use method (1), though with larger gray cards.

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:06:26-07:00
by josephaaroncampbell
@fmw42 Thanks for the reminder!

So i want to produce a scan of the xrite color target. then crop down the image to a specific number of patches. I guess i was wondering if I would be able to locate the target in the scan because the user may not always keep the target square or in the same place. So the script could locate the target and ensure that if the target moves in the image frame the resulting cropped image would always look the same.

here is an example image of the whole target and then what the cropped result would be:
https://drive.google.com/file/d/0BzGl-r ... sp=sharing (whole target)

https://drive.google.com/file/d/0BzGl-r ... sp=sharing (cropped result)

And I do use the colorchecker classic specifically but also may use other xrite targets if needed. but for now i am working on this using that specific target to start out.

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:09:08-07:00
by josephaaroncampbell
@snibgo

are there any examples you may be able to point me to that use standardDeviation? Im going to have to research that and an example or something close to it would be great.

thanks!

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:10:06-07:00
by fmw42
Can you provide an example input image from which you want to find and extract the color chart?

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:15:50-07:00
by fmw42
You might be able to locate the color chart by doing a compare of a smaller patch of the top left corner color to find where it exists and then a compare of the bottom right corner color (or all four corner colors). That would give you the region of the color chart. Then offset the crop by the difference in size of the small patch you use and the proper size of the patch.

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:45:18-07:00
by snibgo
For example:

Code: Select all

convert in.tiff -statistic StandardDeviation 5x5 -threshold 1% out.tiff
Larger rectangles (eg 10x10) are better at finding areas of flat colour, but slower.

As Fred suggests, it may be quicker to search for areas of specific colours.

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T09:54:27-07:00
by fmw42
A compare that ignores transparency in the small image would really help. Snibgo, don't you have one of those from your hole-filling? If we had that, then one could create a transparent image the size of the chart with single color dots at the centers of the color regions. That would the be more resistant to rotation and scale between the pattern in the large image and the reference template.

Wish IM had a transparency ignoring rmse!

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T10:05:48-07:00
by josephaaroncampbell
Here is a tiff scan of the color target I will be using and what the scan would hopefully look like:
https://drive.google.com/file/d/0BzGl-r ... sp=sharing

and thank you for the responses! This all sounds good. I am not intimate with the compare program or the -statistics function so Im going to review the usage examples.

Re: is it possible to recognize a color chart like ArgyllCMS can?

Posted: 2016-04-05T10:32:07-07:00
by snibgo
fmw42 wrote:If we had that, then one could create a transparent image the size of the chart with single color dots at the centers of the color regions.
That's a very clever idea.

I've written (but not yet published) a process module, "rmsealpha". It does comparisons or sub-image searches like ordinary IM, but weighting each pair of pixels by the product of their alphas. Hence a fully-transparent pixel will match any other, and two pixels with the same RGB but different alphas will match.

It has a couple of other features for hole-filling.