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
 How to compare two images and show the difference?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
730 Posts

Posted - Dec 24 2014 :  23:44:28  Show Profile  Reply
The subject says it all.

I have a need wherein I have to allow user to select two different images (and load them in two separate ImageEn Controls) and then show the difference between two images in a third ImageEn control. The difference has to be calculated based on either light values (brightness) or color values.

I don't know as to how I will be able to achieve this so any hints or small sample code will be of great help.

TIA

Yogi Yang


Yogi Yang

xequte

39140 Posts

Posted - Dec 25 2014 :  03:52:37  Show Profile  Reply
Hi Yogi

There is the CompareWith function (see the "Show Image differences" demo), but it only works on pixel intensity:

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

So you may be better to write your own algorithm which resamples two images to the same size and then compares the individual pixels (via scanline).



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

yogiyang

India
730 Posts

Posted - Dec 25 2014 :  22:52:46  Show Profile  Reply
Thanks Nigel,

This works like a charm.

Would it be possible to create a mask or selection from the resulting image and apply the same to user selected image?

TIA



Yogi Yang
Go to Top of Page

xequte

39140 Posts

Posted - Dec 28 2014 :  17:54:28  Show Profile  Reply
Hi

Yes, that should not be hard to do. Are you referring to the result of CompareWith or your own algorithm?

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: