Table of Contents

Class ImageRedactionRequest

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

Describes what to redact in an image. Explicit page areas and text search terms can be combined in one request; everything matched is covered in a single pass.

public sealed class ImageRedactionRequest
Inheritance
ImageRedactionRequest
Inherited Members

Examples

Example 1: Redact every occurrence of two strings.

using LMKit.Media.Image;

var request = new ImageRedactionRequest { OcrEngine = myOcrEngine }; request.SearchTerms.Add("John Doe"); request.SearchTerms.Add("4111 1111 1111 1111");

Example 2: Redact a fixed region on the first page.

using LMKit.Media.Image;
using LMKit.Graphics.Geometry;

var request = new ImageRedactionRequest(); request.Areas.Add(new ImageRedactionArea(pageIndex: 0, Rectangle.FromSize(left: 72, top: 90, width: 220, height: 30)));

Remarks

Search terms are located by reading the pixels, so a request that carries terms must also carry an OcrEngine; the redactor throws InvalidOperationException otherwise. Areas need no OCR engine.

Properties

Areas

Gets the explicit redaction areas, in top-left origin image pixels.

CaseSensitiveSearch

Gets or sets whether term matching is case sensitive. Default: false.

OcrEngine

Gets or sets the OCR engine used to read the image text so SearchTerms can be located. Required whenever SearchTerms is non-empty; ignored otherwise.

SearchTerms

Gets the text strings to search for. Every match found in the image is redacted. Locating terms requires OcrEngine.

WholeWordSearch

Gets or sets whether term matching only accepts whole words. Default: false.

Share