ImageDctHashSearchCriteria

ImageDctHashSearchCriteria class

Represents a search criteria for finding images in a document.

public class ImageDctHashSearchCriteria : ImageSearchCriteria

Constructors

Name Description
ImageDctHashSearchCriteria(Stream) Initializes a new instance of the ImageDctHashSearchCriteria class with a specified stream.
ImageDctHashSearchCriteria(string) Initializes a new instance of the ImageDctHashSearchCriteria class with a specified file path.

Properties

Name Description
MaxDifference { get; set; } Gets or sets maximum allowed difference between images.

Methods

Name Description
And(SearchCriteria) Combines this SearchCriteria with other criteria using logical AND operator.
Not() Negates this SearchCriteria.
Or(SearchCriteria) Combines this SearchCriteria with other criteria using logical OR operator.

Remarks

This search criteria uses DCT based perceptual image hash for calculating image similarity. Learn more:

Examples

Search for images in the attached files (pdf).

WatermarkerSettings settings = new WatermarkerSettings();
settings.SearchableObjects = new SearchableObjects
{
    PdfSearchableObjects = PdfSearchableObjects.All
};
PdfLoadOptions loadOptions = new PdfLoadOptions();
using (Watermarker watermarker = new Watermarker(@"D:\test.pdf", loadOptions, settings))
{
    // Specify sample image to compare document images with
    ImageSearchCriteria criteria = new ImageDctHashSearchCriteria(@"D:\sample.png");
    // Search for similar images
    PossibleWatermarkCollection possibleWatermarks = watermarker.Search(criteria);
    // Remove or modify found image watermarks
    // ...
}

See Also