@Deprecated public class ImageColorHistogramSearchCriteria extends ImageSearchCriteria
Represents search criteria for finding images in a document. This search criteria uses image color histograms for calculating image similarity.
This example demonstrates how to find and remove all possible watermarks containing a particular raster image from a document of any supported format.
String inputFolder = "D:\\docs\\input\\"; String outputFolder = "D:\\docs\\output\\"; String logo = "D:\\docs\\logo.png"; ImageSearchCriteria imageSearchCriteria = new ImageColorHistogramSearchCriteria(logo); imageSearchCriteria.setMaxDifference(0.1); File[] files = new File(inputFolder).listFiles(); for (File file : files) { if (file.isFile()) { Document doc = Document.load(file.getAbsolutePath()); PossibleWatermarkCollection watermarks = doc.findWatermarks(imageSearchCriteria); watermarks.clear(); doc.save(outputFolder + file.getName()); } }
Constructor and Description |
---|
ImageColorHistogramSearchCriteria(InputStream stream)
Deprecated.
Initializes a new instance of the
ImageColorHistogramSearchCriteria class. |
ImageColorHistogramSearchCriteria(String filePath)
Deprecated.
Initializes a new instance of the
ImageColorHistogramSearchCriteria class. |
Modifier and Type | Method and Description |
---|---|
byte |
getBinsCount()
Deprecated.
Gets a count of bins that will be used for building color histograms.
|
void |
setBinsCount(byte value)
Deprecated.
Sets a count of bins that will be used for building color histograms.
|
getMaxDifference, setMaxDifference
and, not, or
public ImageColorHistogramSearchCriteria(String filePath)
Initializes a new instance of the ImageColorHistogramSearchCriteria
class.
filePath
- The file path to load image from.public ImageColorHistogramSearchCriteria(InputStream stream)
Initializes a new instance of the ImageColorHistogramSearchCriteria
class.
stream
- The stream to load image from.public final byte getBinsCount()
Gets a count of bins that will be used for building color histograms.
public final void setBinsCount(byte value)
Sets a count of bins that will be used for building color histograms.
value
- The default value is 10.Copyright © 2020. All rights reserved.