Gets a RasterImage object that represents the comparison results.
public RasterImage OutputImage { get; }
@property (nonatomic, assign, readonly) LTRasterImage* outputImage;
public RasterImage getOutputImage();
public:
property RasterImage^ OutputImage
{
RasterImage^ get()
}
OutputImage # get (CompareBitmapCommand)
Reference to a RasterImage object containing the comparison results.
Refer to the CompareBitmapCommand class for more information.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
public void CompareBitmapCommandExample()
{
using (RasterCodecs codecs = new RasterCodecs())
// Load the original image
using (RasterImage referenceImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif")))
// Use the same image for the "modified" image
using (RasterImage modifiedImage = referenceImage.Clone())
{
// Remove the last paragraph of the reference image
referenceImage.AddRectangleToRegion(null, new LeadRect(290, 2470, 1930, 360), RasterRegionCombineMode.Set);
new FillCommand(RasterColor.White).Run(referenceImage);
referenceImage.MakeRegionEmpty();
// Remove the title from the modified image
modifiedImage.AddRectangleToRegion(null, new LeadRect(290, 300, 810, 110), RasterRegionCombineMode.Set);
new FillCommand(RasterColor.White).Run(modifiedImage);
modifiedImage.MakeRegionEmpty();
// Rotate the modified image for demonstration (angle measured in hundredths of a degree)
new RotateCommand(340 * 100, RotateCommandFlags.Resize, RasterColor.Black).Run(modifiedImage);
// Update the transformation to align/reverse the above rotation
LeadMatrix alignment = LeadMatrix.Identity;
alignment.Translate(-modifiedImage.Width * 0.5, -modifiedImage.Height * 0.5);
alignment.Rotate(20.0);
alignment.Translate(referenceImage.Width * 0.5, referenceImage.Height * 0.5);
// Setup the comparison options
CompareBitmapCommand command = new CompareBitmapCommand()
{
Alignment = alignment,
ReferenceImage = referenceImage
};
// Compare the images
command.Run(modifiedImage);
// Save the results
using (RasterImage outputImage = command.OutputImage)
codecs.Save(outputImage, Path.Combine(LEAD_VARS.ImagesDir, "CompareBitmap_Output.png"), RasterImageFormat.Png, 0);
// Save the two input images, for reference
codecs.Save(referenceImage, Path.Combine(LEAD_VARS.ImagesDir, "CompareBitmap_Reference.png"), RasterImageFormat.Png, 0);
codecs.Save(modifiedImage, Path.Combine(LEAD_VARS.ImagesDir, "CompareBitmap_Modified.png"), RasterImageFormat.Png, 0);
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
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.