public class MotionWienerFilterOptions extends DeconvolutionFilterOptions
Deconvolution filter options deblur motion
The following example applies various types of filters to a raster image.
String dir = "c:\\temp\\"; com.aspose.imaging.Image image = com.aspose.imaging.Image.load(dir + "sample.png"); try { com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image; // Apply a median filter with a rectangle size of 5 to the entire image. rasterImage.filter(rasterImage.getBounds(), new com.aspose.imaging.imagefilters.filteroptions.MedianFilterOptions(5)); rasterImage.save(dir + "sample.MedianFilter.png"); } finally { image.dispose(); } image = com.aspose.imaging.Image.load(dir + "sample.png"); try { com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image; // Apply a bilateral smoothing filter with a kernel size of 5 to the entire image. rasterImage.filter(rasterImage.getBounds(), new com.aspose.imaging.imagefilters.filteroptions.BilateralSmoothingFilterOptions(5)); rasterImage.save(dir + "sample.BilateralSmoothingFilter.png"); } finally { image.dispose(); } image = com.aspose.imaging.Image.load(dir + "sample.png"); try { com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image; // Apply a Gaussian blur filter with a radius of 5 and a sigma value of 4.0 to the entire image. rasterImage.filter(rasterImage.getBounds(), new com.aspose.imaging.imagefilters.filteroptions.GaussianBlurFilterOptions(5, 4.0)); rasterImage.save(dir + "sample.GaussianBlurFilter.png"); } finally { image.dispose(); } image = com.aspose.imaging.Image.load(dir + "sample.png"); try { com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image; // Apply a Gauss-Wiener filter with a radius of 5 and a smooth value of 4.0 to the entire image. rasterImage.filter(rasterImage.getBounds(), new com.aspose.imaging.imagefilters.filteroptions.GaussWienerFilterOptions(5, 4.0)); rasterImage.save(dir + "sample.GaussWienerFilter.png"); } finally { image.dispose(); } image = com.aspose.imaging.Image.load(dir + "sample.png"); try { com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image; // Apply a motion wiener filter with a length of 5, a smooth value of 4.0 and an angle of 90.0 degrees to the entire image. rasterImage.filter(rasterImage.getBounds(), new com.aspose.imaging.imagefilters.filteroptions.MotionWienerFilterOptions(10, 1.0, 90.0)); rasterImage.save(dir + "sample.MotionWienerFilter.png"); } finally { image.dispose(); } image = com.aspose.imaging.Image.load(dir + "sample.png"); try { com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image; // Apply a sharpen filter with a kernel size of 5 and a sigma value of 4.0 to the entire image. rasterImage.filter(rasterImage.getBounds(), new com.aspose.imaging.imagefilters.filteroptions.SharpenFilterOptions(5, 4.0)); rasterImage.save(dir + "sample.SharpenFilter.png"); } finally { image.dispose(); }
Constructor and Description |
---|
MotionWienerFilterOptions(int length,
double smooth,
double angle)
Initializes a new instance of the
MotionWienerFilterOptions class. |
Modifier and Type | Method and Description |
---|---|
double |
getAngle()
Gets or sets the angle in gradus.
|
int |
getLength()
Gets or sets the length.
|
double |
getSmooth()
Gets or sets the smooth.
|
void |
setAngle(double value)
Gets or sets the angle in gradus.
|
void |
setLength(int value)
Gets or sets the length.
|
void |
setSmooth(double value)
Gets or sets the smooth.
|
getBrightness, getGrayscale, getSnr, isPartialLoaded, setBrightness, setGrayscale, setSnr
public MotionWienerFilterOptions(int length, double smooth, double angle)
Initializes a new instance of the MotionWienerFilterOptions
class.
length
- The length.smooth
- The smooth.angle
- The angle in gradus.public int getLength()
Gets or sets the length.
Value: The length.public void setLength(int value)
Gets or sets the length.
Value: The length.public double getSmooth()
Gets or sets the smooth.
Value: The smooth.public void setSmooth(double value)
Gets or sets the smooth.
Value: The smooth.public double getAngle()
Gets or sets the angle in gradus.
Value: The angle.public void setAngle(double value)
Gets or sets the angle in gradus.
Value: The angle.