ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Reading and comparing color areas
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Mar 07 2015 :  12:38:41  Show Profile  Reply
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  Show Profile  Reply
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
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 07 2015 :  16:01:47  Show Profile  Reply
What you are trying to do is not simple. But this may give you some ideas... http://www.xecute.com/ieforum/topic.asp?TOPIC_ID=1446&whichpage=1... Select Similar Colors Demo
It does not use selections but it may give you some ideas how to deal with 24 million colors by converting the image to 256 palette colors?


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Mar 07 2015 :  16:16:06  Show Profile  Reply
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.



Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Mar 08 2015 :  01:42:20  Show Profile  Reply
Hi spetric, does ComputeImageEquality checks for color differences as well or just outlines of differences?
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Mar 08 2015 :  01:50:39  Show Profile  Reply
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.
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Mar 08 2015 :  03:00:14  Show Profile  Reply
I found this resource in C#. Can this be converted to be used in Delphi with ImageEn?

http://www.vcskicks.com/dominant-color.php
Go to Top of Page

xequte

38608 Posts

Posted - Mar 08 2015 :  03:38:31  Show Profile  Reply
Hi

Note that you can calculate teh average color of a selectionn using ImageEnView1.Proc.CalcAverageRGB:

http://www.imageen.com/help/TImageEnProc.CalcAverageRGB.html


Also, next week's release will include an extended version (IEAverageRGB_Sample) which also returns the hue variance (difference between minumum hue and maximum hue of HSV).

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Mar 08 2015 :  07:37:45  Show Profile  Reply
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
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Mar 11 2015 :  13:37:05  Show Profile  Reply
Hi Nigel, I received the latest 6.0 today. Thanks very much. Where would I see the IEAverageRGB_Sample in the help file?

Andy
Go to Top of Page

xequte

38608 Posts

Posted - Mar 11 2015 :  20:05:59  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: