Author |
Topic |
|
AndyColmes
USA
351 Posts |
Posted - Mar 07 2015 : 12:38:41
|
I am trying to get a color value from a selection rectangle in an image and then use that value to compare against another image with the same selection rectangle.
I understand that I might have to create some kind of tolerance level to compare the color values. So, to do this, how do I get an average color value of the selection and how do I use a tolerance level to determine if the color matches or not?
Thanks for any help.
Andy
|
|
AndyColmes
USA
351 Posts |
Posted - Mar 07 2015 : 15:55:59
|
Maybe to save the selection to a file with conversion to less colors so whole color palette (like red, yellow, blue, etc.) can be derived without shades? But how would you recommend doing it this way?
Thanks again.
Andy
|
|
|
w2m
USA
1990 Posts |
|
spetric
Croatia
308 Posts |
Posted - Mar 07 2015 : 16:16:06
|
Hi Andy,
Maybe to use TImageEnProc.ComputeImageEquality, on selection: Copy selected portions of images to temporary bitmaps (map1, map2). As they are the same size, you will be able to analyze them with this method.
|
|
|
AndyColmes
USA
351 Posts |
Posted - Mar 08 2015 : 01:42:20
|
Hi spetric, does ComputeImageEquality checks for color differences as well or just outlines of differences? |
|
|
AndyColmes
USA
351 Posts |
Posted - Mar 08 2015 : 01:50:39
|
Hi Bill, thanks for the demo resource. That should help some. There are some JavaScript or PHP code that can come up with common colors in an image, but how can one do this in Delphi? If I could find the most dominant color in a selection, I can use that value to compare. |
|
|
AndyColmes
USA
351 Posts |
|
xequte
38608 Posts |
|
AndyColmes
USA
351 Posts |
Posted - Mar 08 2015 : 07:37:45
|
Hi Nigel, thanks so much for the CalcAverageRGB. That would help significantly. I can't wait to get next week's release!
Thanks for all the good work.
Andy
|
|
|
AndyColmes
USA
351 Posts |
Posted - Mar 11 2015 : 13:37:05
|
Hi Nigel, I received the latest 6.0 today. Thanks very much. Where would I see the IEAverageRGB_Sample in the help file?
Andy |
|
|
xequte
38608 Posts |
Posted - Mar 11 2015 : 20:05:59
|
Hi Andy
Actually I did not expose IEAverageRGB_Sample because I was not sure it would be useful. You might want to copy it from imageenproc.pas and if you think it worthwhile I will expose it.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
|
Topic |
|