class |
AbstractCropAlgorithm |
Ancestor to cropping algorithms.
|
class |
BinaryCrop |
Turns image into binary (ie black and white) image and determines the largest rectangle encompassing a (white) object in the middle to crop to.
When looking for a black object, check the 'invert' option.
|
class |
CropBackground |
Picks the background at the specified anchor position and crops to the smallest possible rectangle.
|
class |
NoCrop |
Dummy crop algorithm, performs no cropping at all.
|
class |
RectangleCrop |
Turns the image into one with only two indexed colors and then determines from all four sides the locations where the color changes from the one on the edge.
|
class |
RelativeCrop |
Crops the image to specified width and height.
|
class |
SimpleCrop |
Simple cropping algorithm that uses a fixed window.
|
class |
ThresholdedCrop |
Simple cropping algorithm that assumes a good contrast between background and foreground.
Algorithm:
- create histogram of grayscale image
- remove counts from histogram that fall below noise-level
- determine left-most (L) and right-most (R) non-zero count
- divide region between L and R into two and determine highest peak in each (LP and RP)
- 8-bit threshold is halfway between LP and RP
- determine first pixel that is above threshold from top, bottom, left and right, which is used for the crop
|