This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, March 7, 2013 7:39:13 PM(UTC)
Groups: Registered
Posts: 3
I am trying to compare two regions within the same RasterImage and determine (on a relative basis) which has more or less black or white pixels. The regions will not be the same size. I basically want to sum the darker pixels and sum the lighter pixels and divide each by total pixels in the region. This will give a DarkerRatio and a LighterRatio that I can use to compare the regions of interest.
How exactly can I do this? The RasterImage.GetData() method returns a Byte Array, but I am not sure this is what I need. Can I use this? If so, how exactly? If not, what exactly do I need to do?
Some sample code would be helpful.
#2
Posted
:
Sunday, March 10, 2013 7:56:50 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
Although you can get the pixel contents, there is a much easier approach.
You may use the HistogramCommand (which is region aware) to get the information about occurrence of each intensity value. See the following online help topic:
http://www.leadtools.com/help/leadtools/v18/dh/pc/leadtools.imageprocessing.color~leadtools.imageprocessing.color.histogramcommand.html
You can then sum the upper entries in the table to get the light pixels and sum the lower entries to get the dark pixels.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.