Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

How to binarize using V15 ?
Started by karim at 11-12-2008 5:12. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  11-12-2008, 5:12
karim is not online. Last active: 11/12/2008 9:55:20 AM karim

Not Ranked
Joined on 11-12-2008
Posts 3
How to binarize using V15 ?
Reply Quote
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.

   Report 
  11-12-2008, 8:52
karim is not online. Last active: 11/12/2008 9:55:20 AM karim

Not Ranked
Joined on 11-12-2008
Posts 3
Re: How to binarize using V15 ?
Reply Quote
Please Help !!

   Report 
  11-12-2008, 10:28
Adam Boulad is not online. Last active: 1/6/2009 1:25:47 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 540
Re: How to binarize using V15 ?
Reply Quote
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.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  11-12-2008, 11:38
karim is not online. Last active: 11/12/2008 9:55:20 AM karim

Not Ranked
Joined on 11-12-2008
Posts 3
Re: How to binarize using V15 ?
Reply Quote
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;           
        }



   Report 
Post
LEAD Support Fo... » Developer » DotNet » How to binarize using V15 ?

Powered by Community Server, by Telligent Systems