Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Crop an image while preserving the most salient contents
crops img to have an AspectRatio of a such that the result contains the most salient region of img.
crops img to have an AspectRatio of 1, such that the result contains the most salient region of img.
crops img to width w and height h, keeping the most salient region of img.
|Method||Automatic||choose a method for determining saliency|
|"CentralityWeight"||1||priority for centering salient features|
|"Itti"||saliency based on color,intensity and orientation|
|"IttiColor"||color map of the Itti algorithm|
|"IttiIntensity"||intensity map of the Itti algorithm|
|"IttiOrientation"||orientation map of the Itti algorithm|
|"HistogramContrast"||saliency based on mean color difference to image pixels|
|"SpectralResidual"||saliency based on the residual of the log spectrum|
|"ImageSignature"||saliency based on foreground estimation|
Crop an image into a square aspect ratio, focusing on the salient contents:
Choose the target aspect ratio:
Choose the target image size:
"CentralityWeight" can be a value between -4 and 4. It changes the priority of placing the most salient features in the center of the image. If there are two salient points in the image, a high "CentralityWeight" will prefer to center on the most important. A low "CentralityWeight" will try to get both features in the output image:
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License