This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, October 21, 2009 5:28:12 AM(UTC)
Groups: Registered
Posts: 22
I'm using LEADTOOLS C#.NET v16.5.
I need to find the median brightness of a Region, how would I do that?
-Sarkis-
#2
Posted
:
Wednesday, October 21, 2009 10:59:55 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
You can get statistical information about the image (such as Median, Mean, PixelCount, etc.) by using the StatisticsInformationCommand Class.
After drawing the region on the image, you need to pass the image to the StatisticsInformationCommand Class as follows:
+---------+
// Prepare the command
StatisticsInformationCommand command = new StatisticsInformationCommand();
command.Channel = RasterColorChannel.Master;
command.Start = 0;
command.End = 255;
command.Run(_medicalViewer.Cells[CellIndex].Image);
//Get statistical image information.
MessageBox.Show("Minimum = " + command.Minimum + "\n" +
"Maximum = " + command.Maximum + "\n" +
"Mean = " + command.Mean + "\n" +
"Median = " + command.Median + "\n" +
"Percent = " + command.Percent + "\n" +
"PixelCount = " + command.PixelCount + "\n" +
"StandardDeviation = " + command.StandardDeviation + "\n" +
"TotalPixelCount = " + command.TotalPixelCount);
+---------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Thursday, October 22, 2009 5:09:45 AM(UTC)
Groups: Registered
Posts: 22
Ah, so it only calculates the info for the region. Got it working, thanks!
-Sarkis-
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.