Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, October 21, 2009 5:28:12 AM(UTC)
seinarsson

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-
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, October 21, 2009 10:59:55 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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)
seinarsson

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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.097 seconds.