11-12-2008, 11:38
|
karim
Joined on 11-12-2008
Posts 3
|
Re: How to binarize using V15 ?
|
 
 
|
|
|
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
|
|
|
|