MrcSegmenter represents the main class that contains all methods needed to perform a full segmentation process.
public class MrcSegmenter : System.IDisposablePublic Class MrcSegmenterImplements System.IDisposable
public ref class MrcSegmenter : public System.IDisposableThis class is available in the Document/Medical Toolkits.
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.MrcPrivate Function MrcEnumerateSegmentInfoCallback(ByVal segmentHandle As MrcSegmenter, ByVal data As MrcSegmentData, ByVal iD As Integer) As BooleanDim segmentRectangle As LeadRect = data.ImageSegmentIf iD = 0 ThenMessageBox.Show("Segment ID : " & iD.ToString())MessageBox.Show("Left : " & segmentRectangle.Left.ToString() & Constants.vbLf & "Top : " & segmentRectangle.Top.ToString() & Constants.vbLf & "Right : " _& segmentRectangle.Right.ToString() & Constants.vbLf & "Bottom : " & segmentRectangle.Bottom.ToString())End IfReturn TrueEnd Function<TestMethod()> _Public Sub MrcSegmenterExample()' Load an imageDim codecs As RasterCodecs = New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = TrueDim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "PDFSegmentation.pdf"))Dim segmentImageOptions As MrcSegmentImageOptions = MrcSegmentImageOptions.EmptysegmentImageOptions.CleanSize = 5segmentImageOptions.SegmentQuality = 50segmentImageOptions.ColorThreshold = 25segmentImageOptions.BackgroundThreshold = 10segmentImageOptions.CombineThreshold = 75segmentImageOptions.Flags = MrcSegmentImageFlags.FavorOneBit Or MrcSegmentImageFlags.SegmentWithBackgroundDim segmenter As MrcSegmenter = New MrcSegmenter(image, RasterColor.FromKnownColor(RasterKnownColor.White), RasterColor.FromKnownColor(RasterKnownColor.Black))segmenter.SegmentImage(image, segmentImageOptions)Dim callBack As MrcEnumerateSegmentsInfo = New MrcEnumerateSegmentsInfo(AddressOf MrcEnumerateSegmentInfoCallback)segmenter.EnumerateSegments(callBack)End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
using Leadtools;using Leadtools.Codecs;using Leadtools.Mrc;private bool MrcEnumerateSegmentInfoCallback(MrcSegmenter segmentHandle, MrcSegmentData data, int iD){if (iD == 0){MessageBox.Show("Segment ID : " + iD.ToString());MessageBox.Show("Left : " + data.ImageSegment.Left.ToString() +"\nTop : " + data.ImageSegment.Top.ToString() +"\nRight : " + data.ImageSegment.Right.ToString() +"\nBottom : " + data.ImageSegment.Bottom.ToString());}return true;}public void MrcSegmenterExample(){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "PDFSegmentation.pdf"));MrcSegmentImageOptions segmentImageOptions = MrcSegmentImageOptions.Empty;segmentImageOptions.CleanSize = 5;segmentImageOptions.SegmentQuality = 50;segmentImageOptions.ColorThreshold = 25;segmentImageOptions.BackgroundThreshold = 10;segmentImageOptions.CombineThreshold = 75;segmentImageOptions.Flags = MrcSegmentImageFlags.FavorOneBit | MrcSegmentImageFlags.SegmentWithBackground;MrcSegmenter segmenter = new MrcSegmenter(image, RasterColor.FromKnownColor(RasterKnownColor.White), RasterColor.FromKnownColor(RasterKnownColor.Black));segmenter.SegmentImage(image, segmentImageOptions);MrcEnumerateSegmentsInfo callBack = new MrcEnumerateSegmentsInfo(MrcEnumerateSegmentInfoCallback);segmenter.EnumerateSegments(callBack);}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
|
Products |
Support |
Feedback: MrcSegmenter Class - Leadtools.Mrc |
Introduction |
Help Version 19.0.2017.3.22
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.