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, November 12, 2008 12:07:19 AM(UTC)

karim  
karim

Groups: Registered
Posts: 3


Hi,

I'm a newbie with Leadtools, i have LeadTools v15 with Raster Imaging Pro licence.
I need to binarize an image giving brightness and gamma  :

public void Binearize(string imagesPath, int brightness, int gamma)

Can somebody help me !!?

Thanks.
 

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, November 12, 2008 3:47:50 AM(UTC)

karim  
karim

Groups: Registered
Posts: 3


Please Help !!
 
#3 Posted : Wednesday, November 12, 2008 5:23:33 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Karim,
I'm not sure what you mean exactly. Do you mean that you want to convert the image to 2 colors? If yes, you can do that using the intensity detect function, but it does not take a gamma parameter.
Please explain in more details what your requirements are and if possible send me some Before and After images. Put your images in a ZIP or RAR file and don't use the 'Preview' feature when attaching. you can either post it here or send it to us at support@leadtools.com and mention this post.
 
#4 Posted : Wednesday, November 12, 2008 6:33:25 AM(UTC)

karim  
karim

Groups: Registered
Posts: 3


Thank you, it works :

            IntensityDetectCommand cmd = new IntensityDetectCommand();
            cmd.Channel = IntensityDetectCommandFlags.Master;
            cmd.HighThreshold = 255;
            cmd.InColor = new RasterColor(255, 255, 255);
            cmd.LowThreshold = 128;
            cmd.OutColor = new RasterColor(0, 0, 0);

            cmd.Run(SrcImage);

I have to apply color correction before binarize, and i developed two functions for that :

public RasterImage fctSetBrightness(RasterImage srcImage, int brightness)
        {
            RasterImage tmpImage;
            CloneCommand clone = new CloneCommand();
            ChangeIntensityCommand cmdIntensity = new ChangeIntensityCommand(brightness);
            clone.Run(srcImage);
            tmpImage = clone.DestinationImage;
            cmdIntensity.Run(tmpImage);
            return tmpImage;           
        }


        public RasterImage fctGammaCorrect(RasterImage srcImage, int gamma)
        {
            RasterImage tmpImage;
            CloneCommand clone = new CloneCommand();
            GammaCorrectCommand cmdGamma = new GammaCorrectCommand(gamma);           
            clone.Run(srcImage);
            tmpImage = clone.DestinationImage;
            cmdGamma.Run(tmpImage);
            return tmpImage;           
        }


 
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-2024, Yet Another Forum.NET
This page was generated in 0.082 seconds.