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
 Possibilities of detecting by using Histogram
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Aug 06 2015 :  04:48:35  Show Profile  Reply
Are there any possibilities to detecting whether an image is light or dark using Histogram features of ImageEn?

What I need to do is find out whether an image loaded by user is light or dark and the perform some settings accordingly.

Can I find this out? If yes how?

It is possible to know as to how dark or light an image is?

TIA

Yogi Yang


Yogi Yang

xequte

38514 Posts

Posted - Aug 06 2015 :  16:41:54  Show Profile  Reply
Hi Yogi

There is no automated way to do this. You would need to analyze the histogram to determine whether it is weighted more towards 0 (dark) or 255 (light).

You could also try just getting the average color of the image:

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

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

yogiyang

India
727 Posts

Posted - Aug 07 2015 :  09:17:16  Show Profile  Reply
I tried that but still cannot get to know whether an Image is lighter or darker.

If I calculate total pixels in a Historgram Gray channel it seems I am probably getting somewhere but I don't know as how accurate this may be.

What I am doing is calculating total pixels in all levels from 0 to 128 as these are generally dark and then calculating total pixels in all levels from 129 to 255 as these are Light.

Am I going in the right direction?

TIA

Yogi Yang
Go to Top of Page

xequte

38514 Posts

Posted - Aug 09 2015 :  05:13:53  Show Profile  Reply
Hi Yogi

Yes, I think that sounds like a good way to handle it.

Have a look at a sample of images and compare the histograms. This will give you an idea of what you should be looking for.


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: