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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

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

Post 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
Last edited by josephaaroncampbell on 2016-04-05T08:51:01-07:00, edited 3 times in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

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

Post 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.
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

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

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Can you provide an example input image from which you want to find and extract the color chart?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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!
josephaaroncampbell
Posts: 40
Joined: 2015-07-14T19:18:45-07:00
Authentication code: 1151
Location: Chicago, IL

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply